@kdcloudjs/kdesign 1.7.21 → 1.7.23
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 +11 -0
- package/dist/kdesign-complete.less +63 -17
- package/dist/kdesign.css +42 -8
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +110 -44
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +6 -6
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/reactNode.d.ts +1 -0
- package/es/_utils/reactNode.js +3 -0
- package/es/button/style/index.css +3 -0
- package/es/button/style/index.less +3 -3
- package/es/button/style/mixin.less +2 -1
- package/es/button/style/token.less +3 -0
- package/es/checkbox/group.js +1 -1
- package/es/checkbox/style/index.css +1 -0
- package/es/checkbox/style/index.less +1 -0
- package/es/checkbox/style/token.less +1 -0
- package/es/collapse/style/index.css +3 -0
- package/es/collapse/style/index.less +3 -0
- package/es/dropdown/dropdown.js +4 -3
- package/es/filter/style/index.css +6 -0
- package/es/filter/style/index.less +7 -0
- package/es/filter/style/token.less +4 -0
- package/es/form/style/index.css +1 -1
- package/es/form/style/index.less +1 -1
- package/es/form/style/token.less +1 -1
- package/es/input/input.js +21 -3
- package/es/input-number/inputNumber.js +6 -0
- package/es/menu/menu.js +27 -18
- package/es/menu/style/index.css +5 -1
- package/es/menu/style/mixin.less +3 -1
- package/es/menu/style/token.less +2 -0
- package/es/radio/style/index.css +7 -0
- package/es/radio/style/index.less +5 -1
- package/es/radio/style/token.less +3 -0
- package/es/search/style/index.css +1 -0
- package/es/search/style/index.less +1 -0
- package/es/search/style/token.less +1 -0
- package/es/select/select.js +17 -3
- package/es/tag/style/index.css +6 -0
- package/es/tag/style/index.less +3 -3
- package/es/tag/style/mixin.less +3 -1
- package/es/tag/style/token.less +2 -0
- package/es/timeline/TimelineItem.js +2 -1
- package/es/timeline/style/index.css +4 -3
- package/es/timeline/style/index.less +5 -3
- package/es/timeline/style/token.less +2 -0
- package/es/tooltip/tooltip.js +3 -2
- package/es/transfer/style/index.css +2 -2
- package/es/transfer/style/index.less +2 -2
- package/es/transfer/style/token.less +1 -0
- package/es/tree/style/index.css +2 -0
- package/es/tree/style/index.less +2 -0
- package/es/tree/style/token.less +2 -0
- package/es/tree/tree.js +8 -1
- package/es/virtual-list/Filler.d.ts +1 -0
- package/es/virtual-list/Filler.js +4 -3
- package/es/virtual-list/virtual-list.d.ts +1 -0
- package/es/virtual-list/virtual-list.js +5 -3
- package/lib/_utils/reactNode.d.ts +1 -0
- package/lib/_utils/reactNode.js +4 -0
- package/lib/button/style/index.css +3 -0
- package/lib/button/style/index.less +3 -3
- package/lib/button/style/mixin.less +2 -1
- package/lib/button/style/token.less +3 -0
- package/lib/checkbox/group.js +1 -1
- package/lib/checkbox/style/index.css +1 -0
- package/lib/checkbox/style/index.less +1 -0
- package/lib/checkbox/style/token.less +1 -0
- package/lib/collapse/style/index.css +3 -0
- package/lib/collapse/style/index.less +3 -0
- package/lib/dropdown/dropdown.js +4 -3
- package/lib/filter/style/index.css +6 -0
- package/lib/filter/style/index.less +7 -0
- package/lib/filter/style/token.less +4 -0
- package/lib/form/style/index.css +1 -1
- package/lib/form/style/index.less +1 -1
- package/lib/form/style/token.less +1 -1
- package/lib/input/input.js +20 -2
- package/lib/input-number/inputNumber.js +6 -0
- package/lib/menu/menu.js +26 -17
- package/lib/menu/style/index.css +5 -1
- package/lib/menu/style/mixin.less +3 -1
- package/lib/menu/style/token.less +2 -0
- package/lib/radio/style/index.css +7 -0
- package/lib/radio/style/index.less +5 -1
- package/lib/radio/style/token.less +3 -0
- package/lib/search/style/index.css +1 -0
- package/lib/search/style/index.less +1 -0
- package/lib/search/style/token.less +1 -0
- package/lib/select/select.js +16 -2
- package/lib/tag/style/index.css +6 -0
- package/lib/tag/style/index.less +3 -3
- package/lib/tag/style/mixin.less +3 -1
- package/lib/tag/style/token.less +2 -0
- package/lib/timeline/TimelineItem.js +2 -1
- package/lib/timeline/style/index.css +4 -3
- package/lib/timeline/style/index.less +5 -3
- package/lib/timeline/style/token.less +2 -0
- package/lib/tooltip/tooltip.js +3 -2
- package/lib/transfer/style/index.css +2 -2
- package/lib/transfer/style/index.less +2 -2
- package/lib/transfer/style/token.less +1 -0
- package/lib/tree/style/index.css +2 -0
- package/lib/tree/style/index.less +2 -0
- package/lib/tree/style/token.less +2 -0
- package/lib/tree/tree.js +8 -1
- package/lib/virtual-list/Filler.d.ts +1 -0
- package/lib/virtual-list/Filler.js +4 -3
- package/lib/virtual-list/virtual-list.d.ts +1 -0
- package/lib/virtual-list/virtual-list.js +5 -3
- package/package.json +1 -1
package/es/tag/style/index.css
CHANGED
|
@@ -126,6 +126,8 @@
|
|
|
126
126
|
vertical-align: middle;
|
|
127
127
|
padding: 0 var(--kd-c-tag-spacing-padding-horizontal-small, 6px);
|
|
128
128
|
border-radius: calc(var(--kd-c-tag-sizing-height-small, 20px) / 2);
|
|
129
|
+
max-width: var(--kd-c-tag-sizing-max-width);
|
|
130
|
+
min-width: var(--kd-c-tag-sizing-min-width);
|
|
129
131
|
}
|
|
130
132
|
.kd-tag-size-middle {
|
|
131
133
|
font-size: var(--kd-c-tag-font-size-middle, var(--kd-g-font-size-small, 12px));
|
|
@@ -141,6 +143,8 @@
|
|
|
141
143
|
vertical-align: middle;
|
|
142
144
|
padding: 0 var(--kd-c-tag-spacing-padding-horizontal-middle, 7px);
|
|
143
145
|
border-radius: calc(var(--kd-c-tag-sizing-height-middle, 20px) / 2);
|
|
146
|
+
max-width: var(--kd-c-tag-sizing-max-width);
|
|
147
|
+
min-width: var(--kd-c-tag-sizing-min-width);
|
|
144
148
|
}
|
|
145
149
|
.kd-tag-size-large {
|
|
146
150
|
font-size: var(--kd-c-tag-font-size-large, var(--kd-g-font-size-middle, 14px));
|
|
@@ -156,6 +160,8 @@
|
|
|
156
160
|
vertical-align: middle;
|
|
157
161
|
padding: 0 var(--kd-c-tag-spacing-padding-horizontal-large, 8px);
|
|
158
162
|
border-radius: calc(var(--kd-c-tag-sizing-height-large, 24px) / 2);
|
|
163
|
+
max-width: var(--kd-c-tag-sizing-max-width);
|
|
164
|
+
min-width: var(--kd-c-tag-sizing-min-width);
|
|
159
165
|
}
|
|
160
166
|
.kd-tag-shape-status {
|
|
161
167
|
border: 1px solid var(--kd-c-tag-color-process, var(--kd-g-color-ongoing, #276ff5));
|
package/es/tag/style/index.less
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
&-size-small {
|
|
17
|
-
.tag-size(@tag-small-font-size, @tag-small-height, @tag-small-padding-horizontal);
|
|
17
|
+
.tag-size(@tag-small-font-size, @tag-small-height, @tag-small-padding-horizontal, @tag-max-width, @tag-min-width);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
&-size-middle {
|
|
21
|
-
.tag-size(@tag-middle-font-size, @tag-middle-height, @tag-middle-padding-horizontal);
|
|
21
|
+
.tag-size(@tag-middle-font-size, @tag-middle-height, @tag-middle-padding-horizontal, @tag-max-width, @tag-min-width);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
&-size-large {
|
|
25
|
-
.tag-size(@tag-large-font-size, @tag-large-height, @tag-large-padding-horizontal);
|
|
25
|
+
.tag-size(@tag-large-font-size, @tag-large-height, @tag-large-padding-horizontal, @tag-max-width, @tag-min-width);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
transition: all @tag-g-motion-duration;
|
package/es/tag/style/mixin.less
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import './token.less';
|
|
2
2
|
|
|
3
3
|
// code component mixin here
|
|
4
|
-
.tag-size(@size, @height, @padding) {
|
|
4
|
+
.tag-size(@size, @height, @padding, @max-width, @min-width) {
|
|
5
5
|
font-size: @size;
|
|
6
6
|
height: @height;
|
|
7
7
|
box-sizing: border-box;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
vertical-align: middle;
|
|
11
11
|
padding: 0 @padding;
|
|
12
12
|
border-radius: calc(@height / 2);
|
|
13
|
+
max-width: @max-width;
|
|
14
|
+
min-width: @min-width;
|
|
13
15
|
}
|
|
14
16
|
.tag-status(@color) {
|
|
15
17
|
border: 1px solid @color;
|
package/es/tag/style/token.less
CHANGED
|
@@ -35,6 +35,8 @@
|
|
|
35
35
|
@tag-small-height: var(~'@{tag-custom-prefix}-sizing-height-small', 20px);
|
|
36
36
|
@tag-middle-height: var(~'@{tag-custom-prefix}-sizing-height-middle', 20px);
|
|
37
37
|
@tag-large-height: var(~'@{tag-custom-prefix}-sizing-height-large', 24px);
|
|
38
|
+
@tag-max-width: var(~'@{tag-custom-prefix}-sizing-max-width');
|
|
39
|
+
@tag-min-width: var(~'@{tag-custom-prefix}-sizing-min-width');
|
|
38
40
|
|
|
39
41
|
// spacing
|
|
40
42
|
@tag-small-padding-horizontal: var(~'@{tag-custom-prefix}-spacing-padding-horizontal-small', 6px);
|
|
@@ -43,6 +43,7 @@ var TimelineItem = function TimelineItem(props) {
|
|
|
43
43
|
var labelStyle = mode !== 'alternate' ? _defineProperty({
|
|
44
44
|
width: "".concat(labelWidth, "px")
|
|
45
45
|
}, _concatInstanceProperty(_context = "margin".concat(mode === null || mode === void 0 ? void 0 : mode.substring(0, 1).toUpperCase())).call(_context, mode === null || mode === void 0 ? void 0 : mode.substring(1)), "-".concat(labelWidth, "px")) : {};
|
|
46
|
+
var marginDistance = pending ? Math.round(lineHeight / 2 + 12 / 2 + 2) : Math.round(lineHeight / 2 + 9 / 2 + 2);
|
|
46
47
|
return /*#__PURE__*/React.createElement("li", _extends({}, restProps, {
|
|
47
48
|
className: itemClassName
|
|
48
49
|
}), label && /*#__PURE__*/React.createElement("div", {
|
|
@@ -53,7 +54,7 @@ var TimelineItem = function TimelineItem(props) {
|
|
|
53
54
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
54
55
|
className: "".concat(prefixCls, "-tail"),
|
|
55
56
|
style: {
|
|
56
|
-
marginTop:
|
|
57
|
+
marginTop: marginDistance
|
|
57
58
|
}
|
|
58
59
|
}), /*#__PURE__*/React.createElement("div", {
|
|
59
60
|
className: dotClassName,
|
|
@@ -189,6 +189,8 @@
|
|
|
189
189
|
margin: 0 0 0 calc(2 * (var(--kd-c-timeline-dot-sizing, 9px) - var(--kd-c-timeline-sizing-width, 1px)) + 8px);
|
|
190
190
|
word-break: break-word;
|
|
191
191
|
color: var(--kd-c-timeline-content-color-text, var(--kd-g-color-text-primary, #212121));
|
|
192
|
+
max-width: var(--kd-c-timeline-content-sizing-max-width);
|
|
193
|
+
min-width: var(--kd-c-timeline-content-sizing-min-width);
|
|
192
194
|
}
|
|
193
195
|
.kd-timeline .kd-timeline-item-content > * {
|
|
194
196
|
margin: 0;
|
|
@@ -297,16 +299,15 @@
|
|
|
297
299
|
.kd-timeline.pending .kd-timeline-item.last .kd-timeline-item-tail {
|
|
298
300
|
display: block;
|
|
299
301
|
height: calc(100% - 14px);
|
|
300
|
-
border-left:
|
|
302
|
+
border-left: 1px dotted var(--kd-c-timeline-line-color, var(--kd-g-color-border-weak, #e5e5e5));
|
|
301
303
|
}
|
|
302
304
|
.kd-timeline.reverse .kd-timeline-item.last .kd-timeline-item-tail {
|
|
303
305
|
display: none;
|
|
304
306
|
}
|
|
305
307
|
.kd-timeline.reverse .kd-timeline-item.pending .kd-timeline-item-tail {
|
|
306
|
-
top: 15px;
|
|
307
308
|
display: block;
|
|
308
309
|
height: calc(100% - 15px);
|
|
309
|
-
border-left:
|
|
310
|
+
border-left: 1px dotted var(--kd-c-timeline-line-color, var(--kd-g-color-border-weak, #e5e5e5));
|
|
310
311
|
}
|
|
311
312
|
.kd-timeline.reverse .kd-timeline-item.pending .kd-timeline-item-content {
|
|
312
313
|
min-height: 48px;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
list-style: none;
|
|
15
15
|
|
|
16
|
+
|
|
16
17
|
.@{timeline-item-prefix-cls} {
|
|
17
18
|
.reset-component;
|
|
18
19
|
position: relative;
|
|
@@ -84,6 +85,8 @@
|
|
|
84
85
|
margin: 0 0 0 calc(2 * (@timeline-dot-size - @timeline-width) + @timeline-gap);
|
|
85
86
|
word-break: break-word;
|
|
86
87
|
color: @timeline-content-color-text;
|
|
88
|
+
max-width: @timeline-content-max-width;
|
|
89
|
+
min-width: @timeline-content-min-width;
|
|
87
90
|
|
|
88
91
|
> * {
|
|
89
92
|
margin: 0;
|
|
@@ -241,7 +244,7 @@
|
|
|
241
244
|
&.pending .@{timeline-item-prefix-cls}.last .@{timeline-item-prefix-cls}-tail {
|
|
242
245
|
display: block;
|
|
243
246
|
height: calc(100% - 14px);
|
|
244
|
-
border-left:
|
|
247
|
+
border-left: 1px dotted @timeline-line-color;
|
|
245
248
|
}
|
|
246
249
|
|
|
247
250
|
&.reverse .@{timeline-item-prefix-cls}.last .@{timeline-item-prefix-cls}-tail {
|
|
@@ -250,10 +253,9 @@
|
|
|
250
253
|
|
|
251
254
|
&.reverse .@{timeline-item-prefix-cls}.pending {
|
|
252
255
|
.@{timeline-item-prefix-cls}-tail {
|
|
253
|
-
top: 15px;
|
|
254
256
|
display: block;
|
|
255
257
|
height: calc(100% - 15px);
|
|
256
|
-
border-left:
|
|
258
|
+
border-left: 1px dotted @timeline-line-color;
|
|
257
259
|
}
|
|
258
260
|
.@{timeline-item-prefix-cls}-content {
|
|
259
261
|
min-height: 48px;
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
|
|
22
22
|
// sizing
|
|
23
23
|
@timeline-width: var(~'@{timeline-prefix}-sizing-width',1px);
|
|
24
|
+
@timeline-content-max-width: var(~'@{timeline-prefix}-content-sizing-max-width');
|
|
25
|
+
@timeline-content-min-width: var(~'@{timeline-prefix}-content-sizing-min-width');
|
|
24
26
|
|
|
25
27
|
// spacing
|
|
26
28
|
@timeline-item-padding-bottom: var(~'@{timeline-prefix}-spacing-padding-bottom',24px);
|
package/es/tooltip/tooltip.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
3
|
import { getCompProps } from '../_utils';
|
|
4
|
+
import { isFragment } from '../_utils/reactNode';
|
|
4
5
|
import { ConfigContext } from '../config-provider';
|
|
5
6
|
import usePopper from '../_utils/usePopper';
|
|
6
7
|
var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -16,8 +17,8 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
16
17
|
customPrefixcls = allProps.prefixCls;
|
|
17
18
|
// className前缀
|
|
18
19
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'tooltip', customPrefixcls);
|
|
19
|
-
var tiplocator = /*#__PURE__*/React.cloneElement(React.
|
|
20
|
-
ref: children.ref
|
|
20
|
+
var tiplocator = /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.isValidElement(children) && !isFragment(children) ? children : /*#__PURE__*/React.createElement("span", null, children), {
|
|
21
|
+
ref: /*#__PURE__*/React.isValidElement(children) && !isFragment(children) && children.ref ? children.ref : ref
|
|
21
22
|
});
|
|
22
23
|
var onVisibleChange = function onVisibleChange(v) {
|
|
23
24
|
if (status.current === v && allProps.visible === undefined) return;
|
|
@@ -138,12 +138,12 @@
|
|
|
138
138
|
-webkit-box-direction: normal;
|
|
139
139
|
-ms-flex-direction: column;
|
|
140
140
|
flex-direction: column;
|
|
141
|
-
width: 250px;
|
|
141
|
+
width: var(--kd-c-transfer-list-sizing-width, 250px);
|
|
142
142
|
min-height: 300px;
|
|
143
143
|
border: 1px solid var(--kd-c-transfer-color-border, var(--kd-g-color-border-strong, #d9d9d9));
|
|
144
144
|
}
|
|
145
145
|
.kd-transfer-list-with-pagination {
|
|
146
|
-
width: 250px;
|
|
146
|
+
width: var(--kd-c-transfer-list-sizing-width, 250px);
|
|
147
147
|
height: auto;
|
|
148
148
|
}
|
|
149
149
|
.kd-transfer-list-header {
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
&-list {
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
|
-
width:
|
|
28
|
+
width: @transfer-list-width;
|
|
29
29
|
min-height: 300px;
|
|
30
30
|
border: 1px solid @transfer-border-color;
|
|
31
31
|
|
|
32
32
|
&-with-pagination {
|
|
33
|
-
width:
|
|
33
|
+
width: @transfer-list-width;
|
|
34
34
|
height: auto;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
@transfer-header-height: var(~'@{transfer-custom-prefix}-header-sizing-height', 36px);
|
|
18
18
|
@transfer-search-height: var(~'@{transfer-custom-prefix}-search-sizing-height', 32px);
|
|
19
19
|
@transfer-pagination-height: var(~'@{transfer-custom-prefix}-pagination-sizing-height', 36px);
|
|
20
|
+
@transfer-list-width: var(~'@{transfer-custom-prefix}-list-sizing-width', 250px);
|
|
20
21
|
|
|
21
22
|
// spacing
|
|
22
23
|
@transfer-padding-base: var(~'@{transfer-custom-prefix}-spacing-horizontal', 14px);
|
package/es/tree/style/index.css
CHANGED
|
@@ -135,6 +135,8 @@
|
|
|
135
135
|
color: var(--kd-c-tree-color-text, var(--kd-g-color-text-primary, #212121));
|
|
136
136
|
margin-left: var(--kd-c-tree-spacing-margin-left, 0px);
|
|
137
137
|
padding: var(--kd-c-tree-spacing-padding-vertical, 3px) 0;
|
|
138
|
+
max-width: var(--kd-c-tree-root-sizing-max-width);
|
|
139
|
+
min-width: var(--kd-c-tree-root-sizing-min-width);
|
|
138
140
|
}
|
|
139
141
|
.kd-tree-root {
|
|
140
142
|
min-width: 100%;
|
package/es/tree/style/index.less
CHANGED
package/es/tree/style/token.less
CHANGED
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
@tree-expand-icon-loading-width: var(~'@{tree-prefix}-expand-icon-loading-sizing-width', 16px);
|
|
23
23
|
@tree-node-icon-height: var(~'@{tree-prefix}-node-icon-sizing-height', 16px);
|
|
24
24
|
@tree-node-icon-width: var(~'@{tree-prefix}-node-icon-sizing-width', 16px);
|
|
25
|
+
@tree-root-max-width: var(~'@{tree-prefix}-root-sizing-max-width');
|
|
26
|
+
@tree-root-min-width: var(~'@{tree-prefix}-root-sizing-min-width');
|
|
25
27
|
|
|
26
28
|
// spacing
|
|
27
29
|
@tree-margin-left: var(~'@{tree-prefix}-spacing-margin-left', 0px);
|
package/es/tree/tree.js
CHANGED
|
@@ -426,7 +426,14 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
426
426
|
return item === null || item === void 0 ? void 0 : item.key;
|
|
427
427
|
},
|
|
428
428
|
height: height,
|
|
429
|
-
itemHeight: estimatedItemSize
|
|
429
|
+
itemHeight: estimatedItemSize,
|
|
430
|
+
outerStyle: {
|
|
431
|
+
overflow: 'unset'
|
|
432
|
+
},
|
|
433
|
+
innerStyle: {
|
|
434
|
+
minWidth: '100%',
|
|
435
|
+
width: 'max-contnet'
|
|
436
|
+
}
|
|
430
437
|
}, renderTreeNode) : _mapInstanceProperty(filterData).call(filterData, renderTreeNode)));
|
|
431
438
|
});
|
|
432
439
|
var Tree = InternalTree;
|
|
@@ -4,7 +4,8 @@ var Filler = function Filler(_ref) {
|
|
|
4
4
|
var height = _ref.height,
|
|
5
5
|
offset = _ref.offset,
|
|
6
6
|
children = _ref.children,
|
|
7
|
-
propsOuterStyle = _ref.outerStyle
|
|
7
|
+
propsOuterStyle = _ref.outerStyle,
|
|
8
|
+
propsInnerStyle = _ref.innerStyle;
|
|
8
9
|
var outerStyle = {};
|
|
9
10
|
var innerStyle = {
|
|
10
11
|
display: 'flex',
|
|
@@ -17,13 +18,13 @@ var Filler = function Filler(_ref) {
|
|
|
17
18
|
overflow: 'hidden',
|
|
18
19
|
zIndex: 0
|
|
19
20
|
}, propsOuterStyle);
|
|
20
|
-
innerStyle = _extends(_extends({}, innerStyle), {
|
|
21
|
+
innerStyle = _extends(_extends(_extends({}, innerStyle), {
|
|
21
22
|
transform: "translateY(".concat(offset, "px)"),
|
|
22
23
|
position: 'absolute',
|
|
23
24
|
left: 0,
|
|
24
25
|
right: 0,
|
|
25
26
|
top: 0
|
|
26
|
-
});
|
|
27
|
+
}), propsInnerStyle);
|
|
27
28
|
}
|
|
28
29
|
return /*#__PURE__*/React.createElement("div", {
|
|
29
30
|
style: outerStyle
|
|
@@ -17,6 +17,7 @@ export interface VirtualListProps<T> extends Omit<React.HTMLAttributes<any>, 'ch
|
|
|
17
17
|
scrollOptions?: ScrollIntoViewOptions;
|
|
18
18
|
needFiller?: boolean;
|
|
19
19
|
outerStyle?: CSSProperties;
|
|
20
|
+
innerStyle?: CSSProperties;
|
|
20
21
|
onScroll?: React.UIEventHandler<HTMLElement>;
|
|
21
22
|
}
|
|
22
23
|
export declare type AvailableVirtualListProps = Pick<VirtualListProps<any>, 'height' | 'itemHeight' | 'threshold' | 'isStaticItemHeight' | 'scrollOptions'>;
|
|
@@ -74,7 +74,7 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
74
74
|
_props$wrapper = props.wrapper,
|
|
75
75
|
WrapperTagName = _props$wrapper === void 0 ? 'div' : _props$wrapper,
|
|
76
76
|
_props$height = props.height,
|
|
77
|
-
propHeight = _props$height === void 0 ?
|
|
77
|
+
propHeight = _props$height === void 0 ? '100%' : _props$height,
|
|
78
78
|
_props$isStaticItemHe = props.isStaticItemHeight,
|
|
79
79
|
isStaticItemHeight = _props$isStaticItemHe === void 0 ? true : _props$isStaticItemHe,
|
|
80
80
|
propItemHeight = props.itemHeight,
|
|
@@ -84,7 +84,8 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
84
84
|
_props$needFiller = props.needFiller,
|
|
85
85
|
needFiller = _props$needFiller === void 0 ? true : _props$needFiller,
|
|
86
86
|
outerStyle = props.outerStyle,
|
|
87
|
-
|
|
87
|
+
innerStyle = props.innerStyle,
|
|
88
|
+
restProps = __rest(props, ["style", "className", "children", "data", "itemKey", "threshold", "wrapper", "height", "isStaticItemHeight", "itemHeight", "measureLongestItem", "scrollOptions", "onScroll", "needFiller", "outerStyle", "innerStyle"]);
|
|
88
89
|
var styleListMaxHeight = style && style.maxHeight || propHeight;
|
|
89
90
|
var refItemHeightMap = useRef({});
|
|
90
91
|
var _useState = useState(200),
|
|
@@ -507,7 +508,8 @@ var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
507
508
|
}, restProps), isVirtual ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Filler, {
|
|
508
509
|
height: itemTotalHeight,
|
|
509
510
|
offset: state.status === 'MEASURE_DONE' ? state.startItemTop : 0,
|
|
510
|
-
outerStyle: outerStyle
|
|
511
|
+
outerStyle: outerStyle,
|
|
512
|
+
innerStyle: innerStyle
|
|
511
513
|
}, renderChildren(_sliceInstanceProperty(data).call(data, state.startIndex, state.endIndex + 1), state.startIndex)), renderLongestItem()) : needFiller ? /*#__PURE__*/React.createElement(Filler, {
|
|
512
514
|
height: viewportHeight
|
|
513
515
|
}, renderChildren(data, 0)) : renderChildren(data, 0)));
|
|
@@ -3,5 +3,6 @@ export declare const isValidElement: typeof React.isValidElement;
|
|
|
3
3
|
declare type AnyObject = Record<any, any>;
|
|
4
4
|
declare type RenderProps = undefined | AnyObject | ((originProps: AnyObject) => AnyObject | undefined);
|
|
5
5
|
export declare function replaceElement(element: React.ReactNode, replacement: React.ReactNode, props: RenderProps): React.ReactNode;
|
|
6
|
+
export declare function isFragment(child: any): boolean;
|
|
6
7
|
export declare function cloneElement(element: React.ReactNode, props?: RenderProps): React.ReactElement;
|
|
7
8
|
export {};
|
package/lib/_utils/reactNode.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.cloneElement = cloneElement;
|
|
10
|
+
exports.isFragment = isFragment;
|
|
10
11
|
exports.isValidElement = void 0;
|
|
11
12
|
exports.replaceElement = replaceElement;
|
|
12
13
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -18,6 +19,9 @@ function replaceElement(element, replacement, props) {
|
|
|
18
19
|
if (!isValidElement(element)) return replacement;
|
|
19
20
|
return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
|
|
20
21
|
}
|
|
22
|
+
function isFragment(child) {
|
|
23
|
+
return child && isValidElement(child) && child.type === React.Fragment;
|
|
24
|
+
}
|
|
21
25
|
function cloneElement(element, props) {
|
|
22
26
|
return replaceElement(element, element, props);
|
|
23
27
|
}
|
|
@@ -242,6 +242,7 @@
|
|
|
242
242
|
line-height: calc(var(--kd-c-button-sizing-height-small, 24px) - (var(--kd-c-button-spacing-padding-vertical-small, 3px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
243
243
|
font-size: var(--kd-c-button-font-size-small, var(--kd-g-font-size-small, 12px));
|
|
244
244
|
padding: var(--kd-c-button-spacing-padding-vertical-small, 3px) var(--kd-c-button-spacing-padding-horizontal-small, 8px);
|
|
245
|
+
max-width: var(--kd-c-button-sizing-max-width-small);
|
|
245
246
|
}
|
|
246
247
|
.kd-btn-size-small.kd-btn-icon-only {
|
|
247
248
|
font-size: var(--kd-c-button-icon-font-size-small, 14px);
|
|
@@ -265,6 +266,7 @@
|
|
|
265
266
|
line-height: calc(var(--kd-c-button-sizing-height-middle, 28px) - (var(--kd-c-button-spacing-padding-vertical-middle, 5px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
266
267
|
font-size: var(--kd-c-button-font-size-middle, var(--kd-g-font-size-small, 12px));
|
|
267
268
|
padding: var(--kd-c-button-spacing-padding-vertical-middle, 5px) var(--kd-c-button-spacing-padding-horizontal-middle, 8px);
|
|
269
|
+
max-width: var(--kd-c-button-sizing-max-width-middle);
|
|
268
270
|
}
|
|
269
271
|
.kd-btn-size-middle.kd-btn-icon-only {
|
|
270
272
|
font-size: var(--kd-c-button-icon-font-size-middle, 16px);
|
|
@@ -288,6 +290,7 @@
|
|
|
288
290
|
line-height: calc(var(--kd-c-button-sizing-height-large, 32px) - (var(--kd-c-button-spacing-padding-vertical-large, 6px) * 2) - (var(--kd-c-button-sizing-border, 1px) * 2));
|
|
289
291
|
font-size: var(--kd-c-button-font-size-large, var(--kd-g-font-size-large, 16px));
|
|
290
292
|
padding: var(--kd-c-button-spacing-padding-vertical-large, 6px) var(--kd-c-button-spacing-padding-horizontal-large, 8px);
|
|
293
|
+
max-width: var(--kd-c-button-sizing-max-width-large);
|
|
291
294
|
}
|
|
292
295
|
.kd-btn-size-large.kd-btn-icon-only {
|
|
293
296
|
font-size: var(--kd-c-button-icon-font-size-large, 18px);
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
|
|
111
111
|
// 小号尺寸按钮
|
|
112
112
|
&-size-small {
|
|
113
|
-
.btn-size(@btn-small-height, @btn-small-font-size, @btn-small-padding-vertical, @btn-small-padding-horizontal, @btn-small-min-width);
|
|
113
|
+
.btn-size(@btn-small-height, @btn-small-font-size, @btn-small-padding-vertical, @btn-small-padding-horizontal, @btn-small-min-width, @btn-small-max-width);
|
|
114
114
|
&.@{btn-prefix-cls}-icon-only {
|
|
115
115
|
font-size: @btn-icon-small-font-size;
|
|
116
116
|
padding: 0 @btn-icon-padding-horizontal;
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
|
|
127
127
|
// 中号尺寸按钮
|
|
128
128
|
&-size-middle {
|
|
129
|
-
.btn-size(@btn-middle-height, @btn-middle-font-size, @btn-middle-padding-vertical, @btn-middle-padding-horizontal, @btn-middle-min-width);
|
|
129
|
+
.btn-size(@btn-middle-height, @btn-middle-font-size, @btn-middle-padding-vertical, @btn-middle-padding-horizontal, @btn-middle-min-width, @btn-middle-max-width);
|
|
130
130
|
&.@{btn-prefix-cls}-icon-only {
|
|
131
131
|
font-size: @btn-icon-middle-font-size;
|
|
132
132
|
padding: 0 @btn-icon-padding-horizontal;
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
|
|
143
143
|
// 大号尺寸按钮
|
|
144
144
|
&-size-large {
|
|
145
|
-
.btn-size(@btn-large-height, @btn-large-font-size, @btn-large-padding-vertical, @btn-large-padding-horizontal, @btn-large-min-width);
|
|
145
|
+
.btn-size(@btn-large-height, @btn-large-font-size, @btn-large-padding-vertical, @btn-large-padding-horizontal, @btn-large-min-width, @btn-large-max-width);
|
|
146
146
|
&.@{btn-prefix-cls}-icon-only {
|
|
147
147
|
font-size: @btn-icon-large-font-size;
|
|
148
148
|
padding: 0 @btn-icon-padding-horizontal;
|
|
@@ -30,12 +30,13 @@
|
|
|
30
30
|
color: @color;
|
|
31
31
|
}
|
|
32
32
|
// 各个按钮尺寸的样式Mixins
|
|
33
|
-
.btn-size(@height, @font-size, @padding-vertical, @padding-horizontal, @min-width) {
|
|
33
|
+
.btn-size(@height, @font-size, @padding-vertical, @padding-horizontal, @min-width,@max-width) {
|
|
34
34
|
height: @height;
|
|
35
35
|
min-width: @min-width;
|
|
36
36
|
line-height: calc(@height - (@padding-vertical * 2) - (@btn-border-width * 2));
|
|
37
37
|
font-size: @font-size;
|
|
38
38
|
padding: @padding-vertical @padding-horizontal;
|
|
39
|
+
max-width: @max-width;
|
|
39
40
|
}
|
|
40
41
|
// 圆形按钮不同尺寸的样式Mixins
|
|
41
42
|
.btn-shape-circle-width(@width) {
|
|
@@ -88,11 +88,14 @@
|
|
|
88
88
|
@btn-border-width: var(~'@{button-custom-prefix}-sizing-border', 1px);
|
|
89
89
|
@btn-small-height: var(~'@{button-custom-prefix}-sizing-height-small', 24px); // 小号 高度
|
|
90
90
|
@btn-small-min-width: var(~'@{button-custom-prefix}-sizing-min-width-small', 60px); // 小号 最小宽度
|
|
91
|
+
@btn-small-max-width: var(~'@{button-custom-prefix}-sizing-max-width-small'); // 小号 最大宽度
|
|
91
92
|
@btn-middle-height: var(~'@{button-custom-prefix}-sizing-height-middle', 28px); // 中号 高度 高度配置
|
|
92
93
|
@btn-middle-min-width: var(~'@{button-custom-prefix}-sizing-min-width-middle', 60px); // 中号 最小宽度
|
|
94
|
+
@btn-middle-max-width: var(~'@{button-custom-prefix}-sizing-max-width-middle'); // 中号 最大宽度
|
|
93
95
|
@btn-large-height: var(~'@{button-custom-prefix}-sizing-height-large', 32px); // 大号 高度
|
|
94
96
|
@btn-middle-max-width: var(~'@{button-custom-prefix}-sizing-max-width-middle'); // 中号 最大宽度
|
|
95
97
|
@btn-large-min-width: var(~'@{button-custom-prefix}-sizing-min-width-large', 80px); // 大号 最小宽度
|
|
98
|
+
@btn-large-max-width: var(~'@{button-custom-prefix}-sizing-max-width-large'); // 大号 最大宽度
|
|
96
99
|
@btn-group-dropdown-item-height: var(~'@{button-custom-prefix}--group-dropdown-item-height', 30px);
|
|
97
100
|
@btn-group-dropdown-min-width: var(~'@{button-custom-prefix}-group-dropdown-min-width', 80px);
|
|
98
101
|
|
package/lib/checkbox/group.js
CHANGED
|
@@ -43,7 +43,7 @@ var CheckboxGroup = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
43
43
|
getPrefixCls = _useContext.getPrefixCls,
|
|
44
44
|
prefixCls = _useContext.prefixCls,
|
|
45
45
|
userDefaultProps = _useContext.compDefaultProps;
|
|
46
|
-
var CheckboxProps = (0, _utils.getCompProps)('
|
|
46
|
+
var CheckboxProps = (0, _utils.getCompProps)('CheckboxGroup', userDefaultProps, props); // 多选组属性需要合并一遍用户定义的默认属性
|
|
47
47
|
var checkboxType = CheckboxProps.checkboxType,
|
|
48
48
|
className = CheckboxProps.className,
|
|
49
49
|
style = CheckboxProps.style,
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
@checkbox-default-input-height: var(~'@{checkbox-prefix}-default-input-sizing-height', 14px); // 勾选输入框高度
|
|
34
34
|
@checkbox-default-input-width: var(~'@{checkbox-prefix}-default-input-sizing-width', 14px); // 勾选输入框宽度
|
|
35
35
|
@checkbox-default-input-border-width: var(~'@{checkbox-prefix}-default-input-border-width', 1px); // 勾选输入框边框大小 不需要
|
|
36
|
+
@checkbox-default-input-label-max-width: var(~'@{checkbox-prefix}-default-input-label-max-width'); // 勾选输入框便签文本最大宽度,默认为未设置。
|
|
36
37
|
@checkbox-square-triangle-height: var(~'@{checkbox-prefix}-square-triangle-sizing-height', 18px); // 边框类型右下角三角高度
|
|
37
38
|
@checkbox-square-triangle-width: var(~'@{checkbox-prefix}-square-triangle-sizing-width', 18px); // 边框类型右下角三角宽度
|
|
38
39
|
@checkbox-default-indeterminate-square: var(~'@{checkbox-prefix}-default-indeterminate-sizing-square', 6px); // 半选框的大小
|
|
@@ -116,6 +116,9 @@
|
|
|
116
116
|
.kd-collapse-panel:last-child {
|
|
117
117
|
border-top: none;
|
|
118
118
|
}
|
|
119
|
+
.kd-collapse-panel:first-child {
|
|
120
|
+
border-top: var(--kd-c-collapse-border-width, 1px) solid var(--kd-c-collapse-color-border-strong-2, var(--kd-g-color-border-strong-2, #d9d9d9));
|
|
121
|
+
}
|
|
119
122
|
.kd-collapse-panel {
|
|
120
123
|
display: -webkit-inline-box;
|
|
121
124
|
display: -ms-inline-flexbox;
|
package/lib/dropdown/dropdown.js
CHANGED
|
@@ -17,6 +17,7 @@ var _ConfigContext = _interopRequireDefault(require("../config-provider/ConfigCo
|
|
|
17
17
|
var _utils = require("../_utils");
|
|
18
18
|
var _menu = require("./menu");
|
|
19
19
|
var _usePopper = _interopRequireDefault(require("../_utils/usePopper"));
|
|
20
|
+
var _reactNode = require("../_utils/reactNode");
|
|
20
21
|
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
23
|
var findItem = function findItem(element) {
|
|
@@ -71,9 +72,9 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
71
72
|
children.props.onBlur && children.props.onBlur(e);
|
|
72
73
|
handleVisibleChange(false);
|
|
73
74
|
}
|
|
74
|
-
}) : children) : /*#__PURE__*/React.cloneElement(React.
|
|
75
|
-
ref: children.ref
|
|
76
|
-
className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), children.props.className, {
|
|
75
|
+
}) : children) : /*#__PURE__*/React.cloneElement( /*#__PURE__*/React.isValidElement(children) && !(0, _reactNode.isFragment)(children) ? children : /*#__PURE__*/React.createElement("span", null, children), {
|
|
76
|
+
ref: /*#__PURE__*/React.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.ref ? children.ref : ref,
|
|
77
|
+
className: (0, _classnames.default)("".concat(prefixCls, "-trigger"), /*#__PURE__*/React.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.props && children.props.className, {
|
|
77
78
|
disabled: disabled
|
|
78
79
|
})
|
|
79
80
|
});
|
|
@@ -145,6 +145,7 @@
|
|
|
145
145
|
white-space: nowrap;
|
|
146
146
|
overflow: hidden;
|
|
147
147
|
text-overflow: ellipsis;
|
|
148
|
+
display: block;
|
|
148
149
|
}
|
|
149
150
|
.kd-filter .kd-filter-header-search {
|
|
150
151
|
min-width: 200px;
|
|
@@ -240,6 +241,7 @@
|
|
|
240
241
|
padding: 11px 0 10px;
|
|
241
242
|
color: var(--kd-g-color-text-third, #999);
|
|
242
243
|
line-height: 18px;
|
|
244
|
+
width: var(--kd-c-filter-body-condition-label-width);
|
|
243
245
|
}
|
|
244
246
|
.kd-filter .kd-filter-body-condition-options {
|
|
245
247
|
display: -webkit-box;
|
|
@@ -269,6 +271,10 @@
|
|
|
269
271
|
border: 1px solid transparent;
|
|
270
272
|
cursor: pointer;
|
|
271
273
|
white-space: nowrap;
|
|
274
|
+
max-width: var(--kd-c-filter-body-condition-option-max-width);
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
display: inline-block;
|
|
277
|
+
text-overflow: ellipsis;
|
|
272
278
|
}
|
|
273
279
|
.kd-filter .kd-filter-body-condition-option:not(:last-child) {
|
|
274
280
|
margin-right: 24px;
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
&-item-text {
|
|
37
37
|
max-width: 224px;
|
|
38
38
|
.ellipsis;
|
|
39
|
+
display: block;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -130,6 +131,7 @@
|
|
|
130
131
|
padding: 11px 0 10px;
|
|
131
132
|
color: @color-text-third;
|
|
132
133
|
line-height: 18px;
|
|
134
|
+
width: @filter-body-condition-label-width;
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
&-options {
|
|
@@ -154,6 +156,11 @@
|
|
|
154
156
|
border: 1px solid transparent;
|
|
155
157
|
cursor: pointer;
|
|
156
158
|
white-space: nowrap;
|
|
159
|
+
max-width: @filter-body-condition-option-max-width;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
display: inline-block;
|
|
162
|
+
text-overflow: ellipsis;
|
|
163
|
+
|
|
157
164
|
|
|
158
165
|
&:not(:last-child) {
|
|
159
166
|
margin-right: 24px;
|
|
@@ -26,3 +26,7 @@
|
|
|
26
26
|
@filter-condition-label-font-size: var(~'@{filter-custom-prefix}-condition-label-font-size', @font-size-middle);
|
|
27
27
|
@filter-handle-font-size: var(~'@{filter-custom-prefix}-handle-font-size', @font-size-middle);
|
|
28
28
|
@filter-body-tabs-item-font-size: var(~'@{filter-custom-prefix}-body-tabs-item-font-size', @font-size-middle);
|
|
29
|
+
|
|
30
|
+
//sizing
|
|
31
|
+
@filter-body-condition-label-width: var(~'@{filter-custom-prefix}-body-condition-label-width');
|
|
32
|
+
@filter-body-condition-option-max-width: var(~'@{filter-custom-prefix}-body-condition-option-max-width');
|
package/lib/form/style/index.css
CHANGED
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
@form-field-spacing-margin-bottom: var(~'@{form-prefix}-field-spacing-margin-bottom', 22px);
|
|
20
20
|
@form-field-message-spacing-padding-horizontal: var(~'@{form-prefix}-field-message-spacing-padding-horizontal', 2px);
|
|
21
21
|
@form-field-message-spacing-padding-vertical: var(~'@{form-prefix}-field-message-spacing-padding-vertical', 8px);
|
|
22
|
-
|
|
22
|
+
@form-field-label-spacing-margin-bottom: var(~'@{form-prefix}-field-label-spacing-margin-bottom', 5px);
|