@lemon-fe/components 0.1.0 → 0.1.1

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.
@@ -69,17 +69,27 @@ export default function Actions(props) {
69
69
  return null;
70
70
  }
71
71
 
72
+ var key = item.text;
72
73
  var dropDown = item.dropDown ? item.dropDown.filter(function (item) {
73
74
  return item !== null;
74
75
  }) : [];
75
- return /*#__PURE__*/React.createElement("button", {
76
- className: "".concat(prefixCls, "-item"),
76
+ return /*#__PURE__*/React.createElement("div", {
77
+ className: classNames("".concat(prefixCls, "-item"), _defineProperty({}, "".concat(prefixCls, "-item-disabled"), item.disabled)),
77
78
  key: item.text,
78
- disabled: item.disabled,
79
+ onMouseEnter: function onMouseEnter() {
80
+ if (pop !== null && pop.key !== key) {
81
+ closePop();
82
+ }
83
+ },
79
84
  onClick: function onClick(e) {
85
+ if (item.disabled) {
86
+ return;
87
+ }
88
+
80
89
  if (dropDown.length > 0) {
81
90
  var rect = e.target.getBoundingClientRect();
82
91
  openPop({
92
+ key: key,
83
93
  top: rect.top + rect.height,
84
94
  right: document.body.clientWidth - rect.right,
85
95
  items: dropDown
@@ -94,15 +94,6 @@
94
94
  transition: background-color 0.2s;
95
95
  user-select: none;
96
96
 
97
- &:disabled {
98
- color: rgba(51, 51, 51, 0.5);
99
- cursor: not-allowed;
100
-
101
- &:hover {
102
- background-color: rgba(51, 51, 51, 0.06);
103
- }
104
- }
105
-
106
97
  &:hover {
107
98
  background-color: .primary(0.12) [];
108
99
  }
@@ -110,6 +101,15 @@
110
101
  &:active {
111
102
  color: .primary(0.8) [];
112
103
  }
104
+
105
+ &-disabled {
106
+ color: rgba(51, 51, 51, 0.5) !important;
107
+ cursor: not-allowed;
108
+
109
+ &:hover {
110
+ background-color: rgba(51, 51, 51, 0.06);
111
+ }
112
+ }
113
113
  }
114
114
 
115
115
  &-popover {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemon-fe/components",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "> TODO: description",
5
5
  "author": "鲁盛杰 <lusj@cnlemon.net>",
6
6
  "homepage": "",
@@ -39,5 +39,5 @@
39
39
  "@types/lodash": "^4.14.179",
40
40
  "@types/react-resizable": "^1.7.4"
41
41
  },
42
- "gitHead": "194106879a74eb16c75e56c3832a2f555627a8ee"
42
+ "gitHead": "b86fa2f3e6d5d47d43d7dcc3d662d3c941832c4d"
43
43
  }