@glhrmoura/vue-virtualize 0.1.4 → 0.1.5

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.
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { shallowRef as Me, ref as L, toValue as o, watch as ve, onBeforeUnmount as Se, computed as O, defineComponent as ie, openBlock as T, createBlock as q, resolveDynamicComponent as U, normalizeStyle as F, withCtx as Z, renderSlot as j, createElementBlock as V, Fragment as W, renderList as _, unref as K, mergeProps as ne, createElementVNode as le, toDisplayString as ue, createTextVNode as Re } from "vue";
1
+ import { shallowRef as Me, ref as L, toValue as o, watch as ge, onBeforeUnmount as ve, computed as R, defineComponent as ie, openBlock as T, createBlock as Y, resolveDynamicComponent as q, normalizeStyle as F, withCtx as U, renderSlot as G, createElementBlock as $, Fragment as D, renderList as P, unref as K, mergeProps as ne, createElementVNode as ue, toDisplayString as ce, createTextVNode as Oe } from "vue";
2
2
  function ee(e) {
3
3
  return !Number.isFinite(e) || e < 0 ? 0 : e;
4
4
  }
5
- class Te {
5
+ class Re {
6
6
  sizes = /* @__PURE__ */ new Map();
7
7
  divergent = !1;
8
8
  get(t) {
@@ -30,45 +30,45 @@ class Te {
30
30
  }
31
31
  }
32
32
  }
33
- function ze(e, t, i) {
33
+ function Se(e, t, i) {
34
34
  return Math.min(i, Math.max(t, e));
35
35
  }
36
- const Ee = 16777216;
37
- function B(e, t, i) {
36
+ const Te = 16777216;
37
+ function H(e, t, i) {
38
38
  const n = Math.max(0, t - Math.max(0, i));
39
- return ze(Number.isFinite(e) ? e : 0, 0, n);
39
+ return Se(Number.isFinite(e) ? e : 0, 0, n);
40
40
  }
41
- function G(e, t) {
42
- const i = Math.max(0, Number.isFinite(e) ? e : 0), n = Math.min(i, Ee);
41
+ function N(e, t) {
42
+ const i = Math.max(0, Number.isFinite(e) ? e : 0), n = Math.min(i, Te);
43
43
  return t === void 0 || !Number.isFinite(t) || t <= 0 ? n : Math.min(n, t);
44
44
  }
45
- function Ce(e, t, i, n) {
45
+ function Ee(e, t, i, n) {
46
46
  const r = Math.max(0, t - Math.max(0, n)), s = Math.max(0, i - Math.max(0, n));
47
- return r <= 0 ? 0 : s <= 0 || s >= r ? B(e, t, n) : Math.max(0, e) / s * r;
47
+ return r <= 0 ? 0 : s <= 0 || s >= r ? H(e, t, n) : Math.max(0, e) / s * r;
48
48
  }
49
49
  function ke(e, t, i, n) {
50
50
  const r = Math.max(0, t - Math.max(0, n)), s = Math.max(0, i - Math.max(0, n));
51
- return s <= 0 ? 0 : r <= 0 || s >= r ? B(e, t, n) : B(e, t, n) / r * s;
51
+ return s <= 0 ? 0 : r <= 0 || s >= r ? H(e, t, n) : H(e, t, n) / r * s;
52
52
  }
53
- function Ve(e, t, i) {
53
+ function Ce(e, t, i) {
54
54
  if (e <= 0) return 0;
55
55
  let n = 0, r = e - 1, s = e - 1;
56
56
  for (; n <= r; ) {
57
- const d = n + r >>> 1;
58
- i(d) > t ? (s = d, r = d - 1) : n = d + 1;
57
+ const u = n + r >>> 1;
58
+ i(u) > t ? (s = u, r = u - 1) : n = u + 1;
59
59
  }
60
60
  return s;
61
61
  }
62
- function Ae(e, t, i) {
62
+ function $e(e, t, i) {
63
63
  if (e <= 0) return 0;
64
64
  let n = 0, r = e - 1, s = 0;
65
65
  for (; n <= r; ) {
66
- const d = n + r >>> 1;
67
- i(d) < t ? (s = d, n = d + 1) : r = d - 1;
66
+ const u = n + r >>> 1;
67
+ i(u) < t ? (s = u, n = u + 1) : r = u - 1;
68
68
  }
69
69
  return s;
70
70
  }
71
- function $e(e) {
71
+ function Ve(e) {
72
72
  const t = e.start + e.size;
73
73
  let i = e.align;
74
74
  if (i === "auto") {
@@ -78,7 +78,7 @@ function $e(e) {
78
78
  }
79
79
  return i === "center" ? e.start - (e.viewport - e.size) / 2 : i === "end" ? t - e.viewport : e.start;
80
80
  }
81
- class Fe {
81
+ class Ae {
82
82
  count = 0;
83
83
  estimateSize = () => 0;
84
84
  overscan = 0;
@@ -90,14 +90,14 @@ class Fe {
90
90
  viewportSize = 0;
91
91
  scrollOffset = 0;
92
92
  getItemKey = (t) => t;
93
- measurements = new Te();
93
+ measurements = new Re();
94
94
  built = 0;
95
95
  offsets = [];
96
96
  laneCursor = [];
97
97
  laneEnd = [];
98
98
  setOptions(t) {
99
- const i = Math.max(1, Math.floor(t.lanes ?? 1)), n = t.gap ?? 0, r = t.paddingStart ?? 0, s = t.paddingEnd ?? 0, d = Math.max(0, Math.floor(t.count)), p = t.itemSize === void 0 || t.itemSize === null ? null : ee(t.itemSize), w = this.itemSize, I = i !== this.lanes || n !== this.gap || r !== this.paddingStart || s !== this.paddingEnd || t.estimateSize !== this.estimateSize || p !== this.itemSize;
100
- this.count = d, this.lanes = i, this.gap = n, this.paddingStart = r, this.paddingEnd = s, this.overscan = Math.max(0, Math.floor(t.overscan ?? 0)), this.estimateSize = t.estimateSize, this.itemSize = p, this.getItemKey = t.getItemKey ?? ((y) => y), t.viewportSize !== void 0 && (this.viewportSize = Math.max(0, t.viewportSize)), p !== w && this.measurements.clear(), this.measurements.trim(this.count, this.itemSize), (I || this.built > this.count) && this.resetGeometry();
99
+ const i = Math.max(1, Math.floor(t.lanes ?? 1)), n = t.gap ?? 0, r = t.paddingStart ?? 0, s = t.paddingEnd ?? 0, u = Math.max(0, Math.floor(t.count)), p = t.itemSize === void 0 || t.itemSize === null ? null : ee(t.itemSize), x = this.itemSize, I = i !== this.lanes || n !== this.gap || r !== this.paddingStart || s !== this.paddingEnd || t.estimateSize !== this.estimateSize || p !== this.itemSize;
100
+ this.count = u, this.lanes = i, this.gap = n, this.paddingStart = r, this.paddingEnd = s, this.overscan = Math.max(0, Math.floor(t.overscan ?? 0)), this.estimateSize = t.estimateSize, this.itemSize = p, this.getItemKey = t.getItemKey ?? ((w) => w), t.viewportSize !== void 0 && (this.viewportSize = Math.max(0, t.viewportSize)), p !== x && this.measurements.clear(), this.measurements.trim(this.count, this.itemSize), (I || this.built > this.count) && this.resetGeometry();
101
101
  }
102
102
  setScrollOffset(t) {
103
103
  this.scrollOffset = Number.isFinite(t) ? t : 0;
@@ -137,8 +137,8 @@ class Fe {
137
137
  let i = this.paddingStart;
138
138
  const n = this.itemSize ?? 0;
139
139
  for (let r = 0; r < this.lanes && r < this.count; r += 1) {
140
- const s = this.laneLength(r), d = this.paddingStart + s * n + Math.max(0, s - 1) * this.gap;
141
- d > i && (i = d);
140
+ const s = this.laneLength(r), u = this.paddingStart + s * n + Math.max(0, s - 1) * this.gap;
141
+ u > i && (i = u);
142
142
  }
143
143
  return i + this.paddingEnd;
144
144
  }
@@ -152,26 +152,26 @@ class Fe {
152
152
  }
153
153
  getVirtualItems() {
154
154
  if (this.count <= 0 || this.viewportSize <= 0) return [];
155
- const t = B(this.scrollOffset, this.getTotalSize(), this.viewportSize), i = t + this.viewportSize, n = [];
155
+ const t = H(this.scrollOffset, this.getTotalSize(), this.viewportSize), i = t + this.viewportSize, n = [];
156
156
  for (let r = 0; r < this.lanes; r += 1) {
157
157
  const s = this.laneLength(r);
158
158
  if (s <= 0) continue;
159
- const d = Ve(s, t, (y) => {
160
- const b = this.ordinalIndex(r, y);
159
+ const u = Ce(s, t, (w) => {
160
+ const b = this.ordinalIndex(r, w);
161
161
  return this.getItemOffset(b) + this.getItemSize(b);
162
- }), p = Ae(
162
+ }), p = $e(
163
163
  s,
164
164
  i,
165
- (y) => this.getItemOffset(this.ordinalIndex(r, y))
166
- ), w = Math.max(0, Math.min(d, p) - this.overscan), I = Math.min(s - 1, Math.max(d, p) + this.overscan);
167
- for (let y = w; y <= I; y += 1) {
168
- const b = this.ordinalIndex(r, y), E = this.getItemOffset(b), C = this.getItemSize(b);
165
+ (w) => this.getItemOffset(this.ordinalIndex(r, w))
166
+ ), x = Math.max(0, Math.min(u, p) - this.overscan), I = Math.min(s - 1, Math.max(u, p) + this.overscan);
167
+ for (let w = x; w <= I; w += 1) {
168
+ const b = this.ordinalIndex(r, w), E = this.getItemOffset(b), k = this.getItemSize(b);
169
169
  n.push({
170
170
  index: b,
171
171
  key: this.getItemKey(b),
172
172
  start: E,
173
- size: C,
174
- end: E + C,
173
+ size: k,
174
+ end: E + k,
175
175
  lane: r
176
176
  });
177
177
  }
@@ -180,14 +180,14 @@ class Fe {
180
180
  }
181
181
  getOffsetForIndex(t, i = "auto") {
182
182
  if (this.count <= 0) return 0;
183
- const n = ze(t, 0, this.count - 1), r = this.getItemOffset(n), s = this.getItemSize(n), d = $e({
183
+ const n = Se(t, 0, this.count - 1), r = this.getItemOffset(n), s = this.getItemSize(n), u = Ve({
184
184
  start: r,
185
185
  size: s,
186
186
  viewport: this.viewportSize,
187
187
  current: this.scrollOffset,
188
188
  align: i
189
189
  });
190
- return B(d, this.getTotalSize(), this.viewportSize);
190
+ return H(u, this.getTotalSize(), this.viewportSize);
191
191
  }
192
192
  usesFixedPath() {
193
193
  return this.itemSize !== null && !this.measurements.hasDivergent;
@@ -212,13 +212,13 @@ class Fe {
212
212
  this.built = 0, this.offsets = [], this.laneCursor = Array.from({ length: this.lanes }, () => this.paddingStart), this.laneEnd = Array.from({ length: this.lanes }, () => this.paddingStart);
213
213
  }
214
214
  }
215
- function D() {
215
+ function Z() {
216
216
  return typeof window < "u" && typeof document < "u";
217
217
  }
218
- function ye(e) {
218
+ function ze(e) {
219
219
  return typeof Element > "u" ? null : e instanceof Element ? e : null;
220
220
  }
221
- function Ke(e, t, i, n) {
221
+ function Fe(e, t, i, n) {
222
222
  if (n === "smooth" && typeof e.scrollTo == "function") {
223
223
  e.scrollTo({
224
224
  top: i ? e.scrollTop : t,
@@ -229,22 +229,22 @@ function Ke(e, t, i, n) {
229
229
  }
230
230
  i ? e.scrollLeft = t : e.scrollTop = t;
231
231
  }
232
- function ce(e, t) {
232
+ function fe(e, t) {
233
233
  return t ? e.scrollLeft : e.scrollTop;
234
234
  }
235
- function fe(e, t) {
235
+ function de(e, t) {
236
236
  return t ? e.clientWidth : e.clientHeight;
237
237
  }
238
- function Le(e, t) {
238
+ function Ke(e, t) {
239
239
  return t ? e.scrollWidth : e.scrollHeight;
240
240
  }
241
- function de(e) {
241
+ function Le(e) {
242
242
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : setTimeout(e, 0);
243
243
  }
244
- function he(e) {
244
+ function je(e) {
245
245
  e && (typeof cancelAnimationFrame == "function" ? cancelAnimationFrame(e) : clearTimeout(e));
246
246
  }
247
- function je(e, t) {
247
+ function Ge(e, t) {
248
248
  if (e.length !== t.length) return !1;
249
249
  for (let i = 0; i < e.length; i += 1) {
250
250
  const n = e[i], r = t[i];
@@ -254,127 +254,130 @@ function je(e, t) {
254
254
  return !0;
255
255
  }
256
256
  function te(e) {
257
- const t = new Fe(), i = Me([]), n = L(0), r = L(0), s = L(0), d = L(!1), p = (a) => e.estimateSize(a);
258
- let w = null, I = null, y = null, b = 0, E = 0, C = 0, u = o(e.revision);
259
- const c = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), l = [];
260
- function S() {
257
+ const t = new Ae(), i = Me([]), n = L(0), r = L(0), s = L(0), u = L(!1), p = (a) => e.estimateSize(a);
258
+ let x = null, I = null, w = null, b = 0, E = 0, k = 0, f = o(e.revision);
259
+ const d = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), l = [];
260
+ function z() {
261
261
  const a = o(e.container);
262
262
  return typeof HTMLElement > "u" ? null : a instanceof HTMLElement ? a : null;
263
263
  }
264
264
  function m() {
265
265
  return o(e.horizontal) ?? !1;
266
266
  }
267
- function N() {
267
+ function j() {
268
268
  const a = o(e.initialRect);
269
269
  return a ? m() ? a.width : a.height : 0;
270
270
  }
271
- function X(a, f) {
272
- return a ? G(f, Le(a, m())) : G(f);
271
+ function X(a, c) {
272
+ return a ? N(c, Ke(a, m())) : N(c);
273
273
  }
274
- function P(a, f, g) {
275
- return Ce(
276
- ce(a, m()),
277
- f,
278
- X(a, f),
274
+ function _(a, c, g) {
275
+ return Ee(
276
+ fe(a, m()),
277
+ c,
278
+ X(a, c),
279
279
  g
280
280
  );
281
281
  }
282
- function v(a, f, g, R, M) {
283
- Ke(
282
+ function v(a, c, g, M, O) {
283
+ Fe(
284
284
  a,
285
- ke(f, g, X(a, g), R),
285
+ ke(c, g, X(a, g), M),
286
286
  m(),
287
- M
287
+ O
288
288
  );
289
289
  }
290
- function x() {
290
+ function y() {
291
291
  const a = o(e.revision);
292
- Object.is(a, u) || (u = a, t.clearMeasurements());
293
- const f = S(), g = f ? fe(f, m()) : 0, R = o(e.viewportInset) ?? 0, M = Math.max(0, (g > 0 ? g : N()) - R), A = o(e.itemSize);
292
+ Object.is(a, f) || (f = a, t.clearMeasurements());
293
+ const c = z(), g = c ? de(c, m()) : 0, M = o(e.viewportInset) ?? 0, O = Math.max(0, (g > 0 ? g : j()) - M), C = o(e.itemSize);
294
294
  t.setOptions({
295
295
  count: o(e.count),
296
296
  estimateSize: p,
297
- overscan: o(e.overscan) ?? 5,
297
+ overscan: (o(e.overscan) ?? 8) + k,
298
298
  gap: o(e.gap) ?? 0,
299
299
  paddingStart: o(e.paddingStart) ?? 0,
300
300
  paddingEnd: o(e.paddingEnd) ?? 0,
301
301
  lanes: o(e.lanes) ?? 1,
302
- itemSize: A ?? null,
302
+ itemSize: C ?? null,
303
303
  getItemKey: e.getItemKey,
304
- viewportSize: M
304
+ viewportSize: O
305
305
  });
306
- const $ = t.getTotalSize(), J = Math.max(0, $ - M);
307
- t.getScrollOffset() > J && (t.setScrollOffset(J), f && v(f, J, $, M, "auto"));
308
- const oe = t.getVirtualItems();
309
- je(i.value, oe) || (i.value = oe), n.value !== $ && (n.value = $);
306
+ const A = t.getTotalSize(), J = Math.max(0, A - O);
307
+ t.getScrollOffset() > J && (t.setScrollOffset(J), c && v(c, J, A, O, "auto"));
308
+ const ae = t.getVirtualItems();
309
+ Ge(i.value, ae) || (i.value = ae), n.value !== A && (n.value = A);
310
310
  const Q = t.getScrollOffset();
311
311
  r.value !== Q && (r.value = Q);
312
- const ae = f ? Q - ce(f, m()) : 0;
313
- s.value !== ae && (s.value = ae);
312
+ const le = c ? Q - fe(c, m()) : 0;
313
+ s.value !== le && (s.value = le);
314
314
  }
315
- function z() {
316
- if (!D()) {
317
- x();
318
- return;
319
- }
320
- b || (b = de(() => {
321
- b = 0, d.value = !0, x(), typeof window < "u" && (window.clearTimeout(C), C = window.setTimeout(() => {
322
- d.value = !1;
323
- }, 150));
324
- }));
315
+ function S() {
316
+ u.value = !1, k = 0;
317
+ for (const [a, c] of d)
318
+ l.push({ element: a, index: c });
319
+ se(), y();
320
+ }
321
+ function V() {
322
+ u.value = !0, !(typeof window > "u") && (window.clearTimeout(E), E = window.setTimeout(S, 120));
325
323
  }
326
- function k() {
327
- const a = S();
324
+ function B() {
325
+ const a = z();
328
326
  if (!a) return;
329
- const f = t.getViewportSize(), g = t.getTotalSize();
330
- t.setScrollOffset(P(a, g, f)), z();
327
+ V();
328
+ const c = t.getViewportSize(), g = t.getTotalSize(), M = _(a, g, c), O = t.getScrollOffset(), C = Math.max(1, o(e.itemSize) ?? 48);
329
+ k = Math.min(24, Math.ceil(Math.abs(M - O) / C)), t.setScrollOffset(M), y();
331
330
  }
332
- function Y() {
333
- const a = S();
334
- if (a === w || (w && (w.removeEventListener("scroll", k), I?.disconnect(), I = null), w = a, !a || !D())) return;
335
- const f = t.getViewportSize(), g = t.getTotalSize();
336
- t.getScrollOffset() > 0 ? v(a, t.getScrollOffset(), g, f, "auto") : t.setScrollOffset(P(a, g, f)), a.addEventListener("scroll", k, { passive: !0 }), typeof ResizeObserver < "u" && (I = new ResizeObserver(() => x()), I.observe(a));
331
+ function we() {
332
+ const a = z();
333
+ if (a === x || (x && (x.removeEventListener("scroll", B), I?.disconnect(), I = null), x = a, !a || !Z())) return;
334
+ const c = t.getViewportSize(), g = t.getTotalSize();
335
+ t.getScrollOffset() > 0 ? v(a, t.getScrollOffset(), g, c, "auto") : t.setScrollOffset(_(a, g, c)), a.addEventListener("scroll", B, { passive: !0 }), typeof ResizeObserver < "u" && (I = new ResizeObserver(() => y()), I.observe(a));
337
336
  }
338
337
  function xe() {
339
- return !D() || typeof ResizeObserver > "u" ? null : (y || (y = new ResizeObserver((a) => {
340
- const f = m();
338
+ return !Z() || typeof ResizeObserver > "u" ? null : (w || (w = new ResizeObserver((a) => {
339
+ const c = m();
341
340
  let g = !1;
342
- for (const R of a) {
343
- const M = c.get(R.target);
344
- if (M === void 0) continue;
345
- const A = R.borderBoxSize?.[0], $ = f ? A?.inlineSize ?? R.contentRect.width : A?.blockSize ?? R.contentRect.height;
346
- $ > 0 && t.measure(M, $) && (g = !0);
341
+ if (!u.value) {
342
+ for (const M of a) {
343
+ const O = d.get(M.target);
344
+ if (O === void 0) continue;
345
+ const C = M.borderBoxSize?.[0], A = Math.round(
346
+ c ? C?.inlineSize ?? M.contentRect.width : C?.blockSize ?? M.contentRect.height
347
+ );
348
+ A > 0 && t.measure(O, A) && (g = !0);
349
+ }
350
+ g && y();
347
351
  }
348
- g && x();
349
- })), y);
352
+ })), w);
350
353
  }
351
- function pe() {
352
- E = 0;
353
- const a = l.splice(0, l.length), f = m();
354
+ function se() {
355
+ if (b = 0, u.value) return;
356
+ const a = l.splice(0, l.length), c = m();
354
357
  let g = !1;
355
- for (const R of a) {
356
- if (!R.element.isConnected) continue;
357
- const M = R.element.getBoundingClientRect(), A = f ? M.width : M.height;
358
- A > 0 && t.measure(R.index, A) && (g = !0);
358
+ for (const M of a) {
359
+ if (!M.element.isConnected) continue;
360
+ const O = M.element.getBoundingClientRect(), C = Math.round(c ? O.width : O.height);
361
+ C > 0 && t.measure(M.index, C) && (g = !0);
359
362
  }
360
- g && x();
363
+ g && y();
361
364
  }
362
- function be(a, f) {
363
- const g = ye(a), R = xe(), M = h.get(f);
364
- M && M !== g && (R?.unobserve(M), c.delete(M), h.delete(f)), g && (h.set(f, g), c.set(g, f), R?.observe(g), l.push({ element: g, index: f }), !E && (E = de(pe)));
365
+ function pe(a, c) {
366
+ const g = ze(a), M = xe(), O = h.get(c);
367
+ O && O !== g && (M?.unobserve(O), d.delete(O), h.delete(c)), g && (h.set(c, g), d.set(g, c), M?.observe(g), l.push({ element: g, index: c }), !(u.value || b) && (b = Le(se)));
365
368
  }
366
- function se(a, f = "auto") {
367
- const g = S(), R = g ? fe(g, m()) : 0, M = R > 0 ? R : t.getViewportSize(), A = t.getTotalSize(), $ = B(a, A, M);
368
- t.setScrollOffset($), g && v(g, $, A, M, f), x();
369
+ function oe(a, c = "auto") {
370
+ const g = z(), M = g ? de(g, m()) : 0, O = M > 0 ? M : t.getViewportSize(), C = t.getTotalSize(), A = H(a, C, O);
371
+ t.setScrollOffset(A), g && v(g, A, C, O, c), y();
369
372
  }
370
- function Ie(a, f) {
371
- const g = t.getOffsetForIndex(a, f?.align ?? "auto");
372
- se(g, f?.behavior ?? "auto");
373
+ function be(a, c) {
374
+ const g = t.getOffsetForIndex(a, c?.align ?? "auto");
375
+ oe(g, c?.behavior ?? "auto");
373
376
  }
374
- function Oe(a, f) {
375
- t.measure(a, f) && x();
377
+ function Ie(a, c) {
378
+ t.measure(a, c) && y();
376
379
  }
377
- return x(), ve(
380
+ return y(), ge(
378
381
  () => [
379
382
  o(e.count),
380
383
  o(e.overscan),
@@ -391,32 +394,32 @@ function te(e) {
391
394
  o(e.initialRect)?.height
392
395
  ],
393
396
  () => {
394
- Y(), x();
397
+ we(), y();
395
398
  },
396
399
  { flush: "post" }
397
- ), Se(() => {
398
- w && w.removeEventListener("scroll", k), I?.disconnect(), y?.disconnect(), he(b), he(E), typeof window < "u" && window.clearTimeout(C), c.clear(), h.clear(), l.length = 0;
400
+ ), ve(() => {
401
+ x && x.removeEventListener("scroll", B), I?.disconnect(), w?.disconnect(), je(b), typeof window < "u" && window.clearTimeout(E), d.clear(), h.clear(), l.length = 0;
399
402
  }), {
400
- virtualItems: O(() => i.value),
401
- totalSize: O(() => n.value),
402
- scrollOffset: O(() => r.value),
403
- scrollAdjust: O(() => s.value),
404
- isScrolling: O(() => d.value),
405
- scrollToIndex: Ie,
406
- scrollToOffset: se,
407
- measure: Oe,
408
- measureElement: be
403
+ virtualItems: R(() => i.value),
404
+ totalSize: R(() => n.value),
405
+ scrollOffset: R(() => r.value),
406
+ scrollAdjust: R(() => s.value),
407
+ isScrolling: R(() => u.value),
408
+ scrollToIndex: be,
409
+ scrollToOffset: oe,
410
+ measure: Ie,
411
+ measureElement: pe
409
412
  };
410
413
  }
411
- function Ge(e, t, i) {
414
+ function Ne(e, t, i) {
412
415
  return typeof e == "function" ? e(t, i) : typeof e == "number" ? e : 48;
413
416
  }
414
- function we(e) {
417
+ function ye(e) {
415
418
  const t = te({
416
419
  count: () => o(e.items).length,
417
420
  estimateSize: (n) => {
418
421
  const r = o(e.items);
419
- return Ge(e.estimateSize, n, r[n]);
422
+ return Ne(e.estimateSize, n, r[n]);
420
423
  },
421
424
  getItemKey: (n) => {
422
425
  const s = o(e.items)[n];
@@ -434,7 +437,7 @@ function we(e) {
434
437
  revision: e.revision
435
438
  });
436
439
  return {
437
- virtualItems: O(() => {
440
+ virtualItems: R(() => {
438
441
  const n = o(e.items);
439
442
  return t.virtualItems.value.map((r) => {
440
443
  const s = n[r.index];
@@ -455,16 +458,16 @@ function we(e) {
455
458
  measureElement: t.measureElement
456
459
  };
457
460
  }
458
- function me(e, t, i) {
461
+ function he(e, t, i) {
459
462
  return typeof e == "function" ? e(t) : typeof e == "number" ? e : i;
460
463
  }
461
- function Ne(e) {
462
- const t = O(() => Math.max(1, Math.floor(o(e.columnCount) || 1))), i = O(() => Math.ceil(o(e.items).length / t.value)), n = /* @__PURE__ */ new Map(), r = te({
464
+ function Be(e) {
465
+ const t = R(() => Math.max(1, Math.floor(o(e.columnCount) || 1))), i = R(() => Math.ceil(o(e.items).length / t.value)), n = /* @__PURE__ */ new Map(), r = te({
463
466
  count: () => i.value,
464
- estimateSize: (u) => me(o(e.estimateRowSize), u, 48),
467
+ estimateSize: (f) => he(o(e.estimateRowSize), f, 48),
465
468
  itemSize: () => {
466
- const u = o(e.estimateRowSize);
467
- return typeof u == "number" ? u : void 0;
469
+ const f = o(e.estimateRowSize);
470
+ return typeof f == "number" ? f : void 0;
468
471
  },
469
472
  overscan: () => o(e.overscanRows) ?? o(e.overscan) ?? 2,
470
473
  gap: () => o(e.rowGap) ?? 0,
@@ -474,10 +477,10 @@ function Ne(e) {
474
477
  revision: e.revision
475
478
  }), s = te({
476
479
  count: () => t.value,
477
- estimateSize: (u) => me(o(e.estimateColumnSize), u, 160),
480
+ estimateSize: (f) => he(o(e.estimateColumnSize), f, 160),
478
481
  itemSize: () => {
479
- const u = o(e.estimateColumnSize);
480
- return typeof u == "number" ? u : void 0;
482
+ const f = o(e.estimateColumnSize);
483
+ return typeof f == "number" ? f : void 0;
481
484
  },
482
485
  overscan: () => o(e.overscanColumns) ?? o(e.overscan) ?? 1,
483
486
  gap: () => o(e.columnGap) ?? 0,
@@ -485,74 +488,74 @@ function Ne(e) {
485
488
  container: e.container,
486
489
  initialRect: e.initialRect,
487
490
  revision: e.revision
488
- }), d = O(() => {
489
- const u = o(e.items), c = t.value, h = [];
491
+ }), u = R(() => {
492
+ const f = o(e.items), d = t.value, h = [];
490
493
  for (const l of r.virtualItems.value)
491
- for (const S of s.virtualItems.value) {
492
- const m = l.index * c + S.index;
493
- if (m >= u.length) continue;
494
- const N = u[m];
494
+ for (const z of s.virtualItems.value) {
495
+ const m = l.index * d + z.index;
496
+ if (m >= f.length) continue;
497
+ const j = f[m];
495
498
  h.push({
496
499
  index: m,
497
- key: e.getItemKey?.(N, m) ?? m,
498
- item: N,
500
+ key: e.getItemKey?.(j, m) ?? m,
501
+ item: j,
499
502
  row: l,
500
- column: S
503
+ column: z
501
504
  });
502
505
  }
503
506
  return h;
504
507
  });
505
- function p(u, c) {
508
+ function p(f, d) {
506
509
  const h = o(e.items);
507
510
  if (!h.length) return;
508
- const l = Math.min(Math.max(u, 0), h.length - 1), S = t.value;
509
- r.scrollToIndex(Math.floor(l / S), c), s.scrollToIndex(l % S, c);
511
+ const l = Math.min(Math.max(f, 0), h.length - 1), z = t.value;
512
+ r.scrollToIndex(Math.floor(l / z), d), s.scrollToIndex(l % z, d);
510
513
  }
511
- function w(u, c = "auto") {
512
- u.top !== void 0 && r.scrollToOffset(u.top, c), u.left !== void 0 && s.scrollToOffset(u.left, c);
514
+ function x(f, d = "auto") {
515
+ f.top !== void 0 && r.scrollToOffset(f.top, d), f.left !== void 0 && s.scrollToOffset(f.left, d);
513
516
  }
514
- function I(u, c) {
515
- const h = Math.max(n.get(u) ?? 0, c);
516
- h <= 0 || h === n.get(u) || (n.set(u, h), r.measure(u, h));
517
+ function I(f, d) {
518
+ const h = Math.max(n.get(f) ?? 0, d);
519
+ h <= 0 || h === n.get(f) || (n.set(f, h), r.measure(f, h));
517
520
  }
518
- let y = null;
521
+ let w = null;
519
522
  const b = /* @__PURE__ */ new Map();
520
523
  function E() {
521
- return !D() || typeof ResizeObserver > "u" ? null : (y || (y = new ResizeObserver((u) => {
522
- for (const c of u) {
523
- const h = b.get(c.target);
524
+ return !Z() || typeof ResizeObserver > "u" ? null : (w || (w = new ResizeObserver((f) => {
525
+ for (const d of f) {
526
+ const h = b.get(d.target);
524
527
  if (h === void 0) continue;
525
- const S = c.borderBoxSize?.[0]?.blockSize ?? c.contentRect.height;
526
- S > 0 && I(h, S);
528
+ const z = d.borderBoxSize?.[0]?.blockSize ?? d.contentRect.height;
529
+ z > 0 && I(h, z);
527
530
  }
528
- })), y);
531
+ })), w);
529
532
  }
530
- function C(u, c) {
531
- const h = ye(u), l = E();
533
+ function k(f, d) {
534
+ const h = ze(f), l = E();
532
535
  if (!h) return;
533
- b.set(h, c), l?.observe(h);
534
- const S = h.getBoundingClientRect().height;
535
- S > 0 && I(c, S);
536
+ b.set(h, d), l?.observe(h);
537
+ const z = h.getBoundingClientRect().height;
538
+ z > 0 && I(d, z);
536
539
  }
537
- return Se(() => {
538
- y?.disconnect(), b.clear();
540
+ return ve(() => {
541
+ w?.disconnect(), b.clear();
539
542
  }), {
540
543
  virtualRows: r.virtualItems,
541
544
  virtualColumns: s.virtualItems,
542
- virtualCells: d,
545
+ virtualCells: u,
543
546
  totalHeight: r.totalSize,
544
547
  totalWidth: s.totalSize,
545
548
  scrollAdjustX: s.scrollAdjust,
546
549
  scrollAdjustY: r.scrollAdjust,
547
550
  scrollToIndex: p,
548
- scrollToOffset: w,
551
+ scrollToOffset: x,
549
552
  measureRow: I,
550
- measureRowElement: C,
553
+ measureRowElement: k,
551
554
  measureColumn: s.measure
552
555
  };
553
556
  }
554
- function Be(e) {
555
- const t = we({
557
+ function He(e) {
558
+ const t = ye({
556
559
  items: e.rows,
557
560
  estimateSize: e.estimateRowSize,
558
561
  container: e.container,
@@ -562,24 +565,24 @@ function Be(e) {
562
565
  viewportInset: e.viewportInset,
563
566
  revision: e.revision,
564
567
  itemSize: e.itemSize
565
- }), i = O(() => {
568
+ }), i = R(() => {
566
569
  const s = o(e.columns);
567
- let d = 0;
570
+ let u = 0;
568
571
  return s.map((p) => {
569
- const w = p.width ?? p.minWidth ?? 160, I = {
572
+ const x = p.width ?? p.minWidth ?? 160, I = {
570
573
  ...p,
571
- start: d,
572
- size: w,
573
- end: d + w
574
+ start: u,
575
+ size: x,
576
+ end: u + x
574
577
  };
575
- return d += w, I;
578
+ return u += x, I;
576
579
  });
577
- }), n = O(() => {
580
+ }), n = R(() => {
578
581
  const s = i.value;
579
582
  return s.length ? s[s.length - 1]?.end ?? 0 : 0;
580
583
  });
581
584
  return {
582
- virtualRows: O(() => t.virtualItems.value),
585
+ virtualRows: R(() => t.virtualItems.value),
583
586
  columns: i,
584
587
  totalHeight: t.totalSize,
585
588
  totalWidth: n,
@@ -592,11 +595,11 @@ function Be(e) {
592
595
  measureElement: t.measureElement
593
596
  };
594
597
  }
595
- function ge(e) {
598
+ function me(e) {
596
599
  if (typeof e == "number" && Number.isFinite(e)) return `${e}px`;
597
600
  if (typeof e == "string" && e.trim()) return e;
598
601
  }
599
- function H(e) {
602
+ function W(e) {
600
603
  if (typeof e == "number" && Number.isFinite(e)) return e;
601
604
  if (typeof e != "string") return 0;
602
605
  const t = /^(-?\d+(?:\.\d+)?)px$/.exec(e.trim());
@@ -608,30 +611,33 @@ function re(e) {
608
611
  return {
609
612
  overflow: "auto",
610
613
  position: "relative",
611
- height: ge(e.height) ?? (e.horizontal ? "100%" : void 0),
612
- width: ge(e.width) ?? (e.horizontal ? void 0 : "100%"),
614
+ height: me(e.height) ?? (e.horizontal ? "100%" : void 0),
615
+ width: me(e.width) ?? (e.horizontal ? void 0 : "100%"),
613
616
  overflowAnchor: "none"
614
617
  };
615
618
  }
616
- function He(e, t) {
617
- const i = G(e);
619
+ function We(e, t) {
620
+ const i = N(e);
618
621
  return {
619
622
  position: "relative",
620
623
  width: t ? `${i}px` : "100%",
621
624
  height: t ? "100%" : `${i}px`
622
625
  };
623
626
  }
624
- function Pe(e, t) {
627
+ function _e(e, t, i) {
625
628
  return {
626
629
  position: "absolute",
627
630
  top: 0,
628
631
  left: 0,
629
- width: t ? void 0 : "100%",
630
- height: t ? "100%" : void 0,
631
- transform: t ? `translateX(${e}px)` : `translateY(${e}px)`
632
+ width: t ? i === void 0 ? void 0 : `${i}px` : "100%",
633
+ height: t ? "100%" : i === void 0 ? void 0 : `${i}px`,
634
+ transform: t ? `translateX(${e}px)` : `translateY(${e}px)`,
635
+ contain: "layout style",
636
+ boxSizing: "border-box",
637
+ overflow: "hidden"
632
638
  };
633
639
  }
634
- const Xe = /* @__PURE__ */ ie({
640
+ const Ye = /* @__PURE__ */ ie({
635
641
  __name: "VirtualList",
636
642
  props: {
637
643
  items: {},
@@ -639,7 +645,7 @@ const Xe = /* @__PURE__ */ ie({
639
645
  height: {},
640
646
  width: {},
641
647
  horizontal: { type: Boolean, default: !1 },
642
- overscan: { default: 5 },
648
+ overscan: { default: 8 },
643
649
  gap: { default: 0 },
644
650
  paddingStart: { default: 0 },
645
651
  paddingEnd: { default: 0 },
@@ -650,11 +656,11 @@ const Xe = /* @__PURE__ */ ie({
650
656
  revision: {}
651
657
  },
652
658
  setup(e, { expose: t }) {
653
- const i = e, n = L(null), { virtualItems: r, totalSize: s, scrollAdjust: d, scrollToIndex: p, scrollToOffset: w, measure: I, measureElement: y } = we({
659
+ const i = e, n = L(null), { virtualItems: r, totalSize: s, scrollAdjust: u, scrollToIndex: p, scrollToOffset: x, measure: I, measureElement: w } = ye({
654
660
  items: () => i.items,
655
- estimateSize: (c, h) => {
661
+ estimateSize: (d, h) => {
656
662
  const l = i.estimateSize;
657
- return typeof l == "number" ? l : l(c, h);
663
+ return typeof l == "number" ? l : l(d, h);
658
664
  },
659
665
  itemSize: () => typeof i.estimateSize == "number" ? i.estimateSize : void 0,
660
666
  container: n,
@@ -663,57 +669,57 @@ const Xe = /* @__PURE__ */ ie({
663
669
  gap: () => i.gap,
664
670
  paddingStart: () => i.paddingStart,
665
671
  paddingEnd: () => i.paddingEnd,
666
- getItemKey: (c, h) => i.getItemKey?.(c, h) ?? h,
672
+ getItemKey: (d, h) => i.getItemKey?.(d, h) ?? h,
667
673
  initialRect: () => ({
668
- width: H(i.width),
669
- height: H(i.height)
674
+ width: W(i.width),
675
+ height: W(i.height)
670
676
  }),
671
677
  revision: () => i.revision
672
- }), b = O(
678
+ }), b = R(
673
679
  () => re({
674
680
  height: i.height,
675
681
  width: i.width,
676
682
  horizontal: i.horizontal
677
683
  })
678
- ), E = O(() => He(s.value, i.horizontal));
679
- function C(c) {
680
- return Pe(c, i.horizontal);
684
+ ), E = R(() => We(s.value, i.horizontal));
685
+ function k(d, h) {
686
+ return _e(d, i.horizontal, h);
681
687
  }
682
- function u(c) {
688
+ function f(d) {
683
689
  return (h) => {
684
- y(h, c);
690
+ w(h, d);
685
691
  };
686
692
  }
687
693
  return t({
688
694
  scrollToIndex: p,
689
- scrollToOffset: w,
695
+ scrollToOffset: x,
690
696
  measure: I
691
- }), (c, h) => (T(), q(U(e.tag), {
697
+ }), (d, h) => (T(), Y(q(e.tag), {
692
698
  ref_key: "container",
693
699
  ref: n,
694
700
  "data-virtual-container": "",
695
701
  role: "list",
696
702
  style: F(b.value)
697
703
  }, {
698
- default: Z(() => [
699
- e.items.length ? (T(), V("div", {
704
+ default: U(() => [
705
+ e.items.length ? (T(), $("div", {
700
706
  key: 1,
701
707
  "data-virtual-spacer": "",
702
708
  style: F(E.value)
703
709
  }, [
704
- (T(!0), V(W, null, _(K(r), (l) => (T(), q(U(e.itemTag), ne({
710
+ (T(!0), $(D, null, P(K(r), (l) => (T(), Y(q(e.itemTag), ne({
705
711
  key: l.key,
706
712
  ref_for: !0,
707
- ref: u(l.index),
713
+ ref: f(l.index),
708
714
  role: "listitem",
709
715
  "data-index": l.index,
710
716
  "data-key": String(l.key),
711
717
  "aria-setsize": e.items.length,
712
718
  "aria-posinset": l.index + 1,
713
- style: C(l.start - K(d))
719
+ style: k(l.start - K(u), l.size)
714
720
  }, { ref_for: !0 }, e.itemAttrs), {
715
- default: Z(() => [
716
- j(c.$slots, "default", {
721
+ default: U(() => [
722
+ G(d.$slots, "default", {
717
723
  item: l.item,
718
724
  index: l.index,
719
725
  start: l.start,
@@ -723,12 +729,12 @@ const Xe = /* @__PURE__ */ ie({
723
729
  ]),
724
730
  _: 2
725
731
  }, 1040, ["data-index", "data-key", "aria-setsize", "aria-posinset", "style"]))), 128))
726
- ], 4)) : j(c.$slots, "empty", {}, void 0, void 0, 0)
732
+ ], 4)) : G(d.$slots, "empty", {}, void 0, void 0, 0)
727
733
  ]),
728
734
  _: 3
729
735
  }, 8, ["style"]));
730
736
  }
731
- }), We = ["data-index", "data-key"], Ye = /* @__PURE__ */ ie({
737
+ }), De = ["data-index", "data-key"], qe = /* @__PURE__ */ ie({
732
738
  __name: "VirtualGrid",
733
739
  props: {
734
740
  items: {},
@@ -751,14 +757,14 @@ const Xe = /* @__PURE__ */ ie({
751
757
  const i = e, n = L(null), {
752
758
  virtualCells: r,
753
759
  totalWidth: s,
754
- totalHeight: d,
760
+ totalHeight: u,
755
761
  scrollAdjustX: p,
756
- scrollAdjustY: w,
762
+ scrollAdjustY: x,
757
763
  scrollToIndex: I,
758
- scrollToOffset: y,
764
+ scrollToOffset: w,
759
765
  measureRow: b,
760
766
  measureRowElement: E
761
- } = Ne({
767
+ } = Be({
762
768
  items: () => i.items,
763
769
  columnCount: () => i.columnCount,
764
770
  estimateRowSize: () => i.estimateRowSize,
@@ -769,64 +775,68 @@ const Xe = /* @__PURE__ */ ie({
769
775
  overscanColumns: () => i.overscanColumns,
770
776
  rowGap: () => i.rowGap,
771
777
  columnGap: () => i.columnGap,
772
- getItemKey: (l, S) => i.getItemKey?.(l, S) ?? S,
778
+ getItemKey: (l, z) => i.getItemKey?.(l, z) ?? z,
773
779
  initialRect: () => ({
774
- width: H(i.width),
775
- height: H(i.height)
780
+ width: W(i.width),
781
+ height: W(i.height)
776
782
  }),
777
783
  revision: () => i.revision
778
- }), C = O(
784
+ }), k = R(
779
785
  () => re({
780
786
  height: i.height,
781
787
  width: i.width,
782
788
  horizontal: !1
783
789
  })
784
- ), u = O(() => ({
790
+ ), f = R(() => ({
785
791
  position: "relative",
786
- width: `${G(s.value)}px`,
787
- height: `${G(d.value)}px`
792
+ width: `${N(s.value)}px`,
793
+ height: `${N(u.value)}px`
788
794
  }));
789
- function c(l) {
790
- return (S) => {
791
- E(S, l);
795
+ function d(l) {
796
+ return (z) => {
797
+ E(z, l);
792
798
  };
793
799
  }
794
- function h(l, S, m) {
800
+ function h(l, z, m, j) {
795
801
  return {
796
802
  position: "absolute",
797
803
  top: 0,
798
804
  left: 0,
799
- width: `${S}px`,
800
- transform: `translate(${l}px, ${m}px)`
805
+ width: `${z}px`,
806
+ height: `${j}px`,
807
+ transform: `translate(${l}px, ${m}px)`,
808
+ contain: "layout style",
809
+ boxSizing: "border-box",
810
+ overflow: "hidden"
801
811
  };
802
812
  }
803
813
  return t({
804
814
  scrollToIndex: I,
805
- scrollToOffset: y,
815
+ scrollToOffset: w,
806
816
  measureRow: b
807
- }), (l, S) => (T(), q(U(e.tag), {
817
+ }), (l, z) => (T(), Y(q(e.tag), {
808
818
  ref_key: "container",
809
819
  ref: n,
810
820
  "data-virtual-container": "",
811
821
  role: "grid",
812
- style: F(C.value)
822
+ style: F(k.value)
813
823
  }, {
814
- default: Z(() => [
815
- e.items.length ? (T(), V("div", {
824
+ default: U(() => [
825
+ e.items.length ? (T(), $("div", {
816
826
  key: 1,
817
827
  "data-virtual-spacer": "",
818
- style: F(u.value)
828
+ style: F(f.value)
819
829
  }, [
820
- (T(!0), V(W, null, _(K(r), (m) => (T(), V("div", ne({
830
+ (T(!0), $(D, null, P(K(r), (m) => (T(), $("div", ne({
821
831
  key: m.key,
822
832
  ref_for: !0,
823
- ref: c(m.row.index),
833
+ ref: d(m.row.index),
824
834
  role: "gridcell",
825
835
  "data-index": m.index,
826
836
  "data-key": String(m.key),
827
- style: h(m.column.start - K(p), m.column.size, m.row.start - K(w))
837
+ style: h(m.column.start - K(p), m.column.size, m.row.start - K(x), m.row.size)
828
838
  }, { ref_for: !0 }, e.itemAttrs), [
829
- j(l.$slots, "default", {
839
+ G(l.$slots, "default", {
830
840
  item: m.item,
831
841
  index: m.index,
832
842
  rowIndex: m.row.index,
@@ -834,13 +844,13 @@ const Xe = /* @__PURE__ */ ie({
834
844
  row: m.row,
835
845
  column: m.column
836
846
  })
837
- ], 16, We))), 128))
838
- ], 4)) : j(l.$slots, "empty", {}, void 0, void 0, 0)
847
+ ], 16, De))), 128))
848
+ ], 4)) : G(l.$slots, "empty", {}, void 0, void 0, 0)
839
849
  ]),
840
850
  _: 3
841
851
  }, 8, ["style"]));
842
852
  }
843
- }), _e = ["data-index", "data-key", "aria-rowindex"], qe = /* @__PURE__ */ ie({
853
+ }), Pe = ["data-index", "data-key", "aria-rowindex"], Ue = /* @__PURE__ */ ie({
844
854
  __name: "VirtualTable",
845
855
  props: {
846
856
  rows: {},
@@ -848,7 +858,7 @@ const Xe = /* @__PURE__ */ ie({
848
858
  estimateRowSize: { type: [Number, Function], default: 44 },
849
859
  height: {},
850
860
  width: {},
851
- overscan: { default: 5 },
861
+ overscan: { default: 8 },
852
862
  getRowKey: {},
853
863
  stickyHeader: { type: Boolean, default: !0 },
854
864
  tag: { default: "div" },
@@ -857,58 +867,58 @@ const Xe = /* @__PURE__ */ ie({
857
867
  },
858
868
  setup(e, { expose: t }) {
859
869
  const i = e, n = L(null), r = L(null), s = L(0), {
860
- virtualRows: d,
870
+ virtualRows: u,
861
871
  columns: p,
862
- totalWidth: w,
872
+ totalWidth: x,
863
873
  totalHeight: I,
864
- scrollAdjust: y,
874
+ scrollAdjust: w,
865
875
  scrollToIndex: b,
866
876
  scrollToOffset: E,
867
- measure: C,
868
- measureElement: u
869
- } = Be({
877
+ measure: k,
878
+ measureElement: f
879
+ } = He({
870
880
  rows: () => i.rows,
871
881
  columns: () => i.columns,
872
- estimateRowSize: (v, x) => {
873
- const z = i.estimateRowSize;
874
- return typeof z == "number" ? z : z(v, x);
882
+ estimateRowSize: (v, y) => {
883
+ const S = i.estimateRowSize;
884
+ return typeof S == "number" ? S : S(v, y);
875
885
  },
876
886
  container: n,
877
887
  overscan: () => i.overscan,
878
- getRowKey: (v, x) => i.getRowKey?.(v, x) ?? x,
888
+ getRowKey: (v, y) => i.getRowKey?.(v, y) ?? y,
879
889
  initialRect: () => ({
880
- width: H(i.width),
881
- height: H(i.height)
890
+ width: W(i.width),
891
+ height: W(i.height)
882
892
  }),
883
893
  viewportInset: s,
884
894
  revision: () => i.revision,
885
895
  itemSize: () => typeof i.estimateRowSize == "number" ? i.estimateRowSize : void 0
886
896
  });
887
- ve(r, (v, x, z) => {
888
- if (x === v && !v || !v || !D() || typeof ResizeObserver > "u") return;
889
- const k = () => {
897
+ ge(r, (v, y, S) => {
898
+ if (y === v && !v || !v || !Z() || typeof ResizeObserver > "u") return;
899
+ const V = () => {
890
900
  s.value = v.getBoundingClientRect().height;
891
- }, Y = new ResizeObserver(k);
892
- Y.observe(v), k(), z(() => Y.disconnect());
901
+ }, B = new ResizeObserver(V);
902
+ B.observe(v), V(), S(() => B.disconnect());
893
903
  });
894
- const c = O(
904
+ const d = R(
895
905
  () => re({
896
906
  height: i.height,
897
907
  width: i.width,
898
908
  horizontal: !1
899
909
  })
900
- ), h = O(() => ({
901
- minWidth: `${w.value}px`
902
- })), l = O(() => ({
910
+ ), h = R(() => ({
911
+ minWidth: `${x.value}px`
912
+ })), l = R(() => ({
903
913
  position: i.stickyHeader ? "sticky" : "relative",
904
914
  top: i.stickyHeader ? "0px" : void 0,
905
915
  zIndex: 1,
906
916
  display: "flex",
907
- width: `${w.value}px`
908
- })), S = O(() => ({
917
+ width: `${x.value}px`
918
+ })), z = R(() => ({
909
919
  position: "relative",
910
- height: `${G(I.value)}px`,
911
- width: `${G(w.value)}px`
920
+ height: `${N(I.value)}px`,
921
+ width: `${N(x.value)}px`
912
922
  }));
913
923
  function m(v) {
914
924
  return {
@@ -918,85 +928,89 @@ const Xe = /* @__PURE__ */ ie({
918
928
  textAlign: v.align ?? "left"
919
929
  };
920
930
  }
921
- function N(v) {
931
+ function j(v, y) {
922
932
  return {
923
933
  position: "absolute",
924
934
  top: 0,
925
935
  left: 0,
926
936
  width: "100%",
937
+ height: `${y}px`,
927
938
  display: "flex",
928
- transform: `translateY(${v}px)`
939
+ transform: `translateY(${v}px)`,
940
+ contain: "layout style",
941
+ boxSizing: "border-box",
942
+ overflow: "hidden"
929
943
  };
930
944
  }
931
945
  function X(v) {
932
- return (x) => {
933
- u(x, v);
946
+ return (y) => {
947
+ f(y, v);
934
948
  };
935
949
  }
936
- function P(v, x, z) {
937
- return x.accessor ? x.accessor(v, z) : v && typeof v == "object" && x.id in v ? v[x.id] : "";
950
+ function _(v, y, S) {
951
+ return y.accessor ? y.accessor(v, S) : v && typeof v == "object" && y.id in v ? v[y.id] : "";
938
952
  }
939
953
  return t({
940
954
  scrollToIndex: b,
941
955
  scrollToOffset: E,
942
- measure: C
943
- }), (v, x) => (T(), q(U(e.tag), {
956
+ measure: k
957
+ }), (v, y) => (T(), Y(q(e.tag), {
944
958
  ref_key: "container",
945
959
  ref: n,
946
960
  "data-virtual-container": "",
947
961
  role: "table",
948
- style: F(c.value)
962
+ style: F(d.value)
949
963
  }, {
950
- default: Z(() => [
951
- le("div", {
964
+ default: U(() => [
965
+ ue("div", {
952
966
  style: F(h.value)
953
967
  }, [
954
- le("div", {
968
+ ue("div", {
955
969
  ref_key: "header",
956
970
  ref: r,
957
971
  role: "row",
958
972
  style: F(l.value)
959
973
  }, [
960
- j(v.$slots, "header", { columns: K(p) }, () => [
961
- (T(!0), V(W, null, _(K(p), (z) => (T(), V("div", {
962
- key: z.id,
974
+ G(v.$slots, "header", { columns: K(p) }, () => [
975
+ (T(!0), $(D, null, P(K(p), (S) => (T(), $("div", {
976
+ key: S.id,
963
977
  role: "columnheader",
964
- style: F(m(z))
965
- }, ue(z.header), 5))), 128))
978
+ style: F(m(S))
979
+ }, ce(S.header), 5))), 128))
966
980
  ])
967
981
  ], 4),
968
- e.rows.length ? (T(), V("div", {
982
+ e.rows.length ? (T(), $("div", {
969
983
  key: 1,
970
984
  "data-virtual-spacer": "",
971
985
  role: "rowgroup",
972
- style: F(S.value)
986
+ style: F(z.value)
973
987
  }, [
974
- (T(!0), V(W, null, _(K(d), (z) => (T(), V("div", ne({
975
- key: z.key,
988
+ (T(!0), $(D, null, P(K(u), (S) => (T(), $("div", ne({
989
+ key: S.key,
976
990
  ref_for: !0,
977
- ref: X(z.index),
991
+ ref: X(S.index),
978
992
  role: "row",
979
- "data-index": z.index,
980
- "data-key": String(z.key),
981
- "aria-rowindex": z.index + 1,
982
- style: N(z.start - K(y))
993
+ "data-index": S.index,
994
+ "data-key": String(S.key),
995
+ "aria-rowindex": S.index + 1,
996
+ style: j(S.start - K(w), S.size)
983
997
  }, { ref_for: !0 }, e.rowAttrs), [
984
- (T(!0), V(W, null, _(K(p), (k) => (T(), V("div", {
985
- key: k.id,
998
+ (T(!0), $(D, null, P(K(p), (V) => (T(), $("div", {
999
+ key: V.id,
986
1000
  role: "cell",
987
- style: F(m(k))
1001
+ style: F(m(V))
988
1002
  }, [
989
- j(v.$slots, "cell", {
990
- row: z.item,
991
- column: k,
992
- rowIndex: z.index,
993
- value: P(z.item, k, z.index)
1003
+ G(v.$slots, "cell", {
1004
+ row: S.item,
1005
+ column: V,
1006
+ rowIndex: S.index,
1007
+ value: _(S.item, V, S.index)
994
1008
  }, () => [
995
- Re(ue(P(z.item, k, z.index)), 1)
1009
+ Oe(ce(_(S.item, V, S.index)), 1)
996
1010
  ])
997
1011
  ], 4))), 128))
998
- ], 16, _e))), 128))
999
- ], 4)) : j(v.$slots, "empty", {}, void 0, void 0, 0)
1012
+ ], 16, Pe))), 128))
1013
+ ], 4)) : G(v.$slots, "empty", {}, void 0, void 0, 0)
1000
1014
  ], 4)
1001
1015
  ]),
1002
1016
  _: 3
@@ -1004,20 +1018,20 @@ const Xe = /* @__PURE__ */ ie({
1004
1018
  }
1005
1019
  });
1006
1020
  export {
1007
- Te as MeasurementCache,
1008
- Ye as VirtualGrid,
1009
- Xe as VirtualList,
1010
- qe as VirtualTable,
1011
- Fe as Virtualizer,
1012
- B as clampScrollOffset,
1013
- Ce as mapDomOffsetToVirtual,
1021
+ Re as MeasurementCache,
1022
+ qe as VirtualGrid,
1023
+ Ye as VirtualList,
1024
+ Ue as VirtualTable,
1025
+ Ae as Virtualizer,
1026
+ H as clampScrollOffset,
1027
+ Ee as mapDomOffsetToVirtual,
1014
1028
  ke as mapVirtualOffsetToDom,
1015
1029
  ee as normalizeSize,
1016
- $e as resolveScrollOffset,
1017
- G as scrollContentSize,
1018
- Ne as useVirtualGrid,
1019
- we as useVirtualList,
1020
- Be as useVirtualTable,
1030
+ Ve as resolveScrollOffset,
1031
+ N as scrollContentSize,
1032
+ Be as useVirtualGrid,
1033
+ ye as useVirtualList,
1034
+ He as useVirtualTable,
1021
1035
  te as useVirtualizer
1022
1036
  };
1023
1037
  //# sourceMappingURL=index.mjs.map