@hitachivantara/uikit-react-lab 3.55.1 → 3.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Controls/Controls.d.ts +2 -10
- package/dist/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +2 -7
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +2 -5
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +2 -9
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/StepNavigation/SimpleNavigation/utils.js +10 -8
- package/dist/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/StepNavigation/StepNavigation.js +5 -5
- package/dist/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/Wizard/Wizard.d.ts +63 -0
- package/dist/Wizard/Wizard.js +238 -0
- package/dist/Wizard/Wizard.js.map +1 -0
- package/dist/Wizard/WizardActions/WizardActions.d.ts +61 -0
- package/dist/Wizard/WizardActions/WizardActions.js +259 -0
- package/dist/Wizard/WizardActions/WizardActions.js.map +1 -0
- package/dist/Wizard/WizardActions/index.d.ts +2 -0
- package/dist/Wizard/WizardActions/index.js +16 -0
- package/dist/Wizard/WizardActions/index.js.map +1 -0
- package/dist/Wizard/WizardActions/styles.js +30 -0
- package/dist/Wizard/WizardActions/styles.js.map +1 -0
- package/dist/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
- package/dist/Wizard/WizardContainer/WizardContainer.js +94 -0
- package/dist/Wizard/WizardContainer/WizardContainer.js.map +1 -0
- package/dist/Wizard/WizardContainer/index.d.ts +2 -0
- package/dist/Wizard/WizardContainer/index.js +16 -0
- package/dist/Wizard/WizardContainer/index.js.map +1 -0
- package/dist/Wizard/WizardContainer/styles.js +23 -0
- package/dist/Wizard/WizardContainer/styles.js.map +1 -0
- package/dist/Wizard/WizardContent/LoadingContainer.js +74 -0
- package/dist/Wizard/WizardContent/LoadingContainer.js.map +1 -0
- package/dist/Wizard/WizardContent/WizardContent.d.ts +28 -0
- package/dist/Wizard/WizardContent/WizardContent.js +163 -0
- package/dist/Wizard/WizardContent/WizardContent.js.map +1 -0
- package/dist/Wizard/WizardContent/index.d.ts +2 -0
- package/dist/Wizard/WizardContent/index.js +16 -0
- package/dist/Wizard/WizardContent/index.js.map +1 -0
- package/dist/Wizard/WizardContent/styles.js +24 -0
- package/dist/Wizard/WizardContent/styles.js.map +1 -0
- package/dist/Wizard/WizardContext/WizardContext.js +21 -0
- package/dist/Wizard/WizardContext/WizardContext.js.map +1 -0
- package/dist/Wizard/WizardContext/index.js +16 -0
- package/dist/Wizard/WizardContext/index.js.map +1 -0
- package/dist/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
- package/dist/Wizard/WizardTitle/WizardTitle.js +221 -0
- package/dist/Wizard/WizardTitle/WizardTitle.js.map +1 -0
- package/dist/Wizard/WizardTitle/index.d.ts +2 -0
- package/dist/Wizard/WizardTitle/index.js +16 -0
- package/dist/Wizard/WizardTitle/index.js.map +1 -0
- package/dist/Wizard/WizardTitle/styles.js +41 -0
- package/dist/Wizard/WizardTitle/styles.js.map +1 -0
- package/dist/Wizard/index.d.ts +2 -0
- package/dist/Wizard/index.js +56 -0
- package/dist/Wizard/index.js.map +1 -0
- package/dist/Wizard/styles.js +16 -0
- package/dist/Wizard/styles.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy/Controls/Controls.d.ts +2 -10
- package/dist/legacy/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -8
- package/dist/legacy/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/legacy/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js +4 -7
- package/dist/legacy/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -9
- package/dist/legacy/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js +9 -5
- package/dist/legacy/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/legacy/StepNavigation/StepNavigation.js +5 -5
- package/dist/legacy/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/legacy/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/legacy/Wizard/Wizard.d.ts +63 -0
- package/dist/legacy/Wizard/Wizard.js +211 -0
- package/dist/legacy/Wizard/Wizard.js.map +1 -0
- package/dist/legacy/Wizard/WizardActions/WizardActions.d.ts +61 -0
- package/dist/legacy/Wizard/WizardActions/WizardActions.js +226 -0
- package/dist/legacy/Wizard/WizardActions/WizardActions.js.map +1 -0
- package/dist/legacy/Wizard/WizardActions/index.d.ts +2 -0
- package/dist/legacy/Wizard/WizardActions/index.js +2 -0
- package/dist/legacy/Wizard/WizardActions/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardActions/styles.js +22 -0
- package/dist/legacy/Wizard/WizardActions/styles.js.map +1 -0
- package/dist/legacy/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
- package/dist/legacy/Wizard/WizardContainer/WizardContainer.js +75 -0
- package/dist/legacy/Wizard/WizardContainer/WizardContainer.js.map +1 -0
- package/dist/legacy/Wizard/WizardContainer/index.d.ts +2 -0
- package/dist/legacy/Wizard/WizardContainer/index.js +2 -0
- package/dist/legacy/Wizard/WizardContainer/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardContainer/styles.js +15 -0
- package/dist/legacy/Wizard/WizardContainer/styles.js.map +1 -0
- package/dist/legacy/Wizard/WizardContent/LoadingContainer.js +58 -0
- package/dist/legacy/Wizard/WizardContent/LoadingContainer.js.map +1 -0
- package/dist/legacy/Wizard/WizardContent/WizardContent.d.ts +28 -0
- package/dist/legacy/Wizard/WizardContent/WizardContent.js +129 -0
- package/dist/legacy/Wizard/WizardContent/WizardContent.js.map +1 -0
- package/dist/legacy/Wizard/WizardContent/index.d.ts +2 -0
- package/dist/legacy/Wizard/WizardContent/index.js +2 -0
- package/dist/legacy/Wizard/WizardContent/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardContent/styles.js +16 -0
- package/dist/legacy/Wizard/WizardContent/styles.js.map +1 -0
- package/dist/legacy/Wizard/WizardContext/WizardContext.js +12 -0
- package/dist/legacy/Wizard/WizardContext/WizardContext.js.map +1 -0
- package/dist/legacy/Wizard/WizardContext/index.js +2 -0
- package/dist/legacy/Wizard/WizardContext/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js +198 -0
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.js.map +1 -0
- package/dist/legacy/Wizard/WizardTitle/index.d.ts +2 -0
- package/dist/legacy/Wizard/WizardTitle/index.js +2 -0
- package/dist/legacy/Wizard/WizardTitle/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardTitle/styles.js +33 -0
- package/dist/legacy/Wizard/WizardTitle/styles.js.map +1 -0
- package/dist/legacy/Wizard/index.d.ts +2 -0
- package/dist/legacy/Wizard/index.js +7 -0
- package/dist/legacy/Wizard/index.js.map +1 -0
- package/dist/legacy/Wizard/styles.js +8 -0
- package/dist/legacy/Wizard/styles.js.map +1 -0
- package/dist/legacy/index.d.ts +3 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/index.js.map +1 -1
- package/dist/modern/Controls/Controls.d.ts +2 -10
- package/dist/modern/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.d.ts +3 -1
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js +3 -6
- package/dist/modern/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.d.ts +2 -2
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js +2 -2
- package/dist/modern/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js +3 -2
- package/dist/modern/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js +4 -5
- package/dist/modern/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.d.ts +3 -1
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js +3 -7
- package/dist/modern/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js +7 -5
- package/dist/modern/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/modern/StepNavigation/StepNavigation.js +5 -5
- package/dist/modern/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/modern/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/modern/Wizard/Wizard.d.ts +63 -0
- package/dist/modern/Wizard/Wizard.js +198 -0
- package/dist/modern/Wizard/Wizard.js.map +1 -0
- package/dist/modern/Wizard/WizardActions/WizardActions.d.ts +61 -0
- package/dist/modern/Wizard/WizardActions/WizardActions.js +186 -0
- package/dist/modern/Wizard/WizardActions/WizardActions.js.map +1 -0
- package/dist/modern/Wizard/WizardActions/index.d.ts +2 -0
- package/dist/modern/Wizard/WizardActions/index.js +2 -0
- package/dist/modern/Wizard/WizardActions/index.js.map +1 -0
- package/dist/modern/Wizard/WizardActions/styles.js +20 -0
- package/dist/modern/Wizard/WizardActions/styles.js.map +1 -0
- package/dist/modern/Wizard/WizardContainer/WizardContainer.d.ts +28 -0
- package/dist/modern/Wizard/WizardContainer/WizardContainer.js +77 -0
- package/dist/modern/Wizard/WizardContainer/WizardContainer.js.map +1 -0
- package/dist/modern/Wizard/WizardContainer/index.d.ts +2 -0
- package/dist/modern/Wizard/WizardContainer/index.js +2 -0
- package/dist/modern/Wizard/WizardContainer/index.js.map +1 -0
- package/dist/modern/Wizard/WizardContainer/styles.js +13 -0
- package/dist/modern/Wizard/WizardContainer/styles.js.map +1 -0
- package/dist/modern/Wizard/WizardContent/LoadingContainer.js +58 -0
- package/dist/modern/Wizard/WizardContent/LoadingContainer.js.map +1 -0
- package/dist/modern/Wizard/WizardContent/WizardContent.d.ts +28 -0
- package/dist/modern/Wizard/WizardContent/WizardContent.js +119 -0
- package/dist/modern/Wizard/WizardContent/WizardContent.js.map +1 -0
- package/dist/modern/Wizard/WizardContent/index.d.ts +2 -0
- package/dist/modern/Wizard/WizardContent/index.js +2 -0
- package/dist/modern/Wizard/WizardContent/index.js.map +1 -0
- package/dist/modern/Wizard/WizardContent/styles.js +14 -0
- package/dist/modern/Wizard/WizardContent/styles.js.map +1 -0
- package/dist/modern/Wizard/WizardContext/WizardContext.js +12 -0
- package/dist/modern/Wizard/WizardContext/WizardContext.js.map +1 -0
- package/dist/modern/Wizard/WizardContext/index.js +2 -0
- package/dist/modern/Wizard/WizardContext/index.js.map +1 -0
- package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +42 -0
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js +182 -0
- package/dist/modern/Wizard/WizardTitle/WizardTitle.js.map +1 -0
- package/dist/modern/Wizard/WizardTitle/index.d.ts +2 -0
- package/dist/modern/Wizard/WizardTitle/index.js +2 -0
- package/dist/modern/Wizard/WizardTitle/index.js.map +1 -0
- package/dist/modern/Wizard/WizardTitle/styles.js +31 -0
- package/dist/modern/Wizard/WizardTitle/styles.js.map +1 -0
- package/dist/modern/Wizard/index.d.ts +2 -0
- package/dist/modern/Wizard/index.js +7 -0
- package/dist/modern/Wizard/index.js.map +1 -0
- package/dist/modern/Wizard/styles.js +6 -0
- package/dist/modern/Wizard/styles.js.map +1 -0
- package/dist/modern/index.d.ts +3 -0
- package/dist/modern/index.js +1 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["classes", "className", "children", "handleClose", "open"];
|
|
4
|
+
import React from "react";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { withStyles } from "@material-ui/core";
|
|
8
|
+
import { HvDialog } from "@hitachivantara/uikit-react-core";
|
|
9
|
+
import styles from "./styles";
|
|
10
|
+
|
|
11
|
+
var HvWizardContainer = function HvWizardContainer(_ref) {
|
|
12
|
+
var classes = _ref.classes,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
handleClose = _ref.handleClose,
|
|
16
|
+
open = _ref.open,
|
|
17
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement(HvDialog, _extends({
|
|
20
|
+
classes: {
|
|
21
|
+
closeButton: classes.closeButton,
|
|
22
|
+
paper: classes.paper
|
|
23
|
+
} // overrides css
|
|
24
|
+
,
|
|
25
|
+
className: clsx(className, classes.root),
|
|
26
|
+
open: open,
|
|
27
|
+
onClose: handleClose
|
|
28
|
+
}, others), children);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
process.env.NODE_ENV !== "production" ? HvWizardContainer.propTypes = {
|
|
32
|
+
/**
|
|
33
|
+
* Class names to be applied.
|
|
34
|
+
*/
|
|
35
|
+
className: PropTypes.string,
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A Jss Object used to override or extend the styles applied.
|
|
39
|
+
*/
|
|
40
|
+
classes: PropTypes.shape({
|
|
41
|
+
/**
|
|
42
|
+
* Styles applied to the component root class.
|
|
43
|
+
*/
|
|
44
|
+
root: PropTypes.string,
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Style applied to the component (root).
|
|
48
|
+
*/
|
|
49
|
+
paper: PropTypes.string,
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Style applied to the close button.
|
|
53
|
+
*/
|
|
54
|
+
closeButton: PropTypes.string
|
|
55
|
+
}).isRequired,
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Components of the Wizard.
|
|
59
|
+
*/
|
|
60
|
+
children: PropTypes.node.isRequired,
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Current state of the Wizard.
|
|
64
|
+
*/
|
|
65
|
+
open: PropTypes.bool.isRequired,
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Function executed on close.
|
|
69
|
+
*/
|
|
70
|
+
handleClose: PropTypes.func.isRequired
|
|
71
|
+
} : void 0;
|
|
72
|
+
export default withStyles(styles, {
|
|
73
|
+
name: "HvWizardContainer"
|
|
74
|
+
})(HvWizardContainer);
|
|
75
|
+
//# sourceMappingURL=WizardContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContainer.js","names":["React","PropTypes","clsx","withStyles","HvDialog","styles","HvWizardContainer","classes","className","children","handleClose","open","others","closeButton","paper","root","propTypes","string","shape","isRequired","node","bool","func","name"],"sources":["../../../../src/Wizard/WizardContainer/WizardContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@material-ui/core\";\nimport { HvDialog } from \"@hitachivantara/uikit-react-core\";\n\nimport styles from \"./styles\";\n\nconst HvWizardContainer = ({ classes, className, children, handleClose, open, ...others }) => {\n return (\n <HvDialog\n classes={{ closeButton: classes.closeButton, paper: classes.paper }} // overrides css\n className={clsx(className, classes.root)}\n open={open}\n onClose={handleClose}\n {...others}\n >\n {children}\n </HvDialog>\n );\n};\n\nHvWizardContainer.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\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 root class.\n */\n root: PropTypes.string,\n /**\n * Style applied to the component (root).\n */\n paper: PropTypes.string,\n /**\n * Style applied to the close button.\n */\n closeButton: PropTypes.string,\n }).isRequired,\n /**\n * Components of the Wizard.\n */\n children: PropTypes.node.isRequired,\n /**\n * Current state of the Wizard.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Function executed on close.\n */\n handleClose: PropTypes.func.isRequired,\n};\n\nexport default withStyles(styles, { name: \"HvWizardContainer\" })(HvWizardContainer);\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,UAAT,QAA2B,mBAA3B;AACA,SAASC,QAAT,QAAyB,kCAAzB;AAEA,OAAOC,MAAP,MAAmB,UAAnB;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,OAAoE;EAAA,IAAjEC,OAAiE,QAAjEA,OAAiE;EAAA,IAAxDC,SAAwD,QAAxDA,SAAwD;EAAA,IAA7CC,QAA6C,QAA7CA,QAA6C;EAAA,IAAnCC,WAAmC,QAAnCA,WAAmC;EAAA,IAAtBC,IAAsB,QAAtBA,IAAsB;EAAA,IAAbC,MAAa;;EAC5F,oBACE,oBAAC,QAAD;IACE,OAAO,EAAE;MAAEC,WAAW,EAAEN,OAAO,CAACM,WAAvB;MAAoCC,KAAK,EAAEP,OAAO,CAACO;IAAnD,CADX,CACuE;IADvE;IAEE,SAAS,EAAEZ,IAAI,CAACM,SAAD,EAAYD,OAAO,CAACQ,IAApB,CAFjB;IAGE,IAAI,EAAEJ,IAHR;IAIE,OAAO,EAAED;EAJX,GAKME,MALN,GAOGH,QAPH,CADF;AAWD,CAZD;;AAcA,wCAAAH,iBAAiB,CAACU,SAAlB,GAA8B;EAC5B;AACF;AACA;EACER,SAAS,EAAEP,SAAS,CAACgB,MAJO;;EAK5B;AACF;AACA;EACEV,OAAO,EAAEN,SAAS,CAACiB,KAAV,CAAgB;IACvB;AACJ;AACA;IACIH,IAAI,EAAEd,SAAS,CAACgB,MAJO;;IAKvB;AACJ;AACA;IACIH,KAAK,EAAEb,SAAS,CAACgB,MARM;;IASvB;AACJ;AACA;IACIJ,WAAW,EAAEZ,SAAS,CAACgB;EAZA,CAAhB,EAaNE,UArByB;;EAsB5B;AACF;AACA;EACEV,QAAQ,EAAER,SAAS,CAACmB,IAAV,CAAeD,UAzBG;;EA0B5B;AACF;AACA;EACER,IAAI,EAAEV,SAAS,CAACoB,IAAV,CAAeF,UA7BO;;EA8B5B;AACF;AACA;EACET,WAAW,EAAET,SAAS,CAACqB,IAAV,CAAeH;AAjCA,CAA9B;AAoCA,eAAehB,UAAU,CAACE,MAAD,EAAS;EAAEkB,IAAI,EAAE;AAAR,CAAT,CAAV,CAAkDjB,iBAAlD,CAAf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Wizard/WizardContainer/index.js"],"sourcesContent":["export { default } from \"./WizardContainer\";\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,mBAAxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","root","paper","width","maxWidth","closeButton","display"],"sources":["../../../../src/Wizard/WizardContainer/styles.js"],"sourcesContent":["const styles = () => ({\n root: {},\n paper: {\n width: \"80%\",\n maxWidth: \"80%\",\n },\n closeButton: {\n display: \"none\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,OAAO;IACpBC,IAAI,EAAE,EADc;IAEpBC,KAAK,EAAE;MACLC,KAAK,EAAE,KADF;MAELC,QAAQ,EAAE;IAFL,CAFa;IAMpBC,WAAW,EAAE;MACXC,OAAO,EAAE;IADE;EANO,CAAP;AAAA,CAAf;;AAWA,eAAeN,MAAf"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "hidden"];
|
|
4
|
+
import React from "react";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { HvLoading } from "@hitachivantara/uikit-react-core";
|
|
8
|
+
import { makeStyles, alpha, hexToRgb } from "@material-ui/core";
|
|
9
|
+
var useStyles = makeStyles(function (theme) {
|
|
10
|
+
return {
|
|
11
|
+
loading: {
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "100%"
|
|
14
|
+
},
|
|
15
|
+
overlay: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
transition: "background-Color .2s ease",
|
|
18
|
+
zIndex: -1
|
|
19
|
+
},
|
|
20
|
+
blur: {
|
|
21
|
+
backgroundColor: alpha(hexToRgb(theme.hv.palette.atmosphere.atmo2), 0.8),
|
|
22
|
+
zIndex: theme.zIndex.drawer
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var LoadingContainer = function LoadingContainer(_ref) {
|
|
28
|
+
var children = _ref.children,
|
|
29
|
+
hidden = _ref.hidden,
|
|
30
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
|
|
32
|
+
var classes = useStyles();
|
|
33
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
style: {
|
|
35
|
+
top: 0,
|
|
36
|
+
left: 0,
|
|
37
|
+
height: "100%",
|
|
38
|
+
width: "100%"
|
|
39
|
+
},
|
|
40
|
+
className: clsx(classes.overlay, !hidden && classes.blur)
|
|
41
|
+
}, /*#__PURE__*/React.createElement(HvLoading, _extends({
|
|
42
|
+
classes: {
|
|
43
|
+
root: classes.loading
|
|
44
|
+
},
|
|
45
|
+
hidden: hidden
|
|
46
|
+
}, others))), /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
style: {
|
|
48
|
+
display: "flow-root"
|
|
49
|
+
}
|
|
50
|
+
}, children));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
process.env.NODE_ENV !== "production" ? LoadingContainer.propTypes = {
|
|
54
|
+
children: PropTypes.node,
|
|
55
|
+
hidden: PropTypes.bool
|
|
56
|
+
} : void 0;
|
|
57
|
+
export default LoadingContainer;
|
|
58
|
+
//# sourceMappingURL=LoadingContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingContainer.js","names":["React","PropTypes","clsx","HvLoading","makeStyles","alpha","hexToRgb","useStyles","theme","loading","width","height","overlay","position","transition","zIndex","blur","backgroundColor","hv","palette","atmosphere","atmo2","drawer","LoadingContainer","children","hidden","others","classes","top","left","root","display","propTypes","node","bool"],"sources":["../../../../src/Wizard/WizardContent/LoadingContainer.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { HvLoading } from \"@hitachivantara/uikit-react-core\";\nimport { makeStyles, alpha, hexToRgb } from \"@material-ui/core\";\n\nconst useStyles = makeStyles((theme) => ({\n loading: {\n width: \"100%\",\n height: \"100%\",\n },\n overlay: {\n position: \"absolute\",\n transition: \"background-Color .2s ease\",\n zIndex: -1,\n },\n blur: {\n backgroundColor: alpha(hexToRgb(theme.hv.palette.atmosphere.atmo2), 0.8),\n zIndex: theme.zIndex.drawer,\n },\n}));\n\nconst LoadingContainer = ({ children, hidden, ...others }) => {\n const classes = useStyles();\n\n return (\n <>\n <div\n style={{\n top: 0,\n left: 0,\n height: \"100%\",\n width: \"100%\",\n }}\n className={clsx(classes.overlay, { [classes.blur]: !hidden })}\n >\n <HvLoading classes={{ root: classes.loading }} hidden={hidden} {...others} />\n </div>\n <div style={{ display: \"flow-root\" }}>{children}</div>\n </>\n );\n};\n\nLoadingContainer.propTypes = {\n children: PropTypes.node,\n hidden: PropTypes.bool,\n};\n\nexport default LoadingContainer;\n"],"mappings":";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,SAAT,QAA0B,kCAA1B;AACA,SAASC,UAAT,EAAqBC,KAArB,EAA4BC,QAA5B,QAA4C,mBAA5C;AAEA,IAAMC,SAAS,GAAGH,UAAU,CAAC,UAACI,KAAD;EAAA,OAAY;IACvCC,OAAO,EAAE;MACPC,KAAK,EAAE,MADA;MAEPC,MAAM,EAAE;IAFD,CAD8B;IAKvCC,OAAO,EAAE;MACPC,QAAQ,EAAE,UADH;MAEPC,UAAU,EAAE,2BAFL;MAGPC,MAAM,EAAE,CAAC;IAHF,CAL8B;IAUvCC,IAAI,EAAE;MACJC,eAAe,EAAEZ,KAAK,CAACC,QAAQ,CAACE,KAAK,CAACU,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAA7B,CAAT,EAA8C,GAA9C,CADlB;MAEJN,MAAM,EAAEP,KAAK,CAACO,MAAN,CAAaO;IAFjB;EAViC,CAAZ;AAAA,CAAD,CAA5B;;AAgBA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAqC;EAAA,IAAlCC,QAAkC,QAAlCA,QAAkC;EAAA,IAAxBC,MAAwB,QAAxBA,MAAwB;EAAA,IAAbC,MAAa;;EAC5D,IAAMC,OAAO,GAAGpB,SAAS,EAAzB;EAEA,oBACE,uDACE;IACE,KAAK,EAAE;MACLqB,GAAG,EAAE,CADA;MAELC,IAAI,EAAE,CAFD;MAGLlB,MAAM,EAAE,MAHH;MAILD,KAAK,EAAE;IAJF,CADT;IAOE,SAAS,EAAER,IAAI,CAACyB,OAAO,CAACf,OAAT,EAAoC,CAACa,MAArC,IAAqBE,OAAO,CAACX,IAA7B;EAPjB,gBASE,oBAAC,SAAD;IAAW,OAAO,EAAE;MAAEc,IAAI,EAAEH,OAAO,CAAClB;IAAhB,CAApB;IAA+C,MAAM,EAAEgB;EAAvD,GAAmEC,MAAnE,EATF,CADF,eAYE;IAAK,KAAK,EAAE;MAAEK,OAAO,EAAE;IAAX;EAAZ,GAAuCP,QAAvC,CAZF,CADF;AAgBD,CAnBD;;AAqBA,wCAAAD,gBAAgB,CAACS,SAAjB,GAA6B;EAC3BR,QAAQ,EAAEvB,SAAS,CAACgC,IADO;EAE3BR,MAAM,EAAExB,SAAS,CAACiC;AAFS,CAA7B;AAKA,eAAeX,gBAAf"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StandardProps } from "@material-ui/core";
|
|
3
|
+
|
|
4
|
+
export type HvWizardContentClassKey = "root";
|
|
5
|
+
|
|
6
|
+
export type HvWizardContentProps = StandardProps<
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
8
|
+
HvWizardContentClassKey
|
|
9
|
+
> & {
|
|
10
|
+
/**
|
|
11
|
+
* Tabs to show on the Wizard.
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Current tab to show.
|
|
16
|
+
*/
|
|
17
|
+
tab: number;
|
|
18
|
+
/**
|
|
19
|
+
* Forces minimum height to the component.
|
|
20
|
+
*/
|
|
21
|
+
fixedHeight?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the loading animation is shown.
|
|
24
|
+
*/
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function HvWizardContent(props: HvWizardContentProps): JSX.Element | null;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import "core-js/modules/es.object.keys.js";
|
|
2
|
+
import "core-js/modules/es.symbol.js";
|
|
3
|
+
import "core-js/modules/es.array.filter.js";
|
|
4
|
+
import "core-js/modules/es.object.get-own-property-descriptor.js";
|
|
5
|
+
import "core-js/modules/web.dom-collections.for-each.js";
|
|
6
|
+
import "core-js/modules/es.object.get-own-property-descriptors.js";
|
|
7
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
|
|
10
|
+
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; }
|
|
11
|
+
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
|
|
14
|
+
import "core-js/modules/es.object.to-string.js";
|
|
15
|
+
import "core-js/modules/es.promise.js";
|
|
16
|
+
import "core-js/modules/es.object.entries.js";
|
|
17
|
+
import "core-js/modules/es.array.map.js";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import PropTypes from "prop-types";
|
|
20
|
+
import { withStyles } from "@material-ui/core";
|
|
21
|
+
import clsx from "clsx";
|
|
22
|
+
import { HvDialogContent } from "@hitachivantara/uikit-react-core";
|
|
23
|
+
import { HvWizardContext } from "..";
|
|
24
|
+
import LoadingContainer from "./LoadingContainer";
|
|
25
|
+
import styles from "./styles";
|
|
26
|
+
|
|
27
|
+
var HvWizardContent = function HvWizardContent(_ref) {
|
|
28
|
+
var classes = _ref.classes,
|
|
29
|
+
_ref$fixedHeight = _ref.fixedHeight,
|
|
30
|
+
fixedHeight = _ref$fixedHeight === void 0 ? false : _ref$fixedHeight,
|
|
31
|
+
_ref$loading = _ref.loading,
|
|
32
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
33
|
+
children = _ref.children,
|
|
34
|
+
tab = _ref.tab;
|
|
35
|
+
var arrayChildren = React.Children.toArray(children);
|
|
36
|
+
var initialContext = arrayChildren.reduce(function (acc, child, index) {
|
|
37
|
+
var invalid = child.props.mustValidate === true ? false : null;
|
|
38
|
+
var valid = invalid !== null && invalid !== void 0 ? invalid : index === 0 || null;
|
|
39
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, index, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
40
|
+
form: {},
|
|
41
|
+
valid: valid,
|
|
42
|
+
touched: index === 0
|
|
43
|
+
})));
|
|
44
|
+
}, {});
|
|
45
|
+
|
|
46
|
+
var _React$useContext = React.useContext(HvWizardContext),
|
|
47
|
+
context = _React$useContext.context,
|
|
48
|
+
setContext = _React$useContext.setContext;
|
|
49
|
+
|
|
50
|
+
React.useEffect(function () {
|
|
51
|
+
setContext(initialContext);
|
|
52
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
53
|
+
|
|
54
|
+
React.useEffect(function () {
|
|
55
|
+
var _context$tab;
|
|
56
|
+
|
|
57
|
+
if (tab && !((_context$tab = context[tab]) !== null && _context$tab !== void 0 && _context$tab.touched)) {
|
|
58
|
+
var updatedContext = Object.entries(context).reduce(function (acc, _ref2) {
|
|
59
|
+
var _childState$valid;
|
|
60
|
+
|
|
61
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
62
|
+
key = _ref3[0],
|
|
63
|
+
childState = _ref3[1];
|
|
64
|
+
|
|
65
|
+
return _objectSpread(_objectSpread({}, acc), +key <= tab ? _defineProperty({}, key, _objectSpread(_objectSpread({}, childState), {}, {
|
|
66
|
+
touched: true,
|
|
67
|
+
valid: (_childState$valid = childState.valid) !== null && _childState$valid !== void 0 ? _childState$valid : true
|
|
68
|
+
})) : _defineProperty({}, key, childState));
|
|
69
|
+
}, {});
|
|
70
|
+
setContext(updatedContext);
|
|
71
|
+
}
|
|
72
|
+
}, [tab]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
73
|
+
|
|
74
|
+
return /*#__PURE__*/React.createElement(HvDialogContent, {
|
|
75
|
+
className: clsx(classes.contentContainer, fixedHeight && classes.fixedHeight),
|
|
76
|
+
indentContent: true
|
|
77
|
+
}, /*#__PURE__*/React.createElement(LoadingContainer, {
|
|
78
|
+
hidden: !loading
|
|
79
|
+
}, React.Children.map(arrayChildren, function (child, index) {
|
|
80
|
+
if (index === tab) {
|
|
81
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
82
|
+
tab: tab
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return null;
|
|
87
|
+
})));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
process.env.NODE_ENV !== "production" ? HvWizardContent.propTypes = {
|
|
91
|
+
/**
|
|
92
|
+
* Current tab to show.
|
|
93
|
+
*/
|
|
94
|
+
tab: PropTypes.number.isRequired,
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Tabs to show on the Wizard.
|
|
98
|
+
*/
|
|
99
|
+
children: PropTypes.node.isRequired,
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A Jss Object used to override or extend the styles applied.
|
|
103
|
+
*/
|
|
104
|
+
classes: PropTypes.shape({
|
|
105
|
+
/**
|
|
106
|
+
* Style applied to the Wizard content container
|
|
107
|
+
*/
|
|
108
|
+
contentContainer: PropTypes.string,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Style applied to the Wizard to fix its height.
|
|
112
|
+
*/
|
|
113
|
+
fixedHeight: PropTypes.string
|
|
114
|
+
}).isRequired,
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Forces minimum height to the component.
|
|
118
|
+
*/
|
|
119
|
+
fixedHeight: PropTypes.bool,
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Whether the loading animation is shown.
|
|
123
|
+
*/
|
|
124
|
+
loading: PropTypes.bool
|
|
125
|
+
} : void 0;
|
|
126
|
+
export default withStyles(styles, {
|
|
127
|
+
name: "HvWizardContent"
|
|
128
|
+
})(HvWizardContent);
|
|
129
|
+
//# sourceMappingURL=WizardContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContent.js","names":["React","PropTypes","withStyles","clsx","HvDialogContent","HvWizardContext","LoadingContainer","styles","HvWizardContent","classes","fixedHeight","loading","children","tab","arrayChildren","Children","toArray","initialContext","reduce","acc","child","index","invalid","props","mustValidate","valid","form","touched","useContext","context","setContext","useEffect","updatedContext","Object","entries","key","childState","contentContainer","map","cloneElement","propTypes","number","isRequired","node","shape","string","bool","name"],"sources":["../../../../src/Wizard/WizardContent/WizardContent.js"],"sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { withStyles } from \"@material-ui/core\";\nimport clsx from \"clsx\";\nimport { HvDialogContent } from \"@hitachivantara/uikit-react-core\";\nimport { HvWizardContext } from \"..\";\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":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Wizard/WizardContent/index.js"],"sourcesContent":["export { default } from \"./WizardContent\";\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var styles = function styles() {
|
|
2
|
+
return {
|
|
3
|
+
contentContainer: {
|
|
4
|
+
position: "relative",
|
|
5
|
+
padding: 20,
|
|
6
|
+
marginLeft: 0,
|
|
7
|
+
minHeight: 400
|
|
8
|
+
},
|
|
9
|
+
fixedHeight: {
|
|
10
|
+
minHeight: "calc(100vh - 387px)"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default styles;
|
|
16
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","contentContainer","position","padding","marginLeft","minHeight","fixedHeight"],"sources":["../../../../src/Wizard/WizardContent/styles.js"],"sourcesContent":["const styles = () => ({\n contentContainer: {\n position: \"relative\",\n padding: 20,\n marginLeft: 0,\n minHeight: 400,\n },\n fixedHeight: {\n minHeight: \"calc(100vh - 387px)\",\n },\n});\n\nexport default styles;\n"],"mappings":"AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,OAAO;IACpBC,gBAAgB,EAAE;MAChBC,QAAQ,EAAE,UADM;MAEhBC,OAAO,EAAE,EAFO;MAGhBC,UAAU,EAAE,CAHI;MAIhBC,SAAS,EAAE;IAJK,CADE;IAOpBC,WAAW,EAAE;MACXD,SAAS,EAAE;IADA;EAPO,CAAP;AAAA,CAAf;;AAYA,eAAeL,MAAf"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
var WizardContext = /*#__PURE__*/createContext({
|
|
3
|
+
context: {},
|
|
4
|
+
setContext: function setContext() {}
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
if (process.env.NODE_ENV !== "production") {
|
|
8
|
+
WizardContext.displayName = "WizardContext";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default WizardContext;
|
|
12
|
+
//# sourceMappingURL=WizardContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.js","names":["createContext","WizardContext","context","setContext","process","env","NODE_ENV","displayName"],"sources":["../../../../src/Wizard/WizardContext/WizardContext.js"],"sourcesContent":["import { createContext } from \"react\";\n\nconst WizardContext = createContext({\n context: {},\n setContext: () => {},\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n WizardContext.displayName = \"WizardContext\";\n}\n\nexport default WizardContext;\n"],"mappings":"AAAA,SAASA,aAAT,QAA8B,OAA9B;AAEA,IAAMC,aAAa,gBAAGD,aAAa,CAAC;EAClCE,OAAO,EAAE,EADyB;EAElCC,UAAU,EAAE,sBAAM,CAAE;AAFc,CAAD,CAAnC;;AAKA,IAAIC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;EACzCL,aAAa,CAACM,WAAd,GAA4B,eAA5B;AACD;;AAED,eAAeN,aAAf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["default"],"sources":["../../../../src/Wizard/WizardContext/index.js"],"sourcesContent":["export { default } from \"./WizardContext\";\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,iBAAxB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StandardProps } from "@material-ui/core";
|
|
3
|
+
import { HvStepNavigationProps } from "../../StepNavigation";
|
|
4
|
+
|
|
5
|
+
export type HvWizardTitleClassKey = "root";
|
|
6
|
+
|
|
7
|
+
export type HvWizardTitleProps = StandardProps<
|
|
8
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
9
|
+
HvWizardTitleClassKey
|
|
10
|
+
> & {
|
|
11
|
+
/**
|
|
12
|
+
* Title for the wizard.
|
|
13
|
+
*/
|
|
14
|
+
title: string;
|
|
15
|
+
/**
|
|
16
|
+
* Shows the summary button.
|
|
17
|
+
*/
|
|
18
|
+
hasSummary: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* An object containing all the labels for the wizard header.
|
|
21
|
+
*/
|
|
22
|
+
labels: {
|
|
23
|
+
/**
|
|
24
|
+
* Summary button label.
|
|
25
|
+
*/
|
|
26
|
+
summary: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Current tab to check if it's last page or first to disable previous button and swap between next and submit button.
|
|
30
|
+
*/
|
|
31
|
+
tab: number;
|
|
32
|
+
/**
|
|
33
|
+
* Function to change the tab when pressing previous and next buttons.
|
|
34
|
+
*/
|
|
35
|
+
changeTab: any;
|
|
36
|
+
/**
|
|
37
|
+
* Custom object to define type, size and width of the StepNavigation component
|
|
38
|
+
*/
|
|
39
|
+
customStep?: Pick<HvStepNavigationProps, "type" | "stepSize" | "width">
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default function HvWizardTitle(props: HvWizardTitleProps): JSX.Element | null;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
|
|
3
|
+
var _Report;
|
|
4
|
+
|
|
5
|
+
import "core-js/modules/es.object.entries.js";
|
|
6
|
+
import "core-js/modules/es.array.map.js";
|
|
7
|
+
import "core-js/modules/es.function.name.js";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import { withStyles } from "@material-ui/core";
|
|
11
|
+
import { HvButton, HvDialogTitle, HvGrid, HvTypography } from "@hitachivantara/uikit-react-core";
|
|
12
|
+
import { Report } from "@hitachivantara/uikit-react-icons";
|
|
13
|
+
import { HvStepNavigation } from "@hitachivantara/uikit-react-lab";
|
|
14
|
+
import { HvWizardContext } from "..";
|
|
15
|
+
import styles from "./styles";
|
|
16
|
+
|
|
17
|
+
var switchTabState = function switchTabState(state, currentTab, index) {
|
|
18
|
+
if (index === currentTab) return "Current";
|
|
19
|
+
if (state.valid) return "Completed";
|
|
20
|
+
if (state.valid === null) return "Enabled";
|
|
21
|
+
if (state.touched && state.valid === false) return "Failed"; // "Disabled"
|
|
22
|
+
// "Pending"
|
|
23
|
+
|
|
24
|
+
return "Enabled";
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var HvWizardTitle = function HvWizardTitle(_ref) {
|
|
28
|
+
var _customStep$type, _customStep$stepSize, _customStep$width, _labels$summary;
|
|
29
|
+
|
|
30
|
+
var title = _ref.title,
|
|
31
|
+
_ref$hasSummary = _ref.hasSummary,
|
|
32
|
+
hasSummary = _ref$hasSummary === void 0 ? false : _ref$hasSummary,
|
|
33
|
+
_ref$labels = _ref.labels,
|
|
34
|
+
labels = _ref$labels === void 0 ? {} : _ref$labels,
|
|
35
|
+
tab = _ref.tab,
|
|
36
|
+
classes = _ref.classes,
|
|
37
|
+
changeTab = _ref.changeTab,
|
|
38
|
+
_ref$customStep = _ref.customStep,
|
|
39
|
+
customStep = _ref$customStep === void 0 ? {} : _ref$customStep;
|
|
40
|
+
|
|
41
|
+
var _React$useContext = React.useContext(HvWizardContext),
|
|
42
|
+
context = _React$useContext.context;
|
|
43
|
+
|
|
44
|
+
var _React$useState = React.useState([]),
|
|
45
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
46
|
+
steps = _React$useState2[0],
|
|
47
|
+
setSteps = _React$useState2[1];
|
|
48
|
+
|
|
49
|
+
React.useEffect(function () {
|
|
50
|
+
var contextArray = Object.entries(context);
|
|
51
|
+
|
|
52
|
+
if (contextArray.length) {
|
|
53
|
+
var updatedSteps = contextArray.map(function (_ref2, index) {
|
|
54
|
+
var _childState$name;
|
|
55
|
+
|
|
56
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
57
|
+
childState = _ref3[1];
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
title: (_childState$name = childState.name) !== null && _childState$name !== void 0 ? _childState$name : "".concat(index + 1),
|
|
61
|
+
state: switchTabState(childState, tab, index),
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
return changeTab(index);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
setSteps(updatedSteps);
|
|
68
|
+
}
|
|
69
|
+
}, [context, tab, changeTab]);
|
|
70
|
+
return /*#__PURE__*/React.createElement(HvDialogTitle, {
|
|
71
|
+
className: classes.headerContainer,
|
|
72
|
+
classes: {
|
|
73
|
+
messageContainer: classes.messageContainer
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/React.createElement(HvGrid, {
|
|
76
|
+
container: true,
|
|
77
|
+
justifyContent: "space-between",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
className: classes.titleContainer
|
|
80
|
+
}, title && /*#__PURE__*/React.createElement(HvTypography, {
|
|
81
|
+
variant: "xsTitle",
|
|
82
|
+
component: "h3"
|
|
83
|
+
}, title), !!steps.length && /*#__PURE__*/React.createElement(HvStepNavigation, {
|
|
84
|
+
className: classes.stepContainer,
|
|
85
|
+
steps: steps,
|
|
86
|
+
type: (_customStep$type = customStep === null || customStep === void 0 ? void 0 : customStep.type) !== null && _customStep$type !== void 0 ? _customStep$type : "Default",
|
|
87
|
+
stepSize: (_customStep$stepSize = customStep === null || customStep === void 0 ? void 0 : customStep.stepSize) !== null && _customStep$stepSize !== void 0 ? _customStep$stepSize : "XS",
|
|
88
|
+
width: (_customStep$width = customStep === null || customStep === void 0 ? void 0 : customStep.width) !== null && _customStep$width !== void 0 ? _customStep$width : {
|
|
89
|
+
xs: 200,
|
|
90
|
+
sm: 350,
|
|
91
|
+
md: 600,
|
|
92
|
+
lg: 800
|
|
93
|
+
}
|
|
94
|
+
}), hasSummary && /*#__PURE__*/React.createElement(HvButton, {
|
|
95
|
+
category: "secondary",
|
|
96
|
+
className: classes.buttonWidth,
|
|
97
|
+
classes: {
|
|
98
|
+
root: classes.rootSummaryButton
|
|
99
|
+
}
|
|
100
|
+
}, _Report || (_Report = /*#__PURE__*/React.createElement(Report, null)), " ", "".concat((_labels$summary = labels.summary) !== null && _labels$summary !== void 0 ? _labels$summary : "Summary"))));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
process.env.NODE_ENV !== "production" ? HvWizardTitle.propTypes = {
|
|
104
|
+
/**
|
|
105
|
+
* A Jss Object used to override or extend the styles applied.
|
|
106
|
+
*/
|
|
107
|
+
classes: PropTypes.shape({
|
|
108
|
+
/**
|
|
109
|
+
* Styles applied to the header container.
|
|
110
|
+
*/
|
|
111
|
+
headerContainer: PropTypes.string,
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Styles applied to override the Dialog Title styles.
|
|
115
|
+
*/
|
|
116
|
+
messageContainer: PropTypes.string,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Styles applied to the header content container.
|
|
120
|
+
*/
|
|
121
|
+
titleContainer: PropTypes.string,
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Styles applied to the Button component to override its width.
|
|
125
|
+
*/
|
|
126
|
+
buttonWidth: PropTypes.string,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Styles applied to the Button component to override its right padding.
|
|
130
|
+
*/
|
|
131
|
+
rootSummaryButton: PropTypes.string,
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
stepContainer: PropTypes.string
|
|
137
|
+
}),
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Title for the wizard.
|
|
141
|
+
*/
|
|
142
|
+
title: PropTypes.string,
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Shows the summary button.
|
|
146
|
+
*/
|
|
147
|
+
hasSummary: PropTypes.bool,
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* An object containing all the labels for the wizard header.
|
|
151
|
+
*/
|
|
152
|
+
labels: PropTypes.shape({
|
|
153
|
+
/**
|
|
154
|
+
* Summary button label.
|
|
155
|
+
*/
|
|
156
|
+
summary: PropTypes.string
|
|
157
|
+
}),
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Current tab to check if it's last page or first to disable previous button and swap between next and submit button.
|
|
161
|
+
*/
|
|
162
|
+
tab: PropTypes.number.isRequired,
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Function to change the tab when pressing previous and next buttons.
|
|
166
|
+
*/
|
|
167
|
+
changeTab: PropTypes.func.isRequired,
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Custom object to define type, size and width of the StepNavigation component
|
|
171
|
+
*/
|
|
172
|
+
customStep: PropTypes.shape({
|
|
173
|
+
/**
|
|
174
|
+
* Type of step navigation. Values = {"Simple", "Default"}.
|
|
175
|
+
*/
|
|
176
|
+
type: PropTypes.oneOf(["Simple", "Default"]),
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Sets one of the standard sizes of the steps. Values = {"XS", "SM", "MD", "LG", "XL"}
|
|
180
|
+
*/
|
|
181
|
+
stepSize: PropTypes.oneOf(["XS", "SM", "MD", "LG", "XL"]),
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Width of the component element on each breakpoint screen resolution.
|
|
185
|
+
*/
|
|
186
|
+
width: PropTypes.shape({
|
|
187
|
+
xs: PropTypes.number,
|
|
188
|
+
sm: PropTypes.number,
|
|
189
|
+
md: PropTypes.number,
|
|
190
|
+
lg: PropTypes.number,
|
|
191
|
+
xl: PropTypes.number
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
} : void 0;
|
|
195
|
+
export default withStyles(styles, {
|
|
196
|
+
name: "HvWizardTitle"
|
|
197
|
+
})(HvWizardTitle);
|
|
198
|
+
//# sourceMappingURL=WizardTitle.js.map
|