@configura/web-ui 2.0.0-alpha.1 → 2.0.0-alpha.12
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/components/productConfiguration/CfgCheckboxView.d.ts +0 -2
- package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +0 -2
- package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +0 -2
- package/dist/components/productConfiguration/CfgDropdownView.d.ts +0 -2
- package/dist/components/productConfiguration/CfgFeatureView.d.ts +1 -5
- package/dist/components/productConfiguration/CfgFeatureView.js +20 -24
- package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/useCatParams.d.ts +18 -0
- package/dist/useCatParams.js +29 -0
- package/package.json +3 -3
|
@@ -3,8 +3,6 @@ import { CssProps } from "../../utilities.js";
|
|
|
3
3
|
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
4
4
|
export declare const CfgCheckboxView: React.FC<CfgOptionViewProps & CssProps>;
|
|
5
5
|
export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & import("./CfgFeatureView.js").CfgProductConfigurationComponent & {
|
|
6
|
-
startOpen?: boolean | undefined;
|
|
7
|
-
} & {
|
|
8
6
|
option: import("@configura/web-api").CfgOption;
|
|
9
7
|
} & CssProps>;
|
|
10
8
|
//# sourceMappingURL=CfgCheckboxView.d.ts.map
|
|
@@ -3,8 +3,6 @@ import { CssProps } from "../../utilities.js";
|
|
|
3
3
|
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
4
|
export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
5
|
export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & import("./CfgFeatureView.js").CfgProductConfigurationComponent & {
|
|
6
|
-
startOpen?: boolean | undefined;
|
|
7
|
-
} & {
|
|
8
6
|
feature: import("@configura/web-api").CfgFeature;
|
|
9
7
|
} & CssProps>;
|
|
10
8
|
//# sourceMappingURL=CfgCheckboxesView.d.ts.map
|
|
@@ -3,8 +3,6 @@ import { CssProps } from "../../utilities.js";
|
|
|
3
3
|
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
4
4
|
export declare const CfgDropdownOptionView: React.FC<CfgOptionViewProps & CssProps>;
|
|
5
5
|
export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & import("./CfgFeatureView.js").CfgProductConfigurationComponent & {
|
|
6
|
-
startOpen?: boolean | undefined;
|
|
7
|
-
} & {
|
|
8
6
|
option: import("@configura/web-api").CfgOption;
|
|
9
7
|
} & CssProps>;
|
|
10
8
|
//# sourceMappingURL=CfgDropdownOptionView.d.ts.map
|
|
@@ -3,8 +3,6 @@ import { CssProps } from "../../utilities.js";
|
|
|
3
3
|
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
4
|
export declare const CfgDropdownView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
5
|
export declare const CfgDropdownViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & import("./CfgFeatureView.js").CfgProductConfigurationComponent & {
|
|
6
|
-
startOpen?: boolean | undefined;
|
|
7
|
-
} & {
|
|
8
6
|
feature: import("@configura/web-api").CfgFeature;
|
|
9
7
|
} & CssProps>;
|
|
10
8
|
//# sourceMappingURL=CfgDropdownView.d.ts.map
|
|
@@ -23,14 +23,10 @@ export declare type CfgProductConfigurationComponent = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare const completeWithDefaultProductConfigurationComponents: <T>(incomplete: T & Partial<CfgProductConfigurationComponent>) => T & CfgProductConfigurationComponent;
|
|
25
25
|
export declare const useCompleteWithDefaultProductConfigurationComponents: (incomplete: Partial<CfgProductConfigurationComponent>) => CfgProductConfigurationComponent;
|
|
26
|
-
export declare type CfgProductConfigurationComponentAndPassthroughProps = PassthroughProps & CfgProductConfigurationComponent
|
|
27
|
-
startOpen?: boolean;
|
|
28
|
-
};
|
|
26
|
+
export declare type CfgProductConfigurationComponentAndPassthroughProps = PassthroughProps & CfgProductConfigurationComponent;
|
|
29
27
|
export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
|
|
30
28
|
export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
31
29
|
export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & CfgProductConfigurationComponent & {
|
|
32
|
-
startOpen?: boolean | undefined;
|
|
33
|
-
} & {
|
|
34
30
|
feature: CfgFeature;
|
|
35
31
|
} & CssProps>;
|
|
36
32
|
//# sourceMappingURL=CfgFeatureView.d.ts.map
|
|
@@ -12,17 +12,15 @@ export const completeWithDefaultProductConfigurationComponents = (incomplete) =>
|
|
|
12
12
|
};
|
|
13
13
|
export const useCompleteWithDefaultProductConfigurationComponents = (incomplete) => {
|
|
14
14
|
const { additionalProductComponent, featureFlattenComponent, featureGroupComponent, featureSelectManyComponent, featureSelectOneComponent, optionSelectManyComponent, optionSelectOneComponent, } = incomplete;
|
|
15
|
-
return useMemo(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
}, [
|
|
15
|
+
return useMemo(() => completeWithDefaultProductConfigurationComponents({
|
|
16
|
+
additionalProductComponent,
|
|
17
|
+
featureFlattenComponent,
|
|
18
|
+
featureGroupComponent,
|
|
19
|
+
featureSelectManyComponent,
|
|
20
|
+
featureSelectOneComponent,
|
|
21
|
+
optionSelectManyComponent,
|
|
22
|
+
optionSelectOneComponent,
|
|
23
|
+
}), [
|
|
26
24
|
additionalProductComponent,
|
|
27
25
|
featureFlattenComponent,
|
|
28
26
|
featureGroupComponent,
|
|
@@ -32,19 +30,17 @@ export const useCompleteWithDefaultProductConfigurationComponents = (incomplete)
|
|
|
32
30
|
optionSelectOneComponent,
|
|
33
31
|
]);
|
|
34
32
|
};
|
|
35
|
-
export const forwardProps = (props) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
};
|
|
33
|
+
export const forwardProps = (props) => ({
|
|
34
|
+
upchargeDisplayMode: props.upchargeDisplayMode,
|
|
35
|
+
startOpen: props.startOpen,
|
|
36
|
+
additionalProductComponent: props.additionalProductComponent,
|
|
37
|
+
featureFlattenComponent: props.featureFlattenComponent,
|
|
38
|
+
featureGroupComponent: props.featureGroupComponent,
|
|
39
|
+
featureSelectManyComponent: props.featureSelectManyComponent,
|
|
40
|
+
optionSelectManyComponent: props.optionSelectManyComponent,
|
|
41
|
+
featureSelectOneComponent: props.featureSelectOneComponent,
|
|
42
|
+
optionSelectOneComponent: props.optionSelectOneComponent,
|
|
43
|
+
});
|
|
48
44
|
export const CfgFeatureView = (props) => {
|
|
49
45
|
const { feature, featureFlattenComponent: FlattenComponent, featureGroupComponent: GroupComponent, featureSelectManyComponent: SelectManyComponent, featureSelectOneComponent: SelectOneComponent, } = props;
|
|
50
46
|
if (!feature.visible) {
|
|
@@ -7,8 +7,13 @@ export declare enum UpchargeDisplayMode {
|
|
|
7
7
|
None = 1,
|
|
8
8
|
Price = 2
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* @param upchargeDisplayMode How upcharge on Options is displayed
|
|
12
|
+
* @param startOpen Setting this to true will make all selected options be expanded from start. This is bad for performance when viewing large products.
|
|
13
|
+
*/
|
|
10
14
|
export declare type PassthroughProps = {
|
|
11
15
|
upchargeDisplayMode?: UpchargeDisplayMode;
|
|
16
|
+
startOpen?: boolean;
|
|
12
17
|
};
|
|
13
18
|
export declare type CfgProductConfigurationViewProps = PassthroughProps & Partial<CfgProductConfigurationComponent> & CssProps & {
|
|
14
19
|
productOrConfiguration: CfgProductConfiguration | CfgProduct;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./components/productConfiguration/CfgProductConfigurationView.js"
|
|
|
17
17
|
export * from "./components/ProductInformation.js";
|
|
18
18
|
export * from "./components/TaskListView.js";
|
|
19
19
|
export * from "./components/TaskStartView.js";
|
|
20
|
+
export * from "./useCatParams.js";
|
|
20
21
|
export * from "./useObservable.js";
|
|
21
22
|
export * from "./useRerender.js";
|
|
22
23
|
export * from "./useResize.js";
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./components/productConfiguration/CfgProductConfigurationView.js"
|
|
|
17
17
|
export * from "./components/ProductInformation.js";
|
|
18
18
|
export * from "./components/TaskListView.js";
|
|
19
19
|
export * from "./components/TaskStartView.js";
|
|
20
|
+
export * from "./useCatParams.js";
|
|
20
21
|
export * from "./useObservable.js";
|
|
21
22
|
export * from "./useRerender.js";
|
|
22
23
|
export * from "./useResize.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DtoCatalogueParams, DtoCatalogueParamsWithLang, DtoProductParams, DtoProductParamsWithLang } from "@configura/web-api";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a memozied version of the catParams
|
|
4
|
+
*/
|
|
5
|
+
export declare function useMemoCatalogueParams(catParams: DtoCatalogueParams): DtoCatalogueParams;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a memozied version of the catParams
|
|
8
|
+
*/
|
|
9
|
+
export declare function useMemoCatalogueParamsWithLang(catParams: DtoCatalogueParamsWithLang): DtoCatalogueParamsWithLang;
|
|
10
|
+
/**
|
|
11
|
+
* Returns a memozied version of the prodParams
|
|
12
|
+
*/
|
|
13
|
+
export declare function useMemoProductParams(prodParams: DtoProductParams): DtoProductParams;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a memozied version of the prodParams
|
|
16
|
+
*/
|
|
17
|
+
export declare function useMemoProductParamsWithLang(prodParams: DtoProductParamsWithLang): DtoProductParamsWithLang;
|
|
18
|
+
//# sourceMappingURL=useCatParams.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a memozied version of the catParams
|
|
4
|
+
*/
|
|
5
|
+
export function useMemoCatalogueParams(catParams) {
|
|
6
|
+
const { cid, enterprise, prdCat, prdCatVersion, vendor, priceList } = catParams;
|
|
7
|
+
return useMemo(() => ({ cid, enterprise, prdCat, prdCatVersion, vendor, priceList }), [cid, enterprise, prdCat, prdCatVersion, priceList, vendor]);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns a memozied version of the catParams
|
|
11
|
+
*/
|
|
12
|
+
export function useMemoCatalogueParamsWithLang(catParams) {
|
|
13
|
+
const { lang, cid, enterprise, prdCat, prdCatVersion, vendor, priceList } = catParams;
|
|
14
|
+
return useMemo(() => ({ lang, cid, enterprise, prdCat, prdCatVersion, vendor, priceList }), [lang, cid, enterprise, prdCat, prdCatVersion, priceList, vendor]);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns a memozied version of the prodParams
|
|
18
|
+
*/
|
|
19
|
+
export function useMemoProductParams(prodParams) {
|
|
20
|
+
const { cid, enterprise, prdCat, prdCatVersion, vendor, priceList, partNumber } = prodParams;
|
|
21
|
+
return useMemo(() => ({ cid, enterprise, prdCat, prdCatVersion, vendor, priceList, partNumber }), [cid, enterprise, prdCat, prdCatVersion, priceList, vendor, partNumber]);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns a memozied version of the prodParams
|
|
25
|
+
*/
|
|
26
|
+
export function useMemoProductParamsWithLang(prodParams) {
|
|
27
|
+
const { lang, cid, enterprise, prdCat, prdCatVersion, vendor, priceList, partNumber } = prodParams;
|
|
28
|
+
return useMemo(() => ({ lang, cid, enterprise, prdCat, prdCatVersion, vendor, priceList, partNumber }), [lang, cid, enterprise, prdCat, prdCatVersion, priceList, vendor, partNumber]);
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configura/web-ui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@configura/web-api": "2.0.0-alpha.
|
|
35
|
+
"@configura/web-api": "2.0.0-alpha.12"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@babel/preset-env": "^7.14.4",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "82ffe4d0ec20d169b4e7ddb94b8207b6aa7d62a2"
|
|
68
68
|
}
|