@configura/web-ui 2.2.0-alpha.1 → 2.2.0-alpha.2
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/.eslintrc.json +5 -5
- 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 +14 -14
- package/dist/components/ConfigurationActionsButtonRow.js +16 -16
- 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/ErrorContext.d.ts +2 -2
- package/dist/components/ErrorContext.js +2 -2
- package/dist/components/ExpandableHeadingRow.d.ts +15 -15
- package/dist/components/ExpandableHeadingRow.js +23 -23
- 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/ResetButton.d.ts +8 -8
- package/dist/components/ResetButton.js +7 -7
- package/dist/components/ShareView.d.ts +3 -3
- package/dist/components/ShareView.js +21 -21
- package/dist/components/TaskListView.d.ts +8 -8
- package/dist/components/TaskListView.js +69 -69
- package/dist/components/TaskStartView.d.ts +12 -12
- package/dist/components/TaskStartView.js +29 -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 +46 -46
- package/dist/components/productConfiguration/CfgCheckboxView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgCheckboxView.js +7 -7
- package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgCheckboxesView.js +20 -20
- package/dist/components/productConfiguration/CfgConfigurationCommonView.d.ts +7 -7
- package/dist/components/productConfiguration/CfgConfigurationCommonView.js +8 -8
- package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgDropdownOptionView.js +23 -23
- package/dist/components/productConfiguration/CfgDropdownView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgDropdownView.js +23 -23
- package/dist/components/productConfiguration/CfgFeatureView.d.ts +72 -72
- package/dist/components/productConfiguration/CfgFeatureView.js +77 -77
- package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
- package/dist/components/productConfiguration/CfgGroupView.js +7 -7
- package/dist/components/productConfiguration/CfgMiscFile.d.ts +4 -4
- package/dist/components/productConfiguration/CfgMiscFile.js +9 -9
- package/dist/components/productConfiguration/CfgMiscFiles.d.ts +4 -4
- package/dist/components/productConfiguration/CfgMiscFiles.js +5 -5
- package/dist/components/productConfiguration/CfgNote.d.ts +4 -4
- package/dist/components/productConfiguration/CfgNote.js +15 -15
- package/dist/components/productConfiguration/CfgNotes.d.ts +4 -4
- package/dist/components/productConfiguration/CfgNotes.js +5 -5
- package/dist/components/productConfiguration/CfgOptionCommonView.d.ts +6 -6
- package/dist/components/productConfiguration/CfgOptionCommonView.js +53 -53
- package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +29 -29
- package/dist/components/productConfiguration/CfgOptionNumericView.js +132 -132
- package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
- package/dist/components/productConfiguration/CfgOptionPriceView.js +31 -31
- package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +24 -24
- package/dist/components/productConfiguration/CfgProductConfigurationView.js +50 -50
- package/dist/css/web-ui.css +1 -1
- package/dist/css/web-ui.css.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +29 -29
- package/dist/scss/_button.scss +52 -52
- package/dist/scss/_configurator.scss +132 -132
- package/dist/scss/_expandable.scss +38 -38
- package/dist/scss/_feature-item.scss +146 -146
- package/dist/scss/_forms.scss +44 -44
- package/dist/scss/_hr.scss +16 -16
- package/dist/scss/_loading.scss +98 -98
- package/dist/scss/_misc-file-and-note.scss +44 -44
- package/dist/scss/_mixins.scss +56 -56
- package/dist/scss/_option-tree.scss +29 -29
- package/dist/scss/_product-information.scss +63 -63
- 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 +156 -156
- package/dist/scss/_utilities.scss +22 -22
- 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/useCatParams.d.ts +17 -17
- package/dist/useCatParams.js +29 -29
- 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 +3 -3
- package/dist/utilities.d.ts +5 -5
- package/dist/utilities.js +1 -1
- package/package.json +3 -3
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { ErrorContext } from "./ErrorContext.js";
|
|
3
|
-
export const TaskStartView = (props) => {
|
|
4
|
-
var _a, _b;
|
|
5
|
-
const { taskHandler, product, renderTaskParams, getPreviewUrl } = props;
|
|
6
|
-
const setError = useContext(ErrorContext);
|
|
7
|
-
const formats = (_a = props.formats) !== null && _a !== void 0 ? _a : taskHandler.availableFormats;
|
|
8
|
-
if (formats.length === 0) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return (React.createElement("div", { className: `cfgTaskStart ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
|
|
12
|
-
React.createElement("div", { className: "cfgFormSelect" },
|
|
13
|
-
React.createElement("select", { value: "", onChange: (event) => {
|
|
14
|
-
const index = event.target.selectedIndex;
|
|
15
|
-
if (index === 0) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
taskHandler
|
|
19
|
-
.start(formats[index - 1], product, typeof renderTaskParams === "function"
|
|
20
|
-
? renderTaskParams()
|
|
21
|
-
: renderTaskParams, getPreviewUrl)
|
|
22
|
-
.catch((e) => {
|
|
23
|
-
setError(e);
|
|
24
|
-
throw e;
|
|
25
|
-
});
|
|
26
|
-
} },
|
|
27
|
-
React.createElement("option", { value: "" }, "Export"),
|
|
28
|
-
formats.map((format) => (React.createElement("option", { value: format, key: format }, format)))))));
|
|
29
|
-
};
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ErrorContext } from "./ErrorContext.js";
|
|
3
|
+
export const TaskStartView = (props) => {
|
|
4
|
+
var _a, _b;
|
|
5
|
+
const { taskHandler, product, renderTaskParams, getPreviewUrl } = props;
|
|
6
|
+
const setError = useContext(ErrorContext);
|
|
7
|
+
const formats = (_a = props.formats) !== null && _a !== void 0 ? _a : taskHandler.availableFormats;
|
|
8
|
+
if (formats.length === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement("div", { className: `cfgTaskStart ${(_b = props.className) !== null && _b !== void 0 ? _b : ""}`, style: props.style },
|
|
12
|
+
React.createElement("div", { className: "cfgFormSelect" },
|
|
13
|
+
React.createElement("select", { value: "", onChange: (event) => {
|
|
14
|
+
const index = event.target.selectedIndex;
|
|
15
|
+
if (index === 0) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
taskHandler
|
|
19
|
+
.start(formats[index - 1], product, typeof renderTaskParams === "function"
|
|
20
|
+
? renderTaskParams()
|
|
21
|
+
: renderTaskParams, getPreviewUrl)
|
|
22
|
+
.catch((e) => {
|
|
23
|
+
setError(e);
|
|
24
|
+
throw e;
|
|
25
|
+
});
|
|
26
|
+
} },
|
|
27
|
+
React.createElement("option", { value: "" }, "Export"),
|
|
28
|
+
formats.map((format) => (React.createElement("option", { value: format, key: format }, format)))))));
|
|
29
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities";
|
|
3
|
-
export declare const CheckmarkWithBorder: React.FC<{
|
|
4
|
-
active: boolean;
|
|
5
|
-
} & CssProps>;
|
|
6
|
-
export declare const Checkmark: React.FC<CssProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities";
|
|
3
|
+
export declare const CheckmarkWithBorder: React.FC<{
|
|
4
|
+
active: boolean;
|
|
5
|
+
} & CssProps>;
|
|
6
|
+
export declare const Checkmark: React.FC<CssProps>;
|
|
7
7
|
//# sourceMappingURL=Checkmark.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const CheckmarkWithBorder = (props) => {
|
|
3
|
-
const { active } = props;
|
|
4
|
-
return (React.createElement("div", { className: `cfgCheckmark__border ${props.className || ""} ${active ? "cfgCheckmark__border--active" : ""}`, style: props.style }, active && React.createElement(Checkmark, null)));
|
|
5
|
-
};
|
|
6
|
-
export const Checkmark = (props) => {
|
|
7
|
-
return (React.createElement("span", { className: `cfgCheckmark ${props.className || ""}`, style: props.style },
|
|
8
|
-
React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
-
React.createElement("g", { className: "cfgCheckmark__container" },
|
|
10
|
-
React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineLeft", x1: "10", y1: "30", x2: "30", y2: "30" }),
|
|
11
|
-
React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineRight", x1: "90", y1: "50", x2: "50", y2: "50" })))));
|
|
12
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const CheckmarkWithBorder = (props) => {
|
|
3
|
+
const { active } = props;
|
|
4
|
+
return (React.createElement("div", { className: `cfgCheckmark__border ${props.className || ""} ${active ? "cfgCheckmark__border--active" : ""}`, style: props.style }, active && React.createElement(Checkmark, null)));
|
|
5
|
+
};
|
|
6
|
+
export const Checkmark = (props) => {
|
|
7
|
+
return (React.createElement("span", { className: `cfgCheckmark ${props.className || ""}`, style: props.style },
|
|
8
|
+
React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
|
+
React.createElement("g", { className: "cfgCheckmark__container" },
|
|
10
|
+
React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineLeft", x1: "10", y1: "30", x2: "30", y2: "30" }),
|
|
11
|
+
React.createElement("line", { className: "cfgCheckmark__line cfgCheckmark__lineRight", x1: "90", y1: "50", x2: "50", y2: "50" })))));
|
|
12
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities";
|
|
3
|
-
export interface Props {
|
|
4
|
-
active: boolean;
|
|
5
|
-
up?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const Chevron: React.FC<Props & CssProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities";
|
|
3
|
+
export interface Props {
|
|
4
|
+
active: boolean;
|
|
5
|
+
up?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Chevron: React.FC<Props & CssProps>;
|
|
8
8
|
//# sourceMappingURL=Chevron.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export const Chevron = (props) => {
|
|
3
|
-
const { active } = props;
|
|
4
|
-
let { up } = props;
|
|
5
|
-
if (up === undefined) {
|
|
6
|
-
up = active;
|
|
7
|
-
}
|
|
8
|
-
const upFragment = up ? "up" : "down";
|
|
9
|
-
const activeFragment = active ? "active" : "passive";
|
|
10
|
-
const containerClass = "cfgChevron__container--" + upFragment + " cfgChevron__container--" + activeFragment;
|
|
11
|
-
const leftLineClass = "cfgChevron__lineLeft--" + upFragment + " cfgChevron__lineLeft--" + activeFragment;
|
|
12
|
-
const rightLineClass = "cfgChevron__lineRight--" + upFragment + " cfgChevron__lineRight--" + activeFragment;
|
|
13
|
-
return (React.createElement("span", { className: `cfgChevron ${props.className || ""}`, style: props.style },
|
|
14
|
-
React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
|
|
15
|
-
React.createElement("g", { className: `cfgChevron__container ${containerClass}` },
|
|
16
|
-
React.createElement("line", { className: `cfgChevron__line ${leftLineClass}`, x1: "10", y1: "50", x2: "50", y2: "50" }),
|
|
17
|
-
React.createElement("line", { className: `cfgChevron__line ${rightLineClass}`, x1: "90", y1: "50", x2: "50", y2: "50" })))));
|
|
18
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export const Chevron = (props) => {
|
|
3
|
+
const { active } = props;
|
|
4
|
+
let { up } = props;
|
|
5
|
+
if (up === undefined) {
|
|
6
|
+
up = active;
|
|
7
|
+
}
|
|
8
|
+
const upFragment = up ? "up" : "down";
|
|
9
|
+
const activeFragment = active ? "active" : "passive";
|
|
10
|
+
const containerClass = "cfgChevron__container--" + upFragment + " cfgChevron__container--" + activeFragment;
|
|
11
|
+
const leftLineClass = "cfgChevron__lineLeft--" + upFragment + " cfgChevron__lineLeft--" + activeFragment;
|
|
12
|
+
const rightLineClass = "cfgChevron__lineRight--" + upFragment + " cfgChevron__lineRight--" + activeFragment;
|
|
13
|
+
return (React.createElement("span", { className: `cfgChevron ${props.className || ""}`, style: props.style },
|
|
14
|
+
React.createElement("svg", { height: "100%", preserveAspectRatio: "xMidYMid", version: "1.1", viewBox: "0 0 100 100", width: "100%", xmlns: "http://www.w3.org/2000/svg" },
|
|
15
|
+
React.createElement("g", { className: `cfgChevron__container ${containerClass}` },
|
|
16
|
+
React.createElement("line", { className: `cfgChevron__line ${leftLineClass}`, x1: "10", y1: "50", x2: "50", y2: "50" }),
|
|
17
|
+
React.createElement("line", { className: `cfgChevron__line ${rightLineClass}`, x1: "90", y1: "50", x2: "50", y2: "50" })))));
|
|
18
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CssProps } from "../../utilities";
|
|
3
|
-
export declare const CircleXmarkIcon: React.FC<CssProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CssProps } from "../../utilities";
|
|
3
|
+
export declare const CircleXmarkIcon: React.FC<CssProps>;
|
|
4
4
|
//# sourceMappingURL=CircleXmarkIcon.d.ts.map
|
|
@@ -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,46 +1,46 @@
|
|
|
1
|
-
import React, { useContext, useState } from "react";
|
|
2
|
-
import { ErrorContext } from "../ErrorContext.js";
|
|
3
|
-
import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableHeadingRow.js";
|
|
4
|
-
import { forwardProps, } from "./CfgFeatureView.js";
|
|
5
|
-
import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
|
|
6
|
-
export const CfgAdditionalProductView = React.memo((props) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const { product, permanentlyExpandedLevels, startOpen } = props;
|
|
9
|
-
const { partNumber, optional, selected, configuration, additionalProducts, preview, description, visible: configurationVisible, } = product;
|
|
10
|
-
const setError = useContext(ErrorContext);
|
|
11
|
-
const [open, setOpen] = useState(startOpen === true);
|
|
12
|
-
if (!configurationVisible) {
|
|
13
|
-
// Visibility of a Product should not affect its Additional Products.
|
|
14
|
-
// (Those have their own visibility.)
|
|
15
|
-
return (React.createElement(AdditionalProductsView, Object.assign({}, forwardProps(props), { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels })));
|
|
16
|
-
}
|
|
17
|
-
const openOrSelected = optional ? selected : open;
|
|
18
|
-
const hasChildren = configuration.features.length !== 0 ||
|
|
19
|
-
additionalProducts.length !== 0 ||
|
|
20
|
-
product.notes.length !== 0 ||
|
|
21
|
-
product.miscFiles.length !== 0;
|
|
22
|
-
return (React.createElement("li", { className: `cfgFeatureItem cfgAdditionalProduct ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
23
|
-
React.createElement(ExpandableHeadingRow, { heading: description || partNumber, expandable: optional || (hasChildren && permanentlyExpandedLevels <= 0), open: openOrSelected, onClick: () => {
|
|
24
|
-
if (optional) {
|
|
25
|
-
product.setSelected(!selected).catch((e) => {
|
|
26
|
-
setError(e);
|
|
27
|
-
throw e;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
setOpen((prev) => !prev);
|
|
32
|
-
}
|
|
33
|
-
}, symbol: optional ? ExpandableHeadingRowSymbol.Checkbox : undefined }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
|
|
34
|
-
React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
|
|
35
|
-
hasChildren &&
|
|
36
|
-
(!optional || selected) &&
|
|
37
|
-
(openOrSelected || 0 < permanentlyExpandedLevels) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
38
|
-
React.createElement(CfgProductConfigurationView, Object.assign({}, forwardProps(props), { productOrConfiguration: configuration })),
|
|
39
|
-
additionalProducts.length !== 0 && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--topLevel` },
|
|
40
|
-
React.createElement(AdditionalProductsView, Object.assign({}, forwardProps(props), { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels })))))),
|
|
41
|
-
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })));
|
|
42
|
-
});
|
|
43
|
-
const AdditionalProductsView = (props) => {
|
|
44
|
-
const { additionalProducts, permanentlyExpandedLevels, additionalProductComponent: AdditionalProductComponent, } = props;
|
|
45
|
-
return (React.createElement(React.Fragment, null, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({}, forwardProps(props), { key: additionalProduct.key, product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 }))))));
|
|
46
|
-
};
|
|
1
|
+
import React, { useContext, useState } from "react";
|
|
2
|
+
import { ErrorContext } from "../ErrorContext.js";
|
|
3
|
+
import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableHeadingRow.js";
|
|
4
|
+
import { forwardProps, } from "./CfgFeatureView.js";
|
|
5
|
+
import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
|
|
6
|
+
export const CfgAdditionalProductView = React.memo((props) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const { product, permanentlyExpandedLevels, startOpen } = props;
|
|
9
|
+
const { partNumber, optional, selected, configuration, additionalProducts, preview, description, visible: configurationVisible, } = product;
|
|
10
|
+
const setError = useContext(ErrorContext);
|
|
11
|
+
const [open, setOpen] = useState(startOpen === true);
|
|
12
|
+
if (!configurationVisible) {
|
|
13
|
+
// Visibility of a Product should not affect its Additional Products.
|
|
14
|
+
// (Those have their own visibility.)
|
|
15
|
+
return (React.createElement(AdditionalProductsView, Object.assign({}, forwardProps(props), { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels })));
|
|
16
|
+
}
|
|
17
|
+
const openOrSelected = optional ? selected : open;
|
|
18
|
+
const hasChildren = configuration.features.length !== 0 ||
|
|
19
|
+
additionalProducts.length !== 0 ||
|
|
20
|
+
product.notes.length !== 0 ||
|
|
21
|
+
product.miscFiles.length !== 0;
|
|
22
|
+
return (React.createElement("li", { className: `cfgFeatureItem cfgAdditionalProduct ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
23
|
+
React.createElement(ExpandableHeadingRow, { heading: description || partNumber, expandable: optional || (hasChildren && permanentlyExpandedLevels <= 0), open: openOrSelected, onClick: () => {
|
|
24
|
+
if (optional) {
|
|
25
|
+
product.setSelected(!selected).catch((e) => {
|
|
26
|
+
setError(e);
|
|
27
|
+
throw e;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
setOpen((prev) => !prev);
|
|
32
|
+
}
|
|
33
|
+
}, symbol: optional ? ExpandableHeadingRowSymbol.Checkbox : undefined }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
|
|
34
|
+
React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
|
|
35
|
+
hasChildren &&
|
|
36
|
+
(!optional || selected) &&
|
|
37
|
+
(openOrSelected || 0 < permanentlyExpandedLevels) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
38
|
+
React.createElement(CfgProductConfigurationView, Object.assign({}, forwardProps(props), { productOrConfiguration: configuration })),
|
|
39
|
+
additionalProducts.length !== 0 && (React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--topLevel` },
|
|
40
|
+
React.createElement(AdditionalProductsView, Object.assign({}, forwardProps(props), { additionalProducts: additionalProducts, permanentlyExpandedLevels: permanentlyExpandedLevels })))))),
|
|
41
|
+
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })));
|
|
42
|
+
});
|
|
43
|
+
const AdditionalProductsView = (props) => {
|
|
44
|
+
const { additionalProducts, permanentlyExpandedLevels, additionalProductComponent: AdditionalProductComponent, } = props;
|
|
45
|
+
return (React.createElement(React.Fragment, null, additionalProducts.map((additionalProduct) => (React.createElement(AdditionalProductComponent, Object.assign({}, forwardProps(props), { key: additionalProduct.key, product: additionalProduct, permanentlyExpandedLevels: permanentlyExpandedLevels - 1 }))))));
|
|
46
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
3
|
-
export declare const CfgCheckboxView: React.FC<CfgOptionViewProps>;
|
|
4
|
-
export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<CfgOptionViewProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
3
|
+
export declare const CfgCheckboxView: React.FC<CfgOptionViewProps>;
|
|
4
|
+
export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<CfgOptionViewProps>;
|
|
5
5
|
//# sourceMappingURL=CfgCheckboxView.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgOptionCommonView } from "./CfgOptionCommonView.js";
|
|
3
|
-
export const CfgCheckboxView = (props) => {
|
|
4
|
-
var _a;
|
|
5
|
-
return (React.createElement(CfgOptionCommonView, Object.assign({}, props, { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` })));
|
|
6
|
-
};
|
|
7
|
-
export const CfgCheckboxViewMemo = React.memo(CfgCheckboxView);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgOptionCommonView } from "./CfgOptionCommonView.js";
|
|
3
|
+
export const CfgCheckboxView = (props) => {
|
|
4
|
+
var _a;
|
|
5
|
+
return (React.createElement(CfgOptionCommonView, Object.assign({}, props, { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` })));
|
|
6
|
+
};
|
|
7
|
+
export const CfgCheckboxViewMemo = React.memo(CfgCheckboxView);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
3
|
-
export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps>;
|
|
4
|
-
export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
3
|
+
export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps>;
|
|
4
|
+
export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
|
|
5
5
|
//# sourceMappingURL=CfgCheckboxesView.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { SelectionType } from "@configura/web-api";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { CfgConfigurationCommonView } from "./CfgConfigurationCommonView.js";
|
|
4
|
-
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
-
export const CfgCheckboxesView = (props) => {
|
|
6
|
-
var _a;
|
|
7
|
-
const { feature, optionSelectManyComponent: OptionComponent } = props;
|
|
8
|
-
if (feature.selectionType !== SelectionType.SelectMany) {
|
|
9
|
-
throw Error(`Unsupported selection type expected: ${SelectionType.SelectMany}, got: ${feature.selectionType}`);
|
|
10
|
-
}
|
|
11
|
-
const { options, description, code, notes } = 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 || code),
|
|
17
|
-
React.createElement(CfgConfigurationCommonView, Object.assign({}, forwardProps(props), { notes: notes })),
|
|
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
|
+
import { SelectionType } from "@configura/web-api";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CfgConfigurationCommonView } from "./CfgConfigurationCommonView.js";
|
|
4
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
5
|
+
export const CfgCheckboxesView = (props) => {
|
|
6
|
+
var _a;
|
|
7
|
+
const { feature, optionSelectManyComponent: OptionComponent } = props;
|
|
8
|
+
if (feature.selectionType !== SelectionType.SelectMany) {
|
|
9
|
+
throw Error(`Unsupported selection type expected: ${SelectionType.SelectMany}, got: ${feature.selectionType}`);
|
|
10
|
+
}
|
|
11
|
+
const { options, description, code, notes } = 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 || code),
|
|
17
|
+
React.createElement(CfgConfigurationCommonView, Object.assign({}, forwardProps(props), { notes: notes })),
|
|
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,8 +1,8 @@
|
|
|
1
|
-
import { DtoMiscFile, DtoNote } from "@configura/web-api";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
|
|
4
|
-
export declare const CfgConfigurationCommonView: React.FC<CfgProductConfigurationComponentAndPassthroughProps & {
|
|
5
|
-
notes?: DtoNote[];
|
|
6
|
-
miscFiles?: DtoMiscFile[];
|
|
7
|
-
}>;
|
|
1
|
+
import { DtoMiscFile, DtoNote } from "@configura/web-api";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { CfgProductConfigurationComponentAndPassthroughProps } from "./CfgFeatureView.js";
|
|
4
|
+
export declare const CfgConfigurationCommonView: React.FC<CfgProductConfigurationComponentAndPassthroughProps & {
|
|
5
|
+
notes?: DtoNote[];
|
|
6
|
+
miscFiles?: DtoMiscFile[];
|
|
7
|
+
}>;
|
|
8
8
|
//# sourceMappingURL=CfgConfigurationCommonView.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { forwardProps, } from "./CfgFeatureView.js";
|
|
3
|
-
export const CfgConfigurationCommonView = (props) => {
|
|
4
|
-
const { notesComponent: NotesComponent, miscFilesComponent: MiscFilesComponent, notes, miscFiles, } = props;
|
|
5
|
-
return (React.createElement(React.Fragment, null,
|
|
6
|
-
notes && notes.length !== 0 && (React.createElement(NotesComponent, Object.assign({}, forwardProps(props), { notes: notes }))),
|
|
7
|
-
miscFiles && miscFiles.length !== 0 && (React.createElement(MiscFilesComponent, Object.assign({}, forwardProps(props), { miscFiles: miscFiles })))));
|
|
8
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { forwardProps, } from "./CfgFeatureView.js";
|
|
3
|
+
export const CfgConfigurationCommonView = (props) => {
|
|
4
|
+
const { notesComponent: NotesComponent, miscFilesComponent: MiscFilesComponent, notes, miscFiles, } = props;
|
|
5
|
+
return (React.createElement(React.Fragment, null,
|
|
6
|
+
notes && notes.length !== 0 && (React.createElement(NotesComponent, Object.assign({}, forwardProps(props), { notes: notes }))),
|
|
7
|
+
miscFiles && miscFiles.length !== 0 && (React.createElement(MiscFilesComponent, Object.assign({}, forwardProps(props), { miscFiles: miscFiles })))));
|
|
8
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
3
|
-
export declare const CfgDropdownOptionView: React.FC<CfgOptionViewProps>;
|
|
4
|
-
export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<CfgOptionViewProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgOptionViewProps } from "./CfgFeatureView.js";
|
|
3
|
+
export declare const CfgDropdownOptionView: React.FC<CfgOptionViewProps>;
|
|
4
|
+
export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<CfgOptionViewProps>;
|
|
5
5
|
//# sourceMappingURL=CfgDropdownOptionView.d.ts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { ErrorContext } from "../ErrorContext.js";
|
|
3
|
-
import { CfgOptionCommonView } from "./CfgOptionCommonView.js";
|
|
4
|
-
export const CfgDropdownOptionView = (props) => {
|
|
5
|
-
var _a;
|
|
6
|
-
const { option } = props;
|
|
7
|
-
const { selected } = option;
|
|
8
|
-
const setError = useContext(ErrorContext);
|
|
9
|
-
const onClick = () => {
|
|
10
|
-
// As a convenience for when wanting to re-select something already
|
|
11
|
-
// selected to use the propagation side effects we have added this
|
|
12
|
-
// which will trigger a setSelected even though this is strictly not
|
|
13
|
-
// a change.
|
|
14
|
-
if (selected) {
|
|
15
|
-
option.setSelected(true).catch((e) => {
|
|
16
|
-
setError(e);
|
|
17
|
-
throw e;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return (React.createElement(CfgOptionCommonView, Object.assign({}, props, { className: `cfgFeatureItem cfgMb1 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, labelClassName: selected ? "cfgFeatureItemOption--checked" : "", onClick: onClick })));
|
|
22
|
-
};
|
|
23
|
-
export const CfgDropdownOptionViewMemo = React.memo(CfgDropdownOptionView);
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ErrorContext } from "../ErrorContext.js";
|
|
3
|
+
import { CfgOptionCommonView } from "./CfgOptionCommonView.js";
|
|
4
|
+
export const CfgDropdownOptionView = (props) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const { option } = props;
|
|
7
|
+
const { selected } = option;
|
|
8
|
+
const setError = useContext(ErrorContext);
|
|
9
|
+
const onClick = () => {
|
|
10
|
+
// As a convenience for when wanting to re-select something already
|
|
11
|
+
// selected to use the propagation side effects we have added this
|
|
12
|
+
// which will trigger a setSelected even though this is strictly not
|
|
13
|
+
// a change.
|
|
14
|
+
if (selected) {
|
|
15
|
+
option.setSelected(true).catch((e) => {
|
|
16
|
+
setError(e);
|
|
17
|
+
throw e;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return (React.createElement(CfgOptionCommonView, Object.assign({}, props, { className: `cfgFeatureItem cfgMb1 ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, labelClassName: selected ? "cfgFeatureItemOption--checked" : "", onClick: onClick })));
|
|
22
|
+
};
|
|
23
|
+
export const CfgDropdownOptionViewMemo = React.memo(CfgDropdownOptionView);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
3
|
-
export declare const CfgDropdownView: React.FC<CfgFeatureViewProps>;
|
|
4
|
-
export declare const CfgDropdownViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CfgFeatureViewProps } from "./CfgFeatureView.js";
|
|
3
|
+
export declare const CfgDropdownView: React.FC<CfgFeatureViewProps>;
|
|
4
|
+
export declare const CfgDropdownViewMemo: React.NamedExoticComponent<CfgFeatureViewProps>;
|
|
5
5
|
//# sourceMappingURL=CfgDropdownView.d.ts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { SelectionType } from "@configura/web-api";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { ExpandableHeadingRow } from "../ExpandableHeadingRow.js";
|
|
4
|
-
import { CfgConfigurationCommonView } from "./CfgConfigurationCommonView.js";
|
|
5
|
-
import { forwardProps } from "./CfgFeatureView.js";
|
|
6
|
-
export const CfgDropdownView = (props) => {
|
|
7
|
-
var _a;
|
|
8
|
-
const { feature, optionSelectOneComponent: OptionComponent, startOpen } = 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, code, notes } = feature;
|
|
13
|
-
const [open, setOpen] = useState(startOpen === true);
|
|
14
|
-
return (React.createElement("li", { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
15
|
-
React.createElement(ExpandableHeadingRow, { heading: description || code, 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
|
-
(options || notes.length !== 0) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
18
|
-
open && (React.createElement(React.Fragment, null,
|
|
19
|
-
React.createElement(CfgConfigurationCommonView, Object.assign({}, forwardProps(props), { notes: notes })),
|
|
20
|
-
React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--subLevel ${preview ? "cfgOptionTree--compThumb" : ""}` }, options.map((option) => (React.createElement(OptionComponent, Object.assign({}, forwardProps(props), { key: option.key, option: option }))))))),
|
|
21
|
-
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })))));
|
|
22
|
-
};
|
|
23
|
-
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 { CfgConfigurationCommonView } from "./CfgConfigurationCommonView.js";
|
|
5
|
+
import { forwardProps } from "./CfgFeatureView.js";
|
|
6
|
+
export const CfgDropdownView = (props) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const { feature, optionSelectOneComponent: OptionComponent, startOpen } = 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, code, notes } = feature;
|
|
13
|
+
const [open, setOpen] = useState(startOpen === true);
|
|
14
|
+
return (React.createElement("li", { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
|
|
15
|
+
React.createElement(ExpandableHeadingRow, { heading: description || code, 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
|
+
(options || notes.length !== 0) && (React.createElement("div", { className: "cfgFeatureItem__subTree" },
|
|
18
|
+
open && (React.createElement(React.Fragment, null,
|
|
19
|
+
React.createElement(CfgConfigurationCommonView, Object.assign({}, forwardProps(props), { notes: notes })),
|
|
20
|
+
React.createElement("ul", { className: `cfgOptionTree cfgOptionTree--subLevel ${preview ? "cfgOptionTree--compThumb" : ""}` }, options.map((option) => (React.createElement(OptionComponent, Object.assign({}, forwardProps(props), { key: option.key, option: option }))))))),
|
|
21
|
+
React.createElement("hr", { className: "cfgFeatureItem__hr cfgHr" })))));
|
|
22
|
+
};
|
|
23
|
+
export const CfgDropdownViewMemo = React.memo(CfgDropdownView);
|