ywana-core8 0.0.899 → 0.0.901
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 +42 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +94 -67
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +42 -2
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +42 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/css/theme_light.css +1 -0
- package/src/html/button.css +98 -71
- package/src/html/button.js +48 -4
- package/src/html/index.js +1 -1
- package/src/html/menu.js +2 -2
package/dist/index.umd.js
CHANGED
@@ -435,6 +435,43 @@
|
|
435
435
|
action: click
|
436
436
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Text, null, label));
|
437
437
|
};
|
438
|
+
var ActionButton = function ActionButton(props) {
|
439
|
+
var icon = props.icon,
|
440
|
+
_props$state = props.state,
|
441
|
+
state = _props$state === void 0 ? "normal" : _props$state,
|
442
|
+
action = props.action,
|
443
|
+
className = props.className;
|
444
|
+
var _useState = React.useState("normal"),
|
445
|
+
_state = _useState[0],
|
446
|
+
setState = _useState[1];
|
447
|
+
React.useEffect(function () {
|
448
|
+
setState(state);
|
449
|
+
}, [state]);
|
450
|
+
function activate() {
|
451
|
+
setState("running");
|
452
|
+
if (action) action();
|
453
|
+
}
|
454
|
+
var actionIcon = icon;
|
455
|
+
switch (_state) {
|
456
|
+
case "normal":
|
457
|
+
actionIcon = icon;
|
458
|
+
break;
|
459
|
+
case "running":
|
460
|
+
actionIcon = "rotate_right";
|
461
|
+
break;
|
462
|
+
case "success":
|
463
|
+
actionIcon = "task_alt";
|
464
|
+
break;
|
465
|
+
case "error":
|
466
|
+
actionIcon = "error";
|
467
|
+
break;
|
468
|
+
}
|
469
|
+
return /*#__PURE__*/React__default["default"].createElement(Button, _extends({}, props, {
|
470
|
+
icon: actionIcon,
|
471
|
+
action: activate,
|
472
|
+
className: className + " action-btn " + _state
|
473
|
+
}));
|
474
|
+
};
|
438
475
|
|
439
476
|
/**
|
440
477
|
* CheckBox
|
@@ -832,6 +869,8 @@
|
|
832
869
|
meta = props.meta,
|
833
870
|
_props$disabled = props.disabled,
|
834
871
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
872
|
+
_props$size2 = props.size,
|
873
|
+
size = _props$size2 === void 0 ? "normal" : _props$size2,
|
835
874
|
onSelect = props.onSelect;
|
836
875
|
var _useContext = React.useContext(MenuContext),
|
837
876
|
setOpen = _useContext[1];
|
@@ -849,7 +888,8 @@
|
|
849
888
|
className: "menu-item " + style,
|
850
889
|
onClick: select
|
851
890
|
}, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
852
|
-
icon: icon
|
891
|
+
icon: icon,
|
892
|
+
size: size
|
853
893
|
}) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
|
854
894
|
className: "meta"
|
855
895
|
}, meta) : null);
|
@@ -11138,6 +11178,7 @@
|
|
11138
11178
|
};
|
11139
11179
|
|
11140
11180
|
exports.Accordion = Accordion;
|
11181
|
+
exports.ActionButton = ActionButton;
|
11141
11182
|
exports.Avatar = Avatar;
|
11142
11183
|
exports.Button = Button;
|
11143
11184
|
exports.Calendar = Calendar;
|