@kdcloudjs/kdesign 1.5.1 → 1.5.4

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.
Files changed (66) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/kdesign-complete.less +20 -6
  3. package/dist/kdesign.css +23 -9
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +357 -219
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +8 -8
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/anchor/anchor-link.js +0 -6
  11. package/es/anchor/anchor.js +102 -2
  12. package/es/avatar/avatar.js +3 -1
  13. package/es/drawer/drawer.js +1 -0
  14. package/es/dropdown/dropdown.js +16 -6
  15. package/es/input/ClearableLabeledInput.js +7 -8
  16. package/es/input/style/index.css +10 -0
  17. package/es/input/style/index.less +11 -0
  18. package/es/radio/style/index.css +1 -1
  19. package/es/radio/style/index.less +1 -1
  20. package/es/select/select.js +1 -1
  21. package/es/select/style/index.css +5 -5
  22. package/es/select/style/index.less +1 -1
  23. package/es/select/style/token.less +3 -2
  24. package/es/stepper/stepper.js +9 -4
  25. package/es/stepper/style/index.css +2 -0
  26. package/es/stepper/style/index.less +2 -0
  27. package/es/stepper/style/token.less +1 -2
  28. package/es/style/icon/kdicon.css +2 -1
  29. package/es/style/icon/kdicon.woff +0 -0
  30. package/es/tabs/style/index.css +1 -0
  31. package/es/tabs/style/index.less +1 -0
  32. package/es/tooltip/tooltip.js +1 -1
  33. package/es/tree/tree.js +12 -9
  34. package/es/tree/treeHooks.d.ts +1 -1
  35. package/es/tree/treeHooks.js +3 -3
  36. package/es/tree/utils/treeUtils.d.ts +6 -3
  37. package/es/tree/utils/treeUtils.js +67 -43
  38. package/lib/anchor/anchor-link.js +0 -6
  39. package/lib/anchor/anchor.js +102 -2
  40. package/lib/avatar/avatar.js +3 -1
  41. package/lib/drawer/drawer.js +1 -0
  42. package/lib/dropdown/dropdown.js +15 -6
  43. package/lib/input/ClearableLabeledInput.js +7 -8
  44. package/lib/input/style/index.css +10 -0
  45. package/lib/input/style/index.less +11 -0
  46. package/lib/radio/style/index.css +1 -1
  47. package/lib/radio/style/index.less +1 -1
  48. package/lib/select/select.js +1 -1
  49. package/lib/select/style/index.css +5 -5
  50. package/lib/select/style/index.less +1 -1
  51. package/lib/select/style/token.less +3 -2
  52. package/lib/stepper/stepper.js +9 -4
  53. package/lib/stepper/style/index.css +2 -0
  54. package/lib/stepper/style/index.less +2 -0
  55. package/lib/stepper/style/token.less +1 -2
  56. package/lib/style/icon/kdicon.css +2 -1
  57. package/lib/style/icon/kdicon.woff +0 -0
  58. package/lib/tabs/style/index.css +1 -0
  59. package/lib/tabs/style/index.less +1 -0
  60. package/lib/tooltip/tooltip.js +1 -1
  61. package/lib/tree/tree.js +11 -9
  62. package/lib/tree/treeHooks.d.ts +1 -1
  63. package/lib/tree/treeHooks.js +3 -3
  64. package/lib/tree/utils/treeUtils.d.ts +6 -3
  65. package/lib/tree/utils/treeUtils.js +65 -43
  66. package/package.json +1 -1
@@ -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
@@ -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();
@@ -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
@@ -206,6 +206,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
206
206
  width: width,
207
207
  transform: transform
208
208
  } : {
209
+ height: height,
209
210
  transform: transform
210
211
  });
211
212
 
@@ -7,6 +7,17 @@ import ConfigContext from '../config-provider/ConfigContext';
7
7
  import { getCompProps } from '../_utils';
8
8
  import { Menu, Item } from './menu';
9
9
  import usePopper from '../_utils/usePopper';
10
+
11
+ var findItem = function findItem(element) {
12
+ var isItem = element.className === 'kd-dropdown-menu-item';
13
+
14
+ if (isItem) {
15
+ return element;
16
+ } else {
17
+ return element.parentNode ? findItem(element.parentNode) : null;
18
+ }
19
+ };
20
+
10
21
  var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
22
  var _a, _b, _c;
12
23
 
@@ -37,7 +48,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
37
48
  setVisible(!!props.visible);
38
49
  }, [props.visible]);
39
50
  var child = /*#__PURE__*/React.cloneElement(React.Children.only(children), {
40
- ref: ref,
51
+ ref: children.ref || ref,
41
52
  className: classNames("".concat(prefixCls, "-trigger"), children.props.className, {
42
53
  disabled: disabled
43
54
  })
@@ -55,13 +66,12 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
55
66
  var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
56
67
 
57
68
  var handleItemClick = function handleItemClick(e) {
58
- var _a, _b;
69
+ var _a;
59
70
 
60
- var currentTarget = e.target;
61
- var parentTarget = currentTarget.parentNode;
62
- var key = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.key) || ((_b = currentTarget.parentNode.dataset) === null || _b === void 0 ? void 0 : _b.key);
71
+ var item = findItem(e.target);
72
+ var key = (_a = item === null || item === void 0 ? void 0 : item.dataset) === null || _a === void 0 ? void 0 : _a.key;
63
73
 
64
- if (currentTarget.className.indexOf('disabled') === -1 && parentTarget.className.indexOf('disabled') === -1 && key) {
74
+ if ((item === null || item === void 0 ? void 0 : item.className.indexOf('disabled')) === -1 && key) {
65
75
  if (isMenu && menu.props.onClick) {
66
76
  menu.props.onClick(key);
67
77
  } else if (onItemClick) {
@@ -46,13 +46,13 @@ var ClearableInput = function ClearableInput(props) {
46
46
  };
47
47
 
48
48
  var renderSuffix = function renderSuffix() {
49
- if (!suffix && !allowClear) {
50
- return null;
49
+ if (suffix || !disabled && allowClear) {
50
+ return /*#__PURE__*/React.createElement("span", {
51
+ className: "".concat(prefixCls, "-suffix")
52
+ }, renderClearIcon(), suffix);
51
53
  }
52
54
 
53
- return /*#__PURE__*/React.createElement("span", {
54
- className: "".concat(prefixCls, "-suffix")
55
- }, renderClearIcon(), suffix);
55
+ return null;
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, _context3;
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
 
@@ -360,6 +360,15 @@ 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
+ }
368
+ .kd-input-wrapper-disabled .kd-input-suffix,
369
+ .kd-input-wrapper-disabled .kd-input-prefix {
370
+ color: var(--kd-c-input-color-disabled, var(--kd-g-color-disabled, #b2b2b2));
371
+ }
363
372
  .kd-input-wrapper-textarea {
364
373
  width: 100%;
365
374
  min-width: 0;
@@ -503,6 +512,7 @@ textarea {
503
512
  .kd-input-group-wrapper .kd-input-group .kd-input-group-addon-disabled {
504
513
  background-color: var(--kd-c-input-color-background-disabled, var(--kd-g-color-background-contain-disabled, #f5f5f5));
505
514
  border-color: var(--kd-c-input-color-border-disabled, var(--kd-g-color-border-strong, #d9d9d9));
515
+ color: var(--kd-c-input-color-disabled, var(--kd-g-color-disabled, #b2b2b2));
506
516
  cursor: not-allowed;
507
517
  }
508
518
  .kd-input-group-wrapper .kd-input-group-size-small .kd-input-group-addon {
@@ -126,6 +126,16 @@ 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
+
135
+ .@{input-prefix-cls}-suffix, .@{input-prefix-cls}-prefix {
136
+ color: @input-color-disabled-inner;
137
+ }
138
+ }
129
139
  }
130
140
  &-wrapper-textarea {
131
141
  .input(@input-prefix-cls);
@@ -219,6 +229,7 @@ textarea {
219
229
  &-disabled {
220
230
  background-color: @input-background-color-disabled-inner;
221
231
  border-color: @input-border-color-disabled-inner;
232
+ color: @input-color-disabled-inner;
222
233
  cursor: not-allowed;
223
234
  }
224
235
  }
@@ -407,7 +407,7 @@
407
407
  .kd-radio-button-checked:hover {
408
408
  color: var(--kd-c-radio-color-background, var(--kd-g-color-white, #fff));
409
409
  }
410
- .kd-radio-button-checked::before {
410
+ .kd-radio-button-checked:not(.kd-radio-button-disabled)::before {
411
411
  background-color: var(--kd-c-radio-color-theme, var(--kd-g-color-theme, #5582f3));
412
412
  }
413
413
  .kd-radio-button-checked:first-child {
@@ -312,7 +312,7 @@
312
312
  color: @radio-color-background;
313
313
  }
314
314
 
315
- &::before {
315
+ &:not(.@{radio-button-prefix-cls}-disabled)::before {
316
316
  background-color: @radio-color-theme;
317
317
  }
318
318
 
@@ -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 !== null && selectedVal !== void 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, var(--kd-g-color-background-contain-disabled, #f5f5f5));
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, #212121);
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: #666;
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, #212121);
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, #212121);
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);
@@ -234,7 +234,7 @@
234
234
  opacity: 1;
235
235
  }
236
236
  &-text {
237
- color: #666;
237
+ color: @select-single-color-text;
238
238
  .over();
239
239
  }
240
240
  &-disabled-text {
@@ -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', @color-background-contain-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', #212121);
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); // 下拉列表文字大小
@@ -29,6 +29,7 @@ var InternalStepper = function InternalStepper(props, ref) {
29
29
  stepBtnClassName = inputNumberProps.stepBtnClassName,
30
30
  max = inputNumberProps.max,
31
31
  min = inputNumberProps.min,
32
+ disabled = inputNumberProps.disabled,
32
33
  propsValue = inputNumberProps.value,
33
34
  defaultValue = inputNumberProps.defaultValue;
34
35
  var inputPrefixCls = getPrefixCls(prefixCls, 'inputNumber', customPrefixcls);
@@ -70,10 +71,11 @@ var InternalStepper = function InternalStepper(props, ref) {
70
71
  return null;
71
72
  }
72
73
 
73
- var decreaseClassName = getStepBtnClassNames('base', 'decrease', showPlusdisabled);
74
+ var decreaseClassName = getStepBtnClassNames('base', 'decrease', showPlusdisabled || disabled);
74
75
  return /*#__PURE__*/React.createElement("span", {
75
76
  className: decreaseClassName,
76
77
  onMouseDown: function onMouseDown() {
78
+ if (disabled) return;
77
79
  handleStepMouseDown('minus');
78
80
  }
79
81
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -83,10 +85,11 @@ var InternalStepper = function InternalStepper(props, ref) {
83
85
  };
84
86
 
85
87
  var getStepSuffix = function getStepSuffix() {
86
- var increaseClassName = getStepBtnClassNames('base', 'increase', showMinusdisabled);
88
+ var increaseClassName = getStepBtnClassNames('base', 'increase', showMinusdisabled || disabled);
87
89
  return type === 'embed' ? getEmbedStepView() : /*#__PURE__*/React.createElement("span", {
88
90
  className: increaseClassName,
89
91
  onMouseDown: function onMouseDown() {
92
+ if (disabled) return;
90
93
  handleStepMouseDown('plus');
91
94
  }
92
95
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -183,13 +186,14 @@ var InternalStepper = function InternalStepper(props, ref) {
183
186
  var _classNames2, _classNames3;
184
187
 
185
188
  var embedStepClassName = getStepBtnClassNames('embed');
186
- var plusClassName = classNames("".concat(inputPrefixCls, "-embedStep-plus"), (_classNames2 = {}, _defineProperty(_classNames2, stepBtnClassName, stepBtnClassName), _defineProperty(_classNames2, "".concat(inputPrefixCls, "-embedStep-disabled"), showMinusdisabled), _classNames2));
187
- var minusClassName = classNames("".concat(inputPrefixCls, "-embedStep-minus"), (_classNames3 = {}, _defineProperty(_classNames3, stepBtnClassName, stepBtnClassName), _defineProperty(_classNames3, "".concat(inputPrefixCls, "-embedStep-disabled"), showPlusdisabled), _classNames3));
189
+ var plusClassName = classNames("".concat(inputPrefixCls, "-embedStep-plus"), (_classNames2 = {}, _defineProperty(_classNames2, stepBtnClassName, stepBtnClassName), _defineProperty(_classNames2, "".concat(inputPrefixCls, "-embedStep-disabled"), showMinusdisabled || disabled), _classNames2));
190
+ var minusClassName = classNames("".concat(inputPrefixCls, "-embedStep-minus"), (_classNames3 = {}, _defineProperty(_classNames3, stepBtnClassName, stepBtnClassName), _defineProperty(_classNames3, "".concat(inputPrefixCls, "-embedStep-disabled"), showPlusdisabled || disabled), _classNames3));
188
191
  return /*#__PURE__*/React.createElement("span", {
189
192
  className: embedStepClassName
190
193
  }, /*#__PURE__*/React.createElement("span", {
191
194
  className: plusClassName,
192
195
  onMouseDown: function onMouseDown() {
196
+ if (disabled) return;
193
197
  handleStepMouseDown('plus');
194
198
  }
195
199
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -198,6 +202,7 @@ var InternalStepper = function InternalStepper(props, ref) {
198
202
  })), /*#__PURE__*/React.createElement("span", {
199
203
  className: minusClassName,
200
204
  onMouseDown: function onMouseDown() {
205
+ if (disabled) return;
201
206
  handleStepMouseDown('minus');
202
207
  }
203
208
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -152,6 +152,7 @@
152
152
  }
153
153
  .kd-inputNumber-baseStep-disabled {
154
154
  cursor: not-allowed;
155
+ color: var(--kd-c-stepper-icon-color-disabled, var(--kd-g-color-disabled, #b2b2b2));
155
156
  }
156
157
  .kd-inputNumber-baseStep-disabled .kd-inputNumber-icon {
157
158
  color: unset !important;
@@ -244,6 +245,7 @@
244
245
  }
245
246
  .kd-inputNumber-embedStep-disabled {
246
247
  cursor: not-allowed !important;
248
+ color: var(--kd-c-stepper-icon-color-disabled, var(--kd-g-color-disabled, #b2b2b2));
247
249
  }
248
250
  .kd-inputNumber-embedStep-disabled .kd-inputNumber-icon {
249
251
  color: unset !important;
@@ -53,6 +53,7 @@
53
53
 
54
54
  &-disabled {
55
55
  cursor: not-allowed;
56
+ color: @stepper-icon-color-disabled;
56
57
 
57
58
  .@{inputNumber-prefix-cls}-icon {
58
59
  color: unset !important;
@@ -104,6 +105,7 @@
104
105
 
105
106
  &-disabled {
106
107
  cursor: not-allowed !important;
108
+ color: @stepper-icon-color-disabled;
107
109
 
108
110
  .@{inputNumber-prefix-cls}-icon {
109
111
  color: unset !important;
@@ -7,15 +7,14 @@
7
7
  @stepper-icon-color-hover: var(~'@{stepper-prefix}-icon-color-hover', @color-theme);
8
8
  @stepper-color-border-strong: var(~'@{stepper-prefix}-color-border-strong', @color-border-strong);
9
9
  @stepper-embed-icon-color-background: var(~'@{stepper-prefix}-embed-icon-color-background', transparent);
10
+ @stepper-icon-color-disabled: var(~'@{stepper-prefix}-icon-color-disabled', @color-disabled);
10
11
 
11
12
  // font
12
13
  @stepper-input-font-size: var(~'@{stepper-prefix}-input-font-size', 12px);
13
14
 
14
-
15
15
  // motion
16
16
  @stepper-motion-duration: var(~'@{stepper-prefix}-motion-duration', @duration-promptly);
17
17
 
18
-
19
18
  // sizing
20
19
  @stepper-input-small-sizing-height: var(~'@{stepper-prefix}-input-small-sizing-height', 20px);
21
20
  @stepper-input-middle-sizing-height: var(~'@{stepper-prefix}-input-middle-sizing-height', 28px);
@@ -99,6 +99,7 @@
99
99
  .kdicon-fixed-solid:before { content: "\e65f"; }
100
100
  .kdicon-fixed-window:before { content: "\e6d1"; }
101
101
  .kdicon-fixed:before { content: "\e6e3"; }
102
+ .kdicon-fold:before { content: "\e71d"; }
102
103
  .kdicon-foldmenu:before { content: "\e70e"; }
103
104
  .kdicon-font-background-solid:before { content: "\e673"; }
104
105
  .kdicon-font-color-solid:before { content: "\e674"; }
@@ -209,7 +210,7 @@
209
210
  .kdicon-two-window:before { content: "\e6f6"; }
210
211
  .kdicon-underline-solid:before { content: "\e671"; }
211
212
  .kdicon-unfold-all:before { content: "\e6ad"; }
212
- .kdicon-unfold:before { content: "\e6bb"; }
213
+ .kdicon-unfold:before { content: "\e71e"; }
213
214
  .kdicon-unfoldmenu:before { content: "\e70d"; }
214
215
  .kdicon-unlock-solid:before { content: "\e666"; }
215
216
  .kdicon-unlock:before { content: "\e69e"; }
Binary file
@@ -294,6 +294,7 @@
294
294
  min-width: 120px;
295
295
  height: 100%;
296
296
  font-size: 0;
297
+ border-top: 1px solid transparent;
297
298
  }
298
299
  .kd-tabs-navs-card.kd-tabs-navs-left::before,
299
300
  .kd-tabs-navs-card.kd-tabs-navs-right::before,
@@ -156,6 +156,7 @@
156
156
  min-width: 120px;
157
157
  height: 100%;
158
158
  font-size: 0;
159
+ border-top: 1px solid transparent;
159
160
  &::before, &::after {
160
161
  position: absolute;
161
162
  content: '';
@@ -17,7 +17,7 @@ var Tooltip = /*#__PURE__*/React.forwardRef(function (props, ref) {
17
17
 
18
18
  var prefixCls = getPrefixCls(pkgPrefixCls, 'tooltip', customPrefixcls);
19
19
  var tiplocator = /*#__PURE__*/React.cloneElement(React.Children.count(children) === 1 && children.type ? children : /*#__PURE__*/React.createElement("span", null, children), {
20
- ref: ref
20
+ ref: children.ref || ref
21
21
  });
22
22
 
23
23
  var popperProps = _extends(_extends({}, allProps), {
package/es/tree/tree.js CHANGED
@@ -10,7 +10,7 @@ import classNames from 'classnames';
10
10
  import ConfigContext from '../config-provider/ConfigContext';
11
11
  import { getCompProps } from '../_utils';
12
12
  import TreeNode from './treeNode';
13
- import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getDataCheckededState, getDataCheckededStateStrictly, getMaxLevel, getAllChildKeys, getPos, getSelected, calcDropPosition } from './utils/treeUtils';
13
+ import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getDataCheckededState, getDataCheckededStateStrictly, getAllChildKeys, getPos, getSelected, calcDropPosition } from './utils/treeUtils';
14
14
  import { useChecked, useExpand, usePlantomHeightEffect, useViewportHeight, useVisibleDataMemo, useScrollToKey, useSelect } from './treeHooks';
15
15
  import isBoolean from 'lodash/isBoolean';
16
16
  var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -71,12 +71,11 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
71
71
  var treeRootClassName = "".concat(treePrefixCls, "-root");
72
72
  var estimatedItemSize = innerEstimatedItemSize; // 节点高度
73
73
 
74
- var flattenAllData = React.useMemo(function () {
74
+ var _React$useMemo = React.useMemo(function () {
75
75
  return flattenAll(treeData, []);
76
- }, [treeData]);
77
- var maxLevel = React.useMemo(function () {
78
- return getMaxLevel(flattenAllData);
79
- }, [flattenAllData]);
76
+ }, [treeData]),
77
+ flattenAllData = _React$useMemo.flattenAllData,
78
+ maxLevel = _React$useMemo.maxLevel;
80
79
 
81
80
  var _useChecked = useChecked(checkStrictly, checkedKeysProps, defaultCheckedKeys, flattenAllData, maxLevel, checkable),
82
81
  _useChecked2 = _slicedToArray(_useChecked, 4),
@@ -123,7 +122,11 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
123
122
  dragOverNodeKey = _React$useState10[0],
124
123
  setDragOverNodeKey = _React$useState10[1];
125
124
 
126
- var _useExpand = useExpand(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, isInit, filterTreeNode, filterValue),
125
+ var isSearching = React.useMemo(function () {
126
+ return typeof filterTreeNode === 'function' && filterValue;
127
+ }, [filterValue]);
128
+
129
+ var _useExpand = useExpand(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, isInit, filterTreeNode, isSearching),
127
130
  _useExpand2 = _slicedToArray(_useExpand, 2),
128
131
  expandedKeys = _useExpand2[0],
129
132
  setExpandedKeys = _useExpand2[1];
@@ -132,8 +135,8 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
132
135
  return getSpreadAttrData(flattenAllData, expandedKeys);
133
136
  }, [flattenAllData, expandedKeys]);
134
137
  var filterData = React.useMemo(function () {
135
- return getFilterData(spreadAttrData, filterTreeNode, filterValue);
136
- }, [spreadAttrData, filterTreeNode, filterValue]);
138
+ return getFilterData(spreadAttrData, filterTreeNode, isSearching);
139
+ }, [spreadAttrData, isSearching]);
137
140
 
138
141
  var _useViewportHeight = useViewportHeight(height, listRef),
139
142
  _useViewportHeight2 = _slicedToArray(_useViewportHeight, 1),
@@ -4,6 +4,6 @@ export declare const useViewportHeight: (height: number, listRef: React.RefObjec
4
4
  export declare const useVisibleDataMemo: (virtual: boolean, filterData: TreeNodeData[], viewportHeight: number, estimatedItemSize: number, start: number) => TreeNodeData[][];
5
5
  export declare const usePlantomHeightEffect: (plantomRef: React.RefObject<HTMLElement>, filterData: TreeNodeData[], estimatedItemSize: number) => void;
6
6
  export declare const useChecked: (checkStrictly: boolean, checkedKeysProps: string[], defaultCheckedKeys: string[], flattenAllData: any[], maxLevel: number, checkable: boolean) => readonly [string[], string[], React.Dispatch<React.SetStateAction<string[]>>, React.Dispatch<React.SetStateAction<string[]>>];
7
- export declare const useExpand: (flattenAllData: any[], expandedKeysProps: string[], defaultExpandedKeys: string[], defaultExpandAll: boolean, defaultExpandRoot: boolean, defaultExpandParent: boolean, scrollKey: string, isInit: boolean, filterTreeNode: FunctionConstructor, filterValue: string) => readonly [string[], React.Dispatch<React.SetStateAction<string[]>>];
7
+ export declare const useExpand: (flattenAllData: any[], expandedKeysProps: string[], defaultExpandedKeys: string[], defaultExpandAll: boolean, defaultExpandRoot: boolean, defaultExpandParent: boolean, scrollKey: string, isInit: boolean, filterTreeNode: FunctionConstructor, isSearching: boolean) => readonly [string[], React.Dispatch<React.SetStateAction<string[]>>];
8
8
  export declare const useScrollToKey: (scrollKey: string, index: number, estimatedItemSize: number, scrollRef: any, viewportHeight: number, treeNodePrefixCls: string) => void;
9
9
  export declare const useSelect: (selectedKeysProps: string[], defaultSelectedKeys: string[]) => readonly [string[], React.Dispatch<React.SetStateAction<string[]>>];
@@ -64,7 +64,7 @@ export var useChecked = function useChecked(checkStrictly, checkedKeysProps, def
64
64
  }, [nextHalfCheckedKeys]);
65
65
  return [checkedKeys, halfCheckedKeys, setCheckedKeys, setHalfCheckedKeys];
66
66
  };
67
- export var useExpand = function useExpand(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, isInit, filterTreeNode, filterValue) {
67
+ export var useExpand = function useExpand(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, isInit, filterTreeNode, isSearching) {
68
68
  var expandScrollkeys = [];
69
69
 
70
70
  if (scrollKey) {
@@ -73,8 +73,8 @@ export var useExpand = function useExpand(flattenAllData, expandedKeysProps, def
73
73
  }
74
74
 
75
75
  var initialExpandedKeys = React.useMemo(function () {
76
- return getInitExpandedKeys(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, expandScrollkeys, filterTreeNode, filterValue);
77
- }, [flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, filterTreeNode, filterValue]);
76
+ return getInitExpandedKeys(flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, expandScrollkeys, filterTreeNode, isSearching);
77
+ }, [flattenAllData, expandedKeysProps, defaultExpandedKeys, defaultExpandAll, defaultExpandRoot, defaultExpandParent, scrollKey, filterTreeNode, isSearching]);
78
78
  var newExpandedKeys = React.useMemo(function () {
79
79
  return getExpandedKeys(expandedKeysProps, expandScrollkeys);
80
80
  }, [expandedKeysProps]);