ywana-core8 0.0.652 → 0.0.654

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
@@ -362,7 +362,8 @@
362
362
  _ref$disabled = _ref.disabled,
363
363
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
364
364
  outlined = _ref.outlined,
365
- raised = _ref.raised;
365
+ raised = _ref.raised,
366
+ className = _ref.className;
366
367
 
367
368
  function click(event) {
368
369
  if (!disabled) {
@@ -375,7 +376,7 @@
375
376
  var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
376
377
  if (disabled) style = style + " disabled";
377
378
  return /*#__PURE__*/React__default["default"].createElement("button", {
378
- className: "btn " + style,
379
+ className: "btn " + style + " " + className,
379
380
  onClick: click
380
381
  }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
381
382
  icon: icon,
@@ -9617,6 +9618,79 @@
9617
9618
  };
9618
9619
  };
9619
9620
 
9621
+ var Wizard = function Wizard(props) {
9622
+ var _props$steps = props.steps,
9623
+ steps = _props$steps === void 0 ? [] : _props$steps,
9624
+ _props$init = props.init,
9625
+ init = _props$init === void 0 ? 0 : _props$init,
9626
+ onClose = props.onClose;
9627
+
9628
+ var _useState = React.useState(init),
9629
+ _useState$ = _useState[0],
9630
+ current = _useState$ === void 0 ? 0 : _useState$,
9631
+ setCurrent = _useState[1];
9632
+
9633
+ function prev() {
9634
+ if (current > 0) setCurrent(current - 1);
9635
+ }
9636
+
9637
+ function next() {
9638
+ var step = steps[current];
9639
+
9640
+ if (step.onComplete) {
9641
+ step.onComplete(function () {
9642
+ setCurrent(current + 1);
9643
+ });
9644
+ } else {
9645
+ setCurrent(current + 1);
9646
+ }
9647
+ }
9648
+
9649
+ function finish() {
9650
+ var step = steps[current];
9651
+ if (step.onComplete) step.onComplete(function () {
9652
+ if (onClose) onClose();
9653
+ });
9654
+ }
9655
+
9656
+ return /*#__PURE__*/React__default["default"].createElement("div", {
9657
+ className: "wizard"
9658
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
9659
+ className: "wizard-steps"
9660
+ }, steps.map(function (step, index) {
9661
+ var active = index === current;
9662
+ var done = index < current;
9663
+ return /*#__PURE__*/React__default["default"].createElement("div", {
9664
+ key: index,
9665
+ className: "wizard-step"
9666
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
9667
+ className: "wizard-step-icon"
9668
+ }, done && /*#__PURE__*/React__default["default"].createElement(Icon, {
9669
+ icon: "check"
9670
+ }), active && /*#__PURE__*/React__default["default"].createElement(Icon, {
9671
+ icon: "play_arrow"
9672
+ })), /*#__PURE__*/React__default["default"].createElement("div", {
9673
+ className: "wizard-step-label"
9674
+ }, step.label));
9675
+ })), /*#__PURE__*/React__default["default"].createElement("div", {
9676
+ className: "wizard-content"
9677
+ }, steps[current].content), /*#__PURE__*/React__default["default"].createElement("div", {
9678
+ className: "wizard-actions"
9679
+ }, /*#__PURE__*/React__default["default"].createElement(Button, {
9680
+ label: "Anterior",
9681
+ disabled: current === 0,
9682
+ action: prev
9683
+ }), current < steps.length - 1 ? /*#__PURE__*/React__default["default"].createElement(Button, {
9684
+ label: "Siguiente",
9685
+ disabled: current === steps.length - 1,
9686
+ action: next
9687
+ }) : /*#__PURE__*/React__default["default"].createElement(Button, {
9688
+ label: "Finalizar",
9689
+ action: finish,
9690
+ raised: true
9691
+ })));
9692
+ };
9693
+
9620
9694
  var isFunction = function isFunction(value) {
9621
9695
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
9622
9696
  };
@@ -9706,6 +9780,7 @@
9706
9780
  exports.View = View;
9707
9781
  exports.Viewer = Viewer;
9708
9782
  exports.WaitScreen = WaitScreen;
9783
+ exports.Wizard = Wizard;
9709
9784
  exports.isFunction = isFunction;
9710
9785
 
9711
9786
  }));