@configura/web-ui 2.1.0-alpha.2 → 2.1.0-alpha.3

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 (115) hide show
  1. package/.eslintrc.json +5 -5
  2. package/.postcssrc.json +8 -8
  3. package/LICENSE +201 -201
  4. package/README.md +1 -1
  5. package/dist/components/CanvasWrapper.d.ts +9 -9
  6. package/dist/components/CanvasWrapper.js +8 -8
  7. package/dist/components/CfgPriceView.d.ts +6 -6
  8. package/dist/components/CfgPriceView.js +13 -13
  9. package/dist/components/ConfigurationActionsButtonRow.d.ts +14 -14
  10. package/dist/components/ConfigurationActionsButtonRow.js +16 -16
  11. package/dist/components/Configurator.d.ts +12 -12
  12. package/dist/components/Configurator.js +15 -15
  13. package/dist/components/ConfiguratorWrapper.d.ts +8 -8
  14. package/dist/components/ConfiguratorWrapper.js +5 -5
  15. package/dist/components/CurrencyPrice.d.ts +9 -9
  16. package/dist/components/CurrencyPrice.js +7 -7
  17. package/dist/components/ErrorContext.d.ts +2 -2
  18. package/dist/components/ErrorContext.js +2 -2
  19. package/dist/components/ExpandableHeadingRow.d.ts +15 -15
  20. package/dist/components/ExpandableHeadingRow.js +23 -23
  21. package/dist/components/Loading.d.ts +13 -13
  22. package/dist/components/Loading.js +20 -20
  23. package/dist/components/ProductInformation.d.ts +13 -13
  24. package/dist/components/ProductInformation.js +14 -14
  25. package/dist/components/ResetButton.d.ts +8 -8
  26. package/dist/components/ResetButton.js +7 -7
  27. package/dist/components/ShareView.d.ts +3 -3
  28. package/dist/components/ShareView.js +21 -21
  29. package/dist/components/TaskListView.d.ts +8 -8
  30. package/dist/components/TaskListView.js +69 -69
  31. package/dist/components/TaskStartView.d.ts +12 -12
  32. package/dist/components/TaskStartView.js +29 -29
  33. package/dist/components/icons/Checkmark.d.ts +6 -6
  34. package/dist/components/icons/Checkmark.js +12 -12
  35. package/dist/components/icons/Chevron.d.ts +7 -7
  36. package/dist/components/icons/Chevron.js +18 -18
  37. package/dist/components/icons/CircleXmarkIcon.d.ts +3 -3
  38. package/dist/components/icons/CircleXmarkIcon.js +8 -8
  39. package/dist/components/icons/DownloadIcon.d.ts +3 -3
  40. package/dist/components/icons/DownloadIcon.js +8 -8
  41. package/dist/components/icons/ErrorIcon.d.ts +3 -3
  42. package/dist/components/icons/ErrorIcon.js +8 -8
  43. package/dist/components/productConfiguration/CfgAdditionalProductView.d.ts +3 -3
  44. package/dist/components/productConfiguration/CfgAdditionalProductView.js +46 -46
  45. package/dist/components/productConfiguration/CfgCheckboxView.d.ts +4 -4
  46. package/dist/components/productConfiguration/CfgCheckboxView.js +7 -7
  47. package/dist/components/productConfiguration/CfgCheckboxesView.d.ts +4 -4
  48. package/dist/components/productConfiguration/CfgCheckboxesView.js +20 -20
  49. package/dist/components/productConfiguration/CfgConfigurationCommonView.d.ts +7 -7
  50. package/dist/components/productConfiguration/CfgConfigurationCommonView.js +8 -8
  51. package/dist/components/productConfiguration/CfgDropdownOptionView.d.ts +4 -4
  52. package/dist/components/productConfiguration/CfgDropdownOptionView.js +23 -23
  53. package/dist/components/productConfiguration/CfgDropdownView.d.ts +4 -4
  54. package/dist/components/productConfiguration/CfgDropdownView.js +23 -23
  55. package/dist/components/productConfiguration/CfgFeatureView.d.ts +72 -72
  56. package/dist/components/productConfiguration/CfgFeatureView.js +77 -76
  57. package/dist/components/productConfiguration/CfgGroupView.d.ts +4 -4
  58. package/dist/components/productConfiguration/CfgGroupView.js +7 -7
  59. package/dist/components/productConfiguration/CfgMiscFile.d.ts +4 -4
  60. package/dist/components/productConfiguration/CfgMiscFile.js +9 -9
  61. package/dist/components/productConfiguration/CfgMiscFiles.d.ts +4 -4
  62. package/dist/components/productConfiguration/CfgMiscFiles.js +5 -5
  63. package/dist/components/productConfiguration/CfgNote.d.ts +4 -4
  64. package/dist/components/productConfiguration/CfgNote.js +15 -15
  65. package/dist/components/productConfiguration/CfgNotes.d.ts +4 -4
  66. package/dist/components/productConfiguration/CfgNotes.js +5 -5
  67. package/dist/components/productConfiguration/CfgOptionCommonView.d.ts +6 -6
  68. package/dist/components/productConfiguration/CfgOptionCommonView.js +53 -50
  69. package/dist/components/productConfiguration/CfgOptionNumericView.d.ts +29 -29
  70. package/dist/components/productConfiguration/CfgOptionNumericView.js +132 -132
  71. package/dist/components/productConfiguration/CfgOptionPriceView.d.ts +9 -9
  72. package/dist/components/productConfiguration/CfgOptionPriceView.js +31 -31
  73. package/dist/components/productConfiguration/CfgProductConfigurationView.d.ts +24 -22
  74. package/dist/components/productConfiguration/CfgProductConfigurationView.js +50 -50
  75. package/dist/css/web-ui.css.map +1 -1
  76. package/dist/index.d.ts +29 -29
  77. package/dist/index.js +29 -29
  78. package/dist/scss/_button.scss +52 -52
  79. package/dist/scss/_configurator.scss +132 -132
  80. package/dist/scss/_expandable.scss +38 -38
  81. package/dist/scss/_feature-item.scss +146 -146
  82. package/dist/scss/_forms.scss +44 -44
  83. package/dist/scss/_hr.scss +16 -16
  84. package/dist/scss/_loading.scss +98 -98
  85. package/dist/scss/_misc-file-and-note.scss +44 -44
  86. package/dist/scss/_mixins.scss +56 -56
  87. package/dist/scss/_option-tree.scss +29 -29
  88. package/dist/scss/_product-information.scss +53 -53
  89. package/dist/scss/_range-view.scss +39 -39
  90. package/dist/scss/_slider.scss +70 -70
  91. package/dist/scss/_tasks.scss +72 -72
  92. package/dist/scss/_themed.scss +156 -156
  93. package/dist/scss/_utilities.scss +21 -21
  94. package/dist/scss/_variables.scss +6 -6
  95. package/dist/scss/icons/_checkmark.scss +46 -46
  96. package/dist/scss/icons/_chevron.scss +62 -62
  97. package/dist/scss/icons/_circle-xmark-icon.scss +24 -24
  98. package/dist/scss/icons/_download-icon.scss +24 -24
  99. package/dist/scss/icons/_error-icon.scss +24 -24
  100. package/dist/scss/web-ui.scss +11 -11
  101. package/dist/useCatParams.d.ts +17 -17
  102. package/dist/useCatParams.js +29 -29
  103. package/dist/useObservable.d.ts +4 -4
  104. package/dist/useObservable.js +18 -18
  105. package/dist/useRerender.d.ts +1 -1
  106. package/dist/useRerender.js +5 -5
  107. package/dist/useResize.d.ts +6 -6
  108. package/dist/useResize.js +47 -47
  109. package/dist/useSelected.d.ts +2 -2
  110. package/dist/useSelected.js +13 -13
  111. package/dist/useUniqueId.d.ts +1 -1
  112. package/dist/useUniqueId.js +3 -3
  113. package/dist/utilities.d.ts +5 -5
  114. package/dist/utilities.js +1 -1
  115. package/package.json +3 -3
@@ -1,15 +1,15 @@
1
- import React from "react";
2
- import { ConfigurationActionsButtonRow } from "./ConfigurationActionsButtonRow.js";
3
- import { CfgProductConfigurationView } from "./productConfiguration/CfgProductConfigurationView.js";
4
- import { ProductInformation } from "./ProductInformation.js";
5
- export const Configurator = (props) => {
6
- const { exportStatus, handleExport, handleRender, product, renderStatus } = props;
7
- return (React.createElement("div", { className: `cfgConfigurator ${props.className || ""}`, style: props.style }, product !== undefined && (React.createElement(React.Fragment, null,
8
- React.createElement("div", { className: "cfgConfiguratorHeader" },
9
- React.createElement(ProductInformation, { lang: product.lang, description: product.description, styleNr: product.styleNr, price: product.aggregatedPrice }),
10
- (handleExport !== undefined || handleRender !== undefined) && (React.createElement("div", { className: "cfgConfiguratorHeader__actions" },
11
- React.createElement(ConfigurationActionsButtonRow, { handleExport: handleExport, exportStatus: exportStatus, handleRender: handleRender, renderStatus: renderStatus })))),
12
- React.createElement("div", { className: "cfgConfiguratorTree" },
13
- React.createElement(CfgProductConfigurationView, { productOrConfiguration: product, permanentlyExpandedAdditionalProductLevels: 1 }),
14
- props.children)))));
15
- };
1
+ import React from "react";
2
+ import { ConfigurationActionsButtonRow } from "./ConfigurationActionsButtonRow.js";
3
+ import { CfgProductConfigurationView } from "./productConfiguration/CfgProductConfigurationView.js";
4
+ import { ProductInformation } from "./ProductInformation.js";
5
+ export const Configurator = (props) => {
6
+ const { exportStatus, handleExport, handleRender, product, renderStatus } = props;
7
+ return (React.createElement("div", { className: `cfgConfigurator ${props.className || ""}`, style: props.style }, product !== undefined && (React.createElement(React.Fragment, null,
8
+ React.createElement("div", { className: "cfgConfiguratorHeader" },
9
+ React.createElement(ProductInformation, { lang: product.lang, description: product.description, styleNr: product.styleNr, price: product.aggregatedPrice }),
10
+ (handleExport !== undefined || handleRender !== undefined) && (React.createElement("div", { className: "cfgConfiguratorHeader__actions" },
11
+ React.createElement(ConfigurationActionsButtonRow, { handleExport: handleExport, exportStatus: exportStatus, handleRender: handleRender, renderStatus: renderStatus })))),
12
+ React.createElement("div", { className: "cfgConfiguratorTree" },
13
+ React.createElement(CfgProductConfigurationView, { productOrConfiguration: product, permanentlyExpandedAdditionalProductLevels: 1 }),
14
+ props.children)))));
15
+ };
@@ -1,9 +1,9 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities";
3
- interface Props {
4
- children: React.ReactNode;
5
- }
6
- export declare type ConfiguratorWrapperRef = HTMLDivElement;
7
- export declare const ConfiguratorWrapper: React.ForwardRefExoticComponent<Props & CssProps & React.RefAttributes<HTMLDivElement>>;
8
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities";
3
+ interface Props {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare type ConfiguratorWrapperRef = HTMLDivElement;
7
+ export declare const ConfiguratorWrapper: React.ForwardRefExoticComponent<Props & CssProps & React.RefAttributes<HTMLDivElement>>;
8
+ export {};
9
9
  //# sourceMappingURL=ConfiguratorWrapper.d.ts.map
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- export const ConfiguratorWrapper = React.forwardRef((props, ref) => {
3
- const { children } = props;
4
- return (React.createElement("div", { ref: ref, className: `cfgConfiguratorWrapper ${props.className || ""}`, style: props.style }, children));
5
- });
1
+ import React from "react";
2
+ export const ConfiguratorWrapper = React.forwardRef((props, ref) => {
3
+ const { children } = props;
4
+ return (React.createElement("div", { ref: ref, className: `cfgConfiguratorWrapper ${props.className || ""}`, style: props.style }, children));
5
+ });
@@ -1,10 +1,10 @@
1
- import React from "react";
2
- interface Props {
3
- currency: string;
4
- language?: string;
5
- price: number;
6
- fractionDigits: number;
7
- }
8
- export declare const CurrencyPrice: React.FC<Props>;
9
- export {};
1
+ import React from "react";
2
+ interface Props {
3
+ currency: string;
4
+ language?: string;
5
+ price: number;
6
+ fractionDigits: number;
7
+ }
8
+ export declare const CurrencyPrice: React.FC<Props>;
9
+ export {};
10
10
  //# sourceMappingURL=CurrencyPrice.d.ts.map
@@ -1,7 +1,7 @@
1
- import { formatPrice } from "@configura/web-utilities";
2
- import React from "react";
3
- export const CurrencyPrice = (props) => {
4
- const { price, fractionDigits, currency, language } = props;
5
- const lang = language || navigator.language;
6
- return React.createElement(React.Fragment, null, formatPrice(price, fractionDigits, lang, currency));
7
- };
1
+ import { formatPrice } from "@configura/web-utilities";
2
+ import React from "react";
3
+ export const CurrencyPrice = (props) => {
4
+ const { price, fractionDigits, currency, language } = props;
5
+ const lang = language || navigator.language;
6
+ return React.createElement(React.Fragment, null, formatPrice(price, fractionDigits, lang, currency));
7
+ };
@@ -1,3 +1,3 @@
1
- import React from "react";
2
- export declare const ErrorContext: React.Context<(err: unknown) => void>;
1
+ import React from "react";
2
+ export declare const ErrorContext: React.Context<(err: unknown) => void>;
3
3
  //# sourceMappingURL=ErrorContext.d.ts.map
@@ -1,2 +1,2 @@
1
- import React from "react";
2
- export const ErrorContext = React.createContext(() => undefined);
1
+ import React from "react";
2
+ export const ErrorContext = React.createContext(() => undefined);
@@ -1,16 +1,16 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities.js";
3
- export declare enum ExpandableHeadingRowSymbol {
4
- Chevron = 0,
5
- Checkbox = 1
6
- }
7
- declare type Props = {
8
- heading: string;
9
- open: boolean;
10
- onClick: () => void;
11
- expandable?: boolean;
12
- symbol?: ExpandableHeadingRowSymbol;
13
- };
14
- export declare const ExpandableHeadingRow: React.FC<Props & CssProps>;
15
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities.js";
3
+ export declare enum ExpandableHeadingRowSymbol {
4
+ Chevron = 0,
5
+ Checkbox = 1
6
+ }
7
+ declare type Props = {
8
+ heading: string;
9
+ open: boolean;
10
+ onClick: () => void;
11
+ expandable?: boolean;
12
+ symbol?: ExpandableHeadingRowSymbol;
13
+ };
14
+ export declare const ExpandableHeadingRow: React.FC<Props & CssProps>;
15
+ export {};
16
16
  //# sourceMappingURL=ExpandableHeadingRow.d.ts.map
@@ -1,23 +1,23 @@
1
- import React from "react";
2
- import { CheckmarkWithBorder } from "./icons/Checkmark.js";
3
- import { Chevron } from "./icons/Chevron.js";
4
- export var ExpandableHeadingRowSymbol;
5
- (function (ExpandableHeadingRowSymbol) {
6
- ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Chevron"] = 0] = "Chevron";
7
- ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Checkbox"] = 1] = "Checkbox";
8
- })(ExpandableHeadingRowSymbol || (ExpandableHeadingRowSymbol = {}));
9
- export const ExpandableHeadingRow = (props) => {
10
- const { heading, open: active, onClick, children } = props;
11
- const symbol = props.symbol === undefined ? ExpandableHeadingRowSymbol.Chevron : props.symbol;
12
- const inner = (React.createElement(React.Fragment, null,
13
- children,
14
- React.createElement("div", { className: "cfgExpandableHeadingRow__title" },
15
- React.createElement("div", { className: "cfgTextOverflow" }, heading))));
16
- if (props.expandable === false) {
17
- return React.createElement("div", { className: "cfgExpandableHeadingRow" }, inner);
18
- }
19
- return (React.createElement(React.Fragment, null,
20
- React.createElement("button", { className: `cfgExpandableHeadingRow cfgExpandableHeadingRow--expandable ${props.className || ""}`, style: props.style, onClick: onClick },
21
- inner,
22
- React.createElement("div", { className: "cfgExpandableHeadingRow__icon" }, symbol === ExpandableHeadingRowSymbol.Chevron ? (React.createElement(Chevron, { active: active })) : (React.createElement(CheckmarkWithBorder, { active: active }))))));
23
- };
1
+ import React from "react";
2
+ import { CheckmarkWithBorder } from "./icons/Checkmark.js";
3
+ import { Chevron } from "./icons/Chevron.js";
4
+ export var ExpandableHeadingRowSymbol;
5
+ (function (ExpandableHeadingRowSymbol) {
6
+ ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Chevron"] = 0] = "Chevron";
7
+ ExpandableHeadingRowSymbol[ExpandableHeadingRowSymbol["Checkbox"] = 1] = "Checkbox";
8
+ })(ExpandableHeadingRowSymbol || (ExpandableHeadingRowSymbol = {}));
9
+ export const ExpandableHeadingRow = (props) => {
10
+ const { heading, open: active, onClick, children } = props;
11
+ const symbol = props.symbol === undefined ? ExpandableHeadingRowSymbol.Chevron : props.symbol;
12
+ const inner = (React.createElement(React.Fragment, null,
13
+ children,
14
+ React.createElement("div", { className: "cfgExpandableHeadingRow__title" },
15
+ React.createElement("div", { className: "cfgTextOverflow" }, heading))));
16
+ if (props.expandable === false) {
17
+ return React.createElement("div", { className: "cfgExpandableHeadingRow" }, inner);
18
+ }
19
+ return (React.createElement(React.Fragment, null,
20
+ React.createElement("button", { className: `cfgExpandableHeadingRow cfgExpandableHeadingRow--expandable ${props.className || ""}`, style: props.style, onClick: onClick },
21
+ inner,
22
+ React.createElement("div", { className: "cfgExpandableHeadingRow__icon" }, symbol === ExpandableHeadingRowSymbol.Chevron ? (React.createElement(Chevron, { active: active })) : (React.createElement(CheckmarkWithBorder, { active: active }))))));
23
+ };
@@ -1,14 +1,14 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities";
3
- interface SpinnerProps {
4
- small?: boolean;
5
- }
6
- interface OverlayProps {
7
- clickThrough?: boolean;
8
- fullWindow?: boolean;
9
- }
10
- export declare const Loading: React.FC<SpinnerProps & CssProps>;
11
- export declare const CenteredLoading: React.FC<CssProps>;
12
- export declare const OverlayLoading: React.FC<OverlayProps & CssProps>;
13
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities";
3
+ interface SpinnerProps {
4
+ small?: boolean;
5
+ }
6
+ interface OverlayProps {
7
+ clickThrough?: boolean;
8
+ fullWindow?: boolean;
9
+ }
10
+ export declare const Loading: React.FC<SpinnerProps & CssProps>;
11
+ export declare const CenteredLoading: React.FC<CssProps>;
12
+ export declare const OverlayLoading: React.FC<OverlayProps & CssProps>;
13
+ export {};
14
14
  //# sourceMappingURL=Loading.d.ts.map
@@ -1,20 +1,20 @@
1
- import React from "react";
2
- export const Loading = (props) => {
3
- const { small } = props;
4
- const smallClass = small ? "cfgLoading--small" : "";
5
- return (React.createElement("div", { className: `cfgLoading ${smallClass} ${props.className || ""}`, style: props.style }));
6
- };
7
- const LoadingWithText = (props) => {
8
- return (React.createElement("div", { className: `cfgLoadingWithText ${props.className || ""}`, style: props.style },
9
- React.createElement(Loading, Object.assign({}, props)),
10
- React.createElement("div", { className: "cfgLoadingWithText__text" }, "Loading")));
11
- };
12
- export const CenteredLoading = (props) => {
13
- return (React.createElement("div", { className: `cfgCenteredLoading ${props.className || ""}`, style: props.style },
14
- React.createElement(LoadingWithText, null)));
15
- };
16
- export const OverlayLoading = (props) => {
17
- const { clickThrough, fullWindow } = props;
18
- return (React.createElement("div", { className: `cfgOverlayLoading ${clickThrough ? "cfgOverlayLoading--clickThrough" : ""} ${fullWindow ? "cfgOverlayLoading--fullWindow" : ""} ${props.className || ""}`, style: props.style },
19
- React.createElement(LoadingWithText, null)));
20
- };
1
+ import React from "react";
2
+ export const Loading = (props) => {
3
+ const { small } = props;
4
+ const smallClass = small ? "cfgLoading--small" : "";
5
+ return (React.createElement("div", { className: `cfgLoading ${smallClass} ${props.className || ""}`, style: props.style }));
6
+ };
7
+ const LoadingWithText = (props) => {
8
+ return (React.createElement("div", { className: `cfgLoadingWithText ${props.className || ""}`, style: props.style },
9
+ React.createElement(Loading, Object.assign({}, props)),
10
+ React.createElement("div", { className: "cfgLoadingWithText__text" }, "Loading")));
11
+ };
12
+ export const CenteredLoading = (props) => {
13
+ return (React.createElement("div", { className: `cfgCenteredLoading ${props.className || ""}`, style: props.style },
14
+ React.createElement(LoadingWithText, null)));
15
+ };
16
+ export const OverlayLoading = (props) => {
17
+ const { clickThrough, fullWindow } = props;
18
+ return (React.createElement("div", { className: `cfgOverlayLoading ${clickThrough ? "cfgOverlayLoading--clickThrough" : ""} ${fullWindow ? "cfgOverlayLoading--fullWindow" : ""} ${props.className || ""}`, style: props.style },
19
+ React.createElement(LoadingWithText, null)));
20
+ };
@@ -1,14 +1,14 @@
1
- import { CfgPrice } from "@configura/web-api";
2
- import React, { ReactElement } from "react";
3
- import { CssProps } from "../utilities.js";
4
- interface Props {
5
- description: string | undefined;
6
- lang: string | undefined;
7
- styleNr: string | undefined;
8
- price: CfgPrice | undefined;
9
- leftContent?: ReactElement;
10
- rightContent?: ReactElement;
11
- }
12
- export declare const ProductInformation: React.FC<Props & CssProps>;
13
- export {};
1
+ import { CfgPrice } from "@configura/web-api";
2
+ import React, { ReactElement } from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ interface Props {
5
+ description: string | undefined;
6
+ lang: string | undefined;
7
+ styleNr: string | undefined;
8
+ price: CfgPrice | undefined;
9
+ leftContent?: ReactElement;
10
+ rightContent?: ReactElement;
11
+ }
12
+ export declare const ProductInformation: React.FC<Props & CssProps>;
13
+ export {};
14
14
  //# sourceMappingURL=ProductInformation.d.ts.map
@@ -1,14 +1,14 @@
1
- import React from "react";
2
- import { CfgPriceView } from "./CfgPriceView.js";
3
- export const ProductInformation = (props) => {
4
- const { styleNr, price, description, lang, leftContent, rightContent } = props;
5
- return (React.createElement("div", { className: `cfgProductInfo ${props.className || ""}`, style: props.style },
6
- React.createElement("div", { className: "cfgProductInfo__left" },
7
- React.createElement("h2", { className: "cfgProductInfo__name cfgTextOverflow" }, description),
8
- React.createElement("div", { className: "cfgProductInfo__number cfgTextOverflow" }, styleNr),
9
- leftContent),
10
- React.createElement("div", { className: "cfgProductInfo__right" },
11
- React.createElement("div", { className: "cfgProductInfo__name cfgProductInfo__name--right" },
12
- React.createElement(CfgPriceView, { price: price, lang: lang })),
13
- rightContent)));
14
- };
1
+ import React from "react";
2
+ import { CfgPriceView } from "./CfgPriceView.js";
3
+ export const ProductInformation = (props) => {
4
+ const { styleNr, price, description, lang, leftContent, rightContent } = props;
5
+ return (React.createElement("div", { className: `cfgProductInfo ${props.className || ""}`, style: props.style },
6
+ React.createElement("div", { className: "cfgProductInfo__left" },
7
+ React.createElement("h2", { className: "cfgProductInfo__name cfgTextOverflow" }, description),
8
+ React.createElement("div", { className: "cfgProductInfo__number cfgTextOverflow" }, styleNr),
9
+ leftContent),
10
+ React.createElement("div", { className: "cfgProductInfo__right" },
11
+ React.createElement("div", { className: "cfgProductInfo__name cfgProductInfo__name--right" },
12
+ React.createElement(CfgPriceView, { price: price, lang: lang })),
13
+ rightContent)));
14
+ };
@@ -1,9 +1,9 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities";
3
- declare type Props = {
4
- callback: () => void;
5
- tooltip: string;
6
- };
7
- export declare const ResetButton: React.FC<Props & CssProps>;
8
- export {};
1
+ import React from "react";
2
+ import { CssProps } from "../utilities";
3
+ declare type Props = {
4
+ callback: () => void;
5
+ tooltip: string;
6
+ };
7
+ export declare const ResetButton: React.FC<Props & CssProps>;
8
+ export {};
9
9
  //# sourceMappingURL=ResetButton.d.ts.map
@@ -1,7 +1,7 @@
1
- import React from "react";
2
- export const ResetButton = (props) => {
3
- var _a;
4
- const { callback, tooltip } = props;
5
- return (React.createElement("div", { className: `cfgReset ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
6
- React.createElement("button", { title: tooltip, className: "cfgInput", onClick: callback }, "Reset")));
7
- };
1
+ import React from "react";
2
+ export const ResetButton = (props) => {
3
+ var _a;
4
+ const { callback, tooltip } = props;
5
+ return (React.createElement("div", { className: `cfgReset ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
6
+ React.createElement("button", { title: tooltip, className: "cfgInput", onClick: callback }, "Reset")));
7
+ };
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import { CssProps } from "../utilities";
3
- export declare const ShareView: React.FC<CssProps>;
1
+ import React from "react";
2
+ import { CssProps } from "../utilities";
3
+ export declare const ShareView: React.FC<CssProps>;
4
4
  //# sourceMappingURL=ShareView.d.ts.map
@@ -1,21 +1,21 @@
1
- import { CfgHistoryManager } from "@configura/web-api";
2
- import React, { useState } from "react";
3
- const shareLabel = "Share";
4
- export const ShareView = (props) => {
5
- var _a;
6
- const [value, setValue] = useState(shareLabel);
7
- // No need for a useMemo, this will always be the same instance
8
- const historyManager = CfgHistoryManager.instance;
9
- return (React.createElement("div", { className: `cfgShare ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
10
- React.createElement("input", { title: "Click to copy a share-link to the clipboard", className: "cfgInput", readOnly: true, value: value, onBlur: () => setValue(shareLabel), onFocus: (event) => {
11
- const url = historyManager.getUrl();
12
- setValue(url);
13
- event.target.value = url;
14
- event.target.select();
15
- navigator.clipboard.writeText(url).catch((err) => {
16
- // In Firefox we get "Error DOMException: Clipboard write was blocked due to lack of user activation." when we
17
- // tab between windows, because the focus event triggers but is not user initiated. We just swallow any error.
18
- console.error("Error", err);
19
- });
20
- } })));
21
- };
1
+ import { CfgHistoryManager } from "@configura/web-api";
2
+ import React, { useState } from "react";
3
+ const shareLabel = "Share";
4
+ export const ShareView = (props) => {
5
+ var _a;
6
+ const [value, setValue] = useState(shareLabel);
7
+ // No need for a useMemo, this will always be the same instance
8
+ const historyManager = CfgHistoryManager.instance;
9
+ return (React.createElement("div", { className: `cfgShare ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
10
+ React.createElement("input", { title: "Click to copy a share-link to the clipboard", className: "cfgInput", readOnly: true, value: value, onBlur: () => setValue(shareLabel), onFocus: (event) => {
11
+ const url = historyManager.getUrl();
12
+ setValue(url);
13
+ event.target.value = url;
14
+ event.target.select();
15
+ navigator.clipboard.writeText(url).catch((err) => {
16
+ // In Firefox we get "Error DOMException: Clipboard write was blocked due to lack of user activation." when we
17
+ // tab between windows, because the focus event triggers but is not user initiated. We just swallow any error.
18
+ console.error("Error", err);
19
+ });
20
+ } })));
21
+ };
@@ -1,9 +1,9 @@
1
- import { TaskHandler } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../utilities.js";
4
- declare type Props = {
5
- taskHandler: TaskHandler;
6
- };
7
- export declare const TaskListView: React.FC<Props & CssProps>;
8
- export {};
1
+ import { TaskHandler } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ declare type Props = {
5
+ taskHandler: TaskHandler;
6
+ };
7
+ export declare const TaskListView: React.FC<Props & CssProps>;
8
+ export {};
9
9
  //# sourceMappingURL=TaskListView.d.ts.map
@@ -1,69 +1,69 @@
1
- import { isRenderFormat } from "@configura/web-api";
2
- import React, { useContext } from "react";
3
- import { ErrorContext } from "./ErrorContext.js";
4
- import { CircleXmarkIcon } from "./icons/CircleXmarkIcon.js";
5
- import { DownloadIcon } from "./icons/DownloadIcon.js";
6
- import { ErrorIcon } from "./icons/ErrorIcon.js";
7
- import { Loading } from "./Loading.js";
8
- export const TaskListView = (props) => {
9
- var _a;
10
- const tasks = props.taskHandler.tasks;
11
- if (tasks.length === 0) {
12
- return null;
13
- }
14
- return (React.createElement("div", { className: `cfgTaskList ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
15
- React.createElement("ul", null, tasks.map((task) => (React.createElement(TaskView, { task: task, key: task.uuid }))))));
16
- };
17
- const spinner = (React.createElement("span", { className: "cfgLoadingSizer" },
18
- React.createElement(Loading, null)));
19
- const TaskView = (props) => {
20
- const { task } = props;
21
- const { status, format, url, previewUrl } = task;
22
- const setError = useContext(ErrorContext);
23
- let icon;
24
- let statusMessage;
25
- switch (status) {
26
- case "pending":
27
- icon = spinner;
28
- statusMessage = `Pending ${format.toUpperCase()} ${isRenderFormat(format) ? "render" : "export"}...`;
29
- break;
30
- case "running":
31
- icon = spinner;
32
- statusMessage = `${isRenderFormat(format) ? "Rendering" : "Exporting"} ${format.toUpperCase()}...`;
33
- break;
34
- case "finished":
35
- icon = React.createElement(DownloadIcon, null);
36
- statusMessage = `Download ${format.toUpperCase()}`;
37
- break;
38
- case "failed":
39
- icon = React.createElement(ErrorIcon, null);
40
- statusMessage = `Failed ${isRenderFormat(format) ? "rendering" : "export"} ${format.toUpperCase()}`;
41
- break;
42
- default:
43
- icon = undefined;
44
- statusMessage = "";
45
- }
46
- return (React.createElement("li", { className: "cfgTaskList__item" },
47
- React.createElement("div", { className: "cfgTaskList__preview" }, previewUrl && React.createElement("img", { src: previewUrl, alt: `Preview of ${statusMessage}` })),
48
- React.createElement("div", { className: "cfgTaskList__icon" }, url === undefined ? (icon) : (React.createElement("a", { href: url, title: statusMessage }, icon))),
49
- React.createElement("div", { className: "cfgTaskList__status" },
50
- url === undefined ? (statusMessage) : (React.createElement("a", { href: url, title: statusMessage }, statusMessage)),
51
- status === "failed" && (React.createElement(React.Fragment, null,
52
- " ",
53
- React.createElement("button", { className: "cfgTaskList__restart", onClick: () => {
54
- task.restart().catch((e) => {
55
- setError(e);
56
- throw e;
57
- });
58
- } }, "Restart")))),
59
- React.createElement("button", { className: "cfgTaskList__abort", onClick: () => {
60
- try {
61
- task.abort();
62
- }
63
- catch (e) {
64
- setError(e);
65
- throw e;
66
- }
67
- } },
68
- React.createElement(CircleXmarkIcon, null))));
69
- };
1
+ import { isRenderFormat } from "@configura/web-api";
2
+ import React, { useContext } from "react";
3
+ import { ErrorContext } from "./ErrorContext.js";
4
+ import { CircleXmarkIcon } from "./icons/CircleXmarkIcon.js";
5
+ import { DownloadIcon } from "./icons/DownloadIcon.js";
6
+ import { ErrorIcon } from "./icons/ErrorIcon.js";
7
+ import { Loading } from "./Loading.js";
8
+ export const TaskListView = (props) => {
9
+ var _a;
10
+ const tasks = props.taskHandler.tasks;
11
+ if (tasks.length === 0) {
12
+ return null;
13
+ }
14
+ return (React.createElement("div", { className: `cfgTaskList ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, style: props.style },
15
+ React.createElement("ul", null, tasks.map((task) => (React.createElement(TaskView, { task: task, key: task.uuid }))))));
16
+ };
17
+ const spinner = (React.createElement("span", { className: "cfgLoadingSizer" },
18
+ React.createElement(Loading, null)));
19
+ const TaskView = (props) => {
20
+ const { task } = props;
21
+ const { status, format, url, previewUrl } = task;
22
+ const setError = useContext(ErrorContext);
23
+ let icon;
24
+ let statusMessage;
25
+ switch (status) {
26
+ case "pending":
27
+ icon = spinner;
28
+ statusMessage = `Pending ${format.toUpperCase()} ${isRenderFormat(format) ? "render" : "export"}...`;
29
+ break;
30
+ case "running":
31
+ icon = spinner;
32
+ statusMessage = `${isRenderFormat(format) ? "Rendering" : "Exporting"} ${format.toUpperCase()}...`;
33
+ break;
34
+ case "finished":
35
+ icon = React.createElement(DownloadIcon, null);
36
+ statusMessage = `Download ${format.toUpperCase()}`;
37
+ break;
38
+ case "failed":
39
+ icon = React.createElement(ErrorIcon, null);
40
+ statusMessage = `Failed ${isRenderFormat(format) ? "rendering" : "export"} ${format.toUpperCase()}`;
41
+ break;
42
+ default:
43
+ icon = undefined;
44
+ statusMessage = "";
45
+ }
46
+ return (React.createElement("li", { className: "cfgTaskList__item" },
47
+ React.createElement("div", { className: "cfgTaskList__preview" }, previewUrl && React.createElement("img", { src: previewUrl, alt: `Preview of ${statusMessage}` })),
48
+ React.createElement("div", { className: "cfgTaskList__icon" }, url === undefined ? (icon) : (React.createElement("a", { href: url, title: statusMessage }, icon))),
49
+ React.createElement("div", { className: "cfgTaskList__status" },
50
+ url === undefined ? (statusMessage) : (React.createElement("a", { href: url, title: statusMessage }, statusMessage)),
51
+ status === "failed" && (React.createElement(React.Fragment, null,
52
+ " ",
53
+ React.createElement("button", { className: "cfgTaskList__restart", onClick: () => {
54
+ task.restart().catch((e) => {
55
+ setError(e);
56
+ throw e;
57
+ });
58
+ } }, "Restart")))),
59
+ React.createElement("button", { className: "cfgTaskList__abort", onClick: () => {
60
+ try {
61
+ task.abort();
62
+ }
63
+ catch (e) {
64
+ setError(e);
65
+ throw e;
66
+ }
67
+ } },
68
+ React.createElement(CircleXmarkIcon, null))));
69
+ };
@@ -1,13 +1,13 @@
1
- import { CfgProduct, RenderOrExportFormat, RenderTaskParams, TaskHandler } from "@configura/web-api";
2
- import React from "react";
3
- import { CssProps } from "../utilities.js";
4
- declare type Props = {
5
- taskHandler: TaskHandler;
6
- product: CfgProduct;
7
- renderTaskParams: (() => RenderTaskParams) | RenderTaskParams | undefined;
8
- getPreviewUrl: (() => Promise<string>) | undefined;
9
- formats?: RenderOrExportFormat[];
10
- };
11
- export declare const TaskStartView: React.FC<Props & CssProps>;
12
- export {};
1
+ import { CfgProduct, RenderOrExportFormat, RenderTaskParams, TaskHandler } from "@configura/web-api";
2
+ import React from "react";
3
+ import { CssProps } from "../utilities.js";
4
+ declare type Props = {
5
+ taskHandler: TaskHandler;
6
+ product: CfgProduct;
7
+ renderTaskParams: (() => RenderTaskParams) | RenderTaskParams | undefined;
8
+ getPreviewUrl: (() => Promise<string>) | undefined;
9
+ formats?: RenderOrExportFormat[];
10
+ };
11
+ export declare const TaskStartView: React.FC<Props & CssProps>;
12
+ export {};
13
13
  //# sourceMappingURL=TaskStartView.d.ts.map