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.cjs +77 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +30 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +77 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +77 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/button.js +2 -2
- package/src/incubator/index.js +1 -0
- package/src/incubator/wizard.css +30 -0
- package/src/incubator/wizard.js +57 -0
- package/src/incubator/wizard.test.js +16 -0
- package/src/index.js +3 -0
package/dist/index.cjs
CHANGED
@@ -368,7 +368,8 @@ var Button = function Button(_ref) {
|
|
368
368
|
_ref$disabled = _ref.disabled,
|
369
369
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
370
370
|
outlined = _ref.outlined,
|
371
|
-
raised = _ref.raised
|
371
|
+
raised = _ref.raised,
|
372
|
+
className = _ref.className;
|
372
373
|
|
373
374
|
function click(event) {
|
374
375
|
if (!disabled) {
|
@@ -381,7 +382,7 @@ var Button = function Button(_ref) {
|
|
381
382
|
var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
|
382
383
|
if (disabled) style = style + " disabled";
|
383
384
|
return /*#__PURE__*/React__default["default"].createElement("button", {
|
384
|
-
className: "btn " + style,
|
385
|
+
className: "btn " + style + " " + className,
|
385
386
|
onClick: click
|
386
387
|
}, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
387
388
|
icon: icon,
|
@@ -9623,6 +9624,79 @@ var TableAPI = function TableAPI(url, host) {
|
|
9623
9624
|
};
|
9624
9625
|
};
|
9625
9626
|
|
9627
|
+
var Wizard = function Wizard(props) {
|
9628
|
+
var _props$steps = props.steps,
|
9629
|
+
steps = _props$steps === void 0 ? [] : _props$steps,
|
9630
|
+
_props$init = props.init,
|
9631
|
+
init = _props$init === void 0 ? 0 : _props$init,
|
9632
|
+
onClose = props.onClose;
|
9633
|
+
|
9634
|
+
var _useState = React.useState(init),
|
9635
|
+
_useState$ = _useState[0],
|
9636
|
+
current = _useState$ === void 0 ? 0 : _useState$,
|
9637
|
+
setCurrent = _useState[1];
|
9638
|
+
|
9639
|
+
function prev() {
|
9640
|
+
if (current > 0) setCurrent(current - 1);
|
9641
|
+
}
|
9642
|
+
|
9643
|
+
function next() {
|
9644
|
+
var step = steps[current];
|
9645
|
+
|
9646
|
+
if (step.onComplete) {
|
9647
|
+
step.onComplete(function () {
|
9648
|
+
setCurrent(current + 1);
|
9649
|
+
});
|
9650
|
+
} else {
|
9651
|
+
setCurrent(current + 1);
|
9652
|
+
}
|
9653
|
+
}
|
9654
|
+
|
9655
|
+
function finish() {
|
9656
|
+
var step = steps[current];
|
9657
|
+
if (step.onComplete) step.onComplete(function () {
|
9658
|
+
if (onClose) onClose();
|
9659
|
+
});
|
9660
|
+
}
|
9661
|
+
|
9662
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
9663
|
+
className: "wizard"
|
9664
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
9665
|
+
className: "wizard-steps"
|
9666
|
+
}, steps.map(function (step, index) {
|
9667
|
+
var active = index === current;
|
9668
|
+
var done = index < current;
|
9669
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
9670
|
+
key: index,
|
9671
|
+
className: "wizard-step"
|
9672
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
9673
|
+
className: "wizard-step-icon"
|
9674
|
+
}, done && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
9675
|
+
icon: "check"
|
9676
|
+
}), active && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
9677
|
+
icon: "play_arrow"
|
9678
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
9679
|
+
className: "wizard-step-label"
|
9680
|
+
}, step.label));
|
9681
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
9682
|
+
className: "wizard-content"
|
9683
|
+
}, steps[current].content), /*#__PURE__*/React__default["default"].createElement("div", {
|
9684
|
+
className: "wizard-actions"
|
9685
|
+
}, /*#__PURE__*/React__default["default"].createElement(Button, {
|
9686
|
+
label: "Anterior",
|
9687
|
+
disabled: current === 0,
|
9688
|
+
action: prev
|
9689
|
+
}), current < steps.length - 1 ? /*#__PURE__*/React__default["default"].createElement(Button, {
|
9690
|
+
label: "Siguiente",
|
9691
|
+
disabled: current === steps.length - 1,
|
9692
|
+
action: next
|
9693
|
+
}) : /*#__PURE__*/React__default["default"].createElement(Button, {
|
9694
|
+
label: "Finalizar",
|
9695
|
+
action: finish,
|
9696
|
+
raised: true
|
9697
|
+
})));
|
9698
|
+
};
|
9699
|
+
|
9626
9700
|
var isFunction = function isFunction(value) {
|
9627
9701
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
9628
9702
|
};
|
@@ -9712,5 +9786,6 @@ exports.Uploader = Uploader;
|
|
9712
9786
|
exports.View = View;
|
9713
9787
|
exports.Viewer = Viewer;
|
9714
9788
|
exports.WaitScreen = WaitScreen;
|
9789
|
+
exports.Wizard = Wizard;
|
9715
9790
|
exports.isFunction = isFunction;
|
9716
9791
|
//# sourceMappingURL=index.cjs.map
|