umwd-components 0.1.835 → 0.1.837
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/components/common/module-config/ModuleGuard.js +7 -0
- package/dist/cjs/src/components/e-commerce/opo/OpoDisplay.js +1 -1
- package/dist/cjs/src/components/e-commerce/opo/ShippingStatusIndicator.js +6 -0
- package/dist/cjs/src/data/loaders/e-commerce/getAllOpos.js +1 -1
- package/dist/cjs/src/index.js +1 -1
- package/dist/cjs/src/lib/module-config/config.js +6 -0
- package/dist/cjs/src/lib/module-config/navigation-filter.js +6 -0
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/src/components/common/module-config/ModuleGuard.js +39 -0
- package/dist/esm/src/components/e-commerce/opo/OpoDisplay.js +2 -1
- package/dist/esm/src/components/e-commerce/opo/ShippingStatusIndicator.js +27 -0
- package/dist/esm/src/data/loaders/e-commerce/getAllOpos.js +1 -0
- package/dist/esm/src/index.js +4 -0
- package/dist/esm/src/lib/module-config/config.js +207 -0
- package/dist/esm/src/lib/module-config/navigation-filter.js +58 -0
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/types/components/common/module-config/ModuleGuard.d.ts +22 -0
- package/dist/esm/types/components/e-commerce/opo/ShippingStatusIndicator.d.ts +8 -0
- package/dist/esm/types/index.d.ts +5 -0
- package/dist/esm/types/lib/module-config/config.d.ts +33 -0
- package/dist/esm/types/lib/module-config/navigation-filter.d.ts +10 -0
- package/dist/esm/types/types/e-commerce/opo/types.d.ts +2 -0
- package/dist/esm/types/types/e-commerce/parcelreference/types.d.ts +7 -0
- package/dist/esm/types/types/module-config/types.d.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ModuleName } from "../../../types/module-config/types";
|
|
3
|
+
interface ModuleGuardProps {
|
|
4
|
+
module: ModuleName;
|
|
5
|
+
feature?: string;
|
|
6
|
+
fallback?: React.ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Component that conditionally renders children based on module/feature enablement
|
|
11
|
+
*/
|
|
12
|
+
export declare function ModuleGuard({ module, feature, fallback, children, }: ModuleGuardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
interface ConditionalModuleProps {
|
|
14
|
+
module: ModuleName;
|
|
15
|
+
feature?: string;
|
|
16
|
+
children: (isEnabled: boolean) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Render prop component that provides module/feature status to children
|
|
20
|
+
*/
|
|
21
|
+
export declare function ConditionalModule({ module, feature, children, }: ConditionalModuleProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ShippingStatus } from "../../../types/e-commerce/parcelreference/types";
|
|
3
|
+
interface ShippingStatusIndicatorProps {
|
|
4
|
+
shipping_status: ShippingStatus;
|
|
5
|
+
provider_id?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ShippingStatusIndicator: React.FC<ShippingStatusIndicatorProps>;
|
|
8
|
+
export {};
|
|
@@ -256,3 +256,8 @@ export { getAllMinioReferences as getAllMinioReferences } from "./data/loaders/c
|
|
|
256
256
|
export { MinioItemList as MinioItemList } from "./components/common/media/minio/MinioItemList";
|
|
257
257
|
export { MinioDisplay as MinioDisplay } from "./components/common/media/minio/MinioDisplay";
|
|
258
258
|
export { contactFormAction as contactFormAction } from "./data/actions/e-commerce/lead/contactFormAction";
|
|
259
|
+
export { ShippingStatusIndicator as ShippingStatusIndicator } from "./components/e-commerce/opo/ShippingStatusIndicator";
|
|
260
|
+
export { getModuleConfig, isModuleEnabled, isModuleFeatureEnabled, getFullConfig, getEnabledModules, validateCurrentConfig, clearConfigCache, getConfigFilePath } from "./lib/module-config/config";
|
|
261
|
+
export { filterNavigationByModules } from "./lib/module-config/navigation-filter";
|
|
262
|
+
export { ModuleGuard, ConditionalModule } from "./components/common/module-config/ModuleGuard";
|
|
263
|
+
export type { UMWDConfig, UMWDModuleConfig, ModuleName, ConfigValidationError, ConfigValidationResult } from "./types/module-config/types";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { UMWDConfig, ModuleName, ConfigValidationResult } from "../../types/module-config/types";
|
|
2
|
+
/**
|
|
3
|
+
* Get the configuration for a specific module
|
|
4
|
+
*/
|
|
5
|
+
export declare function getModuleConfig(moduleName: ModuleName): UMWDConfig["modules"][ModuleName];
|
|
6
|
+
/**
|
|
7
|
+
* Check if a specific module is enabled
|
|
8
|
+
*/
|
|
9
|
+
export declare function isModuleEnabled(moduleName: ModuleName): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if a specific feature within a module is enabled
|
|
12
|
+
*/
|
|
13
|
+
export declare function isModuleFeatureEnabled(moduleName: ModuleName, featureName: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Get the full configuration object
|
|
16
|
+
*/
|
|
17
|
+
export declare function getFullConfig(): UMWDConfig;
|
|
18
|
+
/**
|
|
19
|
+
* Get all enabled modules
|
|
20
|
+
*/
|
|
21
|
+
export declare function getEnabledModules(): ModuleName[];
|
|
22
|
+
/**
|
|
23
|
+
* Validate the current configuration without throwing
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateCurrentConfig(): ConfigValidationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Clear the configuration cache (useful for testing or dynamic config reloading)
|
|
28
|
+
*/
|
|
29
|
+
export declare function clearConfigCache(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Get the path to the configuration file (useful for debugging)
|
|
32
|
+
*/
|
|
33
|
+
export declare function getConfigFilePath(): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface NavigationItem {
|
|
2
|
+
href?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
children?: NavigationItem[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Filter navigation items based on enabled modules and features
|
|
8
|
+
*/
|
|
9
|
+
export declare function filterNavigationByModules(navigation: NavigationItem[]): NavigationItem[];
|
|
10
|
+
export {};
|
|
@@ -6,6 +6,7 @@ import { StrapiImageProps } from "../../StrapiImageProps";
|
|
|
6
6
|
import { CustomerLabel } from "../customer/types";
|
|
7
7
|
import { Note } from "../../logistics/Note";
|
|
8
8
|
import { Report, PreReport } from "../../logistics/Report";
|
|
9
|
+
import { Parcelreference } from "../parcelreference/types";
|
|
9
10
|
export interface OpoItem {
|
|
10
11
|
id: number;
|
|
11
12
|
documentId: string;
|
|
@@ -39,6 +40,7 @@ export interface Opo {
|
|
|
39
40
|
delivery_note: {
|
|
40
41
|
name: string;
|
|
41
42
|
};
|
|
43
|
+
parcel_reference?: Parcelreference;
|
|
42
44
|
}
|
|
43
45
|
export interface ManageOpoFormProps {
|
|
44
46
|
opo: Opo;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UMWDModuleConfig {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
features?: Record<string, boolean>;
|
|
4
|
+
}
|
|
5
|
+
export interface UMWDConfig {
|
|
6
|
+
modules: {
|
|
7
|
+
pageBuilder: UMWDModuleConfig;
|
|
8
|
+
ecommerce: UMWDModuleConfig;
|
|
9
|
+
logistics?: UMWDModuleConfig;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export type ModuleName = keyof UMWDConfig["modules"];
|
|
13
|
+
export interface ConfigValidationError {
|
|
14
|
+
field: string;
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ConfigValidationResult {
|
|
18
|
+
isValid: boolean;
|
|
19
|
+
errors: ConfigValidationError[];
|
|
20
|
+
}
|