@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/lib/input/input.js
CHANGED
|
@@ -83,8 +83,7 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
83
83
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
84
84
|
showNumberMark = _useState4[0],
|
|
85
85
|
setShowNumberMark = _useState4[1];
|
|
86
|
-
var
|
|
87
|
-
var inputRef = ref || thisInputRef;
|
|
86
|
+
var inputRef = (0, _react.useRef)();
|
|
88
87
|
var inputPrefixCls = getPrefixCls(prefixCls, 'input', customPrefixcls); // 按钮样式前缀
|
|
89
88
|
var addonBefore = others.addonBefore,
|
|
90
89
|
addonAfter = others.addonAfter;
|
|
@@ -163,6 +162,25 @@ var InternalInput = function InternalInput(props, ref) {
|
|
|
163
162
|
setShowNumberMark(false);
|
|
164
163
|
}
|
|
165
164
|
}, [focused]);
|
|
165
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
166
|
+
return {
|
|
167
|
+
input: inputRef.current,
|
|
168
|
+
focus: function focus() {
|
|
169
|
+
var _a;
|
|
170
|
+
setFocused(true);
|
|
171
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
172
|
+
},
|
|
173
|
+
blur: function blur() {
|
|
174
|
+
var _a;
|
|
175
|
+
setFocused(false);
|
|
176
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
177
|
+
},
|
|
178
|
+
select: function select() {
|
|
179
|
+
var _a;
|
|
180
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
});
|
|
166
184
|
return /*#__PURE__*/_react.default.createElement(_ClearableLabeledInput.default, (0, _extends2.default)({}, inputProps, {
|
|
167
185
|
handleReset: handleReset,
|
|
168
186
|
value: value,
|
|
@@ -84,6 +84,9 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
84
84
|
return true;
|
|
85
85
|
};
|
|
86
86
|
(0, _react.useEffect)(function () {
|
|
87
|
+
if (typeof value === 'undefined') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
87
90
|
setInputValue((0, _numberUtil.serialization)(value + ''));
|
|
88
91
|
}, [value]);
|
|
89
92
|
var handleEventAttachValue = function handleEventAttachValue(event, value) {
|
|
@@ -252,6 +255,9 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
252
255
|
inputStatus.current.inputFocused = false;
|
|
253
256
|
};
|
|
254
257
|
(0, _react.useEffect)(function () {
|
|
258
|
+
if (typeof value === 'undefined') {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
255
261
|
var _inputStatus$current = inputStatus.current,
|
|
256
262
|
isHandleChange = _inputStatus$current.isHandleChange,
|
|
257
263
|
inputFocused = _inputStatus$current.inputFocused;
|
package/lib/menu/menu.js
CHANGED
|
@@ -41,10 +41,10 @@ var openSubMenuSet = new _set.default();
|
|
|
41
41
|
var Menu = function Menu(props) {
|
|
42
42
|
var _context2, _classNames;
|
|
43
43
|
var _a;
|
|
44
|
-
var
|
|
45
|
-
getPrefixCls =
|
|
46
|
-
pkgPrefixCls =
|
|
47
|
-
userDefaultProps =
|
|
44
|
+
var _useContext = (0, _react.useContext)(_configProvider.ConfigContext),
|
|
45
|
+
getPrefixCls = _useContext.getPrefixCls,
|
|
46
|
+
pkgPrefixCls = _useContext.prefixCls,
|
|
47
|
+
userDefaultProps = _useContext.compDefaultProps;
|
|
48
48
|
var userSelectedKey = props.selectedKey,
|
|
49
49
|
userOpenKeys = props.openKeys;
|
|
50
50
|
var _b = (0, _utils.getCompProps)('Menu', userDefaultProps, props),
|
|
@@ -60,22 +60,23 @@ var Menu = function Menu(props) {
|
|
|
60
60
|
theme = _b.theme,
|
|
61
61
|
collapsed = _b.collapsed,
|
|
62
62
|
accordion = _b.accordion,
|
|
63
|
-
|
|
63
|
+
defaultOpenKeys = _b.defaultOpenKeys,
|
|
64
|
+
restProps = __rest(_b, ["prefixCls", "mode", "inlineIndent", "forceSubMenuRender", "additionalTools", "onClick", "onOpenChange", "children", "className", "theme", "collapsed", "accordion", "defaultOpenKeys"]);
|
|
64
65
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'menu', customPrefixcls);
|
|
65
66
|
(0, _devwarning.default)(['inline', 'vertical', undefined].indexOf(mode) === -1, 'menu', "cannot found menu mode '".concat(mode, "'"));
|
|
66
67
|
(0, _devwarning.default)(mode !== 'inline' && accordion !== undefined, 'menu', "'accordion' is valid only in mode='inline'");
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
selectedKey =
|
|
70
|
-
setSelectedKey =
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
selectedKeyPath =
|
|
74
|
-
setSelectedKeyPath =
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
openKeys =
|
|
78
|
-
setOpenKeys =
|
|
68
|
+
var _useState = (0, _react.useState)(''),
|
|
69
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
70
|
+
selectedKey = _useState2[0],
|
|
71
|
+
setSelectedKey = _useState2[1];
|
|
72
|
+
var _useState3 = (0, _react.useState)([]),
|
|
73
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
74
|
+
selectedKeyPath = _useState4[0],
|
|
75
|
+
setSelectedKeyPath = _useState4[1];
|
|
76
|
+
var _useState5 = (0, _react.useState)([]),
|
|
77
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
78
|
+
openKeys = _useState6[0],
|
|
79
|
+
setOpenKeys = _useState6[1];
|
|
79
80
|
if (mode === 'inline') {
|
|
80
81
|
restProps.triggerSubMenuAction = 'click';
|
|
81
82
|
}
|
|
@@ -90,6 +91,14 @@ var Menu = function Menu(props) {
|
|
|
90
91
|
setSelectedKey(userSelectedKey);
|
|
91
92
|
}
|
|
92
93
|
}, [userSelectedKey]);
|
|
94
|
+
(0, _react.useEffect)(function () {
|
|
95
|
+
if (Array.isArray(defaultOpenKeys)) {
|
|
96
|
+
setOpenKeys(defaultOpenKeys);
|
|
97
|
+
defaultOpenKeys.forEach(function (d) {
|
|
98
|
+
openSubMenuSet.add(d);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
93
102
|
(0, _react.useEffect)(function () {
|
|
94
103
|
if (userOpenKeys !== undefined && Array.isArray(userOpenKeys)) {
|
|
95
104
|
setOpenKeys(userOpenKeys);
|
package/lib/menu/style/index.css
CHANGED
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
/* 单行显示省略号 */
|
|
108
108
|
/** 浮层箭头样式 **/
|
|
109
109
|
.menu-hidden {
|
|
110
|
+
display: none;
|
|
110
111
|
opacity: 0;
|
|
111
112
|
visibility: hidden;
|
|
112
113
|
-webkit-animation: kdZoomTopLeftOut calc(var(--kd-c-menu-motion-duration, var(--kd-g-duration, 0.3s)) - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
@@ -191,7 +192,8 @@
|
|
|
191
192
|
position: relative;
|
|
192
193
|
width: 100%;
|
|
193
194
|
height: 100%;
|
|
194
|
-
min-width: 138px;
|
|
195
|
+
min-width: var(--kd-c-menu-sizing-min-width, 138px);
|
|
196
|
+
max-width: var(--kd-c-menu-sizing-max-width);
|
|
195
197
|
background-color: var(--kd-c-menu-color-background, #343848);
|
|
196
198
|
color: var(--kd-c-menu-sub-color-text, rgba(255, 255, 255, 0.65));
|
|
197
199
|
}
|
|
@@ -534,6 +536,7 @@
|
|
|
534
536
|
color: var(--kd-c-menu-sub-color-text-hover, var(--kd-g-color-white, #fff));
|
|
535
537
|
}
|
|
536
538
|
.kd-menu-popper.hidden {
|
|
539
|
+
display: none;
|
|
537
540
|
opacity: 0;
|
|
538
541
|
visibility: hidden;
|
|
539
542
|
-webkit-animation: kdZoomTopLeftOut calc(var(--kd-c-menu-motion-duration, var(--kd-g-duration, 0.3s)) - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
@@ -575,6 +578,7 @@
|
|
|
575
578
|
transition-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
|
|
576
579
|
}
|
|
577
580
|
.kd-menu-popper .kd-menu-submenu-sub-hide {
|
|
581
|
+
display: none;
|
|
578
582
|
opacity: 0;
|
|
579
583
|
visibility: hidden;
|
|
580
584
|
-webkit-animation: kdZoomTopLeftOut calc(var(--kd-c-menu-motion-duration, var(--kd-g-duration, 0.3s)) - 0.1s) cubic-bezier(0, 0.4, 0.4, 1) forwards;
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
position: relative;
|
|
11
11
|
width: 100%;
|
|
12
12
|
height: 100%;
|
|
13
|
-
min-width:
|
|
13
|
+
min-width: @menu-min-width;
|
|
14
|
+
max-width: @menu-max-width;
|
|
14
15
|
background-color: @menu-color-background;
|
|
15
16
|
color: @menu-sub-color;
|
|
16
17
|
}
|
|
@@ -79,6 +80,7 @@
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
.menu-hidden {
|
|
83
|
+
display: none;
|
|
82
84
|
opacity: 0;
|
|
83
85
|
visibility: hidden;
|
|
84
86
|
animation: kdZoomTopLeftOut calc(@menu-motion-duration - 0.1s) cubic-bezier(0, .4, .4, 1) forwards;
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
@menu-motion-duration: var(~'@{menu-prefix}-motion-duration', @duration-promptly);
|
|
26
26
|
|
|
27
27
|
// sizing
|
|
28
|
+
@menu-max-width: var(~'@{menu-prefix}-sizing-max-width');
|
|
29
|
+
@menu-min-width: var(~'@{menu-prefix}-sizing-min-width',138px);
|
|
28
30
|
@menu-item-height: var(~'@{menu-prefix}-item-sizing-height', 50px);
|
|
29
31
|
|
|
30
32
|
// z-index
|
|
@@ -125,6 +125,8 @@
|
|
|
125
125
|
vertical-align: middle;
|
|
126
126
|
color: var(--kd-c-radio-color-font, var(--kd-g-color-text-primary, #212121));
|
|
127
127
|
font-size: var(--kd-c-radio-font-size, var(--kd-g-font-size-small, 12px));
|
|
128
|
+
max-width: var(--kd-c-radio-default-label-max-width);
|
|
129
|
+
overflow: hidden;
|
|
128
130
|
}
|
|
129
131
|
.kd-radio::before {
|
|
130
132
|
position: absolute;
|
|
@@ -256,6 +258,7 @@
|
|
|
256
258
|
border: var(--kd-c-radio-radius-border-width, 1px) solid var(--kd-c-radio-color-border, var(--kd-g-color-border-strong, #d9d9d9));
|
|
257
259
|
-webkit-transition: all 0.3s;
|
|
258
260
|
transition: all 0.3s;
|
|
261
|
+
max-width: var(--kd-c-radio-square-label-max-width);
|
|
259
262
|
}
|
|
260
263
|
.kd-radio-square::after {
|
|
261
264
|
position: absolute;
|
|
@@ -348,6 +351,9 @@
|
|
|
348
351
|
list-style: none;
|
|
349
352
|
-webkit-font-feature-settings: 'tnum';
|
|
350
353
|
font-feature-settings: 'tnum';
|
|
354
|
+
white-space: nowrap;
|
|
355
|
+
overflow: hidden;
|
|
356
|
+
text-overflow: ellipsis;
|
|
351
357
|
position: relative;
|
|
352
358
|
display: inline-block;
|
|
353
359
|
height: var(--kd-c-radio-square-sizing-height, 32px);
|
|
@@ -365,6 +371,7 @@
|
|
|
365
371
|
border-left: none;
|
|
366
372
|
-webkit-transition: all 0.3s;
|
|
367
373
|
transition: all 0.3s;
|
|
374
|
+
max-width: var(--kd-c-radio-button-label-max-width);
|
|
368
375
|
}
|
|
369
376
|
.kd-radio-button:first-child {
|
|
370
377
|
border-radius: 2px 0 0 2px;
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
vertical-align: middle;
|
|
23
23
|
color: @radio-font-color;
|
|
24
24
|
font-size: @radio-font-size;
|
|
25
|
+
max-width: @radio-default-label-max-width;
|
|
26
|
+
overflow: hidden;
|
|
25
27
|
|
|
26
28
|
&::before {
|
|
27
29
|
position: absolute;
|
|
@@ -152,6 +154,7 @@
|
|
|
152
154
|
border-radius: @radius-size;
|
|
153
155
|
border: @radio-border-width solid @radio-color-border;
|
|
154
156
|
transition: all @transition-duration;
|
|
157
|
+
max-width: @radio-square-label-max-width;
|
|
155
158
|
|
|
156
159
|
&::after {
|
|
157
160
|
position: absolute;
|
|
@@ -241,7 +244,7 @@
|
|
|
241
244
|
// 按钮类型(切换按钮)
|
|
242
245
|
.@{radio-button-prefix-cls} {
|
|
243
246
|
.reset-component();
|
|
244
|
-
|
|
247
|
+
.ellipsis();
|
|
245
248
|
// 默认状态
|
|
246
249
|
position: relative;
|
|
247
250
|
display: inline-block;
|
|
@@ -259,6 +262,7 @@
|
|
|
259
262
|
border: @radio-border-width solid @radio-color-border;
|
|
260
263
|
border-left: none;
|
|
261
264
|
transition: all @transition-duration;
|
|
265
|
+
max-width: @radio-button-label-max-width;
|
|
262
266
|
|
|
263
267
|
&:first-child {
|
|
264
268
|
border-radius: @radius-size 0 0 @radius-size;
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
// sizing
|
|
23
23
|
@radio-circle-size:var(~'@{radio-prefix}-square-sizing-width-height',14px);//单选图标大小
|
|
24
24
|
@radio-square-height: var(~'@{radio-prefix}-square-sizing-height',32px);//单选框 高度
|
|
25
|
+
@radio-default-label-max-width: var(~'@{radio-prefix}-default-label-max-width');//单选默认模式 最大宽度
|
|
26
|
+
@radio-square-label-max-width: var(~'@{radio-prefix}-square-label-max-width');//单选框模式 最大宽度
|
|
27
|
+
@radio-button-label-max-width: var(~'@{radio-prefix}-button-label-max-width');//单选按 最大宽度
|
|
25
28
|
|
|
26
29
|
// spacing
|
|
27
30
|
@radio-margin-right: var(~'@{radio-prefix}-spacing-margin-right',8px);
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
@search-panel-height: var(~'@{search-prefix}-panel-sizing-height', 60px);
|
|
15
15
|
@quick-search-dropdown-option-height: var(~'@{search-prefix}-dropdown-option-sizing-height', 32px);
|
|
16
16
|
@search-sizing-border-width: var(~'@{search-prefix}-sizing-border-width', 1px);
|
|
17
|
+
@search-tag-max-width: var(~'@{search-prefix}-tag-sizing-max-width');
|
|
17
18
|
|
|
18
19
|
// color
|
|
19
20
|
@search-icon-color: var(~'@{search-prefix}-icon-color', #B2B2B2);
|
package/lib/select/select.js
CHANGED
|
@@ -85,8 +85,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
85
85
|
initValue = _useMergedState2[0],
|
|
86
86
|
setInitValue = _useMergedState2[1];
|
|
87
87
|
var realChildren = Array.isArray(options) ? options : (0, _reactChildren.toArray)(children); // options配置项和默认children
|
|
88
|
-
var
|
|
89
|
-
var selectRef = ref || innerRef;
|
|
88
|
+
var selectRef = (0, _react.useRef)();
|
|
90
89
|
var searchRef = (0, _react.useRef)(null); // 搜索框ref
|
|
91
90
|
var selectionRef = (0, _react.useRef)(null);
|
|
92
91
|
var dropDownRef = (0, _react.useRef)(null);
|
|
@@ -754,6 +753,21 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
754
753
|
(_a = clearRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseup', fn);
|
|
755
754
|
};
|
|
756
755
|
}, [singleVal, mulOptions]);
|
|
756
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
757
|
+
return {
|
|
758
|
+
select: selectRef.current,
|
|
759
|
+
focus: function focus() {
|
|
760
|
+
var _a;
|
|
761
|
+
setFocusd(true);
|
|
762
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
763
|
+
},
|
|
764
|
+
blur: function blur() {
|
|
765
|
+
var _a;
|
|
766
|
+
setFocusd(false);
|
|
767
|
+
(_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
});
|
|
757
771
|
var _useState13 = (0, _react.useState)(isShowSearch ? getActiveIndex(0) : -1),
|
|
758
772
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
759
773
|
activeIndex = _useState14[0],
|
package/lib/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/lib/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/lib/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/lib/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);
|
|
@@ -55,6 +55,7 @@ var TimelineItem = function TimelineItem(props) {
|
|
|
55
55
|
var labelStyle = mode !== 'alternate' ? (0, _defineProperty2.default)({
|
|
56
56
|
width: "".concat(labelWidth, "px")
|
|
57
57
|
}, (0, _concat.default)(_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")) : {};
|
|
58
|
+
var marginDistance = pending ? Math.round(lineHeight / 2 + 12 / 2 + 2) : Math.round(lineHeight / 2 + 9 / 2 + 2);
|
|
58
59
|
return /*#__PURE__*/React.createElement("li", (0, _extends2.default)({}, restProps, {
|
|
59
60
|
className: itemClassName
|
|
60
61
|
}), label && /*#__PURE__*/React.createElement("div", {
|
|
@@ -65,7 +66,7 @@ var TimelineItem = function TimelineItem(props) {
|
|
|
65
66
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
66
67
|
className: "".concat(prefixCls, "-tail"),
|
|
67
68
|
style: {
|
|
68
|
-
marginTop:
|
|
69
|
+
marginTop: marginDistance
|
|
69
70
|
}
|
|
70
71
|
}), /*#__PURE__*/React.createElement("div", {
|
|
71
72
|
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/lib/tooltip/tooltip.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.default = void 0;
|
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _utils = require("../_utils");
|
|
14
|
+
var _reactNode = require("../_utils/reactNode");
|
|
14
15
|
var _configProvider = require("../config-provider");
|
|
15
16
|
var _usePopper = _interopRequireDefault(require("../_utils/usePopper"));
|
|
16
17
|
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); }
|
|
@@ -28,8 +29,8 @@ var Tooltip = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
28
29
|
customPrefixcls = allProps.prefixCls;
|
|
29
30
|
// className前缀
|
|
30
31
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'tooltip', customPrefixcls);
|
|
31
|
-
var tiplocator = /*#__PURE__*/_react.default.cloneElement(_react.default.
|
|
32
|
-
ref: children.ref
|
|
32
|
+
var tiplocator = /*#__PURE__*/_react.default.cloneElement( /*#__PURE__*/_react.default.isValidElement(children) && !(0, _reactNode.isFragment)(children) ? children : /*#__PURE__*/_react.default.createElement("span", null, children), {
|
|
33
|
+
ref: /*#__PURE__*/_react.default.isValidElement(children) && !(0, _reactNode.isFragment)(children) && children.ref ? children.ref : ref
|
|
33
34
|
});
|
|
34
35
|
var onVisibleChange = function onVisibleChange(v) {
|
|
35
36
|
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/lib/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%;
|
|
@@ -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/lib/tree/tree.js
CHANGED
|
@@ -438,7 +438,14 @@ var InternalTree = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
438
438
|
return item === null || item === void 0 ? void 0 : item.key;
|
|
439
439
|
},
|
|
440
440
|
height: height,
|
|
441
|
-
itemHeight: estimatedItemSize
|
|
441
|
+
itemHeight: estimatedItemSize,
|
|
442
|
+
outerStyle: {
|
|
443
|
+
overflow: 'unset'
|
|
444
|
+
},
|
|
445
|
+
innerStyle: {
|
|
446
|
+
minWidth: '100%',
|
|
447
|
+
width: 'max-contnet'
|
|
448
|
+
}
|
|
442
449
|
}, renderTreeNode) : (0, _map.default)(filterData).call(filterData, renderTreeNode)));
|
|
443
450
|
});
|
|
444
451
|
var Tree = InternalTree;
|
|
@@ -16,7 +16,8 @@ var Filler = function Filler(_ref) {
|
|
|
16
16
|
var height = _ref.height,
|
|
17
17
|
offset = _ref.offset,
|
|
18
18
|
children = _ref.children,
|
|
19
|
-
propsOuterStyle = _ref.outerStyle
|
|
19
|
+
propsOuterStyle = _ref.outerStyle,
|
|
20
|
+
propsInnerStyle = _ref.innerStyle;
|
|
20
21
|
var outerStyle = {};
|
|
21
22
|
var innerStyle = {
|
|
22
23
|
display: 'flex',
|
|
@@ -29,13 +30,13 @@ var Filler = function Filler(_ref) {
|
|
|
29
30
|
overflow: 'hidden',
|
|
30
31
|
zIndex: 0
|
|
31
32
|
}, propsOuterStyle);
|
|
32
|
-
innerStyle = (0, _extends2.default)((0, _extends2.default)({}, innerStyle), {
|
|
33
|
+
innerStyle = (0, _extends2.default)((0, _extends2.default)((0, _extends2.default)({}, innerStyle), {
|
|
33
34
|
transform: "translateY(".concat(offset, "px)"),
|
|
34
35
|
position: 'absolute',
|
|
35
36
|
left: 0,
|
|
36
37
|
right: 0,
|
|
37
38
|
top: 0
|
|
38
|
-
});
|
|
39
|
+
}), propsInnerStyle);
|
|
39
40
|
}
|
|
40
41
|
return /*#__PURE__*/React.createElement("div", {
|
|
41
42
|
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'>;
|