ywana-core8 0.0.655 → 0.0.657

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
@@ -9625,6 +9625,26 @@ var TableAPI = function TableAPI(url, host) {
9625
9625
  };
9626
9626
 
9627
9627
  var Wizard = function Wizard(props) {
9628
+ var finish = function finish() {
9629
+ try {
9630
+ return Promise.resolve(stepRef.current.onNext(function () {
9631
+ if (onClose) onClose();
9632
+ })).then(function () {});
9633
+ } catch (e) {
9634
+ return Promise.reject(e);
9635
+ }
9636
+ };
9637
+
9638
+ var next = function next() {
9639
+ try {
9640
+ return Promise.resolve(stepRef.current.onNext(function () {
9641
+ setCurrent(current + 1);
9642
+ })).then(function () {});
9643
+ } catch (e) {
9644
+ return Promise.reject(e);
9645
+ }
9646
+ };
9647
+
9628
9648
  var _props$init = props.init,
9629
9649
  init = _props$init === void 0 ? 0 : _props$init,
9630
9650
  onClose = props.onClose,
@@ -9642,18 +9662,6 @@ var Wizard = function Wizard(props) {
9642
9662
  if (current > 0) setCurrent(current - 1);
9643
9663
  }
9644
9664
 
9645
- function next() {
9646
- stepRef.current.onComplete(function () {
9647
- setCurrent(current + 1);
9648
- });
9649
- }
9650
-
9651
- function finish() {
9652
- stepRef.current.onComplete(function () {
9653
- if (onClose) onClose();
9654
- });
9655
- }
9656
-
9657
9665
  var currentStep = React.useMemo(function () {
9658
9666
  return React__default["default"].cloneElement(steps[current], {
9659
9667
  ref: stepRef
@@ -9688,10 +9696,11 @@ var Wizard = function Wizard(props) {
9688
9696
  action: prev
9689
9697
  }), current < steps.length - 1 ? /*#__PURE__*/React__default["default"].createElement(Button, {
9690
9698
  label: "Siguiente",
9691
- disabled: current === steps.length - 1,
9699
+ disabled: stepRef && stepRef.current.isValid(),
9692
9700
  action: next
9693
9701
  }) : /*#__PURE__*/React__default["default"].createElement(Button, {
9694
9702
  label: "Finalizar",
9703
+ disabled: stepRef && stepRef.current.isValid(),
9695
9704
  action: finish,
9696
9705
  raised: true
9697
9706
  })));