@kdcloudjs/kdesign 1.6.30 → 1.6.32

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 (77) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/LICENSE +3 -0
  3. package/dist/kdesign-complete.less +16 -0
  4. package/dist/kdesign.css +13 -1
  5. package/dist/kdesign.css.map +1 -1
  6. package/dist/kdesign.js +1678 -49
  7. package/dist/kdesign.js.map +1 -1
  8. package/dist/kdesign.min.css +3 -3
  9. package/dist/kdesign.min.js +8 -8
  10. package/dist/kdesign.min.js.map +1 -1
  11. package/es/_utils/getStringLength.d.ts +1 -0
  12. package/es/_utils/getStringLength.js +14 -0
  13. package/es/_utils/hooks.d.ts +3 -0
  14. package/es/_utils/hooks.js +50 -1
  15. package/es/_utils/raf.d.ts +3 -0
  16. package/es/_utils/raf.js +35 -0
  17. package/es/_utils/resizeObserver.d.ts +15 -0
  18. package/es/_utils/resizeObserver.js +79 -0
  19. package/es/_utils/testBrowserType.d.ts +1 -0
  20. package/es/_utils/testBrowserType.js +11 -0
  21. package/es/_utils/usePopper.js +1 -1
  22. package/es/form/style/index.css +4 -0
  23. package/es/form/style/index.less +6 -0
  24. package/es/grid/col.js +7 -2
  25. package/es/grid/row.js +6 -1
  26. package/es/grid/style/index.css +6 -0
  27. package/es/grid/style/index.less +8 -0
  28. package/es/select/interface.d.ts +2 -0
  29. package/es/select/select.js +52 -21
  30. package/es/select/style/index.css +2 -0
  31. package/es/select/style/index.less +2 -0
  32. package/es/stepper/stepper.js +2 -1
  33. package/es/tree/treeHooks.js +1 -1
  34. package/es/virtual-list/Filler.d.ts +9 -0
  35. package/es/virtual-list/Filler.js +38 -0
  36. package/es/virtual-list/index.d.ts +3 -0
  37. package/es/virtual-list/index.js +3 -0
  38. package/es/virtual-list/utils/algorithmUtil.d.ts +19 -0
  39. package/es/virtual-list/utils/algorithmUtil.js +79 -0
  40. package/es/virtual-list/utils/itemUtil.d.ts +75 -0
  41. package/es/virtual-list/utils/itemUtil.js +176 -0
  42. package/es/virtual-list/virtual-list.d.ts +34 -0
  43. package/es/virtual-list/virtual-list.js +589 -0
  44. package/lib/_utils/getStringLength.d.ts +1 -0
  45. package/lib/_utils/getStringLength.js +21 -0
  46. package/lib/_utils/hooks.d.ts +3 -0
  47. package/lib/_utils/hooks.js +56 -0
  48. package/lib/_utils/raf.d.ts +3 -0
  49. package/lib/_utils/raf.js +43 -0
  50. package/lib/_utils/resizeObserver.d.ts +15 -0
  51. package/lib/_utils/resizeObserver.js +95 -0
  52. package/lib/_utils/testBrowserType.d.ts +1 -0
  53. package/lib/_utils/testBrowserType.js +18 -0
  54. package/lib/_utils/usePopper.js +1 -1
  55. package/lib/form/style/index.css +4 -0
  56. package/lib/form/style/index.less +6 -0
  57. package/lib/grid/col.js +8 -2
  58. package/lib/grid/row.js +7 -1
  59. package/lib/grid/style/index.css +6 -0
  60. package/lib/grid/style/index.less +8 -0
  61. package/lib/select/interface.d.ts +2 -0
  62. package/lib/select/select.js +52 -21
  63. package/lib/select/style/index.css +2 -0
  64. package/lib/select/style/index.less +2 -0
  65. package/lib/stepper/stepper.js +3 -1
  66. package/lib/tree/treeHooks.js +1 -1
  67. package/lib/virtual-list/Filler.d.ts +9 -0
  68. package/lib/virtual-list/Filler.js +59 -0
  69. package/lib/virtual-list/index.d.ts +3 -0
  70. package/lib/virtual-list/index.js +36 -0
  71. package/lib/virtual-list/utils/algorithmUtil.d.ts +19 -0
  72. package/lib/virtual-list/utils/algorithmUtil.js +88 -0
  73. package/lib/virtual-list/utils/itemUtil.d.ts +75 -0
  74. package/lib/virtual-list/utils/itemUtil.js +206 -0
  75. package/lib/virtual-list/virtual-list.d.ts +34 -0
  76. package/lib/virtual-list/virtual-list.js +626 -0
  77. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export default function (str: string): number;
@@ -0,0 +1,14 @@
1
+ // 计算字符串长度,中文字符占两个长度
2
+ export default function (str) {
3
+ var len = 0;
4
+
5
+ for (var i = 0; i < str.length; i++) {
6
+ if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
7
+ len += 2;
8
+ } else {
9
+ len++;
10
+ }
11
+ }
12
+
13
+ return len;
14
+ }
@@ -50,4 +50,7 @@ interface ContentRectType {
50
50
  y: number;
51
51
  }
52
52
  export declare function useResizeObserver(element: (() => HTMLElement | null) | HTMLElement | null, handler?: (react: ContentRectType) => void): void;
53
+ export declare function useIsFirstRender(): boolean;
54
+ export declare function useForceUpdate(): import("react").DispatchWithoutAction;
55
+ export declare function useStateWithPromise<T>(defaultVal: T): [T, (updater: any) => Promise<T>];
53
56
  export {};
@@ -6,6 +6,7 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
6
6
  import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
7
7
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
8
8
  import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
9
+ import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
9
10
 
10
11
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
11
12
 
@@ -13,7 +14,7 @@ function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return;
13
14
 
14
15
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
15
16
 
16
- import { useEffect, useState, useRef } from 'react';
17
+ import { useEffect, useState, useRef, useReducer } from 'react';
17
18
  import ResizeObserver from 'resize-observer-polyfill';
18
19
  import devWarning from './devwarning';
19
20
  /**
@@ -236,4 +237,52 @@ export function useResizeObserver(element, handler) {
236
237
  resizeObserver && resizeObserver.disconnect();
237
238
  };
238
239
  }, [element, handler]);
240
+ }
241
+ export function useIsFirstRender() {
242
+ var isFirst = useRef(true);
243
+ useEffect(function () {
244
+ isFirst.current = false;
245
+ }, []);
246
+ return isFirst.current;
247
+ }
248
+ export function useForceUpdate() {
249
+ var _useReducer = useReducer(function (v) {
250
+ return v + 1;
251
+ }, 0),
252
+ _useReducer2 = _slicedToArray(_useReducer, 2),
253
+ dispatch = _useReducer2[1];
254
+
255
+ return dispatch;
256
+ }
257
+ export function useStateWithPromise(defaultVal) {
258
+ var _useState3 = useState({
259
+ value: defaultVal,
260
+ resolve: function resolve(e) {
261
+ // eslint-disable-next-line no-unused-expressions, @typescript-eslint/no-unused-expressions
262
+ e;
263
+ }
264
+ }),
265
+ _useState4 = _slicedToArray(_useState3, 2),
266
+ state = _useState4[0],
267
+ setState = _useState4[1];
268
+
269
+ useEffect(function () {
270
+ state.resolve(state.value);
271
+ }, [state]);
272
+ return [state.value, function (updater) {
273
+ return new _Promise(function (resolve) {
274
+ setState(function (prevState) {
275
+ var nextVal = updater;
276
+
277
+ if (typeof updater === 'function') {
278
+ nextVal = updater(prevState.value);
279
+ }
280
+
281
+ return {
282
+ value: nextVal,
283
+ resolve: resolve
284
+ };
285
+ });
286
+ });
287
+ }];
239
288
  }
@@ -0,0 +1,3 @@
1
+ declare let raf: any;
2
+ declare let caf: any;
3
+ export { raf, caf };
@@ -0,0 +1,35 @@
1
+ var target = typeof window === 'undefined' ? global : window;
2
+ var vendors = ['webkit', 'ms', 'moz', 'o'];
3
+ var raf = target.requestAnimationFrame; // eslint-disable-line
4
+
5
+ var caf = target.cancelAnimationFrame; // eslint-disable-line
6
+
7
+ if (!raf || !caf) {
8
+ vendors.some(function (prefix) {
9
+ raf = target["".concat(prefix, "RequestAnimationFrame")];
10
+ caf = target["".concat(prefix, "CancelAnimationFrame")] || target["".concat(prefix, "CancelRequestAnimationFrame")];
11
+ return raf && caf;
12
+ });
13
+
14
+ if (!raf || !caf) {
15
+ var lastTime = 0;
16
+
17
+ raf = function raf(cb) {
18
+ var currentTime = Date.now();
19
+ var diff = Math.max(0, 16 - (currentTime - lastTime));
20
+ var timer = setTimeout(function () {
21
+ cb();
22
+ lastTime = currentTime + diff;
23
+ }, diff);
24
+ return timer;
25
+ };
26
+
27
+ caf = function caf(timer) {
28
+ clearTimeout(timer);
29
+ };
30
+ }
31
+ }
32
+
33
+ raf = raf.bind(target);
34
+ caf = caf.bind(target);
35
+ export { raf, caf };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ export interface ResizeProps {
3
+ onResize?: (entry: ResizeObserverEntry[]) => void;
4
+ children?: React.ReactNode;
5
+ }
6
+ declare class ResizeObserverComponent extends React.Component<ResizeProps> {
7
+ resizeObserver: any;
8
+ componentDidMount(): void;
9
+ componentDidUpdate(): void;
10
+ componentWillUnmount: () => void;
11
+ createResizeObserver: () => void;
12
+ destroyResizeObserver: () => void;
13
+ render(): React.ReactNode;
14
+ }
15
+ export default ResizeObserverComponent;
@@ -0,0 +1,79 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
4
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
5
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
6
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
7
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
8
+
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+
13
+ import React from 'react';
14
+ import ResizeObserver from 'resize-observer-polyfill';
15
+ import { findDOMNode } from 'react-dom';
16
+
17
+ var ResizeObserverComponent = /*#__PURE__*/function (_React$Component) {
18
+ _inherits(ResizeObserverComponent, _React$Component);
19
+
20
+ var _super = _createSuper(ResizeObserverComponent);
21
+
22
+ function ResizeObserverComponent() {
23
+ var _this;
24
+
25
+ _classCallCheck(this, ResizeObserverComponent);
26
+
27
+ _this = _super.apply(this, arguments);
28
+
29
+ _this.componentWillUnmount = function () {
30
+ if (_this.resizeObserver) {
31
+ _this.destroyResizeObserver();
32
+ }
33
+ };
34
+
35
+ _this.createResizeObserver = function () {
36
+ _this.resizeObserver = new ResizeObserver(function (entry) {
37
+ var onResize = _this.props.onResize;
38
+ onResize && onResize(entry);
39
+ }); // eslint-disable-next-line react/no-find-dom-node
40
+
41
+ _this.resizeObserver.observe(findDOMNode(_assertThisInitialized(_this)));
42
+ };
43
+
44
+ _this.destroyResizeObserver = function () {
45
+ _this.resizeObserver && _this.resizeObserver.disconnect();
46
+ _this.resizeObserver = null;
47
+ };
48
+
49
+ return _this;
50
+ }
51
+
52
+ _createClass(ResizeObserverComponent, [{
53
+ key: "componentDidMount",
54
+ value: function componentDidMount() {
55
+ if (! /*#__PURE__*/React.isValidElement(this.props.children)) {
56
+ console.warn('The children of ResizeObserver is invalid.');
57
+ } else {
58
+ this.createResizeObserver();
59
+ }
60
+ }
61
+ }, {
62
+ key: "componentDidUpdate",
63
+ value: function componentDidUpdate() {
64
+ // eslint-disable-next-line react/no-find-dom-node
65
+ if (!this.resizeObserver && findDOMNode(this)) {
66
+ this.createResizeObserver();
67
+ }
68
+ }
69
+ }, {
70
+ key: "render",
71
+ value: function render() {
72
+ return this.props.children;
73
+ }
74
+ }]);
75
+
76
+ return ResizeObserverComponent;
77
+ }(React.Component);
78
+
79
+ export default ResizeObserverComponent;
@@ -0,0 +1 @@
1
+ export declare function testBrowserType(reg: RegExp, type: number): boolean;
@@ -0,0 +1,11 @@
1
+ export function testBrowserType(reg, type) {
2
+ var external = window.external || {};
3
+
4
+ for (var i in external) {
5
+ if (reg.test(type ? external[i] : i)) {
6
+ return true;
7
+ }
8
+ }
9
+
10
+ return false;
11
+ }
@@ -545,7 +545,7 @@ function usePopper(locatorElement, popperElement, props) {
545
545
  } else {
546
546
  if (matchTrigger('hover')) {
547
547
  mouseleaveTimer && clearTimeout(mouseleaveTimer);
548
- mouseleaveTimer = window.setTimeout(hidePopper, mouseLeaveDelay * 3000);
548
+ mouseleaveTimer = window.setTimeout(hidePopper, mouseLeaveDelay * 1000);
549
549
  } else {
550
550
  hidePopper();
551
551
  }
@@ -120,6 +120,10 @@
120
120
  display: -ms-flexbox;
121
121
  display: flex;
122
122
  }
123
+ .kd-form-horizontal .kd-form-field-label {
124
+ -ms-flex-negative: 0;
125
+ flex-shrink: 0;
126
+ }
123
127
  .kd-form-inline .kd-form-field {
124
128
  display: -webkit-inline-box;
125
129
  display: -ms-inline-flexbox;
@@ -17,6 +17,12 @@
17
17
  }
18
18
  }
19
19
 
20
+ &-horizontal {
21
+ .@{field-label-cls} {
22
+ flex-shrink: 0;
23
+ }
24
+ }
25
+
20
26
  &-inline {
21
27
  .@{field-prefix-cls} {
22
28
  display: inline-flex;
package/es/grid/col.js CHANGED
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import classNames from 'classnames';
5
5
  import { getCompProps } from '../_utils';
6
6
  import { ConfigContext } from '../config-provider';
7
+ import { testBrowserType } from '../_utils/testBrowserType';
7
8
 
8
9
  var Col = function Col(props) {
9
10
  var _React$useContext = React.useContext(ConfigContext),
@@ -28,9 +29,11 @@ var Col = function Col(props) {
28
29
  winWidth = _getCompProps.winWidth,
29
30
  children = _getCompProps.children,
30
31
  className = _getCompProps.className,
31
- customPrefixcls = _getCompProps.prefixCls; // className前缀
32
+ customPrefixcls = _getCompProps.prefixCls; // 浏览器名称
32
33
 
33
34
 
35
+ var isSogou = testBrowserType(/^sogou/i, 0); // className前缀
36
+
34
37
  var prefixCls = getPrefixCls(pkgPrefixCls, 'col', customPrefixcls);
35
38
  var columns = 24;
36
39
  var base = {
@@ -97,7 +100,9 @@ var Col = function Col(props) {
97
100
  }, style);
98
101
 
99
102
  return /*#__PURE__*/React.createElement("div", {
100
- className: classNames(prefixCls, className),
103
+ className: classNames(prefixCls, className, {
104
+ 'sogou-col': isSogou
105
+ }),
101
106
  style: styleString
102
107
  }, children);
103
108
  };
package/es/grid/row.js CHANGED
@@ -6,6 +6,7 @@ import classNames from 'classnames';
6
6
  import { getCompProps } from '../_utils';
7
7
  import { ConfigContext } from '../config-provider';
8
8
  import throttle from 'lodash/throttle';
9
+ import { testBrowserType } from '../_utils/testBrowserType';
9
10
 
10
11
  function getGap(gutter, width) {
11
12
  var xs = gutter.xs,
@@ -39,9 +40,11 @@ var Row = function Row(props) {
39
40
  gutter = _getCompProps.gutter,
40
41
  align = _getCompProps.align,
41
42
  justify = _getCompProps.justify,
42
- customPrefixcls = _getCompProps.prefixCls; // className前缀
43
+ customPrefixcls = _getCompProps.prefixCls; // 浏览器名称
43
44
 
44
45
 
46
+ var isSogou = testBrowserType(/^sogou/i, 0); // className前缀
47
+
45
48
  var prefixCls = getPrefixCls(pkgPrefixCls, 'row', customPrefixcls);
46
49
 
47
50
  var _React$useState = React.useState(window.innerWidth),
@@ -99,6 +102,8 @@ var Row = function Row(props) {
99
102
  return /*#__PURE__*/React.createElement("div", {
100
103
  className: classNames(prefixCls, className, {
101
104
  nowrap: !wrap
105
+ }, {
106
+ 'sogou-row': isSogou
102
107
  }),
103
108
  style: styleString
104
109
  }, _mapInstanceProperty(_context = React.Children).call(_context, children, function (child) {
@@ -119,9 +119,15 @@
119
119
  -ms-flex-wrap: nowrap;
120
120
  flex-wrap: nowrap;
121
121
  }
122
+ .kd-row.sogou-row {
123
+ margin-bottom: calc(-1 * var(--rgap));
124
+ }
122
125
  .kd-col {
123
126
  position: relative;
124
127
  -webkit-box-sizing: border-box;
125
128
  box-sizing: border-box;
126
129
  padding: 0 calc(var(--cgap) / 2);
127
130
  }
131
+ .kd-col.sogou-col {
132
+ margin-bottom: var(--rgap);
133
+ }
@@ -13,10 +13,18 @@
13
13
  &.nowrap {
14
14
  flex-wrap: nowrap;
15
15
  }
16
+
17
+ &.sogou-row {
18
+ margin-bottom: calc(-1 * var(--rgap));
19
+ }
16
20
  }
17
21
 
18
22
  .@{col-prefix-cls} {
19
23
  position: relative;
20
24
  box-sizing: border-box;
21
25
  padding: 0 calc(var(--cgap) / 2);
26
+
27
+ &.sogou-col {
28
+ margin-bottom: var(--rgap);
29
+ }
22
30
  }
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { PopperProps } from '../_utils/usePopper';
3
+ import { AvailableVirtualListProps } from '../virtual-list';
3
4
  export declare const SelectSizes: ["large", "middle", "small"];
4
5
  export declare type SelectSize = typeof SelectSizes[number];
5
6
  export declare const BorderTypes: ["none", "underline", "bordered"];
@@ -37,6 +38,7 @@ export interface AbstractSelectProps extends PopperProps {
37
38
  filterOption?: boolean | ((inputValue: string, option?: OptionsType) => boolean);
38
39
  optionFilterProp?: string;
39
40
  optionLabelProp?: string;
41
+ virtualListProps?: AvailableVirtualListProps | boolean;
40
42
  }
41
43
  export interface LabeledValue {
42
44
  key?: string;
@@ -17,6 +17,7 @@ import { toArray } from '../_utils/react-children';
17
17
  import { Icon, Checkbox, Tag } from '../index';
18
18
  import Option from './option';
19
19
  import usePopper from '../_utils/usePopper';
20
+ import VirtualList from '../virtual-list';
20
21
  var INPUT_MIN_WIDTH = 4; // 输入框最小宽度
21
22
 
22
23
  var InternalSelect = function InternalSelect(props, ref) {
@@ -61,7 +62,8 @@ var InternalSelect = function InternalSelect(props, ref) {
61
62
  optionLabelProp = selectProps.optionLabelProp,
62
63
  _selectProps$popperSt = selectProps.popperStyle,
63
64
  popperStyle = _selectProps$popperSt === void 0 ? {} : _selectProps$popperSt,
64
- tagRender = selectProps.tagRender;
65
+ tagRender = selectProps.tagRender,
66
+ virtualListProps = selectProps.virtualListProps;
65
67
  var isMultiple = mode === 'multiple'; // 是否多选
66
68
 
67
69
  var _useMergedState = useMergedState(undefined, {
@@ -411,31 +413,42 @@ var InternalSelect = function InternalSelect(props, ref) {
411
413
  selectedVal = _multipleRef$current3.selectedVal,
412
414
  selectMulOpts = _multipleRef$current3.selectMulOpts;
413
415
 
414
- if (!('value' in selectProps)) {
415
- if ((filledOptions === null || filledOptions === void 0 ? void 0 : filledOptions.length) !== selectedVal.length) {
416
- _mapInstanceProperty(filledOptions).call(filledOptions, function (child) {
417
- var _ref = child.props || child,
418
- value = _ref.value;
419
-
420
- if (!_includesInstanceProperty(selectedVal).call(selectedVal, value)) {
421
- selectedVal.push(value);
422
- selectMulOpts.push({
423
- value: value,
424
- label: getOptionLabel(child)
425
- });
426
- }
427
- });
416
+ var newSelectedVal = _toConsumableArray(selectedVal);
417
+
418
+ var newSelectMulOpts = _toConsumableArray(selectMulOpts);
419
+
420
+ if ((filledOptions === null || filledOptions === void 0 ? void 0 : filledOptions.length) !== newSelectedVal.length) {
421
+ _mapInstanceProperty(filledOptions).call(filledOptions, function (child) {
422
+ var _ref = child.props || child,
423
+ value = _ref.value;
428
424
 
429
- setMulOptions(_toConsumableArray(selectMulOpts));
425
+ if (!_includesInstanceProperty(newSelectedVal).call(newSelectedVal, value)) {
426
+ newSelectedVal.push(value);
427
+ newSelectMulOpts.push({
428
+ value: value,
429
+ label: getOptionLabel(child)
430
+ });
431
+ }
432
+ });
433
+
434
+ if (typeof value === 'undefined') {
435
+ multipleRef.current.selectedVal = newSelectedVal;
436
+ multipleRef.current.selectMulOpts = newSelectMulOpts;
437
+ setMulOptions(_toConsumableArray(newSelectMulOpts));
430
438
  setSearchValue('');
431
- } else {
432
- multipleRef.current.selectedVal = selectedVal = [];
433
- multipleRef.current.selectMulOpts = selectMulOpts = [];
439
+ }
440
+ } else {
441
+ newSelectedVal = [];
442
+ newSelectMulOpts = [];
443
+
444
+ if (typeof value === 'undefined') {
445
+ multipleRef.current.selectedVal = [];
446
+ multipleRef.current.selectMulOpts = [];
434
447
  setMulOptions([]);
435
448
  }
436
449
  }
437
450
 
438
- onChange && onChange(labelInValue ? selectMulOpts : selectedVal, selectMulOpts);
451
+ onChange && onChange(labelInValue ? newSelectMulOpts : newSelectedVal, newSelectMulOpts);
439
452
  }; // 输入框变化搜索内容
440
453
 
441
454
 
@@ -559,6 +572,7 @@ var InternalSelect = function InternalSelect(props, ref) {
559
572
  listHeight = selectProps.listHeight;
560
573
  var selectedVal = multipleRef.current.selectedVal;
561
574
  var childrenToRender = filledOptions;
575
+ var eleOptionList = filledOptions;
562
576
 
563
577
  if (Array.isArray(childrenToRender) && childrenToRender.length > 0) {
564
578
  childrenToRender = _mapInstanceProperty(childrenToRender).call(childrenToRender, function (item, index) {
@@ -566,6 +580,23 @@ var InternalSelect = function InternalSelect(props, ref) {
566
580
  var temp = renderOption(item, index);
567
581
  return temp;
568
582
  });
583
+ eleOptionList = /*#__PURE__*/React.createElement(VirtualList, _extends({
584
+ role: "listbox",
585
+ data: childrenToRender,
586
+ itemKey: function itemKey(child) {
587
+ var _a;
588
+
589
+ return (_a = child.props) === null || _a === void 0 ? void 0 : _a.value;
590
+ },
591
+ onMouseDown: function onMouseDown(e) {
592
+ return e === null || e === void 0 ? void 0 : e.preventDefault();
593
+ },
594
+ isStaticItemHeight: true,
595
+ height: listHeight || 300,
596
+ measureLongestItem: false
597
+ }, virtualListProps), function (child) {
598
+ return child;
599
+ });
569
600
  }
570
601
 
571
602
  var heightStyle = {
@@ -586,7 +617,7 @@ var InternalSelect = function InternalSelect(props, ref) {
586
617
  className: dropDownCls,
587
618
  style: dropDownStyle,
588
619
  ref: dropDownRef
589
- }, !dropdownRender && childrenToRender.length > 0 && dropRender(childrenToRender, heightStyle), renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender && dropdownRender(dropRender(childrenToRender, heightStyle))), isMultiple && /*#__PURE__*/React.createElement("div", {
620
+ }, !dropdownRender && childrenToRender.length > 0 && dropRender(eleOptionList, heightStyle), renderNotContent(), /*#__PURE__*/React.createElement("div", null, dropdownRender && dropdownRender(dropRender(childrenToRender, heightStyle))), isMultiple && /*#__PURE__*/React.createElement("div", {
590
621
  className: multipleFooterCls
591
622
  }, /*#__PURE__*/React.createElement(Checkbox, {
592
623
  style: checkboxStyle,
@@ -298,6 +298,8 @@
298
298
  overflow: hidden;
299
299
  white-space: nowrap;
300
300
  text-overflow: ellipsis;
301
+ right: 28px;
302
+ left: 0;
301
303
  }
302
304
  .kd-select-borderless {
303
305
  border: none;
@@ -67,6 +67,8 @@
67
67
  overflow: hidden;
68
68
  white-space: nowrap;
69
69
  text-overflow: ellipsis;
70
+ right: 28px;
71
+ left: 0;
70
72
  }
71
73
 
72
74
  &-borderless {
@@ -13,6 +13,7 @@ import devWarning from '../_utils/devwarning';
13
13
  import { tuple } from '../_utils/type';
14
14
  import { omit } from '../_utils/omit';
15
15
  import { useMergedState } from '../_utils/hooks';
16
+ import { isExp } from '../_utils/numberUtil';
16
17
  export var StepTypes = tuple('embed', 'base');
17
18
 
18
19
  var InternalStepper = function InternalStepper(props, ref) {
@@ -105,7 +106,7 @@ var InternalStepper = function InternalStepper(props, ref) {
105
106
  return false;
106
107
  }
107
108
 
108
- var startingNumber = parseFloat(stepperrref.current.value) || parseFloat(inputNumberProps.min) || 0;
109
+ var startingNumber = isExp(stepperrref.current.value) ? Big(stepperrref.current.value).valueOf() : stepperrref.current.value || parseFloat(inputNumberProps.min) || 0;
109
110
  var calculationResults = new Big(startingNumber)[type](stepNum).valueOf();
110
111
  var legalNumber = stepperrref.current.verifiValue(calculationResults);
111
112
 
@@ -83,7 +83,7 @@ export var useExpand = function useExpand(flattenAllData, expandedKeysProps, def
83
83
 
84
84
  React.useEffect(function () {
85
85
  setExpandedKeys(initialExpandedKeys);
86
- }, [expandedKeysProps, searchExpandedKeys, defaultExpandAll, defaultExpandedKeys, defaultExpandRoot, defaultExpandParent]);
86
+ }, [flattenAllData, expandedKeysProps, searchExpandedKeys, defaultExpandAll, defaultExpandedKeys, defaultExpandRoot, defaultExpandParent]);
87
87
  return [expandedKeys, setExpandedKeys];
88
88
  };
89
89
  export var useScrollToKey = function useScrollToKey(scrollKey, index, estimatedItemSize, scrollRef, viewportHeight, treeNodePrefixCls) {
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ interface FillerProps {
3
+ height: number;
4
+ offset?: number;
5
+ outerStyle?: React.CSSProperties;
6
+ children: React.ReactNode;
7
+ }
8
+ declare const Filler: React.FC<FillerProps>;
9
+ export default Filler;
@@ -0,0 +1,38 @@
1
+ import _extends from "@babel/runtime-corejs3/helpers/extends";
2
+ import * as React from 'react';
3
+
4
+ var Filler = function Filler(_ref) {
5
+ var height = _ref.height,
6
+ offset = _ref.offset,
7
+ children = _ref.children,
8
+ propsOuterStyle = _ref.outerStyle;
9
+ var outerStyle = {};
10
+ var innerStyle = {
11
+ display: 'flex',
12
+ flexDirection: 'column'
13
+ };
14
+
15
+ if (offset !== undefined) {
16
+ outerStyle = _extends({
17
+ height: height,
18
+ position: 'relative',
19
+ overflow: 'hidden',
20
+ zIndex: 0
21
+ }, propsOuterStyle);
22
+ innerStyle = _extends(_extends({}, innerStyle), {
23
+ transform: "translateY(".concat(offset, "px)"),
24
+ position: 'absolute',
25
+ left: 0,
26
+ right: 0,
27
+ top: 0
28
+ });
29
+ }
30
+
31
+ return /*#__PURE__*/React.createElement("div", {
32
+ style: outerStyle
33
+ }, /*#__PURE__*/React.createElement("div", {
34
+ style: innerStyle
35
+ }, children));
36
+ };
37
+
38
+ export default Filler;
@@ -0,0 +1,3 @@
1
+ import VirtualList from './virtual-list';
2
+ export * from './virtual-list';
3
+ export default VirtualList;
@@ -0,0 +1,3 @@
1
+ import VirtualList from './virtual-list';
2
+ export * from './virtual-list';
3
+ export default VirtualList;
@@ -0,0 +1,19 @@
1
+ import { Key } from './itemUtil';
2
+ /**
3
+ * Get index with specific start index one by one. e.g.
4
+ * min: 3, max: 9, start: 6
5
+ *
6
+ * Return index is:
7
+ * [0]: 6
8
+ * [1]: 7
9
+ * [2]: 5
10
+ * [3]: 8
11
+ * [4]: 4
12
+ * [5]: 9
13
+ * [6]: 3
14
+ */
15
+ export declare function getIndexByStartLoc(min: number, max: number, start: number, index: number): number;
16
+ export declare function findListDiffIndex<T>(originList: T[], targetList: T[], getKey: (item: T, index: number) => Key): {
17
+ index: number;
18
+ multiple: boolean;
19
+ } | null;