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 CHANGED
@@ -9624,6 +9624,27 @@ var TableAPI = function TableAPI(url, host) {
9624
9624
  };
9625
9625
  };
9626
9626
 
9627
+ /**
9628
+ * Wizard Context
9629
+ */
9630
+
9631
+ var WizardContext = React__default["default"].createContext({});
9632
+ /**
9633
+ * Wizard Provider
9634
+ */
9635
+
9636
+ var WizardProvider = function WizardProvider(props) {
9637
+ var _useState = React.useState(props.form),
9638
+ form = _useState[0],
9639
+ setForm = _useState[1];
9640
+
9641
+ return /*#__PURE__*/React__default["default"].createElement(WizardContext.Provider, {
9642
+ value: {
9643
+ form: form,
9644
+ setForm: setForm
9645
+ }
9646
+ }, props.children);
9647
+ };
9627
9648
  var Wizard = function Wizard(props) {
9628
9649
  var finish = function finish() {
9629
9650
  try {
@@ -9645,15 +9666,17 @@ var Wizard = function Wizard(props) {
9645
9666
  }
9646
9667
  };
9647
9668
 
9648
- var _props$init = props.init,
9669
+ var _props$form = props.form,
9670
+ form = _props$form === void 0 ? {} : _props$form,
9671
+ _props$init = props.init,
9649
9672
  init = _props$init === void 0 ? 0 : _props$init,
9650
9673
  onClose = props.onClose,
9651
9674
  children = props.children;
9652
9675
 
9653
- var _useState = React.useState(init),
9654
- _useState$ = _useState[0],
9655
- current = _useState$ === void 0 ? 0 : _useState$,
9656
- setCurrent = _useState[1];
9676
+ var _useState2 = React.useState(init),
9677
+ _useState2$ = _useState2[0],
9678
+ current = _useState2$ === void 0 ? 0 : _useState2$,
9679
+ setCurrent = _useState2[1];
9657
9680
 
9658
9681
  var steps = React__default["default"].Children.toArray(children);
9659
9682
  var stepRef = React.useRef();
@@ -9667,7 +9690,9 @@ var Wizard = function Wizard(props) {
9667
9690
  ref: stepRef
9668
9691
  });
9669
9692
  }, [current]);
9670
- return /*#__PURE__*/React__default["default"].createElement("div", {
9693
+ return /*#__PURE__*/React__default["default"].createElement(WizardProvider, {
9694
+ form: form
9695
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
9671
9696
  className: "wizard"
9672
9697
  }, /*#__PURE__*/React__default["default"].createElement("div", {
9673
9698
  className: "wizard-steps"
@@ -9703,7 +9728,7 @@ var Wizard = function Wizard(props) {
9703
9728
  disabled: stepRef.current && stepRef.current.isValid(),
9704
9729
  action: finish,
9705
9730
  raised: true
9706
- })));
9731
+ }))));
9707
9732
  };
9708
9733
 
9709
9734
  var isFunction = function isFunction(value) {