ywana-core8 0.0.658 → 0.0.660
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/index.cjs +32 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +32 -7
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +32 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/incubator/wizard.js +47 -26
- package/src/incubator/wizard.test.js +16 -2
package/dist/index.modern.js
CHANGED
@@ -9616,6 +9616,27 @@ var TableAPI = function TableAPI(url, host) {
|
|
9616
9616
|
};
|
9617
9617
|
};
|
9618
9618
|
|
9619
|
+
/**
|
9620
|
+
* Wizard Context
|
9621
|
+
*/
|
9622
|
+
|
9623
|
+
var WizardContext = React.createContext({});
|
9624
|
+
/**
|
9625
|
+
* Wizard Provider
|
9626
|
+
*/
|
9627
|
+
|
9628
|
+
var WizardProvider = function WizardProvider(props) {
|
9629
|
+
var _useState = useState(props.form),
|
9630
|
+
form = _useState[0],
|
9631
|
+
setForm = _useState[1];
|
9632
|
+
|
9633
|
+
return /*#__PURE__*/React.createElement(WizardContext.Provider, {
|
9634
|
+
value: {
|
9635
|
+
form: form,
|
9636
|
+
setForm: setForm
|
9637
|
+
}
|
9638
|
+
}, props.children);
|
9639
|
+
};
|
9619
9640
|
var Wizard = function Wizard(props) {
|
9620
9641
|
var finish = function finish() {
|
9621
9642
|
try {
|
@@ -9637,15 +9658,17 @@ var Wizard = function Wizard(props) {
|
|
9637
9658
|
}
|
9638
9659
|
};
|
9639
9660
|
|
9640
|
-
var _props$
|
9661
|
+
var _props$form = props.form,
|
9662
|
+
form = _props$form === void 0 ? {} : _props$form,
|
9663
|
+
_props$init = props.init,
|
9641
9664
|
init = _props$init === void 0 ? 0 : _props$init,
|
9642
9665
|
onClose = props.onClose,
|
9643
9666
|
children = props.children;
|
9644
9667
|
|
9645
|
-
var
|
9646
|
-
|
9647
|
-
current =
|
9648
|
-
setCurrent =
|
9668
|
+
var _useState2 = useState(init),
|
9669
|
+
_useState2$ = _useState2[0],
|
9670
|
+
current = _useState2$ === void 0 ? 0 : _useState2$,
|
9671
|
+
setCurrent = _useState2[1];
|
9649
9672
|
|
9650
9673
|
var steps = React.Children.toArray(children);
|
9651
9674
|
var stepRef = useRef();
|
@@ -9659,7 +9682,9 @@ var Wizard = function Wizard(props) {
|
|
9659
9682
|
ref: stepRef
|
9660
9683
|
});
|
9661
9684
|
}, [current]);
|
9662
|
-
return /*#__PURE__*/React.createElement(
|
9685
|
+
return /*#__PURE__*/React.createElement(WizardProvider, {
|
9686
|
+
form: form
|
9687
|
+
}, /*#__PURE__*/React.createElement("div", {
|
9663
9688
|
className: "wizard"
|
9664
9689
|
}, /*#__PURE__*/React.createElement("div", {
|
9665
9690
|
className: "wizard-steps"
|
@@ -9695,7 +9720,7 @@ var Wizard = function Wizard(props) {
|
|
9695
9720
|
disabled: stepRef.current && stepRef.current.isValid(),
|
9696
9721
|
action: finish,
|
9697
9722
|
raised: true
|
9698
|
-
})));
|
9723
|
+
}))));
|
9699
9724
|
};
|
9700
9725
|
|
9701
9726
|
var isFunction = function isFunction(value) {
|