react-virtuoso 4.12.7 → 4.12.8
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.cjs +1 -1
- package/dist/index.mjs +708 -706
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -45,10 +45,10 @@ function W(t, e) {
|
|
|
45
45
|
function We(t) {
|
|
46
46
|
t(qt);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function st(t) {
|
|
49
49
|
return t(En);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function O(t, e) {
|
|
52
52
|
return K(t, co(e, we));
|
|
53
53
|
}
|
|
54
54
|
function bt(t, e) {
|
|
@@ -117,7 +117,7 @@ function Lt(t) {
|
|
|
117
117
|
}, t));
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function _(...t) {
|
|
121
121
|
const e = new Array(t.length);
|
|
122
122
|
let n = 0, o = null;
|
|
123
123
|
const r = Math.pow(2, t.length) - 1;
|
|
@@ -169,7 +169,7 @@ function v(t) {
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
function ct(t, e) {
|
|
172
|
-
return ve(v(e), (n) =>
|
|
172
|
+
return ve(v(e), (n) => O(t, n));
|
|
173
173
|
}
|
|
174
174
|
function $() {
|
|
175
175
|
const t = [];
|
|
@@ -191,8 +191,8 @@ function $() {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return ve($(), (e) =>
|
|
194
|
+
function ht(t) {
|
|
195
|
+
return ve($(), (e) => O(t, e));
|
|
196
196
|
}
|
|
197
197
|
function U(t, e = [], { singleton: n } = { singleton: !0 }) {
|
|
198
198
|
return {
|
|
@@ -245,7 +245,7 @@ function an(...t) {
|
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
-
var
|
|
248
|
+
var mt = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t))(mt || {});
|
|
249
249
|
const go = {
|
|
250
250
|
0: "debug",
|
|
251
251
|
3: "error",
|
|
@@ -260,7 +260,7 @@ const go = {
|
|
|
260
260
|
return {
|
|
261
261
|
log: v((n, o, r = 1) => {
|
|
262
262
|
var i;
|
|
263
|
-
const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i :
|
|
263
|
+
const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i : st(t);
|
|
264
264
|
r >= s && console[go[r]](
|
|
265
265
|
"%creact-virtuoso: %c%s %o",
|
|
266
266
|
"color: #0253b3; font-weight: bold",
|
|
@@ -276,9 +276,9 @@ const go = {
|
|
|
276
276
|
{ singleton: !0 }
|
|
277
277
|
);
|
|
278
278
|
function Ht(t, e, n) {
|
|
279
|
-
return
|
|
279
|
+
return Ge(t, e, n).callbackRef;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Ge(t, e, n) {
|
|
282
282
|
const o = H.useRef(null);
|
|
283
283
|
let r = (i) => {
|
|
284
284
|
};
|
|
@@ -295,26 +295,26 @@ function _e(t, e, n) {
|
|
|
295
295
|
}
|
|
296
296
|
function kn(t, e, n, o, r, s, i, l, c) {
|
|
297
297
|
const a = H.useCallback(
|
|
298
|
-
(
|
|
299
|
-
const
|
|
300
|
-
let
|
|
301
|
-
for (; !
|
|
302
|
-
|
|
303
|
-
const
|
|
304
|
-
let
|
|
305
|
-
|
|
306
|
-
const
|
|
298
|
+
(p) => {
|
|
299
|
+
const I = So(p.children, e, l ? "offsetWidth" : "offsetHeight", r);
|
|
300
|
+
let h = p.parentElement;
|
|
301
|
+
for (; !h.dataset.virtuosoScroller; )
|
|
302
|
+
h = h.parentElement;
|
|
303
|
+
const f = h.lastElementChild.dataset.viewportType === "window";
|
|
304
|
+
let C;
|
|
305
|
+
f && (C = h.ownerDocument.defaultView);
|
|
306
|
+
const w = i ? l ? i.scrollLeft : i.scrollTop : f ? l ? C.scrollX || C.document.documentElement.scrollLeft : C.scrollY || C.document.documentElement.scrollTop : l ? h.scrollLeft : h.scrollTop, S = i ? l ? i.scrollWidth : i.scrollHeight : f ? l ? C.document.documentElement.scrollWidth : C.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, m = i ? l ? i.offsetWidth : i.offsetHeight : f ? l ? C.innerWidth : C.innerHeight : l ? h.offsetWidth : h.offsetHeight;
|
|
307
307
|
o({
|
|
308
|
-
scrollHeight:
|
|
309
|
-
scrollTop: Math.max(
|
|
310
|
-
viewportHeight:
|
|
308
|
+
scrollHeight: S,
|
|
309
|
+
scrollTop: Math.max(w, 0),
|
|
310
|
+
viewportHeight: m
|
|
311
311
|
}), s == null || s(
|
|
312
|
-
l ? dn("column-gap", getComputedStyle(
|
|
313
|
-
),
|
|
312
|
+
l ? dn("column-gap", getComputedStyle(p).columnGap, r) : dn("row-gap", getComputedStyle(p).rowGap, r)
|
|
313
|
+
), I !== null && t(I);
|
|
314
314
|
},
|
|
315
315
|
[t, e, r, s, i, o, l]
|
|
316
316
|
);
|
|
317
|
-
return
|
|
317
|
+
return Ge(a, n, c);
|
|
318
318
|
}
|
|
319
319
|
function So(t, e, n, o) {
|
|
320
320
|
const r = t.length;
|
|
@@ -325,40 +325,40 @@ function So(t, e, n, o) {
|
|
|
325
325
|
const l = t.item(i);
|
|
326
326
|
if (l.dataset.index === void 0)
|
|
327
327
|
continue;
|
|
328
|
-
const c = parseInt(l.dataset.index), a = parseFloat(l.dataset.knownSize),
|
|
329
|
-
if (
|
|
328
|
+
const c = parseInt(l.dataset.index), a = parseFloat(l.dataset.knownSize), p = e(l, n);
|
|
329
|
+
if (p === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), p === a)
|
|
330
330
|
continue;
|
|
331
|
-
const
|
|
332
|
-
s.length === 0 ||
|
|
331
|
+
const I = s[s.length - 1];
|
|
332
|
+
s.length === 0 || I.size !== p || I.endIndex !== c - 1 ? s.push({ endIndex: c, size: p, startIndex: c }) : s[s.length - 1].endIndex++;
|
|
333
333
|
}
|
|
334
334
|
return s;
|
|
335
335
|
}
|
|
336
336
|
function dn(t, e, n) {
|
|
337
|
-
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e,
|
|
337
|
+
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function _e(t, e, n) {
|
|
340
340
|
const o = H.useRef(null), r = H.useCallback(
|
|
341
341
|
(c) => {
|
|
342
342
|
if (!(c != null && c.offsetParent))
|
|
343
343
|
return;
|
|
344
|
-
const a = c.getBoundingClientRect(),
|
|
345
|
-
let
|
|
344
|
+
const a = c.getBoundingClientRect(), p = a.width;
|
|
345
|
+
let I, h;
|
|
346
346
|
if (e) {
|
|
347
|
-
const
|
|
348
|
-
|
|
347
|
+
const f = e.getBoundingClientRect(), C = a.top - f.top;
|
|
348
|
+
h = f.height - Math.max(0, C), I = C + e.scrollTop;
|
|
349
349
|
} else {
|
|
350
|
-
const
|
|
351
|
-
|
|
350
|
+
const f = i.current.ownerDocument.defaultView;
|
|
351
|
+
h = f.innerHeight - Math.max(0, a.top), I = a.top + f.scrollY;
|
|
352
352
|
}
|
|
353
353
|
o.current = {
|
|
354
|
-
offsetTop:
|
|
355
|
-
visibleHeight:
|
|
356
|
-
visibleWidth:
|
|
354
|
+
offsetTop: I,
|
|
355
|
+
visibleHeight: h,
|
|
356
|
+
visibleWidth: p
|
|
357
357
|
}, t(o.current);
|
|
358
358
|
},
|
|
359
359
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
360
360
|
[t, e]
|
|
361
|
-
), { callbackRef: s, ref: i } =
|
|
361
|
+
), { callbackRef: s, ref: i } = Ge(r, !0, n), l = H.useCallback(() => {
|
|
362
362
|
r(i.current);
|
|
363
363
|
}, [r, i]);
|
|
364
364
|
return H.useEffect(() => {
|
|
@@ -381,35 +381,35 @@ function Ge(t, e, n) {
|
|
|
381
381
|
}
|
|
382
382
|
const at = U(
|
|
383
383
|
() => {
|
|
384
|
-
const t = $(), e = $(), n = v(0), o = $(), r = v(0), s = $(), i = $(), l = v(0), c = v(0), a = v(0),
|
|
385
|
-
return
|
|
384
|
+
const t = $(), e = $(), n = v(0), o = $(), r = v(0), s = $(), i = $(), l = v(0), c = v(0), a = v(0), p = v(0), I = $(), h = $(), f = v(!1), C = v(!1), w = v(!1);
|
|
385
|
+
return O(
|
|
386
386
|
x(
|
|
387
387
|
t,
|
|
388
|
-
E(({ scrollTop:
|
|
388
|
+
E(({ scrollTop: S }) => S)
|
|
389
389
|
),
|
|
390
390
|
e
|
|
391
|
-
),
|
|
391
|
+
), O(
|
|
392
392
|
x(
|
|
393
393
|
t,
|
|
394
|
-
E(({ scrollHeight:
|
|
394
|
+
E(({ scrollHeight: S }) => S)
|
|
395
395
|
),
|
|
396
396
|
i
|
|
397
|
-
),
|
|
397
|
+
), O(e, r), {
|
|
398
398
|
deviation: n,
|
|
399
399
|
fixedFooterHeight: a,
|
|
400
400
|
fixedHeaderHeight: c,
|
|
401
|
-
footerHeight:
|
|
401
|
+
footerHeight: p,
|
|
402
402
|
headerHeight: l,
|
|
403
|
-
horizontalDirection:
|
|
404
|
-
scrollBy:
|
|
403
|
+
horizontalDirection: C,
|
|
404
|
+
scrollBy: h,
|
|
405
405
|
// input
|
|
406
406
|
scrollContainerState: t,
|
|
407
407
|
scrollHeight: i,
|
|
408
|
-
scrollingInProgress:
|
|
408
|
+
scrollingInProgress: f,
|
|
409
409
|
// signals
|
|
410
|
-
scrollTo:
|
|
410
|
+
scrollTo: I,
|
|
411
411
|
scrollTop: e,
|
|
412
|
-
skipAnimationFrameInResizeObserver:
|
|
412
|
+
skipAnimationFrameInResizeObserver: w,
|
|
413
413
|
smoothScrollTargetReached: o,
|
|
414
414
|
// state
|
|
415
415
|
statefulScrollTop: r,
|
|
@@ -419,7 +419,7 @@ const at = U(
|
|
|
419
419
|
[],
|
|
420
420
|
{ singleton: !0 }
|
|
421
421
|
), oe = { lvl: 0 };
|
|
422
|
-
function
|
|
422
|
+
function Fn(t, e) {
|
|
423
423
|
const n = t.length;
|
|
424
424
|
if (n === 0)
|
|
425
425
|
return [];
|
|
@@ -449,8 +449,8 @@ function Ct(t, e, n = "k") {
|
|
|
449
449
|
}
|
|
450
450
|
return Ct(t.l, e, n);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
return j(t) ? zn(e, n, 1) : e === t.k ? ot(t, { k: e, v: n }) : e < t.k ? fn(ot(t, { l:
|
|
452
|
+
function pt(t, e, n) {
|
|
453
|
+
return j(t) ? zn(e, n, 1) : e === t.k ? ot(t, { k: e, v: n }) : e < t.k ? fn(ot(t, { l: pt(t.l, e, n) })) : fn(ot(t, { r: pt(t.r, e, n) }));
|
|
454
454
|
}
|
|
455
455
|
function Ut() {
|
|
456
456
|
return oe;
|
|
@@ -471,12 +471,12 @@ function Le(t, e) {
|
|
|
471
471
|
return o;
|
|
472
472
|
{
|
|
473
473
|
const [s, i] = Ln(o);
|
|
474
|
-
return ge(ot(t, { k: s, l:
|
|
474
|
+
return ge(ot(t, { k: s, l: On(o), v: i }));
|
|
475
475
|
}
|
|
476
476
|
} else return e < n ? ge(ot(t, { l: Le(o, e) })) : ge(ot(t, { r: Le(r, e) }));
|
|
477
477
|
}
|
|
478
|
-
function
|
|
479
|
-
return j(t) ? [] : [...
|
|
478
|
+
function Gt(t) {
|
|
479
|
+
return j(t) ? [] : [...Gt(t.l), { k: t.k, v: t.v }, ...Gt(t.r)];
|
|
480
480
|
}
|
|
481
481
|
function ze(t, e, n) {
|
|
482
482
|
if (j(t))
|
|
@@ -528,8 +528,8 @@ function ot(t, e) {
|
|
|
528
528
|
e.r !== void 0 ? e.r : t.r
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
return j(t.r) ? t.l : ge(ot(t, { r:
|
|
531
|
+
function On(t) {
|
|
532
|
+
return j(t.r) ? t.l : ge(ot(t, { r: On(t.r) }));
|
|
533
533
|
}
|
|
534
534
|
function Ee(t) {
|
|
535
535
|
return j(t) || t.lvl > t.r.lvl;
|
|
@@ -552,7 +552,7 @@ function Ve(t) {
|
|
|
552
552
|
return !j(n) && !j(n.r) && n.lvl === e && n.r.lvl === e ? ot(n, { l: ot(t, { r: n.l }), lvl: e + 1 }) : t;
|
|
553
553
|
}
|
|
554
554
|
function xo(t) {
|
|
555
|
-
return
|
|
555
|
+
return Fn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
|
|
556
556
|
}
|
|
557
557
|
function Pn(t, e) {
|
|
558
558
|
return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
|
|
@@ -615,16 +615,16 @@ function wo(t, e) {
|
|
|
615
615
|
for (const o of e) {
|
|
616
616
|
const { endIndex: r, size: s, startIndex: i } = o;
|
|
617
617
|
if (n = Math.min(n, i), j(t)) {
|
|
618
|
-
t =
|
|
618
|
+
t = pt(t, 0, s);
|
|
619
619
|
continue;
|
|
620
620
|
}
|
|
621
621
|
const l = ye(t, i - 1, r + 1);
|
|
622
622
|
if (l.some(Bo(o)))
|
|
623
623
|
continue;
|
|
624
624
|
let c = !1, a = !1;
|
|
625
|
-
for (const { end:
|
|
626
|
-
c ? (r >=
|
|
627
|
-
a && (t =
|
|
625
|
+
for (const { end: p, start: I, value: h } of l)
|
|
626
|
+
c ? (r >= I || s === h) && (t = Le(t, I)) : (a = h !== s, c = !0), p > r && r >= I && h !== s && (t = pt(t, r + 1, h));
|
|
627
|
+
a && (t = pt(t, i, s));
|
|
628
628
|
}
|
|
629
629
|
return [t, n];
|
|
630
630
|
}
|
|
@@ -658,32 +658,32 @@ function Wn(t, e, n) {
|
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
function Ro(t, e, n, o = 0) {
|
|
661
|
-
return o > 0 && (e = Math.max(e, An(t, o, De).offset)),
|
|
661
|
+
return o > 0 && (e = Math.max(e, An(t, o, De).offset)), Fn(To(t, e, n, yo), Eo);
|
|
662
662
|
}
|
|
663
663
|
function bo(t, [e, n, o, r]) {
|
|
664
|
-
e.length > 0 && o("received item sizes", e,
|
|
664
|
+
e.length > 0 && o("received item sizes", e, mt.DEBUG);
|
|
665
665
|
const s = t.sizeTree;
|
|
666
666
|
let i = s, l = 0;
|
|
667
667
|
if (n.length > 0 && j(s) && e.length === 2) {
|
|
668
|
-
const
|
|
669
|
-
i = n.reduce((
|
|
668
|
+
const h = e[0].size, f = e[1].size;
|
|
669
|
+
i = n.reduce((C, w) => pt(pt(C, w, h), w + 1, f), i);
|
|
670
670
|
} else
|
|
671
671
|
[i, l] = wo(i, e);
|
|
672
672
|
if (i === s)
|
|
673
673
|
return t;
|
|
674
|
-
const { lastIndex: c, lastOffset: a, lastSize:
|
|
674
|
+
const { lastIndex: c, lastOffset: a, lastSize: p, offsetTree: I } = Pe(t.offsetTree, l, i, r);
|
|
675
675
|
return {
|
|
676
676
|
groupIndices: n,
|
|
677
|
-
groupOffsetTree: n.reduce((
|
|
677
|
+
groupOffsetTree: n.reduce((h, f) => pt(h, f, ie(f, I, r)), Ut()),
|
|
678
678
|
lastIndex: c,
|
|
679
679
|
lastOffset: a,
|
|
680
|
-
lastSize:
|
|
681
|
-
offsetTree:
|
|
680
|
+
lastSize: p,
|
|
681
|
+
offsetTree: I,
|
|
682
682
|
sizeTree: i
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
function Ho(t) {
|
|
686
|
-
return
|
|
686
|
+
return Gt(t).map(({ k: e, v: n }, o, r) => {
|
|
687
687
|
const s = r[o + 1];
|
|
688
688
|
return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: e };
|
|
689
689
|
});
|
|
@@ -698,17 +698,17 @@ function Pe(t, e, n, o) {
|
|
|
698
698
|
let r = t, s = 0, i = 0, l = 0, c = 0;
|
|
699
699
|
if (e !== 0) {
|
|
700
700
|
c = Se(r, e - 1, De), l = r[c].offset;
|
|
701
|
-
const
|
|
702
|
-
s =
|
|
701
|
+
const p = Ct(n, e - 1);
|
|
702
|
+
s = p[0], i = p[1], r.length && r[c].size === Ct(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
|
|
703
703
|
} else
|
|
704
704
|
r = [];
|
|
705
|
-
for (const { start: a, value:
|
|
706
|
-
const
|
|
705
|
+
for (const { start: a, value: p } of ye(n, e, 1 / 0)) {
|
|
706
|
+
const I = a - s, h = I * i + l + I * o;
|
|
707
707
|
r.push({
|
|
708
708
|
index: a,
|
|
709
|
-
offset:
|
|
710
|
-
size:
|
|
711
|
-
}), s = a, l =
|
|
709
|
+
offset: h,
|
|
710
|
+
size: p
|
|
711
|
+
}), s = a, l = h, i = p;
|
|
712
712
|
}
|
|
713
713
|
return {
|
|
714
714
|
lastIndex: s,
|
|
@@ -729,116 +729,116 @@ const ko = {
|
|
|
729
729
|
offsetWidth: "width"
|
|
730
730
|
}, Et = U(
|
|
731
731
|
([{ log: t }, { recalcInProgress: e }]) => {
|
|
732
|
-
const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l = v(0), c = v([]), a = v(void 0),
|
|
733
|
-
x(n,
|
|
734
|
-
|
|
735
|
-
),
|
|
732
|
+
const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l = v(0), c = v([]), a = v(void 0), p = v(void 0), I = v((g, d) => wt(g, ko[d])), h = v(void 0), f = v(0), C = Co(), w = ct(
|
|
733
|
+
x(n, _(c, t, f), Rt(bo, C), Y()),
|
|
734
|
+
C
|
|
735
|
+
), S = ct(
|
|
736
736
|
x(
|
|
737
737
|
c,
|
|
738
738
|
Y(),
|
|
739
|
-
Rt((
|
|
739
|
+
Rt((g, d) => ({ current: d, prev: g.current }), {
|
|
740
740
|
current: [],
|
|
741
741
|
prev: []
|
|
742
742
|
}),
|
|
743
|
-
E(({ prev:
|
|
743
|
+
E(({ prev: g }) => g)
|
|
744
744
|
),
|
|
745
745
|
[]
|
|
746
746
|
);
|
|
747
|
-
|
|
747
|
+
O(
|
|
748
748
|
x(
|
|
749
749
|
c,
|
|
750
|
-
P((
|
|
751
|
-
|
|
752
|
-
E(([
|
|
753
|
-
const k =
|
|
750
|
+
P((g) => g.length > 0),
|
|
751
|
+
_(w, f),
|
|
752
|
+
E(([g, d, b]) => {
|
|
753
|
+
const k = g.reduce((F, L, V) => pt(F, L, ie(L, d.offsetTree, b) || V), Ut());
|
|
754
754
|
return {
|
|
755
755
|
...d,
|
|
756
|
-
groupIndices:
|
|
756
|
+
groupIndices: g,
|
|
757
757
|
groupOffsetTree: k
|
|
758
758
|
};
|
|
759
759
|
})
|
|
760
760
|
),
|
|
761
|
-
|
|
762
|
-
),
|
|
761
|
+
w
|
|
762
|
+
), O(
|
|
763
763
|
x(
|
|
764
764
|
o,
|
|
765
|
-
|
|
766
|
-
P(([
|
|
767
|
-
E(([
|
|
765
|
+
_(w),
|
|
766
|
+
P(([g, { lastIndex: d }]) => g < d),
|
|
767
|
+
E(([g, { lastIndex: d, lastSize: b }]) => [
|
|
768
768
|
{
|
|
769
769
|
endIndex: d,
|
|
770
770
|
size: b,
|
|
771
|
-
startIndex:
|
|
771
|
+
startIndex: g
|
|
772
772
|
}
|
|
773
773
|
])
|
|
774
774
|
),
|
|
775
775
|
n
|
|
776
|
-
),
|
|
777
|
-
const
|
|
776
|
+
), O(a, p);
|
|
777
|
+
const m = ct(
|
|
778
778
|
x(
|
|
779
779
|
a,
|
|
780
|
-
E((
|
|
780
|
+
E((g) => g === void 0)
|
|
781
781
|
),
|
|
782
782
|
!0
|
|
783
783
|
);
|
|
784
|
-
|
|
784
|
+
O(
|
|
785
785
|
x(
|
|
786
|
-
|
|
787
|
-
P((
|
|
788
|
-
E((
|
|
786
|
+
p,
|
|
787
|
+
P((g) => g !== void 0 && j(st(w).sizeTree)),
|
|
788
|
+
E((g) => [{ endIndex: 0, size: g, startIndex: 0 }])
|
|
789
789
|
),
|
|
790
790
|
n
|
|
791
791
|
);
|
|
792
|
-
const u =
|
|
792
|
+
const u = ht(
|
|
793
793
|
x(
|
|
794
794
|
n,
|
|
795
|
-
|
|
795
|
+
_(w),
|
|
796
796
|
Rt(
|
|
797
|
-
({ sizes:
|
|
798
|
-
changed: b !==
|
|
797
|
+
({ sizes: g }, [d, b]) => ({
|
|
798
|
+
changed: b !== g,
|
|
799
799
|
sizes: b
|
|
800
800
|
}),
|
|
801
|
-
{ changed: !1, sizes:
|
|
801
|
+
{ changed: !1, sizes: C }
|
|
802
802
|
),
|
|
803
|
-
E((
|
|
803
|
+
E((g) => g.changed)
|
|
804
804
|
)
|
|
805
805
|
);
|
|
806
806
|
K(
|
|
807
807
|
x(
|
|
808
808
|
l,
|
|
809
809
|
Rt(
|
|
810
|
-
(
|
|
810
|
+
(g, d) => ({ diff: g.prev - d, prev: d }),
|
|
811
811
|
{ diff: 0, prev: 0 }
|
|
812
812
|
),
|
|
813
|
-
E((
|
|
813
|
+
E((g) => g.diff)
|
|
814
814
|
),
|
|
815
|
-
(
|
|
816
|
-
const { groupIndices: d } =
|
|
817
|
-
if (
|
|
818
|
-
W(e, !0), W(s,
|
|
819
|
-
else if (
|
|
820
|
-
const b =
|
|
821
|
-
b.length > 0 && (
|
|
815
|
+
(g) => {
|
|
816
|
+
const { groupIndices: d } = st(w);
|
|
817
|
+
if (g > 0)
|
|
818
|
+
W(e, !0), W(s, g + mn(g, d));
|
|
819
|
+
else if (g < 0) {
|
|
820
|
+
const b = st(S);
|
|
821
|
+
b.length > 0 && (g -= mn(-g, b)), W(i, g);
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
-
), K(x(l,
|
|
825
|
-
|
|
824
|
+
), K(x(l, _(t)), ([g, d]) => {
|
|
825
|
+
g < 0 && d(
|
|
826
826
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
827
827
|
{ firstItemIndex: l },
|
|
828
|
-
|
|
828
|
+
mt.ERROR
|
|
829
829
|
);
|
|
830
830
|
});
|
|
831
|
-
const T =
|
|
832
|
-
|
|
831
|
+
const T = ht(s);
|
|
832
|
+
O(
|
|
833
833
|
x(
|
|
834
834
|
s,
|
|
835
|
-
|
|
836
|
-
E(([
|
|
837
|
-
const b = d.groupIndices.length > 0, k = [],
|
|
835
|
+
_(w),
|
|
836
|
+
E(([g, d]) => {
|
|
837
|
+
const b = d.groupIndices.length > 0, k = [], F = d.lastSize;
|
|
838
838
|
if (b) {
|
|
839
839
|
const L = re(d.sizeTree, 0);
|
|
840
840
|
let V = 0, D = 0;
|
|
841
|
-
for (; V <
|
|
841
|
+
for (; V < g; ) {
|
|
842
842
|
const B = d.groupIndices[D], q = d.groupIndices.length === D + 1 ? 1 / 0 : d.groupIndices[D + 1] - B - 1;
|
|
843
843
|
k.push({
|
|
844
844
|
endIndex: B,
|
|
@@ -846,43 +846,43 @@ const ko = {
|
|
|
846
846
|
startIndex: B
|
|
847
847
|
}), k.push({
|
|
848
848
|
endIndex: B + 1 + q - 1,
|
|
849
|
-
size:
|
|
849
|
+
size: F,
|
|
850
850
|
startIndex: B + 1
|
|
851
851
|
}), D++, V += q + 1;
|
|
852
852
|
}
|
|
853
|
-
const J =
|
|
854
|
-
return V !==
|
|
855
|
-
(B, { k: q, v:
|
|
853
|
+
const J = Gt(d.sizeTree);
|
|
854
|
+
return V !== g && J.shift(), J.reduce(
|
|
855
|
+
(B, { k: q, v: it }) => {
|
|
856
856
|
let dt = B.ranges;
|
|
857
857
|
return B.prevSize !== 0 && (dt = [
|
|
858
858
|
...B.ranges,
|
|
859
859
|
{
|
|
860
|
-
endIndex: q +
|
|
860
|
+
endIndex: q + g - 1,
|
|
861
861
|
size: B.prevSize,
|
|
862
862
|
startIndex: B.prevIndex
|
|
863
863
|
}
|
|
864
864
|
]), {
|
|
865
|
-
prevIndex: q +
|
|
866
|
-
prevSize:
|
|
865
|
+
prevIndex: q + g,
|
|
866
|
+
prevSize: it,
|
|
867
867
|
ranges: dt
|
|
868
868
|
};
|
|
869
869
|
},
|
|
870
870
|
{
|
|
871
|
-
prevIndex:
|
|
871
|
+
prevIndex: g,
|
|
872
872
|
prevSize: 0,
|
|
873
873
|
ranges: k
|
|
874
874
|
}
|
|
875
875
|
).ranges;
|
|
876
876
|
}
|
|
877
|
-
return
|
|
877
|
+
return Gt(d.sizeTree).reduce(
|
|
878
878
|
(L, { k: V, v: D }) => ({
|
|
879
|
-
prevIndex: V +
|
|
879
|
+
prevIndex: V + g,
|
|
880
880
|
prevSize: D,
|
|
881
|
-
ranges: [...L.ranges, { endIndex: V +
|
|
881
|
+
ranges: [...L.ranges, { endIndex: V + g - 1, size: L.prevSize, startIndex: L.prevIndex }]
|
|
882
882
|
}),
|
|
883
883
|
{
|
|
884
884
|
prevIndex: 0,
|
|
885
|
-
prevSize:
|
|
885
|
+
prevSize: F,
|
|
886
886
|
ranges: []
|
|
887
887
|
}
|
|
888
888
|
).ranges;
|
|
@@ -890,80 +890,80 @@ const ko = {
|
|
|
890
890
|
),
|
|
891
891
|
n
|
|
892
892
|
);
|
|
893
|
-
const R =
|
|
893
|
+
const R = ht(
|
|
894
894
|
x(
|
|
895
895
|
i,
|
|
896
|
-
|
|
897
|
-
E(([
|
|
898
|
-
const k = -
|
|
896
|
+
_(w, f),
|
|
897
|
+
E(([g, { offsetTree: d }, b]) => {
|
|
898
|
+
const k = -g;
|
|
899
899
|
return ie(k, d, b);
|
|
900
900
|
})
|
|
901
901
|
)
|
|
902
902
|
);
|
|
903
|
-
return
|
|
903
|
+
return O(
|
|
904
904
|
x(
|
|
905
905
|
i,
|
|
906
|
-
|
|
907
|
-
E(([
|
|
906
|
+
_(w, f),
|
|
907
|
+
E(([g, d, b]) => {
|
|
908
908
|
if (d.groupIndices.length > 0) {
|
|
909
909
|
if (j(d.sizeTree))
|
|
910
910
|
return d;
|
|
911
|
-
let
|
|
912
|
-
const L =
|
|
911
|
+
let F = Ut();
|
|
912
|
+
const L = st(S);
|
|
913
913
|
let V = 0, D = 0, J = 0;
|
|
914
|
-
for (; V < -
|
|
914
|
+
for (; V < -g; ) {
|
|
915
915
|
J = L[D];
|
|
916
916
|
const B = L[D + 1] - J - 1;
|
|
917
917
|
D++, V += B + 1;
|
|
918
918
|
}
|
|
919
|
-
if (
|
|
919
|
+
if (F = Gt(d.sizeTree).reduce((B, { k: q, v: it }) => pt(B, Math.max(0, q + g), it), F), V !== -g) {
|
|
920
920
|
const B = re(d.sizeTree, J);
|
|
921
|
-
|
|
922
|
-
const q = Ct(d.sizeTree, -
|
|
923
|
-
|
|
921
|
+
F = pt(F, 0, B);
|
|
922
|
+
const q = Ct(d.sizeTree, -g + 1)[1];
|
|
923
|
+
F = pt(F, 1, q);
|
|
924
924
|
}
|
|
925
925
|
return {
|
|
926
926
|
...d,
|
|
927
|
-
sizeTree:
|
|
928
|
-
...Pe(d.offsetTree, 0,
|
|
927
|
+
sizeTree: F,
|
|
928
|
+
...Pe(d.offsetTree, 0, F, b)
|
|
929
929
|
};
|
|
930
930
|
} else {
|
|
931
|
-
const
|
|
931
|
+
const F = Gt(d.sizeTree).reduce((L, { k: V, v: D }) => pt(L, Math.max(0, V + g), D), Ut());
|
|
932
932
|
return {
|
|
933
933
|
...d,
|
|
934
|
-
sizeTree:
|
|
935
|
-
...Pe(d.offsetTree, 0,
|
|
934
|
+
sizeTree: F,
|
|
935
|
+
...Pe(d.offsetTree, 0, F, b)
|
|
936
936
|
};
|
|
937
937
|
}
|
|
938
938
|
})
|
|
939
939
|
),
|
|
940
|
-
|
|
940
|
+
w
|
|
941
941
|
), {
|
|
942
942
|
beforeUnshiftWith: T,
|
|
943
943
|
// input
|
|
944
|
-
data:
|
|
945
|
-
defaultItemSize:
|
|
944
|
+
data: h,
|
|
945
|
+
defaultItemSize: p,
|
|
946
946
|
firstItemIndex: l,
|
|
947
947
|
fixedItemSize: a,
|
|
948
|
-
gap:
|
|
948
|
+
gap: f,
|
|
949
949
|
groupIndices: c,
|
|
950
|
-
itemSize:
|
|
950
|
+
itemSize: I,
|
|
951
951
|
listRefresh: u,
|
|
952
952
|
shiftWith: i,
|
|
953
953
|
shiftWithOffset: R,
|
|
954
954
|
sizeRanges: n,
|
|
955
955
|
// output
|
|
956
|
-
sizes:
|
|
956
|
+
sizes: w,
|
|
957
957
|
statefulTotalCount: r,
|
|
958
958
|
totalCount: o,
|
|
959
|
-
trackItemSizes:
|
|
959
|
+
trackItemSizes: m,
|
|
960
960
|
unshiftWith: s
|
|
961
961
|
};
|
|
962
962
|
},
|
|
963
963
|
X(Vt, Ne),
|
|
964
964
|
{ singleton: !0 }
|
|
965
965
|
);
|
|
966
|
-
function
|
|
966
|
+
function Fo(t) {
|
|
967
967
|
return t.reduce(
|
|
968
968
|
(e, n) => (e.groupIndices.push(e.totalCount), e.totalCount += n + 1, e),
|
|
969
969
|
{
|
|
@@ -972,26 +972,26 @@ function Oo(t) {
|
|
|
972
972
|
}
|
|
973
973
|
);
|
|
974
974
|
}
|
|
975
|
-
const
|
|
975
|
+
const Gn = U(
|
|
976
976
|
([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
|
|
977
|
-
const s = $(), i = $(), l =
|
|
978
|
-
return
|
|
977
|
+
const s = $(), i = $(), l = ht(x(s, E(Fo)));
|
|
978
|
+
return O(
|
|
979
979
|
x(
|
|
980
980
|
l,
|
|
981
981
|
E((c) => c.totalCount)
|
|
982
982
|
),
|
|
983
983
|
n
|
|
984
|
-
),
|
|
984
|
+
), O(
|
|
985
985
|
x(
|
|
986
986
|
l,
|
|
987
987
|
E((c) => c.groupIndices)
|
|
988
988
|
),
|
|
989
989
|
t
|
|
990
|
-
),
|
|
990
|
+
), O(
|
|
991
991
|
x(
|
|
992
992
|
rt(r, e, o),
|
|
993
993
|
P(([c, a]) => Re(a)),
|
|
994
|
-
E(([c, a,
|
|
994
|
+
E(([c, a, p]) => Ct(a.groupOffsetTree, Math.max(c - p, 0), "v")[0]),
|
|
995
995
|
Y(),
|
|
996
996
|
E((c) => [c])
|
|
997
997
|
),
|
|
@@ -1001,7 +1001,7 @@ const _n = U(
|
|
|
1001
1001
|
X(Et, at)
|
|
1002
1002
|
), Pt = U(
|
|
1003
1003
|
([{ log: t }]) => {
|
|
1004
|
-
const e = v(!1), n =
|
|
1004
|
+
const e = v(!1), n = ht(
|
|
1005
1005
|
x(
|
|
1006
1006
|
e,
|
|
1007
1007
|
P((o) => o),
|
|
@@ -1009,15 +1009,15 @@ const _n = U(
|
|
|
1009
1009
|
)
|
|
1010
1010
|
);
|
|
1011
1011
|
return K(e, (o) => {
|
|
1012
|
-
o &&
|
|
1012
|
+
o && st(t)("props updated", {}, mt.DEBUG);
|
|
1013
1013
|
}), { didMount: n, propsReady: e };
|
|
1014
1014
|
},
|
|
1015
1015
|
X(Vt),
|
|
1016
1016
|
{ singleton: !0 }
|
|
1017
|
-
),
|
|
1018
|
-
function
|
|
1017
|
+
), Oo = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1018
|
+
function _n(t) {
|
|
1019
1019
|
const e = typeof t == "number" ? { index: t } : t;
|
|
1020
|
-
return e.align || (e.align = "start"), (!e.behavior || !
|
|
1020
|
+
return e.align || (e.align = "start"), (!e.behavior || !Oo) && (e.behavior = "auto"), e.offset || (e.offset = 0), e;
|
|
1021
1021
|
}
|
|
1022
1022
|
const ce = U(
|
|
1023
1023
|
([
|
|
@@ -1029,54 +1029,54 @@ const ce = U(
|
|
|
1029
1029
|
headerHeight: l,
|
|
1030
1030
|
scrollingInProgress: c,
|
|
1031
1031
|
scrollTo: a,
|
|
1032
|
-
smoothScrollTargetReached:
|
|
1033
|
-
viewportHeight:
|
|
1032
|
+
smoothScrollTargetReached: p,
|
|
1033
|
+
viewportHeight: I
|
|
1034
1034
|
},
|
|
1035
|
-
{ log:
|
|
1035
|
+
{ log: h }
|
|
1036
1036
|
]) => {
|
|
1037
|
-
const
|
|
1038
|
-
let
|
|
1037
|
+
const f = $(), C = $(), w = v(0);
|
|
1038
|
+
let S = null, m = null, u = null;
|
|
1039
1039
|
function T() {
|
|
1040
|
-
|
|
1040
|
+
S && (S(), S = null), u && (u(), u = null), m && (clearTimeout(m), m = null), W(c, !1);
|
|
1041
1041
|
}
|
|
1042
|
-
return
|
|
1042
|
+
return O(
|
|
1043
1043
|
x(
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1044
|
+
f,
|
|
1045
|
+
_(n, I, o, w, l, i, h),
|
|
1046
|
+
_(t, s, r),
|
|
1047
1047
|
E(
|
|
1048
1048
|
([
|
|
1049
|
-
[R,
|
|
1049
|
+
[R, g, d, b, k, F, L, V],
|
|
1050
1050
|
D,
|
|
1051
1051
|
J,
|
|
1052
1052
|
nt
|
|
1053
1053
|
]) => {
|
|
1054
|
-
const B =
|
|
1055
|
-
let ut = ie(ft,
|
|
1056
|
-
q === "end" ? (ut += J + Ct(
|
|
1054
|
+
const B = _n(R), { align: q, behavior: it, offset: dt } = B, St = b - 1, ft = Wn(B, g, St);
|
|
1055
|
+
let ut = ie(ft, g.offsetTree, D) + F;
|
|
1056
|
+
q === "end" ? (ut += J + Ct(g.sizeTree, ft)[1] - d + nt, ft === St && (ut += L)) : q === "center" ? ut += (J + Ct(g.sizeTree, ft)[1] - d + nt) / 2 : ut -= k, dt && (ut += dt);
|
|
1057
1057
|
const At = (xt) => {
|
|
1058
|
-
T(), xt ? (V("retrying to scroll to", { location: R },
|
|
1058
|
+
T(), xt ? (V("retrying to scroll to", { location: R }, mt.DEBUG), W(f, R)) : (W(C, !0), V("list did not change, scroll successful", {}, mt.DEBUG));
|
|
1059
1059
|
};
|
|
1060
|
-
if (T(),
|
|
1060
|
+
if (T(), it === "smooth") {
|
|
1061
1061
|
let xt = !1;
|
|
1062
1062
|
u = K(e, (Xt) => {
|
|
1063
1063
|
xt = xt || Xt;
|
|
1064
|
-
}),
|
|
1064
|
+
}), S = bt(p, () => {
|
|
1065
1065
|
At(xt);
|
|
1066
1066
|
});
|
|
1067
1067
|
} else
|
|
1068
|
-
|
|
1069
|
-
return
|
|
1068
|
+
S = bt(x(e, Lo(150)), At);
|
|
1069
|
+
return m = setTimeout(() => {
|
|
1070
1070
|
T();
|
|
1071
|
-
}, 1200), W(c, !0), V("scrolling from index to", { behavior:
|
|
1071
|
+
}, 1200), W(c, !0), V("scrolling from index to", { behavior: it, index: ft, top: ut }, mt.DEBUG), { behavior: it, top: ut };
|
|
1072
1072
|
}
|
|
1073
1073
|
)
|
|
1074
1074
|
),
|
|
1075
1075
|
a
|
|
1076
1076
|
), {
|
|
1077
|
-
scrollTargetReached:
|
|
1078
|
-
scrollToIndex:
|
|
1079
|
-
topListHeight:
|
|
1077
|
+
scrollTargetReached: C,
|
|
1078
|
+
scrollToIndex: f,
|
|
1079
|
+
topListHeight: w
|
|
1080
1080
|
};
|
|
1081
1081
|
},
|
|
1082
1082
|
X(Et, at, Vt),
|
|
@@ -1104,36 +1104,36 @@ function Ue(t, e) {
|
|
|
1104
1104
|
const ue = U(
|
|
1105
1105
|
([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
|
|
1106
1106
|
const l = v(!0), c = v(0), a = v(!0);
|
|
1107
|
-
return
|
|
1107
|
+
return O(
|
|
1108
1108
|
x(
|
|
1109
1109
|
i,
|
|
1110
|
-
|
|
1111
|
-
P(([
|
|
1110
|
+
_(c),
|
|
1111
|
+
P(([p, I]) => !!I),
|
|
1112
1112
|
yt(!1)
|
|
1113
1113
|
),
|
|
1114
1114
|
l
|
|
1115
|
-
),
|
|
1115
|
+
), O(
|
|
1116
1116
|
x(
|
|
1117
1117
|
i,
|
|
1118
|
-
|
|
1119
|
-
P(([
|
|
1118
|
+
_(c),
|
|
1119
|
+
P(([p, I]) => !!I),
|
|
1120
1120
|
yt(!1)
|
|
1121
1121
|
),
|
|
1122
1122
|
a
|
|
1123
1123
|
), K(
|
|
1124
1124
|
x(
|
|
1125
1125
|
rt(e, i),
|
|
1126
|
-
|
|
1127
|
-
P(([[,
|
|
1128
|
-
|
|
1126
|
+
_(l, n, t, a),
|
|
1127
|
+
P(([[, p], I, { sizeTree: h }, f, C]) => p && (!j(h) || Me(f)) && !I && !C),
|
|
1128
|
+
_(c)
|
|
1129
1129
|
),
|
|
1130
|
-
([,
|
|
1130
|
+
([, p]) => {
|
|
1131
1131
|
bt(r, () => {
|
|
1132
1132
|
W(a, !0);
|
|
1133
1133
|
}), $e(4, () => {
|
|
1134
1134
|
bt(o, () => {
|
|
1135
1135
|
W(l, !0);
|
|
1136
|
-
}), W(s,
|
|
1136
|
+
}), W(s, p);
|
|
1137
1137
|
});
|
|
1138
1138
|
}
|
|
1139
1139
|
), {
|
|
@@ -1158,34 +1158,34 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1158
1158
|
viewportHeight: 0
|
|
1159
1159
|
}
|
|
1160
1160
|
}, Po = 0, ae = U(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
|
|
1161
|
-
const i = v(!1), l = v(!0), c = $(), a = $(),
|
|
1161
|
+
const i = v(!1), l = v(!0), c = $(), a = $(), p = v(4), I = v(Po), h = ct(
|
|
1162
1162
|
x(
|
|
1163
1163
|
an(x(A(r), jt(1), yt(!0)), x(A(r), jt(1), yt(!1), un(100))),
|
|
1164
1164
|
Y()
|
|
1165
1165
|
),
|
|
1166
1166
|
!1
|
|
1167
|
-
),
|
|
1167
|
+
), f = ct(
|
|
1168
1168
|
x(an(x(n, yt(!0)), x(n, yt(!1), un(200))), Y()),
|
|
1169
1169
|
!1
|
|
1170
1170
|
);
|
|
1171
|
-
|
|
1171
|
+
O(
|
|
1172
1172
|
x(
|
|
1173
|
-
rt(A(r), A(
|
|
1173
|
+
rt(A(r), A(I)),
|
|
1174
1174
|
E(([u, T]) => u <= T),
|
|
1175
1175
|
Y()
|
|
1176
1176
|
),
|
|
1177
1177
|
l
|
|
1178
|
-
),
|
|
1179
|
-
const
|
|
1178
|
+
), O(x(l, Lt(50)), a);
|
|
1179
|
+
const C = ht(
|
|
1180
1180
|
x(
|
|
1181
|
-
rt(o, A(s), A(e), A(t), A(
|
|
1182
|
-
Rt((u, [{ scrollHeight: T, scrollTop: R },
|
|
1183
|
-
const
|
|
1181
|
+
rt(o, A(s), A(e), A(t), A(p)),
|
|
1182
|
+
Rt((u, [{ scrollHeight: T, scrollTop: R }, g, d, b, k]) => {
|
|
1183
|
+
const F = R + g - T > -k, L = {
|
|
1184
1184
|
scrollHeight: T,
|
|
1185
1185
|
scrollTop: R,
|
|
1186
|
-
viewportHeight:
|
|
1186
|
+
viewportHeight: g
|
|
1187
1187
|
};
|
|
1188
|
-
if (
|
|
1188
|
+
if (F) {
|
|
1189
1189
|
let D, J;
|
|
1190
1190
|
return R > u.state.scrollTop ? (D = "SCROLLED_DOWN", J = u.state.scrollTop - R) : (D = "SIZE_DECREASED", J = u.state.scrollTop - R || u.scrollTopDelta), {
|
|
1191
1191
|
atBottom: !0,
|
|
@@ -1195,7 +1195,7 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1195
1195
|
};
|
|
1196
1196
|
}
|
|
1197
1197
|
let V;
|
|
1198
|
-
return L.scrollHeight > u.state.scrollHeight ? V = "SIZE_INCREASED" :
|
|
1198
|
+
return L.scrollHeight > u.state.scrollHeight ? V = "SIZE_INCREASED" : g < u.state.viewportHeight ? V = "VIEWPORT_HEIGHT_DECREASING" : R < u.state.scrollTop ? V = "SCROLLING_UPWARDS" : V = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
1199
1199
|
atBottom: !1,
|
|
1200
1200
|
notAtBottomBecause: V,
|
|
1201
1201
|
state: L
|
|
@@ -1203,11 +1203,11 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1203
1203
|
}, Vo),
|
|
1204
1204
|
Y((u, T) => u && u.atBottom === T.atBottom)
|
|
1205
1205
|
)
|
|
1206
|
-
),
|
|
1206
|
+
), w = ct(
|
|
1207
1207
|
x(
|
|
1208
1208
|
o,
|
|
1209
1209
|
Rt(
|
|
1210
|
-
(u, { scrollHeight: T, scrollTop: R, viewportHeight:
|
|
1210
|
+
(u, { scrollHeight: T, scrollTop: R, viewportHeight: g }) => {
|
|
1211
1211
|
if (Nn(u.scrollHeight, T))
|
|
1212
1212
|
return {
|
|
1213
1213
|
changed: !1,
|
|
@@ -1216,7 +1216,7 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1216
1216
|
scrollTop: R
|
|
1217
1217
|
};
|
|
1218
1218
|
{
|
|
1219
|
-
const d = T - (R +
|
|
1219
|
+
const d = T - (R + g) < 1;
|
|
1220
1220
|
return u.scrollTop !== R && d ? {
|
|
1221
1221
|
changed: !0,
|
|
1222
1222
|
jump: u.scrollTop - R,
|
|
@@ -1237,57 +1237,57 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1237
1237
|
),
|
|
1238
1238
|
0
|
|
1239
1239
|
);
|
|
1240
|
-
|
|
1240
|
+
O(
|
|
1241
1241
|
x(
|
|
1242
|
-
|
|
1242
|
+
C,
|
|
1243
1243
|
E((u) => u.atBottom)
|
|
1244
1244
|
),
|
|
1245
1245
|
i
|
|
1246
|
-
),
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1246
|
+
), O(x(i, Lt(50)), c);
|
|
1247
|
+
const S = v(te);
|
|
1248
|
+
O(
|
|
1249
1249
|
x(
|
|
1250
1250
|
o,
|
|
1251
1251
|
E(({ scrollTop: u }) => u),
|
|
1252
1252
|
Y(),
|
|
1253
1253
|
Rt(
|
|
1254
|
-
(u, T) =>
|
|
1254
|
+
(u, T) => st(f) ? { direction: u.direction, prevScrollTop: T } : { direction: T < u.prevScrollTop ? le : te, prevScrollTop: T },
|
|
1255
1255
|
{ direction: te, prevScrollTop: 0 }
|
|
1256
1256
|
),
|
|
1257
1257
|
E((u) => u.direction)
|
|
1258
1258
|
),
|
|
1259
|
-
|
|
1260
|
-
),
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1259
|
+
S
|
|
1260
|
+
), O(x(o, Lt(50), yt(zo)), S);
|
|
1261
|
+
const m = v(0);
|
|
1262
|
+
return O(
|
|
1263
1263
|
x(
|
|
1264
|
-
|
|
1264
|
+
h,
|
|
1265
1265
|
P((u) => !u),
|
|
1266
1266
|
yt(0)
|
|
1267
1267
|
),
|
|
1268
|
-
|
|
1269
|
-
),
|
|
1268
|
+
m
|
|
1269
|
+
), O(
|
|
1270
1270
|
x(
|
|
1271
1271
|
r,
|
|
1272
1272
|
Lt(100),
|
|
1273
|
-
|
|
1273
|
+
_(h),
|
|
1274
1274
|
P(([u, T]) => !!T),
|
|
1275
1275
|
Rt(([u, T], [R]) => [T, R], [0, 0]),
|
|
1276
1276
|
E(([u, T]) => T - u)
|
|
1277
1277
|
),
|
|
1278
|
-
|
|
1278
|
+
m
|
|
1279
1279
|
), {
|
|
1280
|
-
atBottomState:
|
|
1280
|
+
atBottomState: C,
|
|
1281
1281
|
atBottomStateChange: c,
|
|
1282
|
-
atBottomThreshold:
|
|
1282
|
+
atBottomThreshold: p,
|
|
1283
1283
|
atTopStateChange: a,
|
|
1284
|
-
atTopThreshold:
|
|
1284
|
+
atTopThreshold: I,
|
|
1285
1285
|
isAtBottom: i,
|
|
1286
1286
|
isAtTop: l,
|
|
1287
|
-
isScrolling:
|
|
1288
|
-
lastJumpDueToItemResize:
|
|
1289
|
-
scrollDirection:
|
|
1290
|
-
scrollVelocity:
|
|
1287
|
+
isScrolling: h,
|
|
1288
|
+
lastJumpDueToItemResize: w,
|
|
1289
|
+
scrollDirection: S,
|
|
1290
|
+
scrollVelocity: m
|
|
1291
1291
|
};
|
|
1292
1292
|
}, X(at)), xe = "top", Te = "bottom", pn = "none";
|
|
1293
1293
|
function hn(t, e, n) {
|
|
@@ -1314,26 +1314,26 @@ const Ke = U(
|
|
|
1314
1314
|
),
|
|
1315
1315
|
E(
|
|
1316
1316
|
([
|
|
1317
|
-
f,
|
|
1318
|
-
S,
|
|
1319
1317
|
p,
|
|
1320
|
-
[m, w],
|
|
1321
1318
|
I,
|
|
1322
|
-
|
|
1323
|
-
|
|
1319
|
+
h,
|
|
1320
|
+
[f, C],
|
|
1321
|
+
w,
|
|
1322
|
+
S,
|
|
1323
|
+
m,
|
|
1324
1324
|
u,
|
|
1325
1325
|
T
|
|
1326
1326
|
]) => {
|
|
1327
|
-
const R =
|
|
1327
|
+
const R = p - u, g = S + m, d = Math.max(h - R, 0);
|
|
1328
1328
|
let b = pn;
|
|
1329
|
-
const k = gn(T, xe),
|
|
1330
|
-
return
|
|
1331
|
-
Math.max(R -
|
|
1332
|
-
R - d -
|
|
1329
|
+
const k = gn(T, xe), F = gn(T, Te);
|
|
1330
|
+
return f -= u, f += h + m, C += h + m, C -= u, f > p + g - k && (b = le), C < p - d + I + F && (b = te), b !== pn ? [
|
|
1331
|
+
Math.max(R - h - hn(w, xe, b) - k, 0),
|
|
1332
|
+
R - d - m + I + hn(w, Te, b) + F
|
|
1333
1333
|
] : null;
|
|
1334
1334
|
}
|
|
1335
1335
|
),
|
|
1336
|
-
P((
|
|
1336
|
+
P((p) => p != null),
|
|
1337
1337
|
Y(se)
|
|
1338
1338
|
),
|
|
1339
1339
|
[0, 0]
|
|
@@ -1374,36 +1374,36 @@ const Be = {
|
|
|
1374
1374
|
};
|
|
1375
1375
|
function Ie(t, e, n, o, r, s) {
|
|
1376
1376
|
const { lastIndex: i, lastOffset: l, lastSize: c } = r;
|
|
1377
|
-
let a = 0,
|
|
1377
|
+
let a = 0, p = 0;
|
|
1378
1378
|
if (t.length > 0) {
|
|
1379
1379
|
a = t[0].offset;
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1380
|
+
const w = t[t.length - 1];
|
|
1381
|
+
p = w.offset + w.size;
|
|
1382
1382
|
}
|
|
1383
|
-
const
|
|
1383
|
+
const I = n - i, h = l + I * c + (I - 1) * o, f = a, C = h - p;
|
|
1384
1384
|
return {
|
|
1385
|
-
bottom:
|
|
1385
|
+
bottom: p,
|
|
1386
1386
|
firstItemIndex: s,
|
|
1387
1387
|
items: In(t, r, s),
|
|
1388
|
-
offsetBottom:
|
|
1388
|
+
offsetBottom: C,
|
|
1389
1389
|
offsetTop: a,
|
|
1390
|
-
top:
|
|
1390
|
+
top: f,
|
|
1391
1391
|
topItems: In(e, r, s),
|
|
1392
|
-
topListHeight: e.reduce((
|
|
1392
|
+
topListHeight: e.reduce((w, S) => S.size + w, 0),
|
|
1393
1393
|
totalCount: n
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
1396
|
function Dn(t, e, n, o, r, s) {
|
|
1397
1397
|
let i = 0;
|
|
1398
1398
|
if (n.groupIndices.length > 0)
|
|
1399
|
-
for (const
|
|
1400
|
-
if (
|
|
1399
|
+
for (const p of n.groupIndices) {
|
|
1400
|
+
if (p - i >= t)
|
|
1401
1401
|
break;
|
|
1402
1402
|
i++;
|
|
1403
1403
|
}
|
|
1404
|
-
const l = t + i, c = Ue(e, l), a = Array.from({ length: l }).map((
|
|
1405
|
-
data: s[
|
|
1406
|
-
index:
|
|
1404
|
+
const l = t + i, c = Ue(e, l), a = Array.from({ length: l }).map((p, I) => ({
|
|
1405
|
+
data: s[I + c],
|
|
1406
|
+
index: I + c,
|
|
1407
1407
|
offset: 0,
|
|
1408
1408
|
size: 0
|
|
1409
1409
|
}));
|
|
@@ -1418,15 +1418,15 @@ function In(t, e, n) {
|
|
|
1418
1418
|
let l, c = 0;
|
|
1419
1419
|
for (const a of t) {
|
|
1420
1420
|
(!l || l.end < a.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
|
|
1421
|
-
let
|
|
1422
|
-
a.index === l.start ?
|
|
1421
|
+
let p;
|
|
1422
|
+
a.index === l.start ? p = {
|
|
1423
1423
|
index: c,
|
|
1424
1424
|
type: "group"
|
|
1425
|
-
} :
|
|
1425
|
+
} : p = {
|
|
1426
1426
|
groupIndex: c,
|
|
1427
1427
|
index: a.index - (c + 1) + n
|
|
1428
1428
|
}, s.push({
|
|
1429
|
-
...
|
|
1429
|
+
...p,
|
|
1430
1430
|
data: a.data,
|
|
1431
1431
|
offset: a.offset,
|
|
1432
1432
|
originalIndex: a.index,
|
|
@@ -1435,36 +1435,36 @@ function In(t, e, n) {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
return s;
|
|
1437
1437
|
}
|
|
1438
|
-
const
|
|
1438
|
+
const _t = U(
|
|
1439
1439
|
([
|
|
1440
1440
|
{ data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
|
|
1441
1441
|
s,
|
|
1442
1442
|
{ listBoundary: i, topListHeight: l, visibleRange: c },
|
|
1443
|
-
{ initialTopMostItemIndex: a, scrolledToInitialItem:
|
|
1444
|
-
{ topListHeight:
|
|
1445
|
-
|
|
1446
|
-
{ didMount:
|
|
1447
|
-
{ recalcInProgress:
|
|
1443
|
+
{ initialTopMostItemIndex: a, scrolledToInitialItem: p },
|
|
1444
|
+
{ topListHeight: I },
|
|
1445
|
+
h,
|
|
1446
|
+
{ didMount: f },
|
|
1447
|
+
{ recalcInProgress: C }
|
|
1448
1448
|
]) => {
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1449
|
+
const w = v([]), S = v(0), m = $();
|
|
1450
|
+
O(s.topItemsIndexes, w);
|
|
1451
1451
|
const u = ct(
|
|
1452
1452
|
x(
|
|
1453
1453
|
rt(
|
|
1454
|
-
|
|
1455
|
-
|
|
1454
|
+
f,
|
|
1455
|
+
C,
|
|
1456
1456
|
A(c, se),
|
|
1457
1457
|
A(r),
|
|
1458
1458
|
A(o),
|
|
1459
1459
|
A(a),
|
|
1460
|
-
|
|
1461
|
-
A(
|
|
1460
|
+
p,
|
|
1461
|
+
A(w),
|
|
1462
1462
|
A(e),
|
|
1463
1463
|
A(n),
|
|
1464
1464
|
t
|
|
1465
1465
|
),
|
|
1466
|
-
P(([d, b, , k, , , , , , ,
|
|
1467
|
-
const L =
|
|
1466
|
+
P(([d, b, , k, , , , , , , F]) => {
|
|
1467
|
+
const L = F && F.length !== k;
|
|
1468
1468
|
return d && !b && !L;
|
|
1469
1469
|
}),
|
|
1470
1470
|
E(
|
|
@@ -1473,7 +1473,7 @@ const Gt = U(
|
|
|
1473
1473
|
,
|
|
1474
1474
|
[d, b],
|
|
1475
1475
|
k,
|
|
1476
|
-
|
|
1476
|
+
F,
|
|
1477
1477
|
L,
|
|
1478
1478
|
V,
|
|
1479
1479
|
D,
|
|
@@ -1481,11 +1481,11 @@ const Gt = U(
|
|
|
1481
1481
|
nt,
|
|
1482
1482
|
B
|
|
1483
1483
|
]) => {
|
|
1484
|
-
const q =
|
|
1484
|
+
const q = F, { offsetTree: it, sizeTree: dt } = q, St = st(S);
|
|
1485
1485
|
if (k === 0)
|
|
1486
1486
|
return { ...Be, totalCount: k };
|
|
1487
1487
|
if (d === 0 && b === 0)
|
|
1488
|
-
return St === 0 ? { ...Be, totalCount: k } : Dn(St, L,
|
|
1488
|
+
return St === 0 ? { ...Be, totalCount: k } : Dn(St, L, F, J, nt, B || []);
|
|
1489
1489
|
if (j(dt))
|
|
1490
1490
|
return St > 0 ? null : Ie(
|
|
1491
1491
|
Ao(Ue(L, k), q, B),
|
|
@@ -1500,14 +1500,14 @@ const Gt = U(
|
|
|
1500
1500
|
const Mt = D[0], vt = D[D.length - 1];
|
|
1501
1501
|
let Bt = 0;
|
|
1502
1502
|
for (const y of ye(dt, Mt, vt)) {
|
|
1503
|
-
const N = y.value, Q = Math.max(y.start, Mt),
|
|
1504
|
-
for (let tt = Q; tt <=
|
|
1503
|
+
const N = y.value, Q = Math.max(y.start, Mt), lt = Math.min(y.end, vt);
|
|
1504
|
+
for (let tt = Q; tt <= lt; tt++)
|
|
1505
1505
|
ft.push({ data: B == null ? void 0 : B[tt], index: tt, offset: Bt, size: N }), Bt += N;
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
1508
|
if (!V)
|
|
1509
1509
|
return Ie([], ft, k, nt, q, J);
|
|
1510
|
-
const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At = Ro(
|
|
1510
|
+
const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At = Ro(it, d, b, ut);
|
|
1511
1511
|
if (At.length === 0)
|
|
1512
1512
|
return null;
|
|
1513
1513
|
const xt = k - 1, Xt = ve([], (Mt) => {
|
|
@@ -1521,8 +1521,8 @@ const Gt = U(
|
|
|
1521
1521
|
y += tt * Q + tt * nt;
|
|
1522
1522
|
}
|
|
1523
1523
|
N < ut && (y += (ut - N) * Q, N = ut);
|
|
1524
|
-
const
|
|
1525
|
-
for (let tt = N; tt <=
|
|
1524
|
+
const lt = Math.min(vt.end, xt);
|
|
1525
|
+
for (let tt = N; tt <= lt && !(y >= b); tt++)
|
|
1526
1526
|
Mt.push({ data: B == null ? void 0 : B[tt], index: tt, offset: y, size: Q }), y += Q + nt;
|
|
1527
1527
|
}
|
|
1528
1528
|
});
|
|
@@ -1535,43 +1535,43 @@ const Gt = U(
|
|
|
1535
1535
|
),
|
|
1536
1536
|
Be
|
|
1537
1537
|
);
|
|
1538
|
-
|
|
1538
|
+
O(
|
|
1539
1539
|
x(
|
|
1540
1540
|
t,
|
|
1541
1541
|
P(Me),
|
|
1542
1542
|
E((d) => d == null ? void 0 : d.length)
|
|
1543
1543
|
),
|
|
1544
1544
|
r
|
|
1545
|
-
),
|
|
1545
|
+
), O(
|
|
1546
1546
|
x(
|
|
1547
1547
|
u,
|
|
1548
1548
|
E((d) => d.topListHeight)
|
|
1549
1549
|
),
|
|
1550
|
-
|
|
1551
|
-
),
|
|
1550
|
+
I
|
|
1551
|
+
), O(I, l), O(
|
|
1552
1552
|
x(
|
|
1553
1553
|
u,
|
|
1554
1554
|
E((d) => [d.top, d.bottom])
|
|
1555
1555
|
),
|
|
1556
1556
|
i
|
|
1557
|
-
),
|
|
1557
|
+
), O(
|
|
1558
1558
|
x(
|
|
1559
1559
|
u,
|
|
1560
1560
|
E((d) => d.items)
|
|
1561
1561
|
),
|
|
1562
|
-
|
|
1562
|
+
m
|
|
1563
1563
|
);
|
|
1564
|
-
const T =
|
|
1564
|
+
const T = ht(
|
|
1565
1565
|
x(
|
|
1566
1566
|
u,
|
|
1567
1567
|
P(({ items: d }) => d.length > 0),
|
|
1568
|
-
|
|
1568
|
+
_(r, t),
|
|
1569
1569
|
P(([{ items: d }, b]) => d[d.length - 1].originalIndex === b - 1),
|
|
1570
1570
|
E(([, d, b]) => [d - 1, b]),
|
|
1571
1571
|
Y(se),
|
|
1572
1572
|
E(([d]) => d)
|
|
1573
1573
|
)
|
|
1574
|
-
), R =
|
|
1574
|
+
), R = ht(
|
|
1575
1575
|
x(
|
|
1576
1576
|
u,
|
|
1577
1577
|
Lt(200),
|
|
@@ -1579,7 +1579,7 @@ const Gt = U(
|
|
|
1579
1579
|
E(({ items: d }) => d[0].index),
|
|
1580
1580
|
Y()
|
|
1581
1581
|
)
|
|
1582
|
-
),
|
|
1582
|
+
), g = ht(
|
|
1583
1583
|
x(
|
|
1584
1584
|
u,
|
|
1585
1585
|
P(({ items: d }) => d.length > 0),
|
|
@@ -1597,11 +1597,11 @@ const Gt = U(
|
|
|
1597
1597
|
Y(Pn)
|
|
1598
1598
|
)
|
|
1599
1599
|
);
|
|
1600
|
-
return { endReached: T, initialItemCount:
|
|
1600
|
+
return { endReached: T, initialItemCount: S, itemsRendered: m, listState: u, rangeChanged: g, startReached: R, topItemsIndexes: w, ...h };
|
|
1601
1601
|
},
|
|
1602
1602
|
X(
|
|
1603
1603
|
Et,
|
|
1604
|
-
|
|
1604
|
+
Gn,
|
|
1605
1605
|
Ke,
|
|
1606
1606
|
ue,
|
|
1607
1607
|
ce,
|
|
@@ -1615,13 +1615,13 @@ const Gt = U(
|
|
|
1615
1615
|
const s = $(), i = ct(
|
|
1616
1616
|
x(
|
|
1617
1617
|
rt(n, t, o, e, r),
|
|
1618
|
-
E(([l, c, a,
|
|
1618
|
+
E(([l, c, a, p, I]) => l + c + a + p + I.offsetBottom + I.bottom)
|
|
1619
1619
|
),
|
|
1620
1620
|
0
|
|
1621
1621
|
);
|
|
1622
|
-
return
|
|
1622
|
+
return O(A(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
1623
1623
|
},
|
|
1624
|
-
X(at,
|
|
1624
|
+
X(at, _t),
|
|
1625
1625
|
{ singleton: !0 }
|
|
1626
1626
|
), Mo = U(
|
|
1627
1627
|
([{ viewportHeight: t }, { totalListHeight: e }]) => {
|
|
@@ -1643,80 +1643,82 @@ const Gt = U(
|
|
|
1643
1643
|
function Sn(t) {
|
|
1644
1644
|
return t ? t === "smooth" ? "smooth" : "auto" : !1;
|
|
1645
1645
|
}
|
|
1646
|
-
const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t),
|
|
1646
|
+
const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), Go = U(
|
|
1647
1647
|
([
|
|
1648
|
-
{ listRefresh: t, totalCount: e },
|
|
1649
|
-
{ atBottomState:
|
|
1650
|
-
{ scrollToIndex:
|
|
1651
|
-
{ scrolledToInitialItem:
|
|
1652
|
-
{ didMount:
|
|
1653
|
-
{ log:
|
|
1654
|
-
{ scrollingInProgress:
|
|
1648
|
+
{ listRefresh: t, totalCount: e, fixedItemSize: n },
|
|
1649
|
+
{ atBottomState: o, isAtBottom: r },
|
|
1650
|
+
{ scrollToIndex: s },
|
|
1651
|
+
{ scrolledToInitialItem: i },
|
|
1652
|
+
{ didMount: l, propsReady: c },
|
|
1653
|
+
{ log: a },
|
|
1654
|
+
{ scrollingInProgress: p }
|
|
1655
1655
|
]) => {
|
|
1656
|
-
const
|
|
1657
|
-
let
|
|
1658
|
-
function
|
|
1659
|
-
W(
|
|
1656
|
+
const I = v(!1), h = $();
|
|
1657
|
+
let f = null;
|
|
1658
|
+
function C(S) {
|
|
1659
|
+
W(s, {
|
|
1660
1660
|
align: "end",
|
|
1661
|
-
behavior:
|
|
1661
|
+
behavior: S,
|
|
1662
1662
|
index: "LAST"
|
|
1663
1663
|
});
|
|
1664
1664
|
}
|
|
1665
1665
|
K(
|
|
1666
1666
|
x(
|
|
1667
|
-
rt(x(A(e), jt(1)),
|
|
1668
|
-
|
|
1669
|
-
E(([[
|
|
1670
|
-
let
|
|
1671
|
-
return
|
|
1667
|
+
rt(x(A(e), jt(1)), l),
|
|
1668
|
+
_(A(I), r, i, p),
|
|
1669
|
+
E(([[S, m], u, T, R, g]) => {
|
|
1670
|
+
let d = m && R, b = "auto";
|
|
1671
|
+
return d && (b = Wo(u, T || g), d = d && !!b), { followOutputBehavior: b, shouldFollow: d, totalCount: S };
|
|
1672
1672
|
}),
|
|
1673
|
-
P(({ shouldFollow:
|
|
1673
|
+
P(({ shouldFollow: S }) => S)
|
|
1674
1674
|
),
|
|
1675
|
-
({ followOutputBehavior:
|
|
1676
|
-
|
|
1677
|
-
|
|
1675
|
+
({ followOutputBehavior: S, totalCount: m }) => {
|
|
1676
|
+
f && (f(), f = null), st(n) ? requestAnimationFrame(() => {
|
|
1677
|
+
st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S);
|
|
1678
|
+
}) : f = bt(t, () => {
|
|
1679
|
+
st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S), f = null;
|
|
1678
1680
|
});
|
|
1679
1681
|
}
|
|
1680
1682
|
);
|
|
1681
|
-
function w(
|
|
1682
|
-
const
|
|
1683
|
-
|
|
1683
|
+
function w(S) {
|
|
1684
|
+
const m = bt(o, (u) => {
|
|
1685
|
+
S && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && !f && (st(a)("scrolling to bottom due to increased size", {}, mt.DEBUG), C("auto"));
|
|
1684
1686
|
});
|
|
1685
|
-
setTimeout(
|
|
1687
|
+
setTimeout(m, 100);
|
|
1686
1688
|
}
|
|
1687
1689
|
return K(
|
|
1688
1690
|
x(
|
|
1689
|
-
rt(A(
|
|
1690
|
-
P(([
|
|
1691
|
+
rt(A(I), e, c),
|
|
1692
|
+
P(([S, , m]) => S && m),
|
|
1691
1693
|
Rt(
|
|
1692
|
-
({ value:
|
|
1694
|
+
({ value: S }, [, m]) => ({ refreshed: S === m, value: m }),
|
|
1693
1695
|
{ refreshed: !1, value: 0 }
|
|
1694
1696
|
),
|
|
1695
|
-
P(({ refreshed:
|
|
1696
|
-
|
|
1697
|
+
P(({ refreshed: S }) => S),
|
|
1698
|
+
_(I, e)
|
|
1697
1699
|
),
|
|
1698
|
-
([,
|
|
1699
|
-
|
|
1700
|
+
([, S]) => {
|
|
1701
|
+
st(i) && w(S !== !1);
|
|
1700
1702
|
}
|
|
1701
|
-
), K(
|
|
1702
|
-
w(
|
|
1703
|
-
}), K(rt(A(
|
|
1704
|
-
|
|
1705
|
-
}), { autoscrollToBottom:
|
|
1703
|
+
), K(h, () => {
|
|
1704
|
+
w(st(I) !== !1);
|
|
1705
|
+
}), K(rt(A(I), o), ([S, m]) => {
|
|
1706
|
+
S && !m.atBottom && m.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && C("auto");
|
|
1707
|
+
}), { autoscrollToBottom: h, followOutput: I };
|
|
1706
1708
|
},
|
|
1707
1709
|
X(Et, ae, ce, ue, Pt, Vt, at)
|
|
1708
|
-
),
|
|
1709
|
-
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (
|
|
1710
|
+
), _o = U(
|
|
1711
|
+
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (O(
|
|
1710
1712
|
x(
|
|
1711
1713
|
l,
|
|
1712
|
-
|
|
1714
|
+
_(s),
|
|
1713
1715
|
P(([, c]) => c !== 0),
|
|
1714
|
-
|
|
1715
|
-
E(([[, c], a,
|
|
1716
|
+
_(r, o, e, n, t),
|
|
1717
|
+
E(([[, c], a, p, I, h, f = []]) => Dn(c, a, p, I, h, f))
|
|
1716
1718
|
),
|
|
1717
1719
|
i
|
|
1718
1720
|
), {}),
|
|
1719
|
-
X(Et, ue,
|
|
1721
|
+
X(Et, ue, _t, Pt),
|
|
1720
1722
|
{ singleton: !0 }
|
|
1721
1723
|
), No = U(
|
|
1722
1724
|
([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
|
|
@@ -1724,7 +1726,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1724
1726
|
return K(
|
|
1725
1727
|
x(
|
|
1726
1728
|
t,
|
|
1727
|
-
|
|
1729
|
+
_(o),
|
|
1728
1730
|
P(([, r]) => r !== 0),
|
|
1729
1731
|
E(([, r]) => ({ top: r }))
|
|
1730
1732
|
),
|
|
@@ -1746,7 +1748,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1746
1748
|
initialScrollTop: o
|
|
1747
1749
|
};
|
|
1748
1750
|
},
|
|
1749
|
-
X(Pt, at,
|
|
1751
|
+
X(Pt, at, _t),
|
|
1750
1752
|
{ singleton: !0 }
|
|
1751
1753
|
), Do = ({
|
|
1752
1754
|
itemBottom: t,
|
|
@@ -1760,17 +1762,17 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1760
1762
|
{ fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
|
|
1761
1763
|
{ scrollToIndex: a }
|
|
1762
1764
|
]) => {
|
|
1763
|
-
const
|
|
1764
|
-
return
|
|
1765
|
+
const p = $();
|
|
1766
|
+
return O(
|
|
1765
1767
|
x(
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
E(([[
|
|
1770
|
-
const { align: R, behavior:
|
|
1768
|
+
p,
|
|
1769
|
+
_(e, c, n, s, r, o, l),
|
|
1770
|
+
_(t),
|
|
1771
|
+
E(([[I, h, f, C, w, S, m, u], T]) => {
|
|
1772
|
+
const { align: R, behavior: g, calculateViewLocation: d = Do, done: b, ...k } = I, F = Wn(I, h, C - 1), L = ie(F, h.offsetTree, T) + w + S, V = L + Ct(h.sizeTree, F)[1], D = u + S, J = u + f - m, nt = d({
|
|
1771
1773
|
itemBottom: V,
|
|
1772
1774
|
itemTop: L,
|
|
1773
|
-
locationParams: { align: R, behavior:
|
|
1775
|
+
locationParams: { align: R, behavior: g, ...k },
|
|
1774
1776
|
viewportBottom: J,
|
|
1775
1777
|
viewportTop: D
|
|
1776
1778
|
});
|
|
@@ -1780,27 +1782,27 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1780
1782
|
P((B) => !B),
|
|
1781
1783
|
// skips the initial publish of false, and the cleanup call.
|
|
1782
1784
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
1783
|
-
jt(
|
|
1785
|
+
jt(st(i) ? 1 : 2)
|
|
1784
1786
|
),
|
|
1785
1787
|
b
|
|
1786
1788
|
) : b && b(), nt;
|
|
1787
1789
|
}),
|
|
1788
|
-
P((
|
|
1790
|
+
P((I) => I !== null)
|
|
1789
1791
|
),
|
|
1790
1792
|
a
|
|
1791
1793
|
), {
|
|
1792
|
-
scrollIntoView:
|
|
1794
|
+
scrollIntoView: p
|
|
1793
1795
|
};
|
|
1794
1796
|
},
|
|
1795
|
-
X(Et, at, ce,
|
|
1797
|
+
X(Et, at, ce, _t, Vt),
|
|
1796
1798
|
{ singleton: !0 }
|
|
1797
1799
|
), Un = U(
|
|
1798
1800
|
([{ scrollVelocity: t }]) => {
|
|
1799
1801
|
const e = v(!1), n = $(), o = v(!1);
|
|
1800
|
-
return
|
|
1802
|
+
return O(
|
|
1801
1803
|
x(
|
|
1802
1804
|
t,
|
|
1803
|
-
|
|
1805
|
+
_(o, e, n),
|
|
1804
1806
|
P(([r, s]) => !!s),
|
|
1805
1807
|
E(([r, s, i, l]) => {
|
|
1806
1808
|
const { enter: c, exit: a } = s;
|
|
@@ -1815,7 +1817,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1815
1817
|
),
|
|
1816
1818
|
e
|
|
1817
1819
|
), K(
|
|
1818
|
-
x(rt(e, t, n),
|
|
1820
|
+
x(rt(e, t, n), _(o)),
|
|
1819
1821
|
([[r, s, i], l]) => {
|
|
1820
1822
|
r && l && l.change && l.change(s, i);
|
|
1821
1823
|
}
|
|
@@ -1825,20 +1827,20 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1825
1827
|
{ singleton: !0 }
|
|
1826
1828
|
), je = U(([{ scrollContainerState: t, scrollTo: e }]) => {
|
|
1827
1829
|
const n = $(), o = $(), r = $(), s = v(!1), i = v(void 0);
|
|
1828
|
-
return
|
|
1830
|
+
return O(
|
|
1829
1831
|
x(
|
|
1830
1832
|
rt(n, o),
|
|
1831
|
-
E(([{ scrollHeight: l, scrollTop: c, viewportHeight: a }, { offsetTop:
|
|
1833
|
+
E(([{ scrollHeight: l, scrollTop: c, viewportHeight: a }, { offsetTop: p }]) => ({
|
|
1832
1834
|
scrollHeight: l,
|
|
1833
|
-
scrollTop: Math.max(0, c -
|
|
1835
|
+
scrollTop: Math.max(0, c - p),
|
|
1834
1836
|
viewportHeight: a
|
|
1835
1837
|
}))
|
|
1836
1838
|
),
|
|
1837
1839
|
t
|
|
1838
|
-
),
|
|
1840
|
+
), O(
|
|
1839
1841
|
x(
|
|
1840
1842
|
e,
|
|
1841
|
-
|
|
1843
|
+
_(o),
|
|
1842
1844
|
E(([l, { offsetTop: c }]) => ({
|
|
1843
1845
|
...l,
|
|
1844
1846
|
top: l.top + c
|
|
@@ -1863,28 +1865,28 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1863
1865
|
{ didMount: s },
|
|
1864
1866
|
{ useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
|
|
1865
1867
|
]) => {
|
|
1866
|
-
const a = $(),
|
|
1867
|
-
return
|
|
1868
|
+
const a = $(), p = v(void 0), I = v(null), h = v(null);
|
|
1869
|
+
return O(l, I), O(c, h), K(
|
|
1868
1870
|
x(
|
|
1869
1871
|
a,
|
|
1870
|
-
|
|
1872
|
+
_(e, o, i, I, h, n)
|
|
1871
1873
|
),
|
|
1872
|
-
([
|
|
1873
|
-
const R = Ho(
|
|
1874
|
-
|
|
1874
|
+
([f, C, w, S, m, u, T]) => {
|
|
1875
|
+
const R = Ho(C.sizeTree);
|
|
1876
|
+
S && m !== null && u !== null && (w = m.scrollTop - u.offsetTop), w -= T, f({ ranges: R, scrollTop: w });
|
|
1875
1877
|
}
|
|
1876
|
-
),
|
|
1878
|
+
), O(x(p, P(Me), E(Ko)), r), O(
|
|
1877
1879
|
x(
|
|
1878
1880
|
s,
|
|
1879
|
-
|
|
1880
|
-
P(([,
|
|
1881
|
+
_(p),
|
|
1882
|
+
P(([, f]) => f !== void 0),
|
|
1881
1883
|
Y(),
|
|
1882
|
-
E(([,
|
|
1884
|
+
E(([, f]) => f.ranges)
|
|
1883
1885
|
),
|
|
1884
1886
|
t
|
|
1885
1887
|
), {
|
|
1886
1888
|
getState: a,
|
|
1887
|
-
restoreStateFrom:
|
|
1889
|
+
restoreStateFrom: p
|
|
1888
1890
|
};
|
|
1889
1891
|
},
|
|
1890
1892
|
X(Et, at, ue, Pt, je)
|
|
@@ -1894,7 +1896,7 @@ function Ko(t) {
|
|
|
1894
1896
|
}
|
|
1895
1897
|
const jo = U(([{ topItemsIndexes: t }]) => {
|
|
1896
1898
|
const e = v(0);
|
|
1897
|
-
return
|
|
1899
|
+
return O(
|
|
1898
1900
|
x(
|
|
1899
1901
|
e,
|
|
1900
1902
|
P((n) => n >= 0),
|
|
@@ -1902,7 +1904,7 @@ const jo = U(([{ topItemsIndexes: t }]) => {
|
|
|
1902
1904
|
),
|
|
1903
1905
|
t
|
|
1904
1906
|
), { topItemCount: e };
|
|
1905
|
-
}, X(
|
|
1907
|
+
}, X(_t));
|
|
1906
1908
|
function Kn(t) {
|
|
1907
1909
|
let e = !1, n;
|
|
1908
1910
|
return () => (e || (e = !0, n = t()), n);
|
|
@@ -1912,80 +1914,80 @@ const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
1912
1914
|
{ deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
|
|
1913
1915
|
{ isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
|
|
1914
1916
|
{ listState: c },
|
|
1915
|
-
{ beforeUnshiftWith: a, gap:
|
|
1916
|
-
{ log:
|
|
1917
|
-
{ recalcInProgress:
|
|
1917
|
+
{ beforeUnshiftWith: a, gap: p, shiftWithOffset: I, sizes: h },
|
|
1918
|
+
{ log: f },
|
|
1919
|
+
{ recalcInProgress: C }
|
|
1918
1920
|
]) => {
|
|
1919
|
-
const
|
|
1921
|
+
const w = ht(
|
|
1920
1922
|
x(
|
|
1921
1923
|
c,
|
|
1922
|
-
|
|
1924
|
+
_(i),
|
|
1923
1925
|
Rt(
|
|
1924
|
-
([,
|
|
1925
|
-
const
|
|
1926
|
+
([, m, u, T], [{ bottom: R, items: g, offsetBottom: d, totalCount: b }, k]) => {
|
|
1927
|
+
const F = R + d;
|
|
1926
1928
|
let L = 0;
|
|
1927
|
-
return u === b &&
|
|
1929
|
+
return u === b && m.length > 0 && g.length > 0 && (g[0].originalIndex === 0 && m[0].originalIndex === 0 || (L = F - T, L !== 0 && (L += k))), [L, g, b, F];
|
|
1928
1930
|
},
|
|
1929
1931
|
[0, [], 0, 0]
|
|
1930
1932
|
),
|
|
1931
|
-
P(([
|
|
1932
|
-
|
|
1933
|
-
P(([,
|
|
1934
|
-
E(([[
|
|
1933
|
+
P(([m]) => m !== 0),
|
|
1934
|
+
_(o, l, n, r, f, C),
|
|
1935
|
+
P(([, m, u, T, , , R]) => !R && !T && m !== 0 && u === le),
|
|
1936
|
+
E(([[m], , , , , u]) => (u("Upward scrolling compensation", { amount: m }, mt.DEBUG), m))
|
|
1935
1937
|
)
|
|
1936
1938
|
);
|
|
1937
|
-
function
|
|
1938
|
-
|
|
1939
|
+
function S(m) {
|
|
1940
|
+
m > 0 ? (W(e, { behavior: "auto", top: -m }), W(t, 0)) : (W(t, 0), W(e, { behavior: "auto", top: -m }));
|
|
1939
1941
|
}
|
|
1940
|
-
return K(x(
|
|
1941
|
-
T && qo() ? W(t, u -
|
|
1942
|
+
return K(x(w, _(t, s)), ([m, u, T]) => {
|
|
1943
|
+
T && qo() ? W(t, u - m) : S(-m);
|
|
1942
1944
|
}), K(
|
|
1943
1945
|
x(
|
|
1944
|
-
rt(ct(s, !1), t,
|
|
1945
|
-
P(([
|
|
1946
|
-
E(([
|
|
1946
|
+
rt(ct(s, !1), t, C),
|
|
1947
|
+
P(([m, u, T]) => !m && !T && u !== 0),
|
|
1948
|
+
E(([m, u]) => u),
|
|
1947
1949
|
Lt(1)
|
|
1948
1950
|
),
|
|
1949
|
-
|
|
1950
|
-
),
|
|
1951
|
+
S
|
|
1952
|
+
), O(
|
|
1951
1953
|
x(
|
|
1952
|
-
|
|
1953
|
-
E((
|
|
1954
|
+
I,
|
|
1955
|
+
E((m) => ({ top: -m }))
|
|
1954
1956
|
),
|
|
1955
1957
|
e
|
|
1956
1958
|
), K(
|
|
1957
1959
|
x(
|
|
1958
1960
|
a,
|
|
1959
|
-
|
|
1960
|
-
E(([
|
|
1961
|
+
_(h, p),
|
|
1962
|
+
E(([m, { groupIndices: u, lastSize: T, sizeTree: R }, g]) => {
|
|
1961
1963
|
function d(b) {
|
|
1962
|
-
return b * (T +
|
|
1964
|
+
return b * (T + g);
|
|
1963
1965
|
}
|
|
1964
1966
|
if (u.length === 0)
|
|
1965
|
-
return d(
|
|
1967
|
+
return d(m);
|
|
1966
1968
|
{
|
|
1967
1969
|
let b = 0;
|
|
1968
1970
|
const k = re(R, 0);
|
|
1969
|
-
let
|
|
1970
|
-
for (;
|
|
1971
|
-
|
|
1971
|
+
let F = 0, L = 0;
|
|
1972
|
+
for (; F < m; ) {
|
|
1973
|
+
F++, b += k;
|
|
1972
1974
|
let V = u.length === L + 1 ? 1 / 0 : u[L + 1] - u[L] - 1;
|
|
1973
|
-
|
|
1975
|
+
F + V > m && (b -= k, V = m - F + 1), F += V, b += d(V), L++;
|
|
1974
1976
|
}
|
|
1975
1977
|
return b;
|
|
1976
1978
|
}
|
|
1977
1979
|
})
|
|
1978
1980
|
),
|
|
1979
|
-
(
|
|
1980
|
-
W(t,
|
|
1981
|
-
W(e, { top:
|
|
1982
|
-
W(t, 0), W(
|
|
1981
|
+
(m) => {
|
|
1982
|
+
W(t, m), requestAnimationFrame(() => {
|
|
1983
|
+
W(e, { top: m }), requestAnimationFrame(() => {
|
|
1984
|
+
W(t, 0), W(C, !1);
|
|
1983
1985
|
});
|
|
1984
1986
|
});
|
|
1985
1987
|
}
|
|
1986
1988
|
), { deviation: t };
|
|
1987
1989
|
},
|
|
1988
|
-
X(at, ae,
|
|
1990
|
+
X(at, ae, _t, Et, Vt, Ne)
|
|
1989
1991
|
), Zo = U(
|
|
1990
1992
|
([
|
|
1991
1993
|
t,
|
|
@@ -2012,7 +2014,7 @@ const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2012
2014
|
}),
|
|
2013
2015
|
X(
|
|
2014
2016
|
Ke,
|
|
2015
|
-
|
|
2017
|
+
_o,
|
|
2016
2018
|
Pt,
|
|
2017
2019
|
Un,
|
|
2018
2020
|
$n,
|
|
@@ -2035,25 +2037,25 @@ const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2035
2037
|
sizeRanges: l,
|
|
2036
2038
|
sizes: c,
|
|
2037
2039
|
statefulTotalCount: a,
|
|
2038
|
-
totalCount:
|
|
2039
|
-
trackItemSizes:
|
|
2040
|
+
totalCount: p,
|
|
2041
|
+
trackItemSizes: I
|
|
2040
2042
|
},
|
|
2041
|
-
{ initialItemFinalLocationReached:
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2043
|
+
{ initialItemFinalLocationReached: h, initialTopMostItemIndex: f, scrolledToInitialItem: C },
|
|
2044
|
+
w,
|
|
2045
|
+
S,
|
|
2046
|
+
m,
|
|
2045
2047
|
{ listState: u, topItemsIndexes: T, ...R },
|
|
2046
|
-
{ scrollToIndex:
|
|
2048
|
+
{ scrollToIndex: g },
|
|
2047
2049
|
d,
|
|
2048
2050
|
{ topItemCount: b },
|
|
2049
2051
|
{ groupCounts: k },
|
|
2050
|
-
|
|
2051
|
-
]) => (
|
|
2052
|
+
F
|
|
2053
|
+
]) => (O(R.rangeChanged, F.scrollSeekRangeChanged), O(
|
|
2052
2054
|
x(
|
|
2053
|
-
|
|
2055
|
+
F.windowViewportRect,
|
|
2054
2056
|
E((L) => L.visibleHeight)
|
|
2055
2057
|
),
|
|
2056
|
-
|
|
2058
|
+
w.viewportHeight
|
|
2057
2059
|
), {
|
|
2058
2060
|
data: t,
|
|
2059
2061
|
defaultItemHeight: e,
|
|
@@ -2061,41 +2063,41 @@ const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2061
2063
|
fixedItemHeight: o,
|
|
2062
2064
|
gap: r,
|
|
2063
2065
|
groupCounts: k,
|
|
2064
|
-
initialItemFinalLocationReached:
|
|
2065
|
-
initialTopMostItemIndex:
|
|
2066
|
-
scrolledToInitialItem:
|
|
2066
|
+
initialItemFinalLocationReached: h,
|
|
2067
|
+
initialTopMostItemIndex: f,
|
|
2068
|
+
scrolledToInitialItem: C,
|
|
2067
2069
|
sizeRanges: l,
|
|
2068
2070
|
topItemCount: b,
|
|
2069
2071
|
topItemsIndexes: T,
|
|
2070
2072
|
// input
|
|
2071
|
-
totalCount:
|
|
2072
|
-
...
|
|
2073
|
+
totalCount: p,
|
|
2074
|
+
...m,
|
|
2073
2075
|
groupIndices: s,
|
|
2074
2076
|
itemSize: i,
|
|
2075
2077
|
listState: u,
|
|
2076
|
-
scrollToIndex:
|
|
2078
|
+
scrollToIndex: g,
|
|
2077
2079
|
// output
|
|
2078
2080
|
statefulTotalCount: a,
|
|
2079
|
-
trackItemSizes:
|
|
2081
|
+
trackItemSizes: I,
|
|
2080
2082
|
// exported from stateFlagsSystem
|
|
2081
2083
|
...R,
|
|
2082
2084
|
// the bag of IO from featureGroup1System
|
|
2083
|
-
...
|
|
2084
|
-
...
|
|
2085
|
+
...F,
|
|
2086
|
+
...w,
|
|
2085
2087
|
sizes: c,
|
|
2086
|
-
...
|
|
2088
|
+
...S
|
|
2087
2089
|
}),
|
|
2088
2090
|
X(
|
|
2089
2091
|
Et,
|
|
2090
2092
|
ue,
|
|
2091
2093
|
at,
|
|
2092
2094
|
Uo,
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
+
Go,
|
|
2096
|
+
_t,
|
|
2095
2097
|
ce,
|
|
2096
2098
|
Yo,
|
|
2097
2099
|
jo,
|
|
2098
|
-
|
|
2100
|
+
Gn,
|
|
2099
2101
|
Zo
|
|
2100
2102
|
)
|
|
2101
2103
|
);
|
|
@@ -2112,78 +2114,78 @@ function Xo(t, e) {
|
|
|
2112
2114
|
const pe = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
2113
2115
|
function qe(t, e, n) {
|
|
2114
2116
|
const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = H.createContext({});
|
|
2115
|
-
function c(
|
|
2116
|
-
|
|
2117
|
+
function c(m, u) {
|
|
2118
|
+
m.propsReady && W(m.propsReady, !1);
|
|
2117
2119
|
for (const T of o) {
|
|
2118
|
-
const R =
|
|
2120
|
+
const R = m[e.required[T]];
|
|
2119
2121
|
W(R, u[T]);
|
|
2120
2122
|
}
|
|
2121
2123
|
for (const T of r)
|
|
2122
2124
|
if (T in u) {
|
|
2123
|
-
const R =
|
|
2125
|
+
const R = m[e.optional[T]];
|
|
2124
2126
|
W(R, u[T]);
|
|
2125
2127
|
}
|
|
2126
|
-
|
|
2128
|
+
m.propsReady && W(m.propsReady, !0);
|
|
2127
2129
|
}
|
|
2128
|
-
function a(
|
|
2130
|
+
function a(m) {
|
|
2129
2131
|
return s.reduce((u, T) => (u[T] = (R) => {
|
|
2130
|
-
const
|
|
2131
|
-
W(
|
|
2132
|
+
const g = m[e.methods[T]];
|
|
2133
|
+
W(g, R);
|
|
2132
2134
|
}, u), {});
|
|
2133
2135
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return i.reduce((u, T) => (u[T] = mo(
|
|
2136
|
+
function p(m) {
|
|
2137
|
+
return i.reduce((u, T) => (u[T] = mo(m[e.events[T]]), u), {});
|
|
2136
2138
|
}
|
|
2137
|
-
const
|
|
2138
|
-
const { children: T, ...R } =
|
|
2139
|
+
const I = H.forwardRef((m, u) => {
|
|
2140
|
+
const { children: T, ...R } = m, [g] = H.useState(() => ve(ho(t), (k) => {
|
|
2139
2141
|
c(k, R);
|
|
2140
|
-
})), [d] = H.useState(cn(
|
|
2142
|
+
})), [d] = H.useState(cn(p, g));
|
|
2141
2143
|
pe(() => {
|
|
2142
2144
|
for (const k of i)
|
|
2143
2145
|
k in R && K(d[k], R[k]);
|
|
2144
2146
|
return () => {
|
|
2145
2147
|
Object.values(d).map(We);
|
|
2146
2148
|
};
|
|
2147
|
-
}, [R, d,
|
|
2148
|
-
c(
|
|
2149
|
-
}), H.useImperativeHandle(u, ln(a(
|
|
2149
|
+
}, [R, d, g]), pe(() => {
|
|
2150
|
+
c(g, R);
|
|
2151
|
+
}), H.useImperativeHandle(u, ln(a(g)));
|
|
2150
2152
|
const b = n;
|
|
2151
|
-
return /* @__PURE__ */ z(l.Provider, { value:
|
|
2152
|
-
}),
|
|
2153
|
+
return /* @__PURE__ */ z(l.Provider, { value: g, children: n ? /* @__PURE__ */ z(b, { ...Xo([...o, ...r, ...i], R), children: T }) : T });
|
|
2154
|
+
}), h = (m) => {
|
|
2153
2155
|
const u = H.useContext(l);
|
|
2154
2156
|
return H.useCallback(
|
|
2155
2157
|
(T) => {
|
|
2156
|
-
W(u[
|
|
2158
|
+
W(u[m], T);
|
|
2157
2159
|
},
|
|
2158
|
-
[u,
|
|
2160
|
+
[u, m]
|
|
2159
2161
|
);
|
|
2160
|
-
},
|
|
2161
|
-
const T = H.useContext(l)[
|
|
2162
|
-
(
|
|
2162
|
+
}, f = (m) => {
|
|
2163
|
+
const T = H.useContext(l)[m], R = H.useCallback(
|
|
2164
|
+
(g) => K(T, g),
|
|
2163
2165
|
[T]
|
|
2164
2166
|
);
|
|
2165
2167
|
return H.useSyncExternalStore(
|
|
2166
2168
|
R,
|
|
2167
|
-
() =>
|
|
2168
|
-
() =>
|
|
2169
|
+
() => st(T),
|
|
2170
|
+
() => st(T)
|
|
2169
2171
|
);
|
|
2170
|
-
},
|
|
2171
|
-
const T = H.useContext(l)[
|
|
2172
|
+
}, C = (m) => {
|
|
2173
|
+
const T = H.useContext(l)[m], [R, g] = H.useState(cn(st, T));
|
|
2172
2174
|
return pe(
|
|
2173
2175
|
() => K(T, (d) => {
|
|
2174
|
-
d !== R &&
|
|
2176
|
+
d !== R && g(ln(d));
|
|
2175
2177
|
}),
|
|
2176
2178
|
[T, R]
|
|
2177
2179
|
), R;
|
|
2178
|
-
},
|
|
2180
|
+
}, w = H.version.startsWith("18") ? f : C;
|
|
2179
2181
|
return {
|
|
2180
|
-
Component:
|
|
2181
|
-
useEmitter: (
|
|
2182
|
-
const R = H.useContext(l)[
|
|
2182
|
+
Component: I,
|
|
2183
|
+
useEmitter: (m, u) => {
|
|
2184
|
+
const R = H.useContext(l)[m];
|
|
2183
2185
|
pe(() => K(R, u), [u, R]);
|
|
2184
2186
|
},
|
|
2185
|
-
useEmitterValue:
|
|
2186
|
-
usePublisher:
|
|
2187
|
+
useEmitterValue: w,
|
|
2188
|
+
usePublisher: h
|
|
2187
2189
|
};
|
|
2188
2190
|
}
|
|
2189
2191
|
const be = H.createContext(void 0), qn = H.createContext(void 0), Yn = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
@@ -2195,60 +2197,60 @@ function Jo(t) {
|
|
|
2195
2197
|
}
|
|
2196
2198
|
function Zn(t, e, n, o = Yt, r, s) {
|
|
2197
2199
|
const i = H.useRef(null), l = H.useRef(null), c = H.useRef(null), a = H.useCallback(
|
|
2198
|
-
(
|
|
2199
|
-
let
|
|
2200
|
-
const
|
|
2201
|
-
if (Jo(
|
|
2202
|
-
const u = ke(
|
|
2203
|
-
|
|
2200
|
+
(h) => {
|
|
2201
|
+
let f, C, w;
|
|
2202
|
+
const S = h.target;
|
|
2203
|
+
if (Jo(S) || ke(S)) {
|
|
2204
|
+
const u = ke(S) ? S : S.defaultView;
|
|
2205
|
+
w = s ? u.scrollX : u.scrollY, f = s ? u.document.documentElement.scrollWidth : u.document.documentElement.scrollHeight, C = s ? u.innerWidth : u.innerHeight;
|
|
2204
2206
|
} else
|
|
2205
|
-
|
|
2206
|
-
const
|
|
2207
|
+
w = s ? S.scrollLeft : S.scrollTop, f = s ? S.scrollWidth : S.scrollHeight, C = s ? S.offsetWidth : S.offsetHeight;
|
|
2208
|
+
const m = () => {
|
|
2207
2209
|
t({
|
|
2208
|
-
scrollHeight:
|
|
2209
|
-
scrollTop: Math.max(
|
|
2210
|
-
viewportHeight:
|
|
2210
|
+
scrollHeight: f,
|
|
2211
|
+
scrollTop: Math.max(w, 0),
|
|
2212
|
+
viewportHeight: C
|
|
2211
2213
|
});
|
|
2212
2214
|
};
|
|
2213
|
-
|
|
2215
|
+
h.suppressFlushSync ? m() : io.flushSync(m), l.current !== null && (w === l.current || w <= 0 || w === f - C) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
|
|
2214
2216
|
},
|
|
2215
2217
|
[t, e, s]
|
|
2216
2218
|
);
|
|
2217
2219
|
H.useEffect(() => {
|
|
2218
|
-
const
|
|
2219
|
-
return o(r || i.current), a({ suppressFlushSync: !0, target:
|
|
2220
|
-
o(null),
|
|
2220
|
+
const h = r || i.current;
|
|
2221
|
+
return o(r || i.current), a({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", a, { passive: !0 }), () => {
|
|
2222
|
+
o(null), h.removeEventListener("scroll", a);
|
|
2221
2223
|
};
|
|
2222
2224
|
}, [i, a, n, o, r]);
|
|
2223
|
-
function
|
|
2224
|
-
const
|
|
2225
|
-
if (!
|
|
2225
|
+
function p(h) {
|
|
2226
|
+
const f = i.current;
|
|
2227
|
+
if (!f || (s ? "offsetWidth" in f && f.offsetWidth === 0 : "offsetHeight" in f && f.offsetHeight === 0))
|
|
2226
2228
|
return;
|
|
2227
|
-
const
|
|
2228
|
-
let
|
|
2229
|
-
ke(
|
|
2230
|
-
wt(
|
|
2231
|
-
s ?
|
|
2232
|
-
),
|
|
2233
|
-
const u =
|
|
2234
|
-
if (
|
|
2235
|
-
t({ scrollHeight:
|
|
2229
|
+
const C = h.behavior === "smooth";
|
|
2230
|
+
let w, S, m;
|
|
2231
|
+
ke(f) ? (S = Math.max(
|
|
2232
|
+
wt(f.document.documentElement, s ? "width" : "height"),
|
|
2233
|
+
s ? f.document.documentElement.scrollWidth : f.document.documentElement.scrollHeight
|
|
2234
|
+
), w = s ? f.innerWidth : f.innerHeight, m = s ? window.scrollX : window.scrollY) : (S = f[s ? "scrollWidth" : "scrollHeight"], w = wt(f, s ? "width" : "height"), m = f[s ? "scrollLeft" : "scrollTop"]);
|
|
2235
|
+
const u = S - w;
|
|
2236
|
+
if (h.top = Math.ceil(Math.max(Math.min(u, h.top), 0)), Nn(w, S) || h.top === m) {
|
|
2237
|
+
t({ scrollHeight: S, scrollTop: m, viewportHeight: w }), C && e(!0);
|
|
2236
2238
|
return;
|
|
2237
2239
|
}
|
|
2238
|
-
|
|
2240
|
+
C ? (l.current = h.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
2239
2241
|
c.current = null, l.current = null, e(!0);
|
|
2240
|
-
}, 1e3)) : l.current = null, s && (
|
|
2242
|
+
}, 1e3)) : l.current = null, s && (h = { behavior: h.behavior, left: h.top }), f.scrollTo(h);
|
|
2241
2243
|
}
|
|
2242
|
-
function
|
|
2243
|
-
s && (
|
|
2244
|
+
function I(h) {
|
|
2245
|
+
s && (h = { behavior: h.behavior, left: h.top }), i.current.scrollBy(h);
|
|
2244
2246
|
}
|
|
2245
|
-
return { scrollByCallback:
|
|
2247
|
+
return { scrollByCallback: I, scrollerRef: i, scrollToCallback: p };
|
|
2246
2248
|
}
|
|
2247
|
-
const
|
|
2249
|
+
const Fe = "-webkit-sticky", xn = "sticky", Xn = Kn(() => {
|
|
2248
2250
|
if (typeof document > "u")
|
|
2249
2251
|
return xn;
|
|
2250
2252
|
const t = document.createElement("div");
|
|
2251
|
-
return t.style.position =
|
|
2253
|
+
return t.style.position = Fe, t.style.position === Fe ? Fe : xn;
|
|
2252
2254
|
});
|
|
2253
2255
|
function Ye(t) {
|
|
2254
2256
|
return t;
|
|
@@ -2257,7 +2259,7 @@ const Qo = /* @__PURE__ */ U(() => {
|
|
|
2257
2259
|
const t = v((c) => `Item ${c}`), e = v(null), n = v((c) => `Group ${c}`), o = v({}), r = v(Ye), s = v("div"), i = v(Yt), l = (c, a = null) => ct(
|
|
2258
2260
|
x(
|
|
2259
2261
|
o,
|
|
2260
|
-
E((
|
|
2262
|
+
E((p) => p[c]),
|
|
2261
2263
|
Y()
|
|
2262
2264
|
),
|
|
2263
2265
|
a
|
|
@@ -2284,23 +2286,23 @@ const Qo = /* @__PURE__ */ U(() => {
|
|
|
2284
2286
|
([t, e]) => ({ ...t, ...e }),
|
|
2285
2287
|
X(jn, Qo)
|
|
2286
2288
|
), er = ({ height: t }) => /* @__PURE__ */ z("div", { style: { height: t } }), nr = { overflowAnchor: "none", position: Xn(), zIndex: 1 }, Jn = { overflowAnchor: "none" }, or = { ...Jn, display: "inline-block", height: "100%" }, Tn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
|
|
2287
|
-
const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l, a = M("itemContent"),
|
|
2289
|
+
const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l, a = M("itemContent"), p = M("context"), I = M("groupContent"), h = M("trackItemSizes"), f = M("itemSize"), C = M("log"), w = gt("gap"), S = M("horizontalDirection"), { callbackRef: m } = kn(
|
|
2288
2290
|
o,
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
+
f,
|
|
2292
|
+
h,
|
|
2291
2293
|
e ? Yt : c,
|
|
2294
|
+
C,
|
|
2292
2295
|
w,
|
|
2293
|
-
I,
|
|
2294
2296
|
s,
|
|
2295
|
-
|
|
2297
|
+
S,
|
|
2296
2298
|
M("skipAnimationFrameInResizeObserver")
|
|
2297
2299
|
), [u, T] = H.useState(0);
|
|
2298
2300
|
Je("deviation", (B) => {
|
|
2299
2301
|
u !== B && T(B);
|
|
2300
2302
|
});
|
|
2301
|
-
const R = M("EmptyPlaceholder"),
|
|
2303
|
+
const R = M("EmptyPlaceholder"), g = M("ScrollSeekPlaceholder") || er, d = M("ListComponent"), b = M("ItemComponent"), k = M("GroupComponent"), F = M("computeItemKey"), L = M("isSeeking"), V = M("groupIndices").length > 0, D = M("alignToBottom"), J = M("initialItemFinalLocationReached"), nt = e ? {} : {
|
|
2302
2304
|
boxSizing: "border-box",
|
|
2303
|
-
...
|
|
2305
|
+
...S ? {
|
|
2304
2306
|
display: "inline-block",
|
|
2305
2307
|
height: "100%",
|
|
2306
2308
|
marginLeft: u !== 0 ? u : D ? "auto" : 0,
|
|
@@ -2314,49 +2316,49 @@ const Qo = /* @__PURE__ */ U(() => {
|
|
|
2314
2316
|
},
|
|
2315
2317
|
...J ? {} : { visibility: "hidden" }
|
|
2316
2318
|
};
|
|
2317
|
-
return !e && n.totalCount === 0 && R ? /* @__PURE__ */ z(R, { ...Z(R,
|
|
2319
|
+
return !e && n.totalCount === 0 && R ? /* @__PURE__ */ z(R, { ...Z(R, p) }) : /* @__PURE__ */ z(
|
|
2318
2320
|
d,
|
|
2319
2321
|
{
|
|
2320
|
-
...Z(d,
|
|
2322
|
+
...Z(d, p),
|
|
2321
2323
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
2322
|
-
ref:
|
|
2324
|
+
ref: m,
|
|
2323
2325
|
style: nt,
|
|
2324
2326
|
children: (e ? n.topItems : n.items).map((B) => {
|
|
2325
|
-
const q = B.originalIndex,
|
|
2327
|
+
const q = B.originalIndex, it = F(q + n.firstItemIndex, B.data, p);
|
|
2326
2328
|
return L ? /* @__PURE__ */ $t(
|
|
2327
|
-
|
|
2329
|
+
g,
|
|
2328
2330
|
{
|
|
2329
|
-
...Z(
|
|
2331
|
+
...Z(g, p),
|
|
2330
2332
|
height: B.size,
|
|
2331
2333
|
index: B.index,
|
|
2332
|
-
key:
|
|
2334
|
+
key: it,
|
|
2333
2335
|
type: B.type || "item",
|
|
2334
2336
|
...B.type === "group" ? {} : { groupIndex: B.groupIndex }
|
|
2335
2337
|
}
|
|
2336
2338
|
) : B.type === "group" ? /* @__PURE__ */ $t(
|
|
2337
2339
|
k,
|
|
2338
2340
|
{
|
|
2339
|
-
...Z(k,
|
|
2341
|
+
...Z(k, p),
|
|
2340
2342
|
"data-index": q,
|
|
2341
2343
|
"data-item-index": B.index,
|
|
2342
2344
|
"data-known-size": B.size,
|
|
2343
|
-
key:
|
|
2345
|
+
key: it,
|
|
2344
2346
|
style: nr
|
|
2345
2347
|
},
|
|
2346
|
-
|
|
2348
|
+
I(B.index, p)
|
|
2347
2349
|
) : /* @__PURE__ */ $t(
|
|
2348
2350
|
b,
|
|
2349
2351
|
{
|
|
2350
|
-
...Z(b,
|
|
2352
|
+
...Z(b, p),
|
|
2351
2353
|
...Qn(b, B.data),
|
|
2352
2354
|
"data-index": q,
|
|
2353
2355
|
"data-item-group-index": B.groupIndex,
|
|
2354
2356
|
"data-item-index": B.index,
|
|
2355
2357
|
"data-known-size": B.size,
|
|
2356
|
-
key:
|
|
2357
|
-
style:
|
|
2358
|
+
key: it,
|
|
2359
|
+
style: S ? or : Jn
|
|
2358
2360
|
},
|
|
2359
|
-
V ? a(B.index, B.groupIndex, B.data,
|
|
2361
|
+
V ? a(B.index, B.groupIndex, B.data, p) : a(B.index, B.data, p)
|
|
2360
2362
|
);
|
|
2361
2363
|
})
|
|
2362
2364
|
}
|
|
@@ -2417,24 +2419,24 @@ const lr = /* @__PURE__ */ H.memo(function() {
|
|
|
2417
2419
|
});
|
|
2418
2420
|
function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2419
2421
|
return H.memo(function({ children: s, style: i, ...l }) {
|
|
2420
|
-
const c = n("scrollContainerState"), a = e("ScrollerComponent"),
|
|
2422
|
+
const c = n("scrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("scrollerRef"), h = e("context"), f = e("horizontalDirection") || !1, { scrollByCallback: C, scrollerRef: w, scrollToCallback: S } = Zn(
|
|
2421
2423
|
c,
|
|
2422
|
-
|
|
2424
|
+
p,
|
|
2423
2425
|
a,
|
|
2424
|
-
|
|
2426
|
+
I,
|
|
2425
2427
|
void 0,
|
|
2426
|
-
|
|
2428
|
+
f
|
|
2427
2429
|
);
|
|
2428
|
-
return t("scrollTo",
|
|
2430
|
+
return t("scrollTo", S), t("scrollBy", C), /* @__PURE__ */ z(
|
|
2429
2431
|
a,
|
|
2430
2432
|
{
|
|
2431
2433
|
"data-testid": "virtuoso-scroller",
|
|
2432
2434
|
"data-virtuoso-scroller": !0,
|
|
2433
|
-
ref:
|
|
2434
|
-
style: { ...
|
|
2435
|
+
ref: w,
|
|
2436
|
+
style: { ...f ? sr : rr, ...i },
|
|
2435
2437
|
tabIndex: 0,
|
|
2436
2438
|
...l,
|
|
2437
|
-
...Z(a,
|
|
2439
|
+
...Z(a, h),
|
|
2438
2440
|
children: s
|
|
2439
2441
|
}
|
|
2440
2442
|
);
|
|
@@ -2442,26 +2444,26 @@ function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2442
2444
|
}
|
|
2443
2445
|
function Xe({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2444
2446
|
return H.memo(function({ children: s, style: i, ...l }) {
|
|
2445
|
-
const c = n("windowScrollContainerState"), a = e("ScrollerComponent"),
|
|
2447
|
+
const c = n("windowScrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("totalListHeight"), h = e("deviation"), f = e("customScrollParent"), C = e("context"), w = H.useRef(null), S = e("scrollerRef"), { scrollByCallback: m, scrollerRef: u, scrollToCallback: T } = Zn(
|
|
2446
2448
|
c,
|
|
2447
|
-
|
|
2449
|
+
p,
|
|
2448
2450
|
a,
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
+
S,
|
|
2452
|
+
f
|
|
2451
2453
|
);
|
|
2452
2454
|
return Yn(() => {
|
|
2453
2455
|
var R;
|
|
2454
|
-
return u.current =
|
|
2456
|
+
return u.current = f || ((R = w.current) == null ? void 0 : R.ownerDocument.defaultView), () => {
|
|
2455
2457
|
u.current = null;
|
|
2456
2458
|
};
|
|
2457
|
-
}, [u,
|
|
2459
|
+
}, [u, f]), t("windowScrollTo", T), t("scrollBy", m), /* @__PURE__ */ z(
|
|
2458
2460
|
a,
|
|
2459
2461
|
{
|
|
2460
|
-
ref:
|
|
2462
|
+
ref: w,
|
|
2461
2463
|
"data-virtuoso-scroller": !0,
|
|
2462
|
-
style: { position: "relative", ...i, ...
|
|
2464
|
+
style: { position: "relative", ...i, ...I !== 0 ? { height: I + h } : {} },
|
|
2463
2465
|
...l,
|
|
2464
|
-
...Z(a,
|
|
2466
|
+
...Z(a, C),
|
|
2465
2467
|
children: s
|
|
2466
2468
|
}
|
|
2467
2469
|
);
|
|
@@ -2476,7 +2478,7 @@ const ur = ({ children: t }) => {
|
|
|
2476
2478
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2477
2479
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: l, style: Zt(r), children: t });
|
|
2478
2480
|
}, ar = ({ children: t }) => {
|
|
2479
|
-
const e = H.useContext(be), n = gt("windowViewportRect"), o = gt("fixedItemHeight"), r = M("customScrollParent"), s =
|
|
2481
|
+
const e = H.useContext(be), n = gt("windowViewportRect"), o = gt("fixedItemHeight"), r = M("customScrollParent"), s = _e(
|
|
2480
2482
|
n,
|
|
2481
2483
|
r,
|
|
2482
2484
|
M("skipAnimationFrameInResizeObserver")
|
|
@@ -2567,7 +2569,7 @@ const ur = ({ children: t }) => {
|
|
|
2567
2569
|
] })), e = v(null), n = v(null), o = v(null), r = v({}), s = v(Ye), i = v(Yt), l = (c, a = null) => ct(
|
|
2568
2570
|
x(
|
|
2569
2571
|
r,
|
|
2570
|
-
E((
|
|
2572
|
+
E((p) => p[c]),
|
|
2571
2573
|
Y()
|
|
2572
2574
|
),
|
|
2573
2575
|
a
|
|
@@ -2594,53 +2596,53 @@ const ur = ({ children: t }) => {
|
|
|
2594
2596
|
([t, e]) => ({ ...t, ...e }),
|
|
2595
2597
|
X(jn, hr)
|
|
2596
2598
|
), Ir = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { height: t } }) }), Sr = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { border: 0, height: t, padding: 0 } }) }), xr = { overflowAnchor: "none" }, Cn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
|
|
2597
|
-
const n =
|
|
2598
|
-
const
|
|
2599
|
+
const n = G("listState"), o = G("computeItemKey"), r = G("firstItemIndex"), s = G("isSeeking"), i = G("ScrollSeekPlaceholder") || Ir, l = G("context"), c = G("TableRowComponent"), a = G("fixedHeaderHeight"), p = G("itemContent"), I = (e ? n.topItems : []).reduce((f, C, w) => (w === 0 ? f.push(C.size) : f.push(f[w - 1] + C.size), f), []), h = (e ? n.topItems : n.items).map((f) => {
|
|
2600
|
+
const C = f.originalIndex, w = o(C + r, f.data, l), S = e ? C === 0 ? 0 : I[C - 1] : 0;
|
|
2599
2601
|
return s ? /* @__PURE__ */ $t(
|
|
2600
2602
|
i,
|
|
2601
2603
|
{
|
|
2602
2604
|
...Z(i, l),
|
|
2603
|
-
height:
|
|
2604
|
-
index:
|
|
2605
|
-
key:
|
|
2606
|
-
type:
|
|
2605
|
+
height: f.size,
|
|
2606
|
+
index: f.index,
|
|
2607
|
+
key: w,
|
|
2608
|
+
type: f.type || "item"
|
|
2607
2609
|
}
|
|
2608
2610
|
) : /* @__PURE__ */ $t(
|
|
2609
2611
|
c,
|
|
2610
2612
|
{
|
|
2611
2613
|
...Z(c, l),
|
|
2612
|
-
...Qn(c,
|
|
2613
|
-
"data-index":
|
|
2614
|
-
"data-item-index":
|
|
2615
|
-
"data-known-size":
|
|
2616
|
-
key:
|
|
2617
|
-
style: e ? { overflowAnchor: "none", position: "sticky", top: a +
|
|
2614
|
+
...Qn(c, f.data),
|
|
2615
|
+
"data-index": C,
|
|
2616
|
+
"data-item-index": f.index,
|
|
2617
|
+
"data-known-size": f.size,
|
|
2618
|
+
key: w,
|
|
2619
|
+
style: e ? { overflowAnchor: "none", position: "sticky", top: a + S, zIndex: 2 } : xr
|
|
2618
2620
|
},
|
|
2619
|
-
f
|
|
2621
|
+
p(f.index, f.data, l)
|
|
2620
2622
|
);
|
|
2621
2623
|
});
|
|
2622
|
-
return /* @__PURE__ */ z(so, { children:
|
|
2624
|
+
return /* @__PURE__ */ z(so, { children: h });
|
|
2623
2625
|
}), Tr = /* @__PURE__ */ H.memo(function() {
|
|
2624
|
-
const e =
|
|
2626
|
+
const e = G("listState"), n = G("topItemsIndexes").length > 0, o = Tt("sizeRanges"), r = G("useWindowScroll"), s = G("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, a = G("trackItemSizes"), p = G("itemSize"), I = G("log"), { callbackRef: h, ref: f } = kn(
|
|
2625
2627
|
o,
|
|
2626
|
-
|
|
2628
|
+
p,
|
|
2627
2629
|
a,
|
|
2628
2630
|
c,
|
|
2629
|
-
|
|
2631
|
+
I,
|
|
2630
2632
|
void 0,
|
|
2631
2633
|
s,
|
|
2632
2634
|
!1,
|
|
2633
|
-
|
|
2634
|
-
), [
|
|
2635
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2636
|
+
), [C, w] = H.useState(0);
|
|
2635
2637
|
Qe("deviation", (V) => {
|
|
2636
|
-
|
|
2638
|
+
C !== V && (f.current.style.marginTop = `${V}px`, w(V));
|
|
2637
2639
|
});
|
|
2638
|
-
const
|
|
2639
|
-
if (R === 0 &&
|
|
2640
|
-
return /* @__PURE__ */ z(
|
|
2641
|
-
const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0), b = e.offsetTop + T +
|
|
2642
|
-
return /* @__PURE__ */ Kt(u, { "data-testid": "virtuoso-item-list", ref:
|
|
2643
|
-
|
|
2640
|
+
const S = G("EmptyPlaceholder"), m = G("FillerRow") || Sr, u = G("TableBodyComponent"), T = G("paddingTopAddition"), R = G("statefulTotalCount"), g = G("context");
|
|
2641
|
+
if (R === 0 && S)
|
|
2642
|
+
return /* @__PURE__ */ z(S, { ...Z(S, g) });
|
|
2643
|
+
const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0), b = e.offsetTop + T + C - d, k = e.offsetBottom, F = b > 0 ? /* @__PURE__ */ z(m, { context: g, height: b }, "padding-top") : null, L = k > 0 ? /* @__PURE__ */ z(m, { context: g, height: k }, "padding-bottom") : null;
|
|
2644
|
+
return /* @__PURE__ */ Kt(u, { "data-testid": "virtuoso-item-list", ref: h, ...Z(u, g), children: [
|
|
2645
|
+
F,
|
|
2644
2646
|
n && /* @__PURE__ */ z(Cn, { showTopList: !0 }),
|
|
2645
2647
|
/* @__PURE__ */ z(Cn, {}),
|
|
2646
2648
|
L
|
|
@@ -2649,57 +2651,57 @@ const ur = ({ children: t }) => {
|
|
|
2649
2651
|
const e = H.useContext(be), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = Ht(
|
|
2650
2652
|
H.useMemo(() => ne(n, (s) => wt(s, "height")), [n]),
|
|
2651
2653
|
!0,
|
|
2652
|
-
|
|
2654
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2653
2655
|
);
|
|
2654
2656
|
return H.useEffect(() => {
|
|
2655
2657
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2656
2658
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: r, style: Zt(!1), children: t });
|
|
2657
2659
|
}, wr = ({ children: t }) => {
|
|
2658
|
-
const e = H.useContext(be), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r =
|
|
2660
|
+
const e = H.useContext(be), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = G("customScrollParent"), s = _e(
|
|
2659
2661
|
n,
|
|
2660
2662
|
r,
|
|
2661
|
-
|
|
2663
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2662
2664
|
);
|
|
2663
2665
|
return H.useEffect(() => {
|
|
2664
2666
|
e && (o(e.itemHeight), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2665
2667
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "window", ref: s, style: Zt(!1), children: t });
|
|
2666
2668
|
}, vr = /* @__PURE__ */ H.memo(function(e) {
|
|
2667
|
-
const n =
|
|
2669
|
+
const n = G("useWindowScroll"), o = G("customScrollParent"), r = Tt("fixedHeaderHeight"), s = Tt("fixedFooterHeight"), i = G("fixedHeaderContent"), l = G("fixedFooterContent"), c = G("context"), a = Ht(
|
|
2668
2670
|
H.useMemo(() => ne(r, (u) => wt(u, "height")), [r]),
|
|
2669
2671
|
!0,
|
|
2670
|
-
|
|
2671
|
-
),
|
|
2672
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2673
|
+
), p = Ht(
|
|
2672
2674
|
H.useMemo(() => ne(s, (u) => wt(u, "height")), [s]),
|
|
2673
2675
|
!0,
|
|
2674
|
-
|
|
2675
|
-
),
|
|
2676
|
-
|
|
2676
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2677
|
+
), I = o || n ? br : Rr, h = o || n ? wr : Cr, f = G("TableComponent"), C = G("TableHeadComponent"), w = G("TableFooterComponent"), S = i ? /* @__PURE__ */ z(
|
|
2678
|
+
C,
|
|
2677
2679
|
{
|
|
2678
2680
|
ref: a,
|
|
2679
2681
|
style: { position: "sticky", top: 0, zIndex: 2 },
|
|
2680
|
-
...Z(
|
|
2682
|
+
...Z(C, c),
|
|
2681
2683
|
children: i()
|
|
2682
2684
|
},
|
|
2683
2685
|
"TableHead"
|
|
2684
|
-
) : null,
|
|
2685
|
-
|
|
2686
|
+
) : null, m = l ? /* @__PURE__ */ z(
|
|
2687
|
+
w,
|
|
2686
2688
|
{
|
|
2687
|
-
ref:
|
|
2689
|
+
ref: p,
|
|
2688
2690
|
style: { bottom: 0, position: "sticky", zIndex: 1 },
|
|
2689
|
-
...Z(
|
|
2691
|
+
...Z(w, c),
|
|
2690
2692
|
children: l()
|
|
2691
2693
|
},
|
|
2692
2694
|
"TableFoot"
|
|
2693
2695
|
) : null;
|
|
2694
|
-
return /* @__PURE__ */ z(
|
|
2695
|
-
|
|
2696
|
+
return /* @__PURE__ */ z(I, { ...e, ...Z(I, c), children: /* @__PURE__ */ z(h, { children: /* @__PURE__ */ Kt(f, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...Z(f, c), children: [
|
|
2697
|
+
S,
|
|
2696
2698
|
/* @__PURE__ */ z(Tr, {}, "TableBody"),
|
|
2697
|
-
|
|
2699
|
+
m
|
|
2698
2700
|
] }) }) });
|
|
2699
2701
|
}), {
|
|
2700
2702
|
Component: yr,
|
|
2701
2703
|
useEmitter: Qe,
|
|
2702
|
-
useEmitterValue:
|
|
2704
|
+
useEmitterValue: G,
|
|
2703
2705
|
usePublisher: Tt
|
|
2704
2706
|
} = /* @__PURE__ */ qe(
|
|
2705
2707
|
gr,
|
|
@@ -2756,7 +2758,7 @@ const ur = ({ children: t }) => {
|
|
|
2756
2758
|
}
|
|
2757
2759
|
},
|
|
2758
2760
|
vr
|
|
2759
|
-
), Rr = /* @__PURE__ */ Ze({ useEmitter: Qe, useEmitterValue:
|
|
2761
|
+
), Rr = /* @__PURE__ */ Ze({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), br = /* @__PURE__ */ Xe({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), qr = yr, wn = {
|
|
2760
2762
|
bottom: 0,
|
|
2761
2763
|
itemHeight: 0,
|
|
2762
2764
|
items: [],
|
|
@@ -2772,7 +2774,7 @@ const ur = ({ children: t }) => {
|
|
|
2772
2774
|
offsetBottom: 0,
|
|
2773
2775
|
offsetTop: 0,
|
|
2774
2776
|
top: 0
|
|
2775
|
-
}, { ceil: vn, floor: Ce, max: ee, min:
|
|
2777
|
+
}, { ceil: vn, floor: Ce, max: ee, min: Oe, round: yn } = Math;
|
|
2776
2778
|
function Rn(t, e, n) {
|
|
2777
2779
|
return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
|
|
2778
2780
|
}
|
|
@@ -2791,18 +2793,18 @@ function Br(t, e) {
|
|
|
2791
2793
|
const kr = /* @__PURE__ */ U(
|
|
2792
2794
|
([
|
|
2793
2795
|
{ increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
|
|
2794
|
-
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: a, smoothScrollTargetReached:
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
{ didMount:
|
|
2798
|
-
{ customScrollParent:
|
|
2799
|
-
|
|
2796
|
+
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: a, smoothScrollTargetReached: p, viewportHeight: I },
|
|
2797
|
+
h,
|
|
2798
|
+
f,
|
|
2799
|
+
{ didMount: C, propsReady: w },
|
|
2800
|
+
{ customScrollParent: S, useWindowScroll: m, windowScrollContainerState: u, windowScrollTo: T, windowViewportRect: R },
|
|
2801
|
+
g
|
|
2800
2802
|
]) => {
|
|
2801
|
-
const d = v(0), b = v(0), k = v(wn),
|
|
2803
|
+
const d = v(0), b = v(0), k = v(wn), F = v({ height: 0, width: 0 }), L = v({ height: 0, width: 0 }), V = $(), D = $(), J = v(0), nt = v(null), B = v({ column: 0, row: 0 }), q = $(), it = $(), dt = v(!1), St = v(0), ft = v(!0), ut = v(!1), At = v(!1);
|
|
2802
2804
|
K(
|
|
2803
2805
|
x(
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
+
C,
|
|
2807
|
+
_(St),
|
|
2806
2808
|
P(([y, N]) => !!N)
|
|
2807
2809
|
),
|
|
2808
2810
|
() => {
|
|
@@ -2810,8 +2812,8 @@ const kr = /* @__PURE__ */ U(
|
|
|
2810
2812
|
}
|
|
2811
2813
|
), K(
|
|
2812
2814
|
x(
|
|
2813
|
-
rt(
|
|
2814
|
-
P(([y, N, Q,
|
|
2815
|
+
rt(C, ft, L, F, St, ut),
|
|
2816
|
+
P(([y, N, Q, lt, , tt]) => y && !N && Q.height !== 0 && lt.height !== 0 && !tt)
|
|
2815
2817
|
),
|
|
2816
2818
|
([, , , , y]) => {
|
|
2817
2819
|
W(ut, !0), $e(1, () => {
|
|
@@ -2820,54 +2822,54 @@ const kr = /* @__PURE__ */ U(
|
|
|
2820
2822
|
W(e, [0, 0]), W(ft, !0);
|
|
2821
2823
|
});
|
|
2822
2824
|
}
|
|
2823
|
-
),
|
|
2825
|
+
), O(
|
|
2824
2826
|
x(
|
|
2825
|
-
|
|
2827
|
+
it,
|
|
2826
2828
|
P((y) => y != null && y.scrollTop > 0),
|
|
2827
2829
|
yt(0)
|
|
2828
2830
|
),
|
|
2829
2831
|
b
|
|
2830
2832
|
), K(
|
|
2831
2833
|
x(
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
+
C,
|
|
2835
|
+
_(it),
|
|
2834
2836
|
P(([, y]) => y != null)
|
|
2835
2837
|
),
|
|
2836
2838
|
([, y]) => {
|
|
2837
|
-
y && (W(
|
|
2839
|
+
y && (W(F, y.viewport), W(L, y.item), W(B, y.gap), y.scrollTop > 0 && (W(dt, !0), bt(x(a, jt(1)), (N) => {
|
|
2838
2840
|
W(dt, !1);
|
|
2839
2841
|
}), W(c, { top: y.scrollTop })));
|
|
2840
2842
|
}
|
|
2841
|
-
),
|
|
2843
|
+
), O(
|
|
2842
2844
|
x(
|
|
2843
|
-
|
|
2845
|
+
F,
|
|
2844
2846
|
E(({ height: y }) => y)
|
|
2845
2847
|
),
|
|
2846
|
-
|
|
2847
|
-
),
|
|
2848
|
+
I
|
|
2849
|
+
), O(
|
|
2848
2850
|
x(
|
|
2849
2851
|
rt(
|
|
2850
|
-
A(
|
|
2852
|
+
A(F, he),
|
|
2851
2853
|
A(L, he),
|
|
2852
2854
|
A(B, (y, N) => y && y.column === N.column && y.row === N.row),
|
|
2853
2855
|
A(a)
|
|
2854
2856
|
),
|
|
2855
|
-
E(([y, N, Q,
|
|
2857
|
+
E(([y, N, Q, lt]) => ({
|
|
2856
2858
|
gap: Q,
|
|
2857
2859
|
item: N,
|
|
2858
|
-
scrollTop:
|
|
2860
|
+
scrollTop: lt,
|
|
2859
2861
|
viewport: y
|
|
2860
2862
|
}))
|
|
2861
2863
|
),
|
|
2862
2864
|
q
|
|
2863
|
-
),
|
|
2865
|
+
), O(
|
|
2864
2866
|
x(
|
|
2865
2867
|
rt(
|
|
2866
2868
|
A(d),
|
|
2867
2869
|
o,
|
|
2868
2870
|
A(B, Br),
|
|
2869
2871
|
A(L, he),
|
|
2870
|
-
A(
|
|
2872
|
+
A(F, he),
|
|
2871
2873
|
A(nt),
|
|
2872
2874
|
A(b),
|
|
2873
2875
|
A(dt),
|
|
@@ -2879,44 +2881,44 @@ const kr = /* @__PURE__ */ U(
|
|
|
2879
2881
|
([
|
|
2880
2882
|
y,
|
|
2881
2883
|
[N, Q],
|
|
2882
|
-
|
|
2884
|
+
lt,
|
|
2883
2885
|
tt,
|
|
2884
2886
|
kt,
|
|
2885
2887
|
Jt,
|
|
2886
2888
|
Nt,
|
|
2887
2889
|
,
|
|
2888
2890
|
de,
|
|
2889
|
-
|
|
2891
|
+
Ft
|
|
2890
2892
|
]) => {
|
|
2891
|
-
const { column:
|
|
2893
|
+
const { column: Ot, row: Qt } = lt, { height: fe, width: He } = tt, { width: tn } = kt;
|
|
2892
2894
|
if (Nt === 0 && (y === 0 || tn === 0))
|
|
2893
2895
|
return wn;
|
|
2894
2896
|
if (He === 0) {
|
|
2895
|
-
const sn = Ue(
|
|
2897
|
+
const sn = Ue(Ft, y), ro = sn + Math.max(Nt - 1, 0);
|
|
2896
2898
|
return Er(Rn(sn, ro, Jt));
|
|
2897
2899
|
}
|
|
2898
|
-
const me = eo(tn, He,
|
|
2900
|
+
const me = eo(tn, He, Ot);
|
|
2899
2901
|
let Dt, Wt;
|
|
2900
|
-
de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me * vn((Q + Qt) / (fe + Qt)) - 1, Wt =
|
|
2901
|
-
const en = Rn(Dt, Wt, Jt), { bottom: nn, top: on } = bn(kt,
|
|
2902
|
+
de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me * vn((Q + Qt) / (fe + Qt)) - 1, Wt = Oe(y - 1, ee(Wt, me - 1)), Dt = Oe(Wt, ee(0, Dt))) : (Dt = 0, Wt = -1);
|
|
2903
|
+
const en = Rn(Dt, Wt, Jt), { bottom: nn, top: on } = bn(kt, lt, tt, en), rn = vn(y / me), oo = rn * fe + (rn - 1) * Qt - nn;
|
|
2902
2904
|
return { bottom: nn, itemHeight: fe, items: en, itemWidth: He, offsetBottom: oo, offsetTop: on, top: on };
|
|
2903
2905
|
}
|
|
2904
2906
|
)
|
|
2905
2907
|
),
|
|
2906
2908
|
k
|
|
2907
|
-
),
|
|
2909
|
+
), O(
|
|
2908
2910
|
x(
|
|
2909
2911
|
nt,
|
|
2910
2912
|
P((y) => y !== null),
|
|
2911
2913
|
E((y) => y.length)
|
|
2912
2914
|
),
|
|
2913
2915
|
d
|
|
2914
|
-
),
|
|
2916
|
+
), O(
|
|
2915
2917
|
x(
|
|
2916
|
-
rt(
|
|
2918
|
+
rt(F, L, k, B),
|
|
2917
2919
|
P(([y, N, { items: Q }]) => Q.length > 0 && N.height !== 0 && y.height !== 0),
|
|
2918
|
-
E(([y, N, { items: Q },
|
|
2919
|
-
const { bottom: tt, top: kt } = bn(y,
|
|
2920
|
+
E(([y, N, { items: Q }, lt]) => {
|
|
2921
|
+
const { bottom: tt, top: kt } = bn(y, lt, N, Q);
|
|
2920
2922
|
return [kt, tt];
|
|
2921
2923
|
}),
|
|
2922
2924
|
Y(se)
|
|
@@ -2924,19 +2926,19 @@ const kr = /* @__PURE__ */ U(
|
|
|
2924
2926
|
e
|
|
2925
2927
|
);
|
|
2926
2928
|
const xt = v(!1);
|
|
2927
|
-
|
|
2929
|
+
O(
|
|
2928
2930
|
x(
|
|
2929
2931
|
a,
|
|
2930
|
-
|
|
2932
|
+
_(xt),
|
|
2931
2933
|
E(([y, N]) => N || y !== 0)
|
|
2932
2934
|
),
|
|
2933
2935
|
xt
|
|
2934
2936
|
);
|
|
2935
|
-
const Xt =
|
|
2937
|
+
const Xt = ht(
|
|
2936
2938
|
x(
|
|
2937
2939
|
rt(k, d),
|
|
2938
2940
|
P(([{ items: y }]) => y.length > 0),
|
|
2939
|
-
|
|
2941
|
+
_(xt),
|
|
2940
2942
|
P(([[y, N], Q]) => {
|
|
2941
2943
|
const tt = y.items[y.items.length - 1].index === N - 1;
|
|
2942
2944
|
return (Q || y.bottom > 0 && y.itemHeight > 0 && y.offsetBottom === 0 && y.items.length === N) && tt;
|
|
@@ -2944,17 +2946,17 @@ const kr = /* @__PURE__ */ U(
|
|
|
2944
2946
|
E(([[, y]]) => y - 1),
|
|
2945
2947
|
Y()
|
|
2946
2948
|
)
|
|
2947
|
-
), Mt =
|
|
2949
|
+
), Mt = ht(
|
|
2948
2950
|
x(
|
|
2949
2951
|
A(k),
|
|
2950
2952
|
P(({ items: y }) => y.length > 0 && y[0].index === 0),
|
|
2951
2953
|
yt(0),
|
|
2952
2954
|
Y()
|
|
2953
2955
|
)
|
|
2954
|
-
), vt =
|
|
2956
|
+
), vt = ht(
|
|
2955
2957
|
x(
|
|
2956
2958
|
A(k),
|
|
2957
|
-
|
|
2959
|
+
_(dt),
|
|
2958
2960
|
P(([{ items: y }, N]) => y.length > 0 && !N),
|
|
2959
2961
|
E(([{ items: y }]) => ({
|
|
2960
2962
|
endIndex: y[y.length - 1].index,
|
|
@@ -2964,16 +2966,16 @@ const kr = /* @__PURE__ */ U(
|
|
|
2964
2966
|
Lt(0)
|
|
2965
2967
|
)
|
|
2966
2968
|
);
|
|
2967
|
-
|
|
2969
|
+
O(vt, f.scrollSeekRangeChanged), O(
|
|
2968
2970
|
x(
|
|
2969
2971
|
V,
|
|
2970
|
-
|
|
2971
|
-
E(([y, N, Q,
|
|
2972
|
-
const kt =
|
|
2973
|
-
let
|
|
2974
|
-
|
|
2975
|
-
let
|
|
2976
|
-
return Jt === "end" ?
|
|
2972
|
+
_(F, L, d, B),
|
|
2973
|
+
E(([y, N, Q, lt, tt]) => {
|
|
2974
|
+
const kt = _n(y), { align: Jt, behavior: Nt, offset: de } = kt;
|
|
2975
|
+
let Ft = kt.index;
|
|
2976
|
+
Ft === "LAST" && (Ft = lt - 1), Ft = ee(0, Ft, Oe(lt - 1, Ft));
|
|
2977
|
+
let Ot = Ae(N, tt, Q, Ft);
|
|
2978
|
+
return Jt === "end" ? Ot = yn(Ot - N.height + Q.height) : Jt === "center" && (Ot = yn(Ot - N.height / 2 + Q.height / 2)), de && (Ot += de), { behavior: Nt, top: Ot };
|
|
2977
2979
|
})
|
|
2978
2980
|
),
|
|
2979
2981
|
c
|
|
@@ -2985,14 +2987,14 @@ const kr = /* @__PURE__ */ U(
|
|
|
2985
2987
|
),
|
|
2986
2988
|
0
|
|
2987
2989
|
);
|
|
2988
|
-
return
|
|
2990
|
+
return O(
|
|
2989
2991
|
x(
|
|
2990
2992
|
R,
|
|
2991
2993
|
E((y) => ({ height: y.visibleHeight, width: y.visibleWidth }))
|
|
2992
2994
|
),
|
|
2993
|
-
|
|
2995
|
+
F
|
|
2994
2996
|
), {
|
|
2995
|
-
customScrollParent:
|
|
2997
|
+
customScrollParent: S,
|
|
2996
2998
|
// input
|
|
2997
2999
|
data: nt,
|
|
2998
3000
|
deviation: J,
|
|
@@ -3003,34 +3005,34 @@ const kr = /* @__PURE__ */ U(
|
|
|
3003
3005
|
initialItemCount: b,
|
|
3004
3006
|
itemDimensions: L,
|
|
3005
3007
|
overscan: n,
|
|
3006
|
-
restoreStateFrom:
|
|
3008
|
+
restoreStateFrom: it,
|
|
3007
3009
|
scrollBy: i,
|
|
3008
3010
|
scrollContainerState: l,
|
|
3009
3011
|
scrollHeight: D,
|
|
3010
3012
|
scrollTo: c,
|
|
3011
3013
|
scrollToIndex: V,
|
|
3012
3014
|
scrollTop: a,
|
|
3013
|
-
smoothScrollTargetReached:
|
|
3015
|
+
smoothScrollTargetReached: p,
|
|
3014
3016
|
totalCount: d,
|
|
3015
|
-
useWindowScroll:
|
|
3016
|
-
viewportDimensions:
|
|
3017
|
+
useWindowScroll: m,
|
|
3018
|
+
viewportDimensions: F,
|
|
3017
3019
|
windowScrollContainerState: u,
|
|
3018
3020
|
windowScrollTo: T,
|
|
3019
3021
|
windowViewportRect: R,
|
|
3020
|
-
...
|
|
3022
|
+
...f,
|
|
3021
3023
|
// output
|
|
3022
3024
|
gridState: k,
|
|
3023
3025
|
horizontalDirection: At,
|
|
3024
3026
|
initialTopMostItemIndex: St,
|
|
3025
3027
|
totalListHeight: Bt,
|
|
3026
|
-
...
|
|
3028
|
+
...h,
|
|
3027
3029
|
endReached: Xt,
|
|
3028
|
-
propsReady:
|
|
3030
|
+
propsReady: w,
|
|
3029
3031
|
rangeChanged: vt,
|
|
3030
3032
|
startReached: Mt,
|
|
3031
3033
|
stateChanged: q,
|
|
3032
3034
|
stateRestoreInProgress: dt,
|
|
3033
|
-
...
|
|
3035
|
+
...g
|
|
3034
3036
|
};
|
|
3035
3037
|
},
|
|
3036
3038
|
X(Ke, at, ae, Un, Pt, je, Vt)
|
|
@@ -3049,16 +3051,16 @@ function Ae(t, e, n, o) {
|
|
|
3049
3051
|
const r = eo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + ee(0, s - 1) * e.row;
|
|
3050
3052
|
return i > 0 ? i + e.row : i;
|
|
3051
3053
|
}
|
|
3052
|
-
const
|
|
3053
|
-
const t = v((
|
|
3054
|
+
const Fr = /* @__PURE__ */ U(() => {
|
|
3055
|
+
const t = v((I) => `Item ${I}`), e = v({}), n = v(null), o = v("virtuoso-grid-item"), r = v("virtuoso-grid-list"), s = v(Ye), i = v("div"), l = v(Yt), c = (I, h = null) => ct(
|
|
3054
3056
|
x(
|
|
3055
3057
|
e,
|
|
3056
|
-
E((
|
|
3058
|
+
E((f) => f[I]),
|
|
3057
3059
|
Y()
|
|
3058
3060
|
),
|
|
3059
|
-
|
|
3060
|
-
), a = v(!1),
|
|
3061
|
-
return
|
|
3061
|
+
h
|
|
3062
|
+
), a = v(!1), p = v(!1);
|
|
3063
|
+
return O(A(p), a), {
|
|
3062
3064
|
components: e,
|
|
3063
3065
|
computeItemKey: s,
|
|
3064
3066
|
context: n,
|
|
@@ -3071,51 +3073,51 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3071
3073
|
listClassName: r,
|
|
3072
3074
|
ListComponent: c("List", "div"),
|
|
3073
3075
|
readyStateChanged: a,
|
|
3074
|
-
reportReadyState:
|
|
3076
|
+
reportReadyState: p,
|
|
3075
3077
|
ScrollerComponent: c("Scroller", "div"),
|
|
3076
3078
|
scrollerRef: l,
|
|
3077
3079
|
ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
|
|
3078
3080
|
};
|
|
3079
|
-
}),
|
|
3081
|
+
}), Or = /* @__PURE__ */ U(
|
|
3080
3082
|
([t, e]) => ({ ...t, ...e }),
|
|
3081
|
-
X(kr,
|
|
3083
|
+
X(kr, Fr)
|
|
3082
3084
|
), Lr = /* @__PURE__ */ H.memo(function() {
|
|
3083
|
-
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"), a = et("ListComponent"),
|
|
3085
|
+
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"), a = et("ListComponent"), p = et("ScrollSeekPlaceholder"), I = et("context"), h = It("itemDimensions"), f = It("gap"), C = et("log"), w = et("stateRestoreInProgress"), S = It("reportReadyState"), m = Ht(
|
|
3084
3086
|
H.useMemo(
|
|
3085
3087
|
() => (u) => {
|
|
3086
3088
|
const T = u.parentElement.parentElement.scrollHeight;
|
|
3087
3089
|
l(T);
|
|
3088
3090
|
const R = u.firstChild;
|
|
3089
3091
|
if (R) {
|
|
3090
|
-
const { height:
|
|
3091
|
-
|
|
3092
|
+
const { height: g, width: d } = R.getBoundingClientRect();
|
|
3093
|
+
h({ height: g, width: d });
|
|
3092
3094
|
}
|
|
3093
|
-
|
|
3094
|
-
column: Hn("column-gap", getComputedStyle(u).columnGap,
|
|
3095
|
-
row: Hn("row-gap", getComputedStyle(u).rowGap,
|
|
3095
|
+
f({
|
|
3096
|
+
column: Hn("column-gap", getComputedStyle(u).columnGap, C),
|
|
3097
|
+
row: Hn("row-gap", getComputedStyle(u).rowGap, C)
|
|
3096
3098
|
});
|
|
3097
3099
|
},
|
|
3098
|
-
[l,
|
|
3100
|
+
[l, h, f, C]
|
|
3099
3101
|
),
|
|
3100
3102
|
!0,
|
|
3101
3103
|
!1
|
|
3102
3104
|
);
|
|
3103
3105
|
return Yn(() => {
|
|
3104
|
-
e.itemHeight > 0 && e.itemWidth > 0 &&
|
|
3105
|
-
}, [e]),
|
|
3106
|
+
e.itemHeight > 0 && e.itemWidth > 0 && S(!0);
|
|
3107
|
+
}, [e]), w ? null : /* @__PURE__ */ z(
|
|
3106
3108
|
a,
|
|
3107
3109
|
{
|
|
3108
3110
|
className: n,
|
|
3109
|
-
ref:
|
|
3110
|
-
...Z(a,
|
|
3111
|
+
ref: m,
|
|
3112
|
+
...Z(a, I),
|
|
3111
3113
|
"data-testid": "virtuoso-item-list",
|
|
3112
3114
|
style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
|
|
3113
3115
|
children: e.items.map((u) => {
|
|
3114
|
-
const T = s(u.index, u.data,
|
|
3116
|
+
const T = s(u.index, u.data, I);
|
|
3115
3117
|
return i ? /* @__PURE__ */ z(
|
|
3116
|
-
|
|
3118
|
+
p,
|
|
3117
3119
|
{
|
|
3118
|
-
...Z(
|
|
3120
|
+
...Z(p, I),
|
|
3119
3121
|
height: e.itemHeight,
|
|
3120
3122
|
index: u.index,
|
|
3121
3123
|
width: e.itemWidth
|
|
@@ -3124,12 +3126,12 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3124
3126
|
) : /* @__PURE__ */ $t(
|
|
3125
3127
|
c,
|
|
3126
3128
|
{
|
|
3127
|
-
...Z(c,
|
|
3129
|
+
...Z(c, I),
|
|
3128
3130
|
className: o,
|
|
3129
3131
|
"data-index": u.index,
|
|
3130
3132
|
key: T
|
|
3131
3133
|
},
|
|
3132
|
-
r(u.index, u.data,
|
|
3134
|
+
r(u.index, u.data, I)
|
|
3133
3135
|
);
|
|
3134
3136
|
})
|
|
3135
3137
|
}
|
|
@@ -3173,12 +3175,12 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3173
3175
|
e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
|
|
3174
3176
|
}, [e, o, n]), /* @__PURE__ */ z("div", { ref: r, style: Zt(!1), children: t });
|
|
3175
3177
|
}, Ar = ({ children: t }) => {
|
|
3176
|
-
const e = H.useContext(qn), n = It("windowViewportRect"), o = It("itemDimensions"), r = et("customScrollParent"), s =
|
|
3178
|
+
const e = H.useContext(qn), n = It("windowViewportRect"), o = It("itemDimensions"), r = et("customScrollParent"), s = _e(n, r, !1);
|
|
3177
3179
|
return H.useEffect(() => {
|
|
3178
3180
|
e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
|
|
3179
3181
|
}, [e, n, o]), /* @__PURE__ */ z("div", { ref: s, style: Zt(!1), children: t });
|
|
3180
3182
|
}, Mr = /* @__PURE__ */ H.memo(function({ ...e }) {
|
|
3181
|
-
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ?
|
|
3183
|
+
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? _r : Gr, s = o || n ? Ar : Pr, i = et("context");
|
|
3182
3184
|
return /* @__PURE__ */ z(r, { ...e, ...Z(r, i), children: /* @__PURE__ */ Kt(s, { children: [
|
|
3183
3185
|
/* @__PURE__ */ z(zr, {}),
|
|
3184
3186
|
/* @__PURE__ */ z(Lr, {}),
|
|
@@ -3190,7 +3192,7 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3190
3192
|
useEmitterValue: et,
|
|
3191
3193
|
usePublisher: It
|
|
3192
3194
|
} = /* @__PURE__ */ qe(
|
|
3193
|
-
|
|
3195
|
+
Or,
|
|
3194
3196
|
{
|
|
3195
3197
|
optional: {
|
|
3196
3198
|
context: "context",
|
|
@@ -3230,14 +3232,14 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3230
3232
|
}
|
|
3231
3233
|
},
|
|
3232
3234
|
Mr
|
|
3233
|
-
),
|
|
3235
|
+
), Gr = /* @__PURE__ */ Ze({ useEmitter: no, useEmitterValue: et, usePublisher: It }), _r = /* @__PURE__ */ Xe({ useEmitter: no, useEmitterValue: et, usePublisher: It });
|
|
3234
3236
|
function Hn(t, e, n) {
|
|
3235
|
-
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e,
|
|
3237
|
+
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
|
|
3236
3238
|
}
|
|
3237
3239
|
const Yr = Wr;
|
|
3238
3240
|
export {
|
|
3239
3241
|
jr as GroupedVirtuoso,
|
|
3240
|
-
|
|
3242
|
+
mt as LogLevel,
|
|
3241
3243
|
qr as TableVirtuoso,
|
|
3242
3244
|
Kr as Virtuoso,
|
|
3243
3245
|
Yr as VirtuosoGrid,
|