@kdcloudjs/kdesign 1.7.12 → 1.7.14

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 (50) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/kdesign-complete.less +12 -5
  3. package/dist/kdesign.css +5 -2
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +326 -191
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +3 -3
  8. package/dist/kdesign.min.js +5 -5
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/anchor/style/index.css +2 -0
  11. package/es/anchor/style/index.less +4 -2
  12. package/es/color-picker/style/index.css +1 -1
  13. package/es/color-picker/style/index.less +1 -1
  14. package/es/color-picker/style/token.less +6 -3
  15. package/es/empty/defaultEmptyImg.d.ts +1 -1
  16. package/es/empty/defaultEmptyImg.js +3 -2
  17. package/es/empty/empty.js +3 -1
  18. package/es/empty/illustrationEmptyImg.d.ts +1 -1
  19. package/es/empty/illustrationEmptyImg.js +3 -2
  20. package/es/input/style/index.css +1 -0
  21. package/es/input/style/index.less +1 -0
  22. package/es/modal/modal.js +3 -2
  23. package/es/select/option.d.ts +2 -0
  24. package/es/select/option.js +10 -3
  25. package/es/select/select.js +119 -12
  26. package/es/stepper/stepper.js +23 -9
  27. package/es/tabs/tabs.js +0 -3
  28. package/es/tree/tree.js +2 -2
  29. package/es/tree-select/tree-select.js +4 -2
  30. package/lib/anchor/style/index.css +2 -0
  31. package/lib/anchor/style/index.less +4 -2
  32. package/lib/color-picker/style/index.css +1 -1
  33. package/lib/color-picker/style/index.less +1 -1
  34. package/lib/color-picker/style/token.less +6 -3
  35. package/lib/empty/defaultEmptyImg.d.ts +1 -1
  36. package/lib/empty/defaultEmptyImg.js +3 -2
  37. package/lib/empty/empty.js +3 -1
  38. package/lib/empty/illustrationEmptyImg.d.ts +1 -1
  39. package/lib/empty/illustrationEmptyImg.js +3 -2
  40. package/lib/input/style/index.css +1 -0
  41. package/lib/input/style/index.less +1 -0
  42. package/lib/modal/modal.js +3 -2
  43. package/lib/select/option.d.ts +2 -0
  44. package/lib/select/option.js +10 -3
  45. package/lib/select/select.js +119 -12
  46. package/lib/stepper/stepper.js +23 -9
  47. package/lib/tabs/tabs.js +0 -3
  48. package/lib/tree/tree.js +1 -1
  49. package/lib/tree-select/tree-select.js +4 -2
  50. package/package.json +1 -1
@@ -108,6 +108,8 @@
108
108
  padding-left: var(--kd-c-anchor-spacing-horizontal, 7px);
109
109
  -webkit-box-sizing: border-box;
110
110
  box-sizing: border-box;
111
+ background: var(--kd-c-anchor-color-background, var(--kd-g-color-background, #fff));
112
+ z-index: 1050;
111
113
  }
112
114
  .kd-anchor-wrapper {
113
115
  overflow: auto;
@@ -6,6 +6,8 @@
6
6
  position: relative;
7
7
  padding-left: @anchor-link-left;
8
8
  box-sizing: border-box;
9
+ background: @anchor-bg;
10
+ z-index: @zIndex-popper;
9
11
 
10
12
  &-wrapper {
11
13
  overflow: auto;
@@ -154,7 +156,7 @@
154
156
  &-link {
155
157
  padding: @anchor-link-padding;
156
158
 
157
- &>.@{anchor-prefix-cls}-link {
159
+ & > .@{anchor-prefix-cls}-link {
158
160
  padding: @anchor-link-secondary-padding;
159
161
  }
160
162
 
@@ -193,6 +195,6 @@
193
195
  &.hidden {
194
196
  opacity: 0;
195
197
  visibility: hidden;
196
- transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
198
+ transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
197
199
  }
198
200
  }
@@ -295,7 +295,7 @@
295
295
  left: 8px;
296
296
  }
297
297
  .kd-color-picker-pop .kd-color-picker-panel-input .active-option {
298
- background-color: #E3EBFF;
298
+ background-color: var(--kd-c-color-picker-panel-option-color-background-selected, var(--kd-g-color-theme-3, #e3eeff));
299
299
  }
300
300
  .kd-color-picker-pop .kd-color-picker-panel-transparent {
301
301
  width: 60px;
@@ -247,7 +247,7 @@
247
247
  }
248
248
 
249
249
  .active-option {
250
- background-color: #E3EBFF;
250
+ background-color: @color-picker-panel-option-color-background;
251
251
  }
252
252
  }
253
253
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  @color-picker-custom-prefix: ~'--@{kd-prefix}-c-color-picker';
4
4
 
5
- // z-index
6
- @color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
5
+ // color
6
+ @color-picker-panel-option-color-background: var(~'@{color-picker-custom-prefix}-panel-option-color-background-selected', @color-theme-3);
7
7
 
8
8
  // font
9
9
  @color-picker-input-font-size: var(~'@{color-picker-custom-prefix}-input-font-size', @font-size-middle);
@@ -19,4 +19,7 @@
19
19
  @color-picker-panel-select-sizing-width: var(~'@{color-picker-custom-prefix}-panel-select-sizing-width', 212px);
20
20
  @color-picker-panel-select-sizing-height: var(~'@{color-picker-custom-prefix}-panel-select-sizing-height', 28px);
21
21
  @color-picker-panel-preset-sizing-width: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-width', 16px);
22
- @color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
22
+ @color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
23
+
24
+ // z-index
25
+ @color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function DefaultEmptyImg(): JSX.Element;
2
+ declare function DefaultEmptyImg(props: any): JSX.Element;
3
3
  export default DefaultEmptyImg;
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import ConfigContext from '../config-provider/ConfigContext';
3
3
  import uniqueId from 'lodash/uniqueId';
4
- function DefaultEmptyImg() {
4
+ function DefaultEmptyImg(props) {
5
5
  var _useContext = useContext(ConfigContext),
6
6
  getPrefixCls = _useContext.getPrefixCls,
7
7
  prefixCls = _useContext.prefixCls;
@@ -13,7 +13,8 @@ function DefaultEmptyImg() {
13
13
  height: "96px",
14
14
  viewBox: "0 0 168 96",
15
15
  version: "1.1",
16
- xmlns: "http://www.w3.org/2000/svg"
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ style: props.style
17
18
  }, /*#__PURE__*/React.createElement("title", null, "\u7F16\u7EC4"), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
18
19
  x1: "50%",
19
20
  y1: "0%",
package/es/empty/empty.js CHANGED
@@ -45,7 +45,9 @@ var InteranalEmpty = function InteranalEmpty(props, ref) {
45
45
  className: imgClasses,
46
46
  style: imageStyle,
47
47
  alt: "empty"
48
- }) : image;
48
+ }) : typeof image === 'boolean' ? null : /*#__PURE__*/React.cloneElement(image, {
49
+ style: imageStyle
50
+ });
49
51
  var descriptionNode = description === undefined ? /*#__PURE__*/React.createElement("div", {
50
52
  className: "".concat(emptyPrefixCls, "-description")
51
53
  }, emptyLangMsg.emptyText) : description ? /*#__PURE__*/React.createElement("div", {
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function IllustrationEmptyImg(): JSX.Element;
2
+ declare function IllustrationEmptyImg(props: any): JSX.Element;
3
3
  export default IllustrationEmptyImg;
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import ConfigContext from '../config-provider/ConfigContext';
3
3
  import uniqueId from 'lodash/uniqueId';
4
- function IllustrationEmptyImg() {
4
+ function IllustrationEmptyImg(props) {
5
5
  var _useContext = useContext(ConfigContext),
6
6
  getPrefixCls = _useContext.getPrefixCls,
7
7
  prefixCls = _useContext.prefixCls;
@@ -13,7 +13,8 @@ function IllustrationEmptyImg() {
13
13
  height: "114px",
14
14
  viewBox: "0 0 200 114",
15
15
  version: "1.1",
16
- xmlns: "http://www.w3.org/2000/svg"
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ style: props.style
17
18
  }, /*#__PURE__*/React.createElement("title", null, "\u5207\u7247"), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("rect", {
18
19
  id: "path-1",
19
20
  x: "0",
@@ -335,6 +335,7 @@ textarea {
335
335
  }
336
336
  .kd-input-wrapper .kd-input-prefix {
337
337
  margin-right: 4px;
338
+ margin-left: 8px;
338
339
  }
339
340
  .kd-input-wrapper-size-small {
340
341
  height: var(--kd-c-input-sizing-height-small, 20px);
@@ -129,6 +129,7 @@ textarea {
129
129
 
130
130
  &-prefix {
131
131
  margin-right: 4px;
132
+ margin-left: 8px;
132
133
  }
133
134
  }
134
135
 
package/es/modal/modal.js CHANGED
@@ -54,6 +54,7 @@ var InternalModal = function InternalModal(props, ref) {
54
54
  mask = modalProps.mask,
55
55
  maskClosable = modalProps.maskClosable,
56
56
  maskStyle = modalProps.maskStyle,
57
+ maskClassName = modalProps.maskClassName,
57
58
  okButtonProps = modalProps.okButtonProps,
58
59
  okText = modalProps.okText,
59
60
  onCancel = modalProps.onCancel,
@@ -69,7 +70,7 @@ var InternalModal = function InternalModal(props, ref) {
69
70
  onDrag = modalProps.onDrag,
70
71
  onDragStop = modalProps.onDragStop,
71
72
  bounds = modalProps.bounds,
72
- others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
73
+ others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "maskClassName", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds"]);
73
74
  var isForceController = visible !== undefined;
74
75
  var _useState = useState(isForceController ? visible : true),
75
76
  _useState2 = _slicedToArray(_useState, 2),
@@ -237,7 +238,7 @@ var InternalModal = function InternalModal(props, ref) {
237
238
  className: modalClasses
238
239
  }, others), mask && /*#__PURE__*/React.createElement("div", {
239
240
  onClick: handleMaskClick,
240
- className: "".concat(modalPrefixCls, "-mask"),
241
+ className: classNames(maskClassName, _defineProperty({}, "".concat(modalPrefixCls, "-mask"), true)),
241
242
  style: maskStyle
242
243
  }), /*#__PURE__*/React.createElement(Draggable, {
243
244
  defaultPosition: defaultPosition,
@@ -8,9 +8,11 @@ export interface ISelectOptionProps {
8
8
  children?: any;
9
9
  className?: string;
10
10
  index?: number;
11
+ activeIndex?: number;
11
12
  style?: React.CSSProperties;
12
13
  isMultiple?: boolean;
13
14
  onChangeSelect?: (key: SelectValue, label: string | undefined, isSelected: boolean) => void;
15
+ onChangeActiveIndex?: (index: any) => void;
14
16
  }
15
17
  declare const Option: React.ForwardRefExoticComponent<ISelectOptionProps & React.RefAttributes<unknown>>;
16
18
  export default Option;
@@ -22,7 +22,10 @@ var InternalOption = function InternalOption(props, ref) {
22
22
  values = _valuesInstanceProperty(props),
23
23
  isMultiple = props.isMultiple,
24
24
  onChangeSelect = props.onChangeSelect,
25
- title = props.title;
25
+ onChangeActiveIndex = props.onChangeActiveIndex,
26
+ title = props.title,
27
+ activeIndex = props.activeIndex,
28
+ index = props.index;
26
29
  var optionProps = _extends({}, props);
27
30
  var _useContext = useContext(ConfigContext),
28
31
  getPrefixCls = _useContext.getPrefixCls,
@@ -35,7 +38,7 @@ var InternalOption = function InternalOption(props, ref) {
35
38
  setSelected(value !== undefined ? value === values : false);
36
39
  }
37
40
  });
38
- var optionCls = classNames(selectOptionPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option"), true), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option-selected"), isSelected), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option-disabled"), disabled), _classNames));
41
+ var optionCls = classNames(selectOptionPrefixCls, className, (_classNames = {}, _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option"), true), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option-active"), activeIndex === index), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option-selected"), isSelected), _defineProperty(_classNames, "".concat(selectOptionPrefixCls, "-option-disabled"), disabled), _classNames));
39
42
  var contentCls = classNames(_defineProperty({}, "".concat(selectOptionPrefixCls, "-option-content"), true));
40
43
  var handleClick = function handleClick(e) {
41
44
  e.preventDefault();
@@ -45,6 +48,9 @@ var InternalOption = function InternalOption(props, ref) {
45
48
  }
46
49
  onChangeSelect && onChangeSelect(value, children, isSelected);
47
50
  };
51
+ var handleOnMouseMove = function handleOnMouseMove() {
52
+ onChangeActiveIndex && onChangeActiveIndex(index);
53
+ };
48
54
  var titleText = title || (_typeof(children) !== 'object' ? children : null);
49
55
  var checkStyle = {
50
56
  minHeight: '22px',
@@ -54,7 +60,8 @@ var InternalOption = function InternalOption(props, ref) {
54
60
  ref: optionRef,
55
61
  className: optionCls,
56
62
  title: titleText,
57
- onClick: handleClick
63
+ onClick: handleClick,
64
+ onMouseMove: handleOnMouseMove
58
65
  }, /*#__PURE__*/React.createElement("div", {
59
66
  className: contentCls
60
67
  }, isMultiple ? /*#__PURE__*/React.createElement(Checkbox, {
@@ -7,6 +7,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
7
7
  import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
8
8
  import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
9
9
  import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/splice";
10
+ import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
10
11
  import React, { useContext, useRef, useEffect, useState, useCallback, useLayoutEffect, useMemo } from 'react';
11
12
  import { useMergedState } from '../_utils/hooks';
12
13
  import isBoolean from 'lodash/isBoolean';
@@ -18,6 +19,7 @@ import { Icon, Checkbox, Tag } from '../index';
18
19
  import Option from './option';
19
20
  import usePopper from '../_utils/usePopper';
20
21
  import VirtualList from '../virtual-list';
22
+ import KeyCode from '../_utils/KeyCode';
21
23
  var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
22
24
  var InternalSelect = function InternalSelect(props, ref) {
23
25
  var _context, _classNames6, _classNames12;
@@ -200,13 +202,13 @@ var InternalSelect = function InternalSelect(props, ref) {
200
202
  onBlur && onBlur(e);
201
203
  }, [onBlur]);
202
204
  // 点击组件
203
- var handleClick = function handleClick() {
204
- if (disabled) return;
205
- if (optionShow) {
206
- var onDropdownVisibleChange = selectProps.onDropdownVisibleChange;
207
- onDropdownVisibleChange && onDropdownVisibleChange(true);
208
- }
209
- };
205
+ // const handleClick = () => {
206
+ // if (disabled) return
207
+ // if (optionShow) {
208
+ // const { onDropdownVisibleChange } = selectProps
209
+ // onDropdownVisibleChange && onDropdownVisibleChange(true)
210
+ // }
211
+ // }
210
212
  useEffect(function () {
211
213
  selectionRef.current.addEventListener('mouseup', function (e) {
212
214
  var _a;
@@ -460,8 +462,12 @@ var InternalSelect = function InternalSelect(props, ref) {
460
462
  }, child.props, {
461
463
  key: index,
462
464
  index: index,
465
+ activeIndex: activeIndex,
463
466
  onChangeSelect: handleOption,
464
- values: multipleRef.current.selectedVal
467
+ values: multipleRef.current.selectedVal,
468
+ onChangeActiveIndex: function onChangeActiveIndex(i) {
469
+ setActiveIndex(i);
470
+ }
465
471
  }));
466
472
  } else {
467
473
  return /*#__PURE__*/React.createElement(Option, _extends({
@@ -469,8 +475,12 @@ var InternalSelect = function InternalSelect(props, ref) {
469
475
  value: child === null || child === void 0 ? void 0 : child.value,
470
476
  key: index,
471
477
  index: index,
478
+ activeIndex: activeIndex,
472
479
  onChangeSelect: handleOption,
473
- values: multipleRef.current.selectedVal
480
+ values: multipleRef.current.selectedVal,
481
+ onChangeActiveIndex: function onChangeActiveIndex(i) {
482
+ setActiveIndex(i);
483
+ }
474
484
  }, child), (child === null || child === void 0 ? void 0 : child.label) || (child === null || child === void 0 ? void 0 : child.value));
475
485
  }
476
486
  };
@@ -499,6 +509,7 @@ var InternalSelect = function InternalSelect(props, ref) {
499
509
  (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
500
510
  }
501
511
  }, [isShowSearch, autoFocus, disabled]);
512
+ var optionsListRef = React.useRef(null);
502
513
  // 渲染下拉列表框
503
514
  var renderContent = function renderContent() {
504
515
  var dropdownRender = selectProps.dropdownRender,
@@ -524,7 +535,8 @@ var InternalSelect = function InternalSelect(props, ref) {
524
535
  },
525
536
  isStaticItemHeight: true,
526
537
  height: listHeight || 300,
527
- measureLongestItem: false
538
+ measureLongestItem: false,
539
+ ref: optionsListRef
528
540
  }, virtualListProps), function (child) {
529
541
  return child;
530
542
  });
@@ -683,6 +695,101 @@ var InternalSelect = function InternalSelect(props, ref) {
683
695
  }, renderSuffix()));
684
696
  };
685
697
  var singleCls = classNames(commCls, (_classNames12 = {}, _defineProperty(_classNames12, "".concat(selectPrefixCls, "-single"), true), _defineProperty(_classNames12, "".concat(selectPrefixCls, "-single-disabled"), disabled), _defineProperty(_classNames12, "".concat(selectPrefixCls, "-single-focused"), focusd && !disabled || optionShow), _classNames12));
698
+ // keyboard
699
+ var getActiveIndex = function getActiveIndex(index) {
700
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
701
+ var len = filledOptions.length;
702
+ for (var i = 0; i < len; i += 1) {
703
+ var current = (index + i * offset + len) % len;
704
+ var _props = filledOptions[current].props;
705
+ if (!(_props === null || _props === void 0 ? void 0 : _props.disabled)) {
706
+ return current;
707
+ }
708
+ }
709
+ return -1;
710
+ };
711
+ // reset activeIndex
712
+ useEffect(function () {
713
+ if (searchValue) {
714
+ setActiveIndex(getActiveIndex(0));
715
+ }
716
+ }, [searchValue]);
717
+ useEffect(function () {
718
+ if (optionShow && !disabled) {
719
+ var onDropdownVisibleChange = selectProps.onDropdownVisibleChange;
720
+ onDropdownVisibleChange && onDropdownVisibleChange(true);
721
+ }
722
+ }, [optionShow]);
723
+ var _useState13 = useState(getActiveIndex(0)),
724
+ _useState14 = _slicedToArray(_useState13, 2),
725
+ activeIndex = _useState14[0],
726
+ setActiveIndex = _useState14[1];
727
+ var onInternalKeyDown = function onInternalKeyDown(e) {
728
+ var _a, _b;
729
+ var which = e.which;
730
+ // open
731
+ if (which === KeyCode.ENTER || which === KeyCode.UP || which === KeyCode.DOWN) {
732
+ e.preventDefault();
733
+ setOptionShow(true);
734
+ }
735
+ // backspace
736
+ var _multipleRef$current5 = multipleRef.current,
737
+ selectedVal = _multipleRef$current5.selectedVal,
738
+ selectMulOpts = _multipleRef$current5.selectMulOpts;
739
+ // isMultiple
740
+ if (which === KeyCode.BACKSPACE && !searchValue && isMultiple && selectedVal.length && selectMulOpts.length) {
741
+ _spliceInstanceProperty(selectedVal).call(selectedVal, -1, 1);
742
+ _spliceInstanceProperty(selectMulOpts).call(selectMulOpts, -1, 1);
743
+ setMulOptions(_toConsumableArray(selectMulOpts));
744
+ onChange && onChange(labelInValue ? selectMulOpts : selectedVal, selectMulOpts);
745
+ // !isMultiple
746
+ } else if (which === KeyCode.BACKSPACE && allowClear && !isMultiple) {
747
+ setInitValue('');
748
+ onClear && onClear('');
749
+ setSearchValue('');
750
+ onChange && onChange(undefined);
751
+ }
752
+ // optionsList: up、down、enter
753
+ if (optionShow) {
754
+ var offset = 0;
755
+ if (which === KeyCode.UP) {
756
+ offset = -1;
757
+ } else if (which === KeyCode.DOWN) {
758
+ offset = 1;
759
+ } else if (which === KeyCode.ENTER) {
760
+ var item = filledOptions[activeIndex];
761
+ var key = ((_a = item.props) === null || _a === void 0 ? void 0 : _a.value) || item.value;
762
+ var label = ((_b = item.props) === null || _b === void 0 ? void 0 : _b.children) || item.label;
763
+ handleOption(key, label, true);
764
+ // search
765
+ if (searchValue) {
766
+ setActiveIndex(_findIndexInstanceProperty(realChildren).call(realChildren, function (child) {
767
+ var _a;
768
+ if (child && child.props) {
769
+ return ((_a = child.props) === null || _a === void 0 ? void 0 : _a.value) === key;
770
+ } else {
771
+ return (child === null || child === void 0 ? void 0 : child.value) === key;
772
+ }
773
+ }));
774
+ }
775
+ if (!isMultiple) {
776
+ setOptionShow(false);
777
+ }
778
+ } else if (which === KeyCode.ESC) {
779
+ setOptionShow(false);
780
+ }
781
+ if (offset !== 0) {
782
+ var nextActiveIndex = getActiveIndex(activeIndex + offset, offset);
783
+ if (optionsListRef.current) {
784
+ optionsListRef.current.scrollTo({
785
+ index: nextActiveIndex
786
+ });
787
+ }
788
+ setActiveIndex(nextActiveIndex);
789
+ e.preventDefault();
790
+ }
791
+ }
792
+ };
686
793
  var renderSelect = function renderSelect() {
687
794
  return /*#__PURE__*/React.createElement("div", {
688
795
  className: selectCls,
@@ -690,7 +797,6 @@ var InternalSelect = function InternalSelect(props, ref) {
690
797
  style: style
691
798
  }, /*#__PURE__*/React.createElement("span", {
692
799
  className: selectionCls,
693
- onClick: handleClick,
694
800
  tabIndex: disabled ? -1 : 0,
695
801
  onFocus: function onFocus() {
696
802
  var _a;
@@ -699,7 +805,8 @@ var InternalSelect = function InternalSelect(props, ref) {
699
805
  onBlur: function onBlur() {
700
806
  var _a;
701
807
  return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.blur();
702
- }
808
+ },
809
+ onKeyDown: onInternalKeyDown
703
810
  }, !isMultiple ? renderSingle() : renderMultiple()));
704
811
  };
705
812
  var catchStyle = function catchStyle() {
@@ -14,6 +14,8 @@ import { tuple } from '../_utils/type';
14
14
  import { omit } from '../_utils/omit';
15
15
  import { useMergedState } from '../_utils/hooks';
16
16
  import { isExp } from '../_utils/numberUtil';
17
+ Big.PE = 40;
18
+ Big.NE = -40;
17
19
  export var StepTypes = tuple('embed', 'base');
18
20
  var InternalStepper = function InternalStepper(props, ref) {
19
21
  var _useContext = useContext(ConfigContext),
@@ -88,38 +90,50 @@ var InternalStepper = function InternalStepper(props, ref) {
88
90
  type: "add"
89
91
  }));
90
92
  };
93
+ var isLegal = function isLegal(value) {
94
+ var reg = /^[0-9]*\.?[0-9]+$/;
95
+ return reg === null || reg === void 0 ? void 0 : reg.test(value);
96
+ };
91
97
  var handleStepChang = function handleStepChang(type) {
92
98
  var stepNum = parseFloat(step);
93
99
  if (typeof stepNum !== 'number') {
94
100
  return false;
95
101
  }
96
- var startingNumber = isExp(stepperrref.current.value) ? Big(stepperrref.current.value).valueOf() : stepperrref.current.value || parseFloat(inputNumberProps.min) || 0;
97
- var calculationResults = new Big(startingNumber)[type](stepNum).valueOf();
102
+ var startingNumber = isExp(stepperrref.current.value) ? Big(stepperrref.current.value).valueOf() : stepperrref.current.value || inputNumberProps.min || 0;
103
+ var currentValue = new Big(startingNumber)[type](stepNum);
104
+ var calculationResults = currentValue.valueOf();
98
105
  var legalNumber = stepperrref.current.verifiValue(calculationResults);
99
106
  if (legalNumber === false) {
100
107
  return false;
101
108
  }
102
- if (typeof max === 'number') {
103
- if (Number(legalNumber) + step > max) {
109
+ var nextPlus = new Big(calculationResults).plus(stepNum);
110
+ var nextMinus = new Big(calculationResults).minus(stepNum);
111
+ if (isLegal(max)) {
112
+ var maxBig = new Big(max);
113
+ if (nextPlus.cmp(maxBig) === 1) {
104
114
  setMinusdisabled(true);
105
115
  } else {
106
116
  setMinusdisabled(false);
107
117
  }
108
- if (Number(legalNumber) > max) {
118
+ if (currentValue.cmp(maxBig) === 1) {
109
119
  return false;
110
120
  }
121
+ } else {
122
+ setMinusdisabled(false);
111
123
  }
112
- if (typeof min === 'number') {
113
- if (Number(legalNumber) - step < min) {
124
+ if (isLegal(min)) {
125
+ var minBig = new Big(min);
126
+ if (minBig.cmp(nextMinus) === 1) {
114
127
  setPlusdisabled(true);
115
128
  } else {
116
129
  setPlusdisabled(false);
117
130
  }
118
- if (Number(legalNumber) < min) {
131
+ if (minBig.cmp(currentValue) === 1) {
119
132
  return false;
120
133
  }
134
+ } else {
135
+ setPlusdisabled(false);
121
136
  }
122
- // props?.value === undefined && stepperrref.current.setValue(legalNumber)
123
137
  (props === null || props === void 0 ? void 0 : props.value) === undefined && setValue(legalNumber);
124
138
  onChange && onChange({
125
139
  target: {
package/es/tabs/tabs.js CHANGED
@@ -359,9 +359,6 @@ var Tabs = function Tabs(props) {
359
359
  }
360
360
  carouselData.push(item);
361
361
  });
362
- if (effect !== 'none') {
363
- console.log('effect', effect);
364
- }
365
362
  return /*#__PURE__*/React.createElement(Carousel, {
366
363
  ref: carouselRef,
367
364
  dots: false,
package/es/tree/tree.js CHANGED
@@ -12,7 +12,7 @@ import cloneDeep from 'lodash/cloneDeep';
12
12
  import ConfigContext from '../config-provider/ConfigContext';
13
13
  import { getCompProps } from '../_utils';
14
14
  import TreeNode from './treeNode';
15
- import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getAllCheckedKeys, getDataCheckededStateStrictly, getAllChildKeys, getPos, getSelected, calcDropPosition } from './utils/treeUtils';
15
+ import { getChecked, getHalfChecked, addKeys, flattenAll, delKey, getFilterData, getSpreadAttrData, getAllCheckedKeys, getDataCheckededStateStrictly, getAllChildKeys, getPos, calcDropPosition } from './utils/treeUtils';
16
16
  import { useChecked, useExpand, usePlantomHeightEffect, useViewportHeight, useVisibleDataMemo, useScrollToKey, useSelect } from './treeHooks';
17
17
  import isBoolean from 'lodash/isBoolean';
18
18
  var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -388,7 +388,7 @@ var InternalTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
388
388
  item.onDrop = handleDrop;
389
389
  item.onSelect = handleSelect;
390
390
  item.checked = checked;
391
- item.selected = getSelected(Array.isArray(selectedKeys) && selectedKeys[0] ? [selectedKeys[0]] : selectedKeys, item.key);
391
+ item.selected = checkable ? false : Array.isArray(selectedKeys) ? (selectedKeys === null || selectedKeys === void 0 ? void 0 : selectedKeys[0]) === item.key : selectedKeys === item.key;
392
392
  item.indeterminate = indeterminate;
393
393
  item.disabled = getDisabled(disabled, item.disabled);
394
394
  item.showIcon = showIcon || false;
@@ -108,7 +108,7 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
108
108
  _useState2 = _slicedToArray(_useState, 2),
109
109
  expandedKeys = _useState2[0],
110
110
  setExpandedKeys = _useState2[1];
111
- var _useState3 = useState([]),
111
+ var _useState3 = useState(initValue),
112
112
  _useState4 = _slicedToArray(_useState3, 2),
113
113
  selectedKeys = _useState4[0],
114
114
  setSelectedKeys = _useState4[1];
@@ -254,7 +254,9 @@ var InternalTreeSelect = function InternalTreeSelect(props, ref) {
254
254
  };
255
255
  var handleCheck = function handleCheck(keys, state) {
256
256
  onCheck === null || onCheck === void 0 ? void 0 : onCheck(keys, state);
257
- onChange === null || onChange === void 0 ? void 0 : onChange(keys);
257
+ onChange === null || onChange === void 0 ? void 0 : onChange(keys, _mapInstanceProperty(keys).call(keys, function (key) {
258
+ return TreeMap.get(key);
259
+ }));
258
260
  !Object.hasOwnProperty.call(treeSelectProps, 'value') && setInitValue(keys);
259
261
  };
260
262
  var handleExpand = function handleExpand(keys, state) {
@@ -108,6 +108,8 @@
108
108
  padding-left: var(--kd-c-anchor-spacing-horizontal, 7px);
109
109
  -webkit-box-sizing: border-box;
110
110
  box-sizing: border-box;
111
+ background: var(--kd-c-anchor-color-background, var(--kd-g-color-background, #fff));
112
+ z-index: 1050;
111
113
  }
112
114
  .kd-anchor-wrapper {
113
115
  overflow: auto;
@@ -6,6 +6,8 @@
6
6
  position: relative;
7
7
  padding-left: @anchor-link-left;
8
8
  box-sizing: border-box;
9
+ background: @anchor-bg;
10
+ z-index: @zIndex-popper;
9
11
 
10
12
  &-wrapper {
11
13
  overflow: auto;
@@ -154,7 +156,7 @@
154
156
  &-link {
155
157
  padding: @anchor-link-padding;
156
158
 
157
- &>.@{anchor-prefix-cls}-link {
159
+ & > .@{anchor-prefix-cls}-link {
158
160
  padding: @anchor-link-secondary-padding;
159
161
  }
160
162
 
@@ -193,6 +195,6 @@
193
195
  &.hidden {
194
196
  opacity: 0;
195
197
  visibility: hidden;
196
- transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4,0,0.6,1);
198
+ transition: all calc(@anchor-transition-duration - 0.1s) cubic-bezier(0.4, 0, 0.6, 1);
197
199
  }
198
200
  }
@@ -295,7 +295,7 @@
295
295
  left: 8px;
296
296
  }
297
297
  .kd-color-picker-pop .kd-color-picker-panel-input .active-option {
298
- background-color: #E3EBFF;
298
+ background-color: var(--kd-c-color-picker-panel-option-color-background-selected, var(--kd-g-color-theme-3, #e3eeff));
299
299
  }
300
300
  .kd-color-picker-pop .kd-color-picker-panel-transparent {
301
301
  width: 60px;
@@ -247,7 +247,7 @@
247
247
  }
248
248
 
249
249
  .active-option {
250
- background-color: #E3EBFF;
250
+ background-color: @color-picker-panel-option-color-background;
251
251
  }
252
252
  }
253
253
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  @color-picker-custom-prefix: ~'--@{kd-prefix}-c-color-picker';
4
4
 
5
- // z-index
6
- @color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
5
+ // color
6
+ @color-picker-panel-option-color-background: var(~'@{color-picker-custom-prefix}-panel-option-color-background-selected', @color-theme-3);
7
7
 
8
8
  // font
9
9
  @color-picker-input-font-size: var(~'@{color-picker-custom-prefix}-input-font-size', @font-size-middle);
@@ -19,4 +19,7 @@
19
19
  @color-picker-panel-select-sizing-width: var(~'@{color-picker-custom-prefix}-panel-select-sizing-width', 212px);
20
20
  @color-picker-panel-select-sizing-height: var(~'@{color-picker-custom-prefix}-panel-select-sizing-height', 28px);
21
21
  @color-picker-panel-preset-sizing-width: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-width', 16px);
22
- @color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
22
+ @color-picker-panel-preset-sizing-height: var(~'@{color-picker-custom-prefix}-panel-preset-sizing-height', 16px);
23
+
24
+ // z-index
25
+ @color-picker-panel-z-index: var(~'@{color-picker-custom-prefix}-panel-z-index', @z-index-popper);
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare function DefaultEmptyImg(): JSX.Element;
2
+ declare function DefaultEmptyImg(props: any): JSX.Element;
3
3
  export default DefaultEmptyImg;