@kdcloudjs/kdesign 1.3.8 → 1.4.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.
- package/CHANGELOG.md +19 -0
- package/dist/kdesign-complete.less +115 -122
- package/dist/kdesign.css +121 -110
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +165 -131
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/config-provider/compDefaultProps.d.ts +1 -0
- package/es/config-provider/compDefaultProps.js +2 -1
- package/es/menu/menu.js +13 -6
- package/es/menu/menuItem.js +13 -3
- package/es/menu/style/index.css +119 -107
- package/es/menu/style/index.less +54 -76
- package/es/menu/style/mixin.less +60 -43
- package/es/menu/subMenu.js +23 -16
- package/es/select/select.js +6 -4
- package/es/table/table.js +2 -0
- package/es/tree/style/index.css +1 -2
- package/es/tree/style/index.less +1 -2
- package/es/tree/style/token.less +0 -1
- package/es/tree/tree.js +1 -2
- package/es/tree/treeNode.js +1 -1
- package/lib/config-provider/compDefaultProps.d.ts +1 -0
- package/lib/config-provider/compDefaultProps.js +2 -1
- package/lib/menu/menu.js +13 -6
- package/lib/menu/menuItem.js +15 -3
- package/lib/menu/style/index.css +119 -107
- package/lib/menu/style/index.less +54 -76
- package/lib/menu/style/mixin.less +60 -43
- package/lib/menu/subMenu.js +25 -17
- package/lib/select/select.js +6 -4
- package/lib/table/table.js +2 -0
- package/lib/tree/style/index.css +1 -2
- package/lib/tree/style/index.less +1 -2
- package/lib/tree/style/token.less +0 -1
- package/lib/tree/tree.js +1 -2
- package/lib/tree/treeNode.js +1 -1
- package/package.json +1 -1
package/es/menu/style/index.less
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
@menuitem-prefix-cls: ~'@{menu-prefix-cls}-item';
|
|
7
7
|
@menu-dark-prefix-cls: ~'@{menu-prefix-cls}-dark';
|
|
8
8
|
@menu-light-prefix-cls: ~'@{menu-prefix-cls}-light';
|
|
9
|
+
@menu-vertical-prefix-cls: ~'@{menu-prefix-cls}-vertical';
|
|
10
|
+
@menu-inline-prefix-cls: ~'@{menu-prefix-cls}-inline';
|
|
9
11
|
@menu-popper-prefix-cls: ~'@{menu-prefix-cls}-popper';
|
|
10
12
|
@submenu-prefix-cls: ~'@{menu-prefix-cls}-submenu';
|
|
11
13
|
|
|
@@ -15,56 +17,17 @@
|
|
|
15
17
|
&-inline {
|
|
16
18
|
.@{menuitem-prefix-cls} {
|
|
17
19
|
.ellipsis();
|
|
18
|
-
|
|
19
|
-
&-active {
|
|
20
|
-
color: @menu-inline-color-active;
|
|
21
|
-
}
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
.@{submenu-prefix-cls} {
|
|
25
23
|
padding-right: 0;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
|
-
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
|
|
29
|
-
color: @menu-inline-color-active;
|
|
30
|
-
}
|
|
31
25
|
}
|
|
32
26
|
|
|
33
27
|
&-collapsed {
|
|
34
28
|
width: 50px;
|
|
35
29
|
min-width: auto;
|
|
36
30
|
}
|
|
37
|
-
|
|
38
|
-
&-vertical {
|
|
39
|
-
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover,
|
|
40
|
-
.@{submenu-prefix-cls}-hover {
|
|
41
|
-
.hover();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&-light {
|
|
46
|
-
.light()
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&-light&-vertical {
|
|
50
|
-
.@{submenu-prefix-cls}-sub {
|
|
51
|
-
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
52
|
-
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.@{menuitem-prefix-cls} {
|
|
56
|
-
&:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover {
|
|
57
|
-
.light-hover();
|
|
58
|
-
border: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
&-active {
|
|
62
|
-
color: @menu-light-color-active;
|
|
63
|
-
background-color: @menu-light-color-background-active;
|
|
64
|
-
border: none !important;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
31
|
}
|
|
69
32
|
|
|
70
33
|
.@{menuitem-prefix-cls} {
|
|
@@ -73,10 +36,6 @@
|
|
|
73
36
|
transition: color, background-color;
|
|
74
37
|
transition-duration: calc(@menu-motion-duration - 0.1s);
|
|
75
38
|
transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
|
|
76
|
-
|
|
77
|
-
&:not(&-disabled):hover {
|
|
78
|
-
.hover();
|
|
79
|
-
}
|
|
80
39
|
}
|
|
81
40
|
|
|
82
41
|
.@{submenu-prefix-cls} {
|
|
@@ -86,13 +45,8 @@
|
|
|
86
45
|
transition-duration: calc(@menu-motion-duration - 0.1s);
|
|
87
46
|
transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
|
|
88
47
|
|
|
89
|
-
&-hover {
|
|
90
|
-
.hover();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
48
|
&-sub {
|
|
94
49
|
line-height: @menu-item-height;
|
|
95
|
-
color: @menu-sub-color;
|
|
96
50
|
}
|
|
97
51
|
|
|
98
52
|
&-thrid {
|
|
@@ -168,26 +122,68 @@
|
|
|
168
122
|
}
|
|
169
123
|
}
|
|
170
124
|
|
|
125
|
+
// dark
|
|
171
126
|
.@{menu-dark-prefix-cls} {
|
|
127
|
+
|
|
172
128
|
.@{submenu-prefix-cls}-sub {
|
|
129
|
+
color: @menu-sub-color;
|
|
173
130
|
background: @menu-sub-inline-color-background;
|
|
174
131
|
}
|
|
175
132
|
|
|
176
133
|
.@{submenu-prefix-cls}-sub-second, .@{submenu-prefix-cls}-sub-third {
|
|
177
134
|
background: @menu-sub-color-background;
|
|
178
135
|
}
|
|
136
|
+
|
|
137
|
+
.@{menuitem-prefix-cls} {
|
|
138
|
+
&:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover {
|
|
139
|
+
.menu-dark-hover();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&-active {
|
|
143
|
+
.menu-dark-active()
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.@{menuitem-prefix-cls}-active, .@{submenu-prefix-cls}-active {
|
|
148
|
+
.menu-dark-active()
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.@{menuitem-prefix-cls}-hover, .@{submenu-prefix-cls}-hover {
|
|
152
|
+
.menu-dark-hover()
|
|
153
|
+
}
|
|
179
154
|
}
|
|
180
155
|
|
|
156
|
+
.@{menu-inline-prefix-cls}.@{menu-dark-prefix-cls} {
|
|
157
|
+
.@{menuitem-prefix-cls}-active, .@{submenu-prefix-cls}-active {
|
|
158
|
+
.@{submenu-prefix-cls}-title {
|
|
159
|
+
.menu-dark-active-inline-title()
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):not(.@{submenu-prefix-cls}-active) {
|
|
164
|
+
> .@{submenu-prefix-cls}-title:hover {
|
|
165
|
+
.menu-dark-active-inline-title()
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// light
|
|
181
171
|
.@{menu-light-prefix-cls} {
|
|
182
|
-
|
|
183
|
-
|
|
172
|
+
.menu-light-base();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.@{menu-inline-prefix-cls}.@{menu-light-prefix-cls} {
|
|
176
|
+
.@{menuitem-prefix-cls}-active, .@{submenu-prefix-cls}-active {
|
|
177
|
+
.@{submenu-prefix-cls}-title {
|
|
178
|
+
.menu-light-active-inline-title()
|
|
179
|
+
}
|
|
184
180
|
}
|
|
185
181
|
}
|
|
186
182
|
|
|
187
183
|
.@{menu-popper-prefix-cls} {
|
|
188
|
-
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover,
|
|
184
|
+
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):not(.@{submenu-prefix-cls}-active):hover,
|
|
189
185
|
.@{submenu-prefix-cls}-hover {
|
|
190
|
-
.hover();
|
|
186
|
+
.menu-dark-hover();
|
|
191
187
|
}
|
|
192
188
|
|
|
193
189
|
&.hidden {
|
|
@@ -204,12 +200,15 @@
|
|
|
204
200
|
padding-right: 0;
|
|
205
201
|
|
|
206
202
|
&-sub {
|
|
203
|
+
color: @menu-sub-color;
|
|
207
204
|
background: @menu-sub-inline-color-background;
|
|
205
|
+
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
206
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
208
207
|
|
|
209
208
|
.@{menuitem-prefix-cls} {
|
|
210
|
-
&:hover,
|
|
209
|
+
&:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover,
|
|
211
210
|
&-active {
|
|
212
|
-
|
|
211
|
+
.menu-dark-hover()
|
|
213
212
|
}
|
|
214
213
|
}
|
|
215
214
|
|
|
@@ -235,28 +234,7 @@
|
|
|
235
234
|
}
|
|
236
235
|
|
|
237
236
|
&.light {
|
|
238
|
-
.light();
|
|
239
|
-
|
|
240
|
-
.@{submenu-prefix-cls}-sub {
|
|
241
|
-
box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
|
242
|
-
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover,
|
|
246
|
-
.@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):hover {
|
|
247
|
-
.light-hover();
|
|
248
|
-
border: none;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.@{menuitem-prefix-cls}-hover,.@{submenu-prefix-cls}-hover {
|
|
252
|
-
.light-hover();
|
|
253
|
-
border: none;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.@{menuitem-prefix-cls}-active,.@{submenu-prefix-cls}-active {
|
|
257
|
-
.light-active();
|
|
258
|
-
border: none;
|
|
259
|
-
}
|
|
237
|
+
.menu-light-base();
|
|
260
238
|
}
|
|
261
239
|
}
|
|
262
240
|
|
package/es/menu/style/mixin.less
CHANGED
|
@@ -20,12 +20,16 @@
|
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
|
|
22
22
|
&-title {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
height: 50px;
|
|
26
|
+
.ellipsis();
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
& > span {
|
|
29
|
+
.ellipsis();
|
|
30
|
+
opacity: 1;
|
|
31
|
+
transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
&-collapsed {
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
|
|
43
47
|
& > span {
|
|
44
48
|
opacity: 0;
|
|
45
|
-
transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0
|
|
49
|
+
transition: opacity calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -55,75 +59,88 @@
|
|
|
55
59
|
&-disabled {
|
|
56
60
|
cursor: not-allowed;
|
|
57
61
|
color: @menu-color-disabled;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
&-active {
|
|
61
|
-
.hover();
|
|
62
|
+
background-color: @menu-color-background;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
&-arrow {
|
|
65
66
|
margin-left: auto;
|
|
66
67
|
font-size: 16px;
|
|
68
|
+
|
|
67
69
|
&-up {
|
|
68
70
|
transform: rotate(180deg);
|
|
69
|
-
transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0
|
|
71
|
+
transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1);
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
&-down {
|
|
73
75
|
transform: rotate(0deg);
|
|
74
|
-
transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
|
|
76
|
+
transition: transform calc(@menu-motion-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
|
|
82
|
+
.menu-dark-hover {
|
|
80
83
|
background-color: @menu-sub-color-background;
|
|
81
84
|
color: @menu-sub-color-hover;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
.
|
|
85
|
-
background-color: @menu-
|
|
86
|
-
color: @menu-
|
|
87
|
+
.menu-dark-active {
|
|
88
|
+
background-color: @menu-sub-color-background;
|
|
89
|
+
color: @menu-sub-color-hover;
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
.menu-dark-active-inline-title {
|
|
93
|
+
color: @menu-sub-color-hover;
|
|
94
|
+
background: @menu-color-background;
|
|
95
|
+
border: none;
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
.light-
|
|
95
|
-
|
|
96
|
-
background: #ffffff;
|
|
97
|
-
}
|
|
98
|
+
.menu-light-base {
|
|
99
|
+
.menu-light-default();
|
|
98
100
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
align-items: center;
|
|
102
|
-
height: 50px;
|
|
103
|
-
.ellipsis();
|
|
104
|
-
& > span {
|
|
105
|
-
.ellipsis();
|
|
101
|
+
.@{menuitem-prefix-cls}-disabled, .@{submenu-prefix-cls}-disabled {
|
|
102
|
+
background-color: #fff;
|
|
106
103
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
104
|
|
|
110
|
-
.light {
|
|
111
|
-
.light-default();
|
|
112
|
-
|
|
113
|
-
.@{submenu-prefix-cls}-hover,
|
|
114
105
|
.@{submenu-prefix-cls}-sub {
|
|
115
|
-
|
|
106
|
+
color: @menu-light-color;
|
|
107
|
+
background: #fafafa;
|
|
116
108
|
}
|
|
117
109
|
|
|
118
|
-
.@{
|
|
119
|
-
|
|
110
|
+
.@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover {
|
|
111
|
+
.menu-light-hover();
|
|
120
112
|
}
|
|
121
113
|
|
|
122
|
-
.@{
|
|
123
|
-
.light-hover();
|
|
114
|
+
.@{menuitem-prefix-cls}-hover, .@{submenu-prefix-cls}-hover {
|
|
115
|
+
.menu-light-hover();
|
|
124
116
|
}
|
|
125
117
|
|
|
126
|
-
.@{menuitem-prefix-cls}
|
|
127
|
-
.light-
|
|
118
|
+
.@{menuitem-prefix-cls}-active, .@{submenu-prefix-cls}-active {
|
|
119
|
+
.menu-light-active();
|
|
128
120
|
}
|
|
129
121
|
}
|
|
122
|
+
|
|
123
|
+
.menu-light-default {
|
|
124
|
+
color: @menu-light-color;
|
|
125
|
+
background: #ffffff;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.menu-light-hover {
|
|
129
|
+
background-color: @menu-light-color-background-hover;
|
|
130
|
+
color: @menu-light-color-hover;
|
|
131
|
+
border: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.menu-light-active {
|
|
135
|
+
background-color: @menu-light-color-background-active;
|
|
136
|
+
color: @menu-light-color-active;
|
|
137
|
+
border: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.menu-light-active-inline-title {
|
|
141
|
+
color: @menu-light-color-active;
|
|
142
|
+
background: #ffffff;
|
|
143
|
+
border: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
package/es/menu/subMenu.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
3
4
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
4
|
-
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
5
5
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
6
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
6
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
8
|
|
|
8
9
|
var __rest = this && this.__rest || function (s, e) {
|
|
@@ -50,6 +51,8 @@ var SubMenu = function SubMenu(props) {
|
|
|
50
51
|
collapsed = _a.collapsed,
|
|
51
52
|
keyValue = _a.keyValue,
|
|
52
53
|
selectedKey = _a.selectedKey,
|
|
54
|
+
selectedKeyPath = _a.selectedKeyPath,
|
|
55
|
+
setSelectedKeyPath = _a.setSelectedKeyPath,
|
|
53
56
|
openKeys = _a.openKeys,
|
|
54
57
|
triggerSubMenuAction = _a.triggerSubMenuAction,
|
|
55
58
|
forceSubMenuRender = _a.forceSubMenuRender,
|
|
@@ -59,7 +62,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
59
62
|
handleOnOpenChange = _a.handleOnOpenChange,
|
|
60
63
|
_a$paddingLeft = _a.paddingLeft,
|
|
61
64
|
paddingLeft = _a$paddingLeft === void 0 ? 0 : _a$paddingLeft,
|
|
62
|
-
restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
|
|
65
|
+
restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "selectedKeyPath", "setSelectedKeyPath", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
|
|
63
66
|
|
|
64
67
|
var isVertical = mode === 'vertical'; // 初始化level
|
|
65
68
|
|
|
@@ -67,6 +70,14 @@ var SubMenu = function SubMenu(props) {
|
|
|
67
70
|
restProps.level = 1;
|
|
68
71
|
}
|
|
69
72
|
|
|
73
|
+
if (Array.isArray(restProps.parentPath)) {
|
|
74
|
+
var _context;
|
|
75
|
+
|
|
76
|
+
restProps.parentPath = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(restProps.parentPath), [keyValue]);
|
|
77
|
+
} else {
|
|
78
|
+
restProps.parentPath = [keyValue];
|
|
79
|
+
}
|
|
80
|
+
|
|
70
81
|
if (mode === 'inline') {
|
|
71
82
|
restProps.subMenuMode = 'vertical';
|
|
72
83
|
restProps.popupOffset = [];
|
|
@@ -188,10 +199,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
188
199
|
if (!_includesInstanceProperty(className).call(className, MENU_ITEM_CONTAINER_NAME)) {
|
|
189
200
|
closeSubMenu();
|
|
190
201
|
}
|
|
191
|
-
});
|
|
192
|
-
// if (triggerSubMenuAction === 'click' && mode === 'vertical' && collapsed) {
|
|
193
|
-
// closeSubMenu()
|
|
194
|
-
// }
|
|
202
|
+
});
|
|
195
203
|
|
|
196
204
|
var handleMouseEvent = function handleMouseEvent(status) {
|
|
197
205
|
if (disabled || triggerSubMenuAction === 'click') return;
|
|
@@ -207,11 +215,6 @@ var SubMenu = function SubMenu(props) {
|
|
|
207
215
|
};
|
|
208
216
|
|
|
209
217
|
var handleOnClick = function handleOnClick(info) {
|
|
210
|
-
var _context;
|
|
211
|
-
|
|
212
|
-
// 保存路径
|
|
213
|
-
info.keyPath = _concatInstanceProperty(_context = info.keyPath).call(_context, [keyValue]);
|
|
214
|
-
|
|
215
218
|
if (triggerSubMenuAction === 'click' && isVertical) {
|
|
216
219
|
closeSubMenu();
|
|
217
220
|
}
|
|
@@ -288,7 +291,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
288
291
|
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
289
292
|
|
|
290
293
|
var verticalView = usePopper( /*#__PURE__*/React.createElement("li", _extends({
|
|
291
|
-
className: classNames(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, "light", theme === 'light'), _defineProperty(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames2, "".concat(prefixCls, "-hover"), !disabled &&
|
|
294
|
+
className: classNames(prefixCls, className, (_classNames2 = {}, _defineProperty(_classNames2, "light", theme === 'light'), _defineProperty(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames2, "".concat(prefixCls, "-hover"), !disabled && Array.isArray(openKeys) && _includesInstanceProperty(openKeys).call(openKeys, keyValue)), _defineProperty(_classNames2, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && _includesInstanceProperty(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames2)),
|
|
292
295
|
ref: subMenuVerticalRef,
|
|
293
296
|
key: keyValue
|
|
294
297
|
}, {
|
|
@@ -320,19 +323,21 @@ var SubMenu = function SubMenu(props) {
|
|
|
320
323
|
mode: mode,
|
|
321
324
|
theme: theme,
|
|
322
325
|
selectedKey: selectedKey,
|
|
326
|
+
setSelectedKeyPath: setSelectedKeyPath,
|
|
323
327
|
openKeys: openKeys,
|
|
324
328
|
forceSubMenuRender: forceSubMenuRender,
|
|
325
329
|
triggerSubMenuAction: triggerSubMenuAction,
|
|
326
330
|
handleOnOpenChange: handleOnOpenChange,
|
|
327
331
|
handleOnClick: handleOnClick,
|
|
328
332
|
inlineIndent: inlineIndent,
|
|
329
|
-
paddingLeft: curPaddingLeft
|
|
333
|
+
paddingLeft: curPaddingLeft,
|
|
334
|
+
parentPath: restProps.parentPath
|
|
330
335
|
});
|
|
331
336
|
}))), {
|
|
332
337
|
arrow: false,
|
|
333
338
|
placement: 'rightTop',
|
|
334
339
|
gap: 0,
|
|
335
|
-
visible: isVertical ? visible : false,
|
|
340
|
+
visible: isVertical && !disabled ? visible : false,
|
|
336
341
|
disabled: isVertical ? undefined : true,
|
|
337
342
|
prefixCls: 'kd-menu-popper',
|
|
338
343
|
popperClassName: theme === 'light' ? 'light' : ''
|
|
@@ -345,7 +350,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
345
350
|
|
|
346
351
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
347
352
|
ref: subMenuRef,
|
|
348
|
-
className: classNames(prefixCls, className, (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames4, "".concat(prefixCls, "-disabled"), disabled), _classNames4)),
|
|
353
|
+
className: classNames(prefixCls, className, (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), _defineProperty(_classNames4, "".concat(prefixCls, "-disabled"), disabled), _defineProperty(_classNames4, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && _includesInstanceProperty(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames4)),
|
|
349
354
|
key: keyValue
|
|
350
355
|
}, mouseEvent, {
|
|
351
356
|
style: style
|
|
@@ -368,13 +373,15 @@ var SubMenu = function SubMenu(props) {
|
|
|
368
373
|
collapsed: collapsed,
|
|
369
374
|
mode: mode,
|
|
370
375
|
selectedKey: selectedKey,
|
|
376
|
+
setSelectedKeyPath: setSelectedKeyPath,
|
|
371
377
|
openKeys: openKeys,
|
|
372
378
|
forceSubMenuRender: forceSubMenuRender,
|
|
373
379
|
triggerSubMenuAction: triggerSubMenuAction,
|
|
374
380
|
handleOnOpenChange: handleOnOpenChange,
|
|
375
381
|
handleOnClick: handleOnClick,
|
|
376
382
|
inlineIndent: inlineIndent,
|
|
377
|
-
paddingLeft: curPaddingLeft
|
|
383
|
+
paddingLeft: curPaddingLeft,
|
|
384
|
+
parentPath: restProps.parentPath
|
|
378
385
|
});
|
|
379
386
|
}))));
|
|
380
387
|
}
|
package/es/select/select.js
CHANGED
|
@@ -55,7 +55,9 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
55
55
|
placeholder = selectProps.placeholder,
|
|
56
56
|
dropdownStyle = selectProps.dropdownStyle,
|
|
57
57
|
style = selectProps.style,
|
|
58
|
-
clearIcon = selectProps.clearIcon
|
|
58
|
+
clearIcon = selectProps.clearIcon,
|
|
59
|
+
_selectProps$popperSt = selectProps.popperStyle,
|
|
60
|
+
popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt;
|
|
59
61
|
var isMultiple = mode === 'multiple'; // 是否多选
|
|
60
62
|
|
|
61
63
|
var _useMergedState = useMergedState(undefined, {
|
|
@@ -116,7 +118,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
116
118
|
|
|
117
119
|
var searchCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-dropdown-search"), true)); // 下拉子项列表样式
|
|
118
120
|
|
|
119
|
-
var dropContentCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-dropdown-scroll"), isMultiple ? (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 8 : (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 10)); // 多选底部样式
|
|
121
|
+
var dropContentCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-dropdown-scroll"), (isMultiple ? (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 8 : (realChildren === null || realChildren === void 0 ? void 0 : realChildren.length) > 10) || selectProps.dropdownRender)); // 多选底部样式
|
|
120
122
|
|
|
121
123
|
var multipleFooterCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-multiple-footer"), true)); // 多选,单选公共样式
|
|
122
124
|
|
|
@@ -668,10 +670,10 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
668
670
|
var _ref2 = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(),
|
|
669
671
|
width = _ref2.width;
|
|
670
672
|
|
|
671
|
-
return {
|
|
673
|
+
return _extends({
|
|
672
674
|
width: (dropdownStyle === null || dropdownStyle === void 0 ? void 0 : dropdownStyle.width) || (width > 75 ? width : 75),
|
|
673
675
|
zIndex: 1050
|
|
674
|
-
};
|
|
676
|
+
}, popperStyle);
|
|
675
677
|
}
|
|
676
678
|
};
|
|
677
679
|
|
package/es/table/table.js
CHANGED
|
@@ -67,6 +67,8 @@ function Table(props) {
|
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
if (footerDataSource) {
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
71
|
+
// @ts-ignore
|
|
70
72
|
pipeline.footerDataSource(footerDataSource);
|
|
71
73
|
}
|
|
72
74
|
/* -------------------------------------------------------------------------- */
|
package/es/tree/style/index.css
CHANGED
|
@@ -140,7 +140,6 @@
|
|
|
140
140
|
pointer-events: none;
|
|
141
141
|
}
|
|
142
142
|
.kd-tree-node-item {
|
|
143
|
-
height: var(--kd-c-tree-node-sizing-height, 32px);
|
|
144
143
|
display: -webkit-box;
|
|
145
144
|
display: -ms-flexbox;
|
|
146
145
|
display: flex;
|
|
@@ -167,7 +166,7 @@
|
|
|
167
166
|
border-right: 10px;
|
|
168
167
|
border-color: white;
|
|
169
168
|
border-style: solid;
|
|
170
|
-
height:
|
|
169
|
+
height: 100%;
|
|
171
170
|
cursor: default;
|
|
172
171
|
opacity: 0;
|
|
173
172
|
}
|
package/es/tree/style/index.less
CHANGED
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
pointer-events: none;
|
|
34
34
|
}
|
|
35
35
|
&-item {
|
|
36
|
-
height: @tree-node-height;
|
|
37
36
|
display: flex;
|
|
38
37
|
align-items: center;
|
|
39
38
|
}
|
|
@@ -54,7 +53,7 @@
|
|
|
54
53
|
border-right: 10px;
|
|
55
54
|
border-color: white;
|
|
56
55
|
border-style: solid;
|
|
57
|
-
height:
|
|
56
|
+
height: 100%;
|
|
58
57
|
cursor: default;
|
|
59
58
|
opacity: 0;
|
|
60
59
|
}
|
package/es/tree/style/token.less
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
@tree-node-icon-color-text: var(~'@{tree-prefix}-node-icon-color-text', #666666);
|
|
14
14
|
|
|
15
15
|
// sizing
|
|
16
|
-
@tree-node-height: var(~'@{tree-prefix}-node-sizing-height', 32px);
|
|
17
16
|
@tree-expand-icon-height: var(~'@{tree-prefix}-expand-icon-sizing-height', 22px);
|
|
18
17
|
@tree-expand-icon-width: var(~'@{tree-prefix}-expand-icon-sizing-width', 22px);
|
|
19
18
|
@tree-node-icon-height: var(~'@{tree-prefix}-node-icon-sizing-height', 20px);
|
package/es/tree/tree.js
CHANGED
|
@@ -57,8 +57,7 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
57
57
|
setTreeNodeClassName = _TreeProps$setTreeNod2 === void 0 ? function () {
|
|
58
58
|
return '';
|
|
59
59
|
} : _TreeProps$setTreeNod2,
|
|
60
|
-
|
|
61
|
-
innerEstimatedItemSize = _TreeProps$estimatedI === void 0 ? 28 : _TreeProps$estimatedI,
|
|
60
|
+
innerEstimatedItemSize = TreeProps.estimatedItemSize,
|
|
62
61
|
style = TreeProps.style;
|
|
63
62
|
var treePrefixCls = getPrefixCls(prefixCls, 'tree', customPrefixcls); // 树样式前缀
|
|
64
63
|
|
package/es/tree/treeNode.js
CHANGED
|
@@ -324,7 +324,7 @@ var TreeNode = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
324
324
|
return /*#__PURE__*/React.createElement("div", {
|
|
325
325
|
className: classNames("".concat(treeNodePrefixCls, "-item"), _defineProperty({}, "".concat(treeNodePrefixCls, "-item-hover"), !disabled && selectable), _defineProperty({}, "".concat(treeNodePrefixCls, "-selected"), selected && selectable && !disabled), _defineProperty({}, "".concat(treeNodePrefixCls, "-disabled"), disabled), _defineProperty({}, "".concat(treeNodePrefixCls, "-opened"), expandState), _concatInstanceProperty(_context = "".concat(treeNodePrefixCls, "-item-")).call(_context, nodeKey), className),
|
|
326
326
|
style: _extends({
|
|
327
|
-
height: "".concat(estimatedItemSize)
|
|
327
|
+
height: "".concat(estimatedItemSize, "px")
|
|
328
328
|
}, style),
|
|
329
329
|
onClick: handleClick
|
|
330
330
|
}, renderNode());
|
package/lib/menu/menu.js
CHANGED
|
@@ -96,7 +96,7 @@ var Menu = function Menu(props) {
|
|
|
96
96
|
restProps = __rest(_b, ["prefixCls", "mode", "inlineIndent", "forceSubMenuRender", "additionalTools", "onClick", "onOpenChange", "children", "className", "theme", "collapsed"]);
|
|
97
97
|
|
|
98
98
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'menu', customPrefixcls);
|
|
99
|
-
(0, _devwarning.default)(['inline', 'vertical', undefined].indexOf(mode) === -1, 'menu', "cannot found menu mode '".concat(mode, "'"));
|
|
99
|
+
(0, _devwarning.default)(['inline', 'vertical', undefined].indexOf(mode) === -1, 'menu', "cannot found menu mode '".concat(mode, "'"));
|
|
100
100
|
|
|
101
101
|
var _React$useState = _react.default.useState(''),
|
|
102
102
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
@@ -105,8 +105,13 @@ var Menu = function Menu(props) {
|
|
|
105
105
|
|
|
106
106
|
var _React$useState3 = _react.default.useState([]),
|
|
107
107
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
selectedKeyPath = _React$useState4[0],
|
|
109
|
+
setSelectedKeyPath = _React$useState4[1];
|
|
110
|
+
|
|
111
|
+
var _React$useState5 = _react.default.useState([]),
|
|
112
|
+
_React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2),
|
|
113
|
+
openKeys = _React$useState6[0],
|
|
114
|
+
setOpenKeys = _React$useState6[1];
|
|
110
115
|
|
|
111
116
|
if (mode === 'inline') {
|
|
112
117
|
restProps.triggerSubMenuAction = 'click';
|
|
@@ -115,6 +120,7 @@ var Menu = function Menu(props) {
|
|
|
115
120
|
(0, _react.useEffect)(function () {
|
|
116
121
|
setOpenKeys([]);
|
|
117
122
|
setSelectedKey('');
|
|
123
|
+
setSelectedKeyPath([]);
|
|
118
124
|
openSubMenuSet.clear();
|
|
119
125
|
}, [mode]);
|
|
120
126
|
(0, _react.useEffect)(function () {
|
|
@@ -130,9 +136,7 @@ var Menu = function Menu(props) {
|
|
|
130
136
|
openSubMenuSet.add(d);
|
|
131
137
|
});
|
|
132
138
|
}
|
|
133
|
-
}, [userOpenKeys]);
|
|
134
|
-
// setCollapsed(restProps.collapsed)
|
|
135
|
-
// }, [restProps.collapsed])
|
|
139
|
+
}, [userOpenKeys]);
|
|
136
140
|
|
|
137
141
|
var handleOnClick = function handleOnClick(info) {
|
|
138
142
|
if (userSelectedKey === undefined) {
|
|
@@ -141,6 +145,7 @@ var Menu = function Menu(props) {
|
|
|
141
145
|
|
|
142
146
|
if (mode !== 'inline' && openKeys.length > 0) {
|
|
143
147
|
setOpenKeys([]);
|
|
148
|
+
openSubMenuSet.clear();
|
|
144
149
|
}
|
|
145
150
|
|
|
146
151
|
onClick && onClick(info);
|
|
@@ -192,6 +197,8 @@ var Menu = function Menu(props) {
|
|
|
192
197
|
mode: mode,
|
|
193
198
|
openKeys: openKeys,
|
|
194
199
|
selectedKey: selectedKey,
|
|
200
|
+
selectedKeyPath: selectedKeyPath,
|
|
201
|
+
setSelectedKeyPath: setSelectedKeyPath,
|
|
195
202
|
theme: theme,
|
|
196
203
|
triggerSubMenuAction: restProps.triggerSubMenuAction,
|
|
197
204
|
forceSubMenuRender: forceSubMenuRender,
|