@uzum-tech/ui 1.8.2 → 1.9.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 (229) hide show
  1. package/dist/index.js +659 -115
  2. package/dist/index.prod.js +3 -3
  3. package/es/_internal/scrollbar/src/Scrollbar.d.ts +119 -17
  4. package/es/_internal/scrollbar/src/Scrollbar.js +120 -67
  5. package/es/_internal/scrollbar/src/styles/index.cssr.js +32 -15
  6. package/es/_internal/scrollbar/styles/common.d.ts +7 -0
  7. package/es/_internal/scrollbar/styles/common.js +7 -0
  8. package/es/_internal/scrollbar/styles/light.d.ts +8 -0
  9. package/es/_internal/scrollbar/styles/light.js +3 -5
  10. package/es/_internal/select-menu/src/SelectMenu.d.ts +57 -1
  11. package/es/_internal/select-menu/styles/light.d.ts +8 -0
  12. package/es/_internal/selection/src/Selection.d.ts +3 -1
  13. package/es/_internal/selection/src/Selection.js +3 -1
  14. package/es/_utils/css/index.d.ts +1 -0
  15. package/es/_utils/css/index.js +1 -0
  16. package/es/_utils/css/rtl-inset.d.ts +1 -0
  17. package/es/_utils/css/rtl-inset.js +5 -0
  18. package/es/_utils/index.d.ts +1 -1
  19. package/es/_utils/index.js +1 -1
  20. package/es/auto-complete/src/AutoComplete.d.ts +88 -0
  21. package/es/auto-complete/styles/light.d.ts +8 -0
  22. package/es/back-top/src/BackTop.d.ts +1 -1
  23. package/es/cascader/src/Cascader.d.ts +168 -0
  24. package/es/cascader/src/CascaderMenu.d.ts +24 -0
  25. package/es/cascader/src/CascaderOption.d.ts +24 -0
  26. package/es/cascader/src/CascaderSelectMenu.d.ts +24 -0
  27. package/es/cascader/src/CascaderSubmenu.d.ts +25 -1
  28. package/es/cascader/styles/light.d.ts +16 -0
  29. package/es/chat/src/Chat.d.ts +88 -0
  30. package/es/chat/src/ChatListItems.d.ts +104 -0
  31. package/es/chat/src/ChatMessages.d.ts +104 -0
  32. package/es/chat/styles/dark.d.ts +8 -0
  33. package/es/chat/styles/light.d.ts +8 -0
  34. package/es/components.d.ts +2 -0
  35. package/es/components.js +2 -0
  36. package/es/data-table/src/DataTable.d.ts +184 -0
  37. package/es/data-table/src/HeaderButton/FilterButton.d.ts +40 -0
  38. package/es/data-table/src/HeaderButton/FilterMenu.d.ts +40 -0
  39. package/es/data-table/src/TableParts/Body.d.ts +41 -1
  40. package/es/data-table/src/TableParts/Header.d.ts +40 -0
  41. package/es/data-table/src/interface.d.ts +72 -0
  42. package/es/data-table/styles/light.d.ts +24 -0
  43. package/es/date-picker/src/DatePicker.d.ts +171 -3
  44. package/es/date-picker/src/panel/date.d.ts +25 -1
  45. package/es/date-picker/src/panel/daterange.d.ts +26 -2
  46. package/es/date-picker/src/panel/datetime.d.ts +25 -1
  47. package/es/date-picker/src/panel/datetimerange.d.ts +26 -2
  48. package/es/date-picker/src/panel/panelMonth.d.ts +50 -2
  49. package/es/date-picker/src/panel/panelMonthContent.d.ts +25 -1
  50. package/es/date-picker/src/panel/panelYear.d.ts +50 -2
  51. package/es/date-picker/src/panel/panelYearContent.d.ts +25 -1
  52. package/es/date-picker/src/panel/use-calendar.d.ts +24 -0
  53. package/es/date-picker/src/panel/use-dual-calendar.d.ts +24 -0
  54. package/es/date-picker/src/panel/use-panel-common.d.ts +24 -0
  55. package/es/date-picker/styles/light.d.ts +16 -0
  56. package/es/dialog/src/DialogProvider.d.ts +2 -2
  57. package/es/drawer/src/Drawer.d.ts +81 -1
  58. package/es/drawer/src/DrawerBodyWrapper.d.ts +9 -1
  59. package/es/drawer/src/DrawerContent.d.ts +8 -0
  60. package/es/drawer/styles/light.d.ts +8 -0
  61. package/es/dropdown/src/Dropdown.d.ts +1 -1
  62. package/es/infinite-scroll/index.d.ts +2 -0
  63. package/es/infinite-scroll/index.js +1 -0
  64. package/es/infinite-scroll/src/InfiniteScroll.d.ts +45 -0
  65. package/es/infinite-scroll/src/InfiniteScroll.js +78 -0
  66. package/es/layout/src/Layout.d.ts +112 -0
  67. package/es/layout/src/LayoutContent.d.ts +56 -0
  68. package/es/layout/src/LayoutFooter.d.ts +72 -0
  69. package/es/layout/src/LayoutHeader.d.ts +48 -0
  70. package/es/layout/src/LayoutSider.d.ts +56 -0
  71. package/es/layout/styles/light.d.ts +8 -0
  72. package/es/legacy-transfer/src/Transfer.d.ts +80 -0
  73. package/es/legacy-transfer/src/TransferFilter.d.ts +8 -0
  74. package/es/legacy-transfer/src/TransferList.d.ts +9 -1
  75. package/es/legacy-transfer/src/TransferListItem.d.ts +8 -0
  76. package/es/legacy-transfer/styles/light.d.ts +8 -0
  77. package/es/log/src/Log.d.ts +80 -0
  78. package/es/log/styles/light.d.ts +8 -0
  79. package/es/mention/src/Mention.d.ts +88 -0
  80. package/es/mention/styles/light.d.ts +8 -0
  81. package/es/menu/src/Menu.d.ts +1 -1
  82. package/es/modal/src/BodyWrapper.d.ts +9 -1
  83. package/es/modal/src/Modal.d.ts +73 -1
  84. package/es/modal/styles/light.d.ts +8 -0
  85. package/es/notification/src/NotificationContainer.d.ts +8 -0
  86. package/es/notification/src/NotificationProvider.d.ts +72 -0
  87. package/es/notification/styles/light.d.ts +8 -0
  88. package/es/pagination/src/Pagination.d.ts +176 -0
  89. package/es/pagination/styles/light.d.ts +16 -0
  90. package/es/popselect/src/Popselect.d.ts +88 -0
  91. package/es/popselect/src/PopselectPanel.d.ts +16 -0
  92. package/es/popselect/styles/light.d.ts +8 -0
  93. package/es/scrollbar/src/Scrollbar.d.ts +72 -0
  94. package/es/select/src/Select.d.ts +88 -0
  95. package/es/select/styles/light.d.ts +8 -0
  96. package/es/time-picker/src/Panel.d.ts +8 -0
  97. package/es/time-picker/src/TimePicker.d.ts +80 -0
  98. package/es/time-picker/styles/light.d.ts +8 -0
  99. package/es/transfer/src/Transfer.d.ts +80 -0
  100. package/es/transfer/src/TransferFilter.d.ts +8 -0
  101. package/es/transfer/src/TransferList.d.ts +9 -1
  102. package/es/transfer/src/TransferListItem.d.ts +8 -0
  103. package/es/transfer/styles/light.d.ts +8 -0
  104. package/es/tree/src/Tree.d.ts +82 -2
  105. package/es/tree/src/TreeNodeCheckbox.d.ts +8 -0
  106. package/es/tree/styles/light.d.ts +8 -0
  107. package/es/tree-select/src/TreeSelect.d.ts +89 -1
  108. package/es/tree-select/styles/light.d.ts +8 -0
  109. package/es/version.d.ts +1 -1
  110. package/es/version.js +1 -1
  111. package/es/virtual-list/index.d.ts +2 -0
  112. package/es/virtual-list/index.js +1 -0
  113. package/es/virtual-list/src/VirtualList.d.ts +146 -0
  114. package/es/virtual-list/src/VirtualList.js +103 -0
  115. package/lib/_internal/scrollbar/src/Scrollbar.d.ts +119 -17
  116. package/lib/_internal/scrollbar/src/Scrollbar.js +117 -64
  117. package/lib/_internal/scrollbar/src/styles/index.cssr.js +32 -15
  118. package/lib/_internal/scrollbar/styles/common.d.ts +7 -0
  119. package/lib/_internal/scrollbar/styles/common.js +10 -0
  120. package/lib/_internal/scrollbar/styles/light.d.ts +8 -0
  121. package/lib/_internal/scrollbar/styles/light.js +3 -5
  122. package/lib/_internal/select-menu/src/SelectMenu.d.ts +57 -1
  123. package/lib/_internal/select-menu/styles/light.d.ts +8 -0
  124. package/lib/_internal/selection/src/Selection.d.ts +3 -1
  125. package/lib/_internal/selection/src/Selection.js +3 -1
  126. package/lib/_utils/css/index.d.ts +1 -0
  127. package/lib/_utils/css/index.js +3 -1
  128. package/lib/_utils/css/rtl-inset.d.ts +1 -0
  129. package/lib/_utils/css/rtl-inset.js +8 -0
  130. package/lib/_utils/index.d.ts +1 -1
  131. package/lib/_utils/index.js +2 -1
  132. package/lib/auto-complete/src/AutoComplete.d.ts +88 -0
  133. package/lib/auto-complete/styles/light.d.ts +8 -0
  134. package/lib/back-top/src/BackTop.d.ts +1 -1
  135. package/lib/cascader/src/Cascader.d.ts +168 -0
  136. package/lib/cascader/src/CascaderMenu.d.ts +24 -0
  137. package/lib/cascader/src/CascaderOption.d.ts +24 -0
  138. package/lib/cascader/src/CascaderSelectMenu.d.ts +24 -0
  139. package/lib/cascader/src/CascaderSubmenu.d.ts +25 -1
  140. package/lib/cascader/styles/light.d.ts +16 -0
  141. package/lib/chat/src/Chat.d.ts +88 -0
  142. package/lib/chat/src/ChatListItems.d.ts +104 -0
  143. package/lib/chat/src/ChatMessages.d.ts +104 -0
  144. package/lib/chat/styles/dark.d.ts +8 -0
  145. package/lib/chat/styles/light.d.ts +8 -0
  146. package/lib/components.d.ts +2 -0
  147. package/lib/components.js +2 -0
  148. package/lib/data-table/src/DataTable.d.ts +184 -0
  149. package/lib/data-table/src/HeaderButton/FilterButton.d.ts +40 -0
  150. package/lib/data-table/src/HeaderButton/FilterMenu.d.ts +40 -0
  151. package/lib/data-table/src/TableParts/Body.d.ts +41 -1
  152. package/lib/data-table/src/TableParts/Header.d.ts +40 -0
  153. package/lib/data-table/src/interface.d.ts +72 -0
  154. package/lib/data-table/styles/light.d.ts +24 -0
  155. package/lib/date-picker/src/DatePicker.d.ts +171 -3
  156. package/lib/date-picker/src/panel/date.d.ts +25 -1
  157. package/lib/date-picker/src/panel/daterange.d.ts +26 -2
  158. package/lib/date-picker/src/panel/datetime.d.ts +25 -1
  159. package/lib/date-picker/src/panel/datetimerange.d.ts +26 -2
  160. package/lib/date-picker/src/panel/panelMonth.d.ts +50 -2
  161. package/lib/date-picker/src/panel/panelMonthContent.d.ts +25 -1
  162. package/lib/date-picker/src/panel/panelYear.d.ts +50 -2
  163. package/lib/date-picker/src/panel/panelYearContent.d.ts +25 -1
  164. package/lib/date-picker/src/panel/use-calendar.d.ts +24 -0
  165. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +24 -0
  166. package/lib/date-picker/src/panel/use-panel-common.d.ts +24 -0
  167. package/lib/date-picker/styles/light.d.ts +16 -0
  168. package/lib/dialog/src/DialogProvider.d.ts +2 -2
  169. package/lib/drawer/src/Drawer.d.ts +81 -1
  170. package/lib/drawer/src/DrawerBodyWrapper.d.ts +9 -1
  171. package/lib/drawer/src/DrawerContent.d.ts +8 -0
  172. package/lib/drawer/styles/light.d.ts +8 -0
  173. package/lib/dropdown/src/Dropdown.d.ts +1 -1
  174. package/lib/infinite-scroll/index.d.ts +2 -0
  175. package/lib/infinite-scroll/index.js +9 -0
  176. package/lib/infinite-scroll/src/InfiniteScroll.d.ts +45 -0
  177. package/lib/infinite-scroll/src/InfiniteScroll.js +81 -0
  178. package/lib/layout/src/Layout.d.ts +112 -0
  179. package/lib/layout/src/LayoutContent.d.ts +56 -0
  180. package/lib/layout/src/LayoutFooter.d.ts +72 -0
  181. package/lib/layout/src/LayoutHeader.d.ts +48 -0
  182. package/lib/layout/src/LayoutSider.d.ts +56 -0
  183. package/lib/layout/styles/light.d.ts +8 -0
  184. package/lib/legacy-transfer/src/Transfer.d.ts +80 -0
  185. package/lib/legacy-transfer/src/TransferFilter.d.ts +8 -0
  186. package/lib/legacy-transfer/src/TransferList.d.ts +9 -1
  187. package/lib/legacy-transfer/src/TransferListItem.d.ts +8 -0
  188. package/lib/legacy-transfer/styles/light.d.ts +8 -0
  189. package/lib/log/src/Log.d.ts +80 -0
  190. package/lib/log/styles/light.d.ts +8 -0
  191. package/lib/mention/src/Mention.d.ts +88 -0
  192. package/lib/mention/styles/light.d.ts +8 -0
  193. package/lib/menu/src/Menu.d.ts +1 -1
  194. package/lib/modal/src/BodyWrapper.d.ts +9 -1
  195. package/lib/modal/src/Modal.d.ts +73 -1
  196. package/lib/modal/styles/light.d.ts +8 -0
  197. package/lib/notification/src/NotificationContainer.d.ts +8 -0
  198. package/lib/notification/src/NotificationProvider.d.ts +72 -0
  199. package/lib/notification/styles/light.d.ts +8 -0
  200. package/lib/pagination/src/Pagination.d.ts +176 -0
  201. package/lib/pagination/styles/light.d.ts +16 -0
  202. package/lib/popselect/src/Popselect.d.ts +88 -0
  203. package/lib/popselect/src/PopselectPanel.d.ts +16 -0
  204. package/lib/popselect/styles/light.d.ts +8 -0
  205. package/lib/scrollbar/src/Scrollbar.d.ts +72 -0
  206. package/lib/select/src/Select.d.ts +88 -0
  207. package/lib/select/styles/light.d.ts +8 -0
  208. package/lib/time-picker/src/Panel.d.ts +8 -0
  209. package/lib/time-picker/src/TimePicker.d.ts +80 -0
  210. package/lib/time-picker/styles/light.d.ts +8 -0
  211. package/lib/transfer/src/Transfer.d.ts +80 -0
  212. package/lib/transfer/src/TransferFilter.d.ts +8 -0
  213. package/lib/transfer/src/TransferList.d.ts +9 -1
  214. package/lib/transfer/src/TransferListItem.d.ts +8 -0
  215. package/lib/transfer/styles/light.d.ts +8 -0
  216. package/lib/tree/src/Tree.d.ts +82 -2
  217. package/lib/tree/src/TreeNodeCheckbox.d.ts +8 -0
  218. package/lib/tree/styles/light.d.ts +8 -0
  219. package/lib/tree-select/src/TreeSelect.d.ts +89 -1
  220. package/lib/tree-select/styles/light.d.ts +8 -0
  221. package/lib/version.d.ts +1 -1
  222. package/lib/version.js +1 -1
  223. package/lib/virtual-list/index.d.ts +2 -0
  224. package/lib/virtual-list/index.js +9 -0
  225. package/lib/virtual-list/src/VirtualList.d.ts +146 -0
  226. package/lib/virtual-list/src/VirtualList.js +106 -0
  227. package/package.json +2 -2
  228. package/volar.d.ts +1 -0
  229. package/web-types.json +30 -1
package/dist/index.js CHANGED
@@ -771,6 +771,16 @@
771
771
  return /^\d+$/.test(value) ? `${value}px` : value;
772
772
  };
773
773
 
774
+ function rtlInset(inset) {
775
+ const {
776
+ left,
777
+ right,
778
+ top,
779
+ bottom
780
+ } = getMargin(inset);
781
+ return `${top} ${left} ${bottom} ${right}`;
782
+ }
783
+
774
784
  function ampCount(selector) {
775
785
  let cnt = 0;
776
786
  for (let i = 0; i < selector.length; ++i) {
@@ -3017,7 +3027,7 @@
3017
3027
  if (typeof selector === 'string') {
3018
3028
  return document.querySelector(selector);
3019
3029
  }
3020
- return selector();
3030
+ return selector() || null;
3021
3031
  }
3022
3032
 
3023
3033
  var VLazyTeleport = vue.defineComponent({
@@ -3109,8 +3119,11 @@
3109
3119
  };
3110
3120
  const keepOffsetDirection = {
3111
3121
  top: true,
3122
+ // top++
3112
3123
  bottom: false,
3124
+ // top--
3113
3125
  left: true,
3126
+ // left++
3114
3127
  right: false // left--
3115
3128
  };
3116
3129
  const cssPositionToOppositeAlign = {
@@ -4281,6 +4294,7 @@
4281
4294
 
4282
4295
  let maybeTouch;
4283
4296
  function ensureMaybeTouch() {
4297
+ if (typeof document === 'undefined') return false;
4284
4298
  if (maybeTouch === undefined) {
4285
4299
  if ('matchMedia' in window) {
4286
4300
  maybeTouch = window.matchMedia('(pointer:coarse)').matches;
@@ -4292,12 +4306,139 @@
4292
4306
  }
4293
4307
  let wheelScale;
4294
4308
  function ensureWheelScale() {
4309
+ if (typeof document === 'undefined') return 1;
4295
4310
  if (wheelScale === undefined) {
4296
4311
  wheelScale = 'chrome' in window ? window.devicePixelRatio : 1;
4297
4312
  }
4298
4313
  return wheelScale;
4299
4314
  }
4300
4315
 
4316
+ const xScrollInjextionKey = 'VVirtualListXScroll';
4317
+
4318
+ function setupXScroll({
4319
+ columnsRef,
4320
+ renderColRef,
4321
+ renderItemWithColsRef
4322
+ }) {
4323
+ const listWidthRef = vue.ref(0);
4324
+ const scrollLeftRef = vue.ref(0);
4325
+ const xFinweckTreeRef = vue.computed(() => {
4326
+ const columns = columnsRef.value;
4327
+ if (columns.length === 0) {
4328
+ return null;
4329
+ }
4330
+ const ft = new FinweckTree(columns.length, 0);
4331
+ columns.forEach((column, index) => {
4332
+ ft.add(index, column.width);
4333
+ });
4334
+ return ft;
4335
+ });
4336
+ const startIndexRef = useMemo(() => {
4337
+ const xFinweckTree = xFinweckTreeRef.value;
4338
+ if (xFinweckTree !== null) {
4339
+ return Math.max(xFinweckTree.getBound(scrollLeftRef.value) - 1, 0);
4340
+ } else {
4341
+ return 0;
4342
+ }
4343
+ });
4344
+ const getLeft = index => {
4345
+ const xFinweckTree = xFinweckTreeRef.value;
4346
+ if (xFinweckTree !== null) {
4347
+ return xFinweckTree.sum(index);
4348
+ } else {
4349
+ return 0;
4350
+ }
4351
+ };
4352
+ const endIndexRef = useMemo(() => {
4353
+ const xFinweckTree = xFinweckTreeRef.value;
4354
+ if (xFinweckTree !== null) {
4355
+ return Math.min(xFinweckTree.getBound(scrollLeftRef.value + listWidthRef.value) + 1, columnsRef.value.length - 1);
4356
+ } else {
4357
+ return 0;
4358
+ }
4359
+ });
4360
+ vue.provide(xScrollInjextionKey, {
4361
+ startIndexRef,
4362
+ endIndexRef,
4363
+ columnsRef,
4364
+ renderColRef,
4365
+ renderItemWithColsRef,
4366
+ getLeft
4367
+ });
4368
+ return {
4369
+ listWidthRef,
4370
+ scrollLeftRef
4371
+ };
4372
+ }
4373
+
4374
+ const VirtualListRow = vue.defineComponent({
4375
+ name: 'VirtualListRow',
4376
+ props: {
4377
+ index: {
4378
+ type: Number,
4379
+ required: true
4380
+ },
4381
+ item: {
4382
+ type: Object,
4383
+ required: true
4384
+ }
4385
+ },
4386
+ setup() {
4387
+ const {
4388
+ startIndexRef,
4389
+ endIndexRef,
4390
+ columnsRef,
4391
+ getLeft,
4392
+ renderColRef,
4393
+ renderItemWithColsRef
4394
+ } =
4395
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
4396
+ vue.inject(xScrollInjextionKey);
4397
+ return {
4398
+ startIndex: startIndexRef,
4399
+ endIndex: endIndexRef,
4400
+ columns: columnsRef,
4401
+ renderCol: renderColRef,
4402
+ renderItemWithCols: renderItemWithColsRef,
4403
+ getLeft
4404
+ };
4405
+ },
4406
+ render() {
4407
+ const {
4408
+ startIndex,
4409
+ endIndex,
4410
+ columns,
4411
+ renderCol,
4412
+ renderItemWithCols,
4413
+ getLeft,
4414
+ item
4415
+ } = this;
4416
+ if (renderItemWithCols != null) {
4417
+ return renderItemWithCols({
4418
+ itemIndex: this.index,
4419
+ startColIndex: startIndex,
4420
+ endColIndex: endIndex,
4421
+ allColumns: columns,
4422
+ item,
4423
+ getLeft
4424
+ });
4425
+ }
4426
+ if (renderCol != null) {
4427
+ const items = [];
4428
+ for (let i = startIndex; i <= endIndex; ++i) {
4429
+ const column = columns[i];
4430
+ items.push(renderCol({
4431
+ column,
4432
+ left: getLeft(i),
4433
+ item
4434
+ }));
4435
+ }
4436
+ return items;
4437
+ }
4438
+ return null;
4439
+ }
4440
+ });
4441
+
4301
4442
  /* eslint-disable no-void */
4302
4443
  /* eslint-disable @typescript-eslint/restrict-plus-operands */
4303
4444
  const styles$1 = c('.v-vl', {
@@ -4320,6 +4461,12 @@
4320
4461
  type: Boolean,
4321
4462
  default: true
4322
4463
  },
4464
+ columns: {
4465
+ type: Array,
4466
+ default: () => []
4467
+ },
4468
+ renderCol: Function,
4469
+ renderItemWithCols: Function,
4323
4470
  items: {
4324
4471
  type: Array,
4325
4472
  default: () => []
@@ -4392,7 +4539,7 @@
4392
4539
  // remount
4393
4540
  scrollTo({
4394
4541
  top: scrollTopRef.value,
4395
- left: scrollLeft
4542
+ left: scrollLeftRef.value
4396
4543
  });
4397
4544
  });
4398
4545
  vue.onDeactivated(() => {
@@ -4401,6 +4548,17 @@
4401
4548
  activateStateInitialized = true;
4402
4549
  }
4403
4550
  });
4551
+ const totalWidthRef = useMemo(() => {
4552
+ if (props.renderCol == null && props.renderItemWithCols == null) {
4553
+ return undefined;
4554
+ }
4555
+ if (props.columns.length === 0) return undefined;
4556
+ let width = 0;
4557
+ props.columns.forEach(column => {
4558
+ width += column.width;
4559
+ });
4560
+ return width;
4561
+ });
4404
4562
  const keyIndexMapRef = vue.computed(() => {
4405
4563
  const map = new Map();
4406
4564
  const {
@@ -4411,6 +4569,14 @@
4411
4569
  });
4412
4570
  return map;
4413
4571
  });
4572
+ const {
4573
+ scrollLeftRef,
4574
+ listWidthRef
4575
+ } = setupXScroll({
4576
+ columnsRef: vue.toRef(props, 'columns'),
4577
+ renderColRef: vue.toRef(props, 'renderCol'),
4578
+ renderItemWithColsRef: vue.toRef(props, 'renderItemWithCols')
4579
+ });
4414
4580
  const listElRef = vue.ref(null);
4415
4581
  const listHeightRef = vue.ref(undefined);
4416
4582
  const keyToHeightOffset = new Map();
@@ -4431,7 +4597,6 @@
4431
4597
  return ft;
4432
4598
  });
4433
4599
  const finweckTreeUpdateTrigger = vue.ref(0);
4434
- let scrollLeft = 0;
4435
4600
  const scrollTopRef = vue.ref(0);
4436
4601
  const startIndexRef = useMemo(() => {
4437
4602
  return Math.max(finweckTreeRef.value.getBound(scrollTopRef.value - depx(props.paddingTop)) - 1, 0);
@@ -4618,8 +4783,15 @@
4618
4783
  // List is HTMLElement
4619
4784
  if (isHideByVShow(entry.target)) return;
4620
4785
  // If height is same, return
4621
- if (entry.contentRect.height === listHeightRef.value) return;
4786
+ if (props.renderCol == null && props.renderItemWithCols == null) {
4787
+ if (entry.contentRect.height === listHeightRef.value) return;
4788
+ } else {
4789
+ if (entry.contentRect.height === listHeightRef.value && entry.contentRect.width === listWidthRef.value) {
4790
+ return;
4791
+ }
4792
+ }
4622
4793
  listHeightRef.value = entry.contentRect.height;
4794
+ listWidthRef.value = entry.contentRect.width;
4623
4795
  const {
4624
4796
  onResize
4625
4797
  } = props;
@@ -4633,7 +4805,7 @@
4633
4805
  // https://github.com/TuSimple/naive-ui/issues/811
4634
4806
  if (listEl == null) return;
4635
4807
  scrollTopRef.value = listEl.scrollTop;
4636
- scrollLeft = listEl.scrollLeft;
4808
+ scrollLeftRef.value = listEl.scrollLeft;
4637
4809
  }
4638
4810
  function isHideByVShow(el) {
4639
4811
  let cursor = el;
@@ -4658,6 +4830,7 @@
4658
4830
  finweckTreeUpdateTrigger.value;
4659
4831
  return [props.itemsStyle, {
4660
4832
  boxSizing: 'content-box',
4833
+ width: pxfy(totalWidthRef.value),
4661
4834
  height: itemResizable ? '' : height,
4662
4835
  minHeight: itemResizable ? height : '',
4663
4836
  paddingTop: pxfy(props.paddingTop),
@@ -4706,24 +4879,40 @@
4706
4879
  class: 'v-vl-visible-items',
4707
4880
  style: this.visibleItemsStyle
4708
4881
  }, this.visibleItemsProps), {
4709
- default: () => this.viewportItems.map(item => {
4710
- const key = item[keyField];
4711
- const index = keyToIndex.get(key);
4712
- const itemVNode = this.$slots.default({
4713
- item,
4714
- index
4715
- })[0];
4716
- if (itemResizable) {
4717
- return vue.h(VResizeObserver, {
4718
- key,
4719
- onResize: entry => this.handleItemResize(key, entry)
4720
- }, {
4721
- default: () => itemVNode
4722
- });
4723
- }
4724
- itemVNode.key = key;
4725
- return itemVNode;
4726
- })
4882
+ default: () => {
4883
+ const {
4884
+ renderCol,
4885
+ renderItemWithCols
4886
+ } = this;
4887
+ return this.viewportItems.map(item => {
4888
+ const key = item[keyField];
4889
+ const index = keyToIndex.get(key);
4890
+ const renderedCols = renderCol != null ? vue.h(VirtualListRow, {
4891
+ index,
4892
+ item
4893
+ }) : undefined;
4894
+ const renderedItemWithCols = renderItemWithCols != null ? vue.h(VirtualListRow, {
4895
+ index,
4896
+ item
4897
+ }) : undefined;
4898
+ const itemVNode = this.$slots.default({
4899
+ item,
4900
+ renderedCols,
4901
+ renderedItemWithCols,
4902
+ index
4903
+ })[0];
4904
+ if (itemResizable) {
4905
+ return vue.h(VResizeObserver, {
4906
+ key,
4907
+ onResize: entry => this.handleItemResize(key, entry)
4908
+ }, {
4909
+ default: () => itemVNode
4910
+ });
4911
+ }
4912
+ itemVNode.key = key;
4913
+ return itemVNode;
4914
+ });
4915
+ }
4727
4916
  })]) : (_b = (_a = this.$slots).empty) === null || _b === void 0 ? void 0 : _b.call(_a)]);
4728
4917
  }
4729
4918
  });
@@ -4790,6 +4979,7 @@
4790
4979
  getCounter: Function,
4791
4980
  getTail: Function,
4792
4981
  updateCounter: Function,
4982
+ onUpdateCount: Function,
4793
4983
  onUpdateOverflow: Function
4794
4984
  },
4795
4985
  setup(props, {
@@ -4797,7 +4987,7 @@
4797
4987
  }) {
4798
4988
  const selfRef = vue.ref(null);
4799
4989
  const counterRef = vue.ref(null);
4800
- function deriveCounter() {
4990
+ function deriveCounter(options) {
4801
4991
  const {
4802
4992
  value: self
4803
4993
  } = selfRef;
@@ -4816,6 +5006,13 @@
4816
5006
  const {
4817
5007
  children
4818
5008
  } = self;
5009
+ if (options.showAllItemsBeforeCalculate) {
5010
+ for (const child of children) {
5011
+ if (child.hasAttribute(hiddenAttr)) {
5012
+ child.removeAttribute(hiddenAttr);
5013
+ }
5014
+ }
5015
+ }
4819
5016
  const containerWidth = self.offsetWidth;
4820
5017
  const childWidths = [];
4821
5018
  const tail = slots.tail ? getTail === null || getTail === void 0 ? void 0 : getTail() : null;
@@ -4862,6 +5059,10 @@
4862
5059
  tail.style.maxWidth = '';
4863
5060
  }
4864
5061
  }
5062
+ const {
5063
+ onUpdateCount
5064
+ } = props;
5065
+ if (onUpdateCount) onUpdateCount(restCount);
4865
5066
  break;
4866
5067
  }
4867
5068
  }
@@ -4888,7 +5089,9 @@
4888
5089
  anchorMetaName: cssrAnchorMetaName$1,
4889
5090
  ssr: ssrAdapter
4890
5091
  });
4891
- vue.onMounted(deriveCounter);
5092
+ vue.onMounted(() => deriveCounter({
5093
+ showAllItemsBeforeCalculate: false
5094
+ }));
4892
5095
  // besides onMounted, other case should be manually triggered, or we shoud watch items
4893
5096
  return {
4894
5097
  selfRef,
@@ -4901,7 +5104,9 @@
4901
5104
  $slots
4902
5105
  } = this;
4903
5106
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
4904
- vue.nextTick(this.sync);
5107
+ vue.nextTick(() => this.sync({
5108
+ showAllItemsBeforeCalculate: false
5109
+ }));
4905
5110
  // It shouldn't have border
4906
5111
  return vue.h('div', {
4907
5112
  class: 'v-overflow',
@@ -4969,7 +5174,6 @@
4969
5174
  return !!element.href && element.rel !== 'ignore';
4970
5175
  case 'INPUT':
4971
5176
  return element.type !== 'hidden' && element.type !== 'file';
4972
- case 'BUTTON':
4973
5177
  case 'SELECT':
4974
5178
  case 'TEXTAREA':
4975
5179
  return true;
@@ -4989,8 +5193,8 @@
4989
5193
  default: true
4990
5194
  },
4991
5195
  onEsc: Function,
4992
- initialFocusTo: String,
4993
- finalFocusTo: String,
5196
+ initialFocusTo: [String, Function],
5197
+ finalFocusTo: [String, Function],
4994
5198
  returnFocusOnDeactivated: {
4995
5199
  type: Boolean,
4996
5200
  default: true
@@ -31510,12 +31714,27 @@
31510
31714
  }
31511
31715
  });
31512
31716
 
31717
+ const commonVars$8 = {
31718
+ railInsetHorizontalBottom: "auto 2px 4px 2px",
31719
+ railInsetHorizontalTop: "4px 2px auto 2px",
31720
+ railInsetVerticalRight: "2px 4px 2px auto",
31721
+ railInsetVerticalLeft: "2px auto 2px 4px",
31722
+ railColor: "transparent"
31723
+ };
31724
+
31513
31725
  const self$1m = vars => {
31514
31726
  const {
31515
31727
  scrollbarColor,
31516
- scrollbarColorHover
31728
+ scrollbarColorHover,
31729
+ scrollbarHeight,
31730
+ scrollbarWidth,
31731
+ scrollbarBorderRadius
31517
31732
  } = vars;
31518
31733
  return {
31734
+ ...commonVars$8,
31735
+ height: scrollbarHeight,
31736
+ width: scrollbarWidth,
31737
+ borderRadius: scrollbarBorderRadius,
31519
31738
  color: scrollbarColor,
31520
31739
  colorHover: scrollbarColorHover
31521
31740
  };
@@ -31585,50 +31804,60 @@
31585
31804
  width: 0;
31586
31805
  height: 0;
31587
31806
  display: none;
31588
- `), c$1(">", [cB("scrollbar-content", `
31807
+ `), c$1(">", [
31808
+ // We can't set overflow hidden since it affects positioning.
31809
+ cB("scrollbar-content", `
31589
31810
  box-sizing: border-box;
31590
31811
  min-width: 100%;
31591
31812
  `)])])]), c$1(">, +", [cB("scrollbar-rail", `
31592
31813
  position: absolute;
31593
31814
  pointer-events: none;
31594
31815
  user-select: none;
31816
+ background: var(--u-scrollbar-rail-color);
31595
31817
  -webkit-user-select: none;
31596
31818
  `, [cM("horizontal", `
31597
- left: 2px;
31598
- right: 2px;
31599
- bottom: 4px;
31600
31819
  height: var(--u-scrollbar-height);
31601
31820
  `, [c$1(">", [cE("scrollbar", `
31602
31821
  height: var(--u-scrollbar-height);
31603
31822
  border-radius: var(--u-scrollbar-border-radius);
31604
31823
  right: 0;
31605
- `)])]), cM("vertical", `
31606
- right: 4px;
31607
- top: 2px;
31608
- bottom: 2px;
31824
+ `)])]), cM("horizontal--top", `
31825
+ top: var(--u-scrollbar-rail-top-horizontal-top);
31826
+ right: var(--u-scrollbar-rail-right-horizontal-top);
31827
+ bottom: var(--u-scrollbar-rail-bottom-horizontal-top);
31828
+ left: var(--u-scrollbar-rail-left-horizontal-top);
31829
+ `), cM("horizontal--bottom", `
31830
+ top: var(--u-scrollbar-rail-top-horizontal-bottom);
31831
+ right: var(--u-scrollbar-rail-right-horizontal-bottom);
31832
+ bottom: var(--u-scrollbar-rail-bottom-horizontal-bottom);
31833
+ left: var(--u-scrollbar-rail-left-horizontal-bottom);
31834
+ `), cM("vertical", `
31609
31835
  width: var(--u-scrollbar-width);
31610
31836
  `, [c$1(">", [cE("scrollbar", `
31611
31837
  width: var(--u-scrollbar-width);
31612
31838
  border-radius: var(--u-scrollbar-border-radius);
31613
31839
  bottom: 0;
31614
- `)])]), cM("disabled", [c$1(">", [cE("scrollbar", {
31615
- pointerEvents: "none"
31616
- })])]), c$1(">", [cE("scrollbar", `
31840
+ `)])]), cM("vertical--left", `
31841
+ top: var(--u-scrollbar-rail-top-vertical-left);
31842
+ right: var(--u-scrollbar-rail-right-vertical-left);
31843
+ bottom: var(--u-scrollbar-rail-bottom-vertical-left);
31844
+ left: var(--u-scrollbar-rail-left-vertical-left);
31845
+ `), cM("vertical--right", `
31846
+ top: var(--u-scrollbar-rail-top-vertical-right);
31847
+ right: var(--u-scrollbar-rail-right-vertical-right);
31848
+ bottom: var(--u-scrollbar-rail-bottom-vertical-right);
31849
+ left: var(--u-scrollbar-rail-left-vertical-right);
31850
+ `), cM("disabled", [c$1(">", [cE("scrollbar", "pointer-events: none;")])]), c$1(">", [cE("scrollbar", `
31851
+ z-index: 1;
31617
31852
  position: absolute;
31618
31853
  cursor: pointer;
31619
31854
  pointer-events: all;
31620
31855
  background-color: var(--u-scrollbar-color);
31621
31856
  transition: background-color .2s var(--u-scrollbar-bezier);
31622
- `, [fadeInTransition(), c$1("&:hover", {
31623
- backgroundColor: "var(--u-scrollbar-color-hover)"
31624
- })])])])])]);
31857
+ `, [fadeInTransition(), c$1("&:hover", "background-color: var(--u-scrollbar-color-hover);")])])])])]);
31625
31858
 
31626
31859
  const scrollbarProps$1 = {
31627
31860
  ...useTheme.props,
31628
- size: {
31629
- type: Number,
31630
- default: 5
31631
- },
31632
31861
  duration: {
31633
31862
  type: Number,
31634
31863
  default: 0
@@ -31649,7 +31878,7 @@
31649
31878
  content: Function,
31650
31879
  containerClass: String,
31651
31880
  containerStyle: [String, Object],
31652
- contentClass: String,
31881
+ contentClass: [String, Array],
31653
31882
  contentStyle: [String, Object],
31654
31883
  horizontalRailStyle: [String, Object],
31655
31884
  verticalRailStyle: [String, Object],
@@ -31657,7 +31886,15 @@
31657
31886
  onWheel: Function,
31658
31887
  onResize: Function,
31659
31888
  internalOnUpdateScrollLeft: Function,
31660
- internalHoistYRail: Boolean
31889
+ internalHoistYRail: Boolean,
31890
+ yPlacement: {
31891
+ type: String,
31892
+ default: "right"
31893
+ },
31894
+ xPlacement: {
31895
+ type: String,
31896
+ default: "bottom"
31897
+ }
31661
31898
  };
31662
31899
  const Scrollbar$1 = vue.defineComponent({
31663
31900
  name: "Scrollbar",
@@ -31690,6 +31927,14 @@
31690
31927
  let memoMouseX = 0;
31691
31928
  let memoMouseY = 0;
31692
31929
  const isIos = useIsIos();
31930
+ const themeRef = useTheme(
31931
+ "Scrollbar",
31932
+ "-scrollbar",
31933
+ style$1C,
31934
+ scrollbarLight,
31935
+ props,
31936
+ mergedClsPrefixRef
31937
+ );
31693
31938
  const yBarSizeRef = vue.computed(() => {
31694
31939
  const { value: containerHeight } = containerHeightRef;
31695
31940
  const { value: contentHeight } = contentHeightRef;
@@ -31699,7 +31944,7 @@
31699
31944
  } else {
31700
31945
  return Math.min(
31701
31946
  containerHeight,
31702
- yRailSize * containerHeight / contentHeight + props.size * 1.5
31947
+ yRailSize * containerHeight / contentHeight + depx(themeRef.value.self.width) * 1.5
31703
31948
  );
31704
31949
  }
31705
31950
  });
@@ -31713,7 +31958,7 @@
31713
31958
  if (containerWidth === null || contentWidth === null || xRailSize === null) {
31714
31959
  return 0;
31715
31960
  } else {
31716
- return xRailSize * containerWidth / contentWidth + props.size * 1.5;
31961
+ return xRailSize * containerWidth / contentWidth + depx(themeRef.value.self.height) * 1.5;
31717
31962
  }
31718
31963
  });
31719
31964
  const xBarSizePxRef = vue.computed(() => {
@@ -31728,7 +31973,9 @@
31728
31973
  return 0;
31729
31974
  } else {
31730
31975
  const heightDiff = contentHeight - containerHeight;
31731
- if (!heightDiff) return 0;
31976
+ if (!heightDiff) {
31977
+ return 0;
31978
+ }
31732
31979
  return containerScrollTop / heightDiff * (yRailSize - yBarSizeRef.value);
31733
31980
  }
31734
31981
  });
@@ -31744,7 +31991,9 @@
31744
31991
  return 0;
31745
31992
  } else {
31746
31993
  const widthDiff = contentWidth - containerWidth;
31747
- if (!widthDiff) return 0;
31994
+ if (!widthDiff) {
31995
+ return 0;
31996
+ }
31748
31997
  return containerScrollLeft / widthDiff * (xRailSize - xBarSizeRef.value);
31749
31998
  }
31750
31999
  });
@@ -31771,34 +32020,22 @@
31771
32020
  });
31772
32021
  const mergedContainerRef = vue.computed(() => {
31773
32022
  const { container } = props;
31774
- if (container) return container();
32023
+ if (container) {
32024
+ return container();
32025
+ }
31775
32026
  return containerRef.value;
31776
32027
  });
31777
32028
  const mergedContentRef = vue.computed(() => {
31778
32029
  const { content } = props;
31779
- if (content) return content();
31780
- return contentRef.value;
31781
- });
31782
- const activateState = useReactivated(() => {
31783
- if (!props.container) {
31784
- scrollTo({
31785
- top: containerScrollTopRef.value,
31786
- left: containerScrollLeftRef.value
31787
- });
32030
+ if (content) {
32031
+ return content();
31788
32032
  }
32033
+ return contentRef.value;
31789
32034
  });
31790
- const handleContentResize = () => {
31791
- if (activateState.isDeactivated) return;
31792
- sync();
31793
- };
31794
- const handleContainerResize = (e) => {
31795
- if (activateState.isDeactivated) return;
31796
- const { onResize } = props;
31797
- if (onResize) onResize(e);
31798
- sync();
31799
- };
31800
32035
  const scrollTo = (options, y) => {
31801
- if (!props.scrollable) return;
32036
+ if (!props.scrollable) {
32037
+ return;
32038
+ }
31802
32039
  if (typeof options === "number") {
31803
32040
  scrollToPosition(options, y ?? 0, 0, false, "auto");
31804
32041
  return;
@@ -31826,10 +32063,38 @@
31826
32063
  scrollToPosition(0, 0, 0, false, behavior);
31827
32064
  }
31828
32065
  };
32066
+ const activateState = useReactivated(() => {
32067
+ if (!props.container) {
32068
+ scrollTo({
32069
+ top: containerScrollTopRef.value,
32070
+ left: containerScrollLeftRef.value
32071
+ });
32072
+ }
32073
+ });
32074
+ const handleContentResize = () => {
32075
+ if (activateState.isDeactivated) {
32076
+ return;
32077
+ }
32078
+ sync();
32079
+ };
32080
+ const handleContainerResize = (e) => {
32081
+ if (activateState.isDeactivated) {
32082
+ return;
32083
+ }
32084
+ const { onResize } = props;
32085
+ if (onResize) {
32086
+ onResize(e);
32087
+ }
32088
+ sync();
32089
+ };
31829
32090
  const scrollBy = (options, y) => {
31830
- if (!props.scrollable) return;
32091
+ if (!props.scrollable) {
32092
+ return;
32093
+ }
31831
32094
  const { value: container } = mergedContainerRef;
31832
- if (!container) return;
32095
+ if (!container) {
32096
+ return;
32097
+ }
31833
32098
  if (typeof options === "object") {
31834
32099
  container.scrollBy(options);
31835
32100
  } else {
@@ -31838,7 +32103,9 @@
31838
32103
  };
31839
32104
  function scrollToPosition(left, top, elSize, debounce, behavior) {
31840
32105
  const { value: container } = mergedContainerRef;
31841
- if (!container) return;
32106
+ if (!container) {
32107
+ return;
32108
+ }
31842
32109
  if (debounce) {
31843
32110
  const { scrollTop, offsetHeight } = container;
31844
32111
  if (top > scrollTop) {
@@ -31900,7 +32167,9 @@
31900
32167
  }
31901
32168
  function handleScroll(e) {
31902
32169
  const { onScroll } = props;
31903
- if (onScroll) onScroll(e);
32170
+ if (onScroll) {
32171
+ onScroll(e);
32172
+ }
31904
32173
  syncScrollState();
31905
32174
  }
31906
32175
  function syncScrollState() {
@@ -31950,7 +32219,9 @@
31950
32219
  }
31951
32220
  }
31952
32221
  function sync() {
31953
- if (!props.scrollable) return;
32222
+ if (!props.scrollable) {
32223
+ return;
32224
+ }
31954
32225
  if (props.useUnifiedContainer) {
31955
32226
  syncUnifiedContainer();
31956
32227
  } else {
@@ -31973,7 +32244,9 @@
31973
32244
  memoMouseX = rtlEnabledRef?.value ? window.innerWidth - e.clientX : e.clientX;
31974
32245
  }
31975
32246
  function handleXScrollMouseMove(e) {
31976
- if (!xBarPressed) return;
32247
+ if (!xBarPressed) {
32248
+ return;
32249
+ }
31977
32250
  if (xBarVanishTimerId !== void 0) {
31978
32251
  window.clearTimeout(xBarVanishTimerId);
31979
32252
  }
@@ -31983,7 +32256,9 @@
31983
32256
  const { value: containerWidth } = containerWidthRef;
31984
32257
  const { value: contentWidth } = contentWidthRef;
31985
32258
  const { value: xBarSize } = xBarSizeRef;
31986
- if (containerWidth === null || contentWidth === null) return;
32259
+ if (containerWidth === null || contentWidth === null) {
32260
+ return;
32261
+ }
31987
32262
  const dX = rtlEnabledRef?.value ? window.innerWidth - e.clientX - memoMouseX : e.clientX - memoMouseX;
31988
32263
  const dScrollLeft = dX * (contentWidth - containerWidth) / (containerWidth - xBarSize);
31989
32264
  const toScrollLeftUpperBound = contentWidth - containerWidth;
@@ -31994,7 +32269,9 @@
31994
32269
  if (container) {
31995
32270
  container.scrollLeft = toScrollLeft * (rtlEnabledRef?.value ? -1 : 1);
31996
32271
  const { internalOnUpdateScrollLeft } = props;
31997
- if (internalOnUpdateScrollLeft) internalOnUpdateScrollLeft(toScrollLeft);
32272
+ if (internalOnUpdateScrollLeft) {
32273
+ internalOnUpdateScrollLeft(toScrollLeft);
32274
+ }
31998
32275
  }
31999
32276
  }
32000
32277
  function handleXScrollMouseUp(e) {
@@ -32018,7 +32295,9 @@
32018
32295
  memoMouseY = e.clientY;
32019
32296
  }
32020
32297
  function handleYScrollMouseMove(e) {
32021
- if (!yBarPressed) return;
32298
+ if (!yBarPressed) {
32299
+ return;
32300
+ }
32022
32301
  if (xBarVanishTimerId !== void 0) {
32023
32302
  window.clearTimeout(xBarVanishTimerId);
32024
32303
  }
@@ -32028,7 +32307,9 @@
32028
32307
  const { value: containerHeight } = containerHeightRef;
32029
32308
  const { value: contentHeight } = contentHeightRef;
32030
32309
  const { value: yBarSize } = yBarSizeRef;
32031
- if (containerHeight === null || contentHeight === null) return;
32310
+ if (containerHeight === null || contentHeight === null) {
32311
+ return;
32312
+ }
32032
32313
  const dY = e.clientY - memoMouseY;
32033
32314
  const dScrollTop = dY * (contentHeight - containerHeight) / (containerHeight - yBarSize);
32034
32315
  const toScrollTopUpperBound = contentHeight - containerHeight;
@@ -32077,7 +32358,9 @@
32077
32358
  }
32078
32359
  });
32079
32360
  vue.onMounted(() => {
32080
- if (props.container) return;
32361
+ if (props.container) {
32362
+ return;
32363
+ }
32081
32364
  sync();
32082
32365
  });
32083
32366
  vue.onBeforeUnmount(() => {
@@ -32090,31 +32373,74 @@
32090
32373
  off("mousemove", window, handleYScrollMouseMove, true);
32091
32374
  off("mouseup", window, handleYScrollMouseUp, true);
32092
32375
  });
32093
- const themeRef = useTheme(
32094
- "Scrollbar",
32095
- "-scrollbar",
32096
- style$1C,
32097
- scrollbarLight,
32098
- props,
32099
- mergedClsPrefixRef
32100
- );
32101
32376
  const cssVarsRef = vue.computed(() => {
32102
32377
  const {
32103
- common: {
32104
- cubicBezierEaseInOut,
32105
- scrollbarBorderRadius,
32106
- scrollbarHeight,
32107
- scrollbarWidth
32108
- },
32109
- self: { color, colorHover }
32378
+ common: { cubicBezierEaseInOut },
32379
+ self: {
32380
+ color,
32381
+ colorHover,
32382
+ height,
32383
+ width,
32384
+ borderRadius,
32385
+ railInsetHorizontalTop,
32386
+ railInsetHorizontalBottom,
32387
+ railInsetVerticalRight,
32388
+ railInsetVerticalLeft,
32389
+ railColor
32390
+ }
32110
32391
  } = themeRef.value;
32392
+ const {
32393
+ top: railTopHorizontalTop,
32394
+ right: railRightHorizontalTop,
32395
+ bottom: railBottomHorizontalTop,
32396
+ left: railLeftHorizontalTop
32397
+ } = getMargin(railInsetHorizontalTop);
32398
+ const {
32399
+ top: railTopHorizontalBottom,
32400
+ right: railRightHorizontalBottom,
32401
+ bottom: railBottomHorizontalBottom,
32402
+ left: railLeftHorizontalBottom
32403
+ } = getMargin(railInsetHorizontalBottom);
32404
+ const {
32405
+ top: railTopVerticalRight,
32406
+ right: railRightVerticalRight,
32407
+ bottom: railBottomVerticalRight,
32408
+ left: railLeftVerticalRight
32409
+ } = getMargin(
32410
+ rtlEnabledRef?.value ? rtlInset(railInsetVerticalRight) : railInsetVerticalRight
32411
+ );
32412
+ const {
32413
+ top: railTopVerticalLeft,
32414
+ right: railRightVerticalLeft,
32415
+ bottom: railBottomVerticalLeft,
32416
+ left: railLeftVerticalLeft
32417
+ } = getMargin(
32418
+ rtlEnabledRef?.value ? rtlInset(railInsetVerticalLeft) : railInsetVerticalLeft
32419
+ );
32111
32420
  return {
32112
32421
  "--u-scrollbar-bezier": cubicBezierEaseInOut,
32113
32422
  "--u-scrollbar-color": color,
32114
32423
  "--u-scrollbar-color-hover": colorHover,
32115
- "--u-scrollbar-border-radius": scrollbarBorderRadius,
32116
- "--u-scrollbar-width": scrollbarWidth,
32117
- "--u-scrollbar-height": scrollbarHeight
32424
+ "--u-scrollbar-border-radius": borderRadius,
32425
+ "--u-scrollbar-width": width,
32426
+ "--u-scrollbar-height": height,
32427
+ "--u-scrollbar-rail-top-horizontal-top": railTopHorizontalTop,
32428
+ "--u-scrollbar-rail-right-horizontal-top": railRightHorizontalTop,
32429
+ "--u-scrollbar-rail-bottom-horizontal-top": railBottomHorizontalTop,
32430
+ "--u-scrollbar-rail-left-horizontal-top": railLeftHorizontalTop,
32431
+ "--u-scrollbar-rail-top-horizontal-bottom": railTopHorizontalBottom,
32432
+ "--u-scrollbar-rail-right-horizontal-bottom": railRightHorizontalBottom,
32433
+ "--u-scrollbar-rail-bottom-horizontal-bottom": railBottomHorizontalBottom,
32434
+ "--u-scrollbar-rail-left-horizontal-bottom": railLeftHorizontalBottom,
32435
+ "--u-scrollbar-rail-top-vertical-right": railTopVerticalRight,
32436
+ "--u-scrollbar-rail-right-vertical-right": railRightVerticalRight,
32437
+ "--u-scrollbar-rail-bottom-vertical-right": railBottomVerticalRight,
32438
+ "--u-scrollbar-rail-left-vertical-right": railLeftVerticalRight,
32439
+ "--u-scrollbar-rail-top-vertical-left": railTopVerticalLeft,
32440
+ "--u-scrollbar-rail-right-vertical-left": railRightVerticalLeft,
32441
+ "--u-scrollbar-rail-bottom-vertical-left": railBottomVerticalLeft,
32442
+ "--u-scrollbar-rail-left-vertical-left": railLeftVerticalLeft,
32443
+ "--u-scrollbar-rail-color": railColor
32118
32444
  };
32119
32445
  });
32120
32446
  const themeClassHandle = inlineThemeDisabled ? useThemeClass("scrollbar", void 0, cssVarsRef, props) : void 0;
@@ -32161,22 +32487,29 @@
32161
32487
  mergedClsPrefix,
32162
32488
  triggerDisplayManually,
32163
32489
  rtlEnabled,
32164
- internalHoistYRail
32490
+ internalHoistYRail,
32491
+ yPlacement,
32492
+ xPlacement,
32493
+ xScrollable
32165
32494
  } = this;
32166
- if (!this.scrollable) return $slots.default?.();
32495
+ if (!this.scrollable) {
32496
+ return $slots.default?.();
32497
+ }
32167
32498
  const triggerIsNone = this.trigger === "none";
32168
- const createYRail = (style2) => {
32499
+ const createYRail = (className, style2) => {
32169
32500
  return /* @__PURE__ */ vue.h(
32170
32501
  "div",
32171
32502
  {
32172
32503
  ref: "yRailRef",
32173
32504
  class: [
32174
32505
  `${mergedClsPrefix}-scrollbar-rail`,
32175
- `${mergedClsPrefix}-scrollbar-rail--vertical`
32506
+ `${mergedClsPrefix}-scrollbar-rail--vertical`,
32507
+ `${mergedClsPrefix}-scrollbar-rail--vertical--${yPlacement}`,
32508
+ className
32176
32509
  ],
32177
32510
  "data-scrollbar-rail": true,
32178
32511
  style: [style2 || "", this.verticalRailStyle],
32179
- "aria-hiddens": true
32512
+ "aria-hidden": true
32180
32513
  },
32181
32514
  vue.h(
32182
32515
  triggerIsNone ? Wrapper : vue.Transition,
@@ -32248,14 +32581,15 @@
32248
32581
  )
32249
32582
  })
32250
32583
  ),
32251
- internalHoistYRail ? null : createYRail(void 0),
32252
- this.xScrollable && /* @__PURE__ */ vue.h(
32584
+ internalHoistYRail ? null : createYRail(void 0, void 0),
32585
+ xScrollable && /* @__PURE__ */ vue.h(
32253
32586
  "div",
32254
32587
  {
32255
32588
  ref: "xRailRef",
32256
32589
  class: [
32257
32590
  `${mergedClsPrefix}-scrollbar-rail`,
32258
- `${mergedClsPrefix}-scrollbar-rail--horizontal`
32591
+ `${mergedClsPrefix}-scrollbar-rail--horizontal`,
32592
+ `${mergedClsPrefix}-scrollbar-rail--horizontal--${xPlacement}`
32259
32593
  ],
32260
32594
  style: this.horizontalRailStyle,
32261
32595
  "data-scrollbar-rail": true,
@@ -32287,7 +32621,7 @@
32287
32621
  default: createChildren
32288
32622
  });
32289
32623
  if (internalHoistYRail) {
32290
- return /* @__PURE__ */ vue.h(vue.Fragment, null, scrollbarNode, createYRail(this.cssVars));
32624
+ return /* @__PURE__ */ vue.h(vue.Fragment, null, scrollbarNode, createYRail(this.themeClass, this.cssVars));
32291
32625
  } else {
32292
32626
  return scrollbarNode;
32293
32627
  }
@@ -35786,7 +36120,9 @@
35786
36120
  if (patternInputEl) {
35787
36121
  patternInputEl.style.width = `${patternInputMirrorEl.offsetWidth}px`;
35788
36122
  if (props.maxTagCount !== "responsive") {
35789
- overflowRef.value?.sync();
36123
+ overflowRef.value?.sync({
36124
+ showAllItemsBeforeCalculate: false
36125
+ });
35790
36126
  }
35791
36127
  }
35792
36128
  }
@@ -112471,6 +112807,78 @@
112471
112807
  }
112472
112808
  });
112473
112809
 
112810
+ const infiniteScrollProps = {
112811
+ distance: {
112812
+ type: Number,
112813
+ default: 0
112814
+ },
112815
+ onLoad: Function,
112816
+ scrollbarProps: Object
112817
+ };
112818
+ var InfiniteScroll = vue.defineComponent({
112819
+ name: "InfiniteScroll",
112820
+ props: infiniteScrollProps,
112821
+ setup(props) {
112822
+ const scrollbarInstRef = vue.ref(null);
112823
+ let loading = false;
112824
+ const handleCheckBottom = async () => {
112825
+ const { value: scrollbarInst } = scrollbarInstRef;
112826
+ if (scrollbarInst) {
112827
+ const { containerRef } = scrollbarInst;
112828
+ const scrollHeight = containerRef?.scrollHeight;
112829
+ const clientHeight = containerRef?.clientHeight;
112830
+ const scrollTop = containerRef?.scrollTop;
112831
+ if (containerRef && scrollHeight !== void 0 && clientHeight !== void 0 && scrollTop !== void 0) {
112832
+ if (scrollTop + clientHeight >= scrollHeight - props.distance) {
112833
+ loading = true;
112834
+ try {
112835
+ await props.onLoad?.();
112836
+ } catch {
112837
+ }
112838
+ loading = false;
112839
+ }
112840
+ }
112841
+ }
112842
+ };
112843
+ const handleScroll = () => {
112844
+ if (loading) {
112845
+ return;
112846
+ }
112847
+ void handleCheckBottom();
112848
+ };
112849
+ const handleWheel = (e) => {
112850
+ if (e.deltaY <= 0) {
112851
+ return;
112852
+ }
112853
+ if (loading) {
112854
+ return;
112855
+ }
112856
+ void handleCheckBottom();
112857
+ };
112858
+ return {
112859
+ scrollbarInstRef,
112860
+ handleScroll,
112861
+ handleWheel
112862
+ };
112863
+ },
112864
+ render() {
112865
+ return /* @__PURE__ */ vue.h(
112866
+ XScrollbar,
112867
+ {
112868
+ ...this.scrollbarProps,
112869
+ ref: "scrollbarInstRef",
112870
+ onWheel: this.handleWheel,
112871
+ onScroll: this.handleScroll
112872
+ },
112873
+ {
112874
+ default: () => {
112875
+ return resolveSlot(this.$slots.default, () => []);
112876
+ }
112877
+ }
112878
+ );
112879
+ }
112880
+ });
112881
+
112474
112882
  function parse(value) {
112475
112883
  if (value === void 0 || value === null || typeof value === "string" && value.trim() === "") {
112476
112884
  return null;
@@ -128862,6 +129270,134 @@
128862
129270
  }
128863
129271
  });
128864
129272
 
129273
+ const virtualListProps = {
129274
+ scrollbarProps: Object,
129275
+ items: {
129276
+ type: Array,
129277
+ default: () => []
129278
+ },
129279
+ itemSize: {
129280
+ type: Number,
129281
+ required: true
129282
+ },
129283
+ itemResizable: Boolean,
129284
+ itemsStyle: [String, Object],
129285
+ visibleItemsTag: {
129286
+ type: [String, Object],
129287
+ default: "div"
129288
+ },
129289
+ visibleItemsProps: Object,
129290
+ ignoreItemResize: Boolean,
129291
+ onScroll: Function,
129292
+ onWheel: Function,
129293
+ onResize: Function,
129294
+ defaultScrollKey: [Number, String],
129295
+ defaultScrollIndex: Number,
129296
+ keyField: {
129297
+ type: String,
129298
+ default: "key"
129299
+ },
129300
+ paddingTop: {
129301
+ type: [Number, String],
129302
+ default: 0
129303
+ },
129304
+ paddingBottom: {
129305
+ type: [Number, String],
129306
+ default: 0
129307
+ }
129308
+ };
129309
+ var VirtualList = vue.defineComponent({
129310
+ name: "VirtualList",
129311
+ props: virtualListProps,
129312
+ setup(props) {
129313
+ const scrollbarInstRef = vue.ref(null);
129314
+ const virtualListInstRef = vue.ref(null);
129315
+ function syncScrollbar() {
129316
+ const { value: scrollbarInst } = scrollbarInstRef;
129317
+ if (scrollbarInst) {
129318
+ scrollbarInst.sync();
129319
+ }
129320
+ }
129321
+ function handleScroll(e) {
129322
+ syncScrollbar();
129323
+ props.onScroll?.(e);
129324
+ }
129325
+ function handleResize(e) {
129326
+ syncScrollbar();
129327
+ props.onResize?.(e);
129328
+ }
129329
+ function handleWheel(e) {
129330
+ props.onWheel?.(e);
129331
+ }
129332
+ function scrollTo(options, y) {
129333
+ if (typeof options === "number") {
129334
+ virtualListInstRef.value?.scrollTo(options, y ?? 0);
129335
+ } else {
129336
+ virtualListInstRef.value?.scrollTo(options);
129337
+ }
129338
+ }
129339
+ function getScrollContainer() {
129340
+ return virtualListInstRef.value?.listElRef;
129341
+ }
129342
+ function getScrollContent() {
129343
+ return virtualListInstRef.value?.itemsElRef;
129344
+ }
129345
+ return {
129346
+ scrollTo,
129347
+ scrollbarInstRef,
129348
+ virtualListInstRef,
129349
+ getScrollContainer,
129350
+ getScrollContent,
129351
+ handleScroll,
129352
+ handleResize,
129353
+ handleWheel
129354
+ };
129355
+ },
129356
+ render() {
129357
+ return /* @__PURE__ */ vue.h(
129358
+ XScrollbar,
129359
+ {
129360
+ ...this.scrollbarProps,
129361
+ ref: "scrollbarInstRef",
129362
+ container: this.getScrollContainer,
129363
+ content: this.getScrollContent
129364
+ },
129365
+ {
129366
+ default: () => {
129367
+ return /* @__PURE__ */ vue.h(
129368
+ VVirtualList,
129369
+ {
129370
+ ref: "virtualListInstRef",
129371
+ showScrollbar: false,
129372
+ items: this.items,
129373
+ itemSize: this.itemSize,
129374
+ itemResizable: this.itemResizable,
129375
+ itemsStyle: this.itemsStyle,
129376
+ visibleItemsTag: this.visibleItemsTag,
129377
+ visibleItemsProps: this.visibleItemsProps,
129378
+ ignoreItemResize: this.ignoreItemResize,
129379
+ keyField: this.keyField,
129380
+ defaultScrollKey: this.defaultScrollKey,
129381
+ defaultScrollIndex: this.defaultScrollIndex,
129382
+ paddingTop: this.paddingTop,
129383
+ paddingBottom: this.paddingBottom,
129384
+ onScroll: this.handleScroll,
129385
+ onResize: this.handleResize,
129386
+ onWheel: this.handleWheel
129387
+ },
129388
+ {
129389
+ default: ({
129390
+ item,
129391
+ index
129392
+ }) => this.$slots.default?.({ item, index })
129393
+ }
129394
+ );
129395
+ }
129396
+ }
129397
+ );
129398
+ }
129399
+ });
129400
+
128865
129401
  var style$1 = c$1([cB("watermark-container", `
128866
129402
  position: relative;
128867
129403
  `, [cNotM("selectable", `
@@ -129535,6 +130071,7 @@
129535
130071
  MessageStatus: MessageStatus,
129536
130072
  NA: a,
129537
130073
  NP: p,
130074
+ NVirtualList: VirtualList,
129538
130075
  UActionCard: ActionCard,
129539
130076
  UAffix: UAffix,
129540
130077
  UAlert: Alert,
@@ -129609,6 +130146,7 @@
129609
130146
  UIconWrapper: UIconWrapper,
129610
130147
  UImage: Image$1,
129611
130148
  UImageGroup: UImageGroup,
130149
+ UInfiniteScroll: InfiniteScroll,
129612
130150
  UInput: UInput,
129613
130151
  UInputGroup: UInputGroup,
129614
130152
  UInputGroupLabel: InputGroupLabel,
@@ -129752,6 +130290,7 @@
129752
130290
  iconWrapperProps: iconWrapperProps,
129753
130291
  imageGroupProps: imageGroupProps,
129754
130292
  imageProps: imageProps,
130293
+ infiniteScrollProps: infiniteScrollProps,
129755
130294
  inputGroupLabelProps: inputGroupLabelProps,
129756
130295
  inputGroupProps: inputGroupProps,
129757
130296
  inputNumberProps: inputNumberProps,
@@ -129820,10 +130359,11 @@
129820
130359
  useLoadingBar: useLoadingBar,
129821
130360
  useMessage: useMessage,
129822
130361
  useNotification: useNotification,
130362
+ virtualListProps: virtualListProps,
129823
130363
  watermarkProps: watermarkProps
129824
130364
  });
129825
130365
 
129826
- var version = "1.8.2";
130366
+ var version = "1.9.0";
129827
130367
 
129828
130368
  function create({
129829
130369
  componentPrefix = "U",
@@ -130633,6 +131173,7 @@
130633
131173
  exports.MessageStatus = MessageStatus;
130634
131174
  exports.NA = a;
130635
131175
  exports.NP = p;
131176
+ exports.NVirtualList = VirtualList;
130636
131177
  exports.UActionCard = ActionCard;
130637
131178
  exports.UAffix = UAffix;
130638
131179
  exports.UAlert = Alert;
@@ -130707,6 +131248,7 @@
130707
131248
  exports.UIconWrapper = UIconWrapper;
130708
131249
  exports.UImage = Image$1;
130709
131250
  exports.UImageGroup = UImageGroup;
131251
+ exports.UInfiniteScroll = InfiniteScroll;
130710
131252
  exports.UInput = UInput;
130711
131253
  exports.UInputGroup = UInputGroup;
130712
131254
  exports.UInputGroupLabel = InputGroupLabel;
@@ -130927,6 +131469,7 @@
130927
131469
  exports.idID = idID;
130928
131470
  exports.imageGroupProps = imageGroupProps;
130929
131471
  exports.imageProps = imageProps;
131472
+ exports.infiniteScrollProps = infiniteScrollProps;
130930
131473
  exports.inputDark = inputDark;
130931
131474
  exports.inputGroupLabelProps = inputGroupLabelProps;
130932
131475
  exports.inputGroupProps = inputGroupProps;
@@ -131087,6 +131630,7 @@
131087
131630
  exports.useThemeVars = useThemeVars;
131088
131631
  exports.version = version;
131089
131632
  exports.viVN = viVN;
131633
+ exports.virtualListProps = virtualListProps;
131090
131634
  exports.watermarkDark = watermarkDark;
131091
131635
  exports.watermarkProps = watermarkProps;
131092
131636
  exports.zhCN = zhCN;