@kdcloudjs/kdesign 1.5.1 → 1.5.2
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/dist/kdesign-complete.less +10 -3
- package/dist/kdesign.css +11 -6
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +238 -146
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/es/anchor/anchor-link.js +0 -6
- package/es/anchor/anchor.js +102 -2
- package/es/avatar/avatar.js +3 -1
- package/es/input/ClearableLabeledInput.js +3 -4
- package/es/input/style/index.css +5 -0
- package/es/input/style/index.less +6 -0
- package/es/select/select.js +1 -1
- package/es/select/style/index.css +5 -5
- package/es/select/style/index.less +1 -1
- package/es/select/style/token.less +3 -2
- package/es/tree/utils/treeUtils.js +1 -1
- package/lib/anchor/anchor-link.js +0 -6
- package/lib/anchor/anchor.js +102 -2
- package/lib/avatar/avatar.js +3 -1
- package/lib/input/ClearableLabeledInput.js +3 -4
- package/lib/input/style/index.css +5 -0
- package/lib/input/style/index.less +6 -0
- package/lib/select/select.js +1 -1
- package/lib/select/style/index.css +5 -5
- package/lib/select/style/index.less +1 -1
- package/lib/select/style/token.less +3 -2
- package/lib/tree/utils/treeUtils.js +1 -1
- package/package.json +1 -1
package/es/anchor/anchor-link.js
CHANGED
|
@@ -41,12 +41,6 @@ var AnchorLink = function AnchorLink(props) {
|
|
|
41
41
|
}, [href, registerLink, prevHref]);
|
|
42
42
|
|
|
43
43
|
var handleClick = function handleClick(e) {
|
|
44
|
-
var anchorElement = document.getElementById(href.replace('#', ''));
|
|
45
|
-
|
|
46
|
-
if (anchorElement) {
|
|
47
|
-
anchorElement.scrollIntoView();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
44
|
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
51
45
|
title: title,
|
|
52
46
|
href: href
|
package/es/anchor/anchor.js
CHANGED
|
@@ -43,6 +43,85 @@ function getOffsetTop(element, container) {
|
|
|
43
43
|
return rect.top;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
function isWindow(obj) {
|
|
47
|
+
return obj !== null && obj !== undefined && obj === obj.window;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getScroll(target, top) {
|
|
51
|
+
var _a;
|
|
52
|
+
|
|
53
|
+
if (typeof window === 'undefined') {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var method = top ? 'scrollTop' : 'scrollLeft';
|
|
58
|
+
var result = 0;
|
|
59
|
+
|
|
60
|
+
if (isWindow(target)) {
|
|
61
|
+
result = target[top ? 'pageYOffset' : 'pageXOffset'];
|
|
62
|
+
} else if (target instanceof Document) {
|
|
63
|
+
result = target.documentElement[method];
|
|
64
|
+
} else if (target) {
|
|
65
|
+
result = target[method];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (target && !isWindow(target) && typeof result !== 'number') {
|
|
69
|
+
result = (_a = (target.ownerDocument || target).documentElement) === null || _a === void 0 ? void 0 : _a[method];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function easeInOutCubic(t, b, c, d) {
|
|
76
|
+
var cc = c - b;
|
|
77
|
+
t /= d / 2;
|
|
78
|
+
|
|
79
|
+
if (t < 1) {
|
|
80
|
+
return cc / 2 * t * t * t + b;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function scrollTo(y) {
|
|
87
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
88
|
+
var _options$getContainer = options.getContainer,
|
|
89
|
+
getContainer = _options$getContainer === void 0 ? function () {
|
|
90
|
+
return window;
|
|
91
|
+
} : _options$getContainer,
|
|
92
|
+
callback = options.callback,
|
|
93
|
+
_options$duration = options.duration,
|
|
94
|
+
duration = _options$duration === void 0 ? 450 : _options$duration;
|
|
95
|
+
var container = getContainer();
|
|
96
|
+
var scrollTop = getScroll(container, true);
|
|
97
|
+
var startTime = Date.now();
|
|
98
|
+
|
|
99
|
+
var frameFunc = function frameFunc() {
|
|
100
|
+
var timestamp = Date.now();
|
|
101
|
+
var time = timestamp - startTime;
|
|
102
|
+
var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
|
103
|
+
|
|
104
|
+
if (isWindow(container)) {
|
|
105
|
+
;
|
|
106
|
+
container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
107
|
+
} else if (container instanceof HTMLDocument || container.constructor.name === 'HTMLDocument') {
|
|
108
|
+
;
|
|
109
|
+
container.documentElement.scrollTop = nextScrollTop;
|
|
110
|
+
} else {
|
|
111
|
+
;
|
|
112
|
+
container.scrollTop = nextScrollTop;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (time < duration) {
|
|
116
|
+
window.requestAnimationFrame(frameFunc);
|
|
117
|
+
} else if (typeof callback === 'function') {
|
|
118
|
+
callback();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
window.requestAnimationFrame(frameFunc);
|
|
123
|
+
}
|
|
124
|
+
|
|
46
125
|
var InternalAnchor = function InternalAnchor(props, ref) {
|
|
47
126
|
var _a;
|
|
48
127
|
|
|
@@ -61,6 +140,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
61
140
|
getCurrentAnchor = anchorProps.getCurrentAnchor,
|
|
62
141
|
_anchorProps$offsetTo = anchorProps.offsetTop,
|
|
63
142
|
offsetTop = _anchorProps$offsetTo === void 0 ? 0 : _anchorProps$offsetTo,
|
|
143
|
+
targetOffset = anchorProps.targetOffset,
|
|
64
144
|
getContainer = anchorProps.getContainer,
|
|
65
145
|
_anchorProps$bounds = anchorProps.bounds,
|
|
66
146
|
bounds = _anchorProps$bounds === void 0 ? 5 : _anchorProps$bounds,
|
|
@@ -265,6 +345,26 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
265
345
|
|
|
266
346
|
var handleScrollTo = function handleScrollTo(link) {
|
|
267
347
|
setCurrentActiveLink(link);
|
|
348
|
+
var container = getScrollContainer();
|
|
349
|
+
var scrollTop = getScroll(container, true);
|
|
350
|
+
var sharpLinkMatch = sharpMatcherRegx.exec(link);
|
|
351
|
+
|
|
352
|
+
if (!sharpLinkMatch) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
var targetElement = document.getElementById(sharpLinkMatch[1]);
|
|
357
|
+
|
|
358
|
+
if (!targetElement) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
var eleOffsetTop = getOffsetTop(targetElement, container);
|
|
363
|
+
var y = scrollTop + eleOffsetTop;
|
|
364
|
+
y -= targetOffset !== undefined ? targetOffset : offsetTop || 0;
|
|
365
|
+
scrollTo(y, {
|
|
366
|
+
getContainer: getScrollContainer
|
|
367
|
+
});
|
|
268
368
|
};
|
|
269
369
|
|
|
270
370
|
var setCurrentActiveLink = useCallback(function (link) {
|
|
@@ -289,9 +389,9 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
289
389
|
}
|
|
290
390
|
}
|
|
291
391
|
|
|
292
|
-
var currentActiveLink = getAnchor(offsetTop || 0, bounds);
|
|
392
|
+
var currentActiveLink = getAnchor(targetOffset !== undefined ? targetOffset : offsetTop || 0, bounds);
|
|
293
393
|
currentActiveLink && setCurrentActiveLink(currentActiveLink);
|
|
294
|
-
}, [affix, setFixedTop, offsetTop, bounds, getAnchor, setCurrentActiveLink, type, getScrollContainer, anchorRef]);
|
|
394
|
+
}, [affix, setFixedTop, offsetTop, bounds, getAnchor, setCurrentActiveLink, type, getScrollContainer, anchorRef, targetOffset]);
|
|
295
395
|
useEffect(function () {
|
|
296
396
|
getScrollContainer().addEventListener('scroll', handleScroll);
|
|
297
397
|
handleScroll();
|
package/es/avatar/avatar.js
CHANGED
|
@@ -32,7 +32,8 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
32
32
|
alt = avatarProps.alt,
|
|
33
33
|
children = avatarProps.children,
|
|
34
34
|
gap = avatarProps.gap,
|
|
35
|
-
disabled = avatarProps.disabled
|
|
35
|
+
disabled = avatarProps.disabled,
|
|
36
|
+
srcSet = avatarProps.srcSet;
|
|
36
37
|
devWarning(AvatarSizes.indexOf(size) === -1 && typeof size !== 'number', 'avatar', "cannot found avatar type '".concat(size, "'"));
|
|
37
38
|
devWarning(AvatarShapes.indexOf(shape) === -1, 'avatar', "cannot found avatar shape '".concat(shape, "'"));
|
|
38
39
|
|
|
@@ -106,6 +107,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
106
107
|
if (typeof src === 'string' && isImgExist) {
|
|
107
108
|
childrenToRender = /*#__PURE__*/React.createElement("img", {
|
|
108
109
|
src: src,
|
|
110
|
+
srcSet: srcSet,
|
|
109
111
|
draggable: draggable,
|
|
110
112
|
onError: handleImgLoadError,
|
|
111
113
|
alt: alt
|
|
@@ -52,7 +52,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
52
52
|
|
|
53
53
|
return /*#__PURE__*/React.createElement("span", {
|
|
54
54
|
className: "".concat(prefixCls, "-suffix")
|
|
55
|
-
}, renderClearIcon(), suffix);
|
|
55
|
+
}, !disabled && renderClearIcon(), suffix);
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
var renderInputWithFixNode = function renderInputWithFixNode(originElement) {
|
|
@@ -76,7 +76,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
var renderInputWithLabel = function renderInputWithLabel(originElement) {
|
|
79
|
-
var _classNames4, _context2, _classNames5
|
|
79
|
+
var _classNames4, _context2, _classNames5;
|
|
80
80
|
|
|
81
81
|
if (!addonBefore && !addonAfter) {
|
|
82
82
|
return originElement;
|
|
@@ -96,8 +96,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
96
96
|
className: inputGroupClasses,
|
|
97
97
|
style: style
|
|
98
98
|
}, addonBeforeNode, /*#__PURE__*/React.cloneElement(originElement, {
|
|
99
|
-
style: null
|
|
100
|
-
className: _concatInstanceProperty(_context3 = "".concat(originElement.props.className || '', " ")).call(_context3, prefixCls, "-wrapper")
|
|
99
|
+
style: null
|
|
101
100
|
}), addonAfterNode));
|
|
102
101
|
};
|
|
103
102
|
|
package/es/input/style/index.css
CHANGED
|
@@ -360,6 +360,11 @@ textarea {
|
|
|
360
360
|
.kd-input-wrapper-focused .kd-input-textarea-clear-icon {
|
|
361
361
|
color: var(--kd-c-input-color-border-focused, var(--kd-g-color-theme, #5582f3));
|
|
362
362
|
}
|
|
363
|
+
.kd-input-wrapper-disabled {
|
|
364
|
+
background-color: var(--kd-c-input-color-background-disabled, var(--kd-g-color-background-contain-disabled, #f5f5f5));
|
|
365
|
+
border-color: var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
|
|
366
|
+
cursor: not-allowed;
|
|
367
|
+
}
|
|
363
368
|
.kd-input-wrapper-textarea {
|
|
364
369
|
width: 100%;
|
|
365
370
|
min-width: 0;
|
|
@@ -126,6 +126,12 @@ textarea {
|
|
|
126
126
|
color: @input-border-color-focused;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
&-disabled {
|
|
131
|
+
background-color: @input-background-color-disabled-inner;
|
|
132
|
+
border-color: @input-border-color-disabled-inner;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
136
|
&-wrapper-textarea {
|
|
131
137
|
.input(@input-prefix-cls);
|
package/es/select/select.js
CHANGED
|
@@ -448,7 +448,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
448
448
|
var selectedVal = multipleRef.current.selectedVal; // 选择器下拉icon样式
|
|
449
449
|
|
|
450
450
|
var arrowIconCls = classNames((_classNames8 = {}, _defineProperty(_classNames8, "".concat(selectPrefixCls, "-icon-arrow"), true), _defineProperty(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), _defineProperty(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), _defineProperty(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames8));
|
|
451
|
-
var iconShow = allowClear && (isMultiple ? mulOptions.length > 0 : selectedVal);
|
|
451
|
+
var iconShow = allowClear && !disabled && (isMultiple ? mulOptions.length > 0 : selectedVal);
|
|
452
452
|
var clearIconCls = classNames(_defineProperty({}, "".concat(selectPrefixCls, "-icon-clear"), true));
|
|
453
453
|
return /*#__PURE__*/React.createElement(React.Fragment, null, iconShow && /*#__PURE__*/React.createElement("span", {
|
|
454
454
|
onClick: handleReset,
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
.kd-select-item-option-disabled {
|
|
429
429
|
color: var(--kd-c-select-item-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
430
430
|
cursor: not-allowed;
|
|
431
|
-
background-color: var(--kd-c-select-item-color-background-disabled,
|
|
431
|
+
background-color: var(--kd-c-select-item-color-background-disabled, #fff);
|
|
432
432
|
}
|
|
433
433
|
.kd-select-size-small {
|
|
434
434
|
min-height: var(--kd-c-select-sizing-height-small, 24px);
|
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
}
|
|
473
473
|
.kd-select-single-disabled {
|
|
474
474
|
background-color: var(--kd-c-select-color-background-disabled, #f5f5f5);
|
|
475
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
475
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
476
476
|
}
|
|
477
477
|
.kd-select-single-disabled:hover {
|
|
478
478
|
cursor: not-allowed;
|
|
@@ -484,13 +484,13 @@
|
|
|
484
484
|
opacity: 1;
|
|
485
485
|
}
|
|
486
486
|
.kd-select-single-text {
|
|
487
|
-
color: #
|
|
487
|
+
color: var(--kd-c-select-single-color-text, var(--kd-g-color-text-primary, #212121));
|
|
488
488
|
overflow: hidden;
|
|
489
489
|
white-space: nowrap;
|
|
490
490
|
text-overflow: ellipsis;
|
|
491
491
|
}
|
|
492
492
|
.kd-select-single-disabled-text {
|
|
493
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
493
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
494
494
|
}
|
|
495
495
|
.kd-select .kd-select-selection-item {
|
|
496
496
|
display: -webkit-inline-box;
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
.kd-select-multiple-disabled {
|
|
565
565
|
cursor: not-allowed;
|
|
566
566
|
background-color: var(--kd-c-select-color-background-disabled, #f5f5f5);
|
|
567
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
567
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
568
568
|
}
|
|
569
569
|
.kd-select-multiple-disabled .kd-select-suffix {
|
|
570
570
|
color: var(--kd-c-select-arrow-icon-color-text-disabled, #b2b2b2);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// color
|
|
7
7
|
@select-dropdown-bg: var(~'@{select-custom-prefix}-dropdown-color-background', @color-background);
|
|
8
|
-
@select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled',
|
|
8
|
+
@select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled', #fff);
|
|
9
9
|
@select-item-active-bg: var(~'@{select-custom-prefix}-color-background', #f5f5f5);
|
|
10
10
|
@select-item-selected-bg: var(~'@{select-custom-prefix}-color-background-selected', @color-theme-3);
|
|
11
11
|
@select-g-color-border: var(~'@{select-custom-prefix}-color-border', @color-input);
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
@select-footer-g-text-color-selected: var(~'@{select-custom-prefix}-footer-color-text-selected', #0e5fd8);
|
|
19
19
|
@select-g-item-text-color-disabled: var(~'@{select-custom-prefix}-item-color-text-disabled', @color-disabled);
|
|
20
20
|
@select-color-background-disabled: var(~'@{select-custom-prefix}-color-background-disabled', #f5f5f5);
|
|
21
|
-
@select-color-text-disabled: var(~'@{select-custom-prefix}-color-text-disabled',
|
|
21
|
+
@select-color-text-disabled: var(~'@{select-custom-prefix}-color-text-disabled', @color-disabled);
|
|
22
22
|
@select-arrow-icon-color-text-disabled: var(~'@{select-custom-prefix}-arrow-icon-color-text-disabled', #b2b2b2);
|
|
23
|
+
@select-single-color-text: var(~'@{select-custom-prefix}-single-color-text', @color-text-primary);
|
|
23
24
|
|
|
24
25
|
// font
|
|
25
26
|
@select-list-font-size: var(~'@{select-custom-prefix}-dropdown-font-size', 12px); // 下拉列表文字大小
|
|
@@ -65,12 +65,6 @@ var AnchorLink = function AnchorLink(props) {
|
|
|
65
65
|
}, [href, registerLink, prevHref]);
|
|
66
66
|
|
|
67
67
|
var handleClick = function handleClick(e) {
|
|
68
|
-
var anchorElement = document.getElementById(href.replace('#', ''));
|
|
69
|
-
|
|
70
|
-
if (anchorElement) {
|
|
71
|
-
anchorElement.scrollIntoView();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
68
|
onClick === null || onClick === void 0 ? void 0 : onClick(e, {
|
|
75
69
|
title: title,
|
|
76
70
|
href: href
|
package/lib/anchor/anchor.js
CHANGED
|
@@ -82,6 +82,85 @@ function getOffsetTop(element, container) {
|
|
|
82
82
|
return rect.top;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
function isWindow(obj) {
|
|
86
|
+
return obj !== null && obj !== undefined && obj === obj.window;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function getScroll(target, top) {
|
|
90
|
+
var _a;
|
|
91
|
+
|
|
92
|
+
if (typeof window === 'undefined') {
|
|
93
|
+
return 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var method = top ? 'scrollTop' : 'scrollLeft';
|
|
97
|
+
var result = 0;
|
|
98
|
+
|
|
99
|
+
if (isWindow(target)) {
|
|
100
|
+
result = target[top ? 'pageYOffset' : 'pageXOffset'];
|
|
101
|
+
} else if (target instanceof Document) {
|
|
102
|
+
result = target.documentElement[method];
|
|
103
|
+
} else if (target) {
|
|
104
|
+
result = target[method];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (target && !isWindow(target) && typeof result !== 'number') {
|
|
108
|
+
result = (_a = (target.ownerDocument || target).documentElement) === null || _a === void 0 ? void 0 : _a[method];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function easeInOutCubic(t, b, c, d) {
|
|
115
|
+
var cc = c - b;
|
|
116
|
+
t /= d / 2;
|
|
117
|
+
|
|
118
|
+
if (t < 1) {
|
|
119
|
+
return cc / 2 * t * t * t + b;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function scrollTo(y) {
|
|
126
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
127
|
+
var _options$getContainer = options.getContainer,
|
|
128
|
+
getContainer = _options$getContainer === void 0 ? function () {
|
|
129
|
+
return window;
|
|
130
|
+
} : _options$getContainer,
|
|
131
|
+
callback = options.callback,
|
|
132
|
+
_options$duration = options.duration,
|
|
133
|
+
duration = _options$duration === void 0 ? 450 : _options$duration;
|
|
134
|
+
var container = getContainer();
|
|
135
|
+
var scrollTop = getScroll(container, true);
|
|
136
|
+
var startTime = Date.now();
|
|
137
|
+
|
|
138
|
+
var frameFunc = function frameFunc() {
|
|
139
|
+
var timestamp = Date.now();
|
|
140
|
+
var time = timestamp - startTime;
|
|
141
|
+
var nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
|
142
|
+
|
|
143
|
+
if (isWindow(container)) {
|
|
144
|
+
;
|
|
145
|
+
container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
146
|
+
} else if (container instanceof HTMLDocument || container.constructor.name === 'HTMLDocument') {
|
|
147
|
+
;
|
|
148
|
+
container.documentElement.scrollTop = nextScrollTop;
|
|
149
|
+
} else {
|
|
150
|
+
;
|
|
151
|
+
container.scrollTop = nextScrollTop;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (time < duration) {
|
|
155
|
+
window.requestAnimationFrame(frameFunc);
|
|
156
|
+
} else if (typeof callback === 'function') {
|
|
157
|
+
callback();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
window.requestAnimationFrame(frameFunc);
|
|
162
|
+
}
|
|
163
|
+
|
|
85
164
|
var InternalAnchor = function InternalAnchor(props, ref) {
|
|
86
165
|
var _a;
|
|
87
166
|
|
|
@@ -100,6 +179,7 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
100
179
|
getCurrentAnchor = anchorProps.getCurrentAnchor,
|
|
101
180
|
_anchorProps$offsetTo = anchorProps.offsetTop,
|
|
102
181
|
offsetTop = _anchorProps$offsetTo === void 0 ? 0 : _anchorProps$offsetTo,
|
|
182
|
+
targetOffset = anchorProps.targetOffset,
|
|
103
183
|
getContainer = anchorProps.getContainer,
|
|
104
184
|
_anchorProps$bounds = anchorProps.bounds,
|
|
105
185
|
bounds = _anchorProps$bounds === void 0 ? 5 : _anchorProps$bounds,
|
|
@@ -312,6 +392,26 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
312
392
|
|
|
313
393
|
var handleScrollTo = function handleScrollTo(link) {
|
|
314
394
|
setCurrentActiveLink(link);
|
|
395
|
+
var container = getScrollContainer();
|
|
396
|
+
var scrollTop = getScroll(container, true);
|
|
397
|
+
var sharpLinkMatch = sharpMatcherRegx.exec(link);
|
|
398
|
+
|
|
399
|
+
if (!sharpLinkMatch) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
var targetElement = document.getElementById(sharpLinkMatch[1]);
|
|
404
|
+
|
|
405
|
+
if (!targetElement) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
var eleOffsetTop = getOffsetTop(targetElement, container);
|
|
410
|
+
var y = scrollTop + eleOffsetTop;
|
|
411
|
+
y -= targetOffset !== undefined ? targetOffset : offsetTop || 0;
|
|
412
|
+
scrollTo(y, {
|
|
413
|
+
getContainer: getScrollContainer
|
|
414
|
+
});
|
|
315
415
|
};
|
|
316
416
|
|
|
317
417
|
var setCurrentActiveLink = (0, _react.useCallback)(function (link) {
|
|
@@ -336,9 +436,9 @@ var InternalAnchor = function InternalAnchor(props, ref) {
|
|
|
336
436
|
}
|
|
337
437
|
}
|
|
338
438
|
|
|
339
|
-
var currentActiveLink = getAnchor(offsetTop || 0, bounds);
|
|
439
|
+
var currentActiveLink = getAnchor(targetOffset !== undefined ? targetOffset : offsetTop || 0, bounds);
|
|
340
440
|
currentActiveLink && setCurrentActiveLink(currentActiveLink);
|
|
341
|
-
}, [affix, setFixedTop, offsetTop, bounds, getAnchor, setCurrentActiveLink, type, getScrollContainer, anchorRef]);
|
|
441
|
+
}, [affix, setFixedTop, offsetTop, bounds, getAnchor, setCurrentActiveLink, type, getScrollContainer, anchorRef, targetOffset]);
|
|
342
442
|
(0, _react.useEffect)(function () {
|
|
343
443
|
getScrollContainer().addEventListener('scroll', handleScroll);
|
|
344
444
|
handleScroll();
|
package/lib/avatar/avatar.js
CHANGED
|
@@ -64,7 +64,8 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
64
64
|
alt = avatarProps.alt,
|
|
65
65
|
children = avatarProps.children,
|
|
66
66
|
gap = avatarProps.gap,
|
|
67
|
-
disabled = avatarProps.disabled
|
|
67
|
+
disabled = avatarProps.disabled,
|
|
68
|
+
srcSet = avatarProps.srcSet;
|
|
68
69
|
(0, _devwarning.default)(AvatarSizes.indexOf(size) === -1 && typeof size !== 'number', 'avatar', "cannot found avatar type '".concat(size, "'"));
|
|
69
70
|
(0, _devwarning.default)(AvatarShapes.indexOf(shape) === -1, 'avatar', "cannot found avatar shape '".concat(shape, "'"));
|
|
70
71
|
|
|
@@ -145,6 +146,7 @@ var InternalAvatar = function InternalAvatar(props, ref) {
|
|
|
145
146
|
if (typeof src === 'string' && isImgExist) {
|
|
146
147
|
childrenToRender = /*#__PURE__*/_react.default.createElement("img", {
|
|
147
148
|
src: src,
|
|
149
|
+
srcSet: srcSet,
|
|
148
150
|
draggable: draggable,
|
|
149
151
|
onError: handleImgLoadError,
|
|
150
152
|
alt: alt
|
|
@@ -69,7 +69,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
69
69
|
|
|
70
70
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
71
71
|
className: "".concat(prefixCls, "-suffix")
|
|
72
|
-
}, renderClearIcon(), suffix);
|
|
72
|
+
}, !disabled && renderClearIcon(), suffix);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
var renderInputWithFixNode = function renderInputWithFixNode(originElement) {
|
|
@@ -93,7 +93,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
93
93
|
};
|
|
94
94
|
|
|
95
95
|
var renderInputWithLabel = function renderInputWithLabel(originElement) {
|
|
96
|
-
var _classNames4, _context2, _classNames5
|
|
96
|
+
var _classNames4, _context2, _classNames5;
|
|
97
97
|
|
|
98
98
|
if (!addonBefore && !addonAfter) {
|
|
99
99
|
return originElement;
|
|
@@ -113,8 +113,7 @@ var ClearableInput = function ClearableInput(props) {
|
|
|
113
113
|
className: inputGroupClasses,
|
|
114
114
|
style: style
|
|
115
115
|
}, addonBeforeNode, /*#__PURE__*/_react.default.cloneElement(originElement, {
|
|
116
|
-
style: null
|
|
117
|
-
className: (0, _concat.default)(_context3 = "".concat(originElement.props.className || '', " ")).call(_context3, prefixCls, "-wrapper")
|
|
116
|
+
style: null
|
|
118
117
|
}), addonAfterNode));
|
|
119
118
|
};
|
|
120
119
|
|
|
@@ -360,6 +360,11 @@ textarea {
|
|
|
360
360
|
.kd-input-wrapper-focused .kd-input-textarea-clear-icon {
|
|
361
361
|
color: var(--kd-c-input-color-border-focused, var(--kd-g-color-theme, #5582f3));
|
|
362
362
|
}
|
|
363
|
+
.kd-input-wrapper-disabled {
|
|
364
|
+
background-color: var(--kd-c-input-color-background-disabled, var(--kd-g-color-background-contain-disabled, #f5f5f5));
|
|
365
|
+
border-color: var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
|
|
366
|
+
cursor: not-allowed;
|
|
367
|
+
}
|
|
363
368
|
.kd-input-wrapper-textarea {
|
|
364
369
|
width: 100%;
|
|
365
370
|
min-width: 0;
|
|
@@ -126,6 +126,12 @@ textarea {
|
|
|
126
126
|
color: @input-border-color-focused;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
&-disabled {
|
|
131
|
+
background-color: @input-background-color-disabled-inner;
|
|
132
|
+
border-color: @input-border-color-disabled-inner;
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
}
|
|
129
135
|
}
|
|
130
136
|
&-wrapper-textarea {
|
|
131
137
|
.input(@input-prefix-cls);
|
package/lib/select/select.js
CHANGED
|
@@ -476,7 +476,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
476
476
|
var selectedVal = multipleRef.current.selectedVal; // 选择器下拉icon样式
|
|
477
477
|
|
|
478
478
|
var arrowIconCls = (0, _classnames.default)((_classNames8 = {}, (0, _defineProperty2.default)(_classNames8, "".concat(selectPrefixCls, "-icon-arrow"), true), (0, _defineProperty2.default)(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-up"), optionShow), (0, _defineProperty2.default)(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-down"), !optionShow), (0, _defineProperty2.default)(_classNames8, "".concat(selectPrefixCls, "-icon-arrow-focus"), optionShow), _classNames8));
|
|
479
|
-
var iconShow = allowClear && (isMultiple ? mulOptions.length > 0 : selectedVal);
|
|
479
|
+
var iconShow = allowClear && !disabled && (isMultiple ? mulOptions.length > 0 : selectedVal);
|
|
480
480
|
var clearIconCls = (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(selectPrefixCls, "-icon-clear"), true));
|
|
481
481
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconShow && /*#__PURE__*/_react.default.createElement("span", {
|
|
482
482
|
onClick: handleReset,
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
.kd-select-item-option-disabled {
|
|
429
429
|
color: var(--kd-c-select-item-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
430
430
|
cursor: not-allowed;
|
|
431
|
-
background-color: var(--kd-c-select-item-color-background-disabled,
|
|
431
|
+
background-color: var(--kd-c-select-item-color-background-disabled, #fff);
|
|
432
432
|
}
|
|
433
433
|
.kd-select-size-small {
|
|
434
434
|
min-height: var(--kd-c-select-sizing-height-small, 24px);
|
|
@@ -472,7 +472,7 @@
|
|
|
472
472
|
}
|
|
473
473
|
.kd-select-single-disabled {
|
|
474
474
|
background-color: var(--kd-c-select-color-background-disabled, #f5f5f5);
|
|
475
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
475
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
476
476
|
}
|
|
477
477
|
.kd-select-single-disabled:hover {
|
|
478
478
|
cursor: not-allowed;
|
|
@@ -484,13 +484,13 @@
|
|
|
484
484
|
opacity: 1;
|
|
485
485
|
}
|
|
486
486
|
.kd-select-single-text {
|
|
487
|
-
color: #
|
|
487
|
+
color: var(--kd-c-select-single-color-text, var(--kd-g-color-text-primary, #212121));
|
|
488
488
|
overflow: hidden;
|
|
489
489
|
white-space: nowrap;
|
|
490
490
|
text-overflow: ellipsis;
|
|
491
491
|
}
|
|
492
492
|
.kd-select-single-disabled-text {
|
|
493
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
493
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
494
494
|
}
|
|
495
495
|
.kd-select .kd-select-selection-item {
|
|
496
496
|
display: -webkit-inline-box;
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
.kd-select-multiple-disabled {
|
|
565
565
|
cursor: not-allowed;
|
|
566
566
|
background-color: var(--kd-c-select-color-background-disabled, #f5f5f5);
|
|
567
|
-
color: var(--kd-c-select-color-text-disabled, #
|
|
567
|
+
color: var(--kd-c-select-color-text-disabled, var(--kd-g-color-disabled, #b2b2b2));
|
|
568
568
|
}
|
|
569
569
|
.kd-select-multiple-disabled .kd-select-suffix {
|
|
570
570
|
color: var(--kd-c-select-arrow-icon-color-text-disabled, #b2b2b2);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// color
|
|
7
7
|
@select-dropdown-bg: var(~'@{select-custom-prefix}-dropdown-color-background', @color-background);
|
|
8
|
-
@select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled',
|
|
8
|
+
@select-disabled-option-bg: var(~'@{select-custom-prefix}-item-color-background-disabled', #fff);
|
|
9
9
|
@select-item-active-bg: var(~'@{select-custom-prefix}-color-background', #f5f5f5);
|
|
10
10
|
@select-item-selected-bg: var(~'@{select-custom-prefix}-color-background-selected', @color-theme-3);
|
|
11
11
|
@select-g-color-border: var(~'@{select-custom-prefix}-color-border', @color-input);
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
@select-footer-g-text-color-selected: var(~'@{select-custom-prefix}-footer-color-text-selected', #0e5fd8);
|
|
19
19
|
@select-g-item-text-color-disabled: var(~'@{select-custom-prefix}-item-color-text-disabled', @color-disabled);
|
|
20
20
|
@select-color-background-disabled: var(~'@{select-custom-prefix}-color-background-disabled', #f5f5f5);
|
|
21
|
-
@select-color-text-disabled: var(~'@{select-custom-prefix}-color-text-disabled',
|
|
21
|
+
@select-color-text-disabled: var(~'@{select-custom-prefix}-color-text-disabled', @color-disabled);
|
|
22
22
|
@select-arrow-icon-color-text-disabled: var(~'@{select-custom-prefix}-arrow-icon-color-text-disabled', #b2b2b2);
|
|
23
|
+
@select-single-color-text: var(~'@{select-custom-prefix}-single-color-text', @color-text-primary);
|
|
23
24
|
|
|
24
25
|
// font
|
|
25
26
|
@select-list-font-size: var(~'@{select-custom-prefix}-dropdown-font-size', 12px); // 下拉列表文字大小
|