ywana-core8 0.0.655 → 0.0.656

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
@@ -9619,6 +9619,26 @@
9619
9619
  };
9620
9620
 
9621
9621
  var Wizard = function Wizard(props) {
9622
+ var finish = function finish() {
9623
+ try {
9624
+ return Promise.resolve(stepRef.current.onNext(function () {
9625
+ if (onClose) onClose();
9626
+ })).then(function () {});
9627
+ } catch (e) {
9628
+ return Promise.reject(e);
9629
+ }
9630
+ };
9631
+
9632
+ var next = function next() {
9633
+ try {
9634
+ return Promise.resolve(stepRef.current.onNext(function () {
9635
+ setCurrent(current + 1);
9636
+ })).then(function () {});
9637
+ } catch (e) {
9638
+ return Promise.reject(e);
9639
+ }
9640
+ };
9641
+
9622
9642
  var _props$init = props.init,
9623
9643
  init = _props$init === void 0 ? 0 : _props$init,
9624
9644
  onClose = props.onClose,
@@ -9636,18 +9656,6 @@
9636
9656
  if (current > 0) setCurrent(current - 1);
9637
9657
  }
9638
9658
 
9639
- function next() {
9640
- stepRef.current.onComplete(function () {
9641
- setCurrent(current + 1);
9642
- });
9643
- }
9644
-
9645
- function finish() {
9646
- stepRef.current.onComplete(function () {
9647
- if (onClose) onClose();
9648
- });
9649
- }
9650
-
9651
9659
  var currentStep = React.useMemo(function () {
9652
9660
  return React__default["default"].cloneElement(steps[current], {
9653
9661
  ref: stepRef
@@ -9682,10 +9690,11 @@
9682
9690
  action: prev
9683
9691
  }), current < steps.length - 1 ? /*#__PURE__*/React__default["default"].createElement(Button, {
9684
9692
  label: "Siguiente",
9685
- disabled: current === steps.length - 1,
9693
+ disabled: stepRef.current.isValid(),
9686
9694
  action: next
9687
9695
  }) : /*#__PURE__*/React__default["default"].createElement(Button, {
9688
9696
  label: "Finalizar",
9697
+ disabled: stepRef.current.isValid(),
9689
9698
  action: finish,
9690
9699
  raised: true
9691
9700
  })));