@kdcloudjs/kdesign 1.3.7 → 1.4.0
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 +38 -0
- package/dist/kdesign-complete.less +122 -129
- package/dist/kdesign.css +129 -118
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +176 -137
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +3 -3
- package/dist/kdesign.min.js.map +1 -1
- package/es/anchor/anchor.js +3 -3
- package/es/anchor/style/index.css +7 -7
- package/es/anchor/style/index.less +5 -5
- package/es/anchor/style/token.less +1 -1
- package/es/config-provider/compDefaultProps.d.ts +1 -0
- package/es/config-provider/compDefaultProps.js +2 -1
- package/es/menu/menu.js +21 -9
- 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/switch/style/index.css +1 -1
- package/es/switch/style/token.less +1 -1
- 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/anchor/anchor.js +3 -3
- package/lib/anchor/style/index.css +7 -7
- package/lib/anchor/style/index.less +5 -5
- package/lib/anchor/style/token.less +1 -1
- package/lib/config-provider/compDefaultProps.d.ts +1 -0
- package/lib/config-provider/compDefaultProps.js +2 -1
- package/lib/menu/menu.js +21 -9
- 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/switch/style/index.css +1 -1
- package/lib/switch/style/token.less +1 -1
- 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
|
@@ -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
|
|
|
@@ -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/lib/menu/subMenu.js
CHANGED
|
@@ -11,12 +11,14 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/he
|
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"));
|
|
17
17
|
|
|
18
18
|
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
19
19
|
|
|
20
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
|
|
21
|
+
|
|
20
22
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
21
23
|
|
|
22
24
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -74,6 +76,8 @@ var SubMenu = function SubMenu(props) {
|
|
|
74
76
|
collapsed = _a.collapsed,
|
|
75
77
|
keyValue = _a.keyValue,
|
|
76
78
|
selectedKey = _a.selectedKey,
|
|
79
|
+
selectedKeyPath = _a.selectedKeyPath,
|
|
80
|
+
setSelectedKeyPath = _a.setSelectedKeyPath,
|
|
77
81
|
openKeys = _a.openKeys,
|
|
78
82
|
triggerSubMenuAction = _a.triggerSubMenuAction,
|
|
79
83
|
forceSubMenuRender = _a.forceSubMenuRender,
|
|
@@ -83,7 +87,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
83
87
|
handleOnOpenChange = _a.handleOnOpenChange,
|
|
84
88
|
_a$paddingLeft = _a.paddingLeft,
|
|
85
89
|
paddingLeft = _a$paddingLeft === void 0 ? 0 : _a$paddingLeft,
|
|
86
|
-
restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
|
|
90
|
+
restProps = __rest(_a, ["prefixCls", "theme", "mode", "title", "icon", "disabled", "children", "collapsed", "keyValue", "selectedKey", "selectedKeyPath", "setSelectedKeyPath", "openKeys", "triggerSubMenuAction", "forceSubMenuRender", "inlineIndent", "className", "style", "handleOnOpenChange", "paddingLeft"]);
|
|
87
91
|
|
|
88
92
|
var isVertical = mode === 'vertical'; // 初始化level
|
|
89
93
|
|
|
@@ -91,6 +95,14 @@ var SubMenu = function SubMenu(props) {
|
|
|
91
95
|
restProps.level = 1;
|
|
92
96
|
}
|
|
93
97
|
|
|
98
|
+
if (Array.isArray(restProps.parentPath)) {
|
|
99
|
+
var _context;
|
|
100
|
+
|
|
101
|
+
restProps.parentPath = (0, _concat.default)(_context = []).call(_context, (0, _toConsumableArray2.default)(restProps.parentPath), [keyValue]);
|
|
102
|
+
} else {
|
|
103
|
+
restProps.parentPath = [keyValue];
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
if (mode === 'inline') {
|
|
95
107
|
restProps.subMenuMode = 'vertical';
|
|
96
108
|
restProps.popupOffset = [];
|
|
@@ -217,10 +229,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
217
229
|
if (!(0, _includes.default)(className).call(className, _menuItem.MENU_ITEM_CONTAINER_NAME)) {
|
|
218
230
|
closeSubMenu();
|
|
219
231
|
}
|
|
220
|
-
});
|
|
221
|
-
// if (triggerSubMenuAction === 'click' && mode === 'vertical' && collapsed) {
|
|
222
|
-
// closeSubMenu()
|
|
223
|
-
// }
|
|
232
|
+
});
|
|
224
233
|
|
|
225
234
|
var handleMouseEvent = function handleMouseEvent(status) {
|
|
226
235
|
if (disabled || triggerSubMenuAction === 'click') return;
|
|
@@ -236,11 +245,6 @@ var SubMenu = function SubMenu(props) {
|
|
|
236
245
|
};
|
|
237
246
|
|
|
238
247
|
var handleOnClick = function handleOnClick(info) {
|
|
239
|
-
var _context;
|
|
240
|
-
|
|
241
|
-
// 保存路径
|
|
242
|
-
info.keyPath = (0, _concat.default)(_context = info.keyPath).call(_context, [keyValue]);
|
|
243
|
-
|
|
244
248
|
if (triggerSubMenuAction === 'click' && isVertical) {
|
|
245
249
|
closeSubMenu();
|
|
246
250
|
}
|
|
@@ -317,7 +321,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
317
321
|
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
318
322
|
|
|
319
323
|
var verticalView = (0, _usePopper.default)( /*#__PURE__*/_react.default.createElement("li", (0, _extends2.default)({
|
|
320
|
-
className: (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "light", theme === 'light'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-hover"), !disabled &&
|
|
324
|
+
className: (0, _classnames.default)(prefixCls, className, (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "light", theme === 'light'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-hover"), !disabled && Array.isArray(openKeys) && (0, _includes.default)(openKeys).call(openKeys, keyValue)), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && (0, _includes.default)(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames2)),
|
|
321
325
|
ref: subMenuVerticalRef,
|
|
322
326
|
key: keyValue
|
|
323
327
|
}, {
|
|
@@ -349,19 +353,21 @@ var SubMenu = function SubMenu(props) {
|
|
|
349
353
|
mode: mode,
|
|
350
354
|
theme: theme,
|
|
351
355
|
selectedKey: selectedKey,
|
|
356
|
+
setSelectedKeyPath: setSelectedKeyPath,
|
|
352
357
|
openKeys: openKeys,
|
|
353
358
|
forceSubMenuRender: forceSubMenuRender,
|
|
354
359
|
triggerSubMenuAction: triggerSubMenuAction,
|
|
355
360
|
handleOnOpenChange: handleOnOpenChange,
|
|
356
361
|
handleOnClick: handleOnClick,
|
|
357
362
|
inlineIndent: inlineIndent,
|
|
358
|
-
paddingLeft: curPaddingLeft
|
|
363
|
+
paddingLeft: curPaddingLeft,
|
|
364
|
+
parentPath: restProps.parentPath
|
|
359
365
|
});
|
|
360
366
|
}))), {
|
|
361
367
|
arrow: false,
|
|
362
368
|
placement: 'rightTop',
|
|
363
369
|
gap: 0,
|
|
364
|
-
visible: isVertical ? visible : false,
|
|
370
|
+
visible: isVertical && !disabled ? visible : false,
|
|
365
371
|
disabled: isVertical ? undefined : true,
|
|
366
372
|
prefixCls: 'kd-menu-popper',
|
|
367
373
|
popperClassName: theme === 'light' ? 'light' : ''
|
|
@@ -374,7 +380,7 @@ var SubMenu = function SubMenu(props) {
|
|
|
374
380
|
|
|
375
381
|
return /*#__PURE__*/_react.default.createElement("li", (0, _extends2.default)({
|
|
376
382
|
ref: subMenuRef,
|
|
377
|
-
className: (0, _classnames.default)(prefixCls, className, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-disabled"), disabled), _classNames4)),
|
|
383
|
+
className: (0, _classnames.default)(prefixCls, className, (_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-collapsed"), collapsed), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-disabled"), disabled), (0, _defineProperty2.default)(_classNames4, "".concat(prefixCls, "-active"), Array.isArray(selectedKeyPath) && (0, _includes.default)(selectedKeyPath).call(selectedKeyPath, keyValue)), _classNames4)),
|
|
378
384
|
key: keyValue
|
|
379
385
|
}, mouseEvent, {
|
|
380
386
|
style: style
|
|
@@ -397,13 +403,15 @@ var SubMenu = function SubMenu(props) {
|
|
|
397
403
|
collapsed: collapsed,
|
|
398
404
|
mode: mode,
|
|
399
405
|
selectedKey: selectedKey,
|
|
406
|
+
setSelectedKeyPath: setSelectedKeyPath,
|
|
400
407
|
openKeys: openKeys,
|
|
401
408
|
forceSubMenuRender: forceSubMenuRender,
|
|
402
409
|
triggerSubMenuAction: triggerSubMenuAction,
|
|
403
410
|
handleOnOpenChange: handleOnOpenChange,
|
|
404
411
|
handleOnClick: handleOnClick,
|
|
405
412
|
inlineIndent: inlineIndent,
|
|
406
|
-
paddingLeft: curPaddingLeft
|
|
413
|
+
paddingLeft: curPaddingLeft,
|
|
414
|
+
parentPath: restProps.parentPath
|
|
407
415
|
});
|
|
408
416
|
}))));
|
|
409
417
|
}
|
package/lib/select/select.js
CHANGED
|
@@ -91,7 +91,9 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
91
91
|
placeholder = selectProps.placeholder,
|
|
92
92
|
dropdownStyle = selectProps.dropdownStyle,
|
|
93
93
|
style = selectProps.style,
|
|
94
|
-
clearIcon = selectProps.clearIcon
|
|
94
|
+
clearIcon = selectProps.clearIcon,
|
|
95
|
+
_selectProps$popperSt = selectProps.popperStyle,
|
|
96
|
+
popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt;
|
|
95
97
|
var isMultiple = mode === 'multiple'; // 是否多选
|
|
96
98
|
|
|
97
99
|
var _useMergedState = (0, _hooks.useMergedState)(undefined, {
|
|
@@ -153,7 +155,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
153
155
|
|
|
154
156
|
var searchCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-dropdown-search"), true)); // 下拉子项列表样式
|
|
155
157
|
|
|
156
|
-
var dropContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".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)); // 多选底部样式
|
|
158
|
+
var dropContentCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".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)); // 多选底部样式
|
|
157
159
|
|
|
158
160
|
var multipleFooterCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-multiple-footer"), true)); // 多选,单选公共样式
|
|
159
161
|
|
|
@@ -695,10 +697,10 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
695
697
|
var _ref2 = (_a = selectRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(),
|
|
696
698
|
width = _ref2.width;
|
|
697
699
|
|
|
698
|
-
return {
|
|
700
|
+
return (0, _extends2.default)({
|
|
699
701
|
width: (dropdownStyle === null || dropdownStyle === void 0 ? void 0 : dropdownStyle.width) || (width > 75 ? width : 75),
|
|
700
702
|
zIndex: 1050
|
|
701
|
-
};
|
|
703
|
+
}, popperStyle);
|
|
702
704
|
}
|
|
703
705
|
};
|
|
704
706
|
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
.kd-switch-size-small {
|
|
186
186
|
height: var(--kd-c-switch-small-sizing-height, 16px);
|
|
187
187
|
min-width: var(--kd-c-switch-small-sizing-width, 32px);
|
|
188
|
-
line-height: var(--kd-c-switch-small-line-height,
|
|
188
|
+
line-height: var(--kd-c-switch-small-line-height, 16px);
|
|
189
189
|
font-size: var(--kd-c-switch-small-font-size, var(--kd-g-font-size-small, 12px));
|
|
190
190
|
border-radius: var(--kd-c-switch-small-radius-border, 8px);
|
|
191
191
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
// line-height
|
|
19
19
|
@switch-large-line-height: var(~'@{switch-prefix}-large-line-height', 20px);
|
|
20
|
-
@switch-small-line-height: var(~'@{switch-prefix}-small-line-height',
|
|
20
|
+
@switch-small-line-height: var(~'@{switch-prefix}-small-line-height', 16px);
|
|
21
21
|
|
|
22
22
|
//radius
|
|
23
23
|
@switch-small-border-radius: var(~'@{switch-prefix}-small-radius-border', 8px);
|
package/lib/table/table.js
CHANGED
|
@@ -106,6 +106,8 @@ function Table(props) {
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
if (footerDataSource) {
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
110
|
+
// @ts-ignore
|
|
109
111
|
pipeline.footerDataSource(footerDataSource);
|
|
110
112
|
}
|
|
111
113
|
/* -------------------------------------------------------------------------- */
|
package/lib/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
|
}
|
|
@@ -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
|
}
|
|
@@ -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/lib/tree/tree.js
CHANGED
|
@@ -89,8 +89,7 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
89
89
|
setTreeNodeClassName = _TreeProps$setTreeNod2 === void 0 ? function () {
|
|
90
90
|
return '';
|
|
91
91
|
} : _TreeProps$setTreeNod2,
|
|
92
|
-
|
|
93
|
-
innerEstimatedItemSize = _TreeProps$estimatedI === void 0 ? 28 : _TreeProps$estimatedI,
|
|
92
|
+
innerEstimatedItemSize = TreeProps.estimatedItemSize,
|
|
94
93
|
style = TreeProps.style;
|
|
95
94
|
var treePrefixCls = getPrefixCls(prefixCls, 'tree', customPrefixcls); // 树样式前缀
|
|
96
95
|
|
package/lib/tree/treeNode.js
CHANGED
|
@@ -363,7 +363,7 @@ var TreeNode = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
363
363
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
364
364
|
className: (0, _classnames.default)("".concat(treeNodePrefixCls, "-item"), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-item-hover"), !disabled && selectable), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-selected"), selected && selectable && !disabled), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-disabled"), disabled), (0, _defineProperty2.default)({}, "".concat(treeNodePrefixCls, "-opened"), expandState), (0, _concat.default)(_context = "".concat(treeNodePrefixCls, "-item-")).call(_context, nodeKey), className),
|
|
365
365
|
style: (0, _extends2.default)({
|
|
366
|
-
height: "".concat(estimatedItemSize)
|
|
366
|
+
height: "".concat(estimatedItemSize, "px")
|
|
367
367
|
}, style),
|
|
368
368
|
onClick: handleClick
|
|
369
369
|
}, renderNode());
|