@vtable-guild/vtable-guild 2.8.0 → 2.9.0-alpha.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 (203) hide show
  1. package/css/presets/antdv.css +20 -0
  2. package/css/presets/element-plus.css +20 -0
  3. package/css/style.css +341 -0
  4. package/css/tailwind3-utilities.css +301 -0
  5. package/css/tailwind3.css +40 -0
  6. package/css/tailwind4.css +40 -0
  7. package/dist/core/src/components/Tooltip.d.ts +1 -1
  8. package/dist/core/src/components/Tooltip.d.ts.map +1 -1
  9. package/dist/core/src/components/Tooltip.mjs +49 -46
  10. package/dist/core/src/components/Tooltip.test.d.ts +2 -0
  11. package/dist/core/src/components/Tooltip.test.d.ts.map +1 -0
  12. package/dist/core/src/components/VirtualList/VirtualList.d.ts +3 -3
  13. package/dist/core/src/components/VirtualList/VirtualList.d.ts.map +1 -1
  14. package/dist/core/src/components/VirtualList/VirtualList.mjs +183 -177
  15. package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts +2 -2
  16. package/dist/core/src/components/VirtualList/hooks/useChildren.d.ts.map +1 -1
  17. package/dist/core/src/components/VirtualList/hooks/useChildren.mjs +12 -12
  18. package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts +1 -1
  19. package/dist/core/src/components/VirtualList/hooks/useGetSize.d.ts.map +1 -1
  20. package/dist/core/src/components/VirtualList/hooks/useGetSize.mjs +1 -1
  21. package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts +2 -2
  22. package/dist/core/src/components/VirtualList/hooks/useHeights.d.ts.map +1 -1
  23. package/dist/core/src/components/VirtualList/hooks/useHeights.mjs +36 -36
  24. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.d.ts.map +1 -1
  25. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.mjs +11 -11
  26. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts +2 -0
  27. package/dist/core/src/components/VirtualList/hooks/useMobileTouchMove.test.d.ts.map +1 -0
  28. package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts +1 -1
  29. package/dist/core/src/components/VirtualList/hooks/useScrollTo.d.ts.map +1 -1
  30. package/dist/core/src/components/VirtualList/hooks/useScrollTo.mjs +30 -30
  31. package/dist/core/src/index.d.ts +1 -1
  32. package/dist/core/src/index.d.ts.map +1 -1
  33. package/dist/core/src/utils/types.d.ts +39 -1
  34. package/dist/core/src/utils/types.d.ts.map +1 -1
  35. package/dist/css/presets/antdv.css +20 -0
  36. package/dist/css/presets/element-plus.css +20 -0
  37. package/dist/css/style.css +341 -0
  38. package/dist/css/tailwind3-utilities.css +301 -0
  39. package/dist/css/tailwind3.css +40 -0
  40. package/dist/css/tailwind4.css +40 -0
  41. package/dist/icons/src/ColumnHeightOutlinedIcon.d.ts +3 -0
  42. package/dist/icons/src/ColumnHeightOutlinedIcon.d.ts.map +1 -0
  43. package/dist/icons/src/ColumnHeightOutlinedIcon.mjs +9 -0
  44. package/dist/icons/src/FullscreenExitOutlinedIcon.d.ts +3 -0
  45. package/dist/icons/src/FullscreenExitOutlinedIcon.d.ts.map +1 -0
  46. package/dist/icons/src/FullscreenExitOutlinedIcon.mjs +9 -0
  47. package/dist/icons/src/FullscreenOutlinedIcon.d.ts +3 -0
  48. package/dist/icons/src/FullscreenOutlinedIcon.d.ts.map +1 -0
  49. package/dist/icons/src/FullscreenOutlinedIcon.mjs +9 -0
  50. package/dist/icons/src/ReloadOutlinedIcon.d.ts +3 -0
  51. package/dist/icons/src/ReloadOutlinedIcon.d.ts.map +1 -0
  52. package/dist/icons/src/ReloadOutlinedIcon.mjs +9 -0
  53. package/dist/icons/src/SettingOutlinedIcon.d.ts +3 -0
  54. package/dist/icons/src/SettingOutlinedIcon.d.ts.map +1 -0
  55. package/dist/icons/src/SettingOutlinedIcon.mjs +9 -0
  56. package/dist/icons/src/index.d.ts +5 -0
  57. package/dist/icons/src/index.d.ts.map +1 -1
  58. package/dist/index.d.ts +0 -28
  59. package/dist/index.full.mjs +6070 -4427
  60. package/dist/index.mjs +115 -87
  61. package/dist/table/src/components/FilterDropdown.d.ts +1 -1
  62. package/dist/table/src/components/Table.d.ts +31 -4
  63. package/dist/table/src/components/Table.d.ts.map +1 -1
  64. package/dist/table/src/components/Table.mjs +514 -475
  65. package/dist/table/src/components/TableBody.d.ts.map +1 -1
  66. package/dist/table/src/components/TableBody.mjs +37 -36
  67. package/dist/table/src/components/TableCell.d.ts.map +1 -1
  68. package/dist/table/src/components/TableCell.mjs +95 -83
  69. package/dist/table/src/components/TableColumnSettings.d.ts +41 -0
  70. package/dist/table/src/components/TableColumnSettings.d.ts.map +1 -0
  71. package/dist/table/src/components/TableColumnSettings.mjs +360 -0
  72. package/dist/table/src/components/TableColumnSettings.test.d.ts +2 -0
  73. package/dist/table/src/components/TableColumnSettings.test.d.ts.map +1 -0
  74. package/dist/table/src/components/TableCopyButton.d.ts +41 -0
  75. package/dist/table/src/components/TableCopyButton.d.ts.map +1 -0
  76. package/dist/table/src/components/TableCopyButton.mjs +94 -0
  77. package/dist/table/src/components/TableEnterprise.test.d.ts +2 -0
  78. package/dist/table/src/components/TableEnterprise.test.d.ts.map +1 -0
  79. package/dist/table/src/components/TableHeaderCell.d.ts.map +1 -1
  80. package/dist/table/src/components/TableHeaderCell.mjs +284 -241
  81. package/dist/table/src/components/TableSelectionAlert.d.ts +50 -0
  82. package/dist/table/src/components/TableSelectionAlert.d.ts.map +1 -0
  83. package/dist/table/src/components/TableSelectionAlert.mjs +86 -0
  84. package/dist/table/src/components/TableSelectionAlert.test.d.ts +2 -0
  85. package/dist/table/src/components/TableSelectionAlert.test.d.ts.map +1 -0
  86. package/dist/table/src/components/TableToolbar.d.ts +87 -0
  87. package/dist/table/src/components/TableToolbar.d.ts.map +1 -0
  88. package/dist/table/src/components/TableToolbar.mjs +265 -0
  89. package/dist/table/src/components/TableToolbar.test.d.ts +2 -0
  90. package/dist/table/src/components/TableToolbar.test.d.ts.map +1 -0
  91. package/dist/table/src/components/VTable.vue.d.ts.map +1 -1
  92. package/dist/table/src/components/VTable.vue.mjs +24 -15
  93. package/dist/table/src/components/VTableColumnSettings.vue.d.ts +20 -0
  94. package/dist/table/src/components/VTableColumnSettings.vue.d.ts.map +1 -0
  95. package/dist/table/src/components/VTableColumnSettings.vue.mjs +42 -0
  96. package/dist/table/src/components/VTableColumnSettings.vue2.mjs +4 -0
  97. package/dist/table/src/components/VTableSelectionAlert.vue.d.ts +19 -0
  98. package/dist/table/src/components/VTableSelectionAlert.vue.d.ts.map +1 -0
  99. package/dist/table/src/components/VTableSelectionAlert.vue.mjs +54 -0
  100. package/dist/table/src/components/VTableSelectionAlert.vue2.mjs +4 -0
  101. package/dist/table/src/components/VTableSummary.d.ts +15 -75
  102. package/dist/table/src/components/VTableSummary.d.ts.map +1 -1
  103. package/dist/table/src/components/VTableSummary.mjs +7 -7
  104. package/dist/table/src/components/VTableToolbar.vue.d.ts +27 -0
  105. package/dist/table/src/components/VTableToolbar.vue.d.ts.map +1 -0
  106. package/dist/table/src/components/VTableToolbar.vue.mjs +108 -0
  107. package/dist/table/src/components/VTableToolbar.vue2.mjs +4 -0
  108. package/dist/table/src/components/VirtualTableBody.d.ts.map +1 -1
  109. package/dist/table/src/components/VirtualTableBody.mjs +2 -3
  110. package/dist/table/src/composables/useColumnState.d.ts +32 -0
  111. package/dist/table/src/composables/useColumnState.d.ts.map +1 -0
  112. package/dist/table/src/composables/useColumnState.mjs +107 -0
  113. package/dist/table/src/composables/useColumnState.test.d.ts +2 -0
  114. package/dist/table/src/composables/useColumnState.test.d.ts.map +1 -0
  115. package/dist/table/src/composables/useExpand.d.ts.map +1 -1
  116. package/dist/table/src/composables/useExpand.mjs +28 -30
  117. package/dist/table/src/composables/useFilter.d.ts.map +1 -1
  118. package/dist/table/src/composables/useFilter.mjs +28 -25
  119. package/dist/table/src/composables/usePagination.d.ts +1 -0
  120. package/dist/table/src/composables/usePagination.d.ts.map +1 -1
  121. package/dist/table/src/composables/usePagination.mjs +35 -34
  122. package/dist/table/src/composables/useSelection.d.ts.map +1 -1
  123. package/dist/table/src/composables/useSelection.mjs +136 -126
  124. package/dist/table/src/composables/useTableRequest.d.ts +4 -0
  125. package/dist/table/src/composables/useTableRequest.d.ts.map +1 -0
  126. package/dist/table/src/composables/useTableRequest.mjs +127 -0
  127. package/dist/table/src/composables/useTableRequest.test.d.ts +2 -0
  128. package/dist/table/src/composables/useTableRequest.test.d.ts.map +1 -0
  129. package/dist/table/src/context.d.ts +9 -2
  130. package/dist/table/src/context.d.ts.map +1 -1
  131. package/dist/table/src/index.d.ts +25 -88
  132. package/dist/table/src/index.d.ts.map +1 -1
  133. package/dist/table/src/index.mjs +12 -12
  134. package/dist/table/src/types/column-settings.d.ts +31 -0
  135. package/dist/table/src/types/column-settings.d.ts.map +1 -0
  136. package/dist/table/src/types/column-state.typecheck.d.ts +2 -0
  137. package/dist/table/src/types/column-state.typecheck.d.ts.map +1 -0
  138. package/dist/table/src/types/column.d.ts +15 -3
  139. package/dist/table/src/types/column.d.ts.map +1 -1
  140. package/dist/table/src/types/index.d.ts +2 -0
  141. package/dist/table/src/types/index.d.ts.map +1 -1
  142. package/dist/table/src/types/presentation.d.ts +24 -0
  143. package/dist/table/src/types/presentation.d.ts.map +1 -0
  144. package/dist/table/src/types/request.d.ts +65 -0
  145. package/dist/table/src/types/request.d.ts.map +1 -0
  146. package/dist/table/src/types/request.typecheck.d.ts +13 -0
  147. package/dist/table/src/types/request.typecheck.d.ts.map +1 -0
  148. package/dist/table/src/types/selection-alert.d.ts +30 -0
  149. package/dist/table/src/types/selection-alert.d.ts.map +1 -0
  150. package/dist/table/src/types/selection-alert.typecheck.d.ts +12 -0
  151. package/dist/table/src/types/selection-alert.typecheck.d.ts.map +1 -0
  152. package/dist/table/src/types/table.d.ts +12 -1
  153. package/dist/table/src/types/table.d.ts.map +1 -1
  154. package/dist/table/src/types/toolbar.d.ts +58 -0
  155. package/dist/table/src/types/toolbar.d.ts.map +1 -0
  156. package/dist/table/src/utils/cell.d.ts +4 -0
  157. package/dist/table/src/utils/cell.d.ts.map +1 -1
  158. package/dist/table/src/utils/cell.mjs +49 -45
  159. package/dist/table/src/utils/columnSettings.d.ts +22 -0
  160. package/dist/table/src/utils/columnSettings.d.ts.map +1 -0
  161. package/dist/table/src/utils/columnSettings.mjs +107 -0
  162. package/dist/table/src/utils/columnSettings.test.d.ts +2 -0
  163. package/dist/table/src/utils/columnSettings.test.d.ts.map +1 -0
  164. package/dist/table/src/utils/manual.d.ts +3 -0
  165. package/dist/table/src/utils/manual.d.ts.map +1 -0
  166. package/dist/table/src/utils/manual.mjs +6 -0
  167. package/dist/table/src/utils/valueEnum.d.ts +7 -0
  168. package/dist/table/src/utils/valueEnum.d.ts.map +1 -0
  169. package/dist/table/src/utils/valueEnum.mjs +23 -0
  170. package/dist/theme/src/augment.d.ts +4 -0
  171. package/dist/theme/src/augment.d.ts.map +1 -1
  172. package/dist/theme/src/column-settings.d.ts +160 -0
  173. package/dist/theme/src/column-settings.d.ts.map +1 -0
  174. package/dist/theme/src/column-settings.mjs +84 -0
  175. package/dist/theme/src/index.d.ts +12 -0
  176. package/dist/theme/src/index.d.ts.map +1 -1
  177. package/dist/theme/src/presets/antdv/table-locale.d.ts +10 -0
  178. package/dist/theme/src/presets/antdv/table-locale.d.ts.map +1 -1
  179. package/dist/theme/src/presets/antdv/table-locale.mjs +2 -0
  180. package/dist/theme/src/presets/antdv/table.d.ts +4 -0
  181. package/dist/theme/src/presets/antdv/table.d.ts.map +1 -1
  182. package/dist/theme/src/presets/antdv/table.mjs +4 -0
  183. package/dist/theme/src/presets/element-plus/table-locale.d.ts +10 -0
  184. package/dist/theme/src/presets/element-plus/table-locale.d.ts.map +1 -1
  185. package/dist/theme/src/presets/element-plus/table-locale.mjs +2 -0
  186. package/dist/theme/src/presets/element-plus/table.d.ts +4 -0
  187. package/dist/theme/src/presets/element-plus/table.d.ts.map +1 -1
  188. package/dist/theme/src/presets/element-plus/table.mjs +4 -0
  189. package/dist/theme/src/presets/index.d.ts.map +1 -1
  190. package/dist/theme/src/presets/index.mjs +100 -67
  191. package/dist/theme/src/presets/types.d.ts +3 -0
  192. package/dist/theme/src/presets/types.d.ts.map +1 -1
  193. package/dist/theme/src/selection-alert.d.ts +54 -0
  194. package/dist/theme/src/selection-alert.d.ts.map +1 -0
  195. package/dist/theme/src/selection-alert.mjs +36 -0
  196. package/dist/theme/src/toolbar.d.ts +105 -0
  197. package/dist/theme/src/toolbar.d.ts.map +1 -0
  198. package/dist/theme/src/toolbar.mjs +57 -0
  199. package/dist/vtable-guild/src/augment.d.ts +18 -0
  200. package/dist/vtable-guild/src/augment.d.ts.map +1 -0
  201. package/dist/vtable-guild/src/index.d.ts +1 -0
  202. package/dist/vtable-guild/src/index.d.ts.map +1 -1
  203. package/package.json +4 -3
@@ -1,37 +1,37 @@
1
- import Re from "./Filler.mjs";
2
- import ze from "./hooks/useChildren.mjs";
3
- import Be from "./hooks/useFrameWheel.mjs";
4
- import { useGetSize as Ce } from "./hooks/useGetSize.mjs";
5
- import we from "./hooks/useHeights.mjs";
6
- import Te from "./hooks/useMobileTouchMove.mjs";
7
- import Ve from "./hooks/useScrollDrag.mjs";
8
- import Ie from "./hooks/useScrollTo.mjs";
9
- import oe from "./VirtualScrollBar.mjs";
10
- import { getSpinSize as ue } from "./utils/scrollbarUtil.mjs";
11
- import { PrefixSums as Ae } from "./utils/PrefixSums.mjs";
12
- import { defineComponent as We, computed as y, watch as H, shallowRef as _, ref as u, unref as ke, toRaw as Fe, onBeforeUnmount as Oe, createVNode as D } from "vue";
13
- const re = [], De = {
1
+ import Be from "./Filler.mjs";
2
+ import Ce from "./hooks/useChildren.mjs";
3
+ import Te from "./hooks/useFrameWheel.mjs";
4
+ import { useGetSize as we } from "./hooks/useGetSize.mjs";
5
+ import Ie from "./hooks/useHeights.mjs";
6
+ import Ve from "./hooks/useMobileTouchMove.mjs";
7
+ import Ae from "./hooks/useScrollDrag.mjs";
8
+ import We from "./hooks/useScrollTo.mjs";
9
+ import re from "./VirtualScrollBar.mjs";
10
+ import { getSpinSize as ce } from "./utils/scrollbarUtil.mjs";
11
+ import { PrefixSums as ke } from "./utils/PrefixSums.mjs";
12
+ import { defineComponent as Fe, computed as H, watch as x, shallowRef as q, ref as u, unref as De, toRaw as Ke, onBeforeUnmount as Oe, createVNode as P } from "vue";
13
+ const se = [], Pe = {
14
14
  overflowY: "auto",
15
15
  overflowAnchor: "none"
16
16
  };
17
- function Ke(t) {
17
+ function je(t) {
18
18
  const m = {};
19
19
  for (const h of Object.keys(t))
20
20
  h.startsWith("on") || (m[h] = t[h]);
21
21
  return m;
22
22
  }
23
- function Pe(t, m, h, L) {
24
- let R = t.findIndex(h);
25
- R >= m && (R = 0);
26
- let x = t.findIndex(h + L + 1);
27
- return x >= m && (x = m - 1), x = Math.min(x + 1, m - 1), {
23
+ function Le(t, m, h, $) {
24
+ let z = t.findIndex(h);
25
+ z >= m && (z = 0);
26
+ let M = t.findIndex(h + $ + 1);
27
+ return M >= m && (M = m - 1), M = Math.min(M + 1, m - 1), {
28
28
  scrollHeight: t.total,
29
- start: R,
30
- end: x,
31
- offset: t.offsetOf(R)
29
+ start: z,
30
+ end: M,
31
+ offset: t.offsetOf(z)
32
32
  };
33
33
  }
34
- const Qe = /* @__PURE__ */ We({
34
+ const pe = /* @__PURE__ */ Fe({
35
35
  name: "VirtualList",
36
36
  props: {
37
37
  prefixCls: {
@@ -83,276 +83,282 @@ const Qe = /* @__PURE__ */ We({
83
83
  setup(t, {
84
84
  expose: m,
85
85
  attrs: h,
86
- slots: L
86
+ slots: $
87
87
  }) {
88
- const R = y(() => t.itemHeight);
89
- let x = t.itemKey;
90
- H(() => t.itemKey, (e) => {
91
- x = e;
88
+ const z = H(() => t.itemHeight);
89
+ let M = t.itemKey;
90
+ x(() => t.itemKey, (e) => {
91
+ M = e;
92
92
  });
93
- const V = (e) => {
94
- const l = x;
95
- return typeof l == "function" ? l(e) : e?.[l];
96
- }, [se, q, z, ce] = we(V, void 0, void 0, () => t.disableHeightMeasure), r = _(t?.data || re);
97
- H(() => t.data, () => {
98
- r.value = t?.data || re;
93
+ const I = (e, l) => {
94
+ const a = M;
95
+ return typeof a == "function" ? a(e, l) : e?.[a];
96
+ }, [ve, G, B, fe] = Ie(I, void 0, void 0, () => t.disableHeightMeasure), c = q(t?.data || se);
97
+ x(() => t.data, () => {
98
+ c.value = t?.data || se;
99
99
  });
100
- const A = y(() => !!(t.virtual !== !1 && t.height && t.itemHeight)), s = y(() => {
101
- const e = r.value;
102
- return A.value && e && (t.itemHeight * e.length > t.height || !!t.scrollWidth);
103
- }), M = u(), G = u(), J = u(), K = u(!1), Q = _(), Z = _(), c = u(0), i = u(0), N = u(!1), p = u(0), ee = u(0), d = u(t.scrollWidth || 0), o = u(0), f = u(0), S = u(0), B = u(void 0);
104
- function C(e) {
100
+ const W = H(() => !!(t.virtual !== !1 && t.height && t.itemHeight)), s = H(() => {
101
+ const e = c.value;
102
+ return W.value && e && (t.itemHeight * e.length > t.height || !!t.scrollWidth);
103
+ }), b = u(), J = u(), Q = u(), j = u(!1), Z = q(), p = q(), r = u(0), n = u(0), E = u(!1), ee = u(0), te = u(0), d = u(t.scrollWidth || 0), o = u(0), v = u(0), S = u(0), C = u(void 0);
104
+ function le(e) {
105
+ const l = o.value - t.height;
106
+ return Math.max(0, Math.min(e, l || 0));
107
+ }
108
+ function T(e) {
105
109
  let l;
106
- typeof e == "function" ? l = e(c.value) : l = e;
107
- const a = o.value - t.height, n = Math.max(0, Math.min(l, a || 0));
108
- M.value && (M.value.scrollTop = n), c.value = n;
110
+ typeof e == "function" ? l = e(r.value) : l = e;
111
+ const a = le(l);
112
+ b.value && (b.value.scrollTop = a), r.value = a;
109
113
  }
110
- const W = new Ae();
111
- H([s, A, c, r, ce, () => t.height], ([, , , e, l], a) => {
112
- if (!a)
113
- W.markAllDirty();
114
+ const V = new ke();
115
+ x([s, W, r, c, fe, () => t.height, () => t.itemHeight], ([, , , e, l, , a], i) => {
116
+ if (!i)
117
+ V.markAllDirty();
114
118
  else {
115
- const [, , , b, X] = a;
116
- e !== b ? W.markAllDirty() : l !== X && W.markDirtyFrom(f.value);
119
+ const [, , , y, U, , O] = i;
120
+ e !== y || a !== O ? V.markAllDirty() : l !== U && V.markDirtyFrom(v.value);
117
121
  }
118
- if (!A.value) {
119
- o.value = 0, f.value = 0, S.value = r.value.length - 1, B.value = void 0;
122
+ if (!W.value) {
123
+ o.value = 0, v.value = 0, S.value = c.value.length - 1, C.value = void 0;
120
124
  return;
121
125
  }
122
126
  if (!s.value) {
123
- o.value = G.value?.offsetHeight || 0, f.value = 0, S.value = r.value.length - 1, B.value = void 0;
127
+ o.value = J.value?.offsetHeight || 0, v.value = 0, S.value = c.value.length - 1, C.value = void 0;
124
128
  return;
125
129
  }
126
130
  const {
127
- itemHeight: n,
128
- height: P
129
- } = t, T = r.value.length;
130
- if (!T) {
131
- o.value = 0, f.value = 0, S.value = -1, B.value = 0;
131
+ itemHeight: R,
132
+ height: L
133
+ } = t, K = c.value.length;
134
+ if (!K) {
135
+ o.value = 0, v.value = 0, S.value = -1, C.value = 0;
132
136
  return;
133
137
  }
134
- if (ke(z.id) === 0) {
135
- const b = n, X = P, Y = Math.max(0, Math.floor(c.value / b)), be = Y * b;
136
- let U = Y + Math.ceil(X / b);
137
- U = Math.min(U + 1, T - 1), o.value = T * b, f.value = Y, S.value = U, B.value = be;
138
+ if (De(B.id) === 0) {
139
+ const y = R, U = L, O = Math.max(0, Math.floor(r.value / y)), ze = O * y;
140
+ let _ = O + Math.ceil(U / y);
141
+ _ = Math.min(_ + 1, K - 1), o.value = K * y, v.value = O, S.value = _, C.value = ze;
138
142
  return;
139
143
  }
140
- const Me = Fe(r.value);
141
- W.sync(T, (b) => z.get(V(Me[b])), n);
142
- const j = Pe(W, T, c.value, P);
143
- o.value = j.scrollHeight, f.value = j.start, S.value = j.end, B.value = j.offset;
144
+ const Re = Ke(c.value);
145
+ V.sync(K, (y) => B.get(I(Re[y], y)), R);
146
+ const N = Le(V, K, r.value, L);
147
+ o.value = N.scrollHeight, v.value = N.start, S.value = N.end, C.value = N.offset;
144
148
  }, {
145
149
  immediate: !0
146
- }), H(o, () => {
147
- const e = z.getRecord();
150
+ }), x(o, () => {
151
+ const e = B.getRecord();
148
152
  if (e.size === 1) {
149
- const l = Array.from(e.keys())[0], a = e.get(l), n = r.value[f.value];
150
- if (n && a === void 0 && V(n) === l) {
151
- const P = z.get(l) - t.itemHeight;
152
- C((T) => T + P);
153
+ const l = Array.from(e.keys())[0], a = e.get(l), i = c.value[v.value];
154
+ if (i && a === void 0 && I(i, v.value) === l) {
155
+ const R = B.get(l) - t.itemHeight;
156
+ T((L) => L + R);
153
157
  }
154
158
  }
155
- if (A.value && t.height) {
159
+ if (W.value && t.height) {
156
160
  const l = Math.max(0, o.value - t.height);
157
- c.value > l && C(l);
161
+ r.value > l && T(l);
158
162
  }
159
- z.resetRecord();
163
+ B.resetRecord();
160
164
  });
161
165
  const g = u({
162
166
  width: 0,
163
167
  height: t.height || 0
164
168
  });
165
169
  let w = null, k = null;
166
- const ve = (e) => {
170
+ const he = (e) => {
167
171
  k !== e && (w && k && w.unobserve(k), k = e, e && (w || (w = new ResizeObserver((l) => {
168
172
  const a = l[0];
169
173
  if (a) {
170
- const n = a.target;
174
+ const i = a.target;
171
175
  g.value = {
172
- width: n.offsetWidth,
173
- height: n.offsetHeight
174
- }, d.value = t.scrollWidth ?? n.offsetWidth;
176
+ width: i.offsetWidth,
177
+ height: i.offsetHeight
178
+ }, d.value = t.scrollWidth ?? i.offsetWidth;
175
179
  }
176
180
  })), w.observe(e)));
177
181
  };
178
182
  Oe(() => {
179
183
  w?.disconnect(), w = null, k = null;
180
184
  });
181
- const v = y(() => t.direction === "rtl"), $ = () => ({
182
- x: v.value ? -i.value : i.value,
183
- y: c.value
184
- }), E = u($()), F = (e, l = !1) => {
185
+ const f = H(() => t.direction === "rtl"), X = () => ({
186
+ x: f.value ? -n.value : n.value,
187
+ y: r.value
188
+ }), Y = u(X()), F = (e, l = !1) => {
185
189
  if (t.onVirtualScroll) {
186
190
  const a = {
187
- ...$(),
191
+ ...X(),
188
192
  ...e
189
193
  };
190
- (l || E.value.x !== a.x || E.value.y !== a.y) && (t.onVirtualScroll(a), E.value = a);
194
+ (l || Y.value.x !== a.x || Y.value.y !== a.y) && (t.onVirtualScroll(a), Y.value = a);
191
195
  }
192
- }, I = y(() => Math.max(0, (d.value || 0) - g.value.width)), fe = y(() => c.value === 0), he = y(() => c.value + t.height >= o.value), de = y(() => i.value === 0), ge = y(() => i.value >= I.value), O = (e) => Math.max(0, Math.min(e, I.value));
193
- H(I, () => {
194
- i.value = O(i.value), F(void 0, !0);
196
+ }, A = H(() => Math.max(0, (d.value || 0) - g.value.width)), de = H(() => r.value === 0), ge = H(() => r.value + t.height >= o.value), me = H(() => n.value === 0), Se = H(() => n.value >= A.value), D = (e) => Math.max(0, Math.min(e, A.value));
197
+ x(A, () => {
198
+ n.value = D(n.value), F(void 0, !0);
195
199
  }, {
196
200
  flush: "post"
197
201
  });
198
- const te = () => {
199
- Q.value?.delayHidden(), Z.value?.delayHidden();
200
- }, [me] = Be(s, fe, he, de, ge, I.value > 0, (e, l) => {
202
+ const ae = () => {
203
+ Z.value?.delayHidden(), p.value?.delayHidden();
204
+ }, [ye] = Te(s, de, ge, me, Se, A.value > 0, (e, l) => {
201
205
  if (l) {
202
- const a = O(v.value ? i.value - e : i.value + e);
203
- i.value = a, F({
204
- x: v.value ? -a : a
206
+ const a = D(f.value ? n.value - e : n.value + e);
207
+ n.value = a, F({
208
+ x: f.value ? -a : a
205
209
  });
206
210
  } else
207
- C((a) => a + e);
211
+ T((a) => a + e);
208
212
  });
209
- Te(s, M, (e, l) => {
213
+ Ve(s, b, (e, l, a) => {
210
214
  if (e) {
211
- const a = O(v.value ? i.value - l : i.value + l);
212
- return i.value = a, F({
213
- x: v.value ? -a : a
214
- }), !0;
215
- } else
216
- return C((a) => a + l), !0;
217
- }), Ve(s, M, (e) => {
218
- C((l) => l + e);
215
+ const i = D(f.value ? n.value - l : n.value + l), R = i !== n.value;
216
+ return n.value = i, F({
217
+ x: f.value ? -i : i
218
+ }), a ? R : !0;
219
+ } else {
220
+ const i = le(r.value + l) !== r.value;
221
+ return T((R) => R + l), a ? i : !0;
222
+ }
223
+ }), Ae(s, b, (e) => {
224
+ T((l) => l + e);
219
225
  });
220
- const le = (e, l) => {
221
- l ? (i.value = e, F({
222
- x: v.value ? -e : e
223
- })) : C(e);
224
- }, ae = () => {
225
- N.value = !0;
226
- }, ie = () => {
227
- N.value = !1;
226
+ const ie = (e, l) => {
227
+ l ? (n.value = e, F({
228
+ x: f.value ? -e : e
229
+ })) : T(e);
230
+ }, ne = () => {
231
+ E.value = !0;
232
+ }, oe = () => {
233
+ E.value = !1;
228
234
  };
229
- H([() => t.height, o, s, () => g.value.height], () => {
230
- s.value && t.height && o.value && (p.value = ue(g.value.height, o.value));
235
+ x([() => t.height, o, s, () => g.value.height], () => {
236
+ s.value && t.height && o.value && (ee.value = ce(g.value.height, o.value));
231
237
  }, {
232
238
  immediate: !0
233
- }), H([() => g.value.width, d], () => {
234
- s.value && d.value && (ee.value = ue(g.value.width, d.value));
239
+ }), x([() => g.value.width, d], () => {
240
+ s.value && d.value && (te.value = ce(g.value.width, d.value));
235
241
  }, {
236
242
  immediate: !0
237
- }), H(() => t.scrollWidth, (e) => {
238
- d.value = e ?? g.value.width, i.value = O(i.value);
243
+ }), x(() => t.scrollWidth, (e) => {
244
+ d.value = e ?? g.value.width, n.value = D(n.value);
239
245
  }, {
240
246
  immediate: !0
241
247
  });
242
- function Se(e) {
248
+ function He(e) {
243
249
  const l = e.currentTarget.scrollTop;
244
- !A.value || !s.value ? c.value = l : l !== c.value && C(l), t.onScroll?.(e), F();
250
+ !W.value || !s.value ? r.value = l : l !== r.value && T(l), t.onScroll?.(e), F();
245
251
  }
246
- const [ne, ye] = Ie(M, r, z, R, V, () => q(!0), (e) => {
247
- const l = ye(), a = Math.max(o.value, l) - t.height, n = Math.max(0, Math.min(e, a || 0));
248
- M.value && (M.value.scrollTop = n), c.value = n;
249
- }, te, () => t.disableHeightMeasure);
252
+ const [ue, xe] = We(b, c, B, z, I, () => G(!0), (e) => {
253
+ const l = xe(), a = Math.max(o.value, l) - t.height, i = Math.max(0, Math.min(e, a || 0));
254
+ b.value && (b.value.scrollTop = i), r.value = i;
255
+ }, ae, () => t.disableHeightMeasure);
250
256
  m({
251
- nativeElement: J,
252
- getScrollInfo: $,
253
- getHorizontalRange: () => I.value,
257
+ nativeElement: Q,
258
+ getScrollInfo: X,
259
+ getHorizontalRange: () => A.value,
254
260
  scrollTo: (e) => {
255
261
  function l(a) {
256
262
  return a && typeof a == "object" && ("left" in a || "top" in a);
257
263
  }
258
- l(e) ? (e.left !== void 0 && (i.value = O(e.left)), ne(e.top)) : ne(e);
264
+ l(e) ? (e.left !== void 0 && (n.value = D(e.left)), ue(e.top)) : ue(e);
259
265
  }
260
- }), H([f, S, r], () => {
266
+ }), x([v, S, c], () => {
261
267
  if (t.onVisibleChange) {
262
- const e = r.value.slice(f.value, S.value + 1);
263
- t.onVisibleChange(e, r.value);
268
+ const e = c.value.slice(v.value, S.value + 1);
269
+ t.onVisibleChange(e, c.value);
264
270
  }
265
271
  }, {
266
272
  flush: "post"
267
273
  });
268
- const He = Ce(r, V, z, R), xe = ze(r, f, S, d, i, se, (e, l, a) => L.default?.({
274
+ const Me = we(c, I, B, z), be = Ce(c, v, S, d, n, ve, (e, l, a) => $.default?.({
269
275
  item: e,
270
276
  index: l,
271
277
  ...a
272
278
  }), {
273
- getKey: V
279
+ getKey: I
274
280
  });
275
281
  return () => {
276
282
  const e = {};
277
- t.height && (e[t.fullHeight ? "height" : "maxHeight"] = `${t.height}px`, Object.assign(e, De), s.value && (e.overflowY = "hidden", I.value > 0 && (e.overflowX = "hidden"), N.value && (e.pointerEvents = "none")));
283
+ t.height && (e[t.fullHeight ? "height" : "maxHeight"] = `${t.height}px`, Object.assign(e, Pe), s.value && (e.overflowY = "hidden", A.value > 0 && (e.overflowX = "hidden"), E.value && (e.pointerEvents = "none")));
278
284
  const l = t.extraRender?.({
279
- start: f.value,
285
+ start: v.value,
280
286
  end: S.value,
281
287
  virtual: s.value,
282
- offsetX: i.value,
283
- offsetY: B.value || 0,
284
- rtl: v.value,
285
- getSize: He
288
+ offsetX: n.value,
289
+ offsetY: C.value || 0,
290
+ rtl: f.value,
291
+ getSize: Me
286
292
  }), a = t.component;
287
- return D("div", {
288
- ref: J,
289
- ...Ke(h),
293
+ return P("div", {
294
+ ref: Q,
295
+ ...je(h),
290
296
  style: {
291
297
  position: "relative",
292
298
  ...h.style
293
299
  },
294
- dir: v.value ? "rtl" : void 0,
300
+ dir: f.value ? "rtl" : void 0,
295
301
  class: [t.prefixCls, {
296
- [`${t.prefixCls}-rtl`]: v.value
302
+ [`${t.prefixCls}-rtl`]: f.value
297
303
  }, h.class],
298
304
  onMouseenter: () => {
299
- K.value = !0;
305
+ j.value = !0;
300
306
  },
301
307
  onMouseleave: () => {
302
- K.value = !1;
308
+ j.value = !1;
303
309
  }
304
- }, [D(a, {
310
+ }, [P(a, {
305
311
  class: [`${t.prefixCls}-holder`, t.holderClass],
306
312
  style: e,
307
- ref: (n) => {
308
- M.value = n?.$el ?? n, ve(n?.$el ?? n);
313
+ ref: (i) => {
314
+ b.value = i?.$el ?? i, he(i?.$el ?? i);
309
315
  },
310
- onScroll: Se,
311
- onWheel: me,
312
- onMouseenter: te
316
+ onScroll: He,
317
+ onWheel: ye,
318
+ onMouseenter: ae
313
319
  }, {
314
- default: () => [D(Re, {
320
+ default: () => [P(Be, {
315
321
  prefixCls: t.prefixCls,
316
322
  height: o.value,
317
- offsetX: i.value,
318
- offsetY: B.value,
323
+ offsetX: n.value,
324
+ offsetY: C.value,
319
325
  scrollWidth: d.value,
320
- onInnerResize: q,
321
- ref: G,
326
+ onInnerResize: G,
327
+ ref: J,
322
328
  innerProps: t.innerProps,
323
- rtl: v.value,
329
+ rtl: f.value,
324
330
  extra: l
325
331
  }, {
326
- default: () => [xe.value]
332
+ default: () => [be.value]
327
333
  })]
328
- }), s.value && o.value > (t.height || 0) && D(oe, {
329
- ref: Q,
334
+ }), s.value && o.value > (t.height || 0) && P(re, {
335
+ ref: Z,
330
336
  prefixCls: t.prefixCls,
331
- scrollOffset: c.value,
337
+ scrollOffset: r.value,
332
338
  scrollRange: o.value,
333
- rtl: v.value,
334
- onScroll: le,
335
- onStartMove: ae,
336
- onStopMove: ie,
337
- spinSize: p.value,
339
+ rtl: f.value,
340
+ onScroll: ie,
341
+ onStartMove: ne,
342
+ onStopMove: oe,
343
+ spinSize: ee.value,
338
344
  containerSize: g.value.height,
339
- active: K.value,
345
+ active: j.value,
340
346
  showScrollBar: t.showScrollBar,
341
347
  style: t.styles?.verticalScrollBar,
342
348
  thumbStyle: t.styles?.verticalScrollBarThumb
343
- }), s.value && d.value > g.value.width && D(oe, {
344
- ref: Z,
349
+ }), s.value && d.value > g.value.width && P(re, {
350
+ ref: p,
345
351
  prefixCls: t.prefixCls,
346
- scrollOffset: i.value,
352
+ scrollOffset: n.value,
347
353
  scrollRange: d.value,
348
- rtl: v.value,
349
- onScroll: le,
350
- onStartMove: ae,
351
- onStopMove: ie,
352
- spinSize: ee.value,
354
+ rtl: f.value,
355
+ onScroll: ie,
356
+ onStartMove: ne,
357
+ onStopMove: oe,
358
+ spinSize: te.value,
353
359
  containerSize: g.value.width,
354
360
  horizontal: !0,
355
- active: K.value,
361
+ active: j.value,
356
362
  showScrollBar: t.showScrollBar,
357
363
  style: t.styles?.horizontalScrollBar,
358
364
  thumbStyle: t.styles?.horizontalScrollBarThumb
@@ -361,5 +367,5 @@ const Qe = /* @__PURE__ */ We({
361
367
  }
362
368
  });
363
369
  export {
364
- Qe as default
370
+ pe as default
365
371
  };
@@ -1,10 +1,10 @@
1
1
  import { CSSProperties, Ref, VNode } from 'vue';
2
2
  import { Key } from '../interface';
3
- export default function useChildren(list: Ref<any[]>, startIndex: Ref<number>, endIndex: Ref<number>, scrollWidth: Ref<number>, offsetX: Ref<number>, setNodeRef: (item: any, ele: HTMLElement | null) => void, renderFunc: (item: any, index: number, props: {
3
+ export default function useChildren(list: Ref<any[]>, startIndex: Ref<number>, endIndex: Ref<number>, scrollWidth: Ref<number>, offsetX: Ref<number>, setNodeRef: (item: any, ele: HTMLElement | null, index?: number) => void, renderFunc: (item: any, index: number, props: {
4
4
  style: CSSProperties;
5
5
  offsetX: number;
6
6
  }) => VNode[] | undefined, { getKey }: {
7
- getKey: (item: any) => Key;
7
+ getKey: (item: any, index?: number) => Key;
8
8
  }): import('vue').ComputedRef<VNode<import('vue').RendererNode, import('vue').RendererElement, {
9
9
  [key: string]: any;
10
10
  }>[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"useChildren.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useChildren.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AASvC,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,EACxD,UAAU,EAAE,CACV,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,KAC7C,KAAK,EAAE,GAAG,SAAS,EACxB,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE;;MAwB3C"}
1
+ {"version":3,"file":"useChildren.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useChildren.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AASvC,MAAM,CAAC,OAAO,UAAU,WAAW,CACjC,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,EACxB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EAGpB,UAAU,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,EACxE,UAAU,EAAE,CACV,IAAI,EAAE,GAAG,EACT,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,KAC7C,KAAK,EAAE,GAAG,SAAS,EACxB,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,CAAA;CAAE;;MAyB3D"}
@@ -1,17 +1,17 @@
1
- import s from "../Item.mjs";
2
- import { computed as v, createVNode as m, isVNode as y } from "vue";
3
- function b(e) {
1
+ import v from "../Item.mjs";
2
+ import { computed as m, createVNode as b, isVNode as y } from "vue";
3
+ function j(e) {
4
4
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !y(e);
5
5
  }
6
- function N(e, u, r, l, n, c, a, { getKey: f }) {
7
- return v(() => e.value.slice(u.value, r.value + 1).map((t, i) => {
8
- const o = a(t, u.value + i, {
6
+ function N(e, n, r, l, c, a, f, { getKey: i }) {
7
+ return m(() => e.value.slice(n.value, r.value + 1).map((t, p) => {
8
+ const o = n.value + p, u = f(t, o, {
9
9
  style: { width: `${l.value}px` },
10
- offsetX: n.value
11
- }), p = f(t);
12
- return m(
13
- s,
14
- { key: p, setRef: (d) => c(t, d) },
10
+ offsetX: c.value
11
+ }), s = i(t, o);
12
+ return b(
13
+ v,
14
+ { key: s, setRef: (d) => a(t, d, o) },
15
15
  // `renderFunc` 返回的已经是 VNode[],这里**不能再包一层数组**。
16
16
  // 包成 [[VNode]] 之后 Vue 的 normalizeSlotValue 会把内层数组转成 Fragment,
17
17
  // Item 的 cloneVNode(child, { ref }) 于是把 ref 挂到 Fragment 上——
@@ -19,7 +19,7 @@ function N(e, u, r, l, n, c, a, { getKey: f }) {
19
19
  // useHeights.getElement() 拿到 Text 就返回 null,行高**永远测不到**:
20
20
  // heights.id 恒为 0,可视区计算一直走估算分支,scrollHeight 恒等于
21
21
  // 行数 × itemHeight。行实际比估算高时,末尾几行落在可滚动范围之外。
22
- b(o) ? o : { default: () => o ?? [] }
22
+ j(u) ? u : { default: () => u ?? [] }
23
23
  );
24
24
  }));
25
25
  }
@@ -1,5 +1,5 @@
1
1
  import { ComputedRef, Ref } from 'vue';
2
2
  import { default as CacheMap } from '../utils/CacheMap';
3
3
  import { GetSize, Key } from '../interface';
4
- export declare function useGetSize(mergedData: Ref<any[]>, getKey: (item: any) => Key, heights: CacheMap, itemHeight: ComputedRef<number | undefined>): GetSize;
4
+ export declare function useGetSize(mergedData: Ref<any[]>, getKey: (item: any, index?: number) => Key, heights: CacheMap, itemHeight: ComputedRef<number | undefined>): GetSize;
5
5
  //# sourceMappingURL=useGetSize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGetSize.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useGetSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEhD,wBAAgB,UAAU,CACxB,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,EAC1B,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,GAC1C,OAAO,CAqCT"}
1
+ {"version":3,"file":"useGetSize.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useGetSize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAA;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAEhD,wBAAgB,UAAU,CACxB,UAAU,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,EAC1C,OAAO,EAAE,QAAQ,EACjB,UAAU,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,GAC1C,OAAO,CAqCT"}
@@ -8,7 +8,7 @@ function k(c, a, v, d) {
8
8
  if (n === void 0 || i === void 0) {
9
9
  const r = c.value.length;
10
10
  for (let e = t.length; e < r; e += 1) {
11
- const s = c.value[e], l = a(s);
11
+ const s = c.value[e], l = a(s, e);
12
12
  o.set(l, e);
13
13
  const p = v.get(l) ?? d.value ?? 0;
14
14
  if (t[e] = (t[e - 1] || 0) + p, l === u && (n = e), l === f && (i = e), n !== void 0 && i !== void 0) break;
@@ -7,8 +7,8 @@ import { ref } from 'vue';
7
7
  * 于是 `heights.id` 恒为 0,VirtualList 的可视区计算永远走 O(1) 的估算分支,
8
8
  * 不再每次滚动重建整表前缀和。代价是行高必须真的等于声明值(调用方负责校验)。
9
9
  */
10
- export default function useHeights(getKey: (item: any) => Key, onItemAdd?: (item: any) => void, onItemRemove?: (item: any) => void, disabled?: () => boolean): [
11
- setInstanceRef: (item: any, instance: HTMLElement | null) => void,
10
+ export default function useHeights(getKey: (item: any, index?: number) => Key, onItemAdd?: (item: any) => void, onItemRemove?: (item: any) => void, disabled?: () => boolean): [
11
+ setInstanceRef: (item: any, instance: HTMLElement | null, index?: number) => void,
12
12
  collectHeight: (sync?: boolean) => void,
13
13
  heights: CacheMap,
14
14
  updatedMark: ReturnType<typeof ref<number>>
@@ -1 +1 @@
1
- {"version":3,"file":"useHeights.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useHeights.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAwB,GAAG,EAAE,MAAM,KAAK,CAAA;AA+B/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,EAC1B,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAClC,QAAQ,CAAC,EAAE,MAAM,OAAO,GACvB;IACD,cAAc,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI;IACjE,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI;IACvC,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5C,CAoGA"}
1
+ {"version":3,"file":"useHeights.d.ts","sourceRoot":"","sources":["../../../../../../../core/src/components/VirtualList/hooks/useHeights.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,mBAAmB,CAAA;AACxC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAwB,GAAG,EAAE,MAAM,KAAK,CAAA;AA+B/C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,MAAM,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,GAAG,EAC1C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAC/B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,EAClC,QAAQ,CAAC,EAAE,MAAM,OAAO,GACvB;IACD,cAAc,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI;IACjF,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI;IACvC,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,UAAU,CAAC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC;CAC5C,CAoGA"}