@lemon-fe/components 0.0.3 → 0.0.5
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/es/MainFramework/components/Menu/index.js +21 -14
- package/es/MainFramework/components/Menu/index.less +1 -1
- package/es/MainFramework/components/TabBar/index.js +15 -21
- package/es/MainFramework/components/TabBar/index.less +5 -3
- package/es/MainFramework/index.less +1 -1
- package/package.json +6 -3
|
@@ -128,17 +128,7 @@ export default function Menu(props) {
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
|
|
131
|
-
var handleMouseEnter = useDebounce(openMenu, 200);
|
|
132
|
-
|
|
133
|
-
var toggleMenu = function toggleMenu() {
|
|
134
|
-
setCollapsed(function (prev) {
|
|
135
|
-
return !prev;
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
|
|
139
131
|
var closeMenu = function closeMenu() {
|
|
140
|
-
handleMouseEnter.cancel();
|
|
141
|
-
|
|
142
132
|
if (popup.current) {
|
|
143
133
|
popup.current.classList.remove('animated');
|
|
144
134
|
|
|
@@ -153,6 +143,18 @@ export default function Menu(props) {
|
|
|
153
143
|
}
|
|
154
144
|
};
|
|
155
145
|
|
|
146
|
+
var toggle = useDebounce(function (handler) {
|
|
147
|
+
if (handler) {
|
|
148
|
+
handler();
|
|
149
|
+
}
|
|
150
|
+
}, 200);
|
|
151
|
+
|
|
152
|
+
var toggleCollapse = function toggleCollapse() {
|
|
153
|
+
setCollapsed(function (prev) {
|
|
154
|
+
return !prev;
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
156
158
|
useEffect(function () {
|
|
157
159
|
if (!visible) {
|
|
158
160
|
return;
|
|
@@ -282,7 +284,9 @@ export default function Menu(props) {
|
|
|
282
284
|
className: classNames("".concat(prefixCls, "-menu"), _defineProperty({}, "".concat(prefixCls, "-menu-collapsed"), collapsed))
|
|
283
285
|
}, /*#__PURE__*/React.createElement("div", {
|
|
284
286
|
className: "".concat(prefixCls, "-menu-bar"),
|
|
285
|
-
onMouseLeave:
|
|
287
|
+
onMouseLeave: function onMouseLeave() {
|
|
288
|
+
return toggle(closeMenu);
|
|
289
|
+
}
|
|
286
290
|
}, popover !== null && popover.children !== undefined && /*#__PURE__*/React.createElement("div", {
|
|
287
291
|
className: "".concat(prefixCls, "-menu-popup"),
|
|
288
292
|
style: {
|
|
@@ -290,7 +294,7 @@ export default function Menu(props) {
|
|
|
290
294
|
},
|
|
291
295
|
ref: popup,
|
|
292
296
|
onMouseEnter: function onMouseEnter() {
|
|
293
|
-
return
|
|
297
|
+
return toggle.cancel();
|
|
294
298
|
}
|
|
295
299
|
}, /*#__PURE__*/React.createElement("div", {
|
|
296
300
|
className: "".concat(prefixCls, "-menu-popup-body")
|
|
@@ -303,7 +307,7 @@ export default function Menu(props) {
|
|
|
303
307
|
}, item.name), item.children !== undefined && item.children.map(renderItem));
|
|
304
308
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
305
309
|
className: "".concat(prefixCls, "-menu-collapse"),
|
|
306
|
-
onClick:
|
|
310
|
+
onClick: toggleCollapse
|
|
307
311
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
308
312
|
width: "20",
|
|
309
313
|
height: "20",
|
|
@@ -339,7 +343,10 @@ export default function Menu(props) {
|
|
|
339
343
|
return handleClick(item);
|
|
340
344
|
},
|
|
341
345
|
onMouseEnter: function onMouseEnter(e) {
|
|
342
|
-
|
|
346
|
+
var target = e.currentTarget;
|
|
347
|
+
toggle(function () {
|
|
348
|
+
return openMenu(item, target);
|
|
349
|
+
});
|
|
343
350
|
}
|
|
344
351
|
}, /*#__PURE__*/React.createElement("img", {
|
|
345
352
|
className: "".concat(prefixCls, "-menu-icon"),
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
height: 100vh;
|
|
256
256
|
background-color: #fff;
|
|
257
257
|
box-shadow: 0 12px 48px 16px rgba(0, 0, 0, 0.03), 0 9px 28px 0 rgba(0, 0, 0, 0.05),
|
|
258
|
-
|
|
258
|
+
0 6px 16px -8px rgba(0, 0, 0, 0.08);
|
|
259
259
|
transform: translate3d(60px, 0, 0);
|
|
260
260
|
opacity: 0;
|
|
261
261
|
transition: all 0.2s;
|
|
@@ -34,28 +34,22 @@ export default function TabBar(props) {
|
|
|
34
34
|
return handleClose(e, index);
|
|
35
35
|
}
|
|
36
36
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
37
|
-
width: "
|
|
38
|
-
height: "
|
|
39
|
-
viewBox: "0 0 9 9",
|
|
37
|
+
width: "14",
|
|
38
|
+
height: "14",
|
|
40
39
|
xmlns: "http://www.w3.org/2000/svg"
|
|
41
40
|
}, /*#__PURE__*/React.createElement("g", {
|
|
42
|
-
fill: "
|
|
43
|
-
fillRule: "evenodd"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
transform: "rotate(-45
|
|
54
|
-
|
|
55
|
-
y: "-.059",
|
|
56
|
-
width: "1",
|
|
57
|
-
height: "9",
|
|
58
|
-
rx: ".5"
|
|
59
|
-
}))))));
|
|
41
|
+
fill: "none",
|
|
42
|
+
fillRule: "evenodd"
|
|
43
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
44
|
+
fill: "currentColor"
|
|
45
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
46
|
+
fillRule: "nonzero"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
d: "M7.74992318,2.75006802 L7.74992318,11.250068 C7.74992318,11.6642816 7.41413675,12.000068 6.99992318,12.000068 C6.58570962,12.000068 6.24992318,11.6642816 6.24992318,11.250068 L6.24992318,2.75006802 C6.24992318,2.33585446 6.58570962,2.00006802 6.99992318,2.00006802 C7.41413675,2.00006802 7.74992318,2.33585446 7.74992318,2.75006802 Z",
|
|
49
|
+
transform: "translate(-367.000000, -21.000000) translate(367.000000, 21.000000) translate(6.999923, 7.000068) rotate(45.000000) translate(-6.999923, -7.000068)"
|
|
50
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
51
|
+
d: "M7.74994595,2.75007682 L7.74994595,11.2500768 C7.74994595,11.6642904 7.41415952,12.0000768 6.99994595,12.0000768 C6.58573239,12.0000768 6.24994595,11.6642904 6.24994595,11.2500768 L6.24994595,2.75007682 C6.24994595,2.33586325 6.58573239,2.00007682 6.99994595,2.00007682 C7.41415952,2.00007682 7.74994595,2.33586325 7.74994595,2.75007682 Z",
|
|
52
|
+
transform: "translate(-367.000000, -21.000000) translate(367.000000, 21.000000) translate(6.999946, 7.000077) rotate(-45.000000) translate(-6.999946, -7.000077)"
|
|
53
|
+
}))))))));
|
|
60
54
|
}));
|
|
61
55
|
}
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
box-sizing: content-box;
|
|
39
39
|
min-width: 14px;
|
|
40
40
|
max-width: 120px;
|
|
41
|
-
height:
|
|
41
|
+
height: 43px;
|
|
42
42
|
cursor: pointer;
|
|
43
43
|
|
|
44
44
|
&::before {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
z-index: 4;
|
|
73
73
|
display: flex;
|
|
74
74
|
align-items: center;
|
|
75
|
-
padding:
|
|
75
|
+
padding: 7px 12px 14px;
|
|
76
76
|
background-color: #fff;
|
|
77
77
|
border-radius: 10px;
|
|
78
78
|
transition: background-color 0.2s;
|
|
@@ -128,12 +128,14 @@
|
|
|
128
128
|
&-close {
|
|
129
129
|
width: 14px;
|
|
130
130
|
height: 14px;
|
|
131
|
+
color: #c4c4c4;
|
|
131
132
|
line-height: 14px;
|
|
132
133
|
text-align: center;
|
|
133
134
|
border-radius: 50%;
|
|
134
135
|
|
|
135
136
|
&:hover {
|
|
136
|
-
|
|
137
|
+
color: #f2f2f2;
|
|
138
|
+
background-color: #c1c1c1;
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemon-fe/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "鲁盛杰 <lusj@cnlemon.net>",
|
|
6
6
|
"homepage": "",
|
|
@@ -12,8 +12,11 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
14
14
|
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"registry": "https://registry.npmjs.org"
|
|
17
|
+
},
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@lemon-fe/hooks": "^0.0.
|
|
19
|
+
"@lemon-fe/hooks": "^0.0.5",
|
|
17
20
|
"antd": "^4.17.0",
|
|
18
21
|
"classnames": "^2.2.6",
|
|
19
22
|
"lodash": "^4.17.21",
|
|
@@ -36,5 +39,5 @@
|
|
|
36
39
|
"@types/lodash": "^4.14.179",
|
|
37
40
|
"@types/react-resizable": "^1.7.4"
|
|
38
41
|
},
|
|
39
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "477ae82a91341a6f769cfd87ff7c8d961c0ec4be"
|
|
40
43
|
}
|