@para-ui/core 4.0.19-aplha6 → 4.0.20

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 (162) hide show
  1. package/Breadcrumbs/index.js +2 -2
  2. package/Button/SplitButton.d.ts +1 -1
  3. package/Button/index.js +2 -2
  4. package/ButtonGroup/index.js +2 -2
  5. package/Cascader/OptionList/Column.d.ts +1 -1
  6. package/Cascader/index.js +5 -5
  7. package/ColorPicker/chromePicker/index.d.ts +2 -1
  8. package/ColorPicker/compactPicker/index.d.ts +2 -1
  9. package/ColorPicker/sketchPicker/index.d.ts +2 -1
  10. package/ColorPicker/swatchesPicker/index.d.ts +2 -1
  11. package/ComboSelect/index.js +151 -84
  12. package/ComboSelect/interface.d.ts +3 -0
  13. package/Container/index.d.ts +1 -1
  14. package/CopyText/index.js +2 -2
  15. package/CycleSelector/index.js +4 -4
  16. package/DatePicker/PickerButton.d.ts +2 -1
  17. package/DatePicker/PickerTag.d.ts +2 -1
  18. package/DatePicker/index.js +3 -3
  19. package/Descriptions/index.js +2 -2
  20. package/Desktop/index.js +3 -3
  21. package/DragVerify/index.js +63 -40
  22. package/Drawer/index.js +2 -2
  23. package/DynamicMultiBox/formItem.d.ts +2 -1
  24. package/DynamicMultiBox/index.js +7 -7
  25. package/DynamicMultiBox/interface.d.ts +1 -1
  26. package/DynamicMultiBox/rowForm.d.ts +1 -1
  27. package/Empty/images/index.d.ts +3 -2
  28. package/Empty/index.js +3 -4
  29. package/Form/index.js +5 -5
  30. package/FormItem/index.js +5 -5
  31. package/FunctionModal/index.js +5 -4
  32. package/FunctionModal/modalContext.d.ts +2 -1
  33. package/GlobalContext/index.js +39 -3
  34. package/InputLang/index.js +3 -3
  35. package/Message/index.d.ts +1 -1
  36. package/Modal/index.js +4 -3
  37. package/MultiBox/index.js +3 -3
  38. package/OperateBtn/index.js +7 -3
  39. package/PageHeader/index.js +2 -2
  40. package/Pagination/index.js +4 -4
  41. package/ParauiProvider/index.d.ts +2 -2
  42. package/ParauiProvider/index.js +3 -3
  43. package/PopConfirm/index.js +2 -2
  44. package/Prompt/index.d.ts +1 -1
  45. package/Querying/images/index.d.ts +3 -2
  46. package/Querying/index.js +3 -4
  47. package/QuickReply/index.js +5 -5
  48. package/README.md +6 -0
  49. package/Search/index.js +2 -2
  50. package/Select/index.js +3 -3
  51. package/SelectInput/index.js +4 -4
  52. package/Selector/index.js +6 -6
  53. package/SelectorPicker/index.js +3 -3
  54. package/SingleBox/index.js +3 -3
  55. package/Switch/index.js +2 -3
  56. package/Table/index.js +4 -4
  57. package/Tabs/index.js +2 -2
  58. package/TextEditor/index.js +2 -2
  59. package/TextField/index.js +2 -2
  60. package/TimePicker/index.js +3 -3
  61. package/Timeline/TimelineItem.d.ts +1 -1
  62. package/ToggleButton/index.js +2 -2
  63. package/Tooltip/utils.d.ts +1 -1
  64. package/Transfer/box.d.ts +1 -1
  65. package/Transfer/index.d.ts +1 -1
  66. package/Transfer/index.js +4 -4
  67. package/Tree/index.js +5 -5
  68. package/Tree/utils/treeUtil.d.ts +1 -1
  69. package/Upload/index.js +4 -3
  70. package/_verture/defineProperty-1d116156.js +34 -0
  71. package/_verture/{index-c77ccb98.js → index-02b7a0b7.js} +1 -1
  72. package/_verture/{index-543781c9.js → index-356d88fa.js} +1 -1
  73. package/_verture/{index-0f5ee6f7.js → index-9bef932a.js} +1 -1
  74. package/_verture/index-c568f272.js +18 -0
  75. package/_verture/{index-f59b0bc0.js → index-cc76d8d5.js} +119 -228
  76. package/_verture/{index-ca413216.js → intl-f2f27722.js} +1 -54
  77. package/_verture/{sortable.esm-76fe46a4.js → sortable.esm-49896035.js} +1029 -597
  78. package/_verture/{useFormatMessage-1fc7c957.js → useFormatMessage-eb13cf56.js} +1 -1
  79. package/_verture/{useGlobalProps-4ae1a007.js → useGlobalProps-1e416658.js} +1 -1
  80. package/index.js +13 -10
  81. package/package.json +17 -12
  82. package/umd/AutoBox.js +11 -11
  83. package/umd/AutoTips.js +11 -11
  84. package/umd/Badge.js +1 -1
  85. package/umd/Breadcrumbs.js +11 -11
  86. package/umd/Button.js +11 -11
  87. package/umd/ButtonGroup.js +11 -11
  88. package/umd/Carousel.js +9 -9
  89. package/umd/Cascader.js +11 -11
  90. package/umd/Checkbox.js +11 -11
  91. package/umd/CheckboxGroup.js +11 -11
  92. package/umd/Collapse.js +10 -10
  93. package/umd/CollapseBox.js +1 -1
  94. package/umd/CollapseLayout.js +4 -4
  95. package/umd/ColorPicker.js +1 -1
  96. package/umd/ComboSelect.js +11 -11
  97. package/umd/Container.js +1 -1
  98. package/umd/CopyText.js +11 -11
  99. package/umd/CycleSelector.js +11 -11
  100. package/umd/DatePicker.js +11 -11
  101. package/umd/Descriptions.js +11 -11
  102. package/umd/Desktop.js +11 -11
  103. package/umd/DragVerify.js +4 -4
  104. package/umd/Drawer.js +11 -11
  105. package/umd/Dropdown.js +8 -8
  106. package/umd/DynamicMultiBox.js +14 -14
  107. package/umd/Empty.js +1 -1
  108. package/umd/Form.js +11 -11
  109. package/umd/FormItem.js +11 -11
  110. package/umd/FunctionModal.js +11 -11
  111. package/umd/GlobalContext.js +1 -1
  112. package/umd/Help.js +11 -11
  113. package/umd/HelperText.js +1 -1
  114. package/umd/InputLang.js +11 -11
  115. package/umd/InputNumber.js +11 -11
  116. package/umd/Label.js +11 -11
  117. package/umd/Loading.js +4 -4
  118. package/umd/Menu.js +11 -11
  119. package/umd/Message.js +4 -4
  120. package/umd/Modal.js +11 -11
  121. package/umd/MultiBox.js +11 -11
  122. package/umd/Notification.js +10 -10
  123. package/umd/OperateBtn.js +11 -11
  124. package/umd/PageHeader.js +11 -11
  125. package/umd/Pagination.js +11 -11
  126. package/umd/ParauiProvider.js +1 -1
  127. package/umd/PasswordRules.js +4 -4
  128. package/umd/PopConfirm.js +11 -11
  129. package/umd/PopMenu.js +11 -11
  130. package/umd/Popover.js +11 -11
  131. package/umd/Progress.js +9 -9
  132. package/umd/Prompt.js +4 -4
  133. package/umd/Querying.js +1 -1
  134. package/umd/QuickReply.js +14 -14
  135. package/umd/Radio.js +11 -11
  136. package/umd/RadioGroup.js +11 -11
  137. package/umd/Search.js +11 -11
  138. package/umd/Select.js +11 -11
  139. package/umd/SelectInput.js +11 -11
  140. package/umd/Selector.js +11 -11
  141. package/umd/SelectorPicker.js +11 -11
  142. package/umd/SingleBox.js +11 -11
  143. package/umd/Slider.js +8 -8
  144. package/umd/Status.js +4 -4
  145. package/umd/Stepper.js +11 -11
  146. package/umd/Switch.js +11 -11
  147. package/umd/Table.js +11 -11
  148. package/umd/Tabs.js +11 -11
  149. package/umd/Tag.js +11 -11
  150. package/umd/TextEditor.js +24 -24
  151. package/umd/TextField.js +11 -11
  152. package/umd/TimePicker.js +11 -11
  153. package/umd/Timeline.js +1 -1
  154. package/umd/Title.js +11 -11
  155. package/umd/ToggleButton.js +11 -11
  156. package/umd/Tooltip.js +11 -11
  157. package/umd/Transfer.js +13 -13
  158. package/umd/Tree.js +11 -11
  159. package/umd/Upload.js +12 -12
  160. package/umd/Utils.js +1 -1
  161. package/_verture/defineProperty-6f62bb2a.js +0 -34
  162. /package/_verture/{modalContext-c8cc3107.js → modalContext-3ba6ca8f.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { _ as __rest } from './tslib.es6-55ed4bd2.js';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import { _ as _toConsumableArray, a as _iterableToArray } from './toConsumableArray-8f4c9589.js';
4
- import { _ as _defineProperty, t as toPropertyKey } from './defineProperty-6f62bb2a.js';
4
+ import { _ as _defineProperty, a as _toPropertyKey } from './defineProperty-1d116156.js';
5
5
  import { _ as _slicedToArray, a as _arrayWithHoles, b as _nonIterableRest } from './slicedToArray-a8206399.js';
6
6
  import { _ as _typeof$1 } from './typeof-adeedc13.js';
7
7
  import * as React$4 from 'react';
@@ -21,7 +21,7 @@ import { Forbid } from '@para-ui/icons';
21
21
  import { $ as $prefixCls } from './constant-5317fc89.js';
22
22
  import LoadingOutlined from '@para-ui/icons/LoadingF';
23
23
  import AutoTips from '../AutoTips/index.js';
24
- import { u as useFormatMessage } from './useFormatMessage-1fc7c957.js';
24
+ import { u as useFormatMessage } from './useFormatMessage-eb13cf56.js';
25
25
  import { UUID } from '@paraview/lib';
26
26
  import { s as styleInject } from './style-inject.es-300983ab.js';
27
27
 
@@ -231,19 +231,8 @@ var preWarningFns = [];
231
231
  var preMessage = function preMessage(fn) {
232
232
  preWarningFns.push(fn);
233
233
  };
234
-
235
- /**
236
- * Warning if condition not match.
237
- * @param valid Condition
238
- * @param message Warning message
239
- * @example
240
- * ```js
241
- * warning(false, 'some error'); // print some error
242
- * warning(true, 'some error'); // print nothing
243
- * warning(1 === 2, 'some error'); // print some error
244
- * ```
245
- */
246
234
  function warning(valid, message) {
235
+ // Support uglify
247
236
  if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
248
237
  var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
249
238
  return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
@@ -253,9 +242,8 @@ function warning(valid, message) {
253
242
  }
254
243
  }
255
244
  }
256
-
257
- /** @see Similar to {@link warning} */
258
245
  function note(valid, message) {
246
+ // Support uglify
259
247
  if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
260
248
  var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
261
249
  return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
@@ -274,19 +262,16 @@ function call(method, valid, message) {
274
262
  warned[message] = true;
275
263
  }
276
264
  }
277
-
278
- /** @see Same as {@link warning}, but only warn once for the same message */
279
265
  function warningOnce(valid, message) {
280
266
  call(warning, valid, message);
281
267
  }
282
-
283
- /** @see Same as {@link warning}, but only warn once for the same message */
284
268
  function noteOnce(valid, message) {
285
269
  call(note, valid, message);
286
270
  }
287
271
  warningOnce.preMessage = preMessage;
288
272
  warningOnce.resetWarned = resetWarned;
289
273
  warningOnce.noteOnce = noteOnce;
274
+ /* eslint-enable */
290
275
 
291
276
  var classnames = {exports: {}};
292
277
 
@@ -303,57 +288,39 @@ var classnames = {exports: {}};
303
288
 
304
289
  var hasOwn = {}.hasOwnProperty;
305
290
 
306
- function classNames () {
307
- var classes = '';
291
+ function classNames() {
292
+ var classes = [];
308
293
 
309
294
  for (var i = 0; i < arguments.length; i++) {
310
295
  var arg = arguments[i];
311
- if (arg) {
312
- classes = appendClass(classes, parseValue(arg));
296
+ if (!arg) continue;
297
+
298
+ var argType = typeof arg;
299
+
300
+ if (argType === 'string' || argType === 'number') {
301
+ classes.push(arg);
302
+ } else if (Array.isArray(arg)) {
303
+ if (arg.length) {
304
+ var inner = classNames.apply(null, arg);
305
+ if (inner) {
306
+ classes.push(inner);
307
+ }
308
+ }
309
+ } else if (argType === 'object') {
310
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
311
+ classes.push(arg.toString());
312
+ continue;
313
+ }
314
+
315
+ for (var key in arg) {
316
+ if (hasOwn.call(arg, key) && arg[key]) {
317
+ classes.push(key);
318
+ }
319
+ }
313
320
  }
314
321
  }
315
322
 
316
- return classes;
317
- }
318
-
319
- function parseValue (arg) {
320
- if (typeof arg === 'string' || typeof arg === 'number') {
321
- return arg;
322
- }
323
-
324
- if (typeof arg !== 'object') {
325
- return '';
326
- }
327
-
328
- if (Array.isArray(arg)) {
329
- return classNames.apply(null, arg);
330
- }
331
-
332
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
333
- return arg.toString();
334
- }
335
-
336
- var classes = '';
337
-
338
- for (var key in arg) {
339
- if (hasOwn.call(arg, key) && arg[key]) {
340
- classes = appendClass(classes, key);
341
- }
342
- }
343
-
344
- return classes;
345
- }
346
-
347
- function appendClass (value, newClass) {
348
- if (!newClass) {
349
- return value;
350
- }
351
-
352
- if (value) {
353
- return value + ' ' + newClass;
354
- }
355
-
356
- return value + newClass;
323
+ return classes.join(' ');
357
324
  }
358
325
 
359
326
  if (module.exports) {
@@ -1231,12 +1198,12 @@ function supportRef(nodeOrComponent) {
1231
1198
  var type = reactIs.exports.isMemo(nodeOrComponent) ? nodeOrComponent.type.type : nodeOrComponent.type;
1232
1199
 
1233
1200
  // Function component node
1234
- if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render) && type.$$typeof !== reactIs.exports.ForwardRef) {
1201
+ if (typeof type === 'function' && !((_type$prototype = type.prototype) !== null && _type$prototype !== void 0 && _type$prototype.render)) {
1235
1202
  return false;
1236
1203
  }
1237
1204
 
1238
1205
  // Class component
1239
- if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render) && nodeOrComponent.$$typeof !== reactIs.exports.ForwardRef) {
1206
+ if (typeof nodeOrComponent === 'function' && !((_nodeOrComponent$prot = nodeOrComponent.prototype) !== null && _nodeOrComponent$prot !== void 0 && _nodeOrComponent$prot.render)) {
1240
1207
  return false;
1241
1208
  }
1242
1209
  return true;
@@ -2499,7 +2466,7 @@ function _defineProperties(target, props) {
2499
2466
  descriptor.enumerable = descriptor.enumerable || false;
2500
2467
  descriptor.configurable = true;
2501
2468
  if ("value" in descriptor) descriptor.writable = true;
2502
- Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
2469
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
2503
2470
  }
2504
2471
  }
2505
2472
  function _createClass(Constructor, protoProps, staticProps) {
@@ -2544,12 +2511,15 @@ function _getPrototypeOf(o) {
2544
2511
  }
2545
2512
 
2546
2513
  function _isNativeReflectConstruct() {
2514
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
2515
+ if (Reflect.construct.sham) return false;
2516
+ if (typeof Proxy === "function") return true;
2547
2517
  try {
2548
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
2549
- } catch (t) {}
2550
- return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
2551
- return !!t;
2552
- })();
2518
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
2519
+ return true;
2520
+ } catch (e) {
2521
+ return false;
2522
+ }
2553
2523
  }
2554
2524
 
2555
2525
  function _assertThisInitialized(self) {
@@ -3933,7 +3903,7 @@ function injectCSS(css) {
3933
3903
  if (prepend) {
3934
3904
  // If is queue `prepend`, it will prepend first style and then append rest style
3935
3905
  if (isPrependQueue) {
3936
- var existStyle = (option.styles || findStyles(container)).filter(function (node) {
3906
+ var existStyle = findStyles(container).filter(function (node) {
3937
3907
  // Ignore style which not injected by rc-util with prepend
3938
3908
  if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
3939
3909
  return false;
@@ -3959,7 +3929,7 @@ function injectCSS(css) {
3959
3929
  function findExistNode(key) {
3960
3930
  var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3961
3931
  var container = getContainer(option);
3962
- return (option.styles || findStyles(container)).find(function (node) {
3932
+ return findStyles(container).find(function (node) {
3963
3933
  return node.getAttribute(getMark(option)) === key;
3964
3934
  });
3965
3935
  }
@@ -3987,12 +3957,8 @@ function syncRealContainer(container, option) {
3987
3957
  }
3988
3958
  }
3989
3959
  function updateCSS(css, key) {
3990
- var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3991
- var container = getContainer(originOption);
3992
- var styles = findStyles(container);
3993
- var option = _objectSpread2(_objectSpread2({}, originOption), {}, {
3994
- styles: styles
3995
- });
3960
+ var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3961
+ var container = getContainer(option);
3996
3962
 
3997
3963
  // Sync real parent
3998
3964
  syncRealContainer(container, option);
@@ -4014,60 +3980,43 @@ function updateCSS(css, key) {
4014
3980
  }
4015
3981
 
4016
3982
  /* eslint-disable no-param-reassign */
4017
- function measureScrollbarSize(ele) {
4018
- var randomId = "rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7));
4019
- var measureEle = document.createElement('div');
4020
- measureEle.id = randomId;
4021
-
4022
- // Create Style
4023
- var measureStyle = measureEle.style;
4024
- measureStyle.position = 'absolute';
4025
- measureStyle.left = '0';
4026
- measureStyle.top = '0';
4027
- measureStyle.width = '100px';
4028
- measureStyle.height = '100px';
4029
- measureStyle.overflow = 'scroll';
4030
-
4031
- // Clone Style if needed
4032
- var fallbackWidth;
4033
- var fallbackHeight;
4034
- if (ele) {
4035
- var targetStyle = getComputedStyle(ele);
4036
- measureStyle.scrollbarColor = targetStyle.scrollbarColor;
4037
- measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
4038
-
4039
- // Set Webkit style
4040
- var webkitScrollbarStyle = getComputedStyle(ele, '::-webkit-scrollbar');
4041
- var width = parseInt(webkitScrollbarStyle.width, 10);
4042
- var height = parseInt(webkitScrollbarStyle.height, 10);
4043
-
4044
- // Try wrap to handle CSP case
4045
- try {
4046
- var widthStyle = width ? "width: ".concat(webkitScrollbarStyle.width, ";") : '';
4047
- var heightStyle = height ? "height: ".concat(webkitScrollbarStyle.height, ";") : '';
4048
- updateCSS("\n#".concat(randomId, "::-webkit-scrollbar {\n").concat(widthStyle, "\n").concat(heightStyle, "\n}"), randomId);
4049
- } catch (e) {
4050
- // Can't wrap, just log error
4051
- console.error(e);
4052
-
4053
- // Get from style directly
4054
- fallbackWidth = width;
4055
- fallbackHeight = height;
4056
- }
4057
- }
4058
- document.body.appendChild(measureEle);
4059
-
4060
- // Measure. Get fallback style if provided
4061
- var scrollWidth = ele && fallbackWidth && !isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
4062
- var scrollHeight = ele && fallbackHeight && !isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
4063
3983
 
4064
- // Clean up
4065
- document.body.removeChild(measureEle);
4066
- removeCSS(randomId);
4067
- return {
4068
- width: scrollWidth,
4069
- height: scrollHeight
4070
- };
3984
+ var cached;
3985
+ function getScrollBarSize(fresh) {
3986
+ if (typeof document === 'undefined') {
3987
+ return 0;
3988
+ }
3989
+ if (fresh || cached === undefined) {
3990
+ var inner = document.createElement('div');
3991
+ inner.style.width = '100%';
3992
+ inner.style.height = '200px';
3993
+ var outer = document.createElement('div');
3994
+ var outerStyle = outer.style;
3995
+ outerStyle.position = 'absolute';
3996
+ outerStyle.top = '0';
3997
+ outerStyle.left = '0';
3998
+ outerStyle.pointerEvents = 'none';
3999
+ outerStyle.visibility = 'hidden';
4000
+ outerStyle.width = '200px';
4001
+ outerStyle.height = '150px';
4002
+ outerStyle.overflow = 'hidden';
4003
+ outer.appendChild(inner);
4004
+ document.body.appendChild(outer);
4005
+ var widthContained = inner.offsetWidth;
4006
+ outer.style.overflow = 'scroll';
4007
+ var widthScroll = inner.offsetWidth;
4008
+ if (widthContained === widthScroll) {
4009
+ widthScroll = outer.clientWidth;
4010
+ }
4011
+ document.body.removeChild(outer);
4012
+ cached = widthContained - widthScroll;
4013
+ }
4014
+ return cached;
4015
+ }
4016
+ function ensureSize(str) {
4017
+ var match = str.match(/^(.*)px$/);
4018
+ var value = Number(match === null || match === void 0 ? void 0 : match[1]);
4019
+ return Number.isNaN(value) ? getScrollBarSize() : value;
4071
4020
  }
4072
4021
  function getTargetScrollBarSize(target) {
4073
4022
  if (typeof document === 'undefined' || !target || !(target instanceof Element)) {
@@ -4076,7 +4025,13 @@ function getTargetScrollBarSize(target) {
4076
4025
  height: 0
4077
4026
  };
4078
4027
  }
4079
- return measureScrollbarSize(target);
4028
+ var _getComputedStyle = getComputedStyle(target, '::-webkit-scrollbar'),
4029
+ width = _getComputedStyle.width,
4030
+ height = _getComputedStyle.height;
4031
+ return {
4032
+ width: ensureSize(width),
4033
+ height: ensureSize(height)
4034
+ };
4080
4035
  }
4081
4036
 
4082
4037
  /**
@@ -5400,9 +5355,7 @@ var _excluded$6 = ["prefixCls", "children", "action", "showAction", "hideAction"
5400
5355
  // Removed Props List
5401
5356
  // Seems this can be auto
5402
5357
  // getDocument?: (element?: HTMLElement) => Document;
5403
-
5404
5358
  // New version will not wrap popup with `rc-trigger-popup-content` when multiple children
5405
-
5406
5359
  function generateTrigger() {
5407
5360
  var PortalComponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Portal;
5408
5361
  var Trigger = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
@@ -5750,9 +5703,9 @@ function generateTrigger() {
5750
5703
  wrapperAction('onPointerEnter', true, mouseEnterDelay, function (event) {
5751
5704
  setMousePosByEvent(event);
5752
5705
  });
5753
- onPopupMouseEnter = function onPopupMouseEnter(event) {
5706
+ onPopupMouseEnter = function onPopupMouseEnter() {
5754
5707
  // Only trigger re-open when popup is visible
5755
- if ((mergedOpen || inMotion) && popupEle !== null && popupEle !== void 0 && popupEle.contains(event.target)) {
5708
+ if (mergedOpen || inMotion) {
5756
5709
  triggerOpen(true, mouseEnterDelay);
5757
5710
  }
5758
5711
  };
@@ -6977,15 +6930,16 @@ var Filler = /*#__PURE__*/React$4.forwardRef(function (_ref, ref) {
6977
6930
  flexDirection: 'column'
6978
6931
  };
6979
6932
  if (offsetY !== undefined) {
6933
+ var _objectSpread2$1;
6980
6934
  // Not set `width` since this will break `sticky: right`
6981
6935
  outerStyle = {
6982
6936
  height: height,
6983
6937
  position: 'relative',
6984
6938
  overflow: 'hidden'
6985
6939
  };
6986
- innerStyle = _objectSpread2(_objectSpread2({}, innerStyle), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
6940
+ innerStyle = _objectSpread2(_objectSpread2({}, innerStyle), {}, (_objectSpread2$1 = {
6987
6941
  transform: "translateY(".concat(offsetY, "px)")
6988
- }, rtl ? 'marginRight' : 'marginLeft', -offsetX), "position", 'absolute'), "left", 0), "right", 0), "top", 0));
6942
+ }, _defineProperty(_objectSpread2$1, rtl ? 'marginRight' : 'marginLeft', -offsetX), _defineProperty(_objectSpread2$1, "position", 'absolute'), _defineProperty(_objectSpread2$1, "left", 0), _defineProperty(_objectSpread2$1, "right", 0), _defineProperty(_objectSpread2$1, "top", 0), _objectSpread2$1));
6989
6943
  }
6990
6944
  return /*#__PURE__*/React$4.createElement("div", {
6991
6945
  style: outerStyle
@@ -7009,6 +6963,7 @@ function getPageXY(e, horizontal) {
7009
6963
  return obj[horizontal ? 'pageX' : 'pageY'];
7010
6964
  }
7011
6965
  var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
6966
+ var _classNames;
7012
6967
  var prefixCls = props.prefixCls,
7013
6968
  rtl = props.rtl,
7014
6969
  scrollOffset = props.scrollOffset,
@@ -7034,11 +6989,9 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7034
6989
  startTop = _React$useState6[0],
7035
6990
  setStartTop = _React$useState6[1];
7036
6991
  var isLTR = !rtl;
7037
-
7038
6992
  // ========================= Refs =========================
7039
6993
  var scrollbarRef = React$4.useRef();
7040
6994
  var thumbRef = React$4.useRef();
7041
-
7042
6995
  // ======================= Visible ========================
7043
6996
  var _React$useState7 = React$4.useState(false),
7044
6997
  _React$useState8 = _slicedToArray(_React$useState7, 2),
@@ -7052,11 +7005,11 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7052
7005
  setVisible(false);
7053
7006
  }, 3000);
7054
7007
  };
7055
-
7056
7008
  // ======================== Range =========================
7057
7009
  var enableScrollRange = scrollRange - containerSize || 0;
7058
7010
  var enableOffsetRange = containerSize - spinSize || 0;
7059
-
7011
+ // `scrollWidth` < `clientWidth` means no need to show scrollbar
7012
+ var canScroll = enableScrollRange > 0;
7060
7013
  // ========================= Top ==========================
7061
7014
  var top = React$4.useMemo(function () {
7062
7015
  if (scrollOffset === 0 || enableScrollRange === 0) {
@@ -7065,13 +7018,11 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7065
7018
  var ptg = scrollOffset / enableScrollRange;
7066
7019
  return ptg * enableOffsetRange;
7067
7020
  }, [scrollOffset, enableScrollRange, enableOffsetRange]);
7068
-
7069
7021
  // ====================== Container =======================
7070
7022
  var onContainerMouseDown = function onContainerMouseDown(e) {
7071
7023
  e.stopPropagation();
7072
7024
  e.preventDefault();
7073
7025
  };
7074
-
7075
7026
  // ======================== Thumb =========================
7076
7027
  var stateRef = React$4.useRef({
7077
7028
  top: top,
@@ -7093,9 +7044,7 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7093
7044
  e.stopPropagation();
7094
7045
  e.preventDefault();
7095
7046
  };
7096
-
7097
7047
  // ======================== Effect ========================
7098
-
7099
7048
  // React make event as passive, but we need to preventDefault
7100
7049
  // Add event on dom directly instead.
7101
7050
  // ref: https://github.com/facebook/react/issues/9809
@@ -7112,7 +7061,6 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7112
7061
  thumbEle.removeEventListener('touchstart', onThumbMouseDown);
7113
7062
  };
7114
7063
  }, []);
7115
-
7116
7064
  // Pass to effect
7117
7065
  var enableScrollRangeRef = React$4.useRef();
7118
7066
  enableScrollRangeRef.current = enableScrollRange;
@@ -7166,19 +7114,17 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7166
7114
  React$4.useEffect(function () {
7167
7115
  delayHidden();
7168
7116
  }, [scrollOffset]);
7169
-
7170
7117
  // ====================== Imperative ======================
7171
7118
  React$4.useImperativeHandle(ref, function () {
7172
7119
  return {
7173
7120
  delayHidden: delayHidden
7174
7121
  };
7175
7122
  });
7176
-
7177
7123
  // ======================== Render ========================
7178
7124
  var scrollbarPrefixCls = "".concat(prefixCls, "-scrollbar");
7179
7125
  var containerStyle = {
7180
7126
  position: 'absolute',
7181
- visibility: visible ? null : 'hidden'
7127
+ visibility: visible && canScroll ? null : 'hidden'
7182
7128
  };
7183
7129
  var thumbStyle = {
7184
7130
  position: 'absolute',
@@ -7193,7 +7139,6 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7193
7139
  containerStyle.left = 0;
7194
7140
  containerStyle.right = 0;
7195
7141
  containerStyle.bottom = 0;
7196
-
7197
7142
  // Thumb
7198
7143
  thumbStyle.height = '100%';
7199
7144
  thumbStyle.width = spinSize;
@@ -7212,7 +7157,6 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7212
7157
  } else {
7213
7158
  containerStyle.left = 0;
7214
7159
  }
7215
-
7216
7160
  // Thumb
7217
7161
  thumbStyle.width = '100%';
7218
7162
  thumbStyle.height = spinSize;
@@ -7220,7 +7164,7 @@ var ScrollBar = /*#__PURE__*/React$4.forwardRef(function (props, ref) {
7220
7164
  }
7221
7165
  return /*#__PURE__*/React$4.createElement("div", {
7222
7166
  ref: scrollbarRef,
7223
- className: classNames(scrollbarPrefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(scrollbarPrefixCls, "-horizontal"), horizontal), "".concat(scrollbarPrefixCls, "-vertical"), !horizontal), "".concat(scrollbarPrefixCls, "-visible"), visible)),
7167
+ className: classNames(scrollbarPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(scrollbarPrefixCls, "-horizontal"), horizontal), _defineProperty(_classNames, "".concat(scrollbarPrefixCls, "-vertical"), !horizontal), _defineProperty(_classNames, "".concat(scrollbarPrefixCls, "-visible"), visible), _classNames)),
7224
7168
  style: _objectSpread2(_objectSpread2({}, containerStyle), style),
7225
7169
  onMouseDown: onContainerMouseDown,
7226
7170
  onMouseMove: delayHidden
@@ -7269,10 +7213,10 @@ function useChildren(list, startIndex, endIndex, scrollWidth, setNodeRef, render
7269
7213
  var CacheMap = /*#__PURE__*/function () {
7270
7214
  function CacheMap() {
7271
7215
  _classCallCheck(this, CacheMap);
7272
- _defineProperty(this, "maps", void 0);
7216
+ this.maps = void 0;
7273
7217
  // Used for cache key
7274
7218
  // `useMemo` no need to update if `id` not change
7275
- _defineProperty(this, "id", 0);
7219
+ this.id = 0;
7276
7220
  this.maps = Object.create(null);
7277
7221
  }
7278
7222
  _createClass(CacheMap, [{
@@ -7314,7 +7258,6 @@ function useHeights(getKey, onItemAdd, onItemRemove) {
7314
7258
  }
7315
7259
  }
7316
7260
  });
7317
-
7318
7261
  // Always trigger update mark to tell parent that should re-calculate heights when resized
7319
7262
  setUpdatedMark(function (c) {
7320
7263
  return c + 1;
@@ -7335,13 +7278,12 @@ function useHeights(getKey, onItemAdd, onItemRemove) {
7335
7278
  } else {
7336
7279
  instanceRef.current.delete(key);
7337
7280
  }
7338
-
7339
7281
  // Instance changed
7340
7282
  if (!origin !== !instance) {
7341
7283
  if (instance) {
7342
- onItemAdd === null || onItemAdd === void 0 || onItemAdd(item);
7284
+ onItemAdd === null || onItemAdd === void 0 ? void 0 : onItemAdd(item);
7343
7285
  } else {
7344
- onItemRemove === null || onItemRemove === void 0 || onItemRemove(item);
7286
+ onItemRemove === null || onItemRemove === void 0 ? void 0 : onItemRemove(item);
7345
7287
  }
7346
7288
  }
7347
7289
  }
@@ -7358,7 +7300,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7358
7300
  _React$useState2 = _slicedToArray(_React$useState, 2),
7359
7301
  syncState = _React$useState2[0],
7360
7302
  setSyncState = _React$useState2[1];
7361
-
7362
7303
  // ========================== Sync Scroll ==========================
7363
7304
  useLayoutEffect$3(function () {
7364
7305
  if (syncState && syncState.times < MAX_TIMES) {
@@ -7378,11 +7319,9 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7378
7319
  var needCollectHeight = false;
7379
7320
  var newTargetAlign = targetAlign;
7380
7321
  var targetTop = null;
7381
-
7382
7322
  // Go to next frame if height not exist
7383
7323
  if (height) {
7384
7324
  var mergedAlign = targetAlign || originAlign;
7385
-
7386
7325
  // Get top & bottom
7387
7326
  var stackTop = 0;
7388
7327
  var itemTop = 0;
@@ -7395,7 +7334,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7395
7334
  itemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
7396
7335
  stackTop = itemBottom;
7397
7336
  }
7398
-
7399
7337
  // Check if need sync height (visible range has item not record height)
7400
7338
  var leftHeight = mergedAlign === 'top' ? offset : height - offset;
7401
7339
  for (var _i = maxLen; _i >= 0; _i -= 1) {
@@ -7410,7 +7348,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7410
7348
  break;
7411
7349
  }
7412
7350
  }
7413
-
7414
7351
  // Scroll to
7415
7352
  switch (mergedAlign) {
7416
7353
  case 'top':
@@ -7433,13 +7370,11 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7433
7370
  if (targetTop !== null) {
7434
7371
  syncScrollTop(targetTop);
7435
7372
  }
7436
-
7437
7373
  // One more time for sync
7438
7374
  if (targetTop !== syncState.lastTop) {
7439
7375
  needCollectHeight = true;
7440
7376
  }
7441
7377
  }
7442
-
7443
7378
  // Trigger next effect
7444
7379
  if (needCollectHeight) {
7445
7380
  setSyncState(_objectSpread2(_objectSpread2({}, syncState), {}, {
@@ -7452,7 +7387,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7452
7387
  warningOnce(false, 'Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.');
7453
7388
  }
7454
7389
  }, [syncState, containerRef.current]);
7455
-
7456
7390
  // =========================== Scroll To ===========================
7457
7391
  return function (arg) {
7458
7392
  // When not argument provided, we think dev may want to show the scrollbar
@@ -7460,7 +7394,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7460
7394
  triggerFlash();
7461
7395
  return;
7462
7396
  }
7463
-
7464
7397
  // Normal scroll logic
7465
7398
  wrapperRaf.cancel(scrollRef.current);
7466
7399
  if (typeof arg === 'number') {
@@ -7500,7 +7433,6 @@ function useScrollTo(containerRef, data, heights, itemHeight, getKey, collectHei
7500
7433
  * [5]: 9
7501
7434
  * [6]: 3
7502
7435
  */
7503
-
7504
7436
  /**
7505
7437
  * We assume that 2 list has only 1 item diff and others keeping the order.
7506
7438
  * So we can use dichotomy algorithm to find changed one.
@@ -7529,7 +7461,6 @@ function findListDiffIndex(originList, targetList, getKey) {
7529
7461
  }
7530
7462
  return notExistKey;
7531
7463
  }
7532
-
7533
7464
  // Loop to find diff one
7534
7465
  var diffIndex = null;
7535
7466
  var multiple = Math.abs(originLen - targetLen) !== 1;
@@ -7560,7 +7491,7 @@ function useDiffItem(data, getKey, onDiff) {
7560
7491
  React$4.useEffect(function () {
7561
7492
  var diff = findListDiffIndex(prevData || [], data || [], getKey);
7562
7493
  if ((diff === null || diff === void 0 ? void 0 : diff.index) !== undefined) {
7563
- onDiff === null || onDiff === void 0 || onDiff(diff.index);
7494
+ onDiff === null || onDiff === void 0 ? void 0 : onDiff(diff.index);
7564
7495
  setDiffItem(data[diff.index]);
7565
7496
  }
7566
7497
  setPrevData(data);
@@ -7581,7 +7512,6 @@ var useOriginScroll = (function (isScrollAtTop, isScrollAtBottom) {
7581
7512
  lockRef.current = false;
7582
7513
  }, 50);
7583
7514
  }
7584
-
7585
7515
  // Pass to ref since global add is in closure
7586
7516
  var scrollPingRef = useRef({
7587
7517
  top: isScrollAtTop,
@@ -7614,21 +7544,17 @@ function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, horizontalScr
7614
7544
  onWheelDelta) {
7615
7545
  var offsetRef = useRef(0);
7616
7546
  var nextFrameRef = useRef(null);
7617
-
7618
7547
  // Firefox patch
7619
7548
  var wheelValueRef = useRef(null);
7620
7549
  var isMouseScrollRef = useRef(false);
7621
-
7622
7550
  // Scroll status sync
7623
7551
  var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
7624
7552
  function onWheelY(event, deltaY) {
7625
7553
  wrapperRaf.cancel(nextFrameRef.current);
7626
7554
  offsetRef.current += deltaY;
7627
7555
  wheelValueRef.current = deltaY;
7628
-
7629
7556
  // Do nothing when scroll at the edge, Skip check when is in scroll
7630
7557
  if (originScroll(deltaY)) return;
7631
-
7632
7558
  // Proxy of scroll events
7633
7559
  if (!isFF) {
7634
7560
  event.preventDefault();
@@ -7647,13 +7573,11 @@ onWheelDelta) {
7647
7573
  event.preventDefault();
7648
7574
  }
7649
7575
  }
7650
-
7651
7576
  // Check for which direction does wheel do. `sx` means `shift + wheel`
7652
7577
  var wheelDirectionRef = useRef(null);
7653
7578
  var wheelDirectionCleanRef = useRef(null);
7654
7579
  function onWheel(event) {
7655
7580
  if (!inVirtual) return;
7656
-
7657
7581
  // Wait for 2 frame to clean direction
7658
7582
  wrapperRaf.cancel(wheelDirectionCleanRef.current);
7659
7583
  wheelDirectionCleanRef.current = wrapperRaf(function () {
@@ -7680,7 +7604,6 @@ onWheelDelta) {
7680
7604
  onWheelX(event, mergedDeltaX);
7681
7605
  }
7682
7606
  }
7683
-
7684
7607
  // A patch for firefox
7685
7608
  function onFireFoxScroll(event) {
7686
7609
  if (!inVirtual) return;
@@ -7694,26 +7617,23 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
7694
7617
  var touchedRef = useRef(false);
7695
7618
  var touchYRef = useRef(0);
7696
7619
  var elementRef = useRef(null);
7697
-
7698
7620
  // Smooth scroll
7699
7621
  var intervalRef = useRef(null);
7700
-
7701
7622
  /* eslint-disable prefer-const */
7702
7623
  var cleanUpEvents;
7703
7624
  var onTouchMove = function onTouchMove(e) {
7704
7625
  if (touchedRef.current) {
7705
7626
  var currentY = Math.ceil(e.touches[0].pageY);
7706
- var _offsetY = touchYRef.current - currentY;
7627
+ var offsetY = touchYRef.current - currentY;
7707
7628
  touchYRef.current = currentY;
7708
- if (callback(_offsetY)) {
7629
+ if (callback(offsetY)) {
7709
7630
  e.preventDefault();
7710
7631
  }
7711
-
7712
7632
  // Smooth interval
7713
7633
  clearInterval(intervalRef.current);
7714
7634
  intervalRef.current = setInterval(function () {
7715
- _offsetY *= SMOOTH_PTG;
7716
- if (!callback(_offsetY, true) || Math.abs(_offsetY) <= 0.1) {
7635
+ offsetY *= SMOOTH_PTG;
7636
+ if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
7717
7637
  clearInterval(intervalRef.current);
7718
7638
  }
7719
7639
  }, 16);
@@ -7745,7 +7665,7 @@ function useMobileTouchMove(inVirtual, listRef, callback) {
7745
7665
  }
7746
7666
  return function () {
7747
7667
  var _listRef$current;
7748
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.removeEventListener('touchstart', onTouchStart);
7668
+ (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.removeEventListener('touchstart', onTouchStart);
7749
7669
  cleanUpEvents();
7750
7670
  clearInterval(intervalRef.current);
7751
7671
  };
@@ -7756,11 +7676,12 @@ var MIN_SIZE = 20;
7756
7676
  function getSpinSize() {
7757
7677
  var containerSize = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
7758
7678
  var scrollRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
7759
- var baseSize = containerSize / scrollRange * containerSize;
7679
+ var baseSize = containerSize / scrollRange * 100;
7760
7680
  if (isNaN(baseSize)) {
7761
7681
  baseSize = 0;
7762
7682
  }
7763
7683
  baseSize = Math.max(baseSize, MIN_SIZE);
7684
+ baseSize = Math.min(baseSize, containerSize / 2);
7764
7685
  return Math.floor(baseSize);
7765
7686
  }
7766
7687
 
@@ -7780,7 +7701,6 @@ function useGetSize(mergedData, getKey, heights, itemHeight) {
7780
7701
  // Get from cache first
7781
7702
  var startIndex = key2Index.get(startKey);
7782
7703
  var endIndex = key2Index.get(endKey);
7783
-
7784
7704
  // Loop to fill the cache
7785
7705
  if (startIndex === undefined || endIndex === undefined) {
7786
7706
  var dataLen = mergedData.length;
@@ -7840,7 +7760,6 @@ function RawList(props, ref) {
7840
7760
  extraRender = props.extraRender,
7841
7761
  styles = props.styles,
7842
7762
  restProps = _objectWithoutProperties(props, _excluded$2);
7843
-
7844
7763
  // ================================= MISC =================================
7845
7764
  var useVirtual = !!(virtual !== false && height && itemHeight);
7846
7765
  var inVirtual = useVirtual && data && (itemHeight * data.length > height || !!scrollWidth);
@@ -7849,9 +7768,7 @@ function RawList(props, ref) {
7849
7768
  var mergedData = data || EMPTY_DATA;
7850
7769
  var componentRef = useRef();
7851
7770
  var fillerInnerRef = useRef();
7852
-
7853
7771
  // =============================== Item Key ===============================
7854
-
7855
7772
  var _useState = useState$1(0),
7856
7773
  _useState2 = _slicedToArray(_useState, 2),
7857
7774
  offsetTop = _useState2[0],
@@ -7870,7 +7787,6 @@ function RawList(props, ref) {
7870
7787
  var onScrollbarStopMove = function onScrollbarStopMove() {
7871
7788
  setScrollMoving(false);
7872
7789
  };
7873
-
7874
7790
  // =============================== Item Key ===============================
7875
7791
  var getKey = React$4.useCallback(function (item) {
7876
7792
  if (typeof itemKey === 'function') {
@@ -7881,7 +7797,6 @@ function RawList(props, ref) {
7881
7797
  var sharedConfig = {
7882
7798
  getKey: getKey
7883
7799
  };
7884
-
7885
7800
  // ================================ Scroll ================================
7886
7801
  function syncScrollTop(newTop) {
7887
7802
  setOffsetTop(function (origin) {
@@ -7896,7 +7811,6 @@ function RawList(props, ref) {
7896
7811
  return alignedTop;
7897
7812
  });
7898
7813
  }
7899
-
7900
7814
  // ================================ Legacy ================================
7901
7815
  // Put ref here since the range is generate by follow
7902
7816
  var rangeRef = useRef({
@@ -7908,7 +7822,6 @@ function RawList(props, ref) {
7908
7822
  _useDiffItem2 = _slicedToArray(_useDiffItem, 1),
7909
7823
  diffItem = _useDiffItem2[0];
7910
7824
  diffItemRef.current = diffItem;
7911
-
7912
7825
  // ================================ Height ================================
7913
7826
  var _useHeights = useHeights(getKey, null, null),
7914
7827
  _useHeights2 = _slicedToArray(_useHeights, 4),
@@ -7916,7 +7829,6 @@ function RawList(props, ref) {
7916
7829
  collectHeight = _useHeights2[1],
7917
7830
  heights = _useHeights2[2],
7918
7831
  heightUpdatedMark = _useHeights2[3];
7919
-
7920
7832
  // ========================== Visible Calculation =========================
7921
7833
  var _React$useMemo = React$4.useMemo(function () {
7922
7834
  if (!useVirtual) {
@@ -7927,7 +7839,6 @@ function RawList(props, ref) {
7927
7839
  offset: undefined
7928
7840
  };
7929
7841
  }
7930
-
7931
7842
  // Always use virtual scroll bar in avoid shaking
7932
7843
  if (!inVirtual) {
7933
7844
  var _fillerInnerRef$curre;
@@ -7944,24 +7855,21 @@ function RawList(props, ref) {
7944
7855
  var endIndex;
7945
7856
  var dataLen = mergedData.length;
7946
7857
  for (var i = 0; i < dataLen; i += 1) {
7947
- var _item = mergedData[i];
7948
- var key = getKey(_item);
7858
+ var item = mergedData[i];
7859
+ var key = getKey(item);
7949
7860
  var cacheHeight = heights.get(key);
7950
7861
  var currentItemBottom = itemTop + (cacheHeight === undefined ? itemHeight : cacheHeight);
7951
-
7952
7862
  // Check item top in the range
7953
7863
  if (currentItemBottom >= offsetTop && startIndex === undefined) {
7954
7864
  startIndex = i;
7955
7865
  startOffset = itemTop;
7956
7866
  }
7957
-
7958
7867
  // Check item bottom in the range. We will render additional one item for motion usage
7959
7868
  if (currentItemBottom > offsetTop + height && endIndex === undefined) {
7960
7869
  endIndex = i;
7961
7870
  }
7962
7871
  itemTop = currentItemBottom;
7963
7872
  }
7964
-
7965
7873
  // When scrollTop at the end but data cut to small count will reach this
7966
7874
  if (startIndex === undefined) {
7967
7875
  startIndex = 0;
@@ -7971,7 +7879,6 @@ function RawList(props, ref) {
7971
7879
  if (endIndex === undefined) {
7972
7880
  endIndex = mergedData.length - 1;
7973
7881
  }
7974
-
7975
7882
  // Give cache to improve scroll experience
7976
7883
  endIndex = Math.min(endIndex + 1, mergedData.length - 1);
7977
7884
  return {
@@ -7987,7 +7894,6 @@ function RawList(props, ref) {
7987
7894
  fillerOffset = _React$useMemo.offset;
7988
7895
  rangeRef.current.start = start;
7989
7896
  rangeRef.current.end = end;
7990
-
7991
7897
  // ================================= Size =================================
7992
7898
  var _React$useState = React$4.useState({
7993
7899
  width: 0,
@@ -8002,7 +7908,6 @@ function RawList(props, ref) {
8002
7908
  height: sizeInfo.height || sizeInfo.offsetHeight
8003
7909
  });
8004
7910
  };
8005
-
8006
7911
  // Hack on scrollbar to enable flash call
8007
7912
  var verticalScrollBarRef = useRef();
8008
7913
  var horizontalScrollBarRef = useRef();
@@ -8012,7 +7917,6 @@ function RawList(props, ref) {
8012
7917
  var verticalScrollBarSpinSize = React$4.useMemo(function () {
8013
7918
  return getSpinSize(size.height, scrollHeight);
8014
7919
  }, [size.height, scrollHeight]);
8015
-
8016
7920
  // =============================== In Range ===============================
8017
7921
  var maxScrollHeight = scrollHeight - height;
8018
7922
  var maxScrollHeightRef = useRef(maxScrollHeight);
@@ -8028,7 +7932,6 @@ function RawList(props, ref) {
8028
7932
  var isScrollAtTop = offsetTop <= 0;
8029
7933
  var isScrollAtBottom = offsetTop >= maxScrollHeight;
8030
7934
  var originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
8031
-
8032
7935
  // ================================ Scroll ================================
8033
7936
  var getVirtualScrollInfo = function getVirtualScrollInfo() {
8034
7937
  return {
@@ -8040,7 +7943,6 @@ function RawList(props, ref) {
8040
7943
  var triggerScroll = useEvent$2(function () {
8041
7944
  if (onVirtualScroll) {
8042
7945
  var nextInfo = getVirtualScrollInfo();
8043
-
8044
7946
  // Trigger when offset changed
8045
7947
  if (lastVirtualScrollInfoRef.current.x !== nextInfo.x || lastVirtualScrollInfoRef.current.y !== nextInfo.y) {
8046
7948
  onVirtualScroll(nextInfo);
@@ -8059,16 +7961,14 @@ function RawList(props, ref) {
8059
7961
  syncScrollTop(newOffset);
8060
7962
  }
8061
7963
  }
8062
-
8063
7964
  // When data size reduce. It may trigger native scroll event back to fit scroll position
8064
7965
  function onFallbackScroll(e) {
8065
7966
  var newScrollTop = e.currentTarget.scrollTop;
8066
7967
  if (newScrollTop !== offsetTop) {
8067
7968
  syncScrollTop(newScrollTop);
8068
7969
  }
8069
-
8070
7970
  // Trigger origin onScroll
8071
- onScroll === null || onScroll === void 0 || onScroll(e);
7971
+ onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);
8072
7972
  triggerScroll();
8073
7973
  }
8074
7974
  var keepInHorizontalRange = function keepInHorizontalRange(nextOffsetLeft) {
@@ -8081,7 +7981,6 @@ function RawList(props, ref) {
8081
7981
  var onWheelDelta = useEvent$2(function (offsetXY, fromHorizontal) {
8082
7982
  if (fromHorizontal) {
8083
7983
  // Horizontal scroll no need sync virtual position
8084
-
8085
7984
  flushSync(function () {
8086
7985
  setOffsetLeft(function (left) {
8087
7986
  var nextOffsetLeft = left + (isRTL ? -offsetXY : offsetXY);
@@ -8096,13 +7995,11 @@ function RawList(props, ref) {
8096
7995
  });
8097
7996
  }
8098
7997
  });
8099
-
8100
7998
  // Since this added in global,should use ref to keep update
8101
7999
  var _useFrameWheel = useFrameWheel(useVirtual, isScrollAtTop, isScrollAtBottom, !!scrollWidth, onWheelDelta),
8102
8000
  _useFrameWheel2 = _slicedToArray(_useFrameWheel, 2),
8103
8001
  onRawWheel = _useFrameWheel2[0],
8104
8002
  onFireFoxScroll = _useFrameWheel2[1];
8105
-
8106
8003
  // Mobile touch move
8107
8004
  useMobileTouchMove(useVirtual, componentRef, function (deltaY, smoothOffset) {
8108
8005
  if (originScroll(deltaY, smoothOffset)) {
@@ -8131,7 +8028,6 @@ function RawList(props, ref) {
8131
8028
  componentEle.removeEventListener('MozMousePixelScroll', onMozMousePixelScroll);
8132
8029
  };
8133
8030
  }, [useVirtual]);
8134
-
8135
8031
  // Sync scroll left
8136
8032
  useLayoutEffect$3(function () {
8137
8033
  if (scrollWidth) {
@@ -8140,12 +8036,11 @@ function RawList(props, ref) {
8140
8036
  });
8141
8037
  }
8142
8038
  }, [size.width, scrollWidth]);
8143
-
8144
8039
  // ================================= Ref ==================================
8145
8040
  var delayHideScrollBar = function delayHideScrollBar() {
8146
8041
  var _verticalScrollBarRef, _horizontalScrollBarR;
8147
- (_verticalScrollBarRef = verticalScrollBarRef.current) === null || _verticalScrollBarRef === void 0 || _verticalScrollBarRef.delayHidden();
8148
- (_horizontalScrollBarR = horizontalScrollBarRef.current) === null || _horizontalScrollBarR === void 0 || _horizontalScrollBarR.delayHidden();
8042
+ (_verticalScrollBarRef = verticalScrollBarRef.current) === null || _verticalScrollBarRef === void 0 ? void 0 : _verticalScrollBarRef.delayHidden();
8043
+ (_horizontalScrollBarR = horizontalScrollBarRef.current) === null || _horizontalScrollBarR === void 0 ? void 0 : _horizontalScrollBarR.delayHidden();
8149
8044
  };
8150
8045
  var _scrollTo = useScrollTo(componentRef, mergedData, heights, itemHeight, getKey, function () {
8151
8046
  return collectHeight(true);
@@ -8162,7 +8057,6 @@ function RawList(props, ref) {
8162
8057
  if (config.left !== undefined) {
8163
8058
  setOffsetLeft(keepInHorizontalRange(config.left));
8164
8059
  }
8165
-
8166
8060
  // Scroll Y
8167
8061
  _scrollTo(config.top);
8168
8062
  } else {
@@ -8171,7 +8065,6 @@ function RawList(props, ref) {
8171
8065
  }
8172
8066
  };
8173
8067
  });
8174
-
8175
8068
  // ================================ Effect ================================
8176
8069
  /** We need told outside that some list not rendered */
8177
8070
  useLayoutEffect$3(function () {
@@ -8180,7 +8073,6 @@ function RawList(props, ref) {
8180
8073
  onVisibleChange(renderList, mergedData);
8181
8074
  }
8182
8075
  }, [start, end, mergedData]);
8183
-
8184
8076
  // ================================ Extra =================================
8185
8077
  var getSize = useGetSize(mergedData, getKey, heights, itemHeight);
8186
8078
  var extraContent = extraRender === null || extraRender === void 0 ? void 0 : extraRender({
@@ -8192,7 +8084,6 @@ function RawList(props, ref) {
8192
8084
  rtl: isRTL,
8193
8085
  getSize: getSize
8194
8086
  });
8195
-
8196
8087
  // ================================ Render ================================
8197
8088
  var listChildren = useChildren(mergedData, start, end, scrollWidth, setInstanceRef, children, sharedConfig);
8198
8089
  var componentStyle = null;
@@ -8249,7 +8140,7 @@ function RawList(props, ref) {
8249
8140
  containerSize: size.height,
8250
8141
  style: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBar,
8251
8142
  thumbStyle: styles === null || styles === void 0 ? void 0 : styles.verticalScrollBarThumb
8252
- }), inVirtual && scrollWidth > size.width && /*#__PURE__*/React$4.createElement(ScrollBar, {
8143
+ }), inVirtual && scrollWidth && /*#__PURE__*/React$4.createElement(ScrollBar, {
8253
8144
  ref: horizontalScrollBarRef,
8254
8145
  prefixCls: prefixCls,
8255
8146
  scrollOffset: offsetLeft,
@@ -9395,7 +9286,7 @@ var interopRequireWildcard = {exports: {}};
9395
9286
  __proto__: null
9396
9287
  },
9397
9288
  a = Object.defineProperty && Object.getOwnPropertyDescriptor;
9398
- for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
9289
+ for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
9399
9290
  var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
9400
9291
  i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
9401
9292
  }