@douyinfe/semi-ui 2.52.0-beta.1 → 2.53.0-beta.0

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 (138) hide show
  1. package/dist/css/semi.css +1 -0
  2. package/dist/css/semi.min.css +1 -1
  3. package/dist/umd/semi-ui.js +930 -1249
  4. package/dist/umd/semi-ui.js.map +1 -1
  5. package/dist/umd/semi-ui.min.js +1 -1
  6. package/dist/umd/semi-ui.min.js.map +1 -1
  7. package/lib/cjs/_utils/index.d.ts +2 -0
  8. package/lib/cjs/_utils/index.js +77 -0
  9. package/lib/cjs/_utils/semi-global.d.ts +46 -0
  10. package/lib/cjs/_utils/semi-global.js +13 -0
  11. package/lib/cjs/autoComplete/index.d.ts +2 -25
  12. package/lib/cjs/autoComplete/index.js +4 -2
  13. package/lib/cjs/avatar/index.d.ts +2 -10
  14. package/lib/cjs/avatar/index.js +4 -2
  15. package/lib/cjs/backtop/index.d.ts +2 -5
  16. package/lib/cjs/backtop/index.js +4 -2
  17. package/lib/cjs/button/Button.d.ts +1 -1
  18. package/lib/cjs/button/index.d.ts +3 -1
  19. package/lib/cjs/button/index.js +3 -0
  20. package/lib/cjs/carousel/index.d.ts +2 -2
  21. package/lib/cjs/cascader/index.d.ts +5 -33
  22. package/lib/cjs/cascader/index.js +34 -23
  23. package/lib/cjs/collapse/index.d.ts +2 -7
  24. package/lib/cjs/collapse/index.js +4 -2
  25. package/lib/cjs/collapsible/index.d.ts +3 -9
  26. package/lib/cjs/collapsible/index.js +4 -2
  27. package/lib/cjs/configProvider/index.d.ts +2 -1
  28. package/lib/cjs/configProvider/index.js +5 -2
  29. package/lib/cjs/datePicker/datePicker.d.ts +2 -44
  30. package/lib/cjs/datePicker/datePicker.js +5 -3
  31. package/lib/cjs/datePicker/yearAndMonth.js +20 -16
  32. package/lib/cjs/dropdown/index.d.ts +2 -12
  33. package/lib/cjs/dropdown/index.js +4 -2
  34. package/lib/cjs/form/arrayField.js +3 -3
  35. package/lib/cjs/form/hoc/withField.d.ts +3 -3
  36. package/lib/cjs/modal/Modal.d.ts +2 -20
  37. package/lib/cjs/modal/Modal.js +5 -4
  38. package/lib/cjs/modal/confirm.d.ts +14 -14
  39. package/lib/cjs/navigation/index.d.ts +2 -15
  40. package/lib/cjs/navigation/index.js +4 -2
  41. package/lib/cjs/notification/notice.d.ts +2 -12
  42. package/lib/cjs/notification/notice.js +3 -2
  43. package/lib/cjs/overflowList/index.d.ts +2 -9
  44. package/lib/cjs/overflowList/index.js +3 -2
  45. package/lib/cjs/popconfirm/index.d.ts +2 -15
  46. package/lib/cjs/popconfirm/index.js +4 -2
  47. package/lib/cjs/popover/index.d.ts +2 -23
  48. package/lib/cjs/popover/index.js +4 -2
  49. package/lib/cjs/resizeObserver/index.d.ts +14 -2
  50. package/lib/cjs/resizeObserver/index.js +66 -32
  51. package/lib/cjs/select/index.d.ts +1 -0
  52. package/lib/cjs/select/index.js +3 -2
  53. package/lib/cjs/select/option.js +2 -1
  54. package/lib/cjs/sideSheet/index.d.ts +1 -0
  55. package/lib/cjs/sideSheet/index.js +3 -2
  56. package/lib/cjs/table/ResizableTable.js +1 -1
  57. package/lib/cjs/tabs/index.d.ts +1 -0
  58. package/lib/cjs/tabs/index.js +4 -2
  59. package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
  60. package/lib/cjs/timePicker/index.d.ts +2 -34
  61. package/lib/cjs/timePicker/index.js +3 -1
  62. package/lib/cjs/toast/toast.d.ts +2 -11
  63. package/lib/cjs/toast/toast.js +3 -2
  64. package/lib/cjs/tooltip/index.d.ts +2 -32
  65. package/lib/cjs/tooltip/index.js +3 -2
  66. package/lib/cjs/typography/base.d.ts +7 -4
  67. package/lib/cjs/typography/base.js +127 -64
  68. package/lib/cjs/typography/numeral.d.ts +1 -1
  69. package/lib/cjs/typography/paragraph.d.ts +1 -1
  70. package/lib/cjs/typography/text.d.ts +1 -1
  71. package/lib/cjs/typography/title.d.ts +1 -1
  72. package/lib/es/_utils/index.d.ts +2 -0
  73. package/lib/es/_utils/index.js +75 -0
  74. package/lib/es/_utils/semi-global.d.ts +46 -0
  75. package/lib/es/_utils/semi-global.js +6 -0
  76. package/lib/es/autoComplete/index.d.ts +2 -25
  77. package/lib/es/autoComplete/index.js +4 -2
  78. package/lib/es/avatar/index.d.ts +2 -10
  79. package/lib/es/avatar/index.js +4 -2
  80. package/lib/es/backtop/index.d.ts +2 -5
  81. package/lib/es/backtop/index.js +4 -2
  82. package/lib/es/button/Button.d.ts +1 -1
  83. package/lib/es/button/index.d.ts +3 -1
  84. package/lib/es/button/index.js +3 -0
  85. package/lib/es/carousel/index.d.ts +2 -2
  86. package/lib/es/cascader/index.d.ts +5 -33
  87. package/lib/es/cascader/index.js +35 -24
  88. package/lib/es/collapse/index.d.ts +2 -7
  89. package/lib/es/collapse/index.js +4 -2
  90. package/lib/es/collapsible/index.d.ts +3 -9
  91. package/lib/es/collapsible/index.js +4 -2
  92. package/lib/es/configProvider/index.d.ts +2 -1
  93. package/lib/es/configProvider/index.js +5 -2
  94. package/lib/es/datePicker/datePicker.d.ts +2 -44
  95. package/lib/es/datePicker/datePicker.js +5 -3
  96. package/lib/es/datePicker/yearAndMonth.js +20 -16
  97. package/lib/es/dropdown/index.d.ts +2 -12
  98. package/lib/es/dropdown/index.js +4 -2
  99. package/lib/es/form/arrayField.js +3 -3
  100. package/lib/es/form/hoc/withField.d.ts +3 -3
  101. package/lib/es/modal/Modal.d.ts +2 -20
  102. package/lib/es/modal/Modal.js +6 -5
  103. package/lib/es/modal/confirm.d.ts +14 -14
  104. package/lib/es/navigation/index.d.ts +2 -15
  105. package/lib/es/navigation/index.js +4 -2
  106. package/lib/es/notification/notice.d.ts +2 -12
  107. package/lib/es/notification/notice.js +4 -3
  108. package/lib/es/overflowList/index.d.ts +2 -9
  109. package/lib/es/overflowList/index.js +4 -3
  110. package/lib/es/popconfirm/index.d.ts +2 -15
  111. package/lib/es/popconfirm/index.js +4 -2
  112. package/lib/es/popover/index.d.ts +2 -23
  113. package/lib/es/popover/index.js +4 -2
  114. package/lib/es/resizeObserver/index.d.ts +14 -2
  115. package/lib/es/resizeObserver/index.js +64 -31
  116. package/lib/es/select/index.d.ts +1 -0
  117. package/lib/es/select/index.js +4 -3
  118. package/lib/es/select/option.js +2 -1
  119. package/lib/es/sideSheet/index.d.ts +1 -0
  120. package/lib/es/sideSheet/index.js +4 -3
  121. package/lib/es/table/ResizableTable.js +1 -1
  122. package/lib/es/tabs/index.d.ts +1 -0
  123. package/lib/es/tabs/index.js +4 -2
  124. package/lib/es/timePicker/TimePicker.d.ts +1 -1
  125. package/lib/es/timePicker/index.d.ts +2 -34
  126. package/lib/es/timePicker/index.js +3 -1
  127. package/lib/es/toast/toast.d.ts +2 -11
  128. package/lib/es/toast/toast.js +4 -3
  129. package/lib/es/tooltip/index.d.ts +2 -32
  130. package/lib/es/tooltip/index.js +4 -3
  131. package/lib/es/typography/base.d.ts +7 -4
  132. package/lib/es/typography/base.js +128 -65
  133. package/lib/es/typography/numeral.d.ts +1 -1
  134. package/lib/es/typography/paragraph.d.ts +1 -1
  135. package/lib/es/typography/text.d.ts +1 -1
  136. package/lib/es/typography/title.d.ts +1 -1
  137. package/package.json +9 -9
  138. package/dist/umd/semi-ui.min.js.LICENSE.txt +0 -5
@@ -9125,42 +9125,6 @@ function clone(value) {
9125
9125
  module.exports = clone;
9126
9126
 
9127
9127
 
9128
- /***/ }),
9129
-
9130
- /***/ "c2re":
9131
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9132
-
9133
- var baseClone = __webpack_require__("kn3Q");
9134
-
9135
- /** Used to compose bitmasks for cloning. */
9136
- var CLONE_DEEP_FLAG = 1,
9137
- CLONE_SYMBOLS_FLAG = 4;
9138
-
9139
- /**
9140
- * This method is like `_.clone` except that it recursively clones `value`.
9141
- *
9142
- * @static
9143
- * @memberOf _
9144
- * @since 1.0.0
9145
- * @category Lang
9146
- * @param {*} value The value to recursively clone.
9147
- * @returns {*} Returns the deep cloned value.
9148
- * @see _.clone
9149
- * @example
9150
- *
9151
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
9152
- *
9153
- * var deep = _.cloneDeep(objects);
9154
- * console.log(deep[0] === objects[0]);
9155
- * // => false
9156
- */
9157
- function cloneDeep(value) {
9158
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
9159
- }
9160
-
9161
- module.exports = cloneDeep;
9162
-
9163
-
9164
9128
  /***/ }),
9165
9129
 
9166
9130
  /***/ "NdXQ":
@@ -18633,6 +18597,7 @@ class foundation_Tooltip extends foundation {
18633
18597
  return null;
18634
18598
  }
18635
18599
  calcPosStyle(props) {
18600
+ var _a;
18636
18601
  const {
18637
18602
  spacing,
18638
18603
  isOverFlow
@@ -18683,6 +18648,10 @@ class foundation_Tooltip extends foundation {
18683
18648
  const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
18684
18649
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
18685
18650
  const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
18651
+ const scaled = Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1;
18652
+ if (scaled) {
18653
+ SPACING = SPACING * wrapperRect.width / this._adapter.getContainer().clientWidth;
18654
+ }
18686
18655
  switch (position) {
18687
18656
  case 'top':
18688
18657
  // left = middleX;
@@ -18799,6 +18768,12 @@ class foundation_Tooltip extends foundation {
18799
18768
  // Calculate container positioning relative to window
18800
18769
  left = left - containerRect.left;
18801
18770
  top = top - containerRect.top;
18771
+ if (scaled) {
18772
+ left /= wrapperRect.width / this._adapter.getContainer().clientWidth;
18773
+ }
18774
+ if (scaled) {
18775
+ top /= wrapperRect.height / this._adapter.getContainer().clientHeight;
18776
+ }
18802
18777
  /**
18803
18778
  * container为body时,如果position不为relative或absolute,这时trigger计算出的top/left会根据html定位(initial containing block)
18804
18779
  * 此时如果body有margin,则计算出的位置相对于body会有问题 fix issue #1368
@@ -19574,10 +19549,45 @@ const findAll = _ref4 => {
19574
19549
  return result;
19575
19550
  };
19576
19551
 
19552
+ ;// CONCATENATED MODULE: ./_utils/semi-global.ts
19553
+ class SemiGlobal {
19554
+ constructor() {
19555
+ this.config = {};
19556
+ }
19557
+ }
19558
+ /* harmony default export */ const semi_global = (new SemiGlobal());
19577
19559
  ;// CONCATENATED MODULE: ./_utils/index.tsx
19578
19560
 
19579
19561
 
19580
19562
 
19563
+ var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
19564
+ function adopt(value) {
19565
+ return value instanceof P ? value : new P(function (resolve) {
19566
+ resolve(value);
19567
+ });
19568
+ }
19569
+ return new (P || (P = Promise))(function (resolve, reject) {
19570
+ function fulfilled(value) {
19571
+ try {
19572
+ step(generator.next(value));
19573
+ } catch (e) {
19574
+ reject(e);
19575
+ }
19576
+ }
19577
+ function rejected(value) {
19578
+ try {
19579
+ step(generator["throw"](value));
19580
+ } catch (e) {
19581
+ reject(e);
19582
+ }
19583
+ }
19584
+ function step(result) {
19585
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
19586
+ }
19587
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19588
+ });
19589
+ };
19590
+
19581
19591
 
19582
19592
 
19583
19593
 
@@ -19731,12 +19741,59 @@ function getFocusableElements(node) {
19731
19741
  const focusableElements = Array.from(node.querySelectorAll(focusableSelectorsStr));
19732
19742
  return focusableElements;
19733
19743
  }
19744
+ function runAfterTicks(func, numberOfTicks) {
19745
+ return __awaiter(this, void 0, void 0, function* () {
19746
+ if (numberOfTicks === 0) {
19747
+ yield func();
19748
+ return;
19749
+ } else {
19750
+ yield new Promise(resolve => {
19751
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
19752
+ yield runAfterTicks(func, numberOfTicks - 1);
19753
+ resolve();
19754
+ }), 0);
19755
+ });
19756
+ return;
19757
+ }
19758
+ });
19759
+ }
19734
19760
  function getScrollbarWidth() {
19735
19761
  if (globalThis && Object.prototype.toString.call(globalThis) === '[object Window]') {
19736
19762
  return window.innerWidth - document.documentElement.clientWidth;
19737
19763
  }
19738
19764
  return 0;
19739
19765
  }
19766
+ function getDefaultPropsFromGlobalConfig(componentName) {
19767
+ let semiDefaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
19768
+ const getFromGlobalConfig = () => {
19769
+ var _a, _b;
19770
+ return ((_b = (_a = semi_global === null || semi_global === void 0 ? void 0 : semi_global.config) === null || _a === void 0 ? void 0 : _a.overrideDefaultProps) === null || _b === void 0 ? void 0 : _b[componentName]) || {};
19771
+ };
19772
+ return new Proxy(Object.assign({}, semiDefaultProps), {
19773
+ get(target, key, receiver) {
19774
+ const defaultPropsFromGlobal = getFromGlobalConfig();
19775
+ if (key in defaultPropsFromGlobal) {
19776
+ return defaultPropsFromGlobal[key];
19777
+ }
19778
+ return Reflect.get(target, key, receiver);
19779
+ },
19780
+ set(target, key, value, receiver) {
19781
+ return Reflect.set(target, key, value, receiver);
19782
+ },
19783
+ ownKeys() {
19784
+ const defaultPropsFromGlobal = getFromGlobalConfig();
19785
+ return Array.from(new Set([...Reflect.ownKeys(semiDefaultProps), ...Object.keys(defaultPropsFromGlobal)]));
19786
+ },
19787
+ getOwnPropertyDescriptor(target, key) {
19788
+ const defaultPropsFromGlobal = getFromGlobalConfig();
19789
+ if (key in defaultPropsFromGlobal) {
19790
+ return Reflect.getOwnPropertyDescriptor(defaultPropsFromGlobal, key);
19791
+ } else {
19792
+ return Reflect.getOwnPropertyDescriptor(target, key);
19793
+ }
19794
+ }
19795
+ });
19796
+ }
19740
19797
  ;// CONCATENATED MODULE: ./configProvider/context.tsx
19741
19798
 
19742
19799
  const ConfigContext = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createContext({});
@@ -20710,7 +20767,8 @@ Tooltip.propTypes = {
20710
20767
  preventScroll: (prop_types_default()).bool,
20711
20768
  keepDOM: (prop_types_default()).bool
20712
20769
  };
20713
- Tooltip.defaultProps = {
20770
+ Tooltip.__SemiComponentName__ = "Tooltip";
20771
+ Tooltip.defaultProps = getDefaultPropsFromGlobalConfig(Tooltip.__SemiComponentName__, {
20714
20772
  arrowBounding: numbers.ARROW_BOUNDING,
20715
20773
  autoAdjustOverflow: true,
20716
20774
  arrowPointAtCenter: true,
@@ -20736,7 +20794,7 @@ Tooltip.defaultProps = {
20736
20794
  disableFocusListener: false,
20737
20795
  disableArrowKeyDown: false,
20738
20796
  keepDOM: false
20739
- };
20797
+ });
20740
20798
  // EXTERNAL MODULE: ../../node_modules/copy-text-to-clipboard/index.js
20741
20799
  var copy_text_to_clipboard = __webpack_require__("HDX/");
20742
20800
  var copy_text_to_clipboard_default = /*#__PURE__*/__webpack_require__.n(copy_text_to_clipboard);
@@ -22376,6 +22434,7 @@ var popover_rest = undefined && undefined.__rest || function (s, e) {
22376
22434
 
22377
22435
 
22378
22436
 
22437
+
22379
22438
  const popover_positionSet = popover_constants_strings.POSITION_SET;
22380
22439
  const popover_triggerSet = popover_constants_strings.TRIGGER_SET;
22381
22440
  class Popover extends (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent {
@@ -22499,7 +22558,8 @@ Popover.propTypes = {
22499
22558
  guardFocus: (prop_types_default()).bool,
22500
22559
  disableArrowKeyDown: (prop_types_default()).bool
22501
22560
  };
22502
- Popover.defaultProps = {
22561
+ Popover.__SemiComponentName__ = "Popover";
22562
+ Popover.defaultProps = getDefaultPropsFromGlobalConfig(Popover.__SemiComponentName__, {
22503
22563
  arrowBounding: constants_numbers.ARROW_BOUNDING,
22504
22564
  showArrow: false,
22505
22565
  autoAdjustOverflow: true,
@@ -22516,7 +22576,7 @@ Popover.defaultProps = {
22516
22576
  returnFocusOnClose: true,
22517
22577
  guardFocus: true,
22518
22578
  disableFocusListener: true
22519
- };
22579
+ });
22520
22580
  /* harmony default export */ const popover_0 = (Popover);
22521
22581
  ;// CONCATENATED MODULE: ./typography/util.tsx
22522
22582
 
@@ -22648,945 +22708,23 @@ const getRenderText = function (originEle, rows) {
22648
22708
  return resText;
22649
22709
  };
22650
22710
  /* harmony default export */ const util = (getRenderText);
22651
- ;// CONCATENATED MODULE: ../../node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js
22652
- /**
22653
- * A collection of shims that provide minimal functionality of the ES6 collections.
22654
- *
22655
- * These implementations are not meant to be used outside of the ResizeObserver
22656
- * modules as they cover only a limited range of use cases.
22657
- */
22658
- /* eslint-disable require-jsdoc, valid-jsdoc */
22659
- var MapShim = (function () {
22660
- if (typeof Map !== 'undefined') {
22661
- return Map;
22662
- }
22663
- /**
22664
- * Returns index in provided array that matches the specified key.
22665
- *
22666
- * @param {Array<Array>} arr
22667
- * @param {*} key
22668
- * @returns {number}
22669
- */
22670
- function getIndex(arr, key) {
22671
- var result = -1;
22672
- arr.some(function (entry, index) {
22673
- if (entry[0] === key) {
22674
- result = index;
22675
- return true;
22676
- }
22677
- return false;
22678
- });
22679
- return result;
22680
- }
22681
- return /** @class */ (function () {
22682
- function class_1() {
22683
- this.__entries__ = [];
22684
- }
22685
- Object.defineProperty(class_1.prototype, "size", {
22686
- /**
22687
- * @returns {boolean}
22688
- */
22689
- get: function () {
22690
- return this.__entries__.length;
22691
- },
22692
- enumerable: true,
22693
- configurable: true
22694
- });
22695
- /**
22696
- * @param {*} key
22697
- * @returns {*}
22698
- */
22699
- class_1.prototype.get = function (key) {
22700
- var index = getIndex(this.__entries__, key);
22701
- var entry = this.__entries__[index];
22702
- return entry && entry[1];
22703
- };
22704
- /**
22705
- * @param {*} key
22706
- * @param {*} value
22707
- * @returns {void}
22708
- */
22709
- class_1.prototype.set = function (key, value) {
22710
- var index = getIndex(this.__entries__, key);
22711
- if (~index) {
22712
- this.__entries__[index][1] = value;
22713
- }
22714
- else {
22715
- this.__entries__.push([key, value]);
22716
- }
22717
- };
22718
- /**
22719
- * @param {*} key
22720
- * @returns {void}
22721
- */
22722
- class_1.prototype.delete = function (key) {
22723
- var entries = this.__entries__;
22724
- var index = getIndex(entries, key);
22725
- if (~index) {
22726
- entries.splice(index, 1);
22727
- }
22728
- };
22729
- /**
22730
- * @param {*} key
22731
- * @returns {void}
22732
- */
22733
- class_1.prototype.has = function (key) {
22734
- return !!~getIndex(this.__entries__, key);
22735
- };
22736
- /**
22737
- * @returns {void}
22738
- */
22739
- class_1.prototype.clear = function () {
22740
- this.__entries__.splice(0);
22741
- };
22742
- /**
22743
- * @param {Function} callback
22744
- * @param {*} [ctx=null]
22745
- * @returns {void}
22746
- */
22747
- class_1.prototype.forEach = function (callback, ctx) {
22748
- if (ctx === void 0) { ctx = null; }
22749
- for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
22750
- var entry = _a[_i];
22751
- callback.call(ctx, entry[1], entry[0]);
22752
- }
22753
- };
22754
- return class_1;
22755
- }());
22756
- })();
22757
-
22758
- /**
22759
- * Detects whether window and document objects are available in current environment.
22760
- */
22761
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && window.document === document;
22762
-
22763
- // Returns global object of a current environment.
22764
- var global$1 = (function () {
22765
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.Math === Math) {
22766
- return __webpack_require__.g;
22767
- }
22768
- if (typeof self !== 'undefined' && self.Math === Math) {
22769
- return self;
22770
- }
22771
- if (typeof window !== 'undefined' && window.Math === Math) {
22772
- return window;
22773
- }
22774
- // eslint-disable-next-line no-new-func
22775
- return Function('return this')();
22776
- })();
22777
-
22778
- /**
22779
- * A shim for the requestAnimationFrame which falls back to the setTimeout if
22780
- * first one is not supported.
22781
- *
22782
- * @returns {number} Requests' identifier.
22783
- */
22784
- var requestAnimationFrame$1 = (function () {
22785
- if (typeof requestAnimationFrame === 'function') {
22786
- // It's required to use a bounded function because IE sometimes throws
22787
- // an "Invalid calling object" error if rAF is invoked without the global
22788
- // object on the left hand side.
22789
- return requestAnimationFrame.bind(global$1);
22790
- }
22791
- return function (callback) { return setTimeout(function () { return callback(Date.now()); }, 1000 / 60); };
22792
- })();
22793
-
22794
- // Defines minimum timeout before adding a trailing call.
22795
- var trailingTimeout = 2;
22796
- /**
22797
- * Creates a wrapper function which ensures that provided callback will be
22798
- * invoked only once during the specified delay period.
22799
- *
22800
- * @param {Function} callback - Function to be invoked after the delay period.
22801
- * @param {number} delay - Delay after which to invoke callback.
22802
- * @returns {Function}
22803
- */
22804
- function ResizeObserver_es_throttle (callback, delay) {
22805
- var leadingCall = false, trailingCall = false, lastCallTime = 0;
22806
- /**
22807
- * Invokes the original callback function and schedules new invocation if
22808
- * the "proxy" was called during current request.
22809
- *
22810
- * @returns {void}
22811
- */
22812
- function resolvePending() {
22813
- if (leadingCall) {
22814
- leadingCall = false;
22815
- callback();
22816
- }
22817
- if (trailingCall) {
22818
- proxy();
22819
- }
22820
- }
22821
- /**
22822
- * Callback invoked after the specified delay. It will further postpone
22823
- * invocation of the original function delegating it to the
22824
- * requestAnimationFrame.
22825
- *
22826
- * @returns {void}
22827
- */
22828
- function timeoutCallback() {
22829
- requestAnimationFrame$1(resolvePending);
22830
- }
22831
- /**
22832
- * Schedules invocation of the original function.
22833
- *
22834
- * @returns {void}
22835
- */
22836
- function proxy() {
22837
- var timeStamp = Date.now();
22838
- if (leadingCall) {
22839
- // Reject immediately following calls.
22840
- if (timeStamp - lastCallTime < trailingTimeout) {
22841
- return;
22842
- }
22843
- // Schedule new call to be in invoked when the pending one is resolved.
22844
- // This is important for "transitions" which never actually start
22845
- // immediately so there is a chance that we might miss one if change
22846
- // happens amids the pending invocation.
22847
- trailingCall = true;
22848
- }
22849
- else {
22850
- leadingCall = true;
22851
- trailingCall = false;
22852
- setTimeout(timeoutCallback, delay);
22853
- }
22854
- lastCallTime = timeStamp;
22855
- }
22856
- return proxy;
22857
- }
22858
-
22859
- // Minimum delay before invoking the update of observers.
22860
- var REFRESH_DELAY = 20;
22861
- // A list of substrings of CSS properties used to find transition events that
22862
- // might affect dimensions of observed elements.
22863
- var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
22864
- // Check if MutationObserver is available.
22865
- var mutationObserverSupported = typeof MutationObserver !== 'undefined';
22866
- /**
22867
- * Singleton controller class which handles updates of ResizeObserver instances.
22868
- */
22869
- var ResizeObserverController = /** @class */ (function () {
22870
- /**
22871
- * Creates a new instance of ResizeObserverController.
22872
- *
22873
- * @private
22874
- */
22875
- function ResizeObserverController() {
22876
- /**
22877
- * Indicates whether DOM listeners have been added.
22878
- *
22879
- * @private {boolean}
22880
- */
22881
- this.connected_ = false;
22882
- /**
22883
- * Tells that controller has subscribed for Mutation Events.
22884
- *
22885
- * @private {boolean}
22886
- */
22887
- this.mutationEventsAdded_ = false;
22888
- /**
22889
- * Keeps reference to the instance of MutationObserver.
22890
- *
22891
- * @private {MutationObserver}
22892
- */
22893
- this.mutationsObserver_ = null;
22894
- /**
22895
- * A list of connected observers.
22896
- *
22897
- * @private {Array<ResizeObserverSPI>}
22898
- */
22899
- this.observers_ = [];
22900
- this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
22901
- this.refresh = ResizeObserver_es_throttle(this.refresh.bind(this), REFRESH_DELAY);
22902
- }
22903
- /**
22904
- * Adds observer to observers list.
22905
- *
22906
- * @param {ResizeObserverSPI} observer - Observer to be added.
22907
- * @returns {void}
22908
- */
22909
- ResizeObserverController.prototype.addObserver = function (observer) {
22910
- if (!~this.observers_.indexOf(observer)) {
22911
- this.observers_.push(observer);
22912
- }
22913
- // Add listeners if they haven't been added yet.
22914
- if (!this.connected_) {
22915
- this.connect_();
22916
- }
22917
- };
22918
- /**
22919
- * Removes observer from observers list.
22920
- *
22921
- * @param {ResizeObserverSPI} observer - Observer to be removed.
22922
- * @returns {void}
22923
- */
22924
- ResizeObserverController.prototype.removeObserver = function (observer) {
22925
- var observers = this.observers_;
22926
- var index = observers.indexOf(observer);
22927
- // Remove observer if it's present in registry.
22928
- if (~index) {
22929
- observers.splice(index, 1);
22930
- }
22931
- // Remove listeners if controller has no connected observers.
22932
- if (!observers.length && this.connected_) {
22933
- this.disconnect_();
22934
- }
22935
- };
22936
- /**
22937
- * Invokes the update of observers. It will continue running updates insofar
22938
- * it detects changes.
22939
- *
22940
- * @returns {void}
22941
- */
22942
- ResizeObserverController.prototype.refresh = function () {
22943
- var changesDetected = this.updateObservers_();
22944
- // Continue running updates if changes have been detected as there might
22945
- // be future ones caused by CSS transitions.
22946
- if (changesDetected) {
22947
- this.refresh();
22948
- }
22949
- };
22950
- /**
22951
- * Updates every observer from observers list and notifies them of queued
22952
- * entries.
22953
- *
22954
- * @private
22955
- * @returns {boolean} Returns "true" if any observer has detected changes in
22956
- * dimensions of it's elements.
22957
- */
22958
- ResizeObserverController.prototype.updateObservers_ = function () {
22959
- // Collect observers that have active observations.
22960
- var activeObservers = this.observers_.filter(function (observer) {
22961
- return observer.gatherActive(), observer.hasActive();
22962
- });
22963
- // Deliver notifications in a separate cycle in order to avoid any
22964
- // collisions between observers, e.g. when multiple instances of
22965
- // ResizeObserver are tracking the same element and the callback of one
22966
- // of them changes content dimensions of the observed target. Sometimes
22967
- // this may result in notifications being blocked for the rest of observers.
22968
- activeObservers.forEach(function (observer) { return observer.broadcastActive(); });
22969
- return activeObservers.length > 0;
22970
- };
22971
- /**
22972
- * Initializes DOM listeners.
22973
- *
22974
- * @private
22975
- * @returns {void}
22976
- */
22977
- ResizeObserverController.prototype.connect_ = function () {
22978
- // Do nothing if running in a non-browser environment or if listeners
22979
- // have been already added.
22980
- if (!isBrowser || this.connected_) {
22981
- return;
22982
- }
22983
- // Subscription to the "Transitionend" event is used as a workaround for
22984
- // delayed transitions. This way it's possible to capture at least the
22985
- // final state of an element.
22986
- document.addEventListener('transitionend', this.onTransitionEnd_);
22987
- window.addEventListener('resize', this.refresh);
22988
- if (mutationObserverSupported) {
22989
- this.mutationsObserver_ = new MutationObserver(this.refresh);
22990
- this.mutationsObserver_.observe(document, {
22991
- attributes: true,
22992
- childList: true,
22993
- characterData: true,
22994
- subtree: true
22995
- });
22996
- }
22997
- else {
22998
- document.addEventListener('DOMSubtreeModified', this.refresh);
22999
- this.mutationEventsAdded_ = true;
23000
- }
23001
- this.connected_ = true;
23002
- };
23003
- /**
23004
- * Removes DOM listeners.
23005
- *
23006
- * @private
23007
- * @returns {void}
23008
- */
23009
- ResizeObserverController.prototype.disconnect_ = function () {
23010
- // Do nothing if running in a non-browser environment or if listeners
23011
- // have been already removed.
23012
- if (!isBrowser || !this.connected_) {
23013
- return;
23014
- }
23015
- document.removeEventListener('transitionend', this.onTransitionEnd_);
23016
- window.removeEventListener('resize', this.refresh);
23017
- if (this.mutationsObserver_) {
23018
- this.mutationsObserver_.disconnect();
23019
- }
23020
- if (this.mutationEventsAdded_) {
23021
- document.removeEventListener('DOMSubtreeModified', this.refresh);
23022
- }
23023
- this.mutationsObserver_ = null;
23024
- this.mutationEventsAdded_ = false;
23025
- this.connected_ = false;
23026
- };
23027
- /**
23028
- * "Transitionend" event handler.
23029
- *
23030
- * @private
23031
- * @param {TransitionEvent} event
23032
- * @returns {void}
23033
- */
23034
- ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
23035
- var _b = _a.propertyName, propertyName = _b === void 0 ? '' : _b;
23036
- // Detect whether transition may affect dimensions of an element.
23037
- var isReflowProperty = transitionKeys.some(function (key) {
23038
- return !!~propertyName.indexOf(key);
23039
- });
23040
- if (isReflowProperty) {
23041
- this.refresh();
23042
- }
23043
- };
23044
- /**
23045
- * Returns instance of the ResizeObserverController.
23046
- *
23047
- * @returns {ResizeObserverController}
23048
- */
23049
- ResizeObserverController.getInstance = function () {
23050
- if (!this.instance_) {
23051
- this.instance_ = new ResizeObserverController();
23052
- }
23053
- return this.instance_;
23054
- };
23055
- /**
23056
- * Holds reference to the controller's instance.
23057
- *
23058
- * @private {ResizeObserverController}
23059
- */
23060
- ResizeObserverController.instance_ = null;
23061
- return ResizeObserverController;
23062
- }());
23063
-
23064
- /**
23065
- * Defines non-writable/enumerable properties of the provided target object.
23066
- *
23067
- * @param {Object} target - Object for which to define properties.
23068
- * @param {Object} props - Properties to be defined.
23069
- * @returns {Object} Target object.
23070
- */
23071
- var defineConfigurable = (function (target, props) {
23072
- for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
23073
- var key = _a[_i];
23074
- Object.defineProperty(target, key, {
23075
- value: props[key],
23076
- enumerable: false,
23077
- writable: false,
23078
- configurable: true
23079
- });
23080
- }
23081
- return target;
23082
- });
23083
-
23084
- /**
23085
- * Returns the global object associated with provided element.
23086
- *
23087
- * @param {Object} target
23088
- * @returns {Object}
23089
- */
23090
- var getWindowOf = (function (target) {
23091
- // Assume that the element is an instance of Node, which means that it
23092
- // has the "ownerDocument" property from which we can retrieve a
23093
- // corresponding global object.
23094
- var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
23095
- // Return the local global object if it's not possible extract one from
23096
- // provided element.
23097
- return ownerGlobal || global$1;
23098
- });
23099
-
23100
- // Placeholder of an empty content rectangle.
23101
- var emptyRect = createRectInit(0, 0, 0, 0);
23102
- /**
23103
- * Converts provided string to a number.
23104
- *
23105
- * @param {number|string} value
23106
- * @returns {number}
23107
- */
23108
- function toFloat(value) {
23109
- return parseFloat(value) || 0;
23110
- }
23111
- /**
23112
- * Extracts borders size from provided styles.
23113
- *
23114
- * @param {CSSStyleDeclaration} styles
23115
- * @param {...string} positions - Borders positions (top, right, ...)
23116
- * @returns {number}
23117
- */
23118
- function getBordersSize(styles) {
23119
- var positions = [];
23120
- for (var _i = 1; _i < arguments.length; _i++) {
23121
- positions[_i - 1] = arguments[_i];
23122
- }
23123
- return positions.reduce(function (size, position) {
23124
- var value = styles['border-' + position + '-width'];
23125
- return size + toFloat(value);
23126
- }, 0);
23127
- }
23128
- /**
23129
- * Extracts paddings sizes from provided styles.
23130
- *
23131
- * @param {CSSStyleDeclaration} styles
23132
- * @returns {Object} Paddings box.
23133
- */
23134
- function getPaddings(styles) {
23135
- var positions = ['top', 'right', 'bottom', 'left'];
23136
- var paddings = {};
23137
- for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
23138
- var position = positions_1[_i];
23139
- var value = styles['padding-' + position];
23140
- paddings[position] = toFloat(value);
23141
- }
23142
- return paddings;
23143
- }
23144
- /**
23145
- * Calculates content rectangle of provided SVG element.
23146
- *
23147
- * @param {SVGGraphicsElement} target - Element content rectangle of which needs
23148
- * to be calculated.
23149
- * @returns {DOMRectInit}
23150
- */
23151
- function getSVGContentRect(target) {
23152
- var bbox = target.getBBox();
23153
- return createRectInit(0, 0, bbox.width, bbox.height);
23154
- }
23155
- /**
23156
- * Calculates content rectangle of provided HTMLElement.
23157
- *
23158
- * @param {HTMLElement} target - Element for which to calculate the content rectangle.
23159
- * @returns {DOMRectInit}
23160
- */
23161
- function getHTMLElementContentRect(target) {
23162
- // Client width & height properties can't be
23163
- // used exclusively as they provide rounded values.
23164
- var clientWidth = target.clientWidth, clientHeight = target.clientHeight;
23165
- // By this condition we can catch all non-replaced inline, hidden and
23166
- // detached elements. Though elements with width & height properties less
23167
- // than 0.5 will be discarded as well.
23168
- //
23169
- // Without it we would need to implement separate methods for each of
23170
- // those cases and it's not possible to perform a precise and performance
23171
- // effective test for hidden elements. E.g. even jQuery's ':visible' filter
23172
- // gives wrong results for elements with width & height less than 0.5.
23173
- if (!clientWidth && !clientHeight) {
23174
- return emptyRect;
23175
- }
23176
- var styles = getWindowOf(target).getComputedStyle(target);
23177
- var paddings = getPaddings(styles);
23178
- var horizPad = paddings.left + paddings.right;
23179
- var vertPad = paddings.top + paddings.bottom;
23180
- // Computed styles of width & height are being used because they are the
23181
- // only dimensions available to JS that contain non-rounded values. It could
23182
- // be possible to utilize the getBoundingClientRect if only it's data wasn't
23183
- // affected by CSS transformations let alone paddings, borders and scroll bars.
23184
- var width = toFloat(styles.width), height = toFloat(styles.height);
23185
- // Width & height include paddings and borders when the 'border-box' box
23186
- // model is applied (except for IE).
23187
- if (styles.boxSizing === 'border-box') {
23188
- // Following conditions are required to handle Internet Explorer which
23189
- // doesn't include paddings and borders to computed CSS dimensions.
23190
- //
23191
- // We can say that if CSS dimensions + paddings are equal to the "client"
23192
- // properties then it's either IE, and thus we don't need to subtract
23193
- // anything, or an element merely doesn't have paddings/borders styles.
23194
- if (Math.round(width + horizPad) !== clientWidth) {
23195
- width -= getBordersSize(styles, 'left', 'right') + horizPad;
23196
- }
23197
- if (Math.round(height + vertPad) !== clientHeight) {
23198
- height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
23199
- }
23200
- }
23201
- // Following steps can't be applied to the document's root element as its
23202
- // client[Width/Height] properties represent viewport area of the window.
23203
- // Besides, it's as well not necessary as the <html> itself neither has
23204
- // rendered scroll bars nor it can be clipped.
23205
- if (!isDocumentElement(target)) {
23206
- // In some browsers (only in Firefox, actually) CSS width & height
23207
- // include scroll bars size which can be removed at this step as scroll
23208
- // bars are the only difference between rounded dimensions + paddings
23209
- // and "client" properties, though that is not always true in Chrome.
23210
- var vertScrollbar = Math.round(width + horizPad) - clientWidth;
23211
- var horizScrollbar = Math.round(height + vertPad) - clientHeight;
23212
- // Chrome has a rather weird rounding of "client" properties.
23213
- // E.g. for an element with content width of 314.2px it sometimes gives
23214
- // the client width of 315px and for the width of 314.7px it may give
23215
- // 314px. And it doesn't happen all the time. So just ignore this delta
23216
- // as a non-relevant.
23217
- if (Math.abs(vertScrollbar) !== 1) {
23218
- width -= vertScrollbar;
23219
- }
23220
- if (Math.abs(horizScrollbar) !== 1) {
23221
- height -= horizScrollbar;
23222
- }
23223
- }
23224
- return createRectInit(paddings.left, paddings.top, width, height);
23225
- }
23226
- /**
23227
- * Checks whether provided element is an instance of the SVGGraphicsElement.
23228
- *
23229
- * @param {Element} target - Element to be checked.
23230
- * @returns {boolean}
23231
- */
23232
- var isSVGGraphicsElement = (function () {
23233
- // Some browsers, namely IE and Edge, don't have the SVGGraphicsElement
23234
- // interface.
23235
- if (typeof SVGGraphicsElement !== 'undefined') {
23236
- return function (target) { return target instanceof getWindowOf(target).SVGGraphicsElement; };
23237
- }
23238
- // If it's so, then check that element is at least an instance of the
23239
- // SVGElement and that it has the "getBBox" method.
23240
- // eslint-disable-next-line no-extra-parens
23241
- return function (target) { return (target instanceof getWindowOf(target).SVGElement &&
23242
- typeof target.getBBox === 'function'); };
23243
- })();
23244
- /**
23245
- * Checks whether provided element is a document element (<html>).
23246
- *
23247
- * @param {Element} target - Element to be checked.
23248
- * @returns {boolean}
23249
- */
23250
- function isDocumentElement(target) {
23251
- return target === getWindowOf(target).document.documentElement;
23252
- }
23253
- /**
23254
- * Calculates an appropriate content rectangle for provided html or svg element.
23255
- *
23256
- * @param {Element} target - Element content rectangle of which needs to be calculated.
23257
- * @returns {DOMRectInit}
23258
- */
23259
- function getContentRect(target) {
23260
- if (!isBrowser) {
23261
- return emptyRect;
23262
- }
23263
- if (isSVGGraphicsElement(target)) {
23264
- return getSVGContentRect(target);
23265
- }
23266
- return getHTMLElementContentRect(target);
23267
- }
23268
- /**
23269
- * Creates rectangle with an interface of the DOMRectReadOnly.
23270
- * Spec: https://drafts.fxtf.org/geometry/#domrectreadonly
23271
- *
23272
- * @param {DOMRectInit} rectInit - Object with rectangle's x/y coordinates and dimensions.
23273
- * @returns {DOMRectReadOnly}
23274
- */
23275
- function createReadOnlyRect(_a) {
23276
- var x = _a.x, y = _a.y, width = _a.width, height = _a.height;
23277
- // If DOMRectReadOnly is available use it as a prototype for the rectangle.
23278
- var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
23279
- var rect = Object.create(Constr.prototype);
23280
- // Rectangle's properties are not writable and non-enumerable.
23281
- defineConfigurable(rect, {
23282
- x: x, y: y, width: width, height: height,
23283
- top: y,
23284
- right: x + width,
23285
- bottom: height + y,
23286
- left: x
23287
- });
23288
- return rect;
23289
- }
23290
- /**
23291
- * Creates DOMRectInit object based on the provided dimensions and the x/y coordinates.
23292
- * Spec: https://drafts.fxtf.org/geometry/#dictdef-domrectinit
23293
- *
23294
- * @param {number} x - X coordinate.
23295
- * @param {number} y - Y coordinate.
23296
- * @param {number} width - Rectangle's width.
23297
- * @param {number} height - Rectangle's height.
23298
- * @returns {DOMRectInit}
23299
- */
23300
- function createRectInit(x, y, width, height) {
23301
- return { x: x, y: y, width: width, height: height };
23302
- }
23303
-
23304
- /**
23305
- * Class that is responsible for computations of the content rectangle of
23306
- * provided DOM element and for keeping track of it's changes.
23307
- */
23308
- var ResizeObservation = /** @class */ (function () {
23309
- /**
23310
- * Creates an instance of ResizeObservation.
23311
- *
23312
- * @param {Element} target - Element to be observed.
23313
- */
23314
- function ResizeObservation(target) {
23315
- /**
23316
- * Broadcasted width of content rectangle.
23317
- *
23318
- * @type {number}
23319
- */
23320
- this.broadcastWidth = 0;
23321
- /**
23322
- * Broadcasted height of content rectangle.
23323
- *
23324
- * @type {number}
23325
- */
23326
- this.broadcastHeight = 0;
23327
- /**
23328
- * Reference to the last observed content rectangle.
23329
- *
23330
- * @private {DOMRectInit}
23331
- */
23332
- this.contentRect_ = createRectInit(0, 0, 0, 0);
23333
- this.target = target;
23334
- }
23335
- /**
23336
- * Updates content rectangle and tells whether it's width or height properties
23337
- * have changed since the last broadcast.
23338
- *
23339
- * @returns {boolean}
23340
- */
23341
- ResizeObservation.prototype.isActive = function () {
23342
- var rect = getContentRect(this.target);
23343
- this.contentRect_ = rect;
23344
- return (rect.width !== this.broadcastWidth ||
23345
- rect.height !== this.broadcastHeight);
23346
- };
23347
- /**
23348
- * Updates 'broadcastWidth' and 'broadcastHeight' properties with a data
23349
- * from the corresponding properties of the last observed content rectangle.
23350
- *
23351
- * @returns {DOMRectInit} Last observed content rectangle.
23352
- */
23353
- ResizeObservation.prototype.broadcastRect = function () {
23354
- var rect = this.contentRect_;
23355
- this.broadcastWidth = rect.width;
23356
- this.broadcastHeight = rect.height;
23357
- return rect;
23358
- };
23359
- return ResizeObservation;
23360
- }());
23361
-
23362
- var ResizeObserverEntry = /** @class */ (function () {
23363
- /**
23364
- * Creates an instance of ResizeObserverEntry.
23365
- *
23366
- * @param {Element} target - Element that is being observed.
23367
- * @param {DOMRectInit} rectInit - Data of the element's content rectangle.
23368
- */
23369
- function ResizeObserverEntry(target, rectInit) {
23370
- var contentRect = createReadOnlyRect(rectInit);
23371
- // According to the specification following properties are not writable
23372
- // and are also not enumerable in the native implementation.
23373
- //
23374
- // Property accessors are not being used as they'd require to define a
23375
- // private WeakMap storage which may cause memory leaks in browsers that
23376
- // don't support this type of collections.
23377
- defineConfigurable(this, { target: target, contentRect: contentRect });
23378
- }
23379
- return ResizeObserverEntry;
23380
- }());
23381
-
23382
- var ResizeObserverSPI = /** @class */ (function () {
23383
- /**
23384
- * Creates a new instance of ResizeObserver.
23385
- *
23386
- * @param {ResizeObserverCallback} callback - Callback function that is invoked
23387
- * when one of the observed elements changes it's content dimensions.
23388
- * @param {ResizeObserverController} controller - Controller instance which
23389
- * is responsible for the updates of observer.
23390
- * @param {ResizeObserver} callbackCtx - Reference to the public
23391
- * ResizeObserver instance which will be passed to callback function.
23392
- */
23393
- function ResizeObserverSPI(callback, controller, callbackCtx) {
23394
- /**
23395
- * Collection of resize observations that have detected changes in dimensions
23396
- * of elements.
23397
- *
23398
- * @private {Array<ResizeObservation>}
23399
- */
23400
- this.activeObservations_ = [];
23401
- /**
23402
- * Registry of the ResizeObservation instances.
23403
- *
23404
- * @private {Map<Element, ResizeObservation>}
23405
- */
23406
- this.observations_ = new MapShim();
23407
- if (typeof callback !== 'function') {
23408
- throw new TypeError('The callback provided as parameter 1 is not a function.');
23409
- }
23410
- this.callback_ = callback;
23411
- this.controller_ = controller;
23412
- this.callbackCtx_ = callbackCtx;
23413
- }
23414
- /**
23415
- * Starts observing provided element.
23416
- *
23417
- * @param {Element} target - Element to be observed.
23418
- * @returns {void}
23419
- */
23420
- ResizeObserverSPI.prototype.observe = function (target) {
23421
- if (!arguments.length) {
23422
- throw new TypeError('1 argument required, but only 0 present.');
23423
- }
23424
- // Do nothing if current environment doesn't have the Element interface.
23425
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
23426
- return;
23427
- }
23428
- if (!(target instanceof getWindowOf(target).Element)) {
23429
- throw new TypeError('parameter 1 is not of type "Element".');
23430
- }
23431
- var observations = this.observations_;
23432
- // Do nothing if element is already being observed.
23433
- if (observations.has(target)) {
23434
- return;
23435
- }
23436
- observations.set(target, new ResizeObservation(target));
23437
- this.controller_.addObserver(this);
23438
- // Force the update of observations.
23439
- this.controller_.refresh();
23440
- };
23441
- /**
23442
- * Stops observing provided element.
23443
- *
23444
- * @param {Element} target - Element to stop observing.
23445
- * @returns {void}
23446
- */
23447
- ResizeObserverSPI.prototype.unobserve = function (target) {
23448
- if (!arguments.length) {
23449
- throw new TypeError('1 argument required, but only 0 present.');
23450
- }
23451
- // Do nothing if current environment doesn't have the Element interface.
23452
- if (typeof Element === 'undefined' || !(Element instanceof Object)) {
23453
- return;
23454
- }
23455
- if (!(target instanceof getWindowOf(target).Element)) {
23456
- throw new TypeError('parameter 1 is not of type "Element".');
23457
- }
23458
- var observations = this.observations_;
23459
- // Do nothing if element is not being observed.
23460
- if (!observations.has(target)) {
23461
- return;
23462
- }
23463
- observations.delete(target);
23464
- if (!observations.size) {
23465
- this.controller_.removeObserver(this);
23466
- }
23467
- };
23468
- /**
23469
- * Stops observing all elements.
23470
- *
23471
- * @returns {void}
23472
- */
23473
- ResizeObserverSPI.prototype.disconnect = function () {
23474
- this.clearActive();
23475
- this.observations_.clear();
23476
- this.controller_.removeObserver(this);
23477
- };
23478
- /**
23479
- * Collects observation instances the associated element of which has changed
23480
- * it's content rectangle.
23481
- *
23482
- * @returns {void}
23483
- */
23484
- ResizeObserverSPI.prototype.gatherActive = function () {
23485
- var _this = this;
23486
- this.clearActive();
23487
- this.observations_.forEach(function (observation) {
23488
- if (observation.isActive()) {
23489
- _this.activeObservations_.push(observation);
23490
- }
23491
- });
23492
- };
23493
- /**
23494
- * Invokes initial callback function with a list of ResizeObserverEntry
23495
- * instances collected from active resize observations.
23496
- *
23497
- * @returns {void}
23498
- */
23499
- ResizeObserverSPI.prototype.broadcastActive = function () {
23500
- // Do nothing if observer doesn't have active observations.
23501
- if (!this.hasActive()) {
23502
- return;
23503
- }
23504
- var ctx = this.callbackCtx_;
23505
- // Create ResizeObserverEntry instance for every active observation.
23506
- var entries = this.activeObservations_.map(function (observation) {
23507
- return new ResizeObserverEntry(observation.target, observation.broadcastRect());
23508
- });
23509
- this.callback_.call(ctx, entries, ctx);
23510
- this.clearActive();
23511
- };
23512
- /**
23513
- * Clears the collection of active observations.
23514
- *
23515
- * @returns {void}
23516
- */
23517
- ResizeObserverSPI.prototype.clearActive = function () {
23518
- this.activeObservations_.splice(0);
23519
- };
23520
- /**
23521
- * Tells whether observer has active observations.
23522
- *
23523
- * @returns {boolean}
23524
- */
23525
- ResizeObserverSPI.prototype.hasActive = function () {
23526
- return this.activeObservations_.length > 0;
23527
- };
23528
- return ResizeObserverSPI;
23529
- }());
23530
-
23531
- // Registry of internal observers. If WeakMap is not available use current shim
23532
- // for the Map collection as it has all required methods and because WeakMap
23533
- // can't be fully polyfilled anyway.
23534
- var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
23535
- /**
23536
- * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
23537
- * exposing only those methods and properties that are defined in the spec.
23538
- */
23539
- var ResizeObserver_es_ResizeObserver = /** @class */ (function () {
23540
- /**
23541
- * Creates a new instance of ResizeObserver.
23542
- *
23543
- * @param {ResizeObserverCallback} callback - Callback that is invoked when
23544
- * dimensions of the observed elements change.
23545
- */
23546
- function ResizeObserver(callback) {
23547
- if (!(this instanceof ResizeObserver)) {
23548
- throw new TypeError('Cannot call a class as a function.');
23549
- }
23550
- if (!arguments.length) {
23551
- throw new TypeError('1 argument required, but only 0 present.');
23552
- }
23553
- var controller = ResizeObserverController.getInstance();
23554
- var observer = new ResizeObserverSPI(callback, controller, this);
23555
- observers.set(this, observer);
23556
- }
23557
- return ResizeObserver;
23558
- }());
23559
- // Expose public methods of ResizeObserver.
23560
- [
23561
- 'observe',
23562
- 'unobserve',
23563
- 'disconnect'
23564
- ].forEach(function (method) {
23565
- ResizeObserver_es_ResizeObserver.prototype[method] = function () {
23566
- var _a;
23567
- return (_a = observers.get(this))[method].apply(_a, arguments);
23568
- };
23569
- });
23570
-
23571
- var index = (function () {
23572
- // Export existing implementation if available.
23573
- if (typeof global$1.ResizeObserver !== 'undefined') {
23574
- return global$1.ResizeObserver;
23575
- }
23576
- return ResizeObserver_es_ResizeObserver;
23577
- })();
23578
-
23579
- /* harmony default export */ const ResizeObserver_es = (index);
23580
-
23581
22711
  ;// CONCATENATED MODULE: ./resizeObserver/index.tsx
23582
22712
 
23583
22713
 
23584
22714
 
23585
22715
 
23586
-
22716
+ var ObserverProperty;
22717
+ (function (ObserverProperty) {
22718
+ ObserverProperty["Width"] = "width";
22719
+ ObserverProperty["Height"] = "height";
22720
+ ObserverProperty["All"] = "all";
22721
+ })(ObserverProperty || (ObserverProperty = {}));
23587
22722
  class ReactResizeObserver extends BaseComponent {
23588
22723
  constructor(props) {
22724
+ var _this;
23589
22725
  super(props);
22726
+ _this = this;
22727
+ this.formerPropertyValue = new Map();
23590
22728
  this.getElement = () => {
23591
22729
  try {
23592
22730
  // using findDOMNode for two reasons:
@@ -23598,6 +22736,54 @@ class ReactResizeObserver extends BaseComponent {
23598
22736
  return null;
23599
22737
  }
23600
22738
  };
22739
+ this.handleResizeEventTriggered = entries => {
22740
+ if (this.props.observerProperty === ObserverProperty.All) {
22741
+ this.props.onResize(entries);
22742
+ } else {
22743
+ const finalEntries = [];
22744
+ for (const entry of entries) {
22745
+ if (this.formerPropertyValue.has(entry.target)) {
22746
+ if (entry.contentRect[this.props.observerProperty] !== this.formerPropertyValue.get(entry.target)) {
22747
+ this.formerPropertyValue.set(entry.target, entry.contentRect[this.props.observerProperty]);
22748
+ finalEntries.push(entry);
22749
+ }
22750
+ } else {
22751
+ this.formerPropertyValue.set(entry.target, entry.contentRect[this.props.observerProperty]);
22752
+ finalEntries.push(entry);
22753
+ }
22754
+ }
22755
+ if (finalEntries.length > 0) {
22756
+ this.props.onResize(finalEntries);
22757
+ }
22758
+ }
22759
+ };
22760
+ this.observeElement = function () {
22761
+ let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
22762
+ const element = _this.getElement();
22763
+ if (!_this.observer) {
22764
+ _this.observer = new ResizeObserver(_this.handleResizeEventTriggered);
22765
+ }
22766
+ if (!(element && element instanceof Element)) {
22767
+ // stop everything if not defined
22768
+ _this.observer.disconnect();
22769
+ return;
22770
+ }
22771
+ if (element === _this.element && !force) {
22772
+ // abort if given same element -- nothing to update (unless forced)
22773
+ return;
22774
+ } else {
22775
+ // clear observer list if new element
22776
+ _this.observer.disconnect();
22777
+ // remember element reference for next time
22778
+ _this.element = element;
22779
+ }
22780
+ // observer callback is invoked immediately when observing new elements
22781
+ _this.observer.observe(element);
22782
+ if (_this.props.observeParent && element.parentNode && element.parentNode.ownerDocument && element.parentNode.ownerDocument.defaultView && element.parentNode instanceof element.parentNode.ownerDocument.defaultView.HTMLElement) {
22783
+ _this._parentNode = element.parentNode;
22784
+ _this.observer.observe(_this._parentNode);
22785
+ }
22786
+ };
23601
22787
  this.mergeRef = (ref, node) => {
23602
22788
  this.childNode = node;
23603
22789
  if (typeof ref === 'function') {
@@ -23606,7 +22792,7 @@ class ReactResizeObserver extends BaseComponent {
23606
22792
  ref.current = node;
23607
22793
  }
23608
22794
  };
23609
- this.observer = new ResizeObserver_es(props.onResize);
22795
+ this.observer = new ResizeObserver(this.handleResizeEventTriggered);
23610
22796
  }
23611
22797
  componentDidMount() {
23612
22798
  this.observeElement();
@@ -23621,33 +22807,6 @@ class ReactResizeObserver extends BaseComponent {
23621
22807
  this.element = null;
23622
22808
  }
23623
22809
  }
23624
- observeElement() {
23625
- let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
23626
- const element = this.getElement();
23627
- if (!this.observer) {
23628
- this.observer = new ResizeObserver_es(this.props.onResize);
23629
- }
23630
- if (!(element && element instanceof Element)) {
23631
- // stop everything if not defined
23632
- this.observer.disconnect();
23633
- return;
23634
- }
23635
- if (element === this.element && !force) {
23636
- // abort if given same element -- nothing to update (unless forced)
23637
- return;
23638
- } else {
23639
- // clear observer list if new element
23640
- this.observer.disconnect();
23641
- // remember element reference for next time
23642
- this.element = element;
23643
- }
23644
- // observer callback is invoked immediately when observing new elements
23645
- this.observer.observe(element);
23646
- if (this.props.observeParent && element.parentNode && element.parentNode.ownerDocument && element.parentNode.ownerDocument.defaultView && element.parentNode instanceof element.parentNode.ownerDocument.defaultView.HTMLElement) {
23647
- this._parentNode = element.parentNode;
23648
- this.observer.observe(this._parentNode);
23649
- }
23650
- }
23651
22810
  render() {
23652
22811
  const child = external_root_React_commonjs2_react_commonjs_react_amd_react_default().Children.only(this.props.children);
23653
22812
  const {
@@ -23660,11 +22819,15 @@ class ReactResizeObserver extends BaseComponent {
23660
22819
  }
23661
22820
  ReactResizeObserver.propTypes = {
23662
22821
  onResize: (prop_types_default()).func,
23663
- observeParent: (prop_types_default()).bool
22822
+ observeParent: (prop_types_default()).bool,
22823
+ observerProperty: (prop_types_default()).string,
22824
+ delayTick: (prop_types_default()).number
23664
22825
  };
23665
22826
  ReactResizeObserver.defaultProps = {
23666
22827
  onResize: () => {},
23667
- observeParent: false
22828
+ observeParent: false,
22829
+ observerProperty: "all",
22830
+ delayTick: 0
23668
22831
  };
23669
22832
  ;// CONCATENATED MODULE: ./typography/base.tsx
23670
22833
 
@@ -23673,6 +22836,33 @@ ReactResizeObserver.defaultProps = {
23673
22836
 
23674
22837
 
23675
22838
 
22839
+ var base_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
22840
+ function adopt(value) {
22841
+ return value instanceof P ? value : new P(function (resolve) {
22842
+ resolve(value);
22843
+ });
22844
+ }
22845
+ return new (P || (P = Promise))(function (resolve, reject) {
22846
+ function fulfilled(value) {
22847
+ try {
22848
+ step(generator.next(value));
22849
+ } catch (e) {
22850
+ reject(e);
22851
+ }
22852
+ }
22853
+ function rejected(value) {
22854
+ try {
22855
+ step(generator["throw"](value));
22856
+ } catch (e) {
22857
+ reject(e);
22858
+ }
22859
+ }
22860
+ function step(result) {
22861
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
22862
+ }
22863
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22864
+ });
22865
+ };
23676
22866
  var base_rest = undefined && undefined.__rest || function (s, e) {
23677
22867
  var t = {};
23678
22868
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -23728,12 +22918,18 @@ const wrapperDecorations = (props, content) => {
23728
22918
  class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_.Component {
23729
22919
  constructor(props) {
23730
22920
  super(props);
23731
- this.onResize = () => {
22921
+ this.observerTakingEffect = false;
22922
+ this.onResize = entries => base_awaiter(this, void 0, void 0, function* () {
23732
22923
  if (this.rafId) {
23733
22924
  window.cancelAnimationFrame(this.rafId);
23734
22925
  }
23735
- this.rafId = window.requestAnimationFrame(this.getEllipsisState.bind(this));
23736
- };
22926
+ return new Promise(resolve => {
22927
+ this.rafId = window.requestAnimationFrame(() => base_awaiter(this, void 0, void 0, function* () {
22928
+ yield this.getEllipsisState();
22929
+ resolve();
22930
+ }));
22931
+ });
22932
+ });
23737
22933
  // if it needs to use js overflowed:
23738
22934
  // 1. text is expandable 2. expandText need to be shown 3. has extra operation 4. text need to ellipse from mid
23739
22935
  this.canUseCSSEllipsis = () => {
@@ -23803,6 +22999,80 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23803
22999
  }
23804
23000
  return defaultOpts;
23805
23001
  };
23002
+ this.onHover = () => {
23003
+ const canUseCSSEllipsis = this.canUseCSSEllipsis();
23004
+ if (canUseCSSEllipsis) {
23005
+ const {
23006
+ rows,
23007
+ suffix,
23008
+ pos
23009
+ } = this.getEllipsisOpt();
23010
+ const updateOverflow = this.shouldTruncated(rows);
23011
+ // isOverflowed needs to be updated to show tooltip when using css ellipsis
23012
+ this.setState({
23013
+ isOverflowed: updateOverflow,
23014
+ isTruncated: false
23015
+ });
23016
+ return undefined;
23017
+ }
23018
+ };
23019
+ this.getEllipsisState = () => base_awaiter(this, void 0, void 0, function* () {
23020
+ const {
23021
+ rows,
23022
+ suffix,
23023
+ pos
23024
+ } = this.getEllipsisOpt();
23025
+ const {
23026
+ children
23027
+ } = this.props;
23028
+ // wait until element mounted
23029
+ if (!this.wrapperRef || !this.wrapperRef.current) {
23030
+ yield this.onResize();
23031
+ return;
23032
+ }
23033
+ const {
23034
+ expanded
23035
+ } = this.state;
23036
+ const canUseCSSEllipsis = this.canUseCSSEllipsis();
23037
+ if (canUseCSSEllipsis) {
23038
+ // const updateOverflow = this.shouldTruncated(rows);
23039
+ // // isOverflowed needs to be updated to show tooltip when using css ellipsis
23040
+ // this.setState({
23041
+ // isOverflowed: updateOverflow,
23042
+ // isTruncated: false
23043
+ // });
23044
+ return;
23045
+ }
23046
+ // If children is null, css/js truncated flag isTruncate is false
23047
+ if (isNull_default()(children)) {
23048
+ return new Promise(resolve => {
23049
+ this.setState({
23050
+ isTruncated: false,
23051
+ isOverflowed: false
23052
+ }, resolve);
23053
+ });
23054
+ }
23055
+ // Currently only text truncation is supported, if there is non-text,
23056
+ // both css truncation and js truncation should throw a warning
23057
+ warning('children' in this.props && typeof children !== 'string', "[Semi Typography] Only children with pure text could be used with ellipsis at this moment.");
23058
+ if (!rows || rows < 0 || expanded) {
23059
+ return;
23060
+ }
23061
+ const extraNode = {
23062
+ expand: this.expandRef.current,
23063
+ copy: this.copyRef && this.copyRef.current
23064
+ };
23065
+ const content = util(this.wrapperRef.current, rows,
23066
+ // Perform type conversion on children to prevent component crash due to non-string type of children
23067
+ String(children), extraNode, ELLIPSIS_STR, suffix, pos);
23068
+ return new Promise(resolve => {
23069
+ this.setState({
23070
+ isOverflowed: false,
23071
+ ellipsisContent: content,
23072
+ isTruncated: children !== content
23073
+ }, resolve);
23074
+ });
23075
+ });
23806
23076
  /**
23807
23077
  * Triggered when the fold button is clicked to save the latest expanded state
23808
23078
  * @param {Event} e
@@ -23969,9 +23239,13 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23969
23239
  ellipsisContent
23970
23240
  } = this.state;
23971
23241
  if (expanded || !isTruncated) {
23972
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, children, suffix && suffix.length ? suffix : null);
23242
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
23243
+ onMouseEnter: this.onHover
23244
+ }, children, suffix && suffix.length ? suffix : null);
23973
23245
  }
23974
- return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", null, ellipsisContent, suffix);
23246
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement("span", {
23247
+ onMouseEnter: this.onHover
23248
+ }, ellipsisContent, suffix);
23975
23249
  };
23976
23250
  this.state = {
23977
23251
  editable: false,
@@ -23991,7 +23265,8 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
23991
23265
  }
23992
23266
  componentDidMount() {
23993
23267
  if (this.props.ellipsis) {
23994
- this.onResize();
23268
+ // runAfterTicks: make sure start observer on the next tick
23269
+ this.onResize().then(() => runAfterTicks(() => this.observerTakingEffect = true, 1));
23995
23270
  }
23996
23271
  }
23997
23272
  static getDerivedStateFromProps(props, prevState) {
@@ -24023,61 +23298,6 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
24023
23298
  window.cancelAnimationFrame(this.rafId);
24024
23299
  }
24025
23300
  }
24026
- getEllipsisState() {
24027
- const {
24028
- rows,
24029
- suffix,
24030
- pos
24031
- } = this.getEllipsisOpt();
24032
- const {
24033
- children
24034
- } = this.props;
24035
- // wait until element mounted
24036
- if (!this.wrapperRef || !this.wrapperRef.current) {
24037
- this.onResize();
24038
- return false;
24039
- }
24040
- const {
24041
- expanded
24042
- } = this.state;
24043
- const canUseCSSEllipsis = this.canUseCSSEllipsis();
24044
- // If children is null, css/js truncated flag isTruncate is false
24045
- if (isNull_default()(children)) {
24046
- this.setState({
24047
- isTruncated: false,
24048
- isOverflowed: false
24049
- });
24050
- return undefined;
24051
- }
24052
- // Currently only text truncation is supported, if there is non-text,
24053
- // both css truncation and js truncation should throw a warning
24054
- warning('children' in this.props && typeof children !== 'string', "[Semi Typography] Only children with pure text could be used with ellipsis at this moment.");
24055
- if (!rows || rows < 0 || expanded) {
24056
- return undefined;
24057
- }
24058
- if (canUseCSSEllipsis) {
24059
- const updateOverflow = this.shouldTruncated(rows);
24060
- // isOverflowed needs to be updated to show tooltip when using css ellipsis
24061
- this.setState({
24062
- isOverflowed: updateOverflow,
24063
- isTruncated: false
24064
- });
24065
- return undefined;
24066
- }
24067
- const extraNode = {
24068
- expand: this.expandRef.current,
24069
- copy: this.copyRef && this.copyRef.current
24070
- };
24071
- const content = util(this.wrapperRef.current, rows,
24072
- // Perform type conversion on children to prevent component crash due to non-string type of children
24073
- String(children), extraNode, ELLIPSIS_STR, suffix, pos);
24074
- this.setState({
24075
- isOverflowed: false,
24076
- ellipsisContent: content,
24077
- isTruncated: children !== content
24078
- });
24079
- return undefined;
24080
- }
24081
23301
  renderOperations() {
24082
23302
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement((external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment, null, this.renderExpandable(), this.renderCopy());
24083
23303
  }
@@ -24219,6 +23439,7 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
24219
23439
  }
24220
23440
  }
24221
23441
  render() {
23442
+ var _this = this;
24222
23443
  const content = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(LocaleConsumer, {
24223
23444
  componentName: "Typography"
24224
23445
  }, locale => {
@@ -24228,8 +23449,13 @@ class Base extends external_root_React_commonjs2_react_commonjs_react_amd_react_
24228
23449
  });
24229
23450
  if (this.props.ellipsis) {
24230
23451
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(ReactResizeObserver, {
24231
- onResize: this.onResize,
24232
- observeParent: true
23452
+ onResize: function () {
23453
+ if (_this.observerTakingEffect) {
23454
+ _this.onResize(...arguments);
23455
+ }
23456
+ },
23457
+ observeParent: true,
23458
+ observerProperty: ObserverProperty.Width
24233
23459
  }, content);
24234
23460
  }
24235
23461
  return content;
@@ -26876,6 +26102,7 @@ var autoComplete = __webpack_require__("PyaV");
26876
26102
 
26877
26103
 
26878
26104
 
26105
+
26879
26106
  const autoComplete_prefixCls = autoComplete_constants_cssClasses.PREFIX;
26880
26107
  const autoComplete_sizeSet = autoComplete_constants_strings.SIZE;
26881
26108
  const autoComplete_positionSet = autoComplete_constants_strings.POSITION;
@@ -27246,7 +26473,8 @@ AutoComplete.propTypes = {
27246
26473
  zIndex: (prop_types_default()).number
27247
26474
  };
27248
26475
  AutoComplete.Option = autoComplete_option;
27249
- AutoComplete.defaultProps = {
26476
+ AutoComplete.__SemiComponentName__ = "AutoComplete";
26477
+ AutoComplete.defaultProps = getDefaultPropsFromGlobalConfig(AutoComplete.__SemiComponentName__, {
27250
26478
  stopPropagation: true,
27251
26479
  motion: true,
27252
26480
  zIndex: constants_numbers.DEFAULT_Z_INDEX,
@@ -27272,7 +26500,7 @@ AutoComplete.defaultProps = {
27272
26500
  onKeyDown: (noop_default())
27273
26501
  // onPressEnter: () => undefined,
27274
26502
  // defaultOpen: false,
27275
- };
26503
+ });
27276
26504
 
27277
26505
  /* harmony default export */ const autoComplete_0 = (AutoComplete);
27278
26506
  ;// CONCATENATED MODULE: ../semi-foundation/avatar/constants.ts
@@ -27434,6 +26662,7 @@ var avatar_rest = undefined && undefined.__rest || function (s, e) {
27434
26662
 
27435
26663
 
27436
26664
 
26665
+
27437
26666
  const avatar_sizeSet = avatar_constants_strings.SIZE;
27438
26667
  const shapeSet = avatar_constants_strings.SHAPE;
27439
26668
  const colorSet = avatar_constants_strings.COLOR;
@@ -27763,7 +26992,8 @@ class Avatar extends BaseComponent {
27763
26992
  }
27764
26993
  }
27765
26994
  }
27766
- Avatar.defaultProps = {
26995
+ Avatar.__SemiComponentName__ = "Avatar";
26996
+ Avatar.defaultProps = getDefaultPropsFromGlobalConfig(Avatar.__SemiComponentName__, {
27767
26997
  size: 'medium',
27768
26998
  color: 'grey',
27769
26999
  shape: 'circle',
@@ -27771,7 +27001,7 @@ Avatar.defaultProps = {
27771
27001
  onClick: function_noop,
27772
27002
  onMouseEnter: function_noop,
27773
27003
  onMouseLeave: function_noop
27774
- };
27004
+ });
27775
27005
  Avatar.propTypes = {
27776
27006
  children: (prop_types_default()).node,
27777
27007
  color: prop_types_default().oneOf(colorSet),
@@ -28862,6 +28092,7 @@ var backtop_rest = undefined && undefined.__rest || function (s, e) {
28862
28092
 
28863
28093
 
28864
28094
 
28095
+
28865
28096
  const backtop_prefixCls = backtop_constants_cssClasses.PREFIX;
28866
28097
  const getDefaultTarget = () => window;
28867
28098
  class BackTop extends BaseComponent {
@@ -28937,11 +28168,12 @@ class BackTop extends BaseComponent {
28937
28168
  return content;
28938
28169
  }
28939
28170
  }
28940
- BackTop.defaultProps = {
28171
+ BackTop.__SemiComponentName__ = "BackTop";
28172
+ BackTop.defaultProps = getDefaultPropsFromGlobalConfig(BackTop.__SemiComponentName__, {
28941
28173
  visibilityHeight: 400,
28942
28174
  target: getDefaultTarget,
28943
28175
  duration: 450
28944
- };
28176
+ });
28945
28177
  BackTop.propTypes = {
28946
28178
  target: (prop_types_default()).func,
28947
28179
  visibilityHeight: (prop_types_default()).number,
@@ -29853,6 +29085,7 @@ Breadcrumb.defaultProps = {
29853
29085
 
29854
29086
 
29855
29087
 
29088
+
29856
29089
  class Button extends (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent {
29857
29090
  constructor() {
29858
29091
  let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -29870,7 +29103,9 @@ class Button extends (external_root_React_commonjs2_react_commonjs_react_amd_rea
29870
29103
  }
29871
29104
  }
29872
29105
  }
29106
+ Button.__SemiComponentName__ = "Button";
29873
29107
  Button.propTypes = Object.assign(Object.assign({}, Button_Button.propTypes), iconButton_0.propTypes);
29108
+ Button.defaultProps = getDefaultPropsFromGlobalConfig(Button.__SemiComponentName__);
29874
29109
  Button.elementType = 'Button';
29875
29110
  /* harmony default export */ const button_0 = (Button);
29876
29111
  ;// CONCATENATED MODULE: ./button/buttonGroup.tsx
@@ -36483,9 +35718,6 @@ var isSet_default = /*#__PURE__*/__webpack_require__.n(isSet);
36483
35718
  // EXTERNAL MODULE: ../../node_modules/lodash/includes.js
36484
35719
  var includes = __webpack_require__("qYhz");
36485
35720
  var includes_default = /*#__PURE__*/__webpack_require__.n(includes);
36486
- // EXTERNAL MODULE: ../../node_modules/lodash/cloneDeep.js
36487
- var lodash_cloneDeep = __webpack_require__("c2re");
36488
- var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(lodash_cloneDeep);
36489
35721
  // EXTERNAL MODULE: ../../node_modules/lodash/assign.js
36490
35722
  var lodash_assign = __webpack_require__("whR3");
36491
35723
  var assign_default = /*#__PURE__*/__webpack_require__.n(lodash_assign);
@@ -36892,14 +36124,13 @@ function calcMotionKeys(oldKeySet, newKeySet, keyEntities) {
36892
36124
  /**
36893
36125
  * @returns whether option includes sugInput.
36894
36126
  * When filterTreeNode is a function,returns the result of filterTreeNode which called with (sugInput, target, option).
36895
- * The filteredPath parameter will only be passed in when the Cascader calls the filter function
36896
36127
  */
36897
- function filter(sugInput, option, filterTreeNode, filterProps, filteredPath) {
36128
+ function filter(sugInput, option, filterTreeNode, filterProps) {
36898
36129
  if (!filterTreeNode) {
36899
36130
  return true;
36900
36131
  }
36901
36132
  let filterFn = filterTreeNode;
36902
- let target = filteredPath !== null && filteredPath !== void 0 ? filteredPath : option;
36133
+ let target = option;
36903
36134
  if (typeof filterTreeNode === 'boolean') {
36904
36135
  filterFn = (targetVal, val) => {
36905
36136
  const input = targetVal.toLowerCase();
@@ -37172,6 +36403,33 @@ function util_normalizedArr(val) {
37172
36403
  return val;
37173
36404
  }
37174
36405
  }
36406
+ /**
36407
+ * @returns whether option includes sugInput.
36408
+ * When filterTreeNode is a function,returns the result of filterTreeNode which called with (sugInput, target, option).
36409
+ */
36410
+ function util_filter(sugInput, option, filterTreeNode, filteredPath) {
36411
+ if (!filterTreeNode) {
36412
+ return true;
36413
+ }
36414
+ let filterFn = filterTreeNode;
36415
+ let target;
36416
+ if (typeof filterTreeNode === 'boolean') {
36417
+ filterFn = (targetVal, val) => {
36418
+ const input = targetVal.toLowerCase();
36419
+ return val.toLowerCase().includes(input);
36420
+ };
36421
+ // 当 filterTreeNode 是 bool 类型时,由 Cascader 内部判断是否符合筛选条件,使用 join('') 修复搜索英文逗号导致所有数据被匹配问题
36422
+ // When the type of of filterTreeNode is bool, Cascader internally determines whether it meets the filtering conditions.
36423
+ // Use join('') to fix the problem that searching for English commas causes all data to be matched.
36424
+ target = filteredPath.join('');
36425
+ } else {
36426
+ // 当 filterTreeNode 为函数类型时,由用户判断是否符合筛选条件,使用 join(), 和原来保持一致
36427
+ // When the type of of filterTreeNode is function, the user determines whether it meets the filtering conditions,
36428
+ // uses join() to be consistent with the previous version.
36429
+ target = filteredPath.join();
36430
+ }
36431
+ return filterFn(sugInput, target, option);
36432
+ }
37175
36433
  /**
37176
36434
  * Traverse all the data by `treeData`.
37177
36435
  */
@@ -37182,10 +36440,12 @@ function util_traverseDataNodes(treeNodes, callback) {
37182
36440
  // Process node if is not root
37183
36441
  if (node) {
37184
36442
  const key = parent ? `${parent.key}${constants_VALUE_SPLIT}${node.value}` : node.value;
36443
+ const pos = parent ? util_getPosition(parent.pos, ind) : `${ind}`;
37185
36444
  item = {
37186
36445
  data: Object.assign({}, node),
37187
36446
  ind,
37188
36447
  key,
36448
+ pos,
37189
36449
  level: parent ? parent.level + 1 : 0,
37190
36450
  parentKey: parent ? parent.key : null,
37191
36451
  path: parent ? [...parent.path, key] : [key],
@@ -37218,6 +36478,17 @@ function getKeyByValuePath(valuePath) {
37218
36478
  function getValuePathByKey(key) {
37219
36479
  return key.split(VALUE_SPLIT);
37220
36480
  }
36481
+ function getKeyByPos(pos, treeData) {
36482
+ const posArr = pos.split('-').map(item => Number(item));
36483
+ let resultData = treeData;
36484
+ let valuePath = [];
36485
+ posArr.forEach((item, index) => {
36486
+ var _a;
36487
+ resultData = index === 0 ? resultData[item] : (_a = resultData === null || resultData === void 0 ? void 0 : resultData.children) === null || _a === void 0 ? void 0 : _a[item];
36488
+ valuePath.push(resultData === null || resultData === void 0 ? void 0 : resultData.value);
36489
+ });
36490
+ return getKeyByValuePath(valuePath);
36491
+ }
37221
36492
  function util_convertDataToEntities(dataNodes) {
37222
36493
  const keyEntities = {};
37223
36494
  util_traverseDataNodes(dataNodes, data => {
@@ -37263,7 +36534,6 @@ function calcMergeType(autoMergeValue, leafOnly) {
37263
36534
 
37264
36535
 
37265
36536
 
37266
-
37267
36537
  class CascaderFoundation extends foundation {
37268
36538
  constructor(adapter) {
37269
36539
  super(Object.assign({}, adapter));
@@ -37272,6 +36542,28 @@ class CascaderFoundation extends foundation {
37272
36542
  isSearching: false
37273
36543
  });
37274
36544
  };
36545
+ this.handleTagRemoveByKey = key => {
36546
+ var _a, _b;
36547
+ const {
36548
+ keyEntities
36549
+ } = this.getStates();
36550
+ const {
36551
+ disabled
36552
+ } = this.getProps();
36553
+ if (disabled) {
36554
+ /* istanbul ignore next */
36555
+ return;
36556
+ }
36557
+ const removedItem = (_a = keyEntities[key]) !== null && _a !== void 0 ? _a : {};
36558
+ !((_b = removedItem === null || removedItem === void 0 ? void 0 : removedItem.data) === null || _b === void 0 ? void 0 : _b.disable) && this._handleMultipleSelect(removedItem);
36559
+ };
36560
+ this.handleTagRemoveInTrigger = pos => {
36561
+ const {
36562
+ treeData
36563
+ } = this.getStates();
36564
+ const key = getKeyByPos(pos, treeData);
36565
+ this.handleTagRemoveByKey(key);
36566
+ };
37275
36567
  }
37276
36568
  init() {
37277
36569
  const isOpen = this.getProp('open') || this.getProp('defaultOpen');
@@ -37334,13 +36626,6 @@ class CascaderFoundation extends foundation {
37334
36626
  const isDisabled = findAncestorKeys([key], keyEntities, true).some(item => keyEntities[item].data.disabled);
37335
36627
  return isDisabled;
37336
36628
  }
37337
- getCopyFromState(items) {
37338
- const res = {};
37339
- util_normalizedArr(items).forEach(key => {
37340
- res[key] = cloneDeep_default()(this.getState(key));
37341
- });
37342
- return res;
37343
- }
37344
36629
  // prop: is array, return all data
37345
36630
  getItemPropPath(selectedKey, prop, keyEntities) {
37346
36631
  const searchMap = keyEntities || this.getState('keyEntities');
@@ -37717,8 +37002,8 @@ class CascaderFoundation extends foundation {
37717
37002
  data,
37718
37003
  key
37719
37004
  } = item;
37720
- const prevLoadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
37721
- const prevLoadedKeys = cloneDeep_default()(this._adapter.getLoadedKeyRefValue());
37005
+ const prevLoadingKeys = new Set(this._adapter.getLoadingKeyRefValue());
37006
+ const prevLoadedKeys = new Set(this._adapter.getLoadedKeyRefValue());
37722
37007
  const newLoadedKeys = prevLoadedKeys.add(key);
37723
37008
  const newLoadingKeys = new Set([...prevLoadingKeys]);
37724
37009
  newLoadingKeys.delete(key);
@@ -37741,7 +37026,7 @@ class CascaderFoundation extends foundation {
37741
37026
  });
37742
37027
  if (!data.isLeaf && !data.children && this.getProp('loadData')) {
37743
37028
  const loadedKeys = this._adapter.getLoadedKeyRefValue();
37744
- const loadingKeys = cloneDeep_default()(this._adapter.getLoadingKeyRefValue());
37029
+ const loadingKeys = new Set(this._adapter.getLoadingKeyRefValue());
37745
37030
  if (loadedKeys.has(key) || loadingKeys.has(key)) {
37746
37031
  return;
37747
37032
  }
@@ -37901,9 +37186,7 @@ class CascaderFoundation extends foundation {
37901
37186
  keyEntities,
37902
37187
  disabledKeys
37903
37188
  } = this.getStates();
37904
- const {
37905
- checkedKeys
37906
- } = this.getCopyFromState(['checkedKeys']);
37189
+ const checkedKeys = new Set(this.getState('checkedKeys'));
37907
37190
  const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
37908
37191
  const hasDisabled = descendantKeys.some(key => disabledKeys.has(key));
37909
37192
  if (!hasDisabled) {
@@ -37953,10 +37236,8 @@ class CascaderFoundation extends foundation {
37953
37236
  const {
37954
37237
  keyEntities
37955
37238
  } = this.getStates();
37956
- const {
37957
- checkedKeys,
37958
- halfCheckedKeys
37959
- } = this.getCopyFromState(['checkedKeys', 'halfCheckedKeys']);
37239
+ const checkedKeys = new Set(this.getState('checkedKeys'));
37240
+ const halfCheckedKeys = new Set(this.getState('halfCheckedKeys'));
37960
37241
  return curCheckedStatus ? calcCheckedKeysForChecked(key, keyEntities, checkedKeys, halfCheckedKeys) : calcCheckedKeysForUnchecked(key, keyEntities, checkedKeys, halfCheckedKeys);
37961
37242
  }
37962
37243
  handleInputChange(sugInput) {
@@ -37980,8 +37261,8 @@ class CascaderFoundation extends foundation {
37980
37261
  if (_notExist) {
37981
37262
  return false;
37982
37263
  }
37983
- const filteredPath = this.getItemPropPath(key, treeNodeFilterProp).join();
37984
- return filter(sugInput, data, filterTreeNode, false, filteredPath);
37264
+ const filteredPath = this.getItemPropPath(key, treeNodeFilterProp);
37265
+ return util_filter(sugInput, data, filterTreeNode, filteredPath);
37985
37266
  }).filter(item => filterTreeNode && !filterLeafOnly || this._isLeaf(item)).map(item => item.key);
37986
37267
  }
37987
37268
  this._adapter.updateStates({
@@ -38003,6 +37284,7 @@ class CascaderFoundation extends foundation {
38003
37284
  const isControlled = this._isControlledComponent();
38004
37285
  const newState = {};
38005
37286
  if (multiple) {
37287
+ newState.isSearching = false;
38006
37288
  this._adapter.updateInputValue('');
38007
37289
  this._adapter.notifyOnSearch('');
38008
37290
  newState.checkedKeys = new Set([]);
@@ -38105,20 +37387,6 @@ class CascaderFoundation extends foundation {
38105
37387
  activeNode: data
38106
37388
  });
38107
37389
  }
38108
- handleTagRemove(e, tagValuePath) {
38109
- const {
38110
- keyEntities
38111
- } = this.getStates();
38112
- const {
38113
- disabled
38114
- } = this.getProps();
38115
- if (disabled) {
38116
- /* istanbul ignore next */
38117
- return;
38118
- }
38119
- const removedItem = Object.values(keyEntities).filter(item => isEqual_default()(item.valuePath, tagValuePath))[0];
38120
- !isEmpty_default()(removedItem) && !removedItem.data.disabled && this._handleMultipleSelect(removedItem);
38121
- }
38122
37390
  }
38123
37391
  // EXTERNAL MODULE: ../semi-foundation/cascader/cascader.scss
38124
37392
  var cascader = __webpack_require__("B2DP");
@@ -47777,14 +47045,13 @@ class Cascader extends BaseComponent {
47777
47045
  this.handleInputChange = value => {
47778
47046
  this.foundation.handleInputChange(value);
47779
47047
  };
47780
- this.handleTagRemove = (e, tagValuePath) => {
47781
- this.foundation.handleTagRemove(e, tagValuePath);
47048
+ this.handleTagRemoveInTrigger = pos => {
47049
+ this.foundation.handleTagRemoveInTrigger(pos);
47782
47050
  };
47783
- this.handleRemoveByKey = key => {
47784
- const {
47785
- keyEntities
47786
- } = this.state;
47787
- this.handleTagRemove(null, keyEntities[key].valuePath);
47051
+ this.handleTagClose = (tagChildren, e, tagKey) => {
47052
+ // When value has not changed, prevent clicking tag closeBtn to close tag
47053
+ e.preventDefault();
47054
+ this.foundation.handleTagRemoveByKey(tagKey);
47788
47055
  };
47789
47056
  this.renderTagItem = (nodeKey, idx) => {
47790
47057
  const {
@@ -47812,18 +47079,18 @@ class Cascader extends BaseComponent {
47812
47079
  size: size === 'default' ? 'large' : size,
47813
47080
  key: `tag-${nodeKey}-${idx}`,
47814
47081
  color: "white",
47082
+ tagKey: nodeKey,
47815
47083
  className: tagCls,
47816
47084
  closable: true,
47817
- onClose: (tagChildren, e) => {
47818
- // When value has not changed, prevent clicking tag closeBtn to close tag
47819
- e.preventDefault();
47820
- this.handleTagRemove(e, keyEntities[nodeKey].valuePath);
47821
- }
47085
+ onClose: this.handleTagClose
47822
47086
  }, keyEntities[nodeKey].data[displayProp]);
47823
47087
  }
47824
47088
  }
47825
47089
  return null;
47826
47090
  };
47091
+ this.onRemoveInTagInput = v => {
47092
+ this.foundation.handleTagRemoveByKey(v);
47093
+ };
47827
47094
  this.handleItemClick = (e, item) => {
47828
47095
  this.foundation.handleItemClick(e, item);
47829
47096
  };
@@ -48023,6 +47290,7 @@ class Cascader extends BaseComponent {
48023
47290
  }, labelNode);
48024
47291
  };
48025
47292
  this.renderCustomTrigger = () => {
47293
+ var _a;
48026
47294
  const {
48027
47295
  disabled,
48028
47296
  triggerRender,
@@ -48033,17 +47301,26 @@ class Cascader extends BaseComponent {
48033
47301
  inputValue,
48034
47302
  inputPlaceHolder,
48035
47303
  resolvedCheckedKeys,
48036
- checkedKeys
47304
+ checkedKeys,
47305
+ keyEntities
48037
47306
  } = this.state;
48038
47307
  let realValue;
48039
47308
  if (multiple) {
48040
47309
  if (this.mergeType === cascader_constants_strings.NONE_MERGE_TYPE) {
48041
- realValue = checkedKeys;
47310
+ realValue = new Set();
47311
+ checkedKeys.forEach(key => {
47312
+ var _a;
47313
+ realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
47314
+ });
48042
47315
  } else {
48043
- realValue = resolvedCheckedKeys;
47316
+ realValue = new Set();
47317
+ resolvedCheckedKeys.forEach(key => {
47318
+ var _a;
47319
+ realValue.add((_a = keyEntities[key]) === null || _a === void 0 ? void 0 : _a.pos);
47320
+ });
48044
47321
  }
48045
47322
  } else {
48046
- realValue = [...selectedKeys][0];
47323
+ realValue = (_a = keyEntities[[...selectedKeys][0]]) === null || _a === void 0 ? void 0 : _a.pos;
48047
47324
  }
48048
47325
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(trigger, {
48049
47326
  value: realValue,
@@ -48056,7 +47333,7 @@ class Cascader extends BaseComponent {
48056
47333
  componentName: 'Cascader',
48057
47334
  componentProps: Object.assign({}, this.props),
48058
47335
  onSearch: this.handleInputChange,
48059
- onRemove: this.handleRemoveByKey
47336
+ onRemove: this.handleTagRemoveInTrigger
48060
47337
  });
48061
47338
  };
48062
47339
  this.handleMouseOver = () => {
@@ -48087,11 +47364,12 @@ class Cascader extends BaseComponent {
48087
47364
  selectedKeys,
48088
47365
  isOpen,
48089
47366
  isHovering,
48090
- checkedKeys
47367
+ checkedKeys,
47368
+ inputValue
48091
47369
  } = this.state;
48092
47370
  const hasValue = selectedKeys.size;
48093
47371
  const multipleWithHaveValue = multiple && checkedKeys.size;
48094
- return showClear && (hasValue || multipleWithHaveValue) && !disabled && (isOpen || isHovering);
47372
+ return showClear && (inputValue || hasValue || multipleWithHaveValue) && !disabled && (isOpen || isHovering);
48095
47373
  };
48096
47374
  this.renderClearBtn = () => {
48097
47375
  const clearCls = classnames_default()(`${cascader_prefixcls}-clearbtn`);
@@ -48540,11 +47818,11 @@ class Cascader extends BaseComponent {
48540
47818
  showRestTagsPopover: showRestTagsPopover,
48541
47819
  restTagsPopoverProps: restTagsPopoverProps,
48542
47820
  maxTagCount: maxTagCount,
48543
- renderTagItem: (value, index) => this.renderTagItem(value, index),
47821
+ renderTagItem: this.renderTagItem,
48544
47822
  inputValue: inputValue,
48545
47823
  onInputChange: this.handleInputChange,
48546
47824
  // TODO Modify logic, not modify type
48547
- onRemove: v => this.handleTagRemove(null, v),
47825
+ onRemove: this.onRemoveInTagInput,
48548
47826
  placeholder: placeholder,
48549
47827
  expandRestTagsOnClick: false
48550
47828
  });
@@ -48638,6 +47916,7 @@ class Cascader extends BaseComponent {
48638
47916
  }, selection);
48639
47917
  }
48640
47918
  }
47919
+ Cascader.__SemiComponentName__ = "Cascader";
48641
47920
  Cascader.contextType = context;
48642
47921
  Cascader.propTypes = {
48643
47922
  'aria-labelledby': (prop_types_default()).string,
@@ -48716,7 +47995,7 @@ Cascader.propTypes = {
48716
47995
  preventScroll: (prop_types_default()).bool,
48717
47996
  position: (prop_types_default()).string
48718
47997
  };
48719
- Cascader.defaultProps = {
47998
+ Cascader.defaultProps = getDefaultPropsFromGlobalConfig(Cascader.__SemiComponentName__, {
48720
47999
  borderless: false,
48721
48000
  leafOnly: false,
48722
48001
  arrowIcon: /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createElement(IconChevronDown, null),
@@ -48746,7 +48025,7 @@ Cascader.defaultProps = {
48746
48025
  onListScroll: (noop_default()),
48747
48026
  enableLeafClick: false,
48748
48027
  'aria-label': 'Cascader'
48749
- };
48028
+ });
48750
48029
  /* harmony default export */ const cascader_0 = (Cascader);
48751
48030
  ;// CONCATENATED MODULE: ../semi-foundation/collapse/constants.ts
48752
48031
 
@@ -48842,6 +48121,7 @@ var collapsible = __webpack_require__("v967");
48842
48121
 
48843
48122
 
48844
48123
 
48124
+
48845
48125
  class Collapsible extends BaseComponent {
48846
48126
  constructor(props) {
48847
48127
  super(props);
@@ -48964,14 +48244,15 @@ class Collapsible extends BaseComponent {
48964
48244
  }, (this.props.keepDOM || this.props.collapseHeight !== 0 || this.state.visible || this.props.isOpen) && this.props.children));
48965
48245
  }
48966
48246
  }
48967
- Collapsible.defaultProps = {
48247
+ Collapsible.__SemiComponentName__ = "Collapsible";
48248
+ Collapsible.defaultProps = getDefaultPropsFromGlobalConfig(Collapsible.__SemiComponentName__, {
48968
48249
  isOpen: false,
48969
48250
  duration: 250,
48970
48251
  motion: true,
48971
48252
  keepDOM: false,
48972
48253
  collapseHeight: 0,
48973
48254
  fade: false
48974
- };
48255
+ });
48975
48256
  Collapsible.getEntryInfo = entry => {
48976
48257
  //judge whether parent or self display none
48977
48258
  let inRenderTree;
@@ -49169,6 +48450,7 @@ var collapse_rest = undefined && undefined.__rest || function (s, e) {
49169
48450
 
49170
48451
 
49171
48452
 
48453
+
49172
48454
  class Collapse extends BaseComponent {
49173
48455
  constructor(props) {
49174
48456
  super(props);
@@ -49258,12 +48540,13 @@ Collapse.propTypes = {
49258
48540
  motion: prop_types_default().oneOfType([(prop_types_default()).bool, (prop_types_default()).func, (prop_types_default()).object]),
49259
48541
  expandIconPosition: prop_types_default().oneOf(collapse_constants_strings.iconPosition)
49260
48542
  };
49261
- Collapse.defaultProps = {
48543
+ Collapse.__SemiComponentName__ = "Collapse";
48544
+ Collapse.defaultProps = getDefaultPropsFromGlobalConfig(Collapse.__SemiComponentName__, {
49262
48545
  defaultActiveKey: '',
49263
48546
  clickHeaderToExpand: true,
49264
48547
  onChange: function_noop,
49265
48548
  expandIconPosition: 'right'
49266
- };
48549
+ });
49267
48550
  /* harmony default export */ const collapse_0 = (Collapse);
49268
48551
  ;// CONCATENATED MODULE: ./configProvider/index.tsx
49269
48552
  var configProvider_rest = undefined && undefined.__rest || function (s, e) {
@@ -49280,7 +48563,10 @@ var configProvider_rest = undefined && undefined.__rest || function (s, e) {
49280
48563
 
49281
48564
 
49282
48565
  class ConfigProvider extends (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Component {
49283
- renderChilren() {
48566
+ constructor(props) {
48567
+ super(props);
48568
+ }
48569
+ renderChildren() {
49284
48570
  const {
49285
48571
  direction,
49286
48572
  children
@@ -49303,7 +48589,7 @@ class ConfigProvider extends (external_root_React_commonjs2_react_commonjs_react
49303
48589
  value: Object.assign({
49304
48590
  direction
49305
48591
  }, rest)
49306
- }, this.renderChilren());
48592
+ }, this.renderChildren());
49307
48593
  }
49308
48594
  }
49309
48595
  ConfigProvider.propTypes = {
@@ -53375,6 +52661,7 @@ function isValidTimeZone(timeZone) {
53375
52661
 
53376
52662
 
53377
52663
 
52664
+
53378
52665
  /**
53379
52666
  * The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
53380
52667
  * task 1. Accept the selected date change, update the date value, and update the input box value according to the date = > Notify the change
@@ -53478,6 +52765,8 @@ class DatePickerFoundation extends foundation {
53478
52765
  parsedV = zonedTimeToUtc(parsedV, prevTimeZone);
53479
52766
  }
53480
52767
  result.push(isValidTimeZone(timeZone) ? utcToZonedTime(parsedV, timeZone) : parsedV);
52768
+ } else {
52769
+ warning(true, `[Semi DatePicker] value cannot be parsed, value: ${String(v)}`);
53481
52770
  }
53482
52771
  }
53483
52772
  }
@@ -54695,6 +53984,406 @@ function getDefaultPickerDate(options) {
54695
53984
  nextDate: nextDate
54696
53985
  };
54697
53986
  }
53987
+ ;// CONCATENATED MODULE: ../../node_modules/fast-copy/dist/esm/index.mjs
53988
+ var toStringFunction = Function.prototype.toString;
53989
+ var create = Object.create;
53990
+ var toStringObject = Object.prototype.toString;
53991
+ /**
53992
+ * @classdesc Fallback cache for when WeakMap is not natively supported
53993
+ */
53994
+ var LegacyCache = /** @class */ (function () {
53995
+ function LegacyCache() {
53996
+ this._keys = [];
53997
+ this._values = [];
53998
+ }
53999
+ LegacyCache.prototype.has = function (key) {
54000
+ return !!~this._keys.indexOf(key);
54001
+ };
54002
+ LegacyCache.prototype.get = function (key) {
54003
+ return this._values[this._keys.indexOf(key)];
54004
+ };
54005
+ LegacyCache.prototype.set = function (key, value) {
54006
+ this._keys.push(key);
54007
+ this._values.push(value);
54008
+ };
54009
+ return LegacyCache;
54010
+ }());
54011
+ function createCacheLegacy() {
54012
+ return new LegacyCache();
54013
+ }
54014
+ function createCacheModern() {
54015
+ return new WeakMap();
54016
+ }
54017
+ /**
54018
+ * Get a new cache object to prevent circular references.
54019
+ */
54020
+ var createCache = typeof WeakMap !== 'undefined' ? createCacheModern : createCacheLegacy;
54021
+ /**
54022
+ * Get an empty version of the object with the same prototype it has.
54023
+ */
54024
+ function getCleanClone(prototype) {
54025
+ if (!prototype) {
54026
+ return create(null);
54027
+ }
54028
+ var Constructor = prototype.constructor;
54029
+ if (Constructor === Object) {
54030
+ return prototype === Object.prototype ? {} : create(prototype);
54031
+ }
54032
+ if (~toStringFunction.call(Constructor).indexOf('[native code]')) {
54033
+ try {
54034
+ return new Constructor();
54035
+ }
54036
+ catch (_a) { }
54037
+ }
54038
+ return create(prototype);
54039
+ }
54040
+ function getRegExpFlagsLegacy(regExp) {
54041
+ var flags = '';
54042
+ if (regExp.global) {
54043
+ flags += 'g';
54044
+ }
54045
+ if (regExp.ignoreCase) {
54046
+ flags += 'i';
54047
+ }
54048
+ if (regExp.multiline) {
54049
+ flags += 'm';
54050
+ }
54051
+ if (regExp.unicode) {
54052
+ flags += 'u';
54053
+ }
54054
+ if (regExp.sticky) {
54055
+ flags += 'y';
54056
+ }
54057
+ return flags;
54058
+ }
54059
+ function getRegExpFlagsModern(regExp) {
54060
+ return regExp.flags;
54061
+ }
54062
+ /**
54063
+ * Get the flags to apply to the copied regexp.
54064
+ */
54065
+ var getRegExpFlags = /test/g.flags === 'g' ? getRegExpFlagsModern : getRegExpFlagsLegacy;
54066
+ function getTagLegacy(value) {
54067
+ var type = toStringObject.call(value);
54068
+ return type.substring(8, type.length - 1);
54069
+ }
54070
+ function getTagModern(value) {
54071
+ return value[Symbol.toStringTag] || getTagLegacy(value);
54072
+ }
54073
+ /**
54074
+ * Get the tag of the value passed, so that the correct copier can be used.
54075
+ */
54076
+ var getTag = typeof Symbol !== 'undefined' ? getTagModern : getTagLegacy;
54077
+
54078
+ var defineProperty = Object.defineProperty, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols;
54079
+ var _a = Object.prototype, esm_hasOwnProperty = _a.hasOwnProperty, propertyIsEnumerable = _a.propertyIsEnumerable;
54080
+ var SUPPORTS_SYMBOL = typeof getOwnPropertySymbols === 'function';
54081
+ function getStrictPropertiesModern(object) {
54082
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
54083
+ }
54084
+ /**
54085
+ * Get the properites used when copying objects strictly. This includes both keys and symbols.
54086
+ */
54087
+ var getStrictProperties = SUPPORTS_SYMBOL
54088
+ ? getStrictPropertiesModern
54089
+ : getOwnPropertyNames;
54090
+ /**
54091
+ * Striclty copy all properties contained on the object.
54092
+ */
54093
+ function copyOwnPropertiesStrict(value, clone, state) {
54094
+ var properties = getStrictProperties(value);
54095
+ for (var index = 0, length_1 = properties.length, property = void 0, descriptor = void 0; index < length_1; ++index) {
54096
+ property = properties[index];
54097
+ if (property === 'callee' || property === 'caller') {
54098
+ continue;
54099
+ }
54100
+ descriptor = getOwnPropertyDescriptor(value, property);
54101
+ if (!descriptor) {
54102
+ // In extra edge cases where the property descriptor cannot be retrived, fall back to
54103
+ // the loose assignment.
54104
+ clone[property] = state.copier(value[property], state);
54105
+ continue;
54106
+ }
54107
+ // Only clone the value if actually a value, not a getter / setter.
54108
+ if (!descriptor.get && !descriptor.set) {
54109
+ descriptor.value = state.copier(descriptor.value, state);
54110
+ }
54111
+ try {
54112
+ defineProperty(clone, property, descriptor);
54113
+ }
54114
+ catch (error) {
54115
+ // Tee above can fail on node in edge cases, so fall back to the loose assignment.
54116
+ clone[property] = descriptor.value;
54117
+ }
54118
+ }
54119
+ return clone;
54120
+ }
54121
+ /**
54122
+ * Deeply copy the indexed values in the array.
54123
+ */
54124
+ function copyArrayLoose(array, state) {
54125
+ var clone = new state.Constructor();
54126
+ // set in the cache immediately to be able to reuse the object recursively
54127
+ state.cache.set(array, clone);
54128
+ for (var index = 0, length_2 = array.length; index < length_2; ++index) {
54129
+ clone[index] = state.copier(array[index], state);
54130
+ }
54131
+ return clone;
54132
+ }
54133
+ /**
54134
+ * Deeply copy the indexed values in the array, as well as any custom properties.
54135
+ */
54136
+ function copyArrayStrict(array, state) {
54137
+ var clone = new state.Constructor();
54138
+ // set in the cache immediately to be able to reuse the object recursively
54139
+ state.cache.set(array, clone);
54140
+ return copyOwnPropertiesStrict(array, clone, state);
54141
+ }
54142
+ /**
54143
+ * Copy the contents of the ArrayBuffer.
54144
+ */
54145
+ function copyArrayBuffer(arrayBuffer, _state) {
54146
+ return arrayBuffer.slice(0);
54147
+ }
54148
+ /**
54149
+ * Create a new Blob with the contents of the original.
54150
+ */
54151
+ function copyBlob(blob, _state) {
54152
+ return blob.slice(0, blob.size, blob.type);
54153
+ }
54154
+ /**
54155
+ * Create a new DataView with the contents of the original.
54156
+ */
54157
+ function copyDataView(dataView, state) {
54158
+ return new state.Constructor(copyArrayBuffer(dataView.buffer));
54159
+ }
54160
+ /**
54161
+ * Create a new Date based on the time of the original.
54162
+ */
54163
+ function copyDate(date, state) {
54164
+ return new state.Constructor(date.getTime());
54165
+ }
54166
+ /**
54167
+ * Deeply copy the keys and values of the original.
54168
+ */
54169
+ function copyMapLoose(map, state) {
54170
+ var clone = new state.Constructor();
54171
+ // set in the cache immediately to be able to reuse the object recursively
54172
+ state.cache.set(map, clone);
54173
+ map.forEach(function (value, key) {
54174
+ clone.set(key, state.copier(value, state));
54175
+ });
54176
+ return clone;
54177
+ }
54178
+ /**
54179
+ * Deeply copy the keys and values of the original, as well as any custom properties.
54180
+ */
54181
+ function copyMapStrict(map, state) {
54182
+ return copyOwnPropertiesStrict(map, copyMapLoose(map, state), state);
54183
+ }
54184
+ function copyObjectLooseLegacy(object, state) {
54185
+ var clone = getCleanClone(state.prototype);
54186
+ // set in the cache immediately to be able to reuse the object recursively
54187
+ state.cache.set(object, clone);
54188
+ for (var key in object) {
54189
+ if (esm_hasOwnProperty.call(object, key)) {
54190
+ clone[key] = state.copier(object[key], state);
54191
+ }
54192
+ }
54193
+ return clone;
54194
+ }
54195
+ function copyObjectLooseModern(object, state) {
54196
+ var clone = getCleanClone(state.prototype);
54197
+ // set in the cache immediately to be able to reuse the object recursively
54198
+ state.cache.set(object, clone);
54199
+ for (var key in object) {
54200
+ if (esm_hasOwnProperty.call(object, key)) {
54201
+ clone[key] = state.copier(object[key], state);
54202
+ }
54203
+ }
54204
+ var symbols = getOwnPropertySymbols(object);
54205
+ for (var index = 0, length_3 = symbols.length, symbol = void 0; index < length_3; ++index) {
54206
+ symbol = symbols[index];
54207
+ if (propertyIsEnumerable.call(object, symbol)) {
54208
+ clone[symbol] = state.copier(object[symbol], state);
54209
+ }
54210
+ }
54211
+ return clone;
54212
+ }
54213
+ /**
54214
+ * Deeply copy the properties (keys and symbols) and values of the original.
54215
+ */
54216
+ var copyObjectLoose = SUPPORTS_SYMBOL
54217
+ ? copyObjectLooseModern
54218
+ : copyObjectLooseLegacy;
54219
+ /**
54220
+ * Deeply copy the properties (keys and symbols) and values of the original, as well
54221
+ * as any hidden or non-enumerable properties.
54222
+ */
54223
+ function copyObjectStrict(object, state) {
54224
+ var clone = getCleanClone(state.prototype);
54225
+ // set in the cache immediately to be able to reuse the object recursively
54226
+ state.cache.set(object, clone);
54227
+ return copyOwnPropertiesStrict(object, clone, state);
54228
+ }
54229
+ /**
54230
+ * Create a new primitive wrapper from the value of the original.
54231
+ */
54232
+ function copyPrimitiveWrapper(primitiveObject, state) {
54233
+ return new state.Constructor(primitiveObject.valueOf());
54234
+ }
54235
+ /**
54236
+ * Create a new RegExp based on the value and flags of the original.
54237
+ */
54238
+ function copyRegExp(regExp, state) {
54239
+ var clone = new state.Constructor(regExp.source, getRegExpFlags(regExp));
54240
+ clone.lastIndex = regExp.lastIndex;
54241
+ return clone;
54242
+ }
54243
+ /**
54244
+ * Return the original value (an identity function).
54245
+ *
54246
+ * @note
54247
+ * THis is used for objects that cannot be copied, such as WeakMap.
54248
+ */
54249
+ function copySelf(value, _state) {
54250
+ return value;
54251
+ }
54252
+ /**
54253
+ * Deeply copy the values of the original.
54254
+ */
54255
+ function copySetLoose(set, state) {
54256
+ var clone = new state.Constructor();
54257
+ // set in the cache immediately to be able to reuse the object recursively
54258
+ state.cache.set(set, clone);
54259
+ set.forEach(function (value) {
54260
+ clone.add(state.copier(value, state));
54261
+ });
54262
+ return clone;
54263
+ }
54264
+ /**
54265
+ * Deeply copy the values of the original, as well as any custom properties.
54266
+ */
54267
+ function copySetStrict(set, state) {
54268
+ return copyOwnPropertiesStrict(set, copySetLoose(set, state), state);
54269
+ }
54270
+
54271
+ var esm_isArray = Array.isArray;
54272
+ var esm_assign = Object.assign;
54273
+ var getPrototypeOf = Object.getPrototypeOf || (function (obj) { return obj.__proto__; });
54274
+ var DEFAULT_LOOSE_OPTIONS = {
54275
+ array: copyArrayLoose,
54276
+ arrayBuffer: copyArrayBuffer,
54277
+ blob: copyBlob,
54278
+ dataView: copyDataView,
54279
+ date: copyDate,
54280
+ error: copySelf,
54281
+ map: copyMapLoose,
54282
+ object: copyObjectLoose,
54283
+ regExp: copyRegExp,
54284
+ set: copySetLoose,
54285
+ };
54286
+ var DEFAULT_STRICT_OPTIONS = esm_assign({}, DEFAULT_LOOSE_OPTIONS, {
54287
+ array: copyArrayStrict,
54288
+ map: copyMapStrict,
54289
+ object: copyObjectStrict,
54290
+ set: copySetStrict,
54291
+ });
54292
+ /**
54293
+ * Get the copiers used for each specific object tag.
54294
+ */
54295
+ function getTagSpecificCopiers(options) {
54296
+ return {
54297
+ Arguments: options.object,
54298
+ Array: options.array,
54299
+ ArrayBuffer: options.arrayBuffer,
54300
+ Blob: options.blob,
54301
+ Boolean: copyPrimitiveWrapper,
54302
+ DataView: options.dataView,
54303
+ Date: options.date,
54304
+ Error: options.error,
54305
+ Float32Array: options.arrayBuffer,
54306
+ Float64Array: options.arrayBuffer,
54307
+ Int8Array: options.arrayBuffer,
54308
+ Int16Array: options.arrayBuffer,
54309
+ Int32Array: options.arrayBuffer,
54310
+ Map: options.map,
54311
+ Number: copyPrimitiveWrapper,
54312
+ Object: options.object,
54313
+ Promise: copySelf,
54314
+ RegExp: options.regExp,
54315
+ Set: options.set,
54316
+ String: copyPrimitiveWrapper,
54317
+ WeakMap: copySelf,
54318
+ WeakSet: copySelf,
54319
+ Uint8Array: options.arrayBuffer,
54320
+ Uint8ClampedArray: options.arrayBuffer,
54321
+ Uint16Array: options.arrayBuffer,
54322
+ Uint32Array: options.arrayBuffer,
54323
+ Uint64Array: options.arrayBuffer,
54324
+ };
54325
+ }
54326
+ /**
54327
+ * Create a custom copier based on the object-specific copy methods passed.
54328
+ */
54329
+ function createCopier(options) {
54330
+ var normalizedOptions = esm_assign({}, DEFAULT_LOOSE_OPTIONS, options);
54331
+ var tagSpecificCopiers = getTagSpecificCopiers(normalizedOptions);
54332
+ var array = tagSpecificCopiers.Array, object = tagSpecificCopiers.Object;
54333
+ function copier(value, state) {
54334
+ state.prototype = state.Constructor = undefined;
54335
+ if (!value || typeof value !== 'object') {
54336
+ return value;
54337
+ }
54338
+ if (state.cache.has(value)) {
54339
+ return state.cache.get(value);
54340
+ }
54341
+ state.prototype = getPrototypeOf(value);
54342
+ state.Constructor = state.prototype && state.prototype.constructor;
54343
+ // plain objects
54344
+ if (!state.Constructor || state.Constructor === Object) {
54345
+ return object(value, state);
54346
+ }
54347
+ // arrays
54348
+ if (esm_isArray(value)) {
54349
+ return array(value, state);
54350
+ }
54351
+ var tagSpecificCopier = tagSpecificCopiers[getTag(value)];
54352
+ if (tagSpecificCopier) {
54353
+ return tagSpecificCopier(value, state);
54354
+ }
54355
+ return typeof value.then === 'function' ? value : object(value, state);
54356
+ }
54357
+ return function copy(value) {
54358
+ return copier(value, {
54359
+ Constructor: undefined,
54360
+ cache: createCache(),
54361
+ copier: copier,
54362
+ prototype: undefined,
54363
+ });
54364
+ };
54365
+ }
54366
+ /**
54367
+ * Create a custom copier based on the object-specific copy methods passed, defaulting to the
54368
+ * same internals as `copyStrict`.
54369
+ */
54370
+ function createStrictCopier(options) {
54371
+ return createCopier(esm_assign({}, DEFAULT_STRICT_OPTIONS, options));
54372
+ }
54373
+ /**
54374
+ * Copy an value deeply as much as possible, where strict recreation of object properties
54375
+ * are maintained. All properties (including non-enumerable ones) are copied with their
54376
+ * original property descriptors on both objects and arrays.
54377
+ */
54378
+ var copyStrict = createStrictCopier({});
54379
+ /**
54380
+ * Copy an value deeply as much as possible.
54381
+ */
54382
+ var index = createCopier({});
54383
+
54384
+
54385
+ //# sourceMappingURL=index.mjs.map
54386
+
54698
54387
  ;// CONCATENATED MODULE: ../semi-foundation/datePicker/inputFoundation.ts
54699
54388
 
54700
54389
 
@@ -54811,7 +54500,7 @@ class inputFoundation_InputFoundation extends foundation {
54811
54500
  type,
54812
54501
  format
54813
54502
  });
54814
- const newInsetInputValue = set_default()(cloneDeep_default()(insetInputValue), valuePath, value);
54503
+ const newInsetInputValue = set_default()(index(insetInputValue), valuePath, value);
54815
54504
  const insetInputStr = this.concatInsetInputValue({
54816
54505
  insetInputValue: newInsetInputValue
54817
54506
  });
@@ -54845,7 +54534,7 @@ class inputFoundation_InputFoundation extends foundation {
54845
54534
  defaultPickerValue,
54846
54535
  dateFnsLocale
54847
54536
  } = this._adapter.getProps();
54848
- const insetInputValueWithTime = cloneDeep_default()(insetInputValue);
54537
+ const insetInputValueWithTime = index(insetInputValue);
54849
54538
  const {
54850
54539
  nowDate,
54851
54540
  nextDate
@@ -58966,7 +58655,7 @@ class YearAndMonthFoundation extends foundation {
58966
58655
  } = this.getProps();
58967
58656
  const left = datePicker_constants_strings.PANEL_TYPE_LEFT;
58968
58657
  const right = datePicker_constants_strings.PANEL_TYPE_RIGHT;
58969
- const year = cloneDeep_default()(currentYear);
58658
+ const year = index(currentYear);
58970
58659
  year[panelType] = item.value;
58971
58660
  // make sure the right panel time is always less than the left panel time
58972
58661
  if (type === 'monthRange') {
@@ -58993,7 +58682,7 @@ class YearAndMonthFoundation extends foundation {
58993
58682
  } = this.getProps();
58994
58683
  const left = datePicker_constants_strings.PANEL_TYPE_LEFT;
58995
58684
  const right = datePicker_constants_strings.PANEL_TYPE_RIGHT;
58996
- const month = cloneDeep_default()(currentMonth);
58685
+ const month = index(currentMonth);
58997
58686
  month[panelType] = item.month;
58998
58687
  // make sure the right panel time is always less than the left panel time
58999
58688
  if (type === 'monthRange' && panelType === left && currentYear[left] === currentYear[right] && item.value > month[right]) {
@@ -59040,7 +58729,7 @@ class YearAndMonthFoundation extends foundation {
59040
58729
  });
59041
58730
  }
59042
58731
  if (validMonth) {
59043
- const month = cloneDeep_default()(currentMonth);
58732
+ const month = index(currentMonth);
59044
58733
  month[panelType] = validMonth.month;
59045
58734
  // change year and month same time
59046
58735
  this._adapter.setCurrentYearAndMonth(year, month);
@@ -59109,16 +58798,6 @@ class YearAndMonth extends BaseComponent {
59109
58798
  currentYear,
59110
58799
  currentMonth
59111
58800
  } = props;
59112
- const currentLeftYear = currentYear.left || now.getFullYear();
59113
- const currentLeftMonth = currentMonth.left || now.getMonth() + 1;
59114
- currentYear = {
59115
- left: currentLeftYear,
59116
- right: currentLeftYear
59117
- };
59118
- currentMonth = {
59119
- left: currentLeftMonth,
59120
- right: currentMonth.right || currentLeftMonth + 1
59121
- };
59122
58801
  this.state = {
59123
58802
  years: _utils_getYears(props.startYear, props.endYear).map(year => ({
59124
58803
  value: year,
@@ -59128,8 +58807,14 @@ class YearAndMonth extends BaseComponent {
59128
58807
  value: idx + 1,
59129
58808
  month: idx + 1
59130
58809
  })),
59131
- currentYear,
59132
- currentMonth
58810
+ currentYear: {
58811
+ left: currentYear.left || now.getFullYear(),
58812
+ right: currentYear.right || now.getFullYear()
58813
+ },
58814
+ currentMonth: {
58815
+ left: currentMonth.left || now.getMonth() + 1,
58816
+ right: currentMonth.right || now.getMonth() + 2
58817
+ }
59133
58818
  };
59134
58819
  this.yearRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
59135
58820
  this.monthRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
@@ -59166,11 +58851,19 @@ class YearAndMonth extends BaseComponent {
59166
58851
  }
59167
58852
  static getDerivedStateFromProps(props, state) {
59168
58853
  const willUpdateStates = {};
59169
- if (!isEqual_default()(props.currentYear, state.currentYear) && props.currentYear.left !== 0) {
59170
- willUpdateStates.currentYear = props.currentYear;
58854
+ if (!isEqual_default()(props.currentYear, state.currentYear)) {
58855
+ const nowYear = new Date().getFullYear();
58856
+ willUpdateStates.currentYear = {
58857
+ left: props.currentYear.left || nowYear,
58858
+ right: props.currentYear.right || nowYear
58859
+ };
59171
58860
  }
59172
- if (!isEqual_default()(props.currentMonth, state.currentMonth) && props.currentMonth.left !== 0) {
59173
- willUpdateStates.currentMonth = props.currentMonth;
58861
+ if (!isEqual_default()(props.currentMonth, state.currentMonth)) {
58862
+ const nowMonth = new Date().getMonth();
58863
+ willUpdateStates.currentMonth = {
58864
+ left: props.currentMonth.left || nowMonth + 1,
58865
+ right: props.currentMonth.right || nowMonth + 2
58866
+ };
59174
58867
  }
59175
58868
  return willUpdateStates;
59176
58869
  }
@@ -60156,6 +59849,7 @@ var datePicker_rest = undefined && undefined.__rest || function (s, e) {
60156
59849
 
60157
59850
 
60158
59851
 
59852
+
60159
59853
  class DatePicker extends BaseComponent {
60160
59854
  constructor(props) {
60161
59855
  var _this;
@@ -60589,7 +60283,7 @@ class DatePicker extends BaseComponent {
60589
60283
  return /range/i.test(type) && !isFunction_default()(triggerRender);
60590
60284
  }
60591
60285
  componentDidUpdate(prevProps) {
60592
- if (prevProps.value !== this.props.value) {
60286
+ if (!isEqual_default()(prevProps.value, this.props.value)) {
60593
60287
  this.foundation.initFromProps(Object.assign({}, this.props));
60594
60288
  } else if (this.props.timeZone !== prevProps.timeZone) {
60595
60289
  this.foundation.initFromProps({
@@ -60963,7 +60657,8 @@ DatePicker.propTypes = {
60963
60657
  yearAndMonthOpts: (prop_types_default()).object,
60964
60658
  onClickOutSide: (prop_types_default()).func
60965
60659
  };
60966
- DatePicker.defaultProps = {
60660
+ DatePicker.__SemiComponentName__ = "DatePicker";
60661
+ DatePicker.defaultProps = getDefaultPropsFromGlobalConfig(DatePicker.__SemiComponentName__, {
60967
60662
  onChangeWithDateFirst: true,
60968
60663
  borderless: false,
60969
60664
  autoAdjustOverflow: true,
@@ -61001,7 +60696,7 @@ DatePicker.defaultProps = {
61001
60696
  rangeSeparator: datePicker_constants_strings.DEFAULT_SEPARATOR_RANGE,
61002
60697
  insetInput: false,
61003
60698
  onClickOutSide: (noop_default())
61004
- };
60699
+ });
61005
60700
  ;// CONCATENATED MODULE: ./datePicker/index.tsx
61006
60701
 
61007
60702
 
@@ -62336,6 +62031,7 @@ const destroyFns = [];
62336
62031
  class Modal extends BaseComponent {
62337
62032
  constructor(props) {
62338
62033
  super(props);
62034
+ this.bodyOverflow = null;
62339
62035
  this.handleCancel = e => {
62340
62036
  this.foundation.handleCancel(e);
62341
62037
  };
@@ -62482,7 +62178,6 @@ class Modal extends BaseComponent {
62482
62178
  };
62483
62179
  this.foundation = new ModalFoundation(this.adapter);
62484
62180
  this.modalRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().createRef();
62485
- this.bodyOverflow = '';
62486
62181
  this.scrollBarWidth = 0;
62487
62182
  this.originBodyWidth = '100%';
62488
62183
  }
@@ -62503,7 +62198,7 @@ class Modal extends BaseComponent {
62503
62198
  const {
62504
62199
  getPopupContainer
62505
62200
  } = this.props;
62506
- if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
62201
+ if (!getPopupContainer && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
62507
62202
  document.body.style.overflow = this.bodyOverflow;
62508
62203
  document.body.style.width = this.originBodyWidth;
62509
62204
  }
@@ -62621,7 +62316,8 @@ Modal.propTypes = {
62621
62316
  fullScreen: (prop_types_default()).bool,
62622
62317
  footerFill: (prop_types_default()).bool
62623
62318
  };
62624
- Modal.defaultProps = {
62319
+ Modal.__SemiComponentName__ = "Modal";
62320
+ Modal.defaultProps = getDefaultPropsFromGlobalConfig(Modal.__SemiComponentName__, {
62625
62321
  zIndex: 1000,
62626
62322
  motion: true,
62627
62323
  mask: true,
@@ -62640,7 +62336,7 @@ Modal.defaultProps = {
62640
62336
  keepDOM: false,
62641
62337
  lazyRender: true,
62642
62338
  fullScreen: false
62643
- };
62339
+ });
62644
62340
  Modal.useModal = useModal;
62645
62341
  Modal.info = function (props) {
62646
62342
  return confirm_confirm(withInfo(props));
@@ -63061,6 +62757,7 @@ var dropdown_rest = undefined && undefined.__rest || function (s, e) {
63061
62757
 
63062
62758
 
63063
62759
 
62760
+
63064
62761
  const dropdown_positionSet = dropdown_constants_strings.POSITION_SET;
63065
62762
  const dropdown_triggerSet = dropdown_constants_strings.TRIGGER_SET;
63066
62763
  class Dropdown extends BaseComponent {
@@ -63268,7 +62965,8 @@ Dropdown.propTypes = {
63268
62965
  visible: (prop_types_default()).bool,
63269
62966
  zIndex: (prop_types_default()).number
63270
62967
  };
63271
- Dropdown.defaultProps = {
62968
+ Dropdown.__SemiComponentName__ = "Dropdown";
62969
+ Dropdown.defaultProps = getDefaultPropsFromGlobalConfig(Dropdown.__SemiComponentName__, {
63272
62970
  onVisibleChange: (noop_default()),
63273
62971
  prefixCls: dropdown_constants_cssClasses.PREFIX,
63274
62972
  zIndex: numbers.DEFAULT_Z_INDEX,
@@ -63279,7 +62977,7 @@ Dropdown.defaultProps = {
63279
62977
  showTick: false,
63280
62978
  closeOnEsc: true,
63281
62979
  onEscKeyDown: (noop_default())
63282
- };
62980
+ });
63283
62981
  /* harmony default export */ const dropdown_0 = (Dropdown);
63284
62982
  ;// CONCATENATED MODULE: ../semi-foundation/grid/constants.ts
63285
62983
 
@@ -67326,6 +67024,7 @@ var navigation_rest = undefined && undefined.__rest || function (s, e) {
67326
67024
 
67327
67025
 
67328
67026
 
67027
+
67329
67028
  function createAddKeysFn(context, keyName) {
67330
67029
  return function addKeys() {
67331
67030
  const handleKeys = new Set(context.state[keyName]);
@@ -67663,7 +67362,8 @@ Nav.propTypes = {
67663
67362
  limitIndent: (prop_types_default()).bool,
67664
67363
  getPopupContainer: (prop_types_default()).func
67665
67364
  };
67666
- Nav.defaultProps = {
67365
+ Nav.__SemiComponentName__ = "Navigation";
67366
+ Nav.defaultProps = getDefaultPropsFromGlobalConfig(Nav.__SemiComponentName__, {
67667
67367
  subNavCloseDelay: navigation_constants_numbers.DEFAULT_SUBNAV_CLOSE_DELAY,
67668
67368
  subNavOpenDelay: navigation_constants_numbers.DEFAULT_SUBNAV_OPEN_DELAY,
67669
67369
  tooltipHideDelay: navigation_constants_numbers.DEFAULT_TOOLTIP_HIDE_DELAY,
@@ -67681,7 +67381,7 @@ Nav.defaultProps = {
67681
67381
  // defaultOpenKeys: [],
67682
67382
  // defaultSelectedKeys: [],
67683
67383
  // items: [],
67684
- };
67384
+ });
67685
67385
 
67686
67386
  /* harmony default export */ const navigation_0 = (Nav);
67687
67387
  ;// CONCATENATED MODULE: ../semi-foundation/notification/notificationListFoundation.ts
@@ -67969,7 +67669,8 @@ Notice.propTypes = {
67969
67669
  close: (prop_types_default()).func,
67970
67670
  direction: prop_types_default().oneOf(notice_directions)
67971
67671
  };
67972
- Notice.defaultProps = {
67672
+ Notice.__SemiComponentName__ = "Notification";
67673
+ Notice.defaultProps = getDefaultPropsFromGlobalConfig(Notice.__SemiComponentName__, {
67973
67674
  duration,
67974
67675
  id: '',
67975
67676
  close: (noop_default()),
@@ -67980,7 +67681,7 @@ Notice.defaultProps = {
67980
67681
  title: '',
67981
67682
  showClose: true,
67982
67683
  theme: 'normal'
67983
- };
67684
+ });
67984
67685
  /* harmony default export */ const notification_notice = (Notice);
67985
67686
  // EXTERNAL MODULE: ../semi-foundation/notification/notification.scss
67986
67687
  var notification = __webpack_require__("x46V");
@@ -68525,7 +68226,7 @@ class OverflowListFoundation extends foundation {
68525
68226
  const {
68526
68227
  items
68527
68228
  } = this.getProps();
68528
- return cloneDeep_default()(items).reverse();
68229
+ return index(items).reverse();
68529
68230
  };
68530
68231
  }
68531
68232
  getOverflowItem() {
@@ -68553,7 +68254,7 @@ class OverflowListFoundation extends foundation {
68553
68254
  return overflowList;
68554
68255
  }
68555
68256
  handleIntersect(entries) {
68556
- const visibleState = cloneDeep_default()(this.getState('visibleState'));
68257
+ const visibleState = index(this.getState('visibleState'));
68557
68258
  const res = {};
68558
68259
  entries.forEach(entry => {
68559
68260
  const itemKey = get_default()(entry, 'target.dataset.scrollkey');
@@ -68913,7 +68614,8 @@ class OverflowList extends BaseComponent {
68913
68614
  }, list);
68914
68615
  }
68915
68616
  }
68916
- OverflowList.defaultProps = {
68617
+ OverflowList.__SemiComponentName__ = "OverflowList";
68618
+ OverflowList.defaultProps = getDefaultPropsFromGlobalConfig(OverflowList.__SemiComponentName__, {
68917
68619
  collapseFrom: 'end',
68918
68620
  minVisibleItems: 0,
68919
68621
  overflowRenderer: () => null,
@@ -68921,7 +68623,7 @@ OverflowList.defaultProps = {
68921
68623
  threshold: 0.75,
68922
68624
  visibleItemRenderer: () => null,
68923
68625
  onOverflow: () => null
68924
- };
68626
+ });
68925
68627
  OverflowList.propTypes = {
68926
68628
  // if render in scroll mode, key is required in items
68927
68629
  className: (prop_types_default()).string,
@@ -70269,6 +69971,8 @@ class SelectFoundation extends foundation {
70269
69971
  if (filter) {
70270
69972
  this.clearInput(e);
70271
69973
  }
69974
+ // after click showClear button, the select need to be focused
69975
+ this.focus();
70272
69976
  this.clearSelected();
70273
69977
  // prevent this click open dropdown
70274
69978
  e.stopPropagation();
@@ -70779,7 +70483,8 @@ class option_Option extends external_root_React_commonjs2_react_commonjs_react_a
70779
70483
  value,
70780
70484
  label,
70781
70485
  children
70782
- }, rest), e)
70486
+ }, rest), e),
70487
+ className
70783
70488
  }, rest));
70784
70489
  }
70785
70490
  const config = {
@@ -72166,7 +71871,8 @@ Select.propTypes = {
72166
71871
  // tagClosable: PropTypes.bool,
72167
71872
  };
72168
71873
 
72169
- Select.defaultProps = {
71874
+ Select.__SemiComponentName__ = "Select";
71875
+ Select.defaultProps = getDefaultPropsFromGlobalConfig(Select.__SemiComponentName__, {
72170
71876
  stopPropagation: true,
72171
71877
  motion: true,
72172
71878
  borderless: false,
@@ -72211,7 +71917,7 @@ Select.defaultProps = {
72211
71917
  // renderSelectedItem: (optionNode) => optionNode.label,
72212
71918
  // The default creator rendering is related to i18, so it is not declared here
72213
71919
  // renderCreateItem: (input) => input
72214
- };
71920
+ });
72215
71921
 
72216
71922
  /* harmony default export */ const select_0 = (Select);
72217
71923
  ;// CONCATENATED MODULE: ./pagination/index.tsx
@@ -72791,6 +72497,7 @@ var popconfirm_rest = undefined && undefined.__rest || function (s, e) {
72791
72497
 
72792
72498
 
72793
72499
 
72500
+
72794
72501
  class Popconfirm extends BaseComponent {
72795
72502
  constructor(props) {
72796
72503
  super(props);
@@ -73022,7 +72729,8 @@ Popconfirm.propTypes = {
73022
72729
  trigger: (prop_types_default()).string,
73023
72730
  position: (prop_types_default()).string
73024
72731
  };
73025
- Popconfirm.defaultProps = {
72732
+ Popconfirm.__SemiComponentName__ = "Popconfirm";
72733
+ Popconfirm.defaultProps = getDefaultPropsFromGlobalConfig(Popconfirm.__SemiComponentName__, {
73026
72734
  stopPropagation: true,
73027
72735
  trigger: 'click',
73028
72736
  // position: 'bottomLeft',
@@ -73039,7 +72747,7 @@ Popconfirm.defaultProps = {
73039
72747
  onCancel: (noop_default()),
73040
72748
  onConfirm: (noop_default()),
73041
72749
  onClickOutSide: (noop_default())
73042
- };
72750
+ });
73043
72751
  ;// CONCATENATED MODULE: ../semi-foundation/progress/constants.ts
73044
72752
 
73045
72753
  const progress_constants_cssClasses = {
@@ -75639,7 +75347,8 @@ SideSheet.propTypes = {
75639
75347
  keepDOM: (prop_types_default()).bool,
75640
75348
  'aria-label': (prop_types_default()).string
75641
75349
  };
75642
- SideSheet.defaultProps = {
75350
+ SideSheet.__SemiComponentName__ = "SideSheet";
75351
+ SideSheet.defaultProps = getDefaultPropsFromGlobalConfig(SideSheet.__SemiComponentName__, {
75643
75352
  visible: false,
75644
75353
  motion: true,
75645
75354
  mask: true,
@@ -75653,7 +75362,7 @@ SideSheet.defaultProps = {
75653
75362
  closeOnEsc: false,
75654
75363
  afterVisibleChange: (noop_default()),
75655
75364
  keepDOM: false
75656
- };
75365
+ });
75657
75366
  ;// CONCATENATED MODULE: ../semi-foundation/slider/constants.ts
75658
75367
 
75659
75368
  const slider_constants_cssClasses = {
@@ -84570,7 +84279,7 @@ const ResizableTable = function () {
84570
84279
  width: table_constants_numbers.DEFAULT_WIDTH_COLUMN_EXPAND
84571
84280
  });
84572
84281
  }
84573
- if (props.rowSelection && !find_default()(rawColumns, item => item.key === table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION)) {
84282
+ if (props.rowSelection && !get_default()(props.rowSelection, 'hidden') && !find_default()(rawColumns, item => item.key === table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION)) {
84574
84283
  newColumns.unshift({
84575
84284
  width: get_default()(props, 'rowSelection.width', table_constants_numbers.DEFAULT_WIDTH_COLUMN_SELECTION),
84576
84285
  key: table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION
@@ -85379,6 +85088,7 @@ var tabs_rest = undefined && undefined.__rest || function (s, e) {
85379
85088
 
85380
85089
 
85381
85090
 
85091
+
85382
85092
  const panePickKeys = ['className', 'style', 'disabled', 'itemKey', 'tab', 'icon'];
85383
85093
 
85384
85094
  class Tabs extends BaseComponent {
@@ -85679,7 +85389,8 @@ Tabs.propTypes = {
85679
85389
  onTabClose: (prop_types_default()).func,
85680
85390
  preventScroll: (prop_types_default()).bool
85681
85391
  };
85682
- Tabs.defaultProps = {
85392
+ Tabs.__SemiComponentName__ = "Tabs";
85393
+ Tabs.defaultProps = getDefaultPropsFromGlobalConfig(Tabs.__SemiComponentName__, {
85683
85394
  children: [],
85684
85395
  collapsible: false,
85685
85396
  keepDOM: true,
@@ -85691,7 +85402,7 @@ Tabs.defaultProps = {
85691
85402
  tabPosition: 'top',
85692
85403
  type: 'line',
85693
85404
  onTabClose: () => undefined
85694
- };
85405
+ });
85695
85406
  /* harmony default export */ const tabs_0 = (Tabs);
85696
85407
  // EXTERNAL MODULE: ../semi-foundation/timeline/timeline.scss
85697
85408
  var timeline = __webpack_require__("9ff2");
@@ -87078,6 +86789,7 @@ TimePicker.defaultProps = Object.assign({
87078
86789
 
87079
86790
 
87080
86791
 
86792
+
87081
86793
  class LocaleTimePicker extends (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).PureComponent {
87082
86794
  render() {
87083
86795
  const {
@@ -87101,7 +86813,8 @@ class LocaleTimePicker extends (external_root_React_commonjs2_react_commonjs_rea
87101
86813
  }
87102
86814
  }
87103
86815
  LocaleTimePicker.propTypes = TimePicker.propTypes;
87104
- LocaleTimePicker.defaultProps = TimePicker.defaultProps;
86816
+ LocaleTimePicker.__SemiComponentName__ = "TimePicker";
86817
+ LocaleTimePicker.defaultProps = getDefaultPropsFromGlobalConfig(LocaleTimePicker.__SemiComponentName__, TimePicker.defaultProps);
87105
86818
  ;// CONCATENATED MODULE: ../semi-foundation/toast/toastListFoundation.ts
87106
86819
 
87107
86820
  class ToastListFoundation extends foundation {
@@ -87376,7 +87089,8 @@ Toast.propTypes = {
87376
87089
  icon: (prop_types_default()).node,
87377
87090
  direction: prop_types_default().oneOf(toast_constants_strings.directions)
87378
87091
  };
87379
- Toast.defaultProps = {
87092
+ Toast.__SemiComponentName__ = "Toast";
87093
+ Toast.defaultProps = getDefaultPropsFromGlobalConfig(Toast.__SemiComponentName__, {
87380
87094
  onClose: (noop_default()),
87381
87095
  content: '',
87382
87096
  close: (noop_default()),
@@ -87386,7 +87100,7 @@ Toast.defaultProps = {
87386
87100
  stack: false,
87387
87101
  stackExpanded: false,
87388
87102
  theme: 'normal'
87389
- };
87103
+ });
87390
87104
  /* harmony default export */ const toast = (Toast);
87391
87105
  // EXTERNAL MODULE: ../semi-foundation/toast/toast.scss
87392
87106
  var toast_toast = __webpack_require__("Ybhv");
@@ -87797,7 +87511,6 @@ class ToastFactory {
87797
87511
 
87798
87512
 
87799
87513
 
87800
-
87801
87514
  /**
87802
87515
  * The drag and drop handler implementation is referenced from rc-tree
87803
87516
  * https://github.com/react-component/tree
@@ -87843,13 +87556,6 @@ class TreeFoundation extends foundation {
87843
87556
  } = this.getProps();
87844
87557
  return Boolean(inputValue) && showFilteredOnly;
87845
87558
  }
87846
- getCopyFromState(items) {
87847
- const res = {};
87848
- normalizedArr(items).forEach(key => {
87849
- res[key] = cloneDeep_default()(this.getState(key));
87850
- });
87851
- return res;
87852
- }
87853
87559
  getTreeNodeProps(key) {
87854
87560
  const {
87855
87561
  expandedKeys = new Set([]),
@@ -88018,9 +87724,7 @@ class TreeFoundation extends foundation {
88018
87724
  this._adapter.notifyDoubleClick(e, treeNode.data);
88019
87725
  }
88020
87726
  handleSingleSelect(e, treeNode) {
88021
- let {
88022
- selectedKeys
88023
- } = this.getCopyFromState('selectedKeys');
87727
+ let selectedKeys = [...this.getState('selectedKeys')];
88024
87728
  const {
88025
87729
  selected,
88026
87730
  eventKey,
@@ -88045,10 +87749,8 @@ class TreeFoundation extends foundation {
88045
87749
  const {
88046
87750
  keyEntities
88047
87751
  } = this.getStates();
88048
- const {
88049
- checkedKeys,
88050
- halfCheckedKeys
88051
- } = this.getCopyFromState(['checkedKeys', 'halfCheckedKeys']);
87752
+ const checkedKeys = new Set(this.getState('checkedKeys'));
87753
+ const halfCheckedKeys = new Set(this.getState('halfCheckedKeys'));
88052
87754
  return targetStatus ? calcCheckedKeysForChecked(eventKey, keyEntities, checkedKeys, halfCheckedKeys) : calcCheckedKeysForUnchecked(eventKey, keyEntities, checkedKeys, halfCheckedKeys);
88053
87755
  }
88054
87756
  /*
@@ -88084,9 +87786,7 @@ class TreeFoundation extends foundation {
88084
87786
  keyEntities,
88085
87787
  disabledKeys
88086
87788
  } = this.getStates();
88087
- const {
88088
- checkedKeys
88089
- } = this.getCopyFromState(['checkedKeys']);
87789
+ const checkedKeys = new Set(this.getState('checkedKeys'));
88090
87790
  const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
88091
87791
  const hasDisabled = descendantKeys.some(key => disabledKeys.has(key));
88092
87792
  // If none of the descendant nodes are disabled, follow the normal logic
@@ -88161,7 +87861,7 @@ class TreeFoundation extends foundation {
88161
87861
  const isSearching = Boolean(inputValue);
88162
87862
  const showFilteredOnly = this._showFilteredOnly();
88163
87863
  const expandedStateKey = isSearching ? 'filteredExpandedKeys' : 'expandedKeys';
88164
- const expandedKeys = this.getCopyFromState(expandedStateKey)[expandedStateKey];
87864
+ const expandedKeys = new Set(this.getState(expandedStateKey));
88165
87865
  let motionType = 'show';
88166
87866
  const {
88167
87867
  eventKey,
@@ -88222,10 +87922,8 @@ class TreeFoundation extends foundation {
88222
87922
  }
88223
87923
  // Process the loaded data
88224
87924
  loadData(data).then(() => {
88225
- const {
88226
- loadedKeys: prevLoadedKeys,
88227
- loadingKeys: prevLoadingKeys
88228
- } = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
87925
+ const prevLoadedKeys = new Set(this.getState('loadedKeys'));
87926
+ const prevLoadingKeys = new Set(this.getState('loadingKeys'));
88229
87927
  const newLoadedKeys = prevLoadedKeys.add(key);
88230
87928
  const newLoadingKeys = new Set([...prevLoadingKeys]);
88231
87929
  newLoadingKeys.delete(key);
@@ -90032,7 +89730,6 @@ const treeSelect_constants_numbers = {};
90032
89730
 
90033
89731
 
90034
89732
 
90035
-
90036
89733
  class TreeSelectFoundation extends foundation {
90037
89734
  constructor(adapter) {
90038
89735
  super(Object.assign({}, adapter));
@@ -90155,13 +89852,6 @@ class TreeSelectFoundation extends foundation {
90155
89852
  return this.constructDataForValue(value);
90156
89853
  }
90157
89854
  }
90158
- getCopyFromState(items) {
90159
- const res = {};
90160
- normalizedArr(items).forEach(key => {
90161
- res[key] = cloneDeep_default()(this.getState(key));
90162
- });
90163
- return res;
90164
- }
90165
89855
  getTreeNodeProps(key) {
90166
89856
  const {
90167
89857
  expandedKeys = new Set([]),
@@ -90227,10 +89917,8 @@ class TreeSelectFoundation extends foundation {
90227
89917
  return {};
90228
89918
  }
90229
89919
  loadData(data).then(() => {
90230
- const {
90231
- loadedKeys: prevLoadedKeys,
90232
- loadingKeys: prevLoadingKeys
90233
- } = this.getCopyFromState(['loadedKeys', 'loadingKeys']);
89920
+ const prevLoadedKeys = new Set(this.getState('loadedKeys'));
89921
+ const prevLoadingKeys = new Set(this.getState('loadingKeys'));
90234
89922
  const newLoadedKeys = prevLoadedKeys.add(key);
90235
89923
  const newLoadingKeys = new Set([...prevLoadingKeys]);
90236
89924
  newLoadingKeys.delete(key);
@@ -90543,9 +90231,7 @@ class TreeSelectFoundation extends foundation {
90543
90231
  }
90544
90232
  }
90545
90233
  handleSingleSelect(e, treeNode) {
90546
- let {
90547
- selectedKeys
90548
- } = this.getCopyFromState('selectedKeys');
90234
+ let selectedKeys = [...this.getState('selectedKeys')];
90549
90235
  const {
90550
90236
  clickToHide
90551
90237
  } = this.getProps();
@@ -90573,10 +90259,8 @@ class TreeSelectFoundation extends foundation {
90573
90259
  const {
90574
90260
  keyEntities
90575
90261
  } = this.getStates();
90576
- const {
90577
- checkedKeys,
90578
- halfCheckedKeys
90579
- } = this.getCopyFromState(['checkedKeys', 'halfCheckedKeys']);
90262
+ const checkedKeys = new Set(this.getState('checkedKeys'));
90263
+ const halfCheckedKeys = new Set(this.getState('halfCheckedKeys'));
90580
90264
  if (targetStatus) {
90581
90265
  return calcCheckedKeysForChecked(eventKey, keyEntities, checkedKeys, halfCheckedKeys);
90582
90266
  } else {
@@ -90643,9 +90327,7 @@ class TreeSelectFoundation extends foundation {
90643
90327
  keyEntities,
90644
90328
  disabledKeys
90645
90329
  } = this.getStates();
90646
- const {
90647
- checkedKeys
90648
- } = this.getCopyFromState(['checkedKeys']);
90330
+ const checkedKeys = new Set(this.getState('checkedKeys'));
90649
90331
  const descendantKeys = normalizeKeyList(findDescendantKeys([eventKey], keyEntities, false), keyEntities, true);
90650
90332
  const hasDisabled = descendantKeys.some(key => disabledKeys.has(key));
90651
90333
  if (!hasDisabled) {
@@ -90682,9 +90364,7 @@ class TreeSelectFoundation extends foundation {
90682
90364
  } = this.getStates();
90683
90365
  const showFilteredOnly = this._showFilteredOnly();
90684
90366
  // clone otherwise will be modified unexpectedly
90685
- const {
90686
- filteredExpandedKeys
90687
- } = this.getCopyFromState('filteredExpandedKeys');
90367
+ const filteredExpandedKeys = new Set(this.getState('filteredExpandedKeys'));
90688
90368
  let motionType = 'show';
90689
90369
  const {
90690
90370
  eventKey,
@@ -90740,9 +90420,7 @@ class TreeSelectFoundation extends foundation {
90740
90420
  treeData
90741
90421
  } = this.getStates();
90742
90422
  // clone otherwise will be modified unexpectedly
90743
- const {
90744
- expandedKeys
90745
- } = this.getCopyFromState('expandedKeys');
90423
+ const expandedKeys = new Set(this.getState('expandedKeys'));
90746
90424
  let motionType = 'show';
90747
90425
  const {
90748
90426
  eventKey,
@@ -92278,7 +91956,7 @@ const upload_constants_numbers = {
92278
91956
  };
92279
91957
 
92280
91958
  ;// CONCATENATED MODULE: ../semi-foundation/upload/utils.ts
92281
- var __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
91959
+ var utils_awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {
92282
91960
  function adopt(value) {
92283
91961
  return value instanceof P ? value : new P(function (resolve) {
92284
91962
  resolve(value);
@@ -92321,7 +91999,7 @@ function endsWith(str, suffix) {
92321
91999
  return str.indexOf(suffix, str.length - suffix.length) !== -1;
92322
92000
  }
92323
92001
  function loopFiles(item) {
92324
- return __awaiter(this, void 0, void 0, function* () {
92002
+ return utils_awaiter(this, void 0, void 0, function* () {
92325
92003
  return new Promise((res, rej) => {
92326
92004
  const dirReader = item.createReader();
92327
92005
  let fileList = [];
@@ -92343,9 +92021,9 @@ function loopFiles(item) {
92343
92021
  });
92344
92022
  }
92345
92023
  function mapFileTree(items) {
92346
- return __awaiter(this, void 0, void 0, function* () {
92024
+ return utils_awaiter(this, void 0, void 0, function* () {
92347
92025
  const promises = [];
92348
- const _traverseFileTree = (item, path) => __awaiter(this, void 0, void 0, function* () {
92026
+ const _traverseFileTree = (item, path) => utils_awaiter(this, void 0, void 0, function* () {
92349
92027
  path = path || '';
92350
92028
  //@ts-ignore add path property into item
92351
92029
  item.path = path;
@@ -96940,7 +96618,6 @@ Schema.validators = validators;
96940
96618
 
96941
96619
  ;// CONCATENATED MODULE: ../semi-foundation/form/utils.ts
96942
96620
 
96943
-
96944
96621
  var form_utils_rest = undefined && undefined.__rest || function (s, e) {
96945
96622
  var t = {};
96946
96623
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
@@ -96951,6 +96628,7 @@ var form_utils_rest = undefined && undefined.__rest || function (s, e) {
96951
96628
  };
96952
96629
 
96953
96630
 
96631
+
96954
96632
  /**
96955
96633
  *
96956
96634
  * @param WrappedComponent React.ComponentType | any
@@ -97108,7 +96786,7 @@ function mergeProps(props) {
97108
96786
  delete rest.defaultValue;
97109
96787
  delete rest.checked;
97110
96788
  if (typeof initValue !== 'undefined') {
97111
- initValue = cloneDeep_default()(initValue);
96789
+ initValue = index(initValue);
97112
96790
  }
97113
96791
  const required = isRequired(rules);
97114
96792
  emptyValue = typeof emptyValue !== 'undefined' ? emptyValue : '';
@@ -99257,8 +98935,8 @@ class ArrayFieldComponent extends external_root_React_commonjs2_react_commonjs_r
99257
98935
  // whether the fields inside arrayField should use props.initValue in current render process
99258
98936
  this.shouldUseInitValue = !context.getArrayField(field);
99259
98937
  // Separate the arrays that reset and the usual add and remove modify, otherwise they will affect each other
99260
- const initValueCopyForFormState = cloneDeep_default()(initValue);
99261
- const initValueCopyForReset = cloneDeep_default()(initValue);
98938
+ const initValueCopyForFormState = index(initValue);
98939
+ const initValueCopyForReset = index(initValue);
99262
98940
  context.registerArrayField(field, initValueCopyForReset);
99263
98941
  // register ArrayField will update state.updateKey to render, So there is no need to execute forceUpdate here
99264
98942
  context.updateStateValue(field, initValueCopyForFormState, {
@@ -100746,6 +100424,9 @@ class PreviewInnerFoundation extends foundation {
100746
100424
  return;
100747
100425
  }
100748
100426
  const preloadImages = getPreloadImagArr(imgSrc, currentIndex, preLoadGap, infinite);
100427
+ if (preloadImages.length === 0) {
100428
+ return;
100429
+ }
100749
100430
  const Img = new Image();
100750
100431
  let index = 0;
100751
100432
  function callback(e) {