@configura/web-ui 1.6.1-alpha.2 → 1.6.1-alpha.7
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/.postcssrc.json +8 -8
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/components/CanvasWrapper.d.ts +9 -9
- package/dist/components/CanvasWrapper.js +8 -8
- package/dist/components/CfgPriceView.d.ts +6 -6
- package/dist/components/CfgPriceView.js +13 -13
- package/dist/components/ConfigurationActionsButtonRow.d.ts +11 -11
- package/dist/components/ConfigurationActionsButtonRow.js +13 -13
- package/dist/components/Configurator.d.ts +12 -12
- package/dist/components/Configurator.js +15 -15
- package/dist/components/ConfiguratorWrapper.d.ts +8 -8
- package/dist/components/ConfiguratorWrapper.js +5 -5
- package/dist/components/CurrencyPrice.d.ts +9 -9
- package/dist/components/CurrencyPrice.js +7 -7
- package/dist/components/ExpandableHeadingRow.d.ts +15 -15
- package/dist/components/ExpandableHeadingRow.js +21 -21
- package/dist/components/Loading.d.ts +13 -13
- package/dist/components/Loading.js +20 -20
- package/dist/components/ProductInformation.d.ts +13 -13
- package/dist/components/ProductInformation.js +14 -14
- package/dist/components/TaskListView.d.ts +8 -8
- package/dist/components/TaskListView.js +54 -69
- package/dist/components/TaskStartView.d.ts +12 -12
- package/dist/components/TaskStartView.js +22 -29
- package/dist/components/icons/Checkmark.d.ts +6 -6
- package/dist/components/icons/Checkmark.js +12 -12
- package/dist/components/icons/Chevron.d.ts +7 -7
- package/dist/components/icons/Chevron.js +18 -18
- package/dist/components/icons/CircleXmarkIcon.d.ts +3 -3
- package/dist/components/icons/CircleXmarkIcon.js +8 -8
- package/dist/components/icons/DownloadIcon.d.ts +3 -3
- package/dist/components/icons/DownloadIcon.js +8 -8
- package/dist/components/icons/ErrorIcon.d.ts +3 -3
- package/dist/components/icons/ErrorIcon.js +8 -8
- package/dist/components/productConfiguration/CfgAdditionalProductView.d.ts +3 -3
- package/dist/components/productConfiguration/CfgAdditionalProductView.js +38 -43
- package/dist/components/productConfiguration/CfgCheckboxView.d.ts +16 -20
- package/dist/components/productConfiguration/CfgCheckboxView.js +22 -29
- package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +16 -14
- package/dist/components/productConfiguration/CfgCheckboxesView.js +20 -19
- package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +16 -20
- package/dist/components/productConfiguration/CfgDropdownOptionView.js +36 -44
- package/dist/components/productConfiguration/CfgDropdownView.d.ts +16 -14
- package/dist/components/productConfiguration/CfgDropdownView.js +22 -21
- package/dist/components/productConfiguration/CfgFeatureView.d.ts +38 -31
- package/dist/components/productConfiguration/CfgFeatureView.js +40 -37
- package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgGroupView.js +7 -7
- package/dist/components/productConfiguration/CfgOptionFeaturesView.d.ts +3 -6
- package/dist/components/productConfiguration/CfgOptionFeaturesView.js +13 -13
- package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +29 -27
- package/dist/components/productConfiguration/CfgOptionNumericView.js +125 -132
- package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
- package/dist/components/productConfiguration/CfgOptionPriceView.js +29 -29
- package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +18 -18
- package/dist/components/productConfiguration/CfgProductConfigurationView.js +46 -46
- package/dist/css/web-ui.css.map +1 -1
- package/dist/index.d.ts +22 -23
- package/dist/index.js +22 -23
- package/dist/scss/_button.scss +36 -36
- package/dist/scss/_configurator.scss +88 -88
- package/dist/scss/_expandable.scss +37 -37
- package/dist/scss/_feature-item.scss +137 -137
- package/dist/scss/_forms.scss +42 -42
- package/dist/scss/_hr.scss +16 -16
- package/dist/scss/_loading.scss +98 -98
- package/dist/scss/_mixins.scss +56 -56
- package/dist/scss/_option-tree.scss +29 -29
- package/dist/scss/_product-information.scss +49 -49
- package/dist/scss/_range-view.scss +39 -39
- package/dist/scss/_slider.scss +70 -70
- package/dist/scss/_tasks.scss +72 -72
- package/dist/scss/_themed.scss +147 -147
- package/dist/scss/_utilities.scss +21 -21
- package/dist/scss/_variables.scss +6 -6
- package/dist/scss/icons/_checkmark.scss +46 -46
- package/dist/scss/icons/_chevron.scss +62 -62
- package/dist/scss/icons/_circle-xmark-icon.scss +24 -24
- package/dist/scss/icons/_download-icon.scss +24 -24
- package/dist/scss/icons/_error-icon.scss +24 -24
- package/dist/scss/web-ui.scss +11 -11
- package/dist/useObservable.d.ts +4 -4
- package/dist/useObservable.js +18 -18
- package/dist/useRerender.d.ts +1 -1
- package/dist/useRerender.js +5 -5
- package/dist/useResize.d.ts +6 -6
- package/dist/useResize.js +47 -47
- package/dist/useSelected.d.ts +2 -2
- package/dist/useSelected.js +13 -13
- package/dist/useUniqueId.d.ts +1 -1
- package/dist/useUniqueId.js +7 -7
- package/dist/utilities.d.ts +5 -5
- package/dist/utilities.js +1 -1
- package/package.json +3 -3
- package/dist/components/ErrorContext.d.ts +0 -3
- package/dist/components/ErrorContext.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const CircleXmarkIcon = (props) => {
|
|
3
|
-
return (React.createElement("span", { className: `cfgCircleXmarkIcon ${props.className || ""}`, style: props.style },
|
|
4
|
-
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
-
React.createElement("path", { d: "M6 6L10 10" }),
|
|
6
|
-
React.createElement("path", { d: "M6 10L10 6" }),
|
|
7
|
-
React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
|
|
8
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const CircleXmarkIcon = (props) => {
|
|
3
|
+
return (React.createElement("span", { className: `cfgCircleXmarkIcon ${props.className || ""}`, style: props.style },
|
|
4
|
+
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
+
React.createElement("path", { d: "M6 6L10 10" }),
|
|
6
|
+
React.createElement("path", { d: "M6 10L10 6" }),
|
|
7
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
|
|
8
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities";
|
|
3
|
-
export declare const DownloadIcon: React.FC<CssProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities";
|
|
3
|
+
export declare const DownloadIcon: React.FC<CssProps>;
|
|
4
4
|
//# sourceMappingURL=DownloadIcon.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const DownloadIcon = (props) => {
|
|
3
|
-
return (React.createElement("span", { className: `cfgDownloadIcon ${props.className || ""}`, style: props.style },
|
|
4
|
-
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
-
React.createElement("path", { d: "M1.5 11.5V14.5H14.5V11.5" }),
|
|
6
|
-
React.createElement("path", { d: "M8 1V11" }),
|
|
7
|
-
React.createElement("path", { d: "M5 9L8 12L11 9" }))));
|
|
8
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const DownloadIcon = (props) => {
|
|
3
|
+
return (React.createElement("span", { className: `cfgDownloadIcon ${props.className || ""}`, style: props.style },
|
|
4
|
+
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
+
React.createElement("path", { d: "M1.5 11.5V14.5H14.5V11.5" }),
|
|
6
|
+
React.createElement("path", { d: "M8 1V11" }),
|
|
7
|
+
React.createElement("path", { d: "M5 9L8 12L11 9" }))));
|
|
8
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities";
|
|
3
|
-
export declare const ErrorIcon: React.FC<CssProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities";
|
|
3
|
+
export declare const ErrorIcon: React.FC<CssProps>;
|
|
4
4
|
//# sourceMappingURL=ErrorIcon.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const ErrorIcon = (props) => {
|
|
3
|
-
return (React.createElement("span", { className: `cfgErrorIcon ${props.className || ""}`, style: props.style },
|
|
4
|
-
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
-
React.createElement("path", { d: "M8 11L8 11.5" }),
|
|
6
|
-
React.createElement("path", { d: "M8 8.5L8 4.5" }),
|
|
7
|
-
React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
|
|
8
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const ErrorIcon = (props) => {
|
|
3
|
+
return (React.createElement("span", { className: `cfgErrorIcon ${props.className || ""}`, style: props.style },
|
|
4
|
+
React.createElement("svg", { preserveAspectRatio: "xMidYMid", width: "100%", height: "100%", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
|
+
React.createElement("path", { d: "M8 11L8 11.5" }),
|
|
6
|
+
React.createElement("path", { d: "M8 8.5L8 4.5" }),
|
|
7
|
+
React.createElement("circle", { cx: "8", cy: "8", r: "7.25" }))));
|
|
8
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgAdditionalProductViewProps } from "./CfgFeatureView.js";
|
|
3
|
-
export declare const CfgAdditionalProductView: React.FC<CfgAdditionalProductViewProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgAdditionalProductViewProps } from "./CfgFeatureView.js";
|
|
3
|
+
export declare const CfgAdditionalProductView: React.FC<CfgAdditionalProductViewProps>;
|
|
4
4
|
//# sourceMappingURL=CfgAdditionalProductView.d.ts.map
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
React.createElement("
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
const AdditionalProductsView = (props) => {
|
|
40
|
-
const { additionalProducts, permanentlyExpandedLevels, additionalProductComponent } = props;
|
|
41
|
-
const AdditionalProductComponent = additionalProductComponent !== null && additionalProductComponent !== void 0 ? additionalProductComponent : CfgAdditionalProductView;
|
|
42
|
-
return (React.createElement(React.Fragment, null, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({ key: additionalProduct.key }, forwardProps(props), { product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 }))))));
|
|
43
|
-
};
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableHeadingRow.js";
|
|
3
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
4
|
+
import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
|
|
5
|
+
export const CfgAdditionalProductView = React.memo((props) => {
|
|
6
|
+
const { product, permanentlyExpandedLevels, additionalProductComponent } = props;
|
|
7
|
+
const { partNumber, optional, selected, configuration, additionalProducts, preview, description, visible: configurationVisible, } = product;
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
if (!configurationVisible) {
|
|
10
|
+
// Visibility of a Product should not affect its Additional Products.
|
|
11
|
+
// (Those have their own visibility.)
|
|
12
|
+
return (React.createElement(AdditionalProductsView, { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels, additionalProductComponent: additionalProductComponent }));
|
|
13
|
+
}
|
|
14
|
+
const openOrSelected = optional ? selected : open;
|
|
15
|
+
const hasChildren = configuration.features.length !== 0 || additionalProducts.length !== 0;
|
|
16
|
+
return (React.createElement("li", { className: "cfgFeatureItem cfgAdditionalProduct" },
|
|
17
|
+
React.createElement(ExpandableHeadingRow, { heading: description || partNumber, expandable: optional || (hasChildren && permanentlyExpandedLevels <= 0), open: openOrSelected, onClick: () => {
|
|
18
|
+
if (optional) {
|
|
19
|
+
product.setSelected(!selected);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
setOpen((prev) => !prev);
|
|
23
|
+
}
|
|
24
|
+
}, symbol: optional ? ExpandableHeadingRowSymbol.Checkbox : undefined }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
|
|
25
|
+
React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
|
|
26
|
+
hasChildren &&
|
|
27
|
+
(!optional || selected) &&
|
|
28
|
+
(openOrSelected || 0 < permanentlyExpandedLevels) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
29
|
+
React.createElement(CfgProductConfigurationView, Object.assign({}, forwardProps(props), { productOrConfiguration: configuration })),
|
|
30
|
+
additionalProducts.length !== 0 && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--topLevel` },
|
|
31
|
+
React.createElement(AdditionalProductsView, { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels, additionalProductComponent: additionalProductComponent }))))),
|
|
32
|
+
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })));
|
|
33
|
+
});
|
|
34
|
+
const AdditionalProductsView = (props) => {
|
|
35
|
+
const { additionalProducts, permanentlyExpandedLevels, additionalProductComponent } = props;
|
|
36
|
+
const AdditionalProductComponent = additionalProductComponent !== null && additionalProductComponent !== void 0 ? additionalProductComponent : CfgAdditionalProductView;
|
|
37
|
+
return (React.createElement(React.Fragment, null, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({ key: additionalProduct.key }, forwardProps(props), { product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 }))))));
|
|
38
|
+
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
18
|
-
featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
19
|
-
} & CssProps>;
|
|
20
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities.js";
|
|
3
|
+
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
4
|
+
export declare const CfgCheckboxView: React.FC<CfgOptionViewProps & CssProps>;
|
|
5
|
+
export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
+
additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
|
|
7
|
+
featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
8
|
+
optionFlattenComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
9
|
+
featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
10
|
+
featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
11
|
+
optionSelectManyComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
12
|
+
featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
13
|
+
optionSelectOneComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
option: import("@configura/web-api").CfgOption;
|
|
16
|
+
} & CssProps>;
|
|
21
17
|
//# sourceMappingURL=CfgCheckboxView.d.ts.map
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { useUuid } from "../../useUniqueId.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.createElement("
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
React.createElement("div", { className: "cfgFeatureItemOptional__titleWrapper" },
|
|
24
|
-
React.createElement("div", { className: "cfgFeatureItemOptional__title" },
|
|
25
|
-
description || code,
|
|
26
|
-
React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
|
|
27
|
-
React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
|
|
28
|
-
};
|
|
29
|
-
export const CfgCheckboxViewMemo = React.memo(CfgCheckboxView);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useUuid } from "../../useUniqueId.js";
|
|
3
|
+
import { Checkmark } from "../icons/Checkmark.js";
|
|
4
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
+
import { CfgOptionFeaturesView } from "./CfgOptionFeaturesView.js";
|
|
6
|
+
import { CfgOptionPriceView } from "./CfgOptionPriceView.js";
|
|
7
|
+
export const CfgCheckboxView = (props) => {
|
|
8
|
+
const { option, upchargeDisplayMode } = props;
|
|
9
|
+
const { thumbnail, description, selected, code } = option;
|
|
10
|
+
const uniqueId = useUuid();
|
|
11
|
+
return (React.createElement("li", { className: props.className, style: props.style },
|
|
12
|
+
React.createElement("label", { className: "cfgFeatureItemOptional", htmlFor: uniqueId },
|
|
13
|
+
React.createElement("input", { checked: selected, className: "cfgFeatureItem__hiddenInput", id: uniqueId, name: uniqueId, onChange: () => option.setSelected(!selected), type: "checkbox" }),
|
|
14
|
+
React.createElement("div", { className: "cfgFeatureItem__checkbox" }, selected && React.createElement(Checkmark, null)),
|
|
15
|
+
thumbnail && (React.createElement("img", { alt: `Thumbnail for ${description}`, className: "cfgThumbnailImage cfgMl1", src: thumbnail })),
|
|
16
|
+
React.createElement("div", { className: "cfgFeatureItemOptional__titleWrapper" },
|
|
17
|
+
React.createElement("div", { className: "cfgFeatureItemOptional__title" },
|
|
18
|
+
description || code,
|
|
19
|
+
React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
|
|
20
|
+
React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
|
|
21
|
+
};
|
|
22
|
+
export const CfgCheckboxViewMemo = React.memo(CfgCheckboxView);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities.js";
|
|
3
|
-
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
|
-
export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
|
-
export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
10
|
-
featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} &
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities.js";
|
|
3
|
+
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
|
+
export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
|
+
export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
+
additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
|
|
7
|
+
featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
8
|
+
optionFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
9
|
+
featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
10
|
+
featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
11
|
+
optionSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
12
|
+
featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
13
|
+
optionSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
feature: import("@configura/web-api").CfgFeature;
|
|
16
|
+
} & CssProps>;
|
|
15
17
|
//# sourceMappingURL=CfgCheckboxesView.d.ts.map
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { SelectionType } from "@configura/web-api";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { CfgCheckboxViewMemo } from "./CfgCheckboxView.js";
|
|
4
|
-
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
-
export const CfgCheckboxesView = (props) => {
|
|
6
|
-
var _a;
|
|
7
|
-
const { feature } = props;
|
|
8
|
-
if (feature.selectionType !== SelectionType.SelectMany) {
|
|
9
|
-
throw Error(`Unsupported selection type expected: ${SelectionType.SelectMany}, got: ${feature.selectionType}`);
|
|
10
|
-
}
|
|
11
|
-
const { options, description } = feature;
|
|
12
|
-
if (options.length === 0) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
React.createElement("
|
|
18
|
-
};
|
|
19
|
-
|
|
1
|
+
import { SelectionType } from "@configura/web-api";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CfgCheckboxViewMemo } from "./CfgCheckboxView.js";
|
|
4
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
+
export const CfgCheckboxesView = (props) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const { feature } = props;
|
|
8
|
+
if (feature.selectionType !== SelectionType.SelectMany) {
|
|
9
|
+
throw Error(`Unsupported selection type expected: ${SelectionType.SelectMany}, got: ${feature.selectionType}`);
|
|
10
|
+
}
|
|
11
|
+
const { options, description } = feature;
|
|
12
|
+
if (options.length === 0) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const OptionComponent = (_a = props.optionSelectManyComponent) !== null && _a !== void 0 ? _a : CfgCheckboxViewMemo;
|
|
16
|
+
return (React.createElement("li", { className: `cfgFeatureItem cfgFeatureItem--optional ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
|
|
17
|
+
React.createElement("h3", { className: "cfgFeatureItemOptional__header" }, description),
|
|
18
|
+
React.createElement("ul", { className: "cfgOptionTree" }, options.map((option) => (React.createElement(OptionComponent, Object.assign({ option: option, key: option.key }, forwardProps(props))))))));
|
|
19
|
+
};
|
|
20
|
+
export const CfgCheckboxesViewMemo = React.memo(CfgCheckboxesView);
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
18
|
-
featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
19
|
-
} & CssProps>;
|
|
20
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities.js";
|
|
3
|
+
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
4
|
+
export declare const CfgDropdownOptionView: React.FC<CfgOptionViewProps & CssProps>;
|
|
5
|
+
export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
+
additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
|
|
7
|
+
featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
8
|
+
optionFlattenComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
9
|
+
featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
10
|
+
featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
11
|
+
optionSelectManyComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
12
|
+
featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
|
|
13
|
+
optionSelectOneComponent?: React.ComponentType<CfgOptionViewProps> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
option: import("@configura/web-api").CfgOption;
|
|
16
|
+
} & CssProps>;
|
|
21
17
|
//# sourceMappingURL=CfgDropdownOptionView.d.ts.map
|
|
@@ -1,44 +1,36 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import { useUuid } from "../../useUniqueId.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
React.createElement("div", { className: "cfgFeatureItemOption__titleWrapper" },
|
|
38
|
-
React.createElement("div", { className: "cfgFeatureItemOption__title" },
|
|
39
|
-
description || code,
|
|
40
|
-
React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
|
|
41
|
-
selected && React.createElement(CfgOptionNumericView, { option: option }),
|
|
42
|
-
React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
|
|
43
|
-
};
|
|
44
|
-
export const CfgDropdownOptionViewMemo = React.memo(CfgDropdownOptionView);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useUuid } from "../../useUniqueId.js";
|
|
3
|
+
import { Checkmark } from "../icons/Checkmark.js";
|
|
4
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
+
import { CfgOptionFeaturesView } from "./CfgOptionFeaturesView.js";
|
|
6
|
+
import { CfgOptionNumericView } from "./CfgOptionNumericView.js";
|
|
7
|
+
import { CfgOptionPriceView } from "./CfgOptionPriceView.js";
|
|
8
|
+
export const CfgDropdownOptionView = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { option, upchargeDisplayMode } = props;
|
|
11
|
+
const { code, thumbnail, description, selected } = option;
|
|
12
|
+
const optionClasses = selected ? "cfgFeatureItemOption--checked" : "";
|
|
13
|
+
const uniqueId = useUuid();
|
|
14
|
+
return (React.createElement("li", { className: `cfgFeatureItem cfgMb1 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
15
|
+
React.createElement("label", { className: `cfgFeatureItemOption ${optionClasses}`, htmlFor: uniqueId },
|
|
16
|
+
React.createElement("input", { checked: selected, className: "cfgFeatureItem__hiddenInput", id: uniqueId, name: uniqueId, onChange: () => {
|
|
17
|
+
option.setSelected(true);
|
|
18
|
+
}, onClick: () => {
|
|
19
|
+
// As a convenience for when wanting to re-select something already
|
|
20
|
+
// selected to use the propagation side effects we have added this
|
|
21
|
+
// which will trigger a setSelected even though this is strictly not
|
|
22
|
+
// a change.
|
|
23
|
+
if (selected) {
|
|
24
|
+
option.setSelected(true);
|
|
25
|
+
}
|
|
26
|
+
}, type: "radio", value: code }),
|
|
27
|
+
React.createElement("div", { className: "cfgFeatureItem__radio" }, selected && React.createElement(Checkmark, null)),
|
|
28
|
+
thumbnail && (React.createElement("img", { alt: `Thumbnail for ${description}`, className: "cfgThumbnailImage cfgMl1", src: thumbnail })),
|
|
29
|
+
React.createElement("div", { className: "cfgFeatureItemOption__titleWrapper" },
|
|
30
|
+
React.createElement("div", { className: "cfgFeatureItemOption__title" },
|
|
31
|
+
description || code,
|
|
32
|
+
React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
|
|
33
|
+
selected && React.createElement(CfgOptionNumericView, { option: option }),
|
|
34
|
+
React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
|
|
35
|
+
};
|
|
36
|
+
export const CfgDropdownOptionViewMemo = React.memo(CfgDropdownOptionView);
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities.js";
|
|
3
|
-
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
|
-
export declare const CfgDropdownView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
|
-
export declare const CfgDropdownViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
10
|
-
featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} &
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities.js";
|
|
3
|
+
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
4
|
+
export declare const CfgDropdownView: React.FC<CfgFeatureViewProps & CssProps>;
|
|
5
|
+
export declare const CfgDropdownViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
|
|
6
|
+
additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
|
|
7
|
+
featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
8
|
+
optionFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
9
|
+
featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
10
|
+
featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
11
|
+
optionSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
12
|
+
featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
|
|
13
|
+
optionSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgOptionViewProps> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
feature: import("@configura/web-api").CfgFeature;
|
|
16
|
+
} & CssProps>;
|
|
15
17
|
//# sourceMappingURL=CfgDropdownView.d.ts.map
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { SelectionType } from "@configura/web-api";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { ExpandableHeadingRow } from "../ExpandableHeadingRow.js";
|
|
4
|
-
import { CfgDropdownOptionViewMemo } from "./CfgDropdownOptionView.js";
|
|
5
|
-
import { forwardProps } from "./CfgFeatureView.js";
|
|
6
|
-
export const CfgDropdownView = (props) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const { feature
|
|
9
|
-
if (feature.selectionType !== SelectionType.SelectOne) {
|
|
10
|
-
throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
|
|
11
|
-
}
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
React.createElement("
|
|
20
|
-
};
|
|
21
|
-
|
|
1
|
+
import { SelectionType } from "@configura/web-api";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { ExpandableHeadingRow } from "../ExpandableHeadingRow.js";
|
|
4
|
+
import { CfgDropdownOptionViewMemo } from "./CfgDropdownOptionView.js";
|
|
5
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
6
|
+
export const CfgDropdownView = (props) => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const { feature } = props;
|
|
9
|
+
if (feature.selectionType !== SelectionType.SelectOne) {
|
|
10
|
+
throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
|
|
11
|
+
}
|
|
12
|
+
const OptionComponent = (_a = props.optionSelectOneComponent) !== null && _a !== void 0 ? _a : CfgDropdownOptionViewMemo;
|
|
13
|
+
const { description, preview, options } = feature;
|
|
14
|
+
const [open, setOpen] = useState(false);
|
|
15
|
+
return (React.createElement("li", { className: `cfgFeatureItem ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
|
|
16
|
+
React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
|
|
17
|
+
React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
|
|
18
|
+
React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
19
|
+
open && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--subLevel ${preview ? "cfgOptionTree--compThumb" : ""}` }, options.map((option) => (React.createElement(OptionComponent, Object.assign({ key: option.key, option: option }, forwardProps(props))))))),
|
|
20
|
+
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" }))));
|
|
21
|
+
};
|
|
22
|
+
export const CfgDropdownViewMemo = React.memo(CfgDropdownView);
|