@configura/web-ui 1.6.0-iotest.2 → 1.6.1-alpha.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.
@@ -3,9 +3,9 @@ import { ExpandableHeadingRow, ExpandableHeadingRowSymbol } from "../ExpandableH
3
3
  import { forwardProps } from "./CfgFeatureView.js";
4
4
  import { CfgProductConfigurationView } from "./CfgProductConfigurationView.js";
5
5
  export const CfgAdditionalProductView = React.memo((props) => {
6
- const { product, permanentlyExpandedLevels, additionalProductComponent } = props;
6
+ const { product, permanentlyExpandedLevels, additionalProductComponent, startOpen } = props;
7
7
  const { partNumber, optional, selected, configuration, additionalProducts, preview, description, visible: configurationVisible, } = product;
8
- const [open, setOpen] = useState(false);
8
+ const [open, setOpen] = useState(startOpen === true);
9
9
  if (!configurationVisible) {
10
10
  // Visibility of a Product should not affect its Additional Products.
11
11
  // (Those have their own visibility.)
@@ -10,6 +10,7 @@ export declare const CfgCheckboxView: React.FC<Props & CfgProductConfigurationCo
10
10
  export declare const CfgCheckboxViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
11
  option: CfgOption;
12
12
  } & {
13
+ startOpen?: boolean | undefined;
13
14
  additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
15
  featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
16
  featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
@@ -3,6 +3,7 @@ import { CssProps } from "../../utilities.js";
3
3
  import { CfgFeatureViewProps } from "./CfgFeatureView.js";
4
4
  export declare const CfgCheckboxesView: React.FC<CfgFeatureViewProps & CssProps>;
5
5
  export declare const CfgCheckboxesViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
6
+ startOpen?: boolean | undefined;
6
7
  additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
7
8
  featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
8
9
  featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
@@ -10,6 +10,7 @@ export declare const CfgDropdownOptionView: React.FC<Props & CfgProductConfigura
10
10
  export declare const CfgDropdownOptionViewMemo: React.NamedExoticComponent<PassthroughProps & {
11
11
  option: CfgOption;
12
12
  } & {
13
+ startOpen?: boolean | undefined;
13
14
  additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
14
15
  featureFlattenComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
15
16
  featureGroupComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgFeatureViewProps> | undefined;
@@ -3,6 +3,7 @@ import { CssProps } from "../../utilities.js";
3
3
  import { CfgFeatureViewProps } from "./CfgFeatureView.js";
4
4
  export declare const CfgDropdownView: React.FC<CfgFeatureViewProps & CssProps>;
5
5
  export declare const CfgDropdownViewMemo: React.NamedExoticComponent<import("./CfgProductConfigurationView.js").PassthroughProps & {
6
+ startOpen?: boolean | undefined;
6
7
  additionalProductComponent?: React.ComponentType<import("./CfgFeatureView.js").CfgAdditionalProductViewProps> | undefined;
7
8
  featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
8
9
  featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
@@ -5,12 +5,12 @@ import { CfgDropdownOptionViewMemo } from "./CfgDropdownOptionView.js";
5
5
  import { forwardProps } from "./CfgFeatureView.js";
6
6
  export const CfgDropdownView = (props) => {
7
7
  var _a;
8
- const { feature } = props;
8
+ const { feature, startOpen } = props;
9
9
  if (feature.selectionType !== SelectionType.SelectOne) {
10
10
  throw Error(`Unsupported selection type expected: ${SelectionType.SelectOne}, got: ${feature.selectionType}`);
11
11
  }
12
12
  const { description, preview, options } = feature;
13
- const [open, setOpen] = useState(false);
13
+ const [open, setOpen] = useState(startOpen === true);
14
14
  return (React.createElement("li", { className: `cfgFeatureItem ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
15
15
  React.createElement(ExpandableHeadingRow, { heading: description, open: open, onClick: () => setOpen((prev) => !prev) }, preview && (React.createElement("div", { className: "cfgThumbnailPlaceholder" },
16
16
  React.createElement("img", { alt: `Preview for ${description}`, className: "cfgThumbnailImage", src: preview })))),
@@ -10,6 +10,7 @@ export declare type CfgAdditionalProductViewProps = CfgProductConfigurationCompo
10
10
  permanentlyExpandedLevels: number;
11
11
  };
12
12
  export declare type CfgProductConfigurationComponentAndPassthroughProps = PassthroughProps & {
13
+ startOpen?: boolean;
13
14
  additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps>;
14
15
  featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps>;
15
16
  featureGroupComponent?: React.ComponentType<CfgFeatureViewProps>;
@@ -19,6 +20,7 @@ export declare type CfgProductConfigurationComponentAndPassthroughProps = Passth
19
20
  export declare const forwardProps: (props: CfgProductConfigurationComponentAndPassthroughProps) => CfgProductConfigurationComponentAndPassthroughProps;
20
21
  export declare const CfgFeatureView: React.FC<CfgFeatureViewProps & CssProps>;
21
22
  export declare const CfgFeatureViewMemo: React.NamedExoticComponent<PassthroughProps & {
23
+ startOpen?: boolean | undefined;
22
24
  additionalProductComponent?: React.ComponentType<CfgAdditionalProductViewProps> | undefined;
23
25
  featureFlattenComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
24
26
  featureGroupComponent?: React.ComponentType<CfgFeatureViewProps> | undefined;
@@ -6,6 +6,7 @@ import { CfgGroupViewMemo } from "./CfgGroupView.js";
6
6
  export const forwardProps = (props) => {
7
7
  return {
8
8
  upchargeDisplayMode: props.upchargeDisplayMode,
9
+ startOpen: props.startOpen,
9
10
  additionalProductComponent: props.additionalProductComponent,
10
11
  featureFlattenComponent: props.featureFlattenComponent,
11
12
  featureGroupComponent: props.featureGroupComponent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@configura/web-ui",
3
- "version": "1.6.0-iotest.2",
3
+ "version": "1.6.1-alpha.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,7 +32,7 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@configura/web-api": "1.6.0-iotest.2"
35
+ "@configura/web-api": "^1.6.1-alpha.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@babel/preset-env": "^7.14.4",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "c03efb8cfe9fb28a83aaa19bbac09a30a7032e01"
67
+ "gitHead": "afaf1e342f0648246a1dcb6f7bc636d4d1979bec"
68
68
  }