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.cjs
CHANGED
@@ -442,6 +442,43 @@ var Button = function Button(_ref) {
|
|
442
442
|
action: click
|
443
443
|
}) : null, /*#__PURE__*/React__default["default"].createElement(Text, null, label));
|
444
444
|
};
|
445
|
+
var ActionButton = function ActionButton(props) {
|
446
|
+
var icon = props.icon,
|
447
|
+
_props$state = props.state,
|
448
|
+
state = _props$state === void 0 ? "normal" : _props$state,
|
449
|
+
action = props.action,
|
450
|
+
className = props.className;
|
451
|
+
var _useState = React.useState("normal"),
|
452
|
+
_state = _useState[0],
|
453
|
+
setState = _useState[1];
|
454
|
+
React.useEffect(function () {
|
455
|
+
setState(state);
|
456
|
+
}, [state]);
|
457
|
+
function activate() {
|
458
|
+
setState("running");
|
459
|
+
if (action) action();
|
460
|
+
}
|
461
|
+
var actionIcon = icon;
|
462
|
+
switch (_state) {
|
463
|
+
case "normal":
|
464
|
+
actionIcon = icon;
|
465
|
+
break;
|
466
|
+
case "running":
|
467
|
+
actionIcon = "rotate_right";
|
468
|
+
break;
|
469
|
+
case "success":
|
470
|
+
actionIcon = "task_alt";
|
471
|
+
break;
|
472
|
+
case "error":
|
473
|
+
actionIcon = "error";
|
474
|
+
break;
|
475
|
+
}
|
476
|
+
return /*#__PURE__*/React__default["default"].createElement(Button, _extends({}, props, {
|
477
|
+
icon: actionIcon,
|
478
|
+
action: activate,
|
479
|
+
className: className + " action-btn " + _state
|
480
|
+
}));
|
481
|
+
};
|
445
482
|
|
446
483
|
/**
|
447
484
|
* CheckBox
|
@@ -839,6 +876,8 @@ var MenuItem = function MenuItem(props) {
|
|
839
876
|
meta = props.meta,
|
840
877
|
_props$disabled = props.disabled,
|
841
878
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
879
|
+
_props$size2 = props.size,
|
880
|
+
size = _props$size2 === void 0 ? "normal" : _props$size2,
|
842
881
|
onSelect = props.onSelect;
|
843
882
|
var _useContext = React.useContext(MenuContext),
|
844
883
|
setOpen = _useContext[1];
|
@@ -856,7 +895,8 @@ var MenuItem = function MenuItem(props) {
|
|
856
895
|
className: "menu-item " + style,
|
857
896
|
onClick: select
|
858
897
|
}, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
|
859
|
-
icon: icon
|
898
|
+
icon: icon,
|
899
|
+
size: size
|
860
900
|
}) : null, /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt), meta ? /*#__PURE__*/React__default["default"].createElement("div", {
|
861
901
|
className: "meta"
|
862
902
|
}, meta) : null);
|
@@ -11145,6 +11185,7 @@ var isFunction = function isFunction(value) {
|
|
11145
11185
|
};
|
11146
11186
|
|
11147
11187
|
exports.Accordion = Accordion;
|
11188
|
+
exports.ActionButton = ActionButton;
|
11148
11189
|
exports.Avatar = Avatar;
|
11149
11190
|
exports.Button = Button;
|
11150
11191
|
exports.Calendar = Calendar;
|