virtua 0.52.2 → 0.52.4

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/lib/index.js CHANGED
@@ -247,11 +247,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
247
247
  t.q(r, s), i !== e.T() && e.W(5, [ i ]);
248
248
  const c = t.V(o, n, e.M() - e.u(0), l);
249
249
  null != c && e.W(9, c);
250
- }, A = /*#__PURE__*/ new WeakMap, W = (e, t, o, n, r, s, l) => {
251
- if (t < n || $(t, r) < d(o, s + 1) || l < o) return !0;
252
- for (const n of e) if (n >= t && n < o) return !0;
253
- return !1;
254
- }, H = (e, t, o) => {
250
+ }, A = /*#__PURE__*/ new WeakMap, W = (e, t, o, n, r, s) => e < o || $(e, n) < d(t, r + 1) || s < t, H = (e, t, o) => {
255
251
  const n = [];
256
252
  for (const r of e) r >= t && r < o && n.push(r);
257
253
  return m(n);
@@ -263,25 +259,22 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
263
259
  e[o] <= t ? n = o + 1 : r = o;
264
260
  }
265
261
  return n - 1;
266
- }, q = (e, t, o, n) => {
267
- const r = P(t, o, n);
268
- r >= 0 && e.push(t[r]);
269
- }, B = (e, t, o, n, r) => {
262
+ }, q = (e, t, o, n, r) => {
270
263
  const s = t.length;
271
264
  for (;o < s && t[o] < n; o++) {
272
265
  const n = t[o];
273
266
  n > r && (e.push(n), r = n);
274
267
  }
275
268
  return o;
276
- }, D = (e, t, o, n, r, s) => {
269
+ }, B = (e, t, o, n, r, s) => {
277
270
  const l = [];
278
271
  for (let e = 0; e < o; e++) l.push(e);
279
- const i = B(l, e, 0, n, o - 1);
272
+ const i = q(l, e, 0, n, o - 1);
280
273
  for (let e = n; e <= r; e++) l.push(e);
281
- B(l, e, i, s, r);
274
+ q(l, e, i, s, r);
282
275
  for (let e = s; e < t; e++) l.push(e);
283
276
  return l;
284
- }, V = (e, t) => d(e.rowIndex + (e.rowSpan || 1), t), X = (e, t) => d(e.colIndex + (e.colSpan || 1), t), Y = (e, t, o, n, r, s) => {
277
+ }, D = (e, t) => d(e.rowIndex + (e.rowSpan || 1), t), V = (e, t) => d(e.colIndex + (e.colSpan || 1), t), X = (e, t, o, n, r, s) => {
285
278
  const l = t.length, i = n.length;
286
279
  let c = "[l0]", a = 0, f = 0, u = 0;
287
280
  for (;a < s; ) {
@@ -296,7 +289,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
296
289
  c += " " + h + " [l" + g + "]", a = g;
297
290
  }
298
291
  return c;
299
- }, j = (e, t, o, n, r) => {
292
+ }, Y = (e, t, o, n, r) => {
300
293
  const s = {
301
294
  display: "grid",
302
295
  gridTemplateRows: "subgrid",
@@ -305,7 +298,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
305
298
  gridRow: "l" + e + "/l" + t
306
299
  };
307
300
  return null != o && (s.position = "sticky", s[n] = o + "px", s.zIndex = r), s;
308
- }, J = e => {
301
+ }, j = e => {
309
302
  let t;
310
303
  return {
311
304
  X(o) {
@@ -318,7 +311,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
318
311
  t && t.disconnect();
319
312
  }
320
313
  };
321
- }, U = (e, t, o, n, r, s, l) => {
314
+ }, J = (e, t, o, n, r, s, l) => {
322
315
  let i, c, a = 0, f = !1, u = !1, d = !1, $ = !1;
323
316
  const g = Date.now, h = n ? "scrollLeft" : "scrollTop", p = n ? "left" : "top", m = e => r ? -e : e, v = () => m(o[h]), z = (e, t) => {
324
317
  o.scrollTo({
@@ -387,9 +380,9 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
387
380
  o ? (e.W(8, t()), _(a)) : a();
388
381
  }
389
382
  };
390
- }, F = (e, t) => {
383
+ }, U = (e, t) => {
391
384
  let o, n, r = v();
392
- const s = /* @__PURE__ */ new WeakMap, l = J(n => {
385
+ const s = /* @__PURE__ */ new WeakMap, l = j(n => {
393
386
  const r = [];
394
387
  for (const {target: l, contentRect: {width: i, height: c}} of n) if (l === o) (i || c) && e.W(4, t ? i : c); else if (l.offsetParent) {
395
388
  const e = s.get(l);
@@ -399,7 +392,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
399
392
  });
400
393
  return {
401
394
  F(s, i = s.parentElement) {
402
- l.X(o = i), n = U(e, i, i, t, t && "rtl" === getComputedStyle(i).direction, () => {
395
+ l.X(o = i), n = J(e, i, i, t, t && "rtl" === getComputedStyle(i).direction, () => {
403
396
  const e = t ? "overflowX" : "overflowY", o = i.style, n = o[e];
404
397
  o[e] = "hidden", w(() => {
405
398
  o[e] = n;
@@ -420,9 +413,9 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
420
413
  },
421
414
  Z: e.O
422
415
  };
423
- }, G = (e, t) => {
416
+ }, F = (e, t) => {
424
417
  let o, n, r, s, l, i = v();
425
- const c = /* @__PURE__ */ new WeakMap, a = J(n => {
418
+ const c = /* @__PURE__ */ new WeakMap, a = j(n => {
426
419
  const r = [];
427
420
  for (const {target: e, contentRect: {width: s, height: i}} of n) if (e === o) l && l(); else if (e.offsetParent) {
428
421
  const o = c.get(e);
@@ -440,7 +433,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
440
433
  };
441
434
  u.addEventListener("resize", p), a.X(d), r = () => {
442
435
  u.removeEventListener("resize", p);
443
- }, n = U(e, u, d, t, $, null, h), i[1](!0);
436
+ }, n = J(e, u, d, t, $, null, h), i[1](!0);
444
437
  },
445
438
  v() {
446
439
  r && r(), a.j(), n && n.j(), i[1](!1), i = v();
@@ -456,9 +449,9 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
456
449
  },
457
450
  Z: () => s()
458
451
  };
459
- }, K = (e, t) => {
452
+ }, G = (e, t) => {
460
453
  let o, n, r, s = v();
461
- const l = /* @__PURE__ */ new WeakMap, i = /* @__PURE__ */ new WeakMap, c = J(n => {
454
+ const l = /* @__PURE__ */ new WeakMap, i = /* @__PURE__ */ new WeakMap, c = j(n => {
462
455
  const r = [], s = [];
463
456
  for (const {target: c, contentRect: {width: a, height: f}} of n) if (c === o) (a || f) && (e.W(4, f),
464
457
  t.W(4, a)); else if (c.offsetParent) {
@@ -474,7 +467,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
474
467
  F(l) {
475
468
  const i = o = l.parentElement;
476
469
  c.X(i);
477
- const a = (e, t) => U(e, i, i, t, t && "rtl" === getComputedStyle(i).direction, () => {
470
+ const a = (e, t) => J(e, i, i, t, t && "rtl" === getComputedStyle(i).direction, () => {
478
471
  const e = t ? "overflowX" : "overflowY", o = i.style, n = o[e];
479
472
  o[e] = "hidden", w(() => {
480
473
  o[e] = n;
@@ -492,9 +485,9 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
492
485
  n && n.J(), r && r.J();
493
486
  }
494
487
  };
495
- }, N = (e, t) => {
488
+ }, K = (e, t) => {
496
489
  e.K(() => t);
497
- }, Q = (e, t, o, {align: n, smooth: r, offset: s = 0} = {}) => {
490
+ }, N = (e, t, o, {align: n, smooth: r, offset: s = 0} = {}) => {
498
491
  if (o = p(o, 0, t.T() - 1), "nearest" === n) {
499
492
  const e = t.u(o), r = t.M();
500
493
  if (e < r) n = "start"; else {
@@ -503,10 +496,10 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
503
496
  }
504
497
  }
505
498
  e.K(() => s + e.Z() + t.u(o) + ("end" === n ? t.$(o) - t.o() : "center" === n ? (t.$(o) - t.o()) / 2 : 0), r);
506
- }, Z = (e, t, o, n, r, s, l) => {
499
+ }, Q = (e, t, o, n, r, s, l) => {
507
500
  const i = t.T(), c = o.B(), a = o.D();
508
501
  r = p(r, 0, i - 1);
509
- const f = H(n, c, a), u = P(f, r, a), g = u < 0 ? -1 : f[u], h = () => o.u(c) + (g < 0 || g === r ? 0 : t.u(g + 1) - t.u(g)), m = () => o.u(i) - o.u(a);
502
+ const f = H(n, c, a), u = P(f, r, a), g = u < 0 ? -1 : f[u], h = () => o.u(c) + (g < 0 || g === r ? 0 : o.u(g + 1) - o.u(g)), m = () => o.u(i) - o.u(a);
510
503
  if ("nearest" === s) {
511
504
  if (r < c || r >= a) return;
512
505
  const e = h(), o = t.M() + e, n = t.o() - e - m(), l = t.$(r);
@@ -524,22 +517,22 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
524
517
  const e = h(), o = t.$(r) - (t.o() - e - m());
525
518
  return t.u(r) - e + ("end" === s ? o : "center" === s ? o / 2 : 0);
526
519
  });
527
- }, ee = z ? r : o, te = "current", oe = (e, t) => {
528
- if (Array.isArray(e)) for (const o of e) oe(o, t); else null == e || "boolean" == typeof e || t.push(e);
529
- }, ne = (e, t) => {
520
+ }, Z = z ? r : o, ee = "current", te = (e, t) => {
521
+ if (Array.isArray(e)) for (const o of e) te(o, t); else null == e || "boolean" == typeof e || t.push(e);
522
+ }, oe = (e, t) => {
530
523
  const o = e.key;
531
524
  return null != o ? o : "_" + t;
532
- }, re = e => {
525
+ }, ne = e => {
533
526
  const t = i(null);
534
527
  return t.current || (t.current = e());
535
- }, se = e => {
528
+ }, re = e => {
536
529
  const t = i(e);
537
- return ee(() => {
538
- t[te] = e;
530
+ return Z(() => {
531
+ t[ee] = e;
539
532
  }, [ e ]), t;
540
- }, le = /*#__PURE__*/ t(({ee: e, te: t, oe: o, ne: n, re: r, se: l, le: a, ie: f}) => {
533
+ }, se = /*#__PURE__*/ t(({ee: e, te: t, oe: o, ne: n, re: r, se: l, le: a, ie: f}) => {
541
534
  const u = i(null);
542
- ee(() => t(u[te], o), [ o ]);
535
+ Z(() => t(u[ee], o), [ o ]);
543
536
  const d = s(() => {
544
537
  const e = {
545
538
  contain: "layout style",
@@ -562,23 +555,23 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
562
555
  index: o,
563
556
  children: e
564
557
  });
565
- }), ie = (e, t) => s(() => {
558
+ }), le = (e, t) => s(() => {
566
559
  if ("function" == typeof e) return [ o => e(t[o], o), t.length ];
567
560
  const o = (e => {
568
561
  const t = [];
569
- return oe(e, t), t;
562
+ return te(e, t), t;
570
563
  })(e);
571
564
  return [ e => o[e], o.length ];
572
- }, [ e, t ]), ce = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: s, horizontal: f, keepMounted: u, cache: d, startMargin: $ = 0, ssrCount: g, as: h = "div", item: p = "div", scrollRef: w, onScroll: S, onScrollEnd: v}, z) => {
573
- const [y, I] = ie(e, t), x = i(null), R = i(!!g), T = se(S), C = se(v), [O, E, L, A] = re(() => {
565
+ }, [ e, t ]), ie = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: s, horizontal: f, keepMounted: u, cache: d, startMargin: $ = 0, ssrCount: g, as: h = "div", item: p = "div", scrollRef: w, onScroll: S, onScrollEnd: v}, z) => {
566
+ const [y, I] = le(e, t), x = i(null), R = i(!!g), T = re(S), C = re(v), [O, E, L, A] = ne(() => {
574
567
  const e = !!f, t = M(I, r, d), o = k(t, g);
575
- return [ o, t, F(o, e), e ];
568
+ return [ o, t, U(o, e), e ];
576
569
  });
577
570
  I !== O.T() && O.W(5, [ I, s ]), $ !== O.O() && O.W(6, $);
578
571
  const [W, H] = l(O.I, void 0, O.I), P = O.C(), q = O.t(), B = [], D = e => {
579
572
  const t = y(e);
580
573
  /* @__PURE__ */
581
- return c(le, {
574
+ return c(se, {
582
575
  te: L.G,
583
576
  oe: e,
584
577
  ne: O.u(e),
@@ -586,24 +579,24 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
586
579
  se: p,
587
580
  ee: t,
588
581
  le: A,
589
- ie: R[te]
590
- }, ne(t, e));
582
+ ie: R[ee]
583
+ }, oe(t, e));
591
584
  };
592
- if (ee(() => {
593
- R[te] = !1, O.A(1, e => {
585
+ if (Z(() => {
586
+ R[ee] = !1, O.A(1, e => {
594
587
  e ? a(H) : H();
595
588
  }), O.A(4, () => {
596
589
  T.current && T.current(O.M());
597
590
  }), O.A(8, () => {
598
591
  C.current && C.current();
599
592
  });
600
- const e = x[te];
593
+ const e = x[ee];
601
594
  return w ? _(() => {
602
- w.current && L.F(e, w[te]);
595
+ w.current && L.F(e, w[ee]);
603
596
  }) : L.F(e), () => {
604
597
  O.v(), L.v();
605
598
  };
606
- }, []), ee(() => {
599
+ }, []), Z(() => {
607
600
  L.N();
608
601
  }, [ W ]), n(z, () => ({
609
602
  get cache() {
@@ -621,10 +614,10 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
621
614
  findItemIndex: O.k,
622
615
  getItemOffset: O.u,
623
616
  getItemSize: O.$,
624
- scrollToIndex: (e, t) => Q(L, O, e, t),
625
- scrollTo: e => N(L, e),
617
+ scrollToIndex: (e, t) => N(L, O, e, t),
618
+ scrollTo: e => K(L, e),
626
619
  scrollBy: e => ((e, t, o) => {
627
- N(e, o + t.M());
620
+ K(e, o + t.M());
628
621
  })(L, O, e)
629
622
  }), []), u) {
630
623
  const e = new Set(u);
@@ -647,7 +640,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
647
640
  },
648
641
  children: B
649
642
  });
650
- }), ae = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: s, keepMounted: l, cache: i, ssrCount: a, item: f, onScroll: u, onScrollEnd: d, style: $, ...g}, h) => /* @__PURE__ */ c("div", {
643
+ }), ce = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: n, shift: r, horizontal: s, keepMounted: l, cache: i, ssrCount: a, item: f, onScroll: u, onScrollEnd: d, style: $, ...g}, h) => /* @__PURE__ */ c("div", {
651
644
  ...g,
652
645
  style: {
653
646
  display: s ? "inline-block" : "block",
@@ -657,7 +650,7 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
657
650
  height: "100%",
658
651
  ...$
659
652
  },
660
- children: /* @__PURE__ */ c(ce, {
653
+ children: /* @__PURE__ */ c(ie, {
661
654
  ref: h,
662
655
  data: t,
663
656
  bufferSize: o,
@@ -672,22 +665,22 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
672
665
  onScrollEnd: d,
673
666
  children: e
674
667
  })
675
- })), fe = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: s, horizontal: f, cache: u, ssrCount: d, as: $ = "div", item: g = "div", onScroll: h, onScrollEnd: p}, m) => {
676
- const [w, S] = ie(e, t), _ = i(null), v = se(h), z = se(p), y = i(!!d), [I, x, b, R] = re(() => {
668
+ })), ae = /*#__PURE__*/ e(({children: e, data: t, bufferSize: o, itemSize: r, shift: s, horizontal: f, cache: u, ssrCount: d, as: $ = "div", item: g = "div", onScroll: h, onScrollEnd: p}, m) => {
669
+ const [w, S] = le(e, t), _ = i(null), v = re(h), z = re(p), y = i(!!d), [I, x, b, R] = ne(() => {
677
670
  const e = !!f, t = M(S, r, u), o = k(t, d);
678
- return [ o, t, G(o, e), e ];
671
+ return [ o, t, F(o, e), e ];
679
672
  });
680
673
  S !== I.T() && I.W(5, [ S, s ]);
681
674
  const [T, C] = l(I.I, void 0, I.I), O = I.C(), E = I.t(), L = [];
682
- ee(() => (y[te] = !1, I.A(1, e => {
675
+ Z(() => (y[ee] = !1, I.A(1, e => {
683
676
  e ? a(C) : C();
684
677
  }), I.A(4, () => {
685
678
  v.current && v.current();
686
679
  }), I.A(8, () => {
687
680
  z.current && z.current();
688
- }), b.F(_[te]), () => {
681
+ }), b.F(_[ee]), () => {
689
682
  I.v(), b.v();
690
- }), []), ee(() => {
683
+ }), []), Z(() => {
691
684
  b.N();
692
685
  }, [ T ]), n(m, () => ({
693
686
  get cache() {
@@ -702,11 +695,11 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
702
695
  findItemIndex: I.k,
703
696
  getItemOffset: I.u,
704
697
  getItemSize: I.$,
705
- scrollToIndex: (e, t) => Q(b, I, e, t)
698
+ scrollToIndex: (e, t) => N(b, I, e, t)
706
699
  }), []);
707
700
  for (let [e, t] = I.l(o); e <= t; e++) {
708
701
  const t = w(e);
709
- L.push(/* @__PURE__ */ c(le, {
702
+ L.push(/* @__PURE__ */ c(se, {
710
703
  te: b.G,
711
704
  oe: e,
712
705
  ne: I.u(e),
@@ -714,8 +707,8 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
714
707
  se: g,
715
708
  ee: t,
716
709
  le: R,
717
- ie: y[te]
718
- }, ne(t, e)));
710
+ ie: y[ee]
711
+ }, oe(t, e)));
719
712
  }
720
713
  /* @__PURE__ */
721
714
  return c($, {
@@ -731,10 +724,10 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
731
724
  },
732
725
  children: L
733
726
  });
734
- }), ue = /*#__PURE__*/ t(({ce: {ae: e, fe: t, ue: o, de: n, $e: r, ge: s, he: l, pe: a}, ee: f, me: u, we: d, Se: $, te: g}) => {
727
+ }), fe = /*#__PURE__*/ t(({ce: {ae: e, fe: t, ue: o, de: n, $e: r, ge: s, he: l, pe: a}, ee: f, me: u, we: d, Se: $, te: g}) => {
735
728
  const h = i(null);
736
- return ee(() => {
737
- if (null != n || null != r) return g(h[te], n, r);
729
+ return Z(() => {
730
+ if (null != n || null != r) return g(h[ee], n, r);
738
731
  }, [ n, r, g ]), /* @__PURE__ */ c("div", {
739
732
  ref: h,
740
733
  role: s,
@@ -748,11 +741,11 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
748
741
  colIndex: e
749
742
  })
750
743
  });
751
- }), de = /*#__PURE__*/ t(({ce: {_e: e, ve: t, pe: o}, ee: n, me: r, ze: s, te: l}) => /* @__PURE__ */ c("div", {
744
+ }), ue = /*#__PURE__*/ t(({ce: {_e: e, ve: t, pe: o}, ee: n, me: r, ze: s, te: l}) => /* @__PURE__ */ c("div", {
752
745
  role: "row",
753
746
  "aria-rowindex": e + 1,
754
747
  style: o,
755
- children: t.map(t => /* @__PURE__ */ c(ue, {
748
+ children: t.map(t => /* @__PURE__ */ c(fe, {
756
749
  ce: t,
757
750
  ee: n,
758
751
  me: r,
@@ -760,183 +753,179 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
760
753
  Se: e,
761
754
  te: l
762
755
  }, t.ae))
763
- })), $e = ({ce: {ye: e, pe: t}, ee: o, Ie: n, ze: r, te: s}) => /* @__PURE__ */ c("div", {
756
+ })), de = ({ce: {ye: e, pe: t}, ee: o, Ie: n, ze: r, te: s}) => /* @__PURE__ */ c("div", {
764
757
  role: "rowgroup",
765
758
  style: t,
766
- children: e.map(e => /* @__PURE__ */ c(de, {
759
+ children: e.map(e => /* @__PURE__ */ c(ue, {
767
760
  ce: e,
768
761
  ee: o,
769
762
  me: O(n, e._e),
770
763
  ze: r,
771
764
  te: s
772
765
  }, e._e))
773
- }), ge = /*#__PURE__*/ e(({children: e, rows: t, cols: o, rowHeight: r, colWidth: s, headerRows: f, sectionRows: g, footerRows: h, headerCols: w, footerCols: S, spans: _, keepMounted: v, bufferSize: z, gap: y = 0, ariaSort: I, onVerticalScroll: x, onHorizontalScroll: R, onScrollEnd: T, style: M, ...C}, B) => {
774
- const J = i(null), U = se(x), F = se(R), G = se(T), [N, Q, oe, ne, le] = re(() => {
766
+ }), $e = /*#__PURE__*/ e(({children: e, rows: t, cols: o, rowHeight: r, colWidth: s, headerRows: f, sectionRows: g, footerRows: h, headerCols: w, footerCols: S, spans: _, keepMounted: v, bufferSize: z, gap: y = 0, ariaSort: I, onVerticalScroll: x, onHorizontalScroll: R, onScrollEnd: T, style: M, ...C}, q) => {
767
+ const j = i(null), J = re(x), U = re(R), F = re(T), [K, N, te, oe, se] = ne(() => {
775
768
  const e = E(t, r, y), n = E(o, s, y), l = k(e), i = k(n);
776
- return [ l, i, e, n, K(l, i) ];
769
+ return [ l, i, e, n, G(l, i) ];
777
770
  });
778
- L(N, oe, t, r, f, h), L(Q, ne, o, s, w, S);
779
- const ie = () => N.I() + Q.I(), [ce, ae] = l(ie, void 0, ie), fe = N.C() || Q.C(), ue = N.u(0), ge = Q.u(0), he = N.T(), pe = Q.T(), me = ((e, t, o, n, r = u, s = u, l = u, i) => {
771
+ L(K, te, t, r, f, h), L(N, oe, o, s, w, S);
772
+ const le = () => K.I() + N.I(), [ie, ce] = l(le, void 0, le), ae = K.C() || N.C(), fe = K.u(0), $e = N.u(0), ge = K.T(), he = N.T(), pe = ((e, t, o, n, r = u, s = u, l = u, i) => {
780
773
  const c = e.m(), a = t.m(), f = e.B(), g = e.D(), h = t.B(), w = t.D(), S = p(o[0], f, g), _ = d(o[1], g - 1), v = p(n[0], h, w), z = d(n[1], w - 1), y = H(r, f, g), I = $(h - 1, 0), x = [], b = [], k = [];
781
774
  for (const e of l) e.rowIndex < c && e.colIndex < a && k.push(e);
782
- const R = y.length;
783
- R && (q(x, y, S, g), b.push(I));
784
- let T = s, M = 0;
785
- do {
786
- for (;M < k.length; M++) {
787
- const {rowIndex: e, colIndex: t} = k[M];
788
- x.push(e), q(x, y, e, g), b.push(t);
789
- }
790
- const e = [];
791
- for (const t of T) {
792
- const o = t.rowIndex, n = t.colIndex, r = V(t, c), s = X(t, a);
793
- if (o < c && n < a && (r - o > 1 || s - n > 1)) {
794
- const l = W(x, o, r, f, S, _, g);
795
- if (l && W(b, n, s, h, v, z, w)) k.push(t); else if (l) {
796
- const n = P(y, r - 1, g);
797
- (o < f || n >= 0 && y[n] >= o) && e.push(t);
798
- } else n < h && e.push(t);
775
+ const R = k.length, T = y.length, M = P(y, S, g), C = M < 0 ? -1 : y[M];
776
+ C >= 0 && x.push(C);
777
+ for (const e of s) {
778
+ const t = e.rowIndex, o = e.colIndex, n = D(e, c), r = V(e, a);
779
+ if (t < c && o < a && (n - t > 1 || r - o > 1)) {
780
+ let s = (W(t, n, f, S, _, g) || C >= t && C < n) && W(o, r, h, v, z, w);
781
+ for (let e = 0; !s && e < R; e++) {
782
+ const {rowIndex: l, colIndex: i} = k[e];
783
+ s = l >= t && l < n && i >= o && i < r;
799
784
  }
785
+ s && k.push(e);
800
786
  }
801
- T = e;
802
- } while (M < k.length);
787
+ }
788
+ for (const {rowIndex: e, colIndex: t} of k) {
789
+ const o = P(y, e, g);
790
+ x.push(e), o >= 0 && x.push(y[o]), b.push(t);
791
+ }
803
792
  m(x), m(b);
804
- const C = D(x, c, f, S, _, g), O = D(b, a, h, v, z, w), E = C.length, L = O.length, B = /* @__PURE__ */ new Map, J = [], U = [];
793
+ const O = B(x, c, f, S, _, g), E = B(b, a, h, v, z, w), L = O.length, q = E.length, j = /* @__PURE__ */ new Map, J = [], U = [];
805
794
  for (const e of k) {
806
- const t = V(e, c), o = X(e, a);
795
+ const t = D(e, c), o = V(e, a);
807
796
  J.push(t), U.push(o);
808
- const n = O.indexOf(e.colIndex);
809
- for (let r = C.indexOf(e.rowIndex); r < E && C[r] < t; r++) {
810
- const t = C[r] * a;
811
- for (let r = n; r < L && O[r] < o; r++) B.set(t + O[r], e);
797
+ const n = E.indexOf(e.colIndex);
798
+ for (let r = O.indexOf(e.rowIndex); r < L && O[r] < t; r++) {
799
+ const t = O[r] * a;
800
+ for (let r = n; r < q && E[r] < o; r++) j.set(t + E[r], e);
812
801
  }
813
802
  }
814
803
  const F = [];
815
- for (const e of O) F.push(!t.P(e) && null);
804
+ for (const e of E) F.push(!t.P(e) && null);
816
805
  const G = [], K = e.u(f), N = [];
817
806
  let Q = N;
818
807
  const Z = A.get(e), ee = /* @__PURE__ */ new Map;
819
- for (const o of C) {
820
- const n = o < f, r = o >= g, s = r || o >= S && o <= _, l = P(y, o, g), u = n ? 0 : r ? g : l < 0 ? -1 : y[l];
821
- if (o === u) {
822
- const e = n ? f : r ? c : l + 1 < R ? y[l + 1] : g;
808
+ for (const o of O) {
809
+ const n = o < f, r = o >= g, s = P(y, o, g), l = n ? 0 : r ? g : s < 0 ? -1 : y[s];
810
+ if (o === l) {
811
+ const e = n ? f : r ? c : s + 1 < T ? y[s + 1] : g;
823
812
  J.push(e);
824
813
  const t = [];
825
814
  N.push({
826
- xe: n ? -1 : r ? -2 : -3 - u,
815
+ xe: n ? -1 : r ? -2 : -3 - l,
827
816
  ye: t,
828
- pe: j(u, e, n || r ? 0 : null, r ? "bottom" : "top", 4)
817
+ pe: Y(l, e, n || r ? 0 : null, r ? "bottom" : "top", 4)
829
818
  }), Q = t;
830
- } else u < 0 && (Q = N);
831
- const d = l >= 0 && o === u, p = d ? K : null, m = o * a, x = Z && Z.get(o), b = x && x.ve, k = [];
832
- let T = 0, M = !e.P(o) && null, C = o + 1, E = !1;
833
- for (let e = 0; e < L; e++) {
834
- const r = O[e], l = r < h, f = r >= w, u = f || r >= v && r <= z, g = B.get(m + r);
835
- if (g ? g.rowIndex === o && g.colIndex === r : s && u || n || d || l) {
836
- const s = g ? V(g, c) : o + 1, u = g ? X(g, a) : r + 1, h = s - o, p = u - r, m = h > 1, w = p > 1, S = m || w;
819
+ } else l < 0 && (Q = N);
820
+ const u = s >= 0 && o === l, d = n || r || o === C || o >= S && o <= _, p = u ? K : null, m = o * a, x = Z && Z.get(o), b = x && x.ve, k = [];
821
+ let R = 0, M = !e.P(o) && null, O = o + 1, L = !1;
822
+ for (let e = 0; e < q; e++) {
823
+ const r = E[e], s = r < h, l = r >= w, f = s || l || r >= v && r <= z, g = j.get(m + r);
824
+ if (g ? g.rowIndex === o && g.colIndex === r : d && f) {
825
+ const f = g ? D(g, c) : o + 1, d = g ? V(g, a) : r + 1, h = f - o, p = d - r, m = h > 1, w = p > 1, S = m || w;
837
826
  let _, v;
838
- C = $(C, s);
839
- const z = l ? t.u(r) : null, y = f ? t.t() - t.u(u - 1) - t.$(u - 1) : null;
827
+ O = $(O, f);
828
+ const z = s ? t.u(r) : null, y = l ? t.t() - t.u(d - 1) - t.$(d - 1) : null;
840
829
  !1 !== M || m || (_ = o, M = !0), !1 !== F[e] || w || (v = r, F[e] = !0);
841
- const x = n ? "columnheader" : r === I && (l || d) ? "rowheader" : "cell", R = S ? h : void 0, O = S ? p : void 0, L = "cell" !== x && i && i.rowIndex === o && i.colIndex === r ? i.order : void 0;
830
+ const x = n ? "columnheader" : r === I && (s || u) ? "rowheader" : "cell", T = S ? h : void 0, C = S ? p : void 0, E = "cell" !== x && i && i.rowIndex === o && i.colIndex === r ? i.order : void 0;
842
831
  let A;
843
832
  if (b) {
844
833
  const e = b.length;
845
- for (;T < e && b[T].ae < r; ) T++;
846
- T < e && b[T].ae === r && (A = b[T]);
834
+ for (;R < e && b[R].ae < r; ) R++;
835
+ R < e && b[R].ae === r && (A = b[R]);
847
836
  }
848
- if (!A || A.fe !== R || A.ue !== O || A.be !== z || A.ke !== y || A.de !== _ || A.$e !== v || A.ge !== x || A.he !== L) {
837
+ if (!A || A.fe !== T || A.ue !== C || A.be !== z || A.ke !== y || A.de !== _ || A.$e !== v || A.ge !== x || A.he !== E) {
849
838
  let e = "1/l" + r;
850
- S && (e += "/l" + s + "/l" + u);
839
+ S && (e += "/l" + f + "/l" + d);
851
840
  const t = {
852
841
  contain: "layout style",
853
842
  display: "grid",
854
843
  gridArea: e
855
844
  };
856
845
  m && (t.height = "0px", t.minHeight = "100%", t.zIndex = 1), w && (t.width = "0px",
857
- t.minWidth = "100%"), (l || f) && (t[l ? "insetInlineStart" : "insetInlineEnd"] = (l ? z : y) + "px",
846
+ t.minWidth = "100%"), (s || l) && (t[s ? "insetInlineStart" : "insetInlineEnd"] = (s ? z : y) + "px",
858
847
  t.position = "sticky", t.zIndex = 2), A = {
859
848
  ae: r,
860
- fe: R,
861
- ue: O,
849
+ fe: T,
850
+ ue: C,
862
851
  de: _,
863
852
  $e: v,
864
853
  ge: x,
865
- he: L,
854
+ he: E,
866
855
  pe: t,
867
856
  be: z,
868
857
  ke: y
869
- }, E = !0;
858
+ }, L = !0;
870
859
  }
871
860
  k.push(A);
872
861
  }
873
862
  }
874
863
  if (G.push(M), k.length) {
875
- const e = x && !E && x.ve.length === k.length && x.Re === p ? x : {
864
+ const e = x && !L && x.ve.length === k.length && x.Re === p ? x : {
876
865
  _e: o,
877
866
  ve: k,
878
- pe: j(o, C, p, "top", 3),
867
+ pe: Y(o, O, p, "top", 3),
879
868
  Re: p
880
869
  };
881
870
  ee.set(o, e), Q.push(e);
882
871
  }
883
872
  }
884
873
  return A.set(e, ee), {
885
- Te: Y(e, C, G, m(J), "max-content", c),
886
- Me: Y(t, O, F, m(U), "minmax(max-content,auto)", a),
874
+ Te: X(e, O, G, m(J), "max-content", c),
875
+ Me: X(t, E, F, m(U), "minmax(max-content,auto)", a),
887
876
  Ce: N
888
877
  };
889
- })(oe, ne, N.l(z), Q.l(z), g, _, v, I), we = se(e => ((e, t, o, n, r, s = u, {rowIndex: l, colIndex: i, rowAlign: c, colAlign: a}) => {
890
- null != l && Z(e, t, n, s, l, c, !1), null != i && Z(e, o, r, u, i, a, !0);
891
- })(le, N, Q, oe, ne, g, e));
892
- return ee(() => {
878
+ })(te, oe, K.l(z), N.l(z), g, _, v, I), me = re(e => ((e, t, o, n, r, s = u, {rowIndex: l, colIndex: i, rowAlign: c, colAlign: a}) => {
879
+ null != l && Q(e, t, n, s, l, c, !1), null != i && Q(e, o, r, u, i, a, !0);
880
+ })(se, K, N, te, oe, g, e));
881
+ return Z(() => {
893
882
  const e = e => {
894
- e ? a(ae) : ae();
883
+ e ? a(ce) : ce();
895
884
  };
896
- N.A(1, e), Q.A(1, e);
885
+ K.A(1, e), N.A(1, e);
897
886
  let t = !1;
898
- N.A(4, () => {
887
+ K.A(4, () => {
888
+ t = !0, J.current && J.current(K.M());
889
+ }), N.A(4, () => {
899
890
  t = !0, U.current && U.current(N.M());
900
- }), Q.A(4, () => {
901
- t = !0, F.current && F.current(Q.M());
902
891
  });
903
892
  const o = () => {
904
- !t || N.C() || Q.C() || (t = !1, G.current && G.current());
893
+ !t || K.C() || N.C() || (t = !1, F.current && F.current());
905
894
  };
906
- return N.A(8, o), Q.A(8, o), le.F(J[te]), () => {
907
- N.v(), Q.v(), le.v();
895
+ return K.A(8, o), N.A(8, o), se.F(j[ee]), () => {
896
+ K.v(), N.v(), se.v();
908
897
  };
909
- }, []), ee(() => {
910
- le.N();
911
- }, [ ce ]), n(B, () => ({
898
+ }, []), Z(() => {
899
+ se.N();
900
+ }, [ ie ]), n(q, () => ({
912
901
  get verticalScrollOffset() {
913
- return N.M();
902
+ return K.M();
914
903
  },
915
904
  get horizontalScrollOffset() {
916
- return Q.M();
905
+ return N.M();
917
906
  },
918
907
  get scrollHeight() {
919
- return b(N);
908
+ return b(K);
920
909
  },
921
910
  get scrollWidth() {
922
- return b(Q);
911
+ return b(N);
923
912
  },
924
913
  get viewportHeight() {
925
- return N.o();
914
+ return K.o();
926
915
  },
927
916
  get viewportWidth() {
928
- return Q.o();
929
- },
930
- findRowIndex: N.k,
931
- findColIndex: Q.k,
932
- getRowOffset: N.u,
933
- getColOffset: Q.u,
934
- getRowSize: N.$,
935
- getColSize: Q.$,
936
- scrollToIndex: e => we[te](e),
917
+ return N.o();
918
+ },
919
+ findRowIndex: K.k,
920
+ findColIndex: N.k,
921
+ getRowOffset: K.u,
922
+ getColOffset: N.u,
923
+ getRowSize: K.$,
924
+ getColSize: N.$,
925
+ scrollToIndex: e => me[ee](e),
937
926
  scrollTo: ({vertical: e, horizontal: t}) => ((e, t, o) => {
938
927
  null != t && e.K(!1, () => t), null != o && e.K(!0, () => o);
939
- })(le, e, t),
928
+ })(se, e, t),
940
929
  scrollBy: ({vertical: e, horizontal: t}) => ((e, t, o, n, r) => {
941
930
  if (null != n) {
942
931
  const o = n + t.M();
@@ -946,11 +935,11 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
946
935
  const t = r + o.M();
947
936
  e.K(!0, () => t);
948
937
  }
949
- })(le, N, Q, e, t)
938
+ })(se, K, N, e, t)
950
939
  }), []), /* @__PURE__ */ c("div", {
951
940
  role: "table",
952
- "aria-rowcount": he,
953
- "aria-colcount": pe,
941
+ "aria-rowcount": ge,
942
+ "aria-colcount": he,
954
943
  ...C,
955
944
  style: {
956
945
  overflow: "auto",
@@ -960,36 +949,36 @@ f), b = e => $(e.t(), e.o()), k = ({l: e, i: t, u: o, $: n, h: r, p: s, t: l, m:
960
949
  ...M
961
950
  },
962
951
  children: /* @__PURE__ */ c("div", {
963
- ref: J,
952
+ ref: j,
964
953
  style: {
965
954
  contain: "size style",
966
955
  overflowAnchor: "none",
967
956
  flex: "none",
968
957
  display: "grid",
969
- gridTemplateRows: me.Te,
970
- gridTemplateColumns: me.Me,
958
+ gridTemplateRows: pe.Te,
959
+ gridTemplateColumns: pe.Me,
971
960
  gap: y,
972
- marginTop: ue,
973
- marginInlineStart: ge,
974
- height: b(N) - ue,
975
- pointerEvents: fe ? "none" : void 0
961
+ marginTop: fe,
962
+ marginInlineStart: $e,
963
+ height: b(K) - fe,
964
+ pointerEvents: ae ? "none" : void 0
976
965
  },
977
- children: me.Ce.map(n => "ye" in n ? /* @__PURE__ */ c($e, {
966
+ children: pe.Ce.map(n => "ye" in n ? /* @__PURE__ */ c(de, {
978
967
  ce: n,
979
968
  ee: e,
980
969
  Ie: t,
981
970
  ze: o,
982
- te: le.G
983
- }, n.xe) : /* @__PURE__ */ c(de, {
971
+ te: se.G
972
+ }, n.xe) : /* @__PURE__ */ c(ue, {
984
973
  ce: n,
985
974
  ee: e,
986
975
  me: O(t, n._e),
987
976
  ze: o,
988
- te: le.G
977
+ te: se.G
989
978
  }, n._e))
990
979
  })
991
980
  });
992
981
  });
993
982
 
994
- export { ge as VGrid, ae as VList, ce as Virtualizer, fe as WindowVirtualizer };
983
+ export { $e as VGrid, ce as VList, ie as Virtualizer, ae as WindowVirtualizer };
995
984
  //# sourceMappingURL=index.js.map