@hitachivantara/uikit-react-lab 3.56.1 → 3.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.d.ts +12 -0
- package/dist/Wizard/WizardContext/WizardContext.js +21 -0
- package/dist/Wizard/WizardContext/WizardContext.js.map +1 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.d.ts +28 -0
- package/dist/Wizard/WizardContext/WizardContextProvider.js +47 -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 +24 -0
- package/dist/Wizard/WizardContext/index.js.map +1 -0
- package/dist/Wizard/WizardTitle/WizardTitle.d.ts +40 -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 +17 -0
- package/dist/Wizard/index.js +64 -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 +22 -1
- package/dist/index.js.map +1 -1
- 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.d.ts +12 -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/WizardContextProvider.d.ts +28 -0
- package/dist/legacy/Wizard/WizardContext/WizardContextProvider.js +35 -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 +3 -0
- package/dist/legacy/Wizard/WizardContext/index.js.map +1 -0
- package/dist/legacy/Wizard/WizardTitle/WizardTitle.d.ts +40 -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 +17 -0
- package/dist/legacy/Wizard/index.js +8 -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 +2 -0
- package/dist/legacy/index.js.map +1 -1
- 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.d.ts +12 -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/WizardContextProvider.d.ts +28 -0
- package/dist/modern/Wizard/WizardContext/WizardContextProvider.js +36 -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 +3 -0
- package/dist/modern/Wizard/WizardContext/index.js.map +1 -0
- package/dist/modern/Wizard/WizardTitle/WizardTitle.d.ts +40 -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 +17 -0
- package/dist/modern/Wizard/index.js +8 -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 +2 -0
- package/dist/modern/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Wizard/WizardActions/index.js"],"sourcesContent":["export { default } from \"./WizardActions\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var styles = function styles() {
|
|
9
|
+
return {
|
|
10
|
+
buttonWidth: {
|
|
11
|
+
width: 120
|
|
12
|
+
},
|
|
13
|
+
actionsContainer: {
|
|
14
|
+
display: "flex",
|
|
15
|
+
justifyContent: "space-between"
|
|
16
|
+
},
|
|
17
|
+
buttonsContainer: {
|
|
18
|
+
"& > button:last-child": {
|
|
19
|
+
marginLeft: 20
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
buttonSpacing: {
|
|
23
|
+
paddingLeft: 28
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _default = styles;
|
|
29
|
+
exports.default = _default;
|
|
30
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","names":["styles","buttonWidth","width","actionsContainer","display","justifyContent","buttonsContainer","marginLeft","buttonSpacing","paddingLeft"],"sources":["../../../src/Wizard/WizardActions/styles.js"],"sourcesContent":["const styles = () => ({\n buttonWidth: {\n width: 120,\n },\n actionsContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n },\n buttonsContainer: {\n \"& > button:last-child\": {\n marginLeft: 20,\n },\n },\n buttonSpacing: {\n paddingLeft: 28,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;;AAAA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,OAAO;IACpBC,WAAW,EAAE;MACXC,KAAK,EAAE;IADI,CADO;IAIpBC,gBAAgB,EAAE;MAChBC,OAAO,EAAE,MADO;MAEhBC,cAAc,EAAE;IAFA,CAJE;IAQpBC,gBAAgB,EAAE;MAChB,yBAAyB;QACvBC,UAAU,EAAE;MADW;IADT,CARE;IAapBC,aAAa,EAAE;MACbC,WAAW,EAAE;IADA;EAbK,CAAP;AAAA,CAAf;;eAkBeT,M"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StandardProps, ModalProps } from "@material-ui/core";
|
|
3
|
+
|
|
4
|
+
export type HvWizardContainerClassKey = "root";
|
|
5
|
+
|
|
6
|
+
export type HvWizardContainerProps = StandardProps<
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
8
|
+
HvWizardContainerClassKey
|
|
9
|
+
> & {
|
|
10
|
+
/**
|
|
11
|
+
* Class names to be applied.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Components of the Wizard.
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Current state of the Wizard.
|
|
20
|
+
*/
|
|
21
|
+
open: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Function executed on close.
|
|
24
|
+
*/
|
|
25
|
+
handleClose: ModalProps["onClose"];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function HvWizardContainer(props: HvWizardContainerProps): JSX.Element | null;
|
|
@@ -0,0 +1,94 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
|
+
|
|
20
|
+
var _core = require("@material-ui/core");
|
|
21
|
+
|
|
22
|
+
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
23
|
+
|
|
24
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
25
|
+
|
|
26
|
+
var _excluded = ["classes", "className", "children", "handleClose", "open"];
|
|
27
|
+
|
|
28
|
+
var HvWizardContainer = function HvWizardContainer(_ref) {
|
|
29
|
+
var classes = _ref.classes,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
children = _ref.children,
|
|
32
|
+
handleClose = _ref.handleClose,
|
|
33
|
+
open = _ref.open,
|
|
34
|
+
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvDialog, (0, _extends2.default)({
|
|
36
|
+
classes: {
|
|
37
|
+
closeButton: classes.closeButton,
|
|
38
|
+
paper: classes.paper
|
|
39
|
+
} // overrides css
|
|
40
|
+
,
|
|
41
|
+
className: (0, _clsx.default)(className, classes.root),
|
|
42
|
+
open: open,
|
|
43
|
+
onClose: handleClose
|
|
44
|
+
}, others), children);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
process.env.NODE_ENV !== "production" ? HvWizardContainer.propTypes = {
|
|
48
|
+
/**
|
|
49
|
+
* Class names to be applied.
|
|
50
|
+
*/
|
|
51
|
+
className: _propTypes.default.string,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* A Jss Object used to override or extend the styles applied.
|
|
55
|
+
*/
|
|
56
|
+
classes: _propTypes.default.shape({
|
|
57
|
+
/**
|
|
58
|
+
* Styles applied to the component root class.
|
|
59
|
+
*/
|
|
60
|
+
root: _propTypes.default.string,
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Style applied to the component (root).
|
|
64
|
+
*/
|
|
65
|
+
paper: _propTypes.default.string,
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Style applied to the close button.
|
|
69
|
+
*/
|
|
70
|
+
closeButton: _propTypes.default.string
|
|
71
|
+
}).isRequired,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Components of the Wizard.
|
|
75
|
+
*/
|
|
76
|
+
children: _propTypes.default.node.isRequired,
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Current state of the Wizard.
|
|
80
|
+
*/
|
|
81
|
+
open: _propTypes.default.bool.isRequired,
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Function executed on close.
|
|
85
|
+
*/
|
|
86
|
+
handleClose: _propTypes.default.func.isRequired
|
|
87
|
+
} : void 0;
|
|
88
|
+
|
|
89
|
+
var _default = (0, _core.withStyles)(_styles.default, {
|
|
90
|
+
name: "HvWizardContainer"
|
|
91
|
+
})(HvWizardContainer);
|
|
92
|
+
|
|
93
|
+
exports.default = _default;
|
|
94
|
+
//# sourceMappingURL=WizardContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContainer.js","names":["HvWizardContainer","classes","className","children","handleClose","open","others","closeButton","paper","clsx","root","propTypes","PropTypes","string","shape","isRequired","node","bool","func","withStyles","styles","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;;AACA;;AACA;;AACA;;AACA;;AAEA;;;;AAEA,IAAMA,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,6BAAC,wBAAD;IACE,OAAO,EAAE;MAAEC,WAAW,EAAEN,OAAO,CAACM,WAAvB;MAAoCC,KAAK,EAAEP,OAAO,CAACO;IAAnD,CADX,CACuE;IADvE;IAEE,SAAS,EAAE,IAAAC,aAAA,EAAKP,SAAL,EAAgBD,OAAO,CAACS,IAAxB,CAFb;IAGE,IAAI,EAAEL,IAHR;IAIE,OAAO,EAAED;EAJX,GAKME,MALN,GAOGH,QAPH,CADF;AAWD,CAZD;;AAcA,wCAAAH,iBAAiB,CAACW,SAAlB,GAA8B;EAC5B;AACF;AACA;EACET,SAAS,EAAEU,kBAAA,CAAUC,MAJO;;EAK5B;AACF;AACA;EACEZ,OAAO,EAAEW,kBAAA,CAAUE,KAAV,CAAgB;IACvB;AACJ;AACA;IACIJ,IAAI,EAAEE,kBAAA,CAAUC,MAJO;;IAKvB;AACJ;AACA;IACIL,KAAK,EAAEI,kBAAA,CAAUC,MARM;;IASvB;AACJ;AACA;IACIN,WAAW,EAAEK,kBAAA,CAAUC;EAZA,CAAhB,EAaNE,UArByB;;EAsB5B;AACF;AACA;EACEZ,QAAQ,EAAES,kBAAA,CAAUI,IAAV,CAAeD,UAzBG;;EA0B5B;AACF;AACA;EACEV,IAAI,EAAEO,kBAAA,CAAUK,IAAV,CAAeF,UA7BO;;EA8B5B;AACF;AACA;EACEX,WAAW,EAAEQ,kBAAA,CAAUM,IAAV,CAAeH;AAjCA,CAA9B;;eAoCe,IAAAI,gBAAA,EAAWC,eAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAkDrB,iBAAlD,C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _WizardContainer.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _WizardContainer = _interopRequireDefault(require("./WizardContainer"));
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Wizard/WizardContainer/index.js"],"sourcesContent":["export { default } from \"./WizardContainer\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var styles = function styles() {
|
|
9
|
+
return {
|
|
10
|
+
root: {},
|
|
11
|
+
paper: {
|
|
12
|
+
width: "80%",
|
|
13
|
+
maxWidth: "80%"
|
|
14
|
+
},
|
|
15
|
+
closeButton: {
|
|
16
|
+
display: "none"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = styles;
|
|
22
|
+
exports.default = _default;
|
|
23
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -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;;eAWeN,M"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
+
|
|
18
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
19
|
+
|
|
20
|
+
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
21
|
+
|
|
22
|
+
var _core = require("@material-ui/core");
|
|
23
|
+
|
|
24
|
+
var _excluded = ["children", "hidden"];
|
|
25
|
+
var useStyles = (0, _core.makeStyles)(function (theme) {
|
|
26
|
+
return {
|
|
27
|
+
loading: {
|
|
28
|
+
width: "100%",
|
|
29
|
+
height: "100%"
|
|
30
|
+
},
|
|
31
|
+
overlay: {
|
|
32
|
+
position: "absolute",
|
|
33
|
+
transition: "background-Color .2s ease",
|
|
34
|
+
zIndex: -1
|
|
35
|
+
},
|
|
36
|
+
blur: {
|
|
37
|
+
backgroundColor: (0, _core.alpha)((0, _core.hexToRgb)(theme.hv.palette.atmosphere.atmo2), 0.8),
|
|
38
|
+
zIndex: theme.zIndex.drawer
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var LoadingContainer = function LoadingContainer(_ref) {
|
|
44
|
+
var children = _ref.children,
|
|
45
|
+
hidden = _ref.hidden,
|
|
46
|
+
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
|
+
var classes = useStyles();
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
height: "100%",
|
|
53
|
+
width: "100%"
|
|
54
|
+
},
|
|
55
|
+
className: (0, _clsx.default)(classes.overlay, !hidden && classes.blur)
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvLoading, (0, _extends2.default)({
|
|
57
|
+
classes: {
|
|
58
|
+
root: classes.loading
|
|
59
|
+
},
|
|
60
|
+
hidden: hidden
|
|
61
|
+
}, others))), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
|
+
style: {
|
|
63
|
+
display: "flow-root"
|
|
64
|
+
}
|
|
65
|
+
}, children));
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
process.env.NODE_ENV !== "production" ? LoadingContainer.propTypes = {
|
|
69
|
+
children: _propTypes.default.node,
|
|
70
|
+
hidden: _propTypes.default.bool
|
|
71
|
+
} : void 0;
|
|
72
|
+
var _default = LoadingContainer;
|
|
73
|
+
exports.default = _default;
|
|
74
|
+
//# sourceMappingURL=LoadingContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingContainer.js","names":["useStyles","makeStyles","theme","loading","width","height","overlay","position","transition","zIndex","blur","backgroundColor","alpha","hexToRgb","hv","palette","atmosphere","atmo2","drawer","LoadingContainer","children","hidden","others","classes","top","left","clsx","root","display","propTypes","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;;AACA;;AACA;;AACA;;AACA;;;AAEA,IAAMA,SAAS,GAAG,IAAAC,gBAAA,EAAW,UAACC,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,EAAE,IAAAC,WAAA,EAAM,IAAAC,cAAA,EAASX,KAAK,CAACY,EAAN,CAASC,OAAT,CAAiBC,UAAjB,CAA4BC,KAArC,CAAN,EAAmD,GAAnD,CADb;MAEJR,MAAM,EAAEP,KAAK,CAACO,MAAN,CAAaS;IAFjB;EAViC,CAAZ;AAAA,CAAX,CAAlB;;AAgBA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAqC;EAAA,IAAlCC,QAAkC,QAAlCA,QAAkC;EAAA,IAAxBC,MAAwB,QAAxBA,MAAwB;EAAA,IAAbC,MAAa;EAC5D,IAAMC,OAAO,GAAGvB,SAAS,EAAzB;EAEA,oBACE,yEACE;IACE,KAAK,EAAE;MACLwB,GAAG,EAAE,CADA;MAELC,IAAI,EAAE,CAFD;MAGLpB,MAAM,EAAE,MAHH;MAILD,KAAK,EAAE;IAJF,CADT;IAOE,SAAS,EAAE,IAAAsB,aAAA,EAAKH,OAAO,CAACjB,OAAb,EAAwC,CAACe,MAAzC,IAAyBE,OAAO,CAACb,IAAjC;EAPb,gBASE,6BAAC,yBAAD;IAAW,OAAO,EAAE;MAAEiB,IAAI,EAAEJ,OAAO,CAACpB;IAAhB,CAApB;IAA+C,MAAM,EAAEkB;EAAvD,GAAmEC,MAAnE,EATF,CADF,eAYE;IAAK,KAAK,EAAE;MAAEM,OAAO,EAAE;IAAX;EAAZ,GAAuCR,QAAvC,CAZF,CADF;AAgBD,CAnBD;;AAqBA,wCAAAD,gBAAgB,CAACU,SAAjB,GAA6B;EAC3BT,QAAQ,EAAEU,kBAAA,CAAUC,IADO;EAE3BV,MAAM,EAAES,kBAAA,CAAUE;AAFS,CAA7B;eAKeb,gB"}
|
|
@@ -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,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.array.filter.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
14
|
+
|
|
15
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
+
|
|
17
|
+
Object.defineProperty(exports, "__esModule", {
|
|
18
|
+
value: true
|
|
19
|
+
});
|
|
20
|
+
exports.default = void 0;
|
|
21
|
+
|
|
22
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
require("core-js/modules/es.object.to-string.js");
|
|
27
|
+
|
|
28
|
+
require("core-js/modules/es.promise.js");
|
|
29
|
+
|
|
30
|
+
require("core-js/modules/es.object.entries.js");
|
|
31
|
+
|
|
32
|
+
require("core-js/modules/es.array.map.js");
|
|
33
|
+
|
|
34
|
+
var _react = _interopRequireDefault(require("react"));
|
|
35
|
+
|
|
36
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
37
|
+
|
|
38
|
+
var _core = require("@material-ui/core");
|
|
39
|
+
|
|
40
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
41
|
+
|
|
42
|
+
var _uikitReactCore = require("@hitachivantara/uikit-react-core");
|
|
43
|
+
|
|
44
|
+
var _WizardContext = _interopRequireDefault(require("../WizardContext"));
|
|
45
|
+
|
|
46
|
+
var _LoadingContainer = _interopRequireDefault(require("./LoadingContainer"));
|
|
47
|
+
|
|
48
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
49
|
+
|
|
50
|
+
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; }
|
|
51
|
+
|
|
52
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
53
|
+
|
|
54
|
+
var HvWizardContent = function HvWizardContent(_ref) {
|
|
55
|
+
var classes = _ref.classes,
|
|
56
|
+
_ref$fixedHeight = _ref.fixedHeight,
|
|
57
|
+
fixedHeight = _ref$fixedHeight === void 0 ? false : _ref$fixedHeight,
|
|
58
|
+
_ref$loading = _ref.loading,
|
|
59
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
60
|
+
children = _ref.children,
|
|
61
|
+
tab = _ref.tab;
|
|
62
|
+
|
|
63
|
+
var arrayChildren = _react.default.Children.toArray(children);
|
|
64
|
+
|
|
65
|
+
var initialContext = arrayChildren.reduce(function (acc, child, index) {
|
|
66
|
+
var invalid = child.props.mustValidate === true ? false : null;
|
|
67
|
+
var valid = invalid !== null && invalid !== void 0 ? invalid : index === 0 || null;
|
|
68
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, index, _objectSpread(_objectSpread({}, child.props), {}, {
|
|
69
|
+
form: {},
|
|
70
|
+
valid: valid,
|
|
71
|
+
touched: index === 0
|
|
72
|
+
})));
|
|
73
|
+
}, {});
|
|
74
|
+
|
|
75
|
+
var _React$useContext = _react.default.useContext(_WizardContext.default),
|
|
76
|
+
context = _React$useContext.context,
|
|
77
|
+
setContext = _React$useContext.setContext;
|
|
78
|
+
|
|
79
|
+
_react.default.useEffect(function () {
|
|
80
|
+
setContext(initialContext);
|
|
81
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
_react.default.useEffect(function () {
|
|
85
|
+
var _context$tab;
|
|
86
|
+
|
|
87
|
+
if (tab && !((_context$tab = context[tab]) !== null && _context$tab !== void 0 && _context$tab.touched)) {
|
|
88
|
+
var updatedContext = Object.entries(context).reduce(function (acc, _ref2) {
|
|
89
|
+
var _childState$valid;
|
|
90
|
+
|
|
91
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
92
|
+
key = _ref3[0],
|
|
93
|
+
childState = _ref3[1];
|
|
94
|
+
|
|
95
|
+
return _objectSpread(_objectSpread({}, acc), +key <= tab ? (0, _defineProperty2.default)({}, key, _objectSpread(_objectSpread({}, childState), {}, {
|
|
96
|
+
touched: true,
|
|
97
|
+
valid: (_childState$valid = childState.valid) !== null && _childState$valid !== void 0 ? _childState$valid : true
|
|
98
|
+
})) : (0, _defineProperty2.default)({}, key, childState));
|
|
99
|
+
}, {});
|
|
100
|
+
setContext(updatedContext);
|
|
101
|
+
}
|
|
102
|
+
}, [tab]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
return /*#__PURE__*/_react.default.createElement(_uikitReactCore.HvDialogContent, {
|
|
106
|
+
className: (0, _clsx.default)(classes.contentContainer, fixedHeight && classes.fixedHeight),
|
|
107
|
+
indentContent: true
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement(_LoadingContainer.default, {
|
|
109
|
+
hidden: !loading
|
|
110
|
+
}, _react.default.Children.map(arrayChildren, function (child, index) {
|
|
111
|
+
if (index === tab) {
|
|
112
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
113
|
+
tab: tab
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return null;
|
|
118
|
+
})));
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
process.env.NODE_ENV !== "production" ? HvWizardContent.propTypes = {
|
|
122
|
+
/**
|
|
123
|
+
* Current tab to show.
|
|
124
|
+
*/
|
|
125
|
+
tab: _propTypes.default.number.isRequired,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Tabs to show on the Wizard.
|
|
129
|
+
*/
|
|
130
|
+
children: _propTypes.default.node.isRequired,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A Jss Object used to override or extend the styles applied.
|
|
134
|
+
*/
|
|
135
|
+
classes: _propTypes.default.shape({
|
|
136
|
+
/**
|
|
137
|
+
* Style applied to the Wizard content container
|
|
138
|
+
*/
|
|
139
|
+
contentContainer: _propTypes.default.string,
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Style applied to the Wizard to fix its height.
|
|
143
|
+
*/
|
|
144
|
+
fixedHeight: _propTypes.default.string
|
|
145
|
+
}).isRequired,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Forces minimum height to the component.
|
|
149
|
+
*/
|
|
150
|
+
fixedHeight: _propTypes.default.bool,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Whether the loading animation is shown.
|
|
154
|
+
*/
|
|
155
|
+
loading: _propTypes.default.bool
|
|
156
|
+
} : void 0;
|
|
157
|
+
|
|
158
|
+
var _default = (0, _core.withStyles)(_styles.default, {
|
|
159
|
+
name: "HvWizardContent"
|
|
160
|
+
})(HvWizardContent);
|
|
161
|
+
|
|
162
|
+
exports.default = _default;
|
|
163
|
+
//# sourceMappingURL=WizardContent.js.map
|
|
@@ -0,0 +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 \"@material-ui/core\";\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":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _WizardContent.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _WizardContent = _interopRequireDefault(require("./WizardContent"));
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/Wizard/WizardContent/index.js"],"sourcesContent":["export { default } from \"./WizardContent\";\n"],"mappings":";;;;;;;;;;;;;;AAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var styles = function styles() {
|
|
9
|
+
return {
|
|
10
|
+
contentContainer: {
|
|
11
|
+
position: "relative",
|
|
12
|
+
padding: 20,
|
|
13
|
+
marginLeft: 0,
|
|
14
|
+
minHeight: 400
|
|
15
|
+
},
|
|
16
|
+
fixedHeight: {
|
|
17
|
+
minHeight: "calc(100vh - 387px)"
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var _default = styles;
|
|
23
|
+
exports.default = _default;
|
|
24
|
+
//# 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;;eAYeL,M"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export type HvWizardContextClassKey = "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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var WizardContext = /*#__PURE__*/(0, _react.createContext)({
|
|
11
|
+
context: {},
|
|
12
|
+
setContext: function setContext() {}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
if (process.env.NODE_ENV !== "production") {
|
|
16
|
+
WizardContext.displayName = "WizardContext";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var _default = WizardContext;
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=WizardContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WizardContext.js","names":["WizardContext","createContext","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;;AAEA,IAAMA,aAAa,gBAAG,IAAAC,oBAAA,EAAc;EAClCC,OAAO,EAAE,EADyB;EAElCC,UAAU,EAAE,sBAAM,CAAE;AAFc,CAAd,CAAtB;;AAKA,IAAIC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;EACzCN,aAAa,CAACO,WAAd,GAA4B,eAA5B;AACD;;eAEcP,a"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { StandardProps } from "@material-ui/core";
|
|
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;
|