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.umd.js CHANGED
@@ -9618,6 +9618,27 @@
9618
9618
  };
9619
9619
  };
9620
9620
 
9621
+ /**
9622
+ * Wizard Context
9623
+ */
9624
+
9625
+ var WizardContext = React__default["default"].createContext({});
9626
+ /**
9627
+ * Wizard Provider
9628
+ */
9629
+
9630
+ var WizardProvider = function WizardProvider(props) {
9631
+ var _useState = React.useState(props.form),
9632
+ form = _useState[0],
9633
+ setForm = _useState[1];
9634
+
9635
+ return /*#__PURE__*/React__default["default"].createElement(WizardContext.Provider, {
9636
+ value: {
9637
+ form: form,
9638
+ setForm: setForm
9639
+ }
9640
+ }, props.children);
9641
+ };
9621
9642
  var Wizard = function Wizard(props) {
9622
9643
  var finish = function finish() {
9623
9644
  try {
@@ -9639,15 +9660,17 @@
9639
9660
  }
9640
9661
  };
9641
9662
 
9642
- var _props$init = props.init,
9663
+ var _props$form = props.form,
9664
+ form = _props$form === void 0 ? {} : _props$form,
9665
+ _props$init = props.init,
9643
9666
  init = _props$init === void 0 ? 0 : _props$init,
9644
9667
  onClose = props.onClose,
9645
9668
  children = props.children;
9646
9669
 
9647
- var _useState = React.useState(init),
9648
- _useState$ = _useState[0],
9649
- current = _useState$ === void 0 ? 0 : _useState$,
9650
- setCurrent = _useState[1];
9670
+ var _useState2 = React.useState(init),
9671
+ _useState2$ = _useState2[0],
9672
+ current = _useState2$ === void 0 ? 0 : _useState2$,
9673
+ setCurrent = _useState2[1];
9651
9674
 
9652
9675
  var steps = React__default["default"].Children.toArray(children);
9653
9676
  var stepRef = React.useRef();
@@ -9661,7 +9684,9 @@
9661
9684
  ref: stepRef
9662
9685
  });
9663
9686
  }, [current]);
9664
- return /*#__PURE__*/React__default["default"].createElement("div", {
9687
+ return /*#__PURE__*/React__default["default"].createElement(WizardProvider, {
9688
+ form: form
9689
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
9665
9690
  className: "wizard"
9666
9691
  }, /*#__PURE__*/React__default["default"].createElement("div", {
9667
9692
  className: "wizard-steps"
@@ -9697,7 +9722,7 @@
9697
9722
  disabled: stepRef.current && stepRef.current.isValid(),
9698
9723
  action: finish,
9699
9724
  raised: true
9700
- })));
9725
+ }))));
9701
9726
  };
9702
9727
 
9703
9728
  var isFunction = function isFunction(value) {