@hitachivantara/uikit-react-lab 4.0.2 → 4.0.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.
- package/dist/Wizard/Wizard.d.ts +5 -5
- package/dist/Wizard/Wizard.js +4 -4
- package/dist/Wizard/Wizard.js.map +1 -1
- package/dist/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/Wizard/WizardActions/WizardActions.js +6 -6
- package/dist/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/Wizard/WizardContent/WizardContent.js +2 -2
- package/dist/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.js +50 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/Wizard/WizardContext/index.js +8 -0
- package/dist/Wizard/WizardContext/index.js.map +1 -1
- package/dist/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/Wizard/WizardTitle/WizardTitle.js +2 -2
- package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/Wizard/index.d.ts +15 -0
- package/dist/Wizard/index.js +8 -0
- package/dist/Wizard/index.js.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy/Wizard/Wizard.d.ts +5 -5
- package/dist/legacy/Wizard/Wizard.js +4 -4
- package/dist/legacy/Wizard/Wizard.js.map +1 -1
- package/dist/legacy/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/legacy/Wizard/WizardActions/WizardActions.js +8 -8
- package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/legacy/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/legacy/Wizard/WizardContent/WizardContent.js +1 -1
- package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/legacy/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js +37 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/legacy/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/legacy/Wizard/WizardContext/index.js +1 -0
- package/dist/legacy/Wizard/WizardContext/index.js.map +1 -1
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +1 -1
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/legacy/Wizard/index.d.ts +15 -0
- package/dist/legacy/Wizard/index.js +1 -0
- package/dist/legacy/Wizard/index.js.map +1 -1
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/Wizard/Wizard.d.ts +5 -5
- package/dist/modern/Wizard/Wizard.js +4 -4
- package/dist/modern/Wizard/Wizard.js.map +1 -1
- package/dist/modern/Wizard/WizardActions/WizardActions.d.ts +2 -2
- package/dist/modern/Wizard/WizardActions/WizardActions.js +6 -6
- package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/modern/Wizard/WizardContent/WizardContent.d.ts +1 -1
- package/dist/modern/Wizard/WizardContent/WizardContent.js +1 -1
- package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/modern/Wizard/WizardContext/WizardContext.d.ts +12 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.js +38 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.js.map +1 -0
- package/dist/modern/Wizard/WizardContext/index.d.ts +5 -0
- package/dist/modern/Wizard/WizardContext/index.js +1 -0
- package/dist/modern/Wizard/WizardContext/index.js.map +1 -1
- package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +7 -9
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js +1 -1
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/modern/Wizard/index.d.ts +15 -0
- package/dist/modern/Wizard/index.js +1 -0
- package/dist/modern/Wizard/index.js.map +1 -1
- package/dist/modern/index.js +1 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +3 -3
package/dist/Wizard/Wizard.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type HvWizardProps = StandardProps<
|
|
|
13
13
|
/**
|
|
14
14
|
* Class names to be applied.
|
|
15
15
|
*/
|
|
16
|
-
className
|
|
16
|
+
className?: string;
|
|
17
17
|
/**
|
|
18
18
|
* Current state of the Wizard.
|
|
19
19
|
*/
|
|
@@ -25,19 +25,19 @@ export type HvWizardProps = StandardProps<
|
|
|
25
25
|
/**
|
|
26
26
|
* Function executed on submit.
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
handleSubmit: any;
|
|
29
29
|
/**
|
|
30
30
|
* Title for the wizard.
|
|
31
31
|
*/
|
|
32
|
-
title
|
|
32
|
+
title?: string;
|
|
33
33
|
/**
|
|
34
34
|
* The content of the component.
|
|
35
35
|
*/
|
|
36
|
-
children
|
|
36
|
+
children?: React.ReactNode;
|
|
37
37
|
/**
|
|
38
38
|
* An object containing all the labels for the wizard.
|
|
39
39
|
*/
|
|
40
|
-
labels
|
|
40
|
+
labels?: HvWizardActionsProps["labels"] & HvWizardTitleProps["labels"];
|
|
41
41
|
/**
|
|
42
42
|
* Shows the summary button.
|
|
43
43
|
*/
|
package/dist/Wizard/Wizard.js
CHANGED
|
@@ -47,7 +47,7 @@ var _styles2 = _interopRequireDefault(require("./styles"));
|
|
|
47
47
|
|
|
48
48
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
49
49
|
|
|
50
|
-
var _excluded = ["className", "children", "onClose", "
|
|
50
|
+
var _excluded = ["className", "children", "onClose", "handleSubmit", "title", "open", "skippable", "loading", "hasSummary", "labels", "fixedHeight", "customStep"];
|
|
51
51
|
|
|
52
52
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
53
53
|
|
|
@@ -57,7 +57,7 @@ var HvWizard = function HvWizard(_ref) {
|
|
|
57
57
|
var className = _ref.className,
|
|
58
58
|
children = _ref.children,
|
|
59
59
|
onClose = _ref.onClose,
|
|
60
|
-
|
|
60
|
+
handleSubmit = _ref.handleSubmit,
|
|
61
61
|
title = _ref.title,
|
|
62
62
|
open = _ref.open,
|
|
63
63
|
_ref$skippable = _ref.skippable,
|
|
@@ -135,7 +135,7 @@ var HvWizard = function HvWizard(_ref) {
|
|
|
135
135
|
tab: tab,
|
|
136
136
|
changeTab: setTab,
|
|
137
137
|
handleClose: handleClose,
|
|
138
|
-
|
|
138
|
+
handleSubmit: handleSubmit
|
|
139
139
|
})]
|
|
140
140
|
}))
|
|
141
141
|
});
|
|
@@ -160,7 +160,7 @@ process.env.NODE_ENV !== "production" ? HvWizard.propTypes = {
|
|
|
160
160
|
/**
|
|
161
161
|
* Function executed on submit.
|
|
162
162
|
*/
|
|
163
|
-
|
|
163
|
+
handleSubmit: _propTypes.default.func.isRequired,
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* Enables the skip button.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wizard.js","names":["HvWizard","className","children","onClose","
|
|
1
|
+
{"version":3,"file":"Wizard.js","names":["HvWizard","className","children","onClose","handleSubmit","title","open","skippable","loading","hasSummary","labels","cancel","next","previous","skip","submit","summary","fixedHeight","customStep","others","React","useState","context","setContext","tab","setTab","contextValue","useMemo","useEffect","handleClose","useCallback","evt","reason","propTypes","PropTypes","string","bool","isRequired","func","node","shape","type","oneOf","stepSize","width","xs","number","sm","md","lg","xl","withStyles","styles","name"],"sources":["../../src/Wizard/Wizard.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport WizardContext from \"./WizardContext\";\nimport WizardContainer from \"./WizardContainer\";\nimport WizardTitle from \"./WizardTitle\";\nimport WizardContent from \"./WizardContent\";\nimport WizardActions from \"./WizardActions\";\n\nimport styles from \"./styles\";\n\nconst HvWizard = ({\n className,\n children,\n onClose,\n handleSubmit,\n title,\n open,\n skippable = true,\n loading = false,\n hasSummary = false,\n labels = {\n cancel: \"Cancel\",\n next: \"Next\",\n previous: \"Previous\",\n skip: \"Skip\",\n submit: \"Submit\",\n summary: \"Summary\",\n },\n fixedHeight = false,\n customStep,\n ...others\n}) => {\n const [context, setContext] = React.useState({});\n const [tab, setTab] = React.useState(0);\n\n const contextValue = React.useMemo(\n () => ({\n context,\n setContext,\n }),\n [context, setContext]\n );\n\n React.useEffect(() => {\n if (!open) {\n setTab(0);\n }\n }, [open]);\n\n const handleClose = React.useCallback(\n (evt, reason) => {\n if (reason !== \"backdropClick\") {\n onClose(evt, reason);\n }\n },\n [onClose]\n );\n\n return (\n <WizardContext.Provider value={contextValue}>\n <WizardContainer className={className} handleClose={handleClose} open={open} {...others}>\n <WizardTitle\n title={title}\n hasSummary={hasSummary}\n labels={labels}\n tab={tab}\n changeTab={setTab}\n customStep={customStep}\n />\n <WizardContent loading={loading} fixedHeight={fixedHeight} tab={tab}>\n {children}\n </WizardContent>\n <WizardActions\n loading={loading}\n skippable={skippable}\n labels={labels}\n tab={tab}\n changeTab={setTab}\n handleClose={handleClose}\n handleSubmit={handleSubmit}\n />\n </WizardContainer>\n </WizardContext.Provider>\n );\n};\n\nHvWizard.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Current state of the Wizard.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n onClose: PropTypes.func.isRequired,\n /**\n * Function executed on submit.\n */\n handleSubmit: PropTypes.func.isRequired,\n /**\n * Enables the skip button.\n */\n skippable: PropTypes.bool,\n /**\n * Title for the wizard.\n */\n title: PropTypes.string,\n /**\n * Shows the summary button.\n */\n hasSummary: PropTypes.bool,\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * An object containing all the labels for the wizard.\n */\n labels: PropTypes.shape({\n /**\n * Cancel button label.\n */\n cancel: PropTypes.string,\n /**\n * Skip button label.\n */\n skip: PropTypes.string,\n /**\n * Previous button label.\n */\n previous: PropTypes.string,\n /**\n * Next button label.\n */\n next: PropTypes.string,\n /**\n * Submit button label.\n */\n submit: PropTypes.string,\n /**\n * Summary button label.\n */\n summary: PropTypes.string,\n }),\n /**\n * Forces minimum height to the component.\n */\n fixedHeight: PropTypes.bool,\n /**\n * Whether the loading animation is shown.\n */\n loading: PropTypes.bool,\n /**\n * Custom object to define type, size and width of the StepNavigation component\n */\n customStep: PropTypes.shape({\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n }),\n};\n\nexport default withStyles(styles, { name: \"HvWizard\" })(HvWizard);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,OAqBX;EAA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A,CAAUY,MADO;MAErBC,EAAE,EAAEb,kBAAA,CAAUY,MAFO;MAGrBE,EAAE,EAAEd,kBAAA,CAAUY,MAHO;MAIrBG,EAAE,EAAEf,kBAAA,CAAUY,MAJO;MAKrBI,EAAE,EAAEhB,kBAAA,CAAUY;IALO,CAAhB;EAZmB,CAAhB;AAzEO,CAArB;;eA+Fe,IAAAK,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAyCrD,QAAzC,C"}
|
|
@@ -22,11 +22,11 @@ export type HvWizardActionsProps = StandardProps<
|
|
|
22
22
|
/**
|
|
23
23
|
* Function to handle the submit button. Also sends the current context state.
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
handleSubmit: (context: any) => void;
|
|
26
26
|
/**
|
|
27
27
|
* An object containing all the labels for the wizard actions component.
|
|
28
28
|
*/
|
|
29
|
-
labels
|
|
29
|
+
labels?: {
|
|
30
30
|
/**
|
|
31
31
|
* Cancel button label.
|
|
32
32
|
*/
|
|
@@ -58,7 +58,7 @@ var HvWizardActions = function HvWizardActions(_ref) {
|
|
|
58
58
|
|
|
59
59
|
var classes = _ref.classes,
|
|
60
60
|
handleClose = _ref.handleClose,
|
|
61
|
-
|
|
61
|
+
handleSubmit = _ref.handleSubmit,
|
|
62
62
|
changeTab = _ref.changeTab,
|
|
63
63
|
tab = _ref.tab,
|
|
64
64
|
_ref$loading = _ref.loading,
|
|
@@ -123,9 +123,9 @@ var HvWizardActions = function HvWizardActions(_ref) {
|
|
|
123
123
|
changeTab(lastPage);
|
|
124
124
|
}, [changeTab, context, lastPage, setContext]);
|
|
125
125
|
|
|
126
|
-
var
|
|
127
|
-
return
|
|
128
|
-
}, [
|
|
126
|
+
var handleSubmitInternal = _react.default.useCallback(function () {
|
|
127
|
+
return handleSubmit(context);
|
|
128
|
+
}, [handleSubmit, context]);
|
|
129
129
|
|
|
130
130
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_uikitReactCore.HvDialogActions, {
|
|
131
131
|
className: classes.actionsContainer,
|
|
@@ -158,7 +158,7 @@ var HvWizardActions = function HvWizardActions(_ref) {
|
|
|
158
158
|
category: "primary",
|
|
159
159
|
className: classes.buttonWidth,
|
|
160
160
|
disabled: loading || !canSubmit,
|
|
161
|
-
onClick:
|
|
161
|
+
onClick: handleSubmitInternal,
|
|
162
162
|
children: "".concat((_labels$submit = labels.submit) !== null && _labels$submit !== void 0 ? _labels$submit : "Submit")
|
|
163
163
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_uikitReactCore.HvButton, {
|
|
164
164
|
category: "ghost",
|
|
@@ -219,7 +219,7 @@ process.env.NODE_ENV !== "production" ? HvWizardActions.propTypes = {
|
|
|
219
219
|
/**
|
|
220
220
|
* Function to handle the submit button. Also sends the current context state.
|
|
221
221
|
*/
|
|
222
|
-
|
|
222
|
+
handleSubmit: _propTypes.default.func.isRequired,
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* An object containing all the labels for the wizard actions component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardActions.js","names":["HvWizardActions","classes","handleClose","onSubmit","changeTab","tab","loading","skippable","labels","cancel","next","previous","skip","submit","React","useContext","WizardContext","context","setContext","useState","pages","setPages","canSubmit","setCanSubmit","useEffect","contextEntries","Object","entries","length","validWizard","every","value","valid","lastPage","isLastPage","handleSkip","useCallback","skippedContext","map","child","handleSubmit","actionsContainer","buttonWidth","buttonsContainer","t","clsx","buttonSpacing","propTypes","PropTypes","shape","string","isRequired","number","func","bool","withStyles","styles","name"],"sources":["../../../src/Wizard/WizardActions/WizardActions.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport { HvButton, HvDialogActions, HvGrid } from \"@hitachivantara/uikit-react-core\";\nimport { Backwards, Forwards } from \"@hitachivantara/uikit-react-icons\";\nimport WizardContext from \"../WizardContext\";\n\nimport styles from \"./styles\";\n\nconst HvWizardActions = ({\n classes,\n handleClose,\n onSubmit,\n changeTab,\n tab,\n loading = false,\n skippable = false,\n labels = {\n cancel: \"Cancel\",\n next: \"Next\",\n previous: \"Previous\",\n skip: \"Skip\",\n submit: \"Submit\",\n },\n}) => {\n const { context, setContext } = React.useContext(WizardContext);\n const [pages, setPages] = React.useState(0);\n const [canSubmit, setCanSubmit] = React.useState(false);\n\n React.useEffect(() => {\n const contextEntries = Object.entries(context);\n if (contextEntries.length) {\n setPages(contextEntries.length);\n\n const validWizard = Object.entries(context).every(([, value]) => value.valid);\n if (validWizard !== canSubmit) {\n setCanSubmit(validWizard);\n }\n }\n }, [context]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const lastPage = pages - 1;\n const isLastPage = tab >= lastPage;\n\n const handleSkip = React.useCallback(() => {\n const skippedContext = Object.entries(context).map(([, child]) => ({\n ...child,\n valid: child.valid !== false,\n }));\n setContext(skippedContext);\n changeTab(lastPage);\n }, [changeTab, context, lastPage, setContext]);\n const handleSubmit = React.useCallback(() => onSubmit(context), [onSubmit, context]);\n\n return (\n <HvDialogActions className={classes.actionsContainer}>\n <HvGrid>\n <HvButton category=\"ghost\" onClick={handleClose} className={classes.buttonWidth}>\n {`${labels.cancel ?? \"Cancel\"}`}\n </HvButton>\n <HvButton\n category=\"ghost\"\n disabled={isLastPage || !skippable}\n className={classes.buttonWidth}\n onClick={handleSkip}\n >\n {`${labels.skip ?? \"Skip\"}`}\n </HvButton>\n </HvGrid>\n <HvGrid className={classes.buttonsContainer}>\n <HvButton\n category=\"ghost\"\n className={classes.buttonWidth}\n disabled={tab <= 0}\n onClick={() => changeTab((t) => t - 1)}\n >\n <Backwards />\n {`${labels.previous ?? \"Previous\"}`}\n </HvButton>\n\n {isLastPage ? (\n <HvButton\n category=\"primary\"\n className={classes.buttonWidth}\n disabled={loading || !canSubmit}\n onClick={handleSubmit}\n >\n {`${labels.submit ?? \"Submit\"}`}\n </HvButton>\n ) : (\n <HvButton\n category=\"ghost\"\n className={clsx(classes.buttonWidth, classes.buttonSpacing)}\n onClick={() => changeTab((t) => t + 1)}\n disabled={!skippable && !context?.[tab]?.valid}\n >\n {`${labels.next ?? \"Next\"}`}\n <Forwards />\n </HvButton>\n )}\n </HvGrid>\n </HvDialogActions>\n );\n};\n\nHvWizardActions.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component which contains the groups of buttons.\n */\n actionsContainer: PropTypes.string,\n /**\n * Styles applied to the component which contains the buttons.\n */\n buttonsContainer: PropTypes.string,\n /**\n * Styles applied to the Button component to override its width.\n */\n buttonWidth: PropTypes.string,\n /**\n * Styles applied to some Button components to override its left padding.\n */\n buttonSpacing: PropTypes.string,\n }).isRequired,\n /**\n * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.\n */\n tab: PropTypes.number.isRequired,\n /**\n * Function to change the tab when pressing previous and next buttons.\n */\n changeTab: PropTypes.func.isRequired,\n /**\n * Function to handle the cancel button.\n */\n handleClose: PropTypes.func.isRequired,\n /**\n * Function to handle the submit button. Also sends the current context state.\n */\n onSubmit: PropTypes.func.isRequired,\n /**\n * An object containing all the labels for the wizard actions component.\n */\n labels: PropTypes.shape({\n /**\n * Cancel button label.\n */\n cancel: PropTypes.string,\n /**\n * Skip button label.\n */\n skip: PropTypes.string,\n /**\n * Previous button label.\n */\n previous: PropTypes.string,\n /**\n * Next button label.\n */\n next: PropTypes.string,\n /**\n * Submit button label.\n */\n submit: PropTypes.string,\n }),\n /**\n * Whether the submit button is disabled.\n */\n loading: PropTypes.bool,\n /**\n * Enables the skip button.\n */\n skippable: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvWizardActions\" })(HvWizardActions);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eA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WizardActions","classes","handleClose","handleSubmit","changeTab","tab","loading","skippable","labels","cancel","next","previous","skip","submit","React","useContext","HvWizardContext","context","setContext","useState","pages","setPages","canSubmit","setCanSubmit","useEffect","contextEntries","Object","entries","length","validWizard","every","value","valid","lastPage","isLastPage","handleSkip","useCallback","skippedContext","map","child","handleSubmitInternal","actionsContainer","buttonWidth","buttonsContainer","t","clsx","buttonSpacing","propTypes","PropTypes","shape","string","isRequired","number","func","bool","withStyles","styles","name"],"sources":["../../../src/Wizard/WizardActions/WizardActions.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport { HvButton, HvDialogActions, HvGrid } from \"@hitachivantara/uikit-react-core\";\nimport { Backwards, Forwards } from \"@hitachivantara/uikit-react-icons\";\nimport HvWizardContext from \"../WizardContext\";\n\nimport styles from \"./styles\";\n\nconst HvWizardActions = ({\n classes,\n handleClose,\n handleSubmit,\n changeTab,\n tab,\n loading = false,\n skippable = false,\n labels = {\n cancel: \"Cancel\",\n next: \"Next\",\n previous: \"Previous\",\n skip: \"Skip\",\n submit: \"Submit\",\n },\n}) => {\n const { context, setContext } = React.useContext(HvWizardContext);\n const [pages, setPages] = React.useState(0);\n const [canSubmit, setCanSubmit] = React.useState(false);\n\n React.useEffect(() => {\n const contextEntries = Object.entries(context);\n if (contextEntries.length) {\n setPages(contextEntries.length);\n\n const validWizard = Object.entries(context).every(([, value]) => value.valid);\n if (validWizard !== canSubmit) {\n setCanSubmit(validWizard);\n }\n }\n }, [context]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const lastPage = pages - 1;\n const isLastPage = tab >= lastPage;\n\n const handleSkip = React.useCallback(() => {\n const skippedContext = Object.entries(context).map(([, child]) => ({\n ...child,\n valid: child.valid !== false,\n }));\n setContext(skippedContext);\n changeTab(lastPage);\n }, [changeTab, context, lastPage, setContext]);\n const handleSubmitInternal = React.useCallback(\n () => handleSubmit(context),\n [handleSubmit, context]\n );\n\n return (\n <HvDialogActions className={classes.actionsContainer}>\n <HvGrid>\n <HvButton category=\"ghost\" onClick={handleClose} className={classes.buttonWidth}>\n {`${labels.cancel ?? \"Cancel\"}`}\n </HvButton>\n <HvButton\n category=\"ghost\"\n disabled={isLastPage || !skippable}\n className={classes.buttonWidth}\n onClick={handleSkip}\n >\n {`${labels.skip ?? \"Skip\"}`}\n </HvButton>\n </HvGrid>\n <HvGrid className={classes.buttonsContainer}>\n <HvButton\n category=\"ghost\"\n className={classes.buttonWidth}\n disabled={tab <= 0}\n onClick={() => changeTab((t) => t - 1)}\n >\n <Backwards />\n {`${labels.previous ?? \"Previous\"}`}\n </HvButton>\n\n {isLastPage ? (\n <HvButton\n category=\"primary\"\n className={classes.buttonWidth}\n disabled={loading || !canSubmit}\n onClick={handleSubmitInternal}\n >\n {`${labels.submit ?? \"Submit\"}`}\n </HvButton>\n ) : (\n <HvButton\n category=\"ghost\"\n className={clsx(classes.buttonWidth, classes.buttonSpacing)}\n onClick={() => changeTab((t) => t + 1)}\n disabled={!skippable && !context?.[tab]?.valid}\n >\n {`${labels.next ?? \"Next\"}`}\n <Forwards />\n </HvButton>\n )}\n </HvGrid>\n </HvDialogActions>\n );\n};\n\nHvWizardActions.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component which contains the groups of buttons.\n */\n actionsContainer: PropTypes.string,\n /**\n * Styles applied to the component which contains the buttons.\n */\n buttonsContainer: PropTypes.string,\n /**\n * Styles applied to the Button component to override its width.\n */\n buttonWidth: PropTypes.string,\n /**\n * Styles applied to some Button components to override its left padding.\n */\n buttonSpacing: PropTypes.string,\n }).isRequired,\n /**\n * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.\n */\n tab: PropTypes.number.isRequired,\n /**\n * Function to change the tab when pressing previous and next buttons.\n */\n changeTab: PropTypes.func.isRequired,\n /**\n * Function to handle the cancel button.\n */\n handleClose: PropTypes.func.isRequired,\n /**\n * Function to handle the submit button. Also sends the current context state.\n */\n handleSubmit: PropTypes.func.isRequired,\n /**\n * An object containing all the labels for the wizard actions component.\n */\n labels: PropTypes.shape({\n /**\n * Cancel button label.\n */\n cancel: PropTypes.string,\n /**\n * Skip button label.\n */\n skip: PropTypes.string,\n /**\n * Previous button label.\n */\n previous: PropTypes.string,\n /**\n * Next button label.\n */\n next: PropTypes.string,\n /**\n * Submit button label.\n */\n submit: PropTypes.string,\n }),\n /**\n * Whether the submit button is disabled.\n */\n loading: PropTypes.bool,\n /**\n * Enables the skip button.\n */\n skippable: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvWizardActions\" })(HvWizardActions);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OAelB;EAAA;;EAAA,IAdJC,OAcI,QAdJA,OAcI;EAAA,IAbJC,WAaI,QAbJA,WAaI;EAAA,IAZJC,YAYI,QAZJA,YAYI;EAAA,IAXJC,SAWI,QAXJA,SAWI;EAAA,IAVJC,GAUI,QAVJA,GAUI;EAAA,wBATJC,OASI;EAAA,IATJA,OASI,6BATM,KASN;EAAA,0BARJC,SAQI;EAAA,IARJA,SAQI,+BARQ,KAQR;EAAA,uBAPJC,MAOI;EAAA,IAPJA,MAOI,4BAPK;IACPC,MAAM,EAAE,QADD;IAEPC,IAAI,EAAE,MAFC;IAGPC,QAAQ,EAAE,UAHH;IAIPC,IAAI,EAAE,MAJC;IAKPC,MAAM,EAAE;EALD,CAOL;;EACJ,wBAAgCC,cAAA,CAAMC,UAAN,CAAiBC,sBAAjB,CAAhC;EAAA,IAAQC,OAAR,qBAAQA,OAAR;EAAA,IAAiBC,UAAjB,qBAAiBA,UAAjB;;EACA,sBAA0BJ,cAAA,CAAMK,QAAN,CAAe,CAAf,CAA1B;EAAA;EAAA,IAAOC,KAA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IxC,MAAM,EAAEuC,kBAAA,CAAUE,MAJI;;IAKtB;AACJ;AACA;IACItC,IAAI,EAAEoC,kBAAA,CAAUE,MARM;;IAStB;AACJ;AACA;IACIvC,QAAQ,EAAEqC,kBAAA,CAAUE,MAZE;;IAatB;AACJ;AACA;IACIxC,IAAI,EAAEsC,kBAAA,CAAUE,MAhBM;;IAiBtB;AACJ;AACA;IACIrC,MAAM,EAAEmC,kBAAA,CAAUE;EApBI,CAAhB,CAzCkB;;EA+D1B;AACF;AACA;EACE5C,OAAO,EAAE0C,kBAAA,CAAUM,IAlEO;;EAmE1B;AACF;AACA;EACE/C,SAAS,EAAEyC,kBAAA,CAAUM;AAtEK,CAA5B;;eAyEe,IAAAC,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAgDzD,eAAhD,C"}
|
|
@@ -41,7 +41,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
41
41
|
|
|
42
42
|
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _WizardContext = _interopRequireDefault(require("../WizardContext"));
|
|
45
45
|
|
|
46
46
|
var _LoadingContainer = _interopRequireDefault(require("./LoadingContainer"));
|
|
47
47
|
|
|
@@ -74,7 +74,7 @@ var HvWizardContent = function HvWizardContent(_ref) {
|
|
|
74
74
|
})));
|
|
75
75
|
}, {});
|
|
76
76
|
|
|
77
|
-
var _React$useContext = _react.default.useContext(
|
|
77
|
+
var _React$useContext = _react.default.useContext(_WizardContext.default),
|
|
78
78
|
context = _React$useContext.context,
|
|
79
79
|
setContext = _React$useContext.setContext;
|
|
80
80
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardContent.js","names":["HvWizardContent","classes","fixedHeight","loading","children","tab","arrayChildren","React","Children","toArray","initialContext","reduce","acc","child","index","invalid","props","mustValidate","valid","form","touched","useContext","HvWizardContext","context","setContext","useEffect","updatedContext","Object","entries","key","childState","clsx","contentContainer","map","cloneElement","propTypes","PropTypes","number","isRequired","node","shape","string","bool","withStyles","styles","name"],"sources":["../../../src/Wizard/WizardContent/WizardContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport { HvDialogContent } from \"@hitachivantara/uikit-react-core\";\nimport
|
|
1
|
+
{"version":3,"file":"WizardContent.js","names":["HvWizardContent","classes","fixedHeight","loading","children","tab","arrayChildren","React","Children","toArray","initialContext","reduce","acc","child","index","invalid","props","mustValidate","valid","form","touched","useContext","HvWizardContext","context","setContext","useEffect","updatedContext","Object","entries","key","childState","clsx","contentContainer","map","cloneElement","propTypes","PropTypes","number","isRequired","node","shape","string","bool","withStyles","styles","name"],"sources":["../../../src/Wizard/WizardContent/WizardContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport clsx from \"clsx\";\nimport { HvDialogContent } from \"@hitachivantara/uikit-react-core\";\nimport HvWizardContext from \"../WizardContext\";\nimport LoadingContainer from \"./LoadingContainer\";\n\nimport styles from \"./styles\";\n\nconst HvWizardContent = ({ classes, fixedHeight = false, loading = false, children, tab }) => {\n const arrayChildren = React.Children.toArray(children);\n const initialContext = arrayChildren.reduce((acc, child, index) => {\n const invalid = child.props.mustValidate === true ? false : null;\n const valid = invalid ?? (index === 0 || null);\n return {\n ...acc,\n [index]: { ...child.props, form: {}, valid, touched: index === 0 },\n };\n }, {});\n\n const { context, setContext } = React.useContext(HvWizardContext);\n\n React.useEffect(() => {\n setContext(initialContext);\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n React.useEffect(() => {\n if (tab && !context[tab]?.touched) {\n const updatedContext = Object.entries(context).reduce(\n (acc, [key, childState]) => ({\n ...acc,\n ...(+key <= tab\n ? { [key]: { ...childState, touched: true, valid: childState.valid ?? true } }\n : { [key]: childState }),\n }),\n {}\n );\n\n setContext(updatedContext);\n }\n }, [tab]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n <HvDialogContent\n className={clsx(classes.contentContainer, {\n [classes.fixedHeight]: fixedHeight,\n })}\n indentContent\n >\n <LoadingContainer hidden={!loading}>\n {React.Children.map(arrayChildren, (child, index) => {\n if (index === tab) {\n return React.cloneElement(child, { tab });\n }\n return null;\n })}\n </LoadingContainer>\n </HvDialogContent>\n );\n};\n\nHvWizardContent.propTypes = {\n /**\n * Current tab to show.\n */\n tab: PropTypes.number.isRequired,\n /**\n * Tabs to show on the Wizard.\n */\n children: PropTypes.node.isRequired,\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Style applied to the Wizard content container\n */\n contentContainer: PropTypes.string,\n /**\n * Style applied to the Wizard to fix its height.\n */\n fixedHeight: PropTypes.string,\n }).isRequired,\n /**\n * Forces minimum height to the component.\n */\n fixedHeight: PropTypes.bool,\n /**\n * Whether the loading animation is shown.\n */\n loading: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvWizardContent\" })(HvWizardContent);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,OAAsE;EAAA,IAAnEC,OAAmE,QAAnEA,OAAmE;EAAA,4BAA1DC,WAA0D;EAAA,IAA1DA,WAA0D,iCAA5C,KAA4C;EAAA,wBAArCC,OAAqC;EAAA,IAArCA,OAAqC,6BAA3B,KAA2B;EAAA,IAApBC,QAAoB,QAApBA,QAAoB;EAAA,IAAVC,GAAU,QAAVA,GAAU;;EAC5F,IAAMC,aAAa,GAAGC,cAAA,CAAMC,QAAN,CAAeC,OAAf,CAAuBL,QAAvB,CAAtB;;EACA,IAAMM,cAAc,GAAGJ,aAAa,CAACK,MAAd,CAAqB,UAACC,GAAD,EAAMC,KAAN,EAAaC,KAA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ey = "root";
|
|
4
|
+
|
|
5
|
+
export type HvWizardContextProps = {
|
|
6
|
+
context: any;
|
|
7
|
+
setContext: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function HvWizardContext(
|
|
11
|
+
props: HvWizardContextProps
|
|
12
|
+
): React.Context<HvWizardContextProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StandardProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export type HvWizardContextProviderClassKey = "root";
|
|
4
|
+
|
|
5
|
+
export interface HvWizardContextProviderProps
|
|
6
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvWizardContextProviderClassKey> {
|
|
7
|
+
/**
|
|
8
|
+
* Initial context value
|
|
9
|
+
*/
|
|
10
|
+
value?: {
|
|
11
|
+
/**
|
|
12
|
+
* Initial context object
|
|
13
|
+
*/
|
|
14
|
+
context: any;
|
|
15
|
+
/**
|
|
16
|
+
* Function to modify the context
|
|
17
|
+
*/
|
|
18
|
+
setContext: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Child components for the Wizard
|
|
22
|
+
*/
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function HvWizardContextProvider(
|
|
27
|
+
props: HvWizardContextProviderProps
|
|
28
|
+
): JSX.Element | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _WizardContext = _interopRequireDefault(require("./WizardContext"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var WizardContextProvider = function WizardContextProvider(_ref) {
|
|
19
|
+
var value = _ref.value,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_WizardContext.default.Provider, {
|
|
22
|
+
value: value,
|
|
23
|
+
children: children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
process.env.NODE_ENV !== "production" ? WizardContextProvider.propTypes = {
|
|
28
|
+
/**
|
|
29
|
+
* Initial context value
|
|
30
|
+
*/
|
|
31
|
+
value: _propTypes.default.shape({
|
|
32
|
+
/**
|
|
33
|
+
* Initial context object
|
|
34
|
+
*/
|
|
35
|
+
context: _propTypes.default.shape({}),
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Function to modify the context
|
|
39
|
+
*/
|
|
40
|
+
setContext: _propTypes.default.func
|
|
41
|
+
}),
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Child components for the Wizard
|
|
45
|
+
*/
|
|
46
|
+
children: _propTypes.default.node.isRequired
|
|
47
|
+
} : void 0;
|
|
48
|
+
var _default = WizardContextProvider;
|
|
49
|
+
exports.default = _default;
|
|
50
|
+
//# sourceMappingURL=WizardContextProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContextProvider.js","names":["WizardContextProvider","value","children","propTypes","PropTypes","shape","context","setContext","func","node","isRequired"],"sources":["../../../src/Wizard/WizardContext/WizardContextProvider.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport HvWizardContext from \"./WizardContext\";\n\nconst WizardContextProvider = ({ value, children }) => {\n return <HvWizardContext.Provider value={value}>{children}</HvWizardContext.Provider>;\n};\n\nWizardContextProvider.propTypes = {\n /**\n * Initial context value\n */\n value: PropTypes.shape({\n /**\n * Initial context object\n */\n context: PropTypes.shape({}),\n /**\n * Function to modify the context\n */\n setContext: PropTypes.func,\n }),\n /**\n * Child components for the Wizard\n */\n children: PropTypes.node.isRequired,\n};\n\nexport default WizardContextProvider;\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,OAAyB;EAAA,IAAtBC,KAAsB,QAAtBA,KAAsB;EAAA,IAAfC,QAAe,QAAfA,QAAe;EACrD,oBAAO,qBAAC,sBAAD,CAAiB,QAAjB;IAA0B,KAAK,EAAED,KAAjC;IAAA,UAAyCC;EAAzC,EAAP;AACD,CAFD;;AAIA,wCAAAF,qBAAqB,CAACG,SAAtB,GAAkC;EAChC;AACF;AACA;EACEF,KAAK,EAAEG,kBAAA,CAAUC,KAAV,CAAgB;IACrB;AACJ;AACA;IACIC,OAAO,EAAEF,kBAAA,CAAUC,KAAV,CAAgB,EAAhB,CAJY;;IAKrB;AACJ;AACA;IACIE,UAAU,EAAEH,kBAAA,CAAUI;EARD,CAAhB,CAJyB;;EAchC;AACF;AACA;EACEN,QAAQ,EAAEE,kBAAA,CAAUK,IAAV,CAAeC;AAjBO,CAAlC;eAoBeV,qB"}
|
|
@@ -5,6 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
Object.defineProperty(exports, "HvWizardContextProvider", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _WizardContextProvider.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
8
14
|
Object.defineProperty(exports, "default", {
|
|
9
15
|
enumerable: true,
|
|
10
16
|
get: function get() {
|
|
@@ -13,4 +19,6 @@ Object.defineProperty(exports, "default", {
|
|
|
13
19
|
});
|
|
14
20
|
|
|
15
21
|
var _WizardContext = _interopRequireDefault(require("./WizardContext"));
|
|
22
|
+
|
|
23
|
+
var _WizardContextProvider = _interopRequireDefault(require("./WizardContextProvider"));
|
|
16
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Wizard/WizardContext/index.js"],"sourcesContent":["export { default } from \"./WizardContext\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Wizard/WizardContext/index.js"],"sourcesContent":["export { default } from \"./WizardContext\";\nexport { default as HvWizardContextProvider } from \"./WizardContextProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;AACA"}
|
|
@@ -4,22 +4,20 @@ import { HvStepNavigationProps } from "../../StepNavigation";
|
|
|
4
4
|
|
|
5
5
|
export type HvWizardTitleClassKey = "root";
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
React.HTMLAttributes<HTMLDivElement>,
|
|
9
|
-
HvWizardTitleClassKey
|
|
10
|
-
> & {
|
|
7
|
+
export interface HvWizardTitleProps
|
|
8
|
+
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvWizardTitleClassKey> {
|
|
11
9
|
/**
|
|
12
10
|
* Title for the wizard.
|
|
13
11
|
*/
|
|
14
|
-
title
|
|
12
|
+
title?: string;
|
|
15
13
|
/**
|
|
16
14
|
* Shows the summary button.
|
|
17
15
|
*/
|
|
18
|
-
hasSummary
|
|
16
|
+
hasSummary?: boolean;
|
|
19
17
|
/**
|
|
20
18
|
* An object containing all the labels for the wizard header.
|
|
21
19
|
*/
|
|
22
|
-
labels
|
|
20
|
+
labels?: {
|
|
23
21
|
/**
|
|
24
22
|
* Summary button label.
|
|
25
23
|
*/
|
|
@@ -36,7 +34,7 @@ export type HvWizardTitleProps = StandardProps<
|
|
|
36
34
|
/**
|
|
37
35
|
* Custom object to define type, size and width of the StepNavigation component
|
|
38
36
|
*/
|
|
39
|
-
|
|
40
|
-
}
|
|
37
|
+
customStep?: Pick<HvStepNavigationProps, "type" | "stepSize" | "width">;
|
|
38
|
+
}
|
|
41
39
|
|
|
42
40
|
export default function HvWizardTitle(props: HvWizardTitleProps): JSX.Element | null;
|
|
@@ -27,7 +27,7 @@ var _uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
|
27
27
|
|
|
28
28
|
var _uikitReactLab = require("@hitachivantara/uikit-react-lab");
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _WizardContext = _interopRequireDefault(require("../WizardContext"));
|
|
31
31
|
|
|
32
32
|
var _styles2 = _interopRequireDefault(require("./styles"));
|
|
33
33
|
|
|
@@ -59,7 +59,7 @@ var HvWizardTitle = function HvWizardTitle(_ref) {
|
|
|
59
59
|
_ref$customStep = _ref.customStep,
|
|
60
60
|
customStep = _ref$customStep === void 0 ? {} : _ref$customStep;
|
|
61
61
|
|
|
62
|
-
var _React$useContext = _react.default.useContext(
|
|
62
|
+
var _React$useContext = _react.default.useContext(_WizardContext.default),
|
|
63
63
|
context = _React$useContext.context;
|
|
64
64
|
|
|
65
65
|
var _React$useState = _react.default.useState([]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WizardTitle.js","names":["switchTabState","state","currentTab","index","valid","touched","HvWizardTitle","title","hasSummary","labels","tab","classes","changeTab","customStep","React","useContext","HvWizardContext","context","useState","steps","setSteps","useEffect","contextArray","Object","entries","length","updatedSteps","map","childState","name","onClick","headerContainer","messageContainer","titleContainer","stepContainer","type","stepSize","width","xs","sm","md","lg","buttonWidth","root","rootSummaryButton","summary","propTypes","PropTypes","shape","string","bool","number","isRequired","func","oneOf","xl","withStyles","styles"],"sources":["../../../src/Wizard/WizardTitle/WizardTitle.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvButton, HvDialogTitle, HvGrid, HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport { Report } from \"@hitachivantara/uikit-react-icons\";\nimport { HvStepNavigation } from \"@hitachivantara/uikit-react-lab\";\nimport
|
|
1
|
+
{"version":3,"file":"WizardTitle.js","names":["switchTabState","state","currentTab","index","valid","touched","HvWizardTitle","title","hasSummary","labels","tab","classes","changeTab","customStep","React","useContext","HvWizardContext","context","useState","steps","setSteps","useEffect","contextArray","Object","entries","length","updatedSteps","map","childState","name","onClick","headerContainer","messageContainer","titleContainer","stepContainer","type","stepSize","width","xs","sm","md","lg","buttonWidth","root","rootSummaryButton","summary","propTypes","PropTypes","shape","string","bool","number","isRequired","func","oneOf","xl","withStyles","styles"],"sources":["../../../src/Wizard/WizardTitle/WizardTitle.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@mui/styles\";\nimport { HvButton, HvDialogTitle, HvGrid, HvTypography } from \"@hitachivantara/uikit-react-core\";\nimport { Report } from \"@hitachivantara/uikit-react-icons\";\nimport { HvStepNavigation } from \"@hitachivantara/uikit-react-lab\";\nimport HvWizardContext from \"../WizardContext\";\n\nimport styles from \"./styles\";\n\nconst switchTabState = (state, currentTab, index) => {\n if (index === currentTab) return \"Current\";\n if (state.valid) return \"Completed\";\n if (state.valid === null) return \"Enabled\";\n if (state.touched && state.valid === false) return \"Failed\";\n // \"Disabled\"\n // \"Pending\"\n return \"Enabled\";\n};\n\nconst HvWizardTitle = ({\n title,\n hasSummary = false,\n labels = {},\n tab,\n classes,\n changeTab,\n customStep = {},\n}) => {\n const { context } = React.useContext(HvWizardContext);\n const [steps, setSteps] = React.useState([]);\n\n React.useEffect(() => {\n const contextArray = Object.entries(context);\n if (contextArray.length) {\n const updatedSteps = contextArray.map(([, childState], index) => ({\n title: childState.name ?? `${index + 1}`,\n state: switchTabState(childState, tab, index),\n onClick: () => changeTab(index),\n }));\n\n setSteps(updatedSteps);\n }\n }, [context, tab, changeTab]);\n\n return (\n <HvDialogTitle\n className={classes.headerContainer}\n classes={{ messageContainer: classes.messageContainer }}\n >\n <HvGrid\n container\n justifyContent=\"space-between\"\n alignItems=\"center\"\n className={classes.titleContainer}\n >\n {title && (\n <HvTypography variant=\"xsTitle\" component=\"h3\">\n {title}\n </HvTypography>\n )}\n {!!steps.length && (\n <HvStepNavigation\n className={classes.stepContainer}\n steps={steps}\n type={customStep?.type ?? \"Default\"}\n stepSize={customStep?.stepSize ?? \"XS\"}\n width={customStep?.width ?? { xs: 200, sm: 350, md: 600, lg: 800 }}\n />\n )}\n {hasSummary && (\n <HvButton\n category=\"secondary\"\n className={classes.buttonWidth}\n classes={{ root: classes.rootSummaryButton }}\n >\n <Report /> {`${labels.summary ?? \"Summary\"}`}\n </HvButton>\n )}\n </HvGrid>\n </HvDialogTitle>\n );\n};\n\nHvWizardTitle.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the header container.\n */\n headerContainer: PropTypes.string,\n /**\n * Styles applied to override the Dialog Title styles.\n */\n messageContainer: PropTypes.string,\n /**\n * Styles applied to the header content container.\n */\n titleContainer: PropTypes.string,\n /**\n * Styles applied to the Button component to override its width.\n */\n buttonWidth: PropTypes.string,\n /**\n * Styles applied to the Button component to override its right padding.\n */\n rootSummaryButton: PropTypes.string,\n /**\n *\n */\n stepContainer: PropTypes.string,\n }),\n /**\n * Title for the wizard.\n */\n title: PropTypes.string,\n /**\n * Shows the summary button.\n */\n hasSummary: PropTypes.bool,\n /**\n * An object containing all the labels for the wizard header.\n */\n labels: PropTypes.shape({\n /**\n * Summary button label.\n */\n summary: PropTypes.string,\n }),\n /**\n * Current tab to check if it's last page or first to disable previous button and swap between next and submit button.\n */\n tab: PropTypes.number.isRequired,\n /**\n * Function to change the tab when pressing previous and next buttons.\n */\n changeTab: PropTypes.func.isRequired,\n /**\n * Custom object to define type, size and width of the StepNavigation component\n */\n customStep: PropTypes.shape({\n /**\n * Type of step navigation. Values = {\"Simple\", \"Default\"}.\n */\n type: PropTypes.oneOf([\"Simple\", \"Default\"]),\n /**\n * Sets one of the standard sizes of the steps. Values = {\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"}\n */\n stepSize: PropTypes.oneOf([\"XS\", \"SM\", \"MD\", \"LG\", \"XL\"]),\n /**\n * Width of the component element on each breakpoint screen resolution.\n */\n width: PropTypes.shape({\n xs: PropTypes.number,\n sm: PropTypes.number,\n md: PropTypes.number,\n lg: PropTypes.number,\n xl: PropTypes.number,\n }),\n }),\n};\n\nexport default withStyles(styles, { name: \"HvWizardTitle\" })(HvWizardTitle);\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;;;AAEA,IAAMA,cAAc,GAAG,SAAjBA,cAAiB,CAACC,KAAD,EAAQC,UAAR,EAAoBC,KAApB,EAA8B;EACnD,IAAIA,KAAK,KAAKD,UAAd,EAA0B,OAAO,SAAP;EAC1B,IAAID,KAAK,CAACG,KAAV,EAAiB,OAAO,WAAP;EACjB,IAAIH,KAAK,CAACG,KAAN,KAAgB,IAApB,EAA0B,OAAO,SAAP;EAC1B,IAAIH,KAAK,CAACI,OAAN,IAAiBJ,KAAK,CAACG,KAAN,KAAgB,KAArC,EAA4C,OAAO,QAAP,CAJO,CAKnD;EACA;;EACA,OAAO,SAAP;AACD,CARD;;AAUA,IAAME,aAAa,GAAG,SAAhBA,aAAgB,OAQhB;EAAA;;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,2BANJC,UAMI;EAAA,IANJA,UAMI,gCANS,KAMT;EAAA,uBALJC,MAKI;EAAA,IALJA,MAKI,4BALK,EAKL;EAAA,IAJJC,GAII,QAJJA,GAII;EAAA,IAHJC,OAGI,QAHJA,OAGI;EAAA,IAFJC,SAEI,QAFJA,SAEI;EAAA,2BADJC,UACI;EAAA,IADJA,UACI,gCADS,EACT;;EACJ,wBAAoBC,cAAA,CAAMC,UAAN,CAAiBC,sBAAjB,CAApB;EAAA,IAAQC,OAAR,qBAAQA,OAAR;;EACA,sBAA0BH,cAAA,CAAMI,QAAN,CAAe,EAAf,CAA1B;EAA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EsC,kBAAA,CAAUC,KAAV,CAAgB;IACtB;AACJ;AACA;IACIH,OAAO,EAAEE,kBAAA,CAAUE;EAJG,CAAhB,CAzCgB;;EA+CxB;AACF;AACA;EACEvC,GAAG,EAAEqC,kBAAA,CAAUI,MAAV,CAAiBC,UAlDE;;EAmDxB;AACF;AACA;EACExC,SAAS,EAAEmC,kBAAA,CAAUM,IAAV,CAAeD,UAtDF;;EAuDxB;AACF;AACA;EACEvC,UAAU,EAAEkC,kBAAA,CAAUC,KAAV,CAAgB;IAC1B;AACJ;AACA;IACIb,IAAI,EAAEY,kBAAA,CAAUO,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,CAJoB;;IAK1B;AACJ;AACA;IACIlB,QAAQ,EAAEW,kBAAA,CAAUO,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CARgB;;IAS1B;AACJ;AACA;IACIjB,KAAK,EAAEU,kBAAA,CAAUC,KAAV,CAAgB;MACrBV,EAAE,EAAES,kBAAA,CAAUI,MADO;MAErBZ,EAAE,EAAEQ,kBAAA,CAAUI,MAFO;MAGrBX,EAAE,EAAEO,kBAAA,CAAUI,MAHO;MAIrBV,EAAE,EAAEM,kBAAA,CAAUI,MAJO;MAKrBI,EAAE,EAAER,kBAAA,CAAUI;IALO,CAAhB;EAZmB,CAAhB;AA1DY,CAA1B;;eAgFe,IAAAK,kBAAA,EAAWC,gBAAX,EAAmB;EAAE5B,IAAI,EAAE;AAAR,CAAnB,EAA8CvB,aAA9C,C"}
|
package/dist/Wizard/index.d.ts
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
export { default } from "./Wizard";
|
|
2
2
|
export * from "./Wizard";
|
|
3
|
+
|
|
4
|
+
export { default as HvWizardContainer } from "./WizardContainer";
|
|
5
|
+
export * from "./WizardContainer";
|
|
6
|
+
|
|
7
|
+
export { default as HvWizardTitle } from "./WizardTitle";
|
|
8
|
+
export * from "./WizardTitle";
|
|
9
|
+
|
|
10
|
+
export { default as HvWizardContent } from "./WizardContent";
|
|
11
|
+
export * from "./WizardContent";
|
|
12
|
+
|
|
13
|
+
export { default as HvWizardActions } from "./WizardActions";
|
|
14
|
+
export * from "./WizardActions";
|
|
15
|
+
|
|
16
|
+
export { default as HvWizardContext } from "./WizardContext";
|
|
17
|
+
export * from "./WizardContext";
|
package/dist/Wizard/index.js
CHANGED
|
@@ -29,6 +29,12 @@ Object.defineProperty(exports, "HvWizardContext", {
|
|
|
29
29
|
return _WizardContext.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
Object.defineProperty(exports, "HvWizardContextProvider", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _WizardContextProvider.default;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
32
38
|
Object.defineProperty(exports, "HvWizardTitle", {
|
|
33
39
|
enumerable: true,
|
|
34
40
|
get: function get() {
|
|
@@ -53,4 +59,6 @@ var _WizardContent = _interopRequireDefault(require("./WizardContent"));
|
|
|
53
59
|
var _WizardActions = _interopRequireDefault(require("./WizardActions"));
|
|
54
60
|
|
|
55
61
|
var _WizardContext = _interopRequireDefault(require("./WizardContext"));
|
|
62
|
+
|
|
63
|
+
var _WizardContextProvider = _interopRequireDefault(require("./WizardContext/WizardContextProvider"));
|
|
56
64
|
//# sourceMappingURL=index.js.map
|
package/dist/Wizard/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/Wizard/index.js"],"sourcesContent":["export { default } from \"./Wizard\";\nexport { default as HvWizardContainer } from \"./WizardContainer\";\nexport { default as HvWizardTitle } from \"./WizardTitle\";\nexport { default as HvWizardContent } from \"./WizardContent\";\nexport { default as HvWizardActions } from \"./WizardActions\";\nexport { default as HvWizardContext } from \"./WizardContext\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/Wizard/index.js"],"sourcesContent":["export { default } from \"./Wizard\";\nexport { default as HvWizardContainer } from \"./WizardContainer\";\nexport { default as HvWizardTitle } from \"./WizardTitle\";\nexport { default as HvWizardContent } from \"./WizardContent\";\nexport { default as HvWizardActions } from \"./WizardActions\";\nexport { default as HvWizardContext } from \"./WizardContext\";\nexport { default as HvWizardContextProvider } from \"./WizardContext/WizardContextProvider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
package/dist/index.js
CHANGED
|
@@ -117,7 +117,19 @@ Object.keys(_TimeAgo).forEach(function (key) {
|
|
|
117
117
|
});
|
|
118
118
|
});
|
|
119
119
|
|
|
120
|
-
var _Wizard =
|
|
120
|
+
var _Wizard = _interopRequireWildcard(require("./Wizard"));
|
|
121
|
+
|
|
122
|
+
Object.keys(_Wizard).forEach(function (key) {
|
|
123
|
+
if (key === "default" || key === "__esModule") return;
|
|
124
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
125
|
+
if (key in exports && exports[key] === _Wizard[key]) return;
|
|
126
|
+
Object.defineProperty(exports, key, {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function get() {
|
|
129
|
+
return _Wizard[key];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
121
133
|
|
|
122
134
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
123
135
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["export { default as HvColorPicker } from \"./ColorPicker\";\nexport { default as HvDrawer } from \"./Drawer\";\nexport { default as HvImageCarousel } from \"./ImageCarousel\";\nexport { default as HvInlineEditor } from \"./InlineEditor\";\nexport { default as HvNavigationAnchors } from \"./NavigationAnchors\";\nexport { default as HvNotificationPanel } from \"./NotificationPanel\";\nexport { default as HvStepNavigation } from \"./StepNavigation\";\nexport { default as HvTimeAgo } from \"./TimeAgo\";\nexport * from \"./TimeAgo\";\nexport { default as HvWizard } from \"./Wizard\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["export { default as HvColorPicker } from \"./ColorPicker\";\nexport { default as HvDrawer } from \"./Drawer\";\nexport { default as HvImageCarousel } from \"./ImageCarousel\";\nexport { default as HvInlineEditor } from \"./InlineEditor\";\nexport { default as HvNavigationAnchors } from \"./NavigationAnchors\";\nexport { default as HvNotificationPanel } from \"./NotificationPanel\";\nexport { default as HvStepNavigation } from \"./StepNavigation\";\nexport { default as HvTimeAgo } from \"./TimeAgo\";\nexport * from \"./TimeAgo\";\nexport { default as HvWizard } from \"./Wizard\";\nexport * from \"./Wizard\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AACA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|