@configura/web-ui 1.5.0 → 1.6.0-iotest.1

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.
Files changed (95) hide show
  1. package/.postcssrc.json +8 -8
  2. package/LICENSE +201 -201
  3. package/README.md +1 -1
  4. package/dist/components/CanvasWrapper.d.ts +9 -9
  5. package/dist/components/CanvasWrapper.js +8 -8
  6. package/dist/components/CfgPriceView.d.ts +6 -6
  7. package/dist/components/CfgPriceView.js +13 -13
  8. package/dist/components/ConfigurationActionsButtonRow.d.ts +11 -11
  9. package/dist/components/ConfigurationActionsButtonRow.js +13 -13
  10. package/dist/components/Configurator.d.ts +12 -12
  11. package/dist/components/Configurator.js +15 -15
  12. package/dist/components/ConfiguratorWrapper.d.ts +8 -8
  13. package/dist/components/ConfiguratorWrapper.js +5 -5
  14. package/dist/components/CurrencyPrice.d.ts +9 -9
  15. package/dist/components/CurrencyPrice.js +7 -7
  16. package/dist/components/ExpandableHeadingRow.d.ts +15 -15
  17. package/dist/components/ExpandableHeadingRow.js +21 -21
  18. package/dist/components/Loading.d.ts +13 -13
  19. package/dist/components/Loading.js +20 -20
  20. package/dist/components/ProductInformation.d.ts +13 -13
  21. package/dist/components/ProductInformation.js +14 -14
  22. package/dist/components/TaskListView.d.ts +8 -8
  23. package/dist/components/TaskListView.js +54 -54
  24. package/dist/components/TaskStartView.d.ts +12 -12
  25. package/dist/components/TaskStartView.js +22 -22
  26. package/dist/components/icons/Checkmark.d.ts +6 -6
  27. package/dist/components/icons/Checkmark.js +12 -12
  28. package/dist/components/icons/Chevron.d.ts +7 -7
  29. package/dist/components/icons/Chevron.js +18 -18
  30. package/dist/components/icons/CircleXmarkIcon.d.ts +3 -3
  31. package/dist/components/icons/CircleXmarkIcon.js +8 -8
  32. package/dist/components/icons/DownloadIcon.d.ts +3 -3
  33. package/dist/components/icons/DownloadIcon.js +8 -8
  34. package/dist/components/icons/ErrorIcon.d.ts +3 -3
  35. package/dist/components/icons/ErrorIcon.js +8 -8
  36. package/dist/components/productConfiguration/CfgAdditionalProductView.d.ts +3 -3
  37. package/dist/components/productConfiguration/CfgAdditionalProductView.js +38 -38
  38. package/dist/components/productConfiguration/CfgCheckboxView.d.ts +19 -19
  39. package/dist/components/productConfiguration/CfgCheckboxView.js +22 -22
  40. package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +13 -13
  41. package/dist/components/productConfiguration/CfgCheckboxesView.js +19 -19
  42. package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +19 -19
  43. package/dist/components/productConfiguration/CfgDropdownOptionView.js +36 -36
  44. package/dist/components/productConfiguration/CfgDropdownView.d.ts +13 -13
  45. package/dist/components/productConfiguration/CfgDropdownView.js +21 -21
  46. package/dist/components/productConfiguration/CfgFeatureView.d.ts +29 -29
  47. package/dist/components/productConfiguration/CfgFeatureView.js +36 -36
  48. package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
  49. package/dist/components/productConfiguration/CfgGroupView.js +7 -7
  50. package/dist/components/productConfiguration/CfgOptionFeaturesView.d.ts +6 -6
  51. package/dist/components/productConfiguration/CfgOptionFeaturesView.js +13 -13
  52. package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +27 -27
  53. package/dist/components/productConfiguration/CfgOptionNumericView.js +119 -119
  54. package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
  55. package/dist/components/productConfiguration/CfgOptionPriceView.js +29 -29
  56. package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +18 -18
  57. package/dist/components/productConfiguration/CfgProductConfigurationView.js +46 -46
  58. package/dist/css/web-ui.css.map +1 -1
  59. package/dist/index.d.ts +22 -22
  60. package/dist/index.js +22 -22
  61. package/dist/scss/_button.scss +36 -36
  62. package/dist/scss/_configurator.scss +87 -87
  63. package/dist/scss/_expandable.scss +37 -37
  64. package/dist/scss/_feature-item.scss +137 -137
  65. package/dist/scss/_forms.scss +42 -42
  66. package/dist/scss/_hr.scss +16 -16
  67. package/dist/scss/_loading.scss +98 -98
  68. package/dist/scss/_mixins.scss +56 -56
  69. package/dist/scss/_option-tree.scss +29 -29
  70. package/dist/scss/_product-information.scss +49 -49
  71. package/dist/scss/_range-view.scss +39 -39
  72. package/dist/scss/_slider.scss +70 -70
  73. package/dist/scss/_tasks.scss +72 -72
  74. package/dist/scss/_themed.scss +147 -147
  75. package/dist/scss/_utilities.scss +21 -21
  76. package/dist/scss/_variables.scss +6 -6
  77. package/dist/scss/icons/_checkmark.scss +46 -46
  78. package/dist/scss/icons/_chevron.scss +62 -62
  79. package/dist/scss/icons/_circle-xmark-icon.scss +24 -24
  80. package/dist/scss/icons/_download-icon.scss +24 -24
  81. package/dist/scss/icons/_error-icon.scss +24 -24
  82. package/dist/scss/web-ui.scss +11 -11
  83. package/dist/useObservable.d.ts +4 -4
  84. package/dist/useObservable.js +18 -18
  85. package/dist/useRerender.d.ts +1 -1
  86. package/dist/useRerender.js +5 -5
  87. package/dist/useResize.d.ts +6 -6
  88. package/dist/useResize.js +47 -47
  89. package/dist/useSelected.d.ts +2 -2
  90. package/dist/useSelected.js +13 -13
  91. package/dist/useUniqueId.d.ts +1 -1
  92. package/dist/useUniqueId.js +7 -7
  93. package/dist/utilities.d.ts +5 -5
  94. package/dist/utilities.js +1 -1
  95. package/package.json +3 -3
@@ -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,38 +1,38 @@
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
+ 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,20 +1,20 @@
1
- import { CfgOption } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../../utilities.js";
4
- import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
- import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
- declare type Props = PassthroughProps & {
7
- option: CfgOption;
8
- };
9
- export declare const CfgCheckboxView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
- export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
- option: CfgOption;
12
- } & {
13
- additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
- featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
- featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
- featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
- featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
18
- } & CssProps>;
19
- export {};
1
+ import { CfgOption } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../../utilities.js";
4
+ import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
+ import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
+ declare type Props = PassthroughProps & {
7
+ option: CfgOption;
8
+ };
9
+ export declare const CfgCheckboxView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
+ export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
+ option: CfgOption;
12
+ } & {
13
+ additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
+ featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
+ featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
+ featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
+ featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
18
+ } & CssProps>;
19
+ export {};
20
20
  //# sourceMappingURL=CfgCheckboxView.d.ts.map
@@ -1,22 +1,22 @@
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
+ 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,14 +1,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
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
11
- } & {
12
- feature: import("@configura/web-api").CfgFeature;
13
- } & CssProps>;
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
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
11
+ } & {
12
+ feature: import("@configura/web-api").CfgFeature;
13
+ } & CssProps>;
14
14
  //# sourceMappingURL=CfgCheckboxesView.d.ts.map
@@ -1,19 +1,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;
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
- return (React.createElement("li", { className: `cfgFeatureItem cfgFeatureItem--optional ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
16
- React.createElement("h3", { className: "cfgFeatureItemOptional__header" }, description),
17
- React.createElement("ul", { className: "cfgOptionTree" }, options.map((option) => (React.createElement(CfgCheckboxViewMemo, Object.assign({ option: option, key: option.key }, forwardProps(props))))))));
18
- };
19
- export const CfgCheckboxesViewMemo = React.memo(CfgCheckboxesView);
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
+ return (React.createElement("li", { className: `cfgFeatureItem cfgFeatureItem--optional ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
16
+ React.createElement("h3", { className: "cfgFeatureItemOptional__header" }, description),
17
+ React.createElement("ul", { className: "cfgOptionTree" }, options.map((option) => (React.createElement(CfgCheckboxViewMemo, Object.assign({ option: option, key: option.key }, forwardProps(props))))))));
18
+ };
19
+ export const CfgCheckboxesViewMemo = React.memo(CfgCheckboxesView);
@@ -1,20 +1,20 @@
1
- import { CfgOption } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../../utilities.js";
4
- import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
- import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
- declare type Props = PassthroughProps & {
7
- option: CfgOption;
8
- };
9
- export declare const CfgDropdownOptionView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
- export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
- option: CfgOption;
12
- } & {
13
- additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
- featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
- featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
- featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
- featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
18
- } & CssProps>;
19
- export {};
1
+ import { CfgOption } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../../utilities.js";
4
+ import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
5
+ import { PassthroughProps } from "./CfgProductConfigurationView.js";
6
+ declare type Props = PassthroughProps & {
7
+ option: CfgOption;
8
+ };
9
+ export declare const CfgDropdownOptionView: React.FC<Props & CfgProductConfigurationComponentAndPassthroughProps & CssProps>;
10
+ export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
+ option: CfgOption;
12
+ } & {
13
+ additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
+ featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
+ featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
16
+ featureSelectManyComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
17
+ featureSelectOneComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
18
+ } & CssProps>;
19
+ export {};
20
20
  //# sourceMappingURL=CfgDropdownOptionView.d.ts.map
@@ -1,36 +1,36 @@
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
+ 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,14 +1,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
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
11
- } & {
12
- feature: import("@configura/web-api").CfgFeature;
13
- } & CssProps>;
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
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
11
+ } & {
12
+ feature: import("@configura/web-api").CfgFeature;
13
+ } & CssProps>;
14
14
  //# sourceMappingURL=CfgDropdownView.d.ts.map
@@ -1,21 +1,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;
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 { description, preview, options } = feature;
13
- const [open, setOpen] = useState(false);
14
- return (React.createElement("li", { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
15
- React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
16
- React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
17
- React.createElement("div", { className: "cfgFeatureItem__subTree" },
18
- open && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--subLevel ${preview ? "cfgOptionTree--compThumb" : ""}` }, options.map((option) => (React.createElement(CfgDropdownOptionViewMemo, Object.assign({ key: option.key, option: option }, forwardProps(props))))))),
19
- React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" }))));
20
- };
21
- export const CfgDropdownViewMemo = React.memo(CfgDropdownView);
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 } = props;
9
+ if (feature.selectionType !== SelectionType.SelectOne) {
10
+ throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
11
+ }
12
+ const { description, preview, options } = feature;
13
+ const [open, setOpen] = useState(false);
14
+ return (React.createElement("li", { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
15
+ React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
16
+ React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
17
+ React.createElement("div", { className: "cfgFeatureItem__subTree" },
18
+ open && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--subLevel ${preview ? "cfgOptionTree--compThumb" : ""}` }, options.map((option) => (React.createElement(CfgDropdownOptionViewMemo, Object.assign({ key: option.key, option: option }, forwardProps(props))))))),
19
+ React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" }))));
20
+ };
21
+ export const CfgDropdownViewMemo = React.memo(CfgDropdownView);
@@ -1,30 +1,30 @@
1
- import { CfgFeature, CfgProduct } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../../utilities.js";
4
- import { PassthroughProps } from "./CfgProductConfigurationView.js";
5
- export declare type CfgFeatureViewProps = CfgProductConfigurationComponentAndPassthroughProps & {
6
- feature: CfgFeature;
7
- };
8
- export declare type CfgAdditionalProductViewProps = CfgProductConfigurationComponentAndPassthroughProps & {
9
- product: CfgProduct;
10
- permanentlyExpandedLevels: number;
11
- };
12
- export declare type CfgProductConfigurationComponentAndPassthroughProps = PassthroughProps & {
13
- additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps>;
14
- featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps>;
15
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps>;
16
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps>;
17
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps>;
18
- };
19
- export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
20
- export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
21
- export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & {
22
- additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps> | undefined;
23
- featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
24
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
25
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
26
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
27
- } & {
28
- feature: CfgFeature;
29
- } & CssProps>;
1
+ import { CfgFeature, CfgProduct } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../../utilities.js";
4
+ import { PassthroughProps } from "./CfgProductConfigurationView.js";
5
+ export declare type CfgFeatureViewProps = CfgProductConfigurationComponentAndPassthroughProps & {
6
+ feature: CfgFeature;
7
+ };
8
+ export declare type CfgAdditionalProductViewProps = CfgProductConfigurationComponentAndPassthroughProps & {
9
+ product: CfgProduct;
10
+ permanentlyExpandedLevels: number;
11
+ };
12
+ export declare type CfgProductConfigurationComponentAndPassthroughProps = PassthroughProps & {
13
+ additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps>;
14
+ featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps>;
15
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps>;
16
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps>;
17
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps>;
18
+ };
19
+ export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
20
+ export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
21
+ export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & {
22
+ additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps> | undefined;
23
+ featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
24
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
25
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
26
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
27
+ } & {
28
+ feature: CfgFeature;
29
+ } & CssProps>;
30
30
  //# sourceMappingURL=CfgFeatureView.d.ts.map