@configura/web-ui 1.3.0-alpha.7 → 1.3.0

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 (78) 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/ConfigurationActionsButtonRow.d.ts +11 -11
  7. package/dist/components/ConfigurationActionsButtonRow.js +13 -13
  8. package/dist/components/Configurator.d.ts +12 -12
  9. package/dist/components/Configurator.js +15 -15
  10. package/dist/components/ConfiguratorWrapper.d.ts +8 -8
  11. package/dist/components/ConfiguratorWrapper.js +5 -5
  12. package/dist/components/CurrencyPrice.d.ts +9 -9
  13. package/dist/components/CurrencyPrice.js +7 -7
  14. package/dist/components/ExpandableHeadingRow.d.ts +15 -15
  15. package/dist/components/ExpandableHeadingRow.js +21 -21
  16. package/dist/components/Loading.d.ts +13 -13
  17. package/dist/components/Loading.js +20 -20
  18. package/dist/components/ProductInformation.d.ts +10 -10
  19. package/dist/components/ProductInformation.js +23 -23
  20. package/dist/components/icons/Checkmark.d.ts +5 -5
  21. package/dist/components/icons/Checkmark.js +12 -12
  22. package/dist/components/icons/Chevron.d.ts +6 -6
  23. package/dist/components/icons/Chevron.js +18 -18
  24. package/dist/components/productConfiguration/CfgAdditionalProductView.d.ts +3 -3
  25. package/dist/components/productConfiguration/CfgAdditionalProductView.js +28 -28
  26. package/dist/components/productConfiguration/CfgCheckboxView.d.ts +18 -18
  27. package/dist/components/productConfiguration/CfgCheckboxView.js +22 -22
  28. package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +12 -12
  29. package/dist/components/productConfiguration/CfgCheckboxesView.js +18 -18
  30. package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +18 -18
  31. package/dist/components/productConfiguration/CfgDropdownOptionView.js +35 -35
  32. package/dist/components/productConfiguration/CfgDropdownView.d.ts +12 -12
  33. package/dist/components/productConfiguration/CfgDropdownView.js +20 -20
  34. package/dist/components/productConfiguration/CfgFeatureView.d.ts +27 -27
  35. package/dist/components/productConfiguration/CfgFeatureView.js +34 -34
  36. package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
  37. package/dist/components/productConfiguration/CfgGroupView.js +13 -13
  38. package/dist/components/productConfiguration/CfgOptionFeaturesView.d.ts +6 -6
  39. package/dist/components/productConfiguration/CfgOptionFeaturesView.js +13 -13
  40. package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +27 -27
  41. package/dist/components/productConfiguration/CfgOptionNumericView.js +117 -117
  42. package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
  43. package/dist/components/productConfiguration/CfgOptionPriceView.js +29 -29
  44. package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +18 -18
  45. package/dist/components/productConfiguration/CfgProductConfigurationView.js +45 -45
  46. package/dist/css/web-ui.css.map +1 -1
  47. package/dist/index.d.ts +20 -20
  48. package/dist/index.js +20 -20
  49. package/dist/scss/_button.scss +36 -36
  50. package/dist/scss/_configurator.scss +67 -67
  51. package/dist/scss/_expandable.scss +37 -37
  52. package/dist/scss/_feature-item.scss +124 -124
  53. package/dist/scss/_hr.scss +16 -16
  54. package/dist/scss/_loading.scss +98 -98
  55. package/dist/scss/_mixins.scss +56 -56
  56. package/dist/scss/_option-tree.scss +29 -29
  57. package/dist/scss/_product-information.scss +49 -49
  58. package/dist/scss/_range-view.scss +28 -28
  59. package/dist/scss/_slider.scss +70 -70
  60. package/dist/scss/_themed.scss +124 -124
  61. package/dist/scss/_utilities.scss +21 -21
  62. package/dist/scss/_variables.scss +6 -6
  63. package/dist/scss/icons/_checkmark.scss +46 -46
  64. package/dist/scss/icons/_chevron.scss +62 -62
  65. package/dist/scss/web-ui.scss +11 -11
  66. package/dist/useObservable.d.ts +4 -4
  67. package/dist/useObservable.js +18 -18
  68. package/dist/useRerender.d.ts +1 -1
  69. package/dist/useRerender.js +5 -5
  70. package/dist/useResize.d.ts +6 -6
  71. package/dist/useResize.js +47 -47
  72. package/dist/useSelected.d.ts +2 -2
  73. package/dist/useSelected.js +13 -13
  74. package/dist/useUniqueId.d.ts +1 -1
  75. package/dist/useUniqueId.js +7 -7
  76. package/dist/utilities.d.ts +5 -5
  77. package/dist/utilities.js +1 -1
  78. package/package.json +3 -3
@@ -1,35 +1,35 @@
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
- const { option, upchargeDisplayMode } = props;
10
- const { code, thumbnail, description, selected } = option;
11
- const optionClasses = selected ? "cfgFeatureItemOption--checked" : "";
12
- const uniqueId = useUuid();
13
- return (React.createElement("li", { className: `cfgFeatureItem cfgMb1 ${props.className || ""}`, style: props.style },
14
- React.createElement("label", { className: `cfgFeatureItemOption ${optionClasses}`, htmlFor: uniqueId },
15
- React.createElement("input", { checked: selected, className: "cfgFeatureItem__hiddenInput", id: uniqueId, name: uniqueId, onChange: () => {
16
- option.setSelected(true);
17
- }, onClick: () => {
18
- // As a convenience for when wanting to re-select something already
19
- // selected to use the propagation side effects we have added this
20
- // which will trigger a setSelected even though this is strictly not
21
- // a change.
22
- if (selected) {
23
- option.setSelected(true);
24
- }
25
- }, type: "radio", value: code }),
26
- React.createElement("div", { className: "cfgFeatureItem__radio" }, selected && React.createElement(Checkmark, null)),
27
- thumbnail && (React.createElement("img", { alt: `Thumbnail for ${description}`, className: "cfgThumbnailImage cfgMl1", src: thumbnail })),
28
- React.createElement("div", { className: "cfgFeatureItemOption__titleWrapper" },
29
- React.createElement("div", { className: "cfgFeatureItemOption__title" },
30
- description || code,
31
- React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
32
- selected && React.createElement(CfgOptionNumericView, { option: option }),
33
- React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
34
- };
35
- 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
+ const { option, upchargeDisplayMode } = props;
10
+ const { code, thumbnail, description, selected } = option;
11
+ const optionClasses = selected ? "cfgFeatureItemOption--checked" : "";
12
+ const uniqueId = useUuid();
13
+ return (React.createElement("li", { className: `cfgFeatureItem cfgMb1 ${props.className || ""}`, style: props.style },
14
+ React.createElement("label", { className: `cfgFeatureItemOption ${optionClasses}`, htmlFor: uniqueId },
15
+ React.createElement("input", { checked: selected, className: "cfgFeatureItem__hiddenInput", id: uniqueId, name: uniqueId, onChange: () => {
16
+ option.setSelected(true);
17
+ }, onClick: () => {
18
+ // As a convenience for when wanting to re-select something already
19
+ // selected to use the propagation side effects we have added this
20
+ // which will trigger a setSelected even though this is strictly not
21
+ // a change.
22
+ if (selected) {
23
+ option.setSelected(true);
24
+ }
25
+ }, type: "radio", value: code }),
26
+ React.createElement("div", { className: "cfgFeatureItem__radio" }, selected && React.createElement(Checkmark, null)),
27
+ thumbnail && (React.createElement("img", { alt: `Thumbnail for ${description}`, className: "cfgThumbnailImage cfgMl1", src: thumbnail })),
28
+ React.createElement("div", { className: "cfgFeatureItemOption__titleWrapper" },
29
+ React.createElement("div", { className: "cfgFeatureItemOption__title" },
30
+ description || code,
31
+ React.createElement(CfgOptionPriceView, { option: option, upchargeDisplayMode: upchargeDisplayMode })))),
32
+ selected && React.createElement(CfgOptionNumericView, { option: option }),
33
+ React.createElement(CfgOptionFeaturesView, Object.assign({ option: option }, forwardProps(props)))));
34
+ };
35
+ export const CfgDropdownOptionViewMemo = React.memo(CfgDropdownOptionView);
@@ -1,13 +1,13 @@
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
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
8
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
- } & {
11
- feature: import("@configura/web-api").CfgFeature;
12
- } & 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
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
8
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
9
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
10
+ } & {
11
+ feature: import("@configura/web-api").CfgFeature;
12
+ } & CssProps>;
13
13
  //# sourceMappingURL=CfgDropdownView.d.ts.map
@@ -1,20 +1,20 @@
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
- const { feature } = props;
8
- if (feature.selectionType !== SelectionType.SelectOne) {
9
- throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
10
- }
11
- const { description, preview, options } = feature;
12
- const [open, setOpen] = useState(false);
13
- return (React.createElement("li", { className: `cfgFeatureItem ${props.className || ""}`, style: props.style },
14
- React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
15
- React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
16
- React.createElement("div", { className: "cfgFeatureItem__subTree" },
17
- 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))))))),
18
- React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" }))));
19
- };
20
- 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
+ const { feature } = props;
8
+ if (feature.selectionType !== SelectionType.SelectOne) {
9
+ throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
10
+ }
11
+ const { description, preview, options } = feature;
12
+ const [open, setOpen] = useState(false);
13
+ return (React.createElement("li", { className: `cfgFeatureItem ${props.className || ""}`, style: props.style },
14
+ React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
15
+ React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
16
+ React.createElement("div", { className: "cfgFeatureItem__subTree" },
17
+ 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))))))),
18
+ React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" }))));
19
+ };
20
+ export const CfgDropdownViewMemo = React.memo(CfgDropdownView);
@@ -1,28 +1,28 @@
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
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps>;
15
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps>;
16
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps>;
17
- };
18
- export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
19
- export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
20
- export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & {
21
- additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps> | undefined;
22
- featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
23
- featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
24
- featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
25
- } & {
26
- feature: CfgFeature;
27
- } & 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
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps>;
15
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps>;
16
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps>;
17
+ };
18
+ export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
19
+ export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
20
+ export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & {
21
+ additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps> | undefined;
22
+ featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
23
+ featureSelectManyComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
24
+ featureSelectOneComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
25
+ } & {
26
+ feature: CfgFeature;
27
+ } & CssProps>;
28
28
  //# sourceMappingURL=CfgFeatureView.d.ts.map
@@ -1,34 +1,34 @@
1
- import { SelectionType } from "@configura/web-api";
2
- import React from "react";
3
- import { CfgCheckboxesViewMemo } from "./CfgCheckboxesView.js";
4
- import { CfgDropdownViewMemo } from "./CfgDropdownView.js";
5
- import { CfgGroupViewMemo } from "./CfgGroupView.js";
6
- export const forwardProps = (props) => {
7
- return {
8
- upchargeDisplayMode: props.upchargeDisplayMode,
9
- additionalProductComponent: props.additionalProductComponent,
10
- featureGroupComponent: props.featureGroupComponent,
11
- featureSelectManyComponent: props.featureSelectManyComponent,
12
- featureSelectOneComponent: props.featureSelectOneComponent,
13
- };
14
- };
15
- export const CfgFeatureView = (props) => {
16
- const { feature } = props;
17
- if (!feature.visible) {
18
- return null;
19
- }
20
- const GroupComponent = props.featureGroupComponent || CfgGroupViewMemo;
21
- const SelectManyComponent = props.featureSelectManyComponent || CfgCheckboxesViewMemo;
22
- const SelectOneComponent = props.featureSelectOneComponent || CfgDropdownViewMemo;
23
- switch (feature.selectionType) {
24
- case SelectionType.Group:
25
- return React.createElement(GroupComponent, Object.assign({}, props));
26
- case SelectionType.SelectMany:
27
- return React.createElement(SelectManyComponent, Object.assign({}, props));
28
- case SelectionType.SelectOne:
29
- return React.createElement(SelectOneComponent, Object.assign({}, props));
30
- default:
31
- throw Error("Unsupported viewType");
32
- }
33
- };
34
- export const CfgFeatureViewMemo = React.memo(CfgFeatureView);
1
+ import { SelectionType } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CfgCheckboxesViewMemo } from "./CfgCheckboxesView.js";
4
+ import { CfgDropdownViewMemo } from "./CfgDropdownView.js";
5
+ import { CfgGroupViewMemo } from "./CfgGroupView.js";
6
+ export const forwardProps = (props) => {
7
+ return {
8
+ upchargeDisplayMode: props.upchargeDisplayMode,
9
+ additionalProductComponent: props.additionalProductComponent,
10
+ featureGroupComponent: props.featureGroupComponent,
11
+ featureSelectManyComponent: props.featureSelectManyComponent,
12
+ featureSelectOneComponent: props.featureSelectOneComponent,
13
+ };
14
+ };
15
+ export const CfgFeatureView = (props) => {
16
+ const { feature } = props;
17
+ if (!feature.visible) {
18
+ return null;
19
+ }
20
+ const GroupComponent = props.featureGroupComponent || CfgGroupViewMemo;
21
+ const SelectManyComponent = props.featureSelectManyComponent || CfgCheckboxesViewMemo;
22
+ const SelectOneComponent = props.featureSelectOneComponent || CfgDropdownViewMemo;
23
+ switch (feature.selectionType) {
24
+ case SelectionType.Group:
25
+ return React.createElement(GroupComponent, Object.assign({}, props));
26
+ case SelectionType.SelectMany:
27
+ return React.createElement(SelectManyComponent, Object.assign({}, props));
28
+ case SelectionType.SelectOne:
29
+ return React.createElement(SelectOneComponent, Object.assign({}, props));
30
+ default:
31
+ throw Error("Unsupported viewType");
32
+ }
33
+ };
34
+ export const CfgFeatureViewMemo = React.memo(CfgFeatureView);
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import { CfgFeatureViewProps } from "./CfgFeatureView.js";
3
- export declare const CfgGroupView: React.FC<CfgFeatureViewProps>;
4
- export declare const CfgGroupViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
1
+ import React from "react";
2
+ import { CfgFeatureViewProps } from "./CfgFeatureView.js";
3
+ export declare const CfgGroupView: React.FC<CfgFeatureViewProps>;
4
+ export declare const CfgGroupViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
5
5
  //# sourceMappingURL=CfgGroupView.d.ts.map
@@ -1,13 +1,13 @@
1
- import { SelectionType } from "@configura/web-api";
2
- import React from "react";
3
- import { CfgFeatureViewMemo, forwardProps } from "./CfgFeatureView.js";
4
- export const CfgGroupView = (props) => {
5
- const { feature } = props;
6
- if (feature.selectionType !== SelectionType.Group) {
7
- throw Error(`Unsupported selection type expected: ${SelectionType.Group}, got: ${feature.selectionType}`);
8
- }
9
- return (React.createElement(React.Fragment, null, feature.options.map((o) => {
10
- return o.features.map((f) => (React.createElement(CfgFeatureViewMemo, Object.assign({ key: f.key, feature: f }, forwardProps(props)))));
11
- })));
12
- };
13
- export const CfgGroupViewMemo = React.memo(CfgGroupView);
1
+ import { SelectionType } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CfgFeatureViewMemo, forwardProps } from "./CfgFeatureView.js";
4
+ export const CfgGroupView = (props) => {
5
+ const { feature } = props;
6
+ if (feature.selectionType !== SelectionType.Group) {
7
+ throw Error(`Unsupported selection type expected: ${SelectionType.Group}, got: ${feature.selectionType}`);
8
+ }
9
+ return (React.createElement(React.Fragment, null, feature.options.map((o) => {
10
+ return o.features.map((f) => (React.createElement(CfgFeatureViewMemo, Object.assign({ key: f.key, feature: f }, forwardProps(props)))));
11
+ })));
12
+ };
13
+ export const CfgGroupViewMemo = React.memo(CfgGroupView);
@@ -1,7 +1,7 @@
1
- import { CfgOption } from "@configura/web-api";
2
- import React from "react";
3
- import { PassthroughProps } from "./CfgProductConfigurationView.js";
4
- export declare const CfgOptionFeaturesView: React.FC<{
5
- option: CfgOption;
6
- } & PassthroughProps>;
1
+ import { CfgOption } from "@configura/web-api";
2
+ import React from "react";
3
+ import { PassthroughProps } from "./CfgProductConfigurationView.js";
4
+ export declare const CfgOptionFeaturesView: React.FC<{
5
+ option: CfgOption;
6
+ } & PassthroughProps>;
7
7
  //# sourceMappingURL=CfgOptionFeaturesView.d.ts.map
@@ -1,13 +1,13 @@
1
- import React from "react";
2
- import { CfgFeatureView, forwardProps } from "./CfgFeatureView.js";
3
- export const CfgOptionFeaturesView = (props) => {
4
- const { option } = props;
5
- const { features, selected } = option;
6
- if (!selected) {
7
- return null;
8
- }
9
- if (features.length === 0) {
10
- return null;
11
- }
12
- return (React.createElement("ul", { className: "cfgOptionTree cfgOptionTree--subLevel cfgOptionTree--indent" }, features.map((f) => (React.createElement(CfgFeatureView, Object.assign({ feature: f, key: f.key }, forwardProps(props)))))));
13
- };
1
+ import React from "react";
2
+ import { CfgFeatureView, forwardProps } from "./CfgFeatureView.js";
3
+ export const CfgOptionFeaturesView = (props) => {
4
+ const { option } = props;
5
+ const { features, selected } = option;
6
+ if (!selected) {
7
+ return null;
8
+ }
9
+ if (features.length === 0) {
10
+ return null;
11
+ }
12
+ return (React.createElement("ul", { className: "cfgOptionTree cfgOptionTree--subLevel cfgOptionTree--indent" }, features.map((f) => (React.createElement(CfgFeatureView, Object.assign({ feature: f, key: f.key }, forwardProps(props)))))));
13
+ };
@@ -1,28 +1,28 @@
1
- import { CfgOption, NumericValueDiscrete, NumericValueRangeDefinition } from "@configura/web-api";
2
- import { LengthUnit } from "@configura/web-utilities";
3
- import React from "react";
4
- import { CssProps } from "../../utilities.js";
5
- export declare const CfgOptionNumericView: React.FC<{
6
- option: CfgOption;
7
- } & CssProps>;
8
- /**
9
- * Displays GUI for selecting in one "range". Please note that the range
10
- * parameter can also be a discrete value.
11
- */
12
- export declare const NumericValueView: React.FC<{
13
- currentValue: number;
14
- unit: LengthUnit;
15
- range: NumericValueRangeDefinition | NumericValueDiscrete;
16
- updateValue: (val: number, commit: boolean) => void;
17
- hasNoSiblings: boolean;
18
- }>;
19
- export declare const RangeView: React.FC<{
20
- currentValue: number;
21
- unit: LengthUnit;
22
- range: NumericValueRangeDefinition;
23
- inputValue: number;
24
- onChange: (val: number, instantUpdate: boolean) => void;
25
- onCommit: () => void;
26
- showRangeError: boolean;
27
- } & CssProps>;
1
+ import { CfgOption, NumericValueDiscrete, NumericValueRangeDefinition } from "@configura/web-api";
2
+ import { LengthUnit } from "@configura/web-utilities";
3
+ import React from "react";
4
+ import { CssProps } from "../../utilities.js";
5
+ export declare const CfgOptionNumericView: React.FC<{
6
+ option: CfgOption;
7
+ } & CssProps>;
8
+ /**
9
+ * Displays GUI for selecting in one "range". Please note that the range
10
+ * parameter can also be a discrete value.
11
+ */
12
+ export declare const NumericValueView: React.FC<{
13
+ currentValue: number;
14
+ unit: LengthUnit;
15
+ range: NumericValueRangeDefinition | NumericValueDiscrete;
16
+ updateValue: (val: number, commit: boolean) => void;
17
+ hasNoSiblings: boolean;
18
+ }>;
19
+ export declare const RangeView: React.FC<{
20
+ currentValue: number;
21
+ unit: LengthUnit;
22
+ range: NumericValueRangeDefinition;
23
+ inputValue: number;
24
+ onChange: (val: number, instantUpdate: boolean) => void;
25
+ onCommit: () => void;
26
+ showRangeError: boolean;
27
+ } & CssProps>;
28
28
  //# sourceMappingURL=CfgOptionNumericView.d.ts.map