react-virtuoso 4.18.18 → 4.18.20
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 +804 -792
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as G, jsxs as Kt } from "react/jsx-runtime";
|
|
2
2
|
import E, { createElement as Ut } from "react";
|
|
3
3
|
import Io from "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const be = 0, Pt = 1, Qt = 2, Mn = 4;
|
|
5
5
|
function mn(t) {
|
|
6
6
|
return () => t;
|
|
7
7
|
}
|
|
@@ -27,7 +27,7 @@ function vo(...t) {
|
|
|
27
27
|
}
|
|
28
28
|
function te() {
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function Re(t, e) {
|
|
31
31
|
return e(t), t;
|
|
32
32
|
}
|
|
33
33
|
function To(t, e) {
|
|
@@ -37,22 +37,22 @@ function st(...t) {
|
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
39
|
function X(t, e) {
|
|
40
|
-
return t(
|
|
40
|
+
return t(Pt, e);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
t(
|
|
42
|
+
function N(t, e) {
|
|
43
|
+
t(be, e);
|
|
44
44
|
}
|
|
45
45
|
function De(t) {
|
|
46
46
|
t(Qt);
|
|
47
47
|
}
|
|
48
48
|
function tt(t) {
|
|
49
|
-
return t(
|
|
49
|
+
return t(Mn);
|
|
50
50
|
}
|
|
51
51
|
function z(t, e) {
|
|
52
|
-
return X(t, xo(e,
|
|
52
|
+
return X(t, xo(e, be));
|
|
53
53
|
}
|
|
54
54
|
function Et(t, e) {
|
|
55
|
-
const n = t(
|
|
55
|
+
const n = t(Pt, (o) => {
|
|
56
56
|
n(), e(o);
|
|
57
57
|
});
|
|
58
58
|
return n;
|
|
@@ -65,10 +65,10 @@ function hn(t) {
|
|
|
65
65
|
}, t);
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Pn(t, e) {
|
|
69
69
|
return t === e;
|
|
70
70
|
}
|
|
71
|
-
function ot(t =
|
|
71
|
+
function ot(t = Pn) {
|
|
72
72
|
let e;
|
|
73
73
|
return (n) => (o) => {
|
|
74
74
|
t(e, o) || (e = o, n(o));
|
|
@@ -79,7 +79,7 @@ function V(t) {
|
|
|
79
79
|
t(n) && e(n);
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function B(t) {
|
|
83
83
|
return (e) => re(e, t);
|
|
84
84
|
}
|
|
85
85
|
function Ct(t) {
|
|
@@ -87,14 +87,14 @@ function Ct(t) {
|
|
|
87
87
|
e(t);
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function v(t, ...e) {
|
|
91
91
|
const n = Co(...e);
|
|
92
92
|
return ((o, r) => {
|
|
93
93
|
switch (o) {
|
|
94
94
|
case Qt:
|
|
95
95
|
De(t);
|
|
96
96
|
return;
|
|
97
|
-
case
|
|
97
|
+
case Pt:
|
|
98
98
|
return X(t, n(r));
|
|
99
99
|
}
|
|
100
100
|
});
|
|
@@ -142,7 +142,7 @@ function wo(t) {
|
|
|
142
142
|
const o = () => e?.();
|
|
143
143
|
return function(r, s) {
|
|
144
144
|
switch (r) {
|
|
145
|
-
case
|
|
145
|
+
case Pt:
|
|
146
146
|
return s ? n === s ? void 0 : (o(), n = s, e = X(t, s), e) : (o(), te);
|
|
147
147
|
case Qt:
|
|
148
148
|
o(), n = null;
|
|
@@ -155,27 +155,27 @@ function y(t) {
|
|
|
155
155
|
const n = U();
|
|
156
156
|
return ((o, r) => {
|
|
157
157
|
switch (o) {
|
|
158
|
-
case
|
|
158
|
+
case be:
|
|
159
159
|
e = r;
|
|
160
160
|
break;
|
|
161
|
-
case
|
|
161
|
+
case Pt: {
|
|
162
162
|
r(e);
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
|
-
case
|
|
165
|
+
case Mn:
|
|
166
166
|
return e;
|
|
167
167
|
}
|
|
168
168
|
return n(o, r);
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
function gt(t, e) {
|
|
172
|
-
return
|
|
172
|
+
return Re(y(e), (n) => z(t, n));
|
|
173
173
|
}
|
|
174
174
|
function U() {
|
|
175
175
|
const t = [];
|
|
176
176
|
return ((e, n) => {
|
|
177
177
|
switch (e) {
|
|
178
|
-
case
|
|
178
|
+
case be:
|
|
179
179
|
t.slice().forEach((o) => {
|
|
180
180
|
o(n);
|
|
181
181
|
});
|
|
@@ -183,7 +183,7 @@ function U() {
|
|
|
183
183
|
case Qt:
|
|
184
184
|
t.splice(0);
|
|
185
185
|
return;
|
|
186
|
-
case
|
|
186
|
+
case Pt:
|
|
187
187
|
return t.push(n), () => {
|
|
188
188
|
const o = t.indexOf(n);
|
|
189
189
|
o > -1 && t.splice(o, 1);
|
|
@@ -192,7 +192,7 @@ function U() {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
function yt(t) {
|
|
195
|
-
return
|
|
195
|
+
return Re(U(), (e) => z(t, e));
|
|
196
196
|
}
|
|
197
197
|
const yo = { singleton: !0 };
|
|
198
198
|
function Y(t, e = [], n = yo) {
|
|
@@ -221,7 +221,7 @@ function mt(...t) {
|
|
|
221
221
|
return t.forEach((s, i) => {
|
|
222
222
|
const l = 2 ** i;
|
|
223
223
|
X(s, (u) => {
|
|
224
|
-
n[i] = u, o |= l, o === r &&
|
|
224
|
+
n[i] = u, o |= l, o === r && N(e, n);
|
|
225
225
|
});
|
|
226
226
|
}), function(s, i) {
|
|
227
227
|
switch (s) {
|
|
@@ -229,20 +229,20 @@ function mt(...t) {
|
|
|
229
229
|
De(e);
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
case
|
|
232
|
+
case Pt:
|
|
233
233
|
return o === r && i(n), X(e, i);
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
237
|
+
function M(t, e = Pn) {
|
|
238
|
+
return v(t, ot(e));
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Ce(...t) {
|
|
241
241
|
return function(e, n) {
|
|
242
242
|
switch (e) {
|
|
243
243
|
case Qt:
|
|
244
244
|
return;
|
|
245
|
-
case
|
|
245
|
+
case Pt:
|
|
246
246
|
return vo(...t.map((o) => X(o, n)));
|
|
247
247
|
}
|
|
248
248
|
};
|
|
@@ -261,7 +261,7 @@ const ht = {
|
|
|
261
261
|
[ht.ERROR]: "error",
|
|
262
262
|
[ht.INFO]: "log",
|
|
263
263
|
[ht.WARN]: "warn"
|
|
264
|
-
}, Eo = () => typeof globalThis > "u" ? window : globalThis,
|
|
264
|
+
}, Eo = () => typeof globalThis > "u" ? window : globalThis, Gt = Y(
|
|
265
265
|
() => {
|
|
266
266
|
const t = y(ht.ERROR);
|
|
267
267
|
return {
|
|
@@ -284,17 +284,17 @@ const ht = {
|
|
|
284
284
|
function ko(t) {
|
|
285
285
|
return "self" in t ? t.document.documentElement : t;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function Gn(t) {
|
|
288
288
|
const e = ko(t);
|
|
289
289
|
return e.ownerDocument.defaultView.getComputedStyle(e).direction === "rtl";
|
|
290
290
|
}
|
|
291
291
|
function Nt(t, e) {
|
|
292
|
-
return
|
|
292
|
+
return Gn(t) ? -e : e;
|
|
293
293
|
}
|
|
294
294
|
function gn(t, e) {
|
|
295
|
-
return
|
|
295
|
+
return Gn(t) ? -e : e;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Ot(t, e, n) {
|
|
298
298
|
return $e(t, e, n).callbackRef;
|
|
299
299
|
}
|
|
300
300
|
function $e(t, e, n) {
|
|
@@ -315,21 +315,21 @@ function $e(t, e, n) {
|
|
|
315
315
|
function An(t, e, n, o, r, s, i, l, u) {
|
|
316
316
|
const d = E.useCallback(
|
|
317
317
|
(f) => {
|
|
318
|
-
const
|
|
318
|
+
const S = Bo(f.children, e, l ? "offsetWidth" : "offsetHeight", r);
|
|
319
319
|
let h = f.parentElement;
|
|
320
320
|
for (; h.dataset.virtuosoScroller === void 0; )
|
|
321
321
|
h = h.parentElement;
|
|
322
322
|
const m = h.lastElementChild?.dataset.viewportType === "window";
|
|
323
|
-
let
|
|
324
|
-
m && (
|
|
325
|
-
const R = i ? l ? i.scrollWidth : i.scrollHeight : m ? l ?
|
|
323
|
+
let T;
|
|
324
|
+
m && (T = h.ownerDocument.defaultView);
|
|
325
|
+
const R = i ? l ? i.scrollWidth : i.scrollHeight : m ? l ? T.document.documentElement.scrollWidth : T.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, g = i ? l ? i.offsetWidth : i.offsetHeight : m ? l ? T.innerWidth : T.innerHeight : l ? h.offsetWidth : h.offsetHeight, x = i ? l ? Nt(i, i.scrollLeft) : i.scrollTop : m ? l ? Nt(T, T.scrollX || T.document.documentElement.scrollLeft) : T.scrollY || T.document.documentElement.scrollTop : l ? Nt(h, h.scrollLeft) : h.scrollTop;
|
|
326
326
|
o({
|
|
327
327
|
scrollHeight: R,
|
|
328
|
-
scrollTop: Math.max(
|
|
328
|
+
scrollTop: Math.max(x, 0),
|
|
329
329
|
viewportHeight: g
|
|
330
330
|
}), s?.(
|
|
331
331
|
l ? In("column-gap", getComputedStyle(f).columnGap, r) : In("row-gap", getComputedStyle(f).rowGap, r)
|
|
332
|
-
),
|
|
332
|
+
), S !== null && t(S);
|
|
333
333
|
},
|
|
334
334
|
[t, e, r, s, i, o, l]
|
|
335
335
|
);
|
|
@@ -347,32 +347,32 @@ function Bo(t, e, n, o) {
|
|
|
347
347
|
const u = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), f = e(l, n);
|
|
348
348
|
if (f === 0 && o("Zero-sized element, this should not happen", { child: l }, ht.ERROR), f === d)
|
|
349
349
|
continue;
|
|
350
|
-
const
|
|
351
|
-
s.length === 0 ||
|
|
350
|
+
const S = s[s.length - 1];
|
|
351
|
+
s.length === 0 || S.size !== f || S.endIndex !== u - 1 ? s.push({ endIndex: u, size: f, startIndex: u }) : s[s.length - 1].endIndex++;
|
|
352
352
|
}
|
|
353
353
|
return s;
|
|
354
354
|
}
|
|
355
355
|
function In(t, e, n) {
|
|
356
356
|
return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ht.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
|
|
357
357
|
}
|
|
358
|
-
const
|
|
358
|
+
const He = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
|
|
359
359
|
function Ue(t, e, n) {
|
|
360
360
|
const o = E.useRef(null), r = E.useCallback(
|
|
361
361
|
(u) => {
|
|
362
362
|
if (!u?.offsetParent)
|
|
363
363
|
return;
|
|
364
364
|
const d = u.getBoundingClientRect(), f = d.width;
|
|
365
|
-
let
|
|
365
|
+
let S, h;
|
|
366
366
|
if (e) {
|
|
367
|
-
const m = e.getBoundingClientRect(),
|
|
368
|
-
h = m.height - Math.max(0,
|
|
367
|
+
const m = e.getBoundingClientRect(), T = d.top - m.top;
|
|
368
|
+
h = m.height - Math.max(0, T), S = T + e.scrollTop;
|
|
369
369
|
} else {
|
|
370
370
|
const m = i.current.ownerDocument.defaultView;
|
|
371
|
-
h = m.innerHeight - Math.max(0, d.top),
|
|
371
|
+
h = m.innerHeight - Math.max(0, d.top), S = d.top + m.scrollY;
|
|
372
372
|
}
|
|
373
373
|
o.current = {
|
|
374
374
|
listHeight: d.height,
|
|
375
|
-
offsetTop:
|
|
375
|
+
offsetTop: S,
|
|
376
376
|
visibleHeight: h,
|
|
377
377
|
visibleWidth: f
|
|
378
378
|
}, t(o.current);
|
|
@@ -400,17 +400,17 @@ function Ue(t, e, n) {
|
|
|
400
400
|
}
|
|
401
401
|
const St = Y(
|
|
402
402
|
() => {
|
|
403
|
-
const t = U(), e = U(), n = y(0), o = U(), r = U(), s = y(0), i = U(), l = U(), u = y(0), d = y(0), f = y(0),
|
|
403
|
+
const t = U(), e = U(), n = y(0), o = U(), r = U(), s = y(0), i = U(), l = U(), u = y(0), d = y(0), f = y(0), S = y(0), h = U(), m = U(), T = y(!1), R = y(!1), g = y(!1);
|
|
404
404
|
return z(
|
|
405
|
-
|
|
405
|
+
v(
|
|
406
406
|
t,
|
|
407
|
-
|
|
407
|
+
B(({ scrollTop: x }) => x)
|
|
408
408
|
),
|
|
409
409
|
e
|
|
410
410
|
), z(
|
|
411
|
-
|
|
411
|
+
v(
|
|
412
412
|
t,
|
|
413
|
-
|
|
413
|
+
B(({ scrollHeight: x }) => x)
|
|
414
414
|
),
|
|
415
415
|
l
|
|
416
416
|
), z(e, s), {
|
|
@@ -418,14 +418,14 @@ const St = Y(
|
|
|
418
418
|
deviationCommitted: o,
|
|
419
419
|
fixedFooterHeight: f,
|
|
420
420
|
fixedHeaderHeight: d,
|
|
421
|
-
footerHeight:
|
|
421
|
+
footerHeight: S,
|
|
422
422
|
headerHeight: u,
|
|
423
423
|
horizontalDirection: R,
|
|
424
424
|
scrollBy: m,
|
|
425
425
|
// input
|
|
426
426
|
scrollContainerState: t,
|
|
427
427
|
scrollHeight: l,
|
|
428
|
-
scrollingInProgress:
|
|
428
|
+
scrollingInProgress: T,
|
|
429
429
|
// signals
|
|
430
430
|
scrollTo: h,
|
|
431
431
|
scrollTop: e,
|
|
@@ -479,7 +479,7 @@ function Xt(t, e, n) {
|
|
|
479
479
|
if (J(t))
|
|
480
480
|
return [];
|
|
481
481
|
const o = kt(t, e)[0];
|
|
482
|
-
return
|
|
482
|
+
return Lo(Me(t, o, n));
|
|
483
483
|
}
|
|
484
484
|
function We(t, e) {
|
|
485
485
|
if (J(t))
|
|
@@ -491,26 +491,26 @@ function We(t, e) {
|
|
|
491
491
|
if (J(r))
|
|
492
492
|
return o;
|
|
493
493
|
const [s, i] = Dn(o);
|
|
494
|
-
return
|
|
494
|
+
return ve(pt(t, { k: s, l: Nn(o), v: i }));
|
|
495
495
|
}
|
|
496
|
-
return e < n ?
|
|
496
|
+
return e < n ? ve(pt(t, { l: We(o, e) })) : ve(pt(t, { r: We(r, e) }));
|
|
497
497
|
}
|
|
498
498
|
function $t(t) {
|
|
499
499
|
return J(t) ? [] : [...$t(t.l), { k: t.k, v: t.v }, ...$t(t.r)];
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function Me(t, e, n) {
|
|
502
502
|
if (J(t))
|
|
503
503
|
return [];
|
|
504
504
|
const { k: o, l: r, r: s, v: i } = t;
|
|
505
505
|
let l = [];
|
|
506
|
-
return o > e && (l = l.concat(
|
|
506
|
+
return o > e && (l = l.concat(Me(r, e, n))), o >= e && o <= n && l.push({ k: o, v: i }), o <= n && (l = l.concat(Me(s, e, n))), l;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function ve(t) {
|
|
509
509
|
const { l: e, lvl: n, r: o } = t;
|
|
510
510
|
if (o.lvl >= n - 1 && e.lvl >= n - 1)
|
|
511
511
|
return t;
|
|
512
512
|
if (n > o.lvl + 1) {
|
|
513
|
-
if (
|
|
513
|
+
if (Le(e))
|
|
514
514
|
return Un(pt(t, { lvl: n - 1 }));
|
|
515
515
|
if (!J(e) && !J(e.r))
|
|
516
516
|
return pt(e.r, {
|
|
@@ -523,17 +523,17 @@ function xe(t) {
|
|
|
523
523
|
});
|
|
524
524
|
throw new Error("Unexpected empty nodes");
|
|
525
525
|
}
|
|
526
|
-
if (
|
|
527
|
-
return
|
|
526
|
+
if (Le(t))
|
|
527
|
+
return Pe(pt(t, { lvl: n - 1 }));
|
|
528
528
|
if (!J(o) && !J(o.l)) {
|
|
529
|
-
const r = o.l, s =
|
|
529
|
+
const r = o.l, s = Le(r) ? o.lvl - 1 : o.lvl;
|
|
530
530
|
return pt(r, {
|
|
531
531
|
l: pt(t, {
|
|
532
532
|
lvl: n - 1,
|
|
533
533
|
r: r.l
|
|
534
534
|
}),
|
|
535
535
|
lvl: r.lvl + 1,
|
|
536
|
-
r:
|
|
536
|
+
r: Pe(pt(o, { l: r.r, lvl: s }))
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
throw new Error("Unexpected empty nodes");
|
|
@@ -548,9 +548,9 @@ function pt(t, e) {
|
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
550
|
function Nn(t) {
|
|
551
|
-
return J(t.r) ? t.l :
|
|
551
|
+
return J(t.r) ? t.l : ve(pt(t, { r: Nn(t.r) }));
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function Le(t) {
|
|
554
554
|
return J(t) || t.lvl > t.r.lvl;
|
|
555
555
|
}
|
|
556
556
|
function Dn(t) {
|
|
@@ -560,17 +560,17 @@ function $n(t, e, n, o = se, r = se) {
|
|
|
560
560
|
return { k: t, l: o, lvl: n, r, v: e };
|
|
561
561
|
}
|
|
562
562
|
function Sn(t) {
|
|
563
|
-
return
|
|
563
|
+
return Pe(Un(t));
|
|
564
564
|
}
|
|
565
565
|
function Un(t) {
|
|
566
566
|
const { l: e } = t;
|
|
567
567
|
return !J(e) && e.lvl === t.lvl ? pt(e, { r: pt(t, { l: e.r }) }) : t;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function Pe(t) {
|
|
570
570
|
const { lvl: e, r: n } = t;
|
|
571
571
|
return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? pt(n, { l: pt(t, { r: n.l }), lvl: e + 1 }) : t;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Lo(t) {
|
|
574
574
|
return _n(t, ({ k: e, v: n }) => ({ index: e, value: n }));
|
|
575
575
|
}
|
|
576
576
|
function Kn(t, e) {
|
|
@@ -585,9 +585,9 @@ const Ke = Y(
|
|
|
585
585
|
{ singleton: !0 }
|
|
586
586
|
);
|
|
587
587
|
function jn(t, e, n) {
|
|
588
|
-
return t[
|
|
588
|
+
return t[we(t, e, n)];
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function we(t, e, n, o = 0) {
|
|
591
591
|
let r = t.length - 1;
|
|
592
592
|
for (; o <= r; ) {
|
|
593
593
|
const s = Math.floor((o + r) / 2), i = t[s], l = n(i, e);
|
|
@@ -605,14 +605,14 @@ function Ce(t, e, n, o = 0) {
|
|
|
605
605
|
}
|
|
606
606
|
throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`);
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
const r =
|
|
608
|
+
function Oo(t, e, n, o) {
|
|
609
|
+
const r = we(t, e, o), s = we(t, n, o, r);
|
|
610
610
|
return t.slice(r, s + 1);
|
|
611
611
|
}
|
|
612
612
|
function Bt(t, e) {
|
|
613
613
|
return Math.round(t.getBoundingClientRect()[e]);
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function Ee(t) {
|
|
616
616
|
return !J(t.groupOffsetTree);
|
|
617
617
|
}
|
|
618
618
|
function je({ index: t }, e) {
|
|
@@ -641,8 +641,8 @@ function zo(t, e) {
|
|
|
641
641
|
if (l.some(Ao(o)))
|
|
642
642
|
continue;
|
|
643
643
|
let u = !1, d = !1;
|
|
644
|
-
for (const { end: f, start:
|
|
645
|
-
u ? (r >=
|
|
644
|
+
for (const { end: f, start: S, value: h } of l)
|
|
645
|
+
u ? (r >= S || s === h) && (t = We(t, S)) : (d = h !== s, u = !0), f > r && r >= S && h !== s && (t = xt(t, r + 1, h));
|
|
646
646
|
d && (t = xt(t, i, s));
|
|
647
647
|
}
|
|
648
648
|
return [t, n];
|
|
@@ -660,7 +660,7 @@ function le(t, e, n) {
|
|
|
660
660
|
return l > 0 ? l + n : l;
|
|
661
661
|
}
|
|
662
662
|
function qn(t, e) {
|
|
663
|
-
if (!
|
|
663
|
+
if (!Ee(e))
|
|
664
664
|
return t;
|
|
665
665
|
let n = 0;
|
|
666
666
|
for (; e.groupIndices[n] <= t + n; )
|
|
@@ -675,31 +675,31 @@ function Yn(t, e, n) {
|
|
|
675
675
|
return r = Math.max(0, Math.min(n, r)), r;
|
|
676
676
|
}
|
|
677
677
|
function Wo(t, e, n, o = 0) {
|
|
678
|
-
return o > 0 && (e = Math.max(e, jn(t, o, je).offset)), _n(
|
|
678
|
+
return o > 0 && (e = Math.max(e, jn(t, o, je).offset)), _n(Oo(t, e, n, Vo), Go);
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function Mo(t, [e, n, o, r]) {
|
|
681
681
|
e.length > 0 && o("received item sizes", e, ht.DEBUG);
|
|
682
682
|
const s = t.sizeTree;
|
|
683
683
|
let i = s, l = 0;
|
|
684
684
|
if (n.length > 0 && J(s) && e.length === 2) {
|
|
685
685
|
const h = e[0].size, m = e[1].size;
|
|
686
|
-
i = n.reduce((
|
|
686
|
+
i = n.reduce((T, R) => xt(xt(T, R, h), R + 1, m), i);
|
|
687
687
|
} else
|
|
688
688
|
[i, l] = zo(i, e);
|
|
689
689
|
if (i === s)
|
|
690
690
|
return t;
|
|
691
|
-
const { lastIndex: u, lastOffset: d, lastSize: f, offsetTree:
|
|
691
|
+
const { lastIndex: u, lastOffset: d, lastSize: f, offsetTree: S } = Ge(t.offsetTree, l, i, r);
|
|
692
692
|
return {
|
|
693
693
|
groupIndices: n,
|
|
694
|
-
groupOffsetTree: n.reduce((h, m) => xt(h, m, le(m,
|
|
694
|
+
groupOffsetTree: n.reduce((h, m) => xt(h, m, le(m, S, r)), Dt()),
|
|
695
695
|
lastIndex: u,
|
|
696
696
|
lastOffset: d,
|
|
697
697
|
lastSize: f,
|
|
698
|
-
offsetTree:
|
|
698
|
+
offsetTree: S,
|
|
699
699
|
sizeTree: i
|
|
700
700
|
};
|
|
701
701
|
}
|
|
702
|
-
function
|
|
702
|
+
function Po(t) {
|
|
703
703
|
return $t(t).map(({ k: e, v: n }, o, r) => {
|
|
704
704
|
const s = r[o + 1];
|
|
705
705
|
return { endIndex: s === void 0 ? 1 / 0 : s.k - 1, size: n, startIndex: e };
|
|
@@ -711,17 +711,17 @@ function vn(t, e) {
|
|
|
711
711
|
n += e[o + 1] - e[o] - 1, o++;
|
|
712
712
|
return o - (n === t ? 0 : 1);
|
|
713
713
|
}
|
|
714
|
-
function
|
|
714
|
+
function Ge(t, e, n, o) {
|
|
715
715
|
let r = t, s = 0, i = 0, l = 0, u = 0;
|
|
716
716
|
if (e === 0)
|
|
717
717
|
r = [];
|
|
718
718
|
else {
|
|
719
|
-
u =
|
|
719
|
+
u = we(r, e - 1, je), l = r[u].offset;
|
|
720
720
|
const f = kt(n, e - 1);
|
|
721
721
|
s = f[0], i = f[1], r.length && r[u].size === kt(n, e)[1] && (u -= 1), r = r.slice(0, u + 1);
|
|
722
722
|
}
|
|
723
723
|
for (const { start: d, value: f } of Xt(n, e, 1 / 0)) {
|
|
724
|
-
const
|
|
724
|
+
const S = d - s, h = S * i + l + S * o;
|
|
725
725
|
r.push({
|
|
726
726
|
index: d,
|
|
727
727
|
offset: h,
|
|
@@ -735,7 +735,7 @@ function Me(t, e, n, o) {
|
|
|
735
735
|
offsetTree: r
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function Go(t) {
|
|
739
739
|
return { index: t.index, value: t };
|
|
740
740
|
}
|
|
741
741
|
function Ao(t) {
|
|
@@ -747,57 +747,57 @@ const _o = {
|
|
|
747
747
|
offsetWidth: "width"
|
|
748
748
|
}, zt = Y(
|
|
749
749
|
([{ log: t }, { recalcInProgress: e }]) => {
|
|
750
|
-
const n = U(), o = U(), r = gt(o, 0), s = U(), i = U(), l = y(0), u = y([]), d = y(void 0), f = y(void 0),
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
const n = U(), o = U(), r = gt(o, 0), s = U(), i = U(), l = y(0), u = y([]), d = y(void 0), f = y(void 0), S = y(void 0), h = y(void 0), m = y((c, p) => Bt(c, _o[p])), T = y(void 0), R = y(0), g = xn(), x = U(), a = gt(
|
|
751
|
+
v(
|
|
752
|
+
Ce(n, x),
|
|
753
753
|
$(u, t, R),
|
|
754
754
|
Ht((c, [p, ...b]) => {
|
|
755
755
|
if (p === null) {
|
|
756
|
-
const [
|
|
756
|
+
const [L] = b;
|
|
757
757
|
return {
|
|
758
758
|
...xn(),
|
|
759
|
-
groupIndices:
|
|
760
|
-
groupOffsetTree:
|
|
759
|
+
groupIndices: L,
|
|
760
|
+
groupOffsetTree: L.reduce((O, F, P) => xt(O, F, P), Dt())
|
|
761
761
|
};
|
|
762
762
|
}
|
|
763
|
-
return
|
|
763
|
+
return Mo(c, [p, ...b]);
|
|
764
764
|
}, g),
|
|
765
765
|
ot()
|
|
766
766
|
),
|
|
767
767
|
g
|
|
768
768
|
), C = gt(
|
|
769
|
-
|
|
769
|
+
v(
|
|
770
770
|
u,
|
|
771
771
|
ot(),
|
|
772
772
|
Ht((c, p) => ({ current: p, prev: c.current }), {
|
|
773
773
|
current: [],
|
|
774
774
|
prev: []
|
|
775
775
|
}),
|
|
776
|
-
|
|
776
|
+
B(({ prev: c }) => c)
|
|
777
777
|
),
|
|
778
778
|
[]
|
|
779
779
|
);
|
|
780
780
|
z(
|
|
781
|
-
|
|
781
|
+
v(
|
|
782
782
|
u,
|
|
783
783
|
V((c) => c.length > 0),
|
|
784
784
|
$(a, R),
|
|
785
|
-
|
|
786
|
-
const
|
|
785
|
+
B(([c, p, b]) => {
|
|
786
|
+
const L = c.reduce((O, F, P) => xt(O, F, le(F, p.offsetTree, b) || P), Dt());
|
|
787
787
|
return {
|
|
788
788
|
...p,
|
|
789
789
|
groupIndices: c,
|
|
790
|
-
groupOffsetTree:
|
|
790
|
+
groupOffsetTree: L
|
|
791
791
|
};
|
|
792
792
|
})
|
|
793
793
|
),
|
|
794
794
|
a
|
|
795
795
|
), z(
|
|
796
|
-
|
|
796
|
+
v(
|
|
797
797
|
o,
|
|
798
798
|
$(a),
|
|
799
799
|
V(([c, { lastIndex: p }]) => c < p),
|
|
800
|
-
|
|
800
|
+
B(([c, { lastIndex: p, lastSize: b }]) => [
|
|
801
801
|
{
|
|
802
802
|
endIndex: p,
|
|
803
803
|
size: b,
|
|
@@ -808,18 +808,18 @@ const _o = {
|
|
|
808
808
|
n
|
|
809
809
|
), z(d, f);
|
|
810
810
|
const I = gt(
|
|
811
|
-
|
|
811
|
+
v(
|
|
812
812
|
d,
|
|
813
|
-
|
|
813
|
+
B((c) => c === void 0)
|
|
814
814
|
),
|
|
815
815
|
!0
|
|
816
816
|
);
|
|
817
817
|
z(
|
|
818
|
-
|
|
818
|
+
v(
|
|
819
819
|
f,
|
|
820
820
|
V((c) => c !== void 0 && J(tt(a).sizeTree)),
|
|
821
|
-
|
|
822
|
-
const p = tt(
|
|
821
|
+
B((c) => {
|
|
822
|
+
const p = tt(S), b = tt(u).length > 0;
|
|
823
823
|
return p !== void 0 && p !== 0 ? b ? [
|
|
824
824
|
{ endIndex: 0, size: p, startIndex: 0 },
|
|
825
825
|
{ endIndex: 1, size: c, startIndex: 1 }
|
|
@@ -828,54 +828,54 @@ const _o = {
|
|
|
828
828
|
),
|
|
829
829
|
n
|
|
830
830
|
), z(
|
|
831
|
-
|
|
831
|
+
v(
|
|
832
832
|
h,
|
|
833
833
|
V((c) => c !== void 0 && c.length > 0 && J(tt(a).sizeTree)),
|
|
834
|
-
|
|
834
|
+
B((c) => {
|
|
835
835
|
const p = [];
|
|
836
|
-
let b = c[0],
|
|
837
|
-
for (let
|
|
838
|
-
const F = c[
|
|
836
|
+
let b = c[0], L = 0;
|
|
837
|
+
for (let O = 1; O < c.length; O++) {
|
|
838
|
+
const F = c[O];
|
|
839
839
|
F !== b && (p.push({
|
|
840
|
-
endIndex:
|
|
840
|
+
endIndex: O - 1,
|
|
841
841
|
size: b,
|
|
842
|
-
startIndex:
|
|
843
|
-
}), b = F,
|
|
842
|
+
startIndex: L
|
|
843
|
+
}), b = F, L = O);
|
|
844
844
|
}
|
|
845
845
|
return p.push({
|
|
846
846
|
endIndex: c.length - 1,
|
|
847
847
|
size: b,
|
|
848
|
-
startIndex:
|
|
848
|
+
startIndex: L
|
|
849
849
|
}), p;
|
|
850
850
|
})
|
|
851
851
|
),
|
|
852
852
|
n
|
|
853
853
|
), z(
|
|
854
|
-
|
|
854
|
+
v(
|
|
855
855
|
u,
|
|
856
|
-
$(
|
|
856
|
+
$(S, f),
|
|
857
857
|
V(([, c, p]) => c !== void 0 && p !== void 0),
|
|
858
|
-
|
|
859
|
-
const
|
|
860
|
-
for (let
|
|
861
|
-
const F = c[
|
|
862
|
-
|
|
858
|
+
B(([c, p, b]) => {
|
|
859
|
+
const L = [];
|
|
860
|
+
for (let O = 0; O < c.length; O++) {
|
|
861
|
+
const F = c[O], P = c[O + 1];
|
|
862
|
+
L.push({
|
|
863
863
|
startIndex: F,
|
|
864
864
|
endIndex: F,
|
|
865
865
|
size: p
|
|
866
|
-
}),
|
|
866
|
+
}), P !== void 0 && L.push({
|
|
867
867
|
startIndex: F + 1,
|
|
868
|
-
endIndex:
|
|
868
|
+
endIndex: P - 1,
|
|
869
869
|
size: b
|
|
870
870
|
});
|
|
871
871
|
}
|
|
872
|
-
return
|
|
872
|
+
return L;
|
|
873
873
|
})
|
|
874
874
|
),
|
|
875
875
|
n
|
|
876
876
|
);
|
|
877
877
|
const w = yt(
|
|
878
|
-
|
|
878
|
+
v(
|
|
879
879
|
n,
|
|
880
880
|
$(a),
|
|
881
881
|
Ht(
|
|
@@ -885,89 +885,89 @@ const _o = {
|
|
|
885
885
|
}),
|
|
886
886
|
{ changed: !1, sizes: g }
|
|
887
887
|
),
|
|
888
|
-
|
|
888
|
+
B((c) => c.changed)
|
|
889
889
|
)
|
|
890
890
|
);
|
|
891
891
|
X(
|
|
892
|
-
|
|
892
|
+
v(
|
|
893
893
|
l,
|
|
894
894
|
Ht(
|
|
895
895
|
(c, p) => ({ diff: c.prev - p, prev: p }),
|
|
896
896
|
{ diff: 0, prev: 0 }
|
|
897
897
|
),
|
|
898
|
-
|
|
898
|
+
B((c) => c.diff)
|
|
899
899
|
),
|
|
900
900
|
(c) => {
|
|
901
901
|
const { groupIndices: p } = tt(a);
|
|
902
902
|
if (c > 0)
|
|
903
|
-
|
|
903
|
+
N(e, !0), N(s, c + vn(c, p));
|
|
904
904
|
else if (c < 0) {
|
|
905
905
|
const b = tt(C);
|
|
906
|
-
b.length > 0 && (c -= vn(-c, b)),
|
|
906
|
+
b.length > 0 && (c -= vn(-c, b)), N(i, c);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
|
-
), X(
|
|
909
|
+
), X(v(l, $(t)), ([c, p]) => {
|
|
910
910
|
c < 0 && p(
|
|
911
911
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
912
912
|
{ firstItemIndex: l },
|
|
913
913
|
ht.ERROR
|
|
914
914
|
);
|
|
915
915
|
});
|
|
916
|
-
const
|
|
916
|
+
const k = yt(s);
|
|
917
917
|
z(
|
|
918
|
-
|
|
918
|
+
v(
|
|
919
919
|
s,
|
|
920
920
|
$(a),
|
|
921
|
-
|
|
922
|
-
const b = p.groupIndices.length > 0,
|
|
921
|
+
B(([c, p]) => {
|
|
922
|
+
const b = p.groupIndices.length > 0, L = [], O = p.lastSize;
|
|
923
923
|
if (b) {
|
|
924
924
|
const F = ie(p.sizeTree, 0);
|
|
925
|
-
let
|
|
926
|
-
for (;
|
|
927
|
-
const K = p.groupIndices[Z],
|
|
928
|
-
|
|
925
|
+
let P = 0, Z = 0;
|
|
926
|
+
for (; P < c; ) {
|
|
927
|
+
const K = p.groupIndices[Z], lt = p.groupIndices.length === Z + 1 ? 1 / 0 : p.groupIndices[Z + 1] - K - 1;
|
|
928
|
+
L.push({
|
|
929
929
|
endIndex: K,
|
|
930
930
|
size: F,
|
|
931
931
|
startIndex: K
|
|
932
|
-
}),
|
|
933
|
-
endIndex: K + 1 +
|
|
934
|
-
size:
|
|
932
|
+
}), L.push({
|
|
933
|
+
endIndex: K + 1 + lt - 1,
|
|
934
|
+
size: O,
|
|
935
935
|
startIndex: K + 1
|
|
936
|
-
}), Z++,
|
|
936
|
+
}), Z++, P += lt + 1;
|
|
937
937
|
}
|
|
938
938
|
const W = $t(p.sizeTree);
|
|
939
|
-
return
|
|
940
|
-
(K, { k:
|
|
939
|
+
return P !== c && W.shift(), W.reduce(
|
|
940
|
+
(K, { k: lt, v: ct }) => {
|
|
941
941
|
let It = K.ranges;
|
|
942
942
|
return K.prevSize !== 0 && (It = [
|
|
943
943
|
...K.ranges,
|
|
944
944
|
{
|
|
945
|
-
endIndex:
|
|
945
|
+
endIndex: lt + c - 1,
|
|
946
946
|
size: K.prevSize,
|
|
947
947
|
startIndex: K.prevIndex
|
|
948
948
|
}
|
|
949
949
|
]), {
|
|
950
|
-
prevIndex:
|
|
951
|
-
prevSize:
|
|
950
|
+
prevIndex: lt + c,
|
|
951
|
+
prevSize: ct,
|
|
952
952
|
ranges: It
|
|
953
953
|
};
|
|
954
954
|
},
|
|
955
955
|
{
|
|
956
956
|
prevIndex: c,
|
|
957
957
|
prevSize: 0,
|
|
958
|
-
ranges:
|
|
958
|
+
ranges: L
|
|
959
959
|
}
|
|
960
960
|
).ranges;
|
|
961
961
|
}
|
|
962
962
|
return $t(p.sizeTree).reduce(
|
|
963
|
-
(F, { k:
|
|
964
|
-
prevIndex:
|
|
963
|
+
(F, { k: P, v: Z }) => ({
|
|
964
|
+
prevIndex: P + c,
|
|
965
965
|
prevSize: Z,
|
|
966
|
-
ranges: [...F.ranges, { endIndex:
|
|
966
|
+
ranges: [...F.ranges, { endIndex: P + c - 1, size: F.prevSize, startIndex: F.prevIndex }]
|
|
967
967
|
}),
|
|
968
968
|
{
|
|
969
969
|
prevIndex: 0,
|
|
970
|
-
prevSize:
|
|
970
|
+
prevSize: O,
|
|
971
971
|
ranges: []
|
|
972
972
|
}
|
|
973
973
|
).ranges;
|
|
@@ -975,69 +975,69 @@ const _o = {
|
|
|
975
975
|
),
|
|
976
976
|
n
|
|
977
977
|
);
|
|
978
|
-
const
|
|
979
|
-
|
|
978
|
+
const A = yt(
|
|
979
|
+
v(
|
|
980
980
|
i,
|
|
981
981
|
$(a, R),
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
return le(
|
|
982
|
+
B(([c, { offsetTree: p }, b]) => {
|
|
983
|
+
const L = -c;
|
|
984
|
+
return le(L, p, b);
|
|
985
985
|
})
|
|
986
986
|
)
|
|
987
987
|
);
|
|
988
988
|
return z(
|
|
989
|
-
|
|
989
|
+
v(
|
|
990
990
|
i,
|
|
991
991
|
$(a, R),
|
|
992
|
-
|
|
992
|
+
B(([c, p, b]) => {
|
|
993
993
|
if (p.groupIndices.length > 0) {
|
|
994
994
|
if (J(p.sizeTree))
|
|
995
995
|
return p;
|
|
996
996
|
let F = Dt();
|
|
997
|
-
const
|
|
997
|
+
const P = tt(C);
|
|
998
998
|
let Z = 0, W = 0, ft = 0;
|
|
999
999
|
for (; Z < -c; ) {
|
|
1000
|
-
ft =
|
|
1001
|
-
const
|
|
1002
|
-
W++, Z +=
|
|
1000
|
+
ft = P[W];
|
|
1001
|
+
const lt = P[W + 1] - ft - 1;
|
|
1002
|
+
W++, Z += lt + 1;
|
|
1003
1003
|
}
|
|
1004
|
-
if (F = $t(p.sizeTree).reduce((
|
|
1005
|
-
const
|
|
1006
|
-
F = xt(F, 0,
|
|
1007
|
-
const
|
|
1008
|
-
F = xt(F, 1,
|
|
1004
|
+
if (F = $t(p.sizeTree).reduce((lt, { k: ct, v: It }) => xt(lt, Math.max(0, ct + c), It), F), Z !== -c) {
|
|
1005
|
+
const lt = ie(p.sizeTree, ft);
|
|
1006
|
+
F = xt(F, 0, lt);
|
|
1007
|
+
const ct = kt(p.sizeTree, -c + 1)[1];
|
|
1008
|
+
F = xt(F, 1, ct);
|
|
1009
1009
|
}
|
|
1010
1010
|
return {
|
|
1011
1011
|
...p,
|
|
1012
1012
|
sizeTree: F,
|
|
1013
|
-
...
|
|
1013
|
+
...Ge(p.offsetTree, 0, F, b)
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1016
|
+
const O = $t(p.sizeTree).reduce((F, { k: P, v: Z }) => xt(F, Math.max(0, P + c), Z), Dt());
|
|
1017
1017
|
return {
|
|
1018
1018
|
...p,
|
|
1019
|
-
sizeTree:
|
|
1020
|
-
...
|
|
1019
|
+
sizeTree: O,
|
|
1020
|
+
...Ge(p.offsetTree, 0, O, b)
|
|
1021
1021
|
};
|
|
1022
1022
|
})
|
|
1023
1023
|
),
|
|
1024
1024
|
a
|
|
1025
1025
|
), {
|
|
1026
|
-
beforeUnshiftWith:
|
|
1026
|
+
beforeUnshiftWith: k,
|
|
1027
1027
|
// input
|
|
1028
|
-
data:
|
|
1028
|
+
data: T,
|
|
1029
1029
|
defaultItemSize: f,
|
|
1030
1030
|
firstItemIndex: l,
|
|
1031
1031
|
fixedItemSize: d,
|
|
1032
|
-
fixedGroupSize:
|
|
1032
|
+
fixedGroupSize: S,
|
|
1033
1033
|
gap: R,
|
|
1034
1034
|
groupIndices: u,
|
|
1035
1035
|
heightEstimates: h,
|
|
1036
1036
|
itemSize: m,
|
|
1037
1037
|
listRefresh: w,
|
|
1038
|
-
resetSizes:
|
|
1038
|
+
resetSizes: x,
|
|
1039
1039
|
shiftWith: i,
|
|
1040
|
-
shiftWithOffset:
|
|
1040
|
+
shiftWithOffset: A,
|
|
1041
1041
|
sizeRanges: n,
|
|
1042
1042
|
// output
|
|
1043
1043
|
sizes: a,
|
|
@@ -1047,7 +1047,7 @@ const _o = {
|
|
|
1047
1047
|
unshiftWith: s
|
|
1048
1048
|
};
|
|
1049
1049
|
},
|
|
1050
|
-
st(
|
|
1050
|
+
st(Gt, Ke),
|
|
1051
1051
|
{ singleton: !0 }
|
|
1052
1052
|
);
|
|
1053
1053
|
function No(t) {
|
|
@@ -1061,49 +1061,49 @@ function No(t) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
const Zn = Y(
|
|
1063
1063
|
([{ groupIndices: t, resetSizes: e, sizeRanges: n, sizes: o, statefulTotalCount: r, totalCount: s, trackItemSizes: i }, { headerHeight: l, scrollTop: u }]) => {
|
|
1064
|
-
const d = U(), f = U(),
|
|
1065
|
-
|
|
1064
|
+
const d = U(), f = U(), S = yt(v(d, B(No))), h = gt(
|
|
1065
|
+
v(
|
|
1066
1066
|
n,
|
|
1067
1067
|
$(r, t),
|
|
1068
|
-
V(([, m,
|
|
1068
|
+
V(([, m, T]) => m > T.length),
|
|
1069
1069
|
Ct(!0)
|
|
1070
1070
|
),
|
|
1071
1071
|
!1
|
|
1072
1072
|
);
|
|
1073
1073
|
return z(
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
Ht(([, m],
|
|
1074
|
+
v(
|
|
1075
|
+
S,
|
|
1076
|
+
Ht(([, m], T) => [m, T], [
|
|
1077
1077
|
{ groupIndices: [], totalCount: 0 },
|
|
1078
1078
|
{ groupIndices: [], totalCount: 0 }
|
|
1079
1079
|
]),
|
|
1080
1080
|
$(o, i, h),
|
|
1081
|
-
V(([[m,
|
|
1082
|
-
const a = m.groupIndices.length > 0 && m.totalCount === m.groupIndices.length, C =
|
|
1083
|
-
return g && !
|
|
1081
|
+
V(([[m, T], { sizeTree: R }, g, x]) => {
|
|
1082
|
+
const a = m.groupIndices.length > 0 && m.totalCount === m.groupIndices.length, C = T.totalCount > T.groupIndices.length;
|
|
1083
|
+
return g && !x && a && C && !J(R);
|
|
1084
1084
|
}),
|
|
1085
1085
|
Ct(null)
|
|
1086
1086
|
),
|
|
1087
1087
|
e
|
|
1088
1088
|
), z(
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1089
|
+
v(
|
|
1090
|
+
S,
|
|
1091
|
+
B((m) => m.totalCount)
|
|
1092
1092
|
),
|
|
1093
1093
|
s
|
|
1094
1094
|
), z(
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1095
|
+
v(
|
|
1096
|
+
S,
|
|
1097
|
+
B((m) => m.groupIndices)
|
|
1098
1098
|
),
|
|
1099
1099
|
t
|
|
1100
1100
|
), z(
|
|
1101
|
-
|
|
1101
|
+
v(
|
|
1102
1102
|
mt(u, o, l),
|
|
1103
|
-
V(([m,
|
|
1104
|
-
|
|
1103
|
+
V(([m, T]) => Ee(T)),
|
|
1104
|
+
B(([m, T, R]) => kt(T.groupOffsetTree, Math.max(m - R, 0), "v")[0]),
|
|
1105
1105
|
ot(),
|
|
1106
|
-
|
|
1106
|
+
B((m) => [m])
|
|
1107
1107
|
),
|
|
1108
1108
|
f
|
|
1109
1109
|
), { groupCounts: d, topItemsIndexes: f };
|
|
@@ -1112,7 +1112,7 @@ const Zn = Y(
|
|
|
1112
1112
|
), At = Y(
|
|
1113
1113
|
([{ log: t }]) => {
|
|
1114
1114
|
const e = y(!1), n = yt(
|
|
1115
|
-
|
|
1115
|
+
v(
|
|
1116
1116
|
e,
|
|
1117
1117
|
V((o) => o),
|
|
1118
1118
|
ot()
|
|
@@ -1122,7 +1122,7 @@ const Zn = Y(
|
|
|
1122
1122
|
o && tt(t)("props updated", {}, ht.DEBUG);
|
|
1123
1123
|
}), { didMount: n, propsReady: e };
|
|
1124
1124
|
},
|
|
1125
|
-
st(
|
|
1125
|
+
st(Gt),
|
|
1126
1126
|
{ singleton: !0 }
|
|
1127
1127
|
), Do = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1128
1128
|
function Xn(t) {
|
|
@@ -1140,56 +1140,56 @@ const de = Y(
|
|
|
1140
1140
|
scrollingInProgress: u,
|
|
1141
1141
|
scrollTo: d,
|
|
1142
1142
|
smoothScrollTargetReached: f,
|
|
1143
|
-
viewportHeight:
|
|
1143
|
+
viewportHeight: S
|
|
1144
1144
|
},
|
|
1145
1145
|
{ log: h }
|
|
1146
1146
|
]) => {
|
|
1147
|
-
const m = U(),
|
|
1148
|
-
let g = null,
|
|
1147
|
+
const m = U(), T = U(), R = y(0);
|
|
1148
|
+
let g = null, x = null, a = null;
|
|
1149
1149
|
function C() {
|
|
1150
|
-
g !== null && (g(), g = null), a !== null && (a(), a = null),
|
|
1150
|
+
g !== null && (g(), g = null), a !== null && (a(), a = null), x && (clearTimeout(x), x = null), N(u, !1);
|
|
1151
1151
|
}
|
|
1152
1152
|
return z(
|
|
1153
|
-
|
|
1153
|
+
v(
|
|
1154
1154
|
m,
|
|
1155
|
-
$(n,
|
|
1155
|
+
$(n, S, o, R, l, i, h),
|
|
1156
1156
|
$(t, s, r),
|
|
1157
|
-
|
|
1157
|
+
B(
|
|
1158
1158
|
([
|
|
1159
|
-
[I, w,
|
|
1160
|
-
|
|
1159
|
+
[I, w, k, A, c, p, b, L],
|
|
1160
|
+
O,
|
|
1161
1161
|
F,
|
|
1162
|
-
|
|
1162
|
+
P
|
|
1163
1163
|
]) => {
|
|
1164
|
-
const Z = Xn(I), { align: W, behavior: ft, offset: K } = Z,
|
|
1165
|
-
let It = le(
|
|
1166
|
-
W === "end" ? (It += F + kt(w.sizeTree,
|
|
1164
|
+
const Z = Xn(I), { align: W, behavior: ft, offset: K } = Z, lt = A - 1, ct = Yn(Z, w, lt);
|
|
1165
|
+
let It = le(ct, w.offsetTree, O) + p;
|
|
1166
|
+
W === "end" ? (It += F + kt(w.sizeTree, ct)[1] - k + P, ct === lt && (It += b)) : W === "center" ? It += (F + kt(w.sizeTree, ct)[1] - k + P) / 2 : It -= c, K !== void 0 && K !== 0 && (It += K);
|
|
1167
1167
|
const Ft = (vt) => {
|
|
1168
|
-
C(), vt ? (
|
|
1168
|
+
C(), vt ? (L("retrying to scroll to", { location: I }, ht.DEBUG), N(m, I)) : (N(T, !0), L("list did not change, scroll successful", {}, ht.DEBUG));
|
|
1169
1169
|
};
|
|
1170
1170
|
if (C(), ft === "smooth") {
|
|
1171
1171
|
let vt = !1;
|
|
1172
|
-
a = X(e, (
|
|
1173
|
-
vt = vt ||
|
|
1172
|
+
a = X(e, (Lt) => {
|
|
1173
|
+
vt = vt || Lt;
|
|
1174
1174
|
}), g = Et(f, () => {
|
|
1175
1175
|
Ft(vt);
|
|
1176
1176
|
});
|
|
1177
1177
|
} else
|
|
1178
|
-
g = Et(
|
|
1179
|
-
return
|
|
1178
|
+
g = Et(v(e, $o(150)), Ft);
|
|
1179
|
+
return x = setTimeout(() => {
|
|
1180
1180
|
C();
|
|
1181
|
-
}, 1200),
|
|
1181
|
+
}, 1200), N(u, !0), L("scrolling from index to", { behavior: ft, index: ct, top: It }, ht.DEBUG), { behavior: ft, top: It };
|
|
1182
1182
|
}
|
|
1183
1183
|
)
|
|
1184
1184
|
),
|
|
1185
1185
|
d
|
|
1186
1186
|
), {
|
|
1187
|
-
scrollTargetReached:
|
|
1187
|
+
scrollTargetReached: T,
|
|
1188
1188
|
scrollToIndex: m,
|
|
1189
1189
|
topListHeight: R
|
|
1190
1190
|
};
|
|
1191
1191
|
},
|
|
1192
|
-
st(zt, St,
|
|
1192
|
+
st(zt, St, Gt),
|
|
1193
1193
|
{ singleton: !0 }
|
|
1194
1194
|
);
|
|
1195
1195
|
function $o(t) {
|
|
@@ -1220,39 +1220,39 @@ const fe = Y(
|
|
|
1220
1220
|
([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
|
|
1221
1221
|
const l = y(!0), u = y(0), d = y(!0);
|
|
1222
1222
|
return z(
|
|
1223
|
-
|
|
1223
|
+
v(
|
|
1224
1224
|
i,
|
|
1225
1225
|
$(u),
|
|
1226
|
-
V(([f,
|
|
1226
|
+
V(([f, S]) => !Ae(S)),
|
|
1227
1227
|
Ct(!1)
|
|
1228
1228
|
),
|
|
1229
1229
|
l
|
|
1230
1230
|
), z(
|
|
1231
|
-
|
|
1231
|
+
v(
|
|
1232
1232
|
i,
|
|
1233
1233
|
$(u),
|
|
1234
|
-
V(([f,
|
|
1234
|
+
V(([f, S]) => !Ae(S)),
|
|
1235
1235
|
Ct(!1)
|
|
1236
1236
|
),
|
|
1237
1237
|
d
|
|
1238
1238
|
), X(
|
|
1239
|
-
|
|
1239
|
+
v(
|
|
1240
1240
|
mt(e, i),
|
|
1241
1241
|
$(l, n, t, d),
|
|
1242
|
-
V(([[, f],
|
|
1242
|
+
V(([[, f], S, { sizeTree: h }, m, T]) => f && (!J(h) || Ne(m)) && !S && !T),
|
|
1243
1243
|
$(u)
|
|
1244
1244
|
),
|
|
1245
1245
|
([, f]) => {
|
|
1246
1246
|
if (f === void 0) {
|
|
1247
|
-
|
|
1247
|
+
N(l, !0), N(d, !0);
|
|
1248
1248
|
return;
|
|
1249
1249
|
}
|
|
1250
1250
|
Et(r, () => {
|
|
1251
|
-
|
|
1251
|
+
N(d, !0);
|
|
1252
1252
|
}), qe(4, () => {
|
|
1253
1253
|
Et(o, () => {
|
|
1254
|
-
|
|
1255
|
-
}),
|
|
1254
|
+
N(l, !0);
|
|
1255
|
+
}), N(s, f);
|
|
1256
1256
|
});
|
|
1257
1257
|
}
|
|
1258
1258
|
), {
|
|
@@ -1277,59 +1277,59 @@ const ce = "up", ne = "down", Uo = "none", Ko = {
|
|
|
1277
1277
|
viewportHeight: 0
|
|
1278
1278
|
}
|
|
1279
1279
|
}, jo = 0, me = Y(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
|
|
1280
|
-
const i = y(!1), l = y(!0), u = U(), d = U(), f = y(4),
|
|
1281
|
-
|
|
1282
|
-
|
|
1280
|
+
const i = y(!1), l = y(!0), u = U(), d = U(), f = y(4), S = y(jo), h = gt(
|
|
1281
|
+
v(
|
|
1282
|
+
Ce(v(M(r), jt(1), Ct(!0)), v(M(r), jt(1), Ct(!1), hn(100))),
|
|
1283
1283
|
ot()
|
|
1284
1284
|
),
|
|
1285
1285
|
!1
|
|
1286
1286
|
), m = gt(
|
|
1287
|
-
|
|
1287
|
+
v(Ce(v(n, Ct(!0)), v(n, Ct(!1), hn(200))), ot()),
|
|
1288
1288
|
!1
|
|
1289
1289
|
);
|
|
1290
1290
|
z(
|
|
1291
|
-
|
|
1292
|
-
mt(
|
|
1293
|
-
|
|
1291
|
+
v(
|
|
1292
|
+
mt(M(r), M(S)),
|
|
1293
|
+
B(([a, C]) => a <= C),
|
|
1294
1294
|
ot()
|
|
1295
1295
|
),
|
|
1296
1296
|
l
|
|
1297
|
-
), z(
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
mt(o,
|
|
1301
|
-
Ht((a, [{ scrollHeight: C, scrollTop: I }, w,
|
|
1297
|
+
), z(v(l, Wt(50)), d);
|
|
1298
|
+
const T = yt(
|
|
1299
|
+
v(
|
|
1300
|
+
mt(o, M(s), M(e), M(t), M(f)),
|
|
1301
|
+
Ht((a, [{ scrollHeight: C, scrollTop: I }, w, k, A, c]) => {
|
|
1302
1302
|
const p = I + w - C > -c, b = {
|
|
1303
1303
|
scrollHeight: C,
|
|
1304
1304
|
scrollTop: I,
|
|
1305
1305
|
viewportHeight: w
|
|
1306
1306
|
};
|
|
1307
1307
|
if (p) {
|
|
1308
|
-
let
|
|
1309
|
-
return I > a.state.scrollTop ? (
|
|
1308
|
+
let O, F;
|
|
1309
|
+
return I > a.state.scrollTop ? (O = "SCROLLED_DOWN", F = a.state.scrollTop - I) : (O = "SIZE_DECREASED", F = a.state.scrollTop - I || a.scrollTopDelta), {
|
|
1310
1310
|
atBottom: !0,
|
|
1311
|
-
atBottomBecause:
|
|
1311
|
+
atBottomBecause: O,
|
|
1312
1312
|
scrollTopDelta: F,
|
|
1313
1313
|
state: b
|
|
1314
1314
|
};
|
|
1315
1315
|
}
|
|
1316
|
-
let
|
|
1317
|
-
return b.scrollHeight > a.state.scrollHeight ?
|
|
1316
|
+
let L;
|
|
1317
|
+
return b.scrollHeight > a.state.scrollHeight ? L = "SIZE_INCREASED" : w < a.state.viewportHeight ? L = "VIEWPORT_HEIGHT_DECREASING" : I < a.state.scrollTop ? L = "SCROLLING_UPWARDS" : L = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
1318
1318
|
atBottom: !1,
|
|
1319
|
-
notAtBottomBecause:
|
|
1319
|
+
notAtBottomBecause: L,
|
|
1320
1320
|
state: b
|
|
1321
1321
|
};
|
|
1322
1322
|
}, Ko),
|
|
1323
1323
|
ot((a, C) => a !== void 0 && a.atBottom === C.atBottom)
|
|
1324
1324
|
)
|
|
1325
1325
|
), R = gt(
|
|
1326
|
-
|
|
1326
|
+
v(
|
|
1327
1327
|
o,
|
|
1328
1328
|
Ht(
|
|
1329
1329
|
(a, { scrollHeight: C, scrollTop: I, viewportHeight: w }) => {
|
|
1330
1330
|
if (!Jn(a.scrollHeight, C)) {
|
|
1331
|
-
const
|
|
1332
|
-
return a.scrollTop !== I &&
|
|
1331
|
+
const k = C - (I + w) < 1;
|
|
1332
|
+
return a.scrollTop !== I && k ? {
|
|
1333
1333
|
changed: !0,
|
|
1334
1334
|
jump: a.scrollTop - I,
|
|
1335
1335
|
scrollHeight: C,
|
|
@@ -1351,61 +1351,61 @@ const ce = "up", ne = "down", Uo = "none", Ko = {
|
|
|
1351
1351
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
1352
1352
|
),
|
|
1353
1353
|
V((a) => a.changed),
|
|
1354
|
-
|
|
1354
|
+
B((a) => a.jump)
|
|
1355
1355
|
),
|
|
1356
1356
|
0
|
|
1357
1357
|
);
|
|
1358
1358
|
z(
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1359
|
+
v(
|
|
1360
|
+
T,
|
|
1361
|
+
B((a) => a.atBottom)
|
|
1362
1362
|
),
|
|
1363
1363
|
i
|
|
1364
|
-
), z(
|
|
1364
|
+
), z(v(i, Wt(50)), u);
|
|
1365
1365
|
const g = y(ne);
|
|
1366
1366
|
z(
|
|
1367
|
-
|
|
1367
|
+
v(
|
|
1368
1368
|
o,
|
|
1369
|
-
|
|
1369
|
+
B(({ scrollTop: a }) => a),
|
|
1370
1370
|
ot(),
|
|
1371
1371
|
Ht(
|
|
1372
1372
|
(a, C) => tt(m) ? { direction: a.direction, prevScrollTop: C } : { direction: C < a.prevScrollTop ? ce : ne, prevScrollTop: C },
|
|
1373
1373
|
{ direction: ne, prevScrollTop: 0 }
|
|
1374
1374
|
),
|
|
1375
|
-
|
|
1375
|
+
B((a) => a.direction)
|
|
1376
1376
|
),
|
|
1377
1377
|
g
|
|
1378
|
-
), z(
|
|
1379
|
-
const
|
|
1378
|
+
), z(v(o, Wt(50), Ct(Uo)), g);
|
|
1379
|
+
const x = y(0);
|
|
1380
1380
|
return z(
|
|
1381
|
-
|
|
1381
|
+
v(
|
|
1382
1382
|
h,
|
|
1383
1383
|
V((a) => !a),
|
|
1384
1384
|
Ct(0)
|
|
1385
1385
|
),
|
|
1386
|
-
|
|
1386
|
+
x
|
|
1387
1387
|
), z(
|
|
1388
|
-
|
|
1388
|
+
v(
|
|
1389
1389
|
r,
|
|
1390
1390
|
Wt(100),
|
|
1391
1391
|
$(h),
|
|
1392
1392
|
V(([a, C]) => C),
|
|
1393
1393
|
Ht(([a, C], [I]) => [C, I], [0, 0]),
|
|
1394
|
-
|
|
1394
|
+
B(([a, C]) => C - a)
|
|
1395
1395
|
),
|
|
1396
|
-
|
|
1396
|
+
x
|
|
1397
1397
|
), {
|
|
1398
|
-
atBottomState:
|
|
1398
|
+
atBottomState: T,
|
|
1399
1399
|
atBottomStateChange: u,
|
|
1400
1400
|
atBottomThreshold: f,
|
|
1401
1401
|
atTopStateChange: d,
|
|
1402
|
-
atTopThreshold:
|
|
1402
|
+
atTopThreshold: S,
|
|
1403
1403
|
isAtBottom: i,
|
|
1404
1404
|
isAtTop: l,
|
|
1405
1405
|
isScrolling: h,
|
|
1406
1406
|
lastJumpDueToItemResize: R,
|
|
1407
1407
|
scrollDirection: g,
|
|
1408
|
-
scrollVelocity:
|
|
1408
|
+
scrollVelocity: x
|
|
1409
1409
|
};
|
|
1410
1410
|
}, st(St)), ue = "top", ae = "bottom", Tn = "none";
|
|
1411
1411
|
function Cn(t, e, n) {
|
|
@@ -1417,36 +1417,36 @@ function wn(t, e) {
|
|
|
1417
1417
|
const Ze = Y(
|
|
1418
1418
|
([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
|
|
1419
1419
|
const s = U(), i = y(0), l = y(0), u = y(0), d = gt(
|
|
1420
|
-
|
|
1420
|
+
v(
|
|
1421
1421
|
mt(
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1422
|
+
M(o),
|
|
1423
|
+
M(r),
|
|
1424
|
+
M(n),
|
|
1425
|
+
M(s, Jt),
|
|
1426
|
+
M(u),
|
|
1427
|
+
M(i),
|
|
1428
|
+
M(e),
|
|
1429
|
+
M(t),
|
|
1430
|
+
M(l)
|
|
1431
1431
|
),
|
|
1432
|
-
|
|
1432
|
+
B(
|
|
1433
1433
|
([
|
|
1434
1434
|
f,
|
|
1435
|
-
|
|
1435
|
+
S,
|
|
1436
1436
|
h,
|
|
1437
|
-
[m,
|
|
1437
|
+
[m, T],
|
|
1438
1438
|
R,
|
|
1439
1439
|
g,
|
|
1440
|
-
|
|
1440
|
+
x,
|
|
1441
1441
|
a,
|
|
1442
1442
|
C
|
|
1443
1443
|
]) => {
|
|
1444
|
-
const I = f - a, w = g +
|
|
1445
|
-
let
|
|
1444
|
+
const I = f - a, w = g + x, k = Math.max(h - I, 0);
|
|
1445
|
+
let A = Tn;
|
|
1446
1446
|
const c = wn(C, ue), p = wn(C, ae);
|
|
1447
|
-
return m -= a, m += h +
|
|
1448
|
-
Math.max(I - h - Cn(R, ue,
|
|
1449
|
-
I -
|
|
1447
|
+
return m -= a, m += h + x, T += h + x, T -= a, m > f + w - c && (A = ce), T < f - k + S + p && (A = ne), A !== Tn ? [
|
|
1448
|
+
Math.max(I - h - Cn(R, ue, A) - c, 0),
|
|
1449
|
+
I - k - x + S + Cn(R, ae, A) + p
|
|
1450
1450
|
] : null;
|
|
1451
1451
|
}
|
|
1452
1452
|
),
|
|
@@ -1469,7 +1469,7 @@ const Ze = Y(
|
|
|
1469
1469
|
{ singleton: !0 }
|
|
1470
1470
|
);
|
|
1471
1471
|
function qo(t, e, n, o) {
|
|
1472
|
-
if (
|
|
1472
|
+
if (Ee(e)) {
|
|
1473
1473
|
const r = o - e.groupIndices.length;
|
|
1474
1474
|
if (r <= 0)
|
|
1475
1475
|
return [{ index: e.groupIndices[0], offset: 0, size: 0 }];
|
|
@@ -1481,7 +1481,7 @@ function qo(t, e, n, o) {
|
|
|
1481
1481
|
}
|
|
1482
1482
|
return [{ data: n?.[0], index: t, offset: 0, size: 0 }];
|
|
1483
1483
|
}
|
|
1484
|
-
const
|
|
1484
|
+
const Oe = {
|
|
1485
1485
|
bottom: 0,
|
|
1486
1486
|
firstItemIndex: 0,
|
|
1487
1487
|
items: [],
|
|
@@ -1492,7 +1492,7 @@ const Le = {
|
|
|
1492
1492
|
topListHeight: 0,
|
|
1493
1493
|
totalCount: 0
|
|
1494
1494
|
};
|
|
1495
|
-
function
|
|
1495
|
+
function Te(t, e, n, o, r, s) {
|
|
1496
1496
|
const { lastIndex: i, lastOffset: l, lastSize: u } = r;
|
|
1497
1497
|
let d = 0, f = 0;
|
|
1498
1498
|
if (t.length > 0) {
|
|
@@ -1500,12 +1500,12 @@ function ve(t, e, n, o, r, s) {
|
|
|
1500
1500
|
const R = t[t.length - 1];
|
|
1501
1501
|
f = R.offset + R.size;
|
|
1502
1502
|
}
|
|
1503
|
-
const
|
|
1503
|
+
const S = n - i, h = l + S * u + (S - 1) * o, m = d, T = h - f;
|
|
1504
1504
|
return {
|
|
1505
1505
|
bottom: f,
|
|
1506
1506
|
firstItemIndex: s,
|
|
1507
1507
|
items: yn(t, r, s),
|
|
1508
|
-
offsetBottom:
|
|
1508
|
+
offsetBottom: T,
|
|
1509
1509
|
offsetTop: d,
|
|
1510
1510
|
top: m,
|
|
1511
1511
|
topItems: yn(e, r, s),
|
|
@@ -1521,18 +1521,18 @@ function Qn(t, e, n, o, r, s) {
|
|
|
1521
1521
|
break;
|
|
1522
1522
|
i++;
|
|
1523
1523
|
}
|
|
1524
|
-
const l = t + i, u = s !== void 0, d = s?.length ?? 0, f = Ye(e, u ? d : l),
|
|
1525
|
-
data: s?.[
|
|
1526
|
-
index:
|
|
1524
|
+
const l = t + i, u = s !== void 0, d = s?.length ?? 0, f = Ye(e, u ? d : l), S = u ? Math.max(0, Math.min(l, d - f)) : l, h = Array.from({ length: S }).map((m, T) => ({
|
|
1525
|
+
data: s?.[T + f],
|
|
1526
|
+
index: T + f,
|
|
1527
1527
|
offset: 0,
|
|
1528
1528
|
size: 0
|
|
1529
1529
|
}));
|
|
1530
|
-
return
|
|
1530
|
+
return Te(h, [], S, r, n, o);
|
|
1531
1531
|
}
|
|
1532
1532
|
function yn(t, e, n) {
|
|
1533
1533
|
if (t.length === 0)
|
|
1534
1534
|
return [];
|
|
1535
|
-
if (!
|
|
1535
|
+
if (!Ee(e))
|
|
1536
1536
|
return t.map((d) => ({ ...d, index: d.index + n, originalIndex: d.index }));
|
|
1537
1537
|
const o = t[0].index, r = t[t.length - 1].index, s = [], i = Xt(e.groupOffsetTree, o, r);
|
|
1538
1538
|
let l, u = 0;
|
|
@@ -1564,13 +1564,13 @@ const qt = Y(
|
|
|
1564
1564
|
s,
|
|
1565
1565
|
{ listBoundary: i, topListHeight: l, visibleRange: u },
|
|
1566
1566
|
{ initialTopMostItemIndex: d, scrolledToInitialItem: f },
|
|
1567
|
-
{ topListHeight:
|
|
1567
|
+
{ topListHeight: S },
|
|
1568
1568
|
h,
|
|
1569
1569
|
{ didMount: m },
|
|
1570
|
-
{ recalcInProgress:
|
|
1570
|
+
{ recalcInProgress: T }
|
|
1571
1571
|
]) => {
|
|
1572
|
-
const R = y([]), g = y(0),
|
|
1573
|
-
|
|
1572
|
+
const R = y([]), g = y(0), x = gt(
|
|
1573
|
+
v(
|
|
1574
1574
|
o,
|
|
1575
1575
|
V(({ sizeTree: c }) => !J(c)),
|
|
1576
1576
|
Ct(!0)
|
|
@@ -1579,172 +1579,172 @@ const qt = Y(
|
|
|
1579
1579
|
), a = U(), C = y(0);
|
|
1580
1580
|
z(s.topItemsIndexes, R);
|
|
1581
1581
|
const I = gt(
|
|
1582
|
-
|
|
1582
|
+
v(
|
|
1583
1583
|
mt(
|
|
1584
1584
|
m,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1585
|
+
T,
|
|
1586
|
+
M(u, Jt),
|
|
1587
|
+
M(r),
|
|
1588
|
+
M(o),
|
|
1589
|
+
M(d),
|
|
1590
1590
|
f,
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1591
|
+
M(R),
|
|
1592
|
+
M(e),
|
|
1593
|
+
M(n),
|
|
1594
|
+
M(C),
|
|
1595
1595
|
t,
|
|
1596
|
-
|
|
1596
|
+
M(g)
|
|
1597
1597
|
),
|
|
1598
|
-
V(([c, p, , b, , , , , , , ,
|
|
1599
|
-
const
|
|
1600
|
-
return c && !p && !
|
|
1598
|
+
V(([c, p, , b, , , , , , , , L]) => {
|
|
1599
|
+
const O = L !== void 0 && L.length !== b;
|
|
1600
|
+
return c && !p && !O;
|
|
1601
1601
|
}),
|
|
1602
|
-
|
|
1602
|
+
B(
|
|
1603
1603
|
([
|
|
1604
1604
|
,
|
|
1605
1605
|
,
|
|
1606
1606
|
[c, p],
|
|
1607
1607
|
b,
|
|
1608
|
-
O,
|
|
1609
1608
|
L,
|
|
1609
|
+
O,
|
|
1610
1610
|
F,
|
|
1611
|
-
|
|
1611
|
+
P,
|
|
1612
1612
|
Z,
|
|
1613
1613
|
W,
|
|
1614
1614
|
ft,
|
|
1615
1615
|
K,
|
|
1616
|
-
|
|
1616
|
+
lt
|
|
1617
1617
|
]) => {
|
|
1618
|
-
const
|
|
1618
|
+
const ct = L, { offsetTree: It, sizeTree: Ft } = ct;
|
|
1619
1619
|
if (b === 0)
|
|
1620
|
-
return { ...
|
|
1620
|
+
return { ...Oe, totalCount: b };
|
|
1621
1621
|
if (c === 0 && p === 0)
|
|
1622
|
-
return
|
|
1622
|
+
return lt === 0 ? { ...Oe, totalCount: b } : Qn(lt, O, L, Z, W, K);
|
|
1623
1623
|
if (J(Ft))
|
|
1624
|
-
return
|
|
1625
|
-
qo(Ye(
|
|
1624
|
+
return lt > 0 && !tt(x) ? null : Te(
|
|
1625
|
+
qo(Ye(O, b), ct, K, b),
|
|
1626
1626
|
[],
|
|
1627
1627
|
b,
|
|
1628
1628
|
W,
|
|
1629
|
-
|
|
1629
|
+
ct,
|
|
1630
1630
|
Z
|
|
1631
1631
|
);
|
|
1632
1632
|
const vt = [];
|
|
1633
|
-
if (
|
|
1634
|
-
const q =
|
|
1635
|
-
let
|
|
1633
|
+
if (P.length > 0) {
|
|
1634
|
+
const q = P[0], Q = P[P.length - 1];
|
|
1635
|
+
let ut = 0;
|
|
1636
1636
|
for (const it of Xt(Ft, q, Q)) {
|
|
1637
1637
|
const et = it.value, dt = Math.max(it.start, q), Tt = Math.min(it.end, Q);
|
|
1638
|
-
for (let
|
|
1639
|
-
vt.push({ data: K?.[
|
|
1638
|
+
for (let at = dt; at <= Tt; at++)
|
|
1639
|
+
vt.push({ data: K?.[at], index: at, offset: ut, size: et }), ut += et;
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
1642
|
if (!F)
|
|
1643
|
-
return
|
|
1644
|
-
const
|
|
1645
|
-
if (
|
|
1643
|
+
return Te([], vt, b, W, ct, Z);
|
|
1644
|
+
const Lt = P.length > 0 ? P[P.length - 1] + 1 : 0, he = Wo(It, c, p, Lt);
|
|
1645
|
+
if (he.length === 0)
|
|
1646
1646
|
return null;
|
|
1647
|
-
const Yt = b - 1, Vt =
|
|
1648
|
-
for (const Q of
|
|
1649
|
-
const
|
|
1650
|
-
let it =
|
|
1651
|
-
const dt =
|
|
1652
|
-
if (
|
|
1653
|
-
et += Math.floor((c -
|
|
1654
|
-
const
|
|
1655
|
-
it +=
|
|
1647
|
+
const Yt = b - 1, Vt = Re([], (q) => {
|
|
1648
|
+
for (const Q of he) {
|
|
1649
|
+
const ut = Q.value;
|
|
1650
|
+
let it = ut.offset, et = Q.start;
|
|
1651
|
+
const dt = ut.size;
|
|
1652
|
+
if (ut.offset < c) {
|
|
1653
|
+
et += Math.floor((c - ut.offset + W) / (dt + W));
|
|
1654
|
+
const at = et - Q.start;
|
|
1655
|
+
it += at * dt + at * W;
|
|
1656
1656
|
}
|
|
1657
|
-
et <
|
|
1657
|
+
et < Lt && (it += (Lt - et) * dt, et = Lt);
|
|
1658
1658
|
const Tt = Math.min(Q.end, Yt);
|
|
1659
|
-
for (let
|
|
1660
|
-
q.push({ data: K?.[
|
|
1659
|
+
for (let at = et; at <= Tt && !(it >= p); at++)
|
|
1660
|
+
q.push({ data: K?.[at], index: at, offset: it, size: dt }), it += dt + W;
|
|
1661
1661
|
}
|
|
1662
1662
|
}), H = bn(ft, ue), j = bn(ft, ae);
|
|
1663
1663
|
if (Vt.length > 0 && (H > 0 || j > 0)) {
|
|
1664
1664
|
const q = Vt[0], Q = Vt[Vt.length - 1];
|
|
1665
|
-
if (H > 0 && q.index >
|
|
1666
|
-
const
|
|
1665
|
+
if (H > 0 && q.index > Lt) {
|
|
1666
|
+
const ut = Math.min(H, q.index - Lt), it = [];
|
|
1667
1667
|
let et = q.offset;
|
|
1668
|
-
for (let dt = q.index - 1; dt >= q.index -
|
|
1669
|
-
const
|
|
1670
|
-
et -=
|
|
1668
|
+
for (let dt = q.index - 1; dt >= q.index - ut; dt--) {
|
|
1669
|
+
const at = Xt(Ft, dt, dt)[0]?.value ?? q.size;
|
|
1670
|
+
et -= at + W, it.unshift({ data: K?.[dt], index: dt, offset: et, size: at });
|
|
1671
1671
|
}
|
|
1672
1672
|
Vt.unshift(...it);
|
|
1673
1673
|
}
|
|
1674
1674
|
if (j > 0 && Q.index < Yt) {
|
|
1675
|
-
const
|
|
1675
|
+
const ut = Math.min(j, Yt - Q.index);
|
|
1676
1676
|
let it = Q.offset + Q.size + W;
|
|
1677
|
-
for (let et = Q.index + 1; et <= Q.index +
|
|
1677
|
+
for (let et = Q.index + 1; et <= Q.index + ut; et++) {
|
|
1678
1678
|
const Tt = Xt(Ft, et, et)[0]?.value ?? Q.size;
|
|
1679
1679
|
Vt.push({ data: K?.[et], index: et, offset: it, size: Tt }), it += Tt + W;
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
return
|
|
1683
|
+
return Te(Vt, vt, b, W, ct, Z);
|
|
1684
1684
|
}
|
|
1685
1685
|
),
|
|
1686
1686
|
//@ts-expect-error filter needs to be fixed
|
|
1687
1687
|
V((c) => c !== null),
|
|
1688
1688
|
ot()
|
|
1689
1689
|
),
|
|
1690
|
-
|
|
1690
|
+
Oe
|
|
1691
1691
|
);
|
|
1692
1692
|
z(
|
|
1693
|
-
|
|
1693
|
+
v(
|
|
1694
1694
|
t,
|
|
1695
1695
|
V(Ne),
|
|
1696
|
-
|
|
1696
|
+
B((c) => c?.length)
|
|
1697
1697
|
),
|
|
1698
1698
|
r
|
|
1699
1699
|
), z(
|
|
1700
|
-
|
|
1700
|
+
v(
|
|
1701
1701
|
I,
|
|
1702
|
-
|
|
1702
|
+
B((c) => c.topListHeight)
|
|
1703
1703
|
),
|
|
1704
|
-
|
|
1705
|
-
), z(
|
|
1706
|
-
|
|
1704
|
+
S
|
|
1705
|
+
), z(S, l), z(
|
|
1706
|
+
v(
|
|
1707
1707
|
I,
|
|
1708
|
-
|
|
1708
|
+
B((c) => [c.top, c.bottom])
|
|
1709
1709
|
),
|
|
1710
1710
|
i
|
|
1711
1711
|
), z(
|
|
1712
|
-
|
|
1712
|
+
v(
|
|
1713
1713
|
I,
|
|
1714
|
-
|
|
1714
|
+
B((c) => c.items)
|
|
1715
1715
|
),
|
|
1716
1716
|
a
|
|
1717
1717
|
);
|
|
1718
1718
|
const w = yt(
|
|
1719
|
-
|
|
1719
|
+
v(
|
|
1720
1720
|
I,
|
|
1721
1721
|
V(({ items: c }) => c.length > 0),
|
|
1722
1722
|
$(r, t),
|
|
1723
1723
|
V(([{ items: c }, p]) => c[c.length - 1].originalIndex === p - 1),
|
|
1724
|
-
|
|
1725
|
-
const
|
|
1726
|
-
return [p - 1 -
|
|
1724
|
+
B(([{ items: c }, p, b]) => {
|
|
1725
|
+
const L = c[c.length - 1], O = L.type === "group" ? L.index + 1 : (L.groupIndex ?? -1) + 1;
|
|
1726
|
+
return [p - 1 - O, b];
|
|
1727
1727
|
}),
|
|
1728
1728
|
ot(Jt),
|
|
1729
1729
|
// when every group is empty, only headers render and there is no item index to report.
|
|
1730
1730
|
// Filter after the distinct check, so that the same index fires again once an item returns.
|
|
1731
1731
|
V(([c]) => c >= 0),
|
|
1732
|
-
|
|
1732
|
+
B(([c]) => c)
|
|
1733
1733
|
)
|
|
1734
|
-
),
|
|
1735
|
-
|
|
1734
|
+
), k = yt(
|
|
1735
|
+
v(
|
|
1736
1736
|
I,
|
|
1737
1737
|
Wt(200),
|
|
1738
1738
|
V(({ items: c, topItems: p }) => c.length > 0 && c[0].originalIndex === p.length),
|
|
1739
|
-
|
|
1739
|
+
B(({ items: c }) => c[0].index),
|
|
1740
1740
|
ot()
|
|
1741
1741
|
)
|
|
1742
|
-
),
|
|
1743
|
-
|
|
1742
|
+
), A = yt(
|
|
1743
|
+
v(
|
|
1744
1744
|
I,
|
|
1745
1745
|
V(({ items: c }) => c.length > 0),
|
|
1746
1746
|
// oxlint-disable-next-line array-callback-return -- callback always returns after trimming group sentinels
|
|
1747
|
-
|
|
1747
|
+
B(({ items: c }) => {
|
|
1748
1748
|
let p = 0, b = c.length - 1;
|
|
1749
1749
|
for (; c[p].type === "group" && p < b; )
|
|
1750
1750
|
p++;
|
|
@@ -1764,8 +1764,8 @@ const qt = Y(
|
|
|
1764
1764
|
itemsRendered: a,
|
|
1765
1765
|
listState: I,
|
|
1766
1766
|
minOverscanItemCount: C,
|
|
1767
|
-
rangeChanged:
|
|
1768
|
-
startReached:
|
|
1767
|
+
rangeChanged: A,
|
|
1768
|
+
startReached: k,
|
|
1769
1769
|
topItemsIndexes: R,
|
|
1770
1770
|
...h
|
|
1771
1771
|
};
|
|
@@ -1784,23 +1784,23 @@ const qt = Y(
|
|
|
1784
1784
|
), to = Y(
|
|
1785
1785
|
([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
|
|
1786
1786
|
const s = U(), i = gt(
|
|
1787
|
-
|
|
1787
|
+
v(
|
|
1788
1788
|
mt(n, t, o, e, r),
|
|
1789
|
-
|
|
1789
|
+
B(([l, u, d, f, S]) => l + u + d + f + S.offsetBottom + S.bottom)
|
|
1790
1790
|
),
|
|
1791
1791
|
0
|
|
1792
1792
|
);
|
|
1793
|
-
return z(
|
|
1793
|
+
return z(M(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
1794
1794
|
},
|
|
1795
1795
|
st(St, qt),
|
|
1796
1796
|
{ singleton: !0 }
|
|
1797
1797
|
), Yo = Y(
|
|
1798
1798
|
([{ viewportHeight: t }, { totalListHeight: e }]) => {
|
|
1799
1799
|
const n = y(!1), o = gt(
|
|
1800
|
-
|
|
1800
|
+
v(
|
|
1801
1801
|
mt(n, t, e),
|
|
1802
1802
|
V(([r]) => r),
|
|
1803
|
-
|
|
1803
|
+
B(([, r, s]) => Math.max(0, r - s)),
|
|
1804
1804
|
Wt(0),
|
|
1805
1805
|
ot()
|
|
1806
1806
|
),
|
|
@@ -1826,20 +1826,20 @@ const qt = Y(
|
|
|
1826
1826
|
]) => {
|
|
1827
1827
|
const f = U();
|
|
1828
1828
|
return z(
|
|
1829
|
-
|
|
1829
|
+
v(
|
|
1830
1830
|
f,
|
|
1831
1831
|
$(e, u, n, s, r, o, l),
|
|
1832
1832
|
$(t),
|
|
1833
|
-
|
|
1834
|
-
const { calculateViewLocation: I = Zo, done: w, ...
|
|
1833
|
+
B(([[S, h, m, T, R, g, x, a], C]) => {
|
|
1834
|
+
const { calculateViewLocation: I = Zo, done: w, ...k } = S, A = Yn(S, h, T - 1), c = le(A, h.offsetTree, C) + R + g, p = c + kt(h.sizeTree, A)[1], b = a + g, L = a + m - x, O = I({
|
|
1835
1835
|
itemBottom: p,
|
|
1836
1836
|
itemTop: c,
|
|
1837
|
-
locationParams:
|
|
1838
|
-
viewportBottom:
|
|
1837
|
+
locationParams: k,
|
|
1838
|
+
viewportBottom: L,
|
|
1839
1839
|
viewportTop: b
|
|
1840
1840
|
});
|
|
1841
|
-
return
|
|
1842
|
-
|
|
1841
|
+
return O === null ? w?.() : w && Et(
|
|
1842
|
+
v(
|
|
1843
1843
|
i,
|
|
1844
1844
|
V((F) => !F),
|
|
1845
1845
|
// skips the initial publish of false, and the cleanup call.
|
|
@@ -1847,16 +1847,16 @@ const qt = Y(
|
|
|
1847
1847
|
jt(tt(i) ? 1 : 2)
|
|
1848
1848
|
),
|
|
1849
1849
|
w
|
|
1850
|
-
),
|
|
1850
|
+
), O;
|
|
1851
1851
|
}),
|
|
1852
|
-
V((
|
|
1852
|
+
V((S) => S !== null)
|
|
1853
1853
|
),
|
|
1854
1854
|
d
|
|
1855
1855
|
), {
|
|
1856
1856
|
scrollIntoView: f
|
|
1857
1857
|
};
|
|
1858
1858
|
},
|
|
1859
|
-
st(zt, St, de, qt,
|
|
1859
|
+
st(zt, St, de, qt, Gt),
|
|
1860
1860
|
{ singleton: !0 }
|
|
1861
1861
|
);
|
|
1862
1862
|
function Rn(t) {
|
|
@@ -1870,88 +1870,88 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
1870
1870
|
{ scrolledToInitialItem: l },
|
|
1871
1871
|
{ didMount: u, propsReady: d },
|
|
1872
1872
|
{ log: f },
|
|
1873
|
-
{ scrollingInProgress:
|
|
1873
|
+
{ scrollingInProgress: S },
|
|
1874
1874
|
{ context: h },
|
|
1875
1875
|
{ scrollIntoView: m }
|
|
1876
1876
|
]) => {
|
|
1877
|
-
const
|
|
1877
|
+
const T = y(!1), R = U();
|
|
1878
1878
|
let g = null;
|
|
1879
|
-
function
|
|
1880
|
-
|
|
1879
|
+
function x(w) {
|
|
1880
|
+
N(i, {
|
|
1881
1881
|
align: "end",
|
|
1882
1882
|
behavior: w,
|
|
1883
1883
|
index: "LAST"
|
|
1884
1884
|
});
|
|
1885
1885
|
}
|
|
1886
1886
|
X(
|
|
1887
|
-
|
|
1888
|
-
mt(
|
|
1889
|
-
$(
|
|
1890
|
-
|
|
1891
|
-
let
|
|
1892
|
-
return
|
|
1887
|
+
v(
|
|
1888
|
+
mt(v(M(e), jt(1)), u),
|
|
1889
|
+
$(M(T), s, l, S),
|
|
1890
|
+
B(([[w, k], A, c, p, b]) => {
|
|
1891
|
+
let L = k && p, O = "auto";
|
|
1892
|
+
return L && (O = Xo(A, c || b), L = L && O !== !1), { followOutputBehavior: O, shouldFollow: L, totalCount: w };
|
|
1893
1893
|
}),
|
|
1894
1894
|
V(({ shouldFollow: w }) => w)
|
|
1895
1895
|
),
|
|
1896
|
-
({ followOutputBehavior: w, totalCount:
|
|
1896
|
+
({ followOutputBehavior: w, totalCount: k }) => {
|
|
1897
1897
|
g !== null && (g(), g = null), tt(n) === void 0 ? g = Et(t, () => {
|
|
1898
|
-
tt(f)("following output to ", { totalCount:
|
|
1898
|
+
tt(f)("following output to ", { totalCount: k }, ht.DEBUG), x(w), g = null;
|
|
1899
1899
|
}) : requestAnimationFrame(() => {
|
|
1900
|
-
tt(f)("following output to ", { totalCount:
|
|
1900
|
+
tt(f)("following output to ", { totalCount: k }, ht.DEBUG), x(w);
|
|
1901
1901
|
});
|
|
1902
1902
|
}
|
|
1903
1903
|
);
|
|
1904
1904
|
function a(w) {
|
|
1905
|
-
const
|
|
1906
|
-
w && !
|
|
1905
|
+
const k = Et(r, (A) => {
|
|
1906
|
+
w && !A.atBottom && A.notAtBottomBecause === "SIZE_INCREASED" && g === null && (tt(f)("scrolling to bottom due to increased size", {}, ht.DEBUG), x("auto"));
|
|
1907
1907
|
});
|
|
1908
|
-
setTimeout(
|
|
1908
|
+
setTimeout(k, 100);
|
|
1909
1909
|
}
|
|
1910
1910
|
X(
|
|
1911
|
-
|
|
1912
|
-
mt(
|
|
1913
|
-
V(([w, ,
|
|
1911
|
+
v(
|
|
1912
|
+
mt(M(T), e, d),
|
|
1913
|
+
V(([w, , k]) => w !== !1 && k),
|
|
1914
1914
|
Ht(
|
|
1915
|
-
({ value: w }, [,
|
|
1915
|
+
({ value: w }, [, k]) => ({ refreshed: w === k, value: k }),
|
|
1916
1916
|
{ refreshed: !1, value: 0 }
|
|
1917
1917
|
),
|
|
1918
1918
|
V(({ refreshed: w }) => w),
|
|
1919
|
-
$(
|
|
1919
|
+
$(T, e)
|
|
1920
1920
|
),
|
|
1921
1921
|
([, w]) => {
|
|
1922
1922
|
tt(l) && a(w !== !1);
|
|
1923
1923
|
}
|
|
1924
1924
|
), X(R, () => {
|
|
1925
|
-
a(tt(
|
|
1926
|
-
}), X(mt(
|
|
1927
|
-
w !== !1 && !
|
|
1925
|
+
a(tt(T) !== !1);
|
|
1926
|
+
}), X(mt(M(T), r), ([w, k]) => {
|
|
1927
|
+
w !== !1 && !k.atBottom && k.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && x("auto");
|
|
1928
1928
|
});
|
|
1929
1929
|
const C = y(null), I = U();
|
|
1930
1930
|
return z(
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1931
|
+
Ce(
|
|
1932
|
+
v(
|
|
1933
|
+
M(o),
|
|
1934
|
+
B((w) => w?.length ?? 0)
|
|
1935
1935
|
),
|
|
1936
|
-
|
|
1936
|
+
v(M(e))
|
|
1937
1937
|
),
|
|
1938
1938
|
I
|
|
1939
1939
|
), X(
|
|
1940
|
-
|
|
1941
|
-
mt(
|
|
1942
|
-
$(
|
|
1943
|
-
|
|
1940
|
+
v(
|
|
1941
|
+
mt(v(I, jt(1)), u),
|
|
1942
|
+
$(M(C), l, S, h),
|
|
1943
|
+
B(([[w, k], A, c, p, b]) => k && c && A?.({ context: b, totalCount: w, scrollingInProgress: p })),
|
|
1944
1944
|
V((w) => !!w),
|
|
1945
1945
|
Wt(0)
|
|
1946
1946
|
),
|
|
1947
1947
|
(w) => {
|
|
1948
1948
|
g !== null && (g(), g = null), tt(n) === void 0 ? g = Et(t, () => {
|
|
1949
|
-
tt(f)("scrolling into view", {}),
|
|
1949
|
+
tt(f)("scrolling into view", {}), N(m, w), g = null;
|
|
1950
1950
|
}) : requestAnimationFrame(() => {
|
|
1951
|
-
tt(f)("scrolling into view", {}),
|
|
1951
|
+
tt(f)("scrolling into view", {}), N(m, w);
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
|
-
), { autoscrollToBottom: R, followOutput:
|
|
1954
|
+
), { autoscrollToBottom: R, followOutput: T, scrollIntoViewOnChange: C };
|
|
1955
1955
|
},
|
|
1956
1956
|
st(
|
|
1957
1957
|
zt,
|
|
@@ -1959,19 +1959,19 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
1959
1959
|
de,
|
|
1960
1960
|
fe,
|
|
1961
1961
|
At,
|
|
1962
|
-
|
|
1962
|
+
Gt,
|
|
1963
1963
|
St,
|
|
1964
1964
|
eo,
|
|
1965
1965
|
no
|
|
1966
1966
|
)
|
|
1967
1967
|
), Qo = Y(
|
|
1968
1968
|
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (z(
|
|
1969
|
-
|
|
1969
|
+
v(
|
|
1970
1970
|
l,
|
|
1971
1971
|
$(s),
|
|
1972
1972
|
V(([, u]) => u !== 0),
|
|
1973
1973
|
$(r, o, e, n, t),
|
|
1974
|
-
|
|
1974
|
+
B(([[, u], d, f, S, h, m]) => Qn(u, d, f, S, h, m))
|
|
1975
1975
|
),
|
|
1976
1976
|
i
|
|
1977
1977
|
), {}),
|
|
@@ -1981,22 +1981,22 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
1981
1981
|
([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
|
|
1982
1982
|
const o = y(0);
|
|
1983
1983
|
return X(
|
|
1984
|
-
|
|
1984
|
+
v(
|
|
1985
1985
|
t,
|
|
1986
1986
|
$(o),
|
|
1987
1987
|
V(([, r]) => r !== 0),
|
|
1988
|
-
|
|
1988
|
+
B(([, r]) => ({ top: r }))
|
|
1989
1989
|
),
|
|
1990
1990
|
(r) => {
|
|
1991
1991
|
Et(
|
|
1992
|
-
|
|
1992
|
+
v(
|
|
1993
1993
|
n,
|
|
1994
1994
|
jt(1),
|
|
1995
1995
|
V((s) => s.items.length > 1)
|
|
1996
1996
|
),
|
|
1997
1997
|
() => {
|
|
1998
1998
|
requestAnimationFrame(() => {
|
|
1999
|
-
|
|
1999
|
+
N(e, r);
|
|
2000
2000
|
});
|
|
2001
2001
|
}
|
|
2002
2002
|
);
|
|
@@ -2011,11 +2011,11 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
2011
2011
|
([{ scrollVelocity: t }]) => {
|
|
2012
2012
|
const e = y(!1), n = U(), o = y(!1);
|
|
2013
2013
|
return z(
|
|
2014
|
-
|
|
2014
|
+
v(
|
|
2015
2015
|
t,
|
|
2016
2016
|
$(o, e, n),
|
|
2017
2017
|
V(([r, s]) => s !== !1 && s !== void 0),
|
|
2018
|
-
|
|
2018
|
+
B(([r, s, i, l]) => {
|
|
2019
2019
|
const { enter: u, exit: d } = s;
|
|
2020
2020
|
if (i) {
|
|
2021
2021
|
if (d(r, l))
|
|
@@ -2028,7 +2028,7 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
2028
2028
|
),
|
|
2029
2029
|
e
|
|
2030
2030
|
), X(
|
|
2031
|
-
|
|
2031
|
+
v(mt(e, t, n), $(o)),
|
|
2032
2032
|
([[r, s, i], l]) => {
|
|
2033
2033
|
r && l !== !1 && l !== void 0 && l.change && l.change(s, i);
|
|
2034
2034
|
}
|
|
@@ -2039,9 +2039,9 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
2039
2039
|
), Xe = Y(([{ scrollContainerState: t, scrollTo: e }]) => {
|
|
2040
2040
|
const n = U(), o = U(), r = U(), s = y(!1), i = y(void 0);
|
|
2041
2041
|
return z(
|
|
2042
|
-
|
|
2042
|
+
v(
|
|
2043
2043
|
mt(n, o),
|
|
2044
|
-
|
|
2044
|
+
B(([{ scrollTop: l, viewportHeight: u }, { offsetTop: d, listHeight: f }]) => ({
|
|
2045
2045
|
scrollHeight: f,
|
|
2046
2046
|
scrollTop: Math.max(0, l - d),
|
|
2047
2047
|
viewportHeight: u
|
|
@@ -2049,10 +2049,10 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
2049
2049
|
),
|
|
2050
2050
|
t
|
|
2051
2051
|
), z(
|
|
2052
|
-
|
|
2052
|
+
v(
|
|
2053
2053
|
e,
|
|
2054
2054
|
$(o),
|
|
2055
|
-
|
|
2055
|
+
B(([l, { offsetTop: u }]) => ({
|
|
2056
2056
|
...l,
|
|
2057
2057
|
top: l.top + u
|
|
2058
2058
|
}))
|
|
@@ -2076,23 +2076,23 @@ const Xo = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), Jo = Y(
|
|
|
2076
2076
|
{ didMount: s },
|
|
2077
2077
|
{ useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: u }
|
|
2078
2078
|
]) => {
|
|
2079
|
-
const d = U(), f = y(void 0),
|
|
2080
|
-
return z(l,
|
|
2081
|
-
|
|
2079
|
+
const d = U(), f = y(void 0), S = y(null), h = y(null);
|
|
2080
|
+
return z(l, S), z(u, h), X(
|
|
2081
|
+
v(
|
|
2082
2082
|
d,
|
|
2083
|
-
$(e, o, i,
|
|
2083
|
+
$(e, o, i, S, h, n)
|
|
2084
2084
|
),
|
|
2085
|
-
([m,
|
|
2086
|
-
const I =
|
|
2087
|
-
g &&
|
|
2085
|
+
([m, T, R, g, x, a, C]) => {
|
|
2086
|
+
const I = Po(T.sizeTree);
|
|
2087
|
+
g && x !== null && a !== null && (R = x.scrollTop - a.offsetTop), R -= C, m({ ranges: I, scrollTop: R });
|
|
2088
2088
|
}
|
|
2089
|
-
), z(
|
|
2090
|
-
|
|
2089
|
+
), z(v(f, V(Ne), B(nr)), r), z(
|
|
2090
|
+
v(
|
|
2091
2091
|
s,
|
|
2092
2092
|
$(f),
|
|
2093
2093
|
V(([, m]) => m !== void 0),
|
|
2094
2094
|
ot(),
|
|
2095
|
-
|
|
2095
|
+
B(([, m]) => m.ranges)
|
|
2096
2096
|
),
|
|
2097
2097
|
t
|
|
2098
2098
|
), {
|
|
@@ -2108,10 +2108,10 @@ function nr(t) {
|
|
|
2108
2108
|
const or = Y(([{ topItemsIndexes: t }]) => {
|
|
2109
2109
|
const e = y(0);
|
|
2110
2110
|
return z(
|
|
2111
|
-
|
|
2111
|
+
v(
|
|
2112
2112
|
e,
|
|
2113
2113
|
V((n) => n >= 0),
|
|
2114
|
-
|
|
2114
|
+
B((n) => Array.from({ length: n }).map((o, r) => r))
|
|
2115
2115
|
),
|
|
2116
2116
|
t
|
|
2117
2117
|
), { topItemCount: e };
|
|
@@ -2125,45 +2125,45 @@ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2125
2125
|
{ deviation: t, deviationCommitted: e, scrollBy: n, scrollingInProgress: o, scrollTop: r },
|
|
2126
2126
|
{ isAtBottom: s, isScrolling: i, lastJumpDueToItemResize: l, scrollDirection: u },
|
|
2127
2127
|
{ listState: d },
|
|
2128
|
-
{ beforeUnshiftWith: f, gap:
|
|
2129
|
-
{ log:
|
|
2128
|
+
{ beforeUnshiftWith: f, gap: S, shiftWithOffset: h, sizes: m },
|
|
2129
|
+
{ log: T },
|
|
2130
2130
|
{ recalcInProgress: R }
|
|
2131
2131
|
]) => {
|
|
2132
2132
|
const g = yt(
|
|
2133
|
-
|
|
2133
|
+
v(
|
|
2134
2134
|
d,
|
|
2135
2135
|
$(l),
|
|
2136
2136
|
Ht(
|
|
2137
|
-
([, I, w,
|
|
2138
|
-
const
|
|
2137
|
+
([, I, w, k], [{ bottom: A, items: c, offsetBottom: p, totalCount: b }, L]) => {
|
|
2138
|
+
const O = A + p;
|
|
2139
2139
|
let F = 0;
|
|
2140
|
-
return w === b && I.length > 0 && c.length > 0 && (c[0].originalIndex === 0 && I[0].originalIndex === 0 || (F =
|
|
2140
|
+
return w === b && I.length > 0 && c.length > 0 && (c[0].originalIndex === 0 && I[0].originalIndex === 0 || (F = O - k, F !== 0 && (F += L))), [F, c, b, O];
|
|
2141
2141
|
},
|
|
2142
2142
|
[0, [], 0, 0]
|
|
2143
2143
|
),
|
|
2144
2144
|
V(([I]) => I !== 0),
|
|
2145
|
-
$(r, u, o, s,
|
|
2146
|
-
V(([, I, w,
|
|
2147
|
-
|
|
2145
|
+
$(r, u, o, s, T, R),
|
|
2146
|
+
V(([, I, w, k, , , A]) => !A && !k && I !== 0 && w === ce),
|
|
2147
|
+
B(([[I], , , , , w]) => (w("Upward scrolling compensation", { amount: I }, ht.DEBUG), I))
|
|
2148
2148
|
)
|
|
2149
2149
|
);
|
|
2150
|
-
function
|
|
2151
|
-
I > 0 ? (
|
|
2150
|
+
function x(I) {
|
|
2151
|
+
I > 0 ? (N(n, { behavior: "auto", top: -I }), N(t, 0)) : (N(t, 0), N(n, { behavior: "auto", top: -I }));
|
|
2152
2152
|
}
|
|
2153
|
-
X(
|
|
2154
|
-
|
|
2153
|
+
X(v(g, $(t, i)), ([I, w, k]) => {
|
|
2154
|
+
k && rr() ? N(t, w - I) : x(-I);
|
|
2155
2155
|
}), X(
|
|
2156
|
-
|
|
2156
|
+
v(
|
|
2157
2157
|
mt(gt(i, !1), t, R),
|
|
2158
|
-
V(([I, w,
|
|
2159
|
-
|
|
2158
|
+
V(([I, w, k]) => !I && !k && w !== 0),
|
|
2159
|
+
B(([I, w]) => w),
|
|
2160
2160
|
Wt(1)
|
|
2161
2161
|
),
|
|
2162
|
-
|
|
2162
|
+
x
|
|
2163
2163
|
), z(
|
|
2164
|
-
|
|
2164
|
+
v(
|
|
2165
2165
|
h,
|
|
2166
|
-
|
|
2166
|
+
B((I) => ({ top: -I }))
|
|
2167
2167
|
),
|
|
2168
2168
|
n
|
|
2169
2169
|
);
|
|
@@ -2172,39 +2172,39 @@ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2172
2172
|
if (a === null)
|
|
2173
2173
|
return;
|
|
2174
2174
|
const { offset: I } = a;
|
|
2175
|
-
a = null,
|
|
2176
|
-
|
|
2175
|
+
a = null, N(n, { top: I }), requestAnimationFrame(() => {
|
|
2176
|
+
N(t, 0), N(R, !1);
|
|
2177
2177
|
});
|
|
2178
2178
|
}
|
|
2179
2179
|
return X(e, (I) => {
|
|
2180
2180
|
a === null || !a.acknowledgeable || I === a.offset && C();
|
|
2181
2181
|
}), X(
|
|
2182
|
-
|
|
2182
|
+
v(
|
|
2183
2183
|
f,
|
|
2184
|
-
$(m,
|
|
2185
|
-
|
|
2186
|
-
function p(
|
|
2187
|
-
return
|
|
2184
|
+
$(m, S),
|
|
2185
|
+
B(([I, { groupIndices: w, lastSize: k, sizeTree: A }, c]) => {
|
|
2186
|
+
function p(P) {
|
|
2187
|
+
return P * (k + c);
|
|
2188
2188
|
}
|
|
2189
2189
|
if (w.length === 0)
|
|
2190
2190
|
return p(I);
|
|
2191
2191
|
let b = 0;
|
|
2192
|
-
const
|
|
2193
|
-
let
|
|
2194
|
-
for (;
|
|
2195
|
-
|
|
2196
|
-
let
|
|
2197
|
-
|
|
2192
|
+
const L = ie(A, 0);
|
|
2193
|
+
let O = 0, F = 0;
|
|
2194
|
+
for (; O < I; ) {
|
|
2195
|
+
O++, b += L;
|
|
2196
|
+
let P = w.length === F + 1 ? 1 / 0 : w[F + 1] - w[F] - 1;
|
|
2197
|
+
O + P > I && (b -= L, P = I - O + 1), O += P, b += p(P), F++;
|
|
2198
2198
|
}
|
|
2199
2199
|
return b;
|
|
2200
2200
|
})
|
|
2201
2201
|
),
|
|
2202
2202
|
(I) => {
|
|
2203
|
-
a = { acknowledgeable: tt(t) !== I, offset: I },
|
|
2203
|
+
a = { acknowledgeable: tt(t) !== I, offset: I }, N(t, I), requestAnimationFrame(C);
|
|
2204
2204
|
}
|
|
2205
2205
|
), { deviation: t };
|
|
2206
2206
|
},
|
|
2207
|
-
st(St, me, qt, zt,
|
|
2207
|
+
st(St, me, qt, zt, Gt, Ke)
|
|
2208
2208
|
), ir = Y(
|
|
2209
2209
|
([
|
|
2210
2210
|
t,
|
|
@@ -2241,7 +2241,7 @@ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2241
2241
|
Yo,
|
|
2242
2242
|
Xe,
|
|
2243
2243
|
no,
|
|
2244
|
-
|
|
2244
|
+
Gt,
|
|
2245
2245
|
eo
|
|
2246
2246
|
)
|
|
2247
2247
|
), so = Y(
|
|
@@ -2258,30 +2258,30 @@ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2258
2258
|
itemSize: u,
|
|
2259
2259
|
sizeRanges: d,
|
|
2260
2260
|
sizes: f,
|
|
2261
|
-
statefulTotalCount:
|
|
2261
|
+
statefulTotalCount: S,
|
|
2262
2262
|
totalCount: h,
|
|
2263
2263
|
trackItemSizes: m
|
|
2264
2264
|
},
|
|
2265
|
-
{ initialItemFinalLocationReached:
|
|
2266
|
-
|
|
2265
|
+
{ initialItemFinalLocationReached: T, initialTopMostItemIndex: R, scrolledToInitialItem: g },
|
|
2266
|
+
x,
|
|
2267
2267
|
a,
|
|
2268
2268
|
C,
|
|
2269
2269
|
I,
|
|
2270
2270
|
{ scrollToIndex: w },
|
|
2271
|
-
|
|
2272
|
-
{ topItemCount:
|
|
2271
|
+
k,
|
|
2272
|
+
{ topItemCount: A },
|
|
2273
2273
|
{ groupCounts: c },
|
|
2274
2274
|
p
|
|
2275
2275
|
]) => {
|
|
2276
|
-
const { listState: b, minOverscanItemCount:
|
|
2276
|
+
const { listState: b, minOverscanItemCount: L, topItemsIndexes: O, rangeChanged: F, ...P } = I;
|
|
2277
2277
|
return z(F, p.scrollSeekRangeChanged), z(
|
|
2278
|
-
|
|
2279
|
-
mt(p.windowViewportRect,
|
|
2278
|
+
v(
|
|
2279
|
+
mt(p.windowViewportRect, x.headerHeight, x.fixedHeaderHeight),
|
|
2280
2280
|
// Keep a measurement range active when a window-scrolling list starts below the viewport.
|
|
2281
2281
|
// One content pixel beyond the headers is enough to render the probe item and estimate the full list height.
|
|
2282
|
-
|
|
2282
|
+
B(([Z, W, ft]) => Math.max(W + ft + 1, Z.visibleHeight))
|
|
2283
2283
|
),
|
|
2284
|
-
|
|
2284
|
+
x.viewportHeight
|
|
2285
2285
|
), {
|
|
2286
2286
|
data: t,
|
|
2287
2287
|
defaultItemHeight: e,
|
|
@@ -2291,29 +2291,29 @@ const rr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2291
2291
|
gap: s,
|
|
2292
2292
|
groupCounts: c,
|
|
2293
2293
|
heightEstimates: l,
|
|
2294
|
-
initialItemFinalLocationReached:
|
|
2294
|
+
initialItemFinalLocationReached: T,
|
|
2295
2295
|
initialTopMostItemIndex: R,
|
|
2296
2296
|
scrolledToInitialItem: g,
|
|
2297
2297
|
sizeRanges: d,
|
|
2298
|
-
topItemCount:
|
|
2299
|
-
topItemsIndexes:
|
|
2298
|
+
topItemCount: A,
|
|
2299
|
+
topItemsIndexes: O,
|
|
2300
2300
|
// input
|
|
2301
2301
|
totalCount: h,
|
|
2302
2302
|
...C,
|
|
2303
2303
|
groupIndices: i,
|
|
2304
2304
|
itemSize: u,
|
|
2305
2305
|
listState: b,
|
|
2306
|
-
minOverscanItemCount:
|
|
2306
|
+
minOverscanItemCount: L,
|
|
2307
2307
|
scrollToIndex: w,
|
|
2308
2308
|
// output
|
|
2309
|
-
statefulTotalCount:
|
|
2309
|
+
statefulTotalCount: S,
|
|
2310
2310
|
trackItemSizes: m,
|
|
2311
2311
|
// exported from stateFlagsSystem
|
|
2312
2312
|
rangeChanged: F,
|
|
2313
|
-
...
|
|
2313
|
+
...P,
|
|
2314
2314
|
// the bag of IO from featureGroup1System
|
|
2315
2315
|
...p,
|
|
2316
|
-
...
|
|
2316
|
+
...x,
|
|
2317
2317
|
sizes: f,
|
|
2318
2318
|
...a
|
|
2319
2319
|
};
|
|
@@ -2342,56 +2342,56 @@ function lr(t, e) {
|
|
|
2342
2342
|
Object.hasOwn(o, i) || (n[i] = e[i]);
|
|
2343
2343
|
return n;
|
|
2344
2344
|
}
|
|
2345
|
-
const
|
|
2345
|
+
const Se = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
|
|
2346
2346
|
function Je(t, e, n) {
|
|
2347
2347
|
const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = E.createContext({});
|
|
2348
|
-
function u(
|
|
2349
|
-
|
|
2348
|
+
function u(x, a) {
|
|
2349
|
+
x.propsReady !== void 0 && N(x.propsReady, !1);
|
|
2350
2350
|
for (const C of o) {
|
|
2351
|
-
const I =
|
|
2352
|
-
|
|
2351
|
+
const I = x[e.required[C]];
|
|
2352
|
+
N(I, a[C]);
|
|
2353
2353
|
}
|
|
2354
2354
|
for (const C of r)
|
|
2355
2355
|
if (C in a) {
|
|
2356
|
-
const I =
|
|
2357
|
-
|
|
2356
|
+
const I = x[e.optional[C]];
|
|
2357
|
+
N(I, a[C]);
|
|
2358
2358
|
}
|
|
2359
|
-
|
|
2359
|
+
x.propsReady !== void 0 && N(x.propsReady, !0);
|
|
2360
2360
|
}
|
|
2361
|
-
function d(
|
|
2361
|
+
function d(x) {
|
|
2362
2362
|
return s.reduce((a, C) => (a[C] = (I) => {
|
|
2363
|
-
const w =
|
|
2364
|
-
|
|
2363
|
+
const w = x[e.methods[C]];
|
|
2364
|
+
N(w, I);
|
|
2365
2365
|
}, a), {});
|
|
2366
2366
|
}
|
|
2367
|
-
function f(
|
|
2368
|
-
return i.reduce((a, C) => (a[C] = wo(
|
|
2367
|
+
function f(x) {
|
|
2368
|
+
return i.reduce((a, C) => (a[C] = wo(x[e.events[C]]), a), {});
|
|
2369
2369
|
}
|
|
2370
|
-
const
|
|
2371
|
-
const { children: I, ...w } = a, [
|
|
2370
|
+
const S = E.forwardRef(function(a, C) {
|
|
2371
|
+
const { children: I, ...w } = a, [k] = E.useState(() => Re(Ro(t), (p) => {
|
|
2372
2372
|
u(p, w);
|
|
2373
|
-
})), [
|
|
2374
|
-
|
|
2373
|
+
})), [A] = E.useState(pn(f, k));
|
|
2374
|
+
Se(() => {
|
|
2375
2375
|
for (const p of i)
|
|
2376
|
-
p in w && X(
|
|
2376
|
+
p in w && X(A[p], w[p]);
|
|
2377
2377
|
return () => {
|
|
2378
|
-
Object.values(
|
|
2378
|
+
Object.values(A).map(De);
|
|
2379
2379
|
};
|
|
2380
|
-
}, [w,
|
|
2381
|
-
u(
|
|
2382
|
-
}), E.useImperativeHandle(C, mn(d(
|
|
2380
|
+
}, [w, A, k]), Se(() => {
|
|
2381
|
+
u(k, w);
|
|
2382
|
+
}), E.useImperativeHandle(C, mn(d(k)));
|
|
2383
2383
|
const c = n;
|
|
2384
|
-
return /* @__PURE__ */
|
|
2385
|
-
}), h = (
|
|
2384
|
+
return /* @__PURE__ */ G(l.Provider, { value: k, children: n === void 0 ? I : /* @__PURE__ */ G(c, { ...lr([...o, ...r, ...i], w), children: I }) });
|
|
2385
|
+
}), h = (x) => {
|
|
2386
2386
|
const a = E.useContext(l);
|
|
2387
2387
|
return E.useCallback(
|
|
2388
2388
|
(C) => {
|
|
2389
|
-
|
|
2389
|
+
N(a[x], C);
|
|
2390
2390
|
},
|
|
2391
|
-
[a,
|
|
2391
|
+
[a, x]
|
|
2392
2392
|
);
|
|
2393
|
-
}, m = (
|
|
2394
|
-
const C = E.useContext(l)[
|
|
2393
|
+
}, m = (x) => {
|
|
2394
|
+
const C = E.useContext(l)[x], I = E.useCallback(
|
|
2395
2395
|
(w) => X(C, w),
|
|
2396
2396
|
[C]
|
|
2397
2397
|
);
|
|
@@ -2400,26 +2400,26 @@ function Je(t, e, n) {
|
|
|
2400
2400
|
() => tt(C),
|
|
2401
2401
|
() => tt(C)
|
|
2402
2402
|
);
|
|
2403
|
-
},
|
|
2404
|
-
const C = E.useContext(l)[
|
|
2405
|
-
return
|
|
2406
|
-
() => X(C, (
|
|
2407
|
-
|
|
2403
|
+
}, T = (x) => {
|
|
2404
|
+
const C = E.useContext(l)[x], [I, w] = E.useState(pn(tt, C));
|
|
2405
|
+
return Se(
|
|
2406
|
+
() => X(C, (k) => {
|
|
2407
|
+
k !== I && w(mn(k));
|
|
2408
2408
|
}),
|
|
2409
2409
|
[C, I]
|
|
2410
2410
|
), I;
|
|
2411
|
-
}, R = parseInt(E.version, 10) >= 18 ? m :
|
|
2411
|
+
}, R = parseInt(E.version, 10) >= 18 ? m : T;
|
|
2412
2412
|
return {
|
|
2413
|
-
Component:
|
|
2414
|
-
useEmitter: (
|
|
2415
|
-
const I = E.useContext(l)[
|
|
2416
|
-
|
|
2413
|
+
Component: S,
|
|
2414
|
+
useEmitter: (x, a) => {
|
|
2415
|
+
const I = E.useContext(l)[x];
|
|
2416
|
+
Se(() => X(I, a), [a, I]);
|
|
2417
2417
|
},
|
|
2418
2418
|
useEmitterValue: R,
|
|
2419
2419
|
usePublisher: h
|
|
2420
2420
|
};
|
|
2421
2421
|
}
|
|
2422
|
-
const
|
|
2422
|
+
const pe = E.createContext(void 0), io = E.createContext(void 0), ze = "-webkit-sticky", Hn = "sticky", Qe = ro(() => {
|
|
2423
2423
|
if (typeof document > "u")
|
|
2424
2424
|
return Hn;
|
|
2425
2425
|
const t = document.createElement("div");
|
|
@@ -2434,21 +2434,21 @@ function cr(t) {
|
|
|
2434
2434
|
function lo(t, e, n, o = te, r, s) {
|
|
2435
2435
|
const i = E.useRef(null), l = E.useRef(null), u = E.useRef(null), d = E.useCallback(
|
|
2436
2436
|
(h) => {
|
|
2437
|
-
let m,
|
|
2437
|
+
let m, T, R;
|
|
2438
2438
|
const g = h.target;
|
|
2439
2439
|
if (cr(g) || Fe(g)) {
|
|
2440
2440
|
const a = Fe(g) ? g : g.defaultView;
|
|
2441
|
-
R = s === !0 ? Nt(a, a.scrollX) : a.scrollY, m = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight,
|
|
2441
|
+
R = s === !0 ? Nt(a, a.scrollX) : a.scrollY, m = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, T = s === !0 ? a.innerWidth : a.innerHeight;
|
|
2442
2442
|
} else
|
|
2443
|
-
R = s === !0 ? Nt(g, g.scrollLeft) : g.scrollTop, m = s === !0 ? g.scrollWidth : g.scrollHeight,
|
|
2444
|
-
const
|
|
2443
|
+
R = s === !0 ? Nt(g, g.scrollLeft) : g.scrollTop, m = s === !0 ? g.scrollWidth : g.scrollHeight, T = s === !0 ? g.offsetWidth : g.offsetHeight;
|
|
2444
|
+
const x = () => {
|
|
2445
2445
|
t({
|
|
2446
2446
|
scrollHeight: m,
|
|
2447
2447
|
scrollTop: Math.max(R, 0),
|
|
2448
|
-
viewportHeight:
|
|
2448
|
+
viewportHeight: T
|
|
2449
2449
|
});
|
|
2450
2450
|
};
|
|
2451
|
-
h.suppressFlushSync === !0 ?
|
|
2451
|
+
h.suppressFlushSync === !0 ? x() : Io.flushSync(x), l.current !== null && (R === l.current || R <= 0 || R === m - T) && (l.current = null, e(!0), u.current && (clearTimeout(u.current), u.current = null));
|
|
2452
2452
|
},
|
|
2453
2453
|
[t, e, s]
|
|
2454
2454
|
);
|
|
@@ -2462,23 +2462,23 @@ function lo(t, e, n, o = te, r, s) {
|
|
|
2462
2462
|
const m = i.current;
|
|
2463
2463
|
if (!m || (s === !0 ? "offsetWidth" in m && m.offsetWidth === 0 : "offsetHeight" in m && m.offsetHeight === 0))
|
|
2464
2464
|
return;
|
|
2465
|
-
const
|
|
2466
|
-
let R, g,
|
|
2465
|
+
const T = h.behavior === "smooth";
|
|
2466
|
+
let R, g, x;
|
|
2467
2467
|
Fe(m) ? (g = Math.max(
|
|
2468
2468
|
Bt(m.document.documentElement, s === !0 ? "width" : "height"),
|
|
2469
2469
|
s === !0 ? m.document.documentElement.scrollWidth : m.document.documentElement.scrollHeight
|
|
2470
|
-
), R = s === !0 ? m.innerWidth : m.innerHeight,
|
|
2470
|
+
), R = s === !0 ? m.innerWidth : m.innerHeight, x = s === !0 ? Nt(m, m.scrollX) : m.scrollY) : (g = m[s === !0 ? "scrollWidth" : "scrollHeight"], R = Bt(m, s === !0 ? "width" : "height"), x = s === !0 ? Nt(m, m.scrollLeft) : m.scrollTop);
|
|
2471
2471
|
const a = g - R;
|
|
2472
2472
|
if (h.top === void 0) {
|
|
2473
2473
|
m.scrollTo(h);
|
|
2474
2474
|
return;
|
|
2475
2475
|
}
|
|
2476
2476
|
const C = Math.ceil(Math.max(Math.min(a, h.top), 0));
|
|
2477
|
-
if (h.top = C, Jn(R, g) || C ===
|
|
2478
|
-
t({ scrollHeight: g, scrollTop:
|
|
2477
|
+
if (h.top = C, Jn(R, g) || C === x) {
|
|
2478
|
+
t({ scrollHeight: g, scrollTop: x, viewportHeight: R }), T && e(!0);
|
|
2479
2479
|
return;
|
|
2480
2480
|
}
|
|
2481
|
-
|
|
2481
|
+
T ? (l.current = C, u.current && clearTimeout(u.current), u.current = setTimeout(() => {
|
|
2482
2482
|
u.current = null, l.current = null, e(!0);
|
|
2483
2483
|
}, 1e3)) : l.current = null, s === !0 && (h = {
|
|
2484
2484
|
...h.behavior === void 0 ? {} : { behavior: h.behavior },
|
|
@@ -2500,9 +2500,9 @@ function tn(t) {
|
|
|
2500
2500
|
}
|
|
2501
2501
|
const ur = /* @__PURE__ */ Y(() => {
|
|
2502
2502
|
const t = y((l) => `Item ${l}`), e = y((l) => `Group ${l}`), n = y({}), o = y(tn), r = y("div"), s = y(te), i = (l, u = null) => gt(
|
|
2503
|
-
|
|
2503
|
+
v(
|
|
2504
2504
|
n,
|
|
2505
|
-
|
|
2505
|
+
B((d) => d[l]),
|
|
2506
2506
|
ot()
|
|
2507
2507
|
),
|
|
2508
2508
|
u
|
|
@@ -2527,26 +2527,26 @@ const ur = /* @__PURE__ */ Y(() => {
|
|
|
2527
2527
|
}), ar = /* @__PURE__ */ Y(
|
|
2528
2528
|
([t, e]) => ({ ...t, ...e }),
|
|
2529
2529
|
st(so, ur)
|
|
2530
|
-
), dr = ({ height: t }) => /* @__PURE__ */
|
|
2531
|
-
const n =
|
|
2530
|
+
), dr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), fr = { overflowAnchor: "none", position: Qe(), zIndex: 1 }, co = { overflowAnchor: "none" }, mr = { ...co, display: "inline-block", height: "100%" }, En = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2531
|
+
const n = _("listState"), o = wt("sizeRanges"), r = _("useWindowScroll"), s = _("customScrollParent"), i = wt("windowScrollContainerState"), l = wt("scrollContainerState"), u = s || r ? i : l, d = _("itemContent"), f = _("context"), S = _("groupContent"), h = _("trackItemSizes"), m = _("itemSize"), T = _("log"), R = wt("gap"), g = _("horizontalDirection"), { callbackRef: x } = An(
|
|
2532
2532
|
o,
|
|
2533
2533
|
m,
|
|
2534
2534
|
h,
|
|
2535
2535
|
e ? te : u,
|
|
2536
|
-
|
|
2536
|
+
T,
|
|
2537
2537
|
R,
|
|
2538
2538
|
s,
|
|
2539
2539
|
g,
|
|
2540
|
-
|
|
2540
|
+
_("skipAnimationFrameInResizeObserver")
|
|
2541
2541
|
), [a, C] = E.useState(0);
|
|
2542
2542
|
rn("deviation", (W) => {
|
|
2543
2543
|
a !== W && C(W);
|
|
2544
2544
|
});
|
|
2545
2545
|
const I = wt("deviationCommitted");
|
|
2546
|
-
|
|
2546
|
+
He(() => {
|
|
2547
2547
|
I(a);
|
|
2548
2548
|
}, [a, I]);
|
|
2549
|
-
const w =
|
|
2549
|
+
const w = _("EmptyPlaceholder"), k = _("ScrollSeekPlaceholder") ?? dr, A = _("ListComponent"), c = _("ItemComponent"), p = _("GroupComponent"), b = _("computeItemKey"), L = _("isSeeking"), O = _("groupIndices").length > 0, F = _("alignToBottom"), P = _("initialItemFinalLocationReached"), Z = e ? {} : {
|
|
2550
2550
|
boxSizing: "border-box",
|
|
2551
2551
|
...g ? {
|
|
2552
2552
|
display: "inline-block",
|
|
@@ -2560,21 +2560,21 @@ const ur = /* @__PURE__ */ Y(() => {
|
|
|
2560
2560
|
paddingBottom: n.offsetBottom,
|
|
2561
2561
|
paddingTop: n.offsetTop
|
|
2562
2562
|
},
|
|
2563
|
-
...
|
|
2563
|
+
...P ? {} : { visibility: "hidden" }
|
|
2564
2564
|
};
|
|
2565
|
-
return !e && n.totalCount === 0 && w !== null && w !== void 0 ? /* @__PURE__ */
|
|
2566
|
-
|
|
2565
|
+
return !e && n.totalCount === 0 && w !== null && w !== void 0 ? /* @__PURE__ */ G(w, { ...rt(w, f) }) : /* @__PURE__ */ G(
|
|
2566
|
+
A,
|
|
2567
2567
|
{
|
|
2568
|
-
...rt(
|
|
2568
|
+
...rt(A, f),
|
|
2569
2569
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
2570
|
-
ref:
|
|
2570
|
+
ref: x,
|
|
2571
2571
|
style: Z,
|
|
2572
2572
|
children: (e ? n.topItems : n.items).map((W) => {
|
|
2573
2573
|
const ft = W.originalIndex, K = b(ft + n.firstItemIndex, W.data, f);
|
|
2574
|
-
return
|
|
2575
|
-
|
|
2574
|
+
return L ? /* @__PURE__ */ Ut(
|
|
2575
|
+
k,
|
|
2576
2576
|
{
|
|
2577
|
-
...rt(
|
|
2577
|
+
...rt(k, f),
|
|
2578
2578
|
height: W.size,
|
|
2579
2579
|
index: W.index,
|
|
2580
2580
|
key: K,
|
|
@@ -2591,7 +2591,7 @@ const ur = /* @__PURE__ */ Y(() => {
|
|
|
2591
2591
|
key: K,
|
|
2592
2592
|
style: fr
|
|
2593
2593
|
},
|
|
2594
|
-
|
|
2594
|
+
S(W.index, f)
|
|
2595
2595
|
) : /* @__PURE__ */ Ut(
|
|
2596
2596
|
c,
|
|
2597
2597
|
{
|
|
@@ -2604,7 +2604,7 @@ const ur = /* @__PURE__ */ Y(() => {
|
|
|
2604
2604
|
key: K,
|
|
2605
2605
|
style: g ? mr : co
|
|
2606
2606
|
},
|
|
2607
|
-
|
|
2607
|
+
O ? d(W.index, W.groupIndex, W.data, f) : d(W.index, W.data, f)
|
|
2608
2608
|
);
|
|
2609
2609
|
})
|
|
2610
2610
|
}
|
|
@@ -2643,7 +2643,7 @@ function uo(t, e) {
|
|
|
2643
2643
|
return { item: typeof t == "string" ? void 0 : e };
|
|
2644
2644
|
}
|
|
2645
2645
|
const Ir = /* @__PURE__ */ E.memo(function() {
|
|
2646
|
-
const e =
|
|
2646
|
+
const e = _("HeaderComponent"), n = wt("headerHeight"), o = _("HeaderFooterTag"), r = Ot(
|
|
2647
2647
|
E.useMemo(
|
|
2648
2648
|
() => (i) => {
|
|
2649
2649
|
n(Bt(i, "height"));
|
|
@@ -2651,11 +2651,11 @@ const Ir = /* @__PURE__ */ E.memo(function() {
|
|
|
2651
2651
|
[n]
|
|
2652
2652
|
),
|
|
2653
2653
|
!0,
|
|
2654
|
-
|
|
2655
|
-
), s =
|
|
2656
|
-
return e != null ? /* @__PURE__ */
|
|
2654
|
+
_("skipAnimationFrameInResizeObserver")
|
|
2655
|
+
), s = _("context");
|
|
2656
|
+
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
|
|
2657
2657
|
}), Sr = /* @__PURE__ */ E.memo(function() {
|
|
2658
|
-
const e =
|
|
2658
|
+
const e = _("FooterComponent"), n = wt("footerHeight"), o = _("HeaderFooterTag"), r = Ot(
|
|
2659
2659
|
E.useMemo(
|
|
2660
2660
|
() => (i) => {
|
|
2661
2661
|
n(Bt(i, "height"));
|
|
@@ -2663,21 +2663,33 @@ const Ir = /* @__PURE__ */ E.memo(function() {
|
|
|
2663
2663
|
[n]
|
|
2664
2664
|
),
|
|
2665
2665
|
!0,
|
|
2666
|
-
|
|
2667
|
-
), s =
|
|
2668
|
-
return e != null ? /* @__PURE__ */
|
|
2666
|
+
_("skipAnimationFrameInResizeObserver")
|
|
2667
|
+
), s = _("context");
|
|
2668
|
+
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
|
|
2669
2669
|
});
|
|
2670
2670
|
function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2671
2671
|
return E.memo(function({ children: s, style: i, context: l, ...u }) {
|
|
2672
|
-
const d = n("scrollContainerState"), f = e("ScrollerComponent"),
|
|
2672
|
+
const d = n("scrollContainerState"), f = e("ScrollerComponent"), S = n("smoothScrollTargetReached"), h = e("scrollerRef"), m = e("horizontalDirection") || !1, { scrollByCallback: T, scrollerRef: R, scrollToCallback: g } = lo(
|
|
2673
2673
|
d,
|
|
2674
|
-
|
|
2674
|
+
S,
|
|
2675
2675
|
f,
|
|
2676
2676
|
h,
|
|
2677
2677
|
void 0,
|
|
2678
2678
|
m
|
|
2679
|
+
), x = E.useContext(pe), a = E.useRef(0), C = E.useCallback((k) => {
|
|
2680
|
+
a.current = k;
|
|
2681
|
+
}, []);
|
|
2682
|
+
t("totalListHeight", C);
|
|
2683
|
+
const I = E.useCallback(
|
|
2684
|
+
(k) => {
|
|
2685
|
+
if (!x || k.top === void 0)
|
|
2686
|
+
return;
|
|
2687
|
+
const A = Math.max(a.current, x.viewportHeight), c = Math.ceil(Math.max(Math.min(A - x.viewportHeight, k.top), 0));
|
|
2688
|
+
d({ scrollHeight: A, scrollTop: c, viewportHeight: x.viewportHeight }), k.behavior === "smooth" && S(!0);
|
|
2689
|
+
},
|
|
2690
|
+
[x, d, S]
|
|
2679
2691
|
);
|
|
2680
|
-
return t("scrollTo", g), t("scrollBy",
|
|
2692
|
+
return t("scrollTo", x ? I : g), t("scrollBy", T), /* @__PURE__ */ G(
|
|
2681
2693
|
f,
|
|
2682
2694
|
{
|
|
2683
2695
|
"data-testid": "virtuoso-scroller",
|
|
@@ -2694,16 +2706,16 @@ function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2694
2706
|
}
|
|
2695
2707
|
function on({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2696
2708
|
return E.memo(function({ children: s, style: i, context: l, ...u }) {
|
|
2697
|
-
const d = n("windowScrollContainerState"), f = e("ScrollerComponent"),
|
|
2709
|
+
const d = n("windowScrollContainerState"), f = e("ScrollerComponent"), S = n("smoothScrollTargetReached"), h = e("totalListHeight"), m = e("deviation"), T = e("customScrollParent"), R = E.useRef(null), g = e("scrollerRef"), { scrollByCallback: x, scrollerRef: a, scrollToCallback: C } = lo(
|
|
2698
2710
|
d,
|
|
2699
|
-
|
|
2711
|
+
S,
|
|
2700
2712
|
f,
|
|
2701
2713
|
g,
|
|
2702
|
-
|
|
2714
|
+
T
|
|
2703
2715
|
);
|
|
2704
|
-
return
|
|
2716
|
+
return He(() => (a.current = T ?? R.current?.ownerDocument.defaultView, () => {
|
|
2705
2717
|
a.current = null;
|
|
2706
|
-
}), [a,
|
|
2718
|
+
}), [a, T]), t("windowScrollTo", C), t("scrollBy", x), /* @__PURE__ */ G(
|
|
2707
2719
|
f,
|
|
2708
2720
|
{
|
|
2709
2721
|
ref: R,
|
|
@@ -2717,39 +2729,39 @@ function on({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2717
2729
|
});
|
|
2718
2730
|
}
|
|
2719
2731
|
const xr = ({ children: t }) => {
|
|
2720
|
-
const e = E.useContext(
|
|
2732
|
+
const e = E.useContext(pe), n = wt("viewportHeight"), o = wt("fixedItemHeight"), r = _("alignToBottom"), s = _("horizontalDirection"), i = E.useMemo(
|
|
2721
2733
|
() => re(n, (u) => Bt(u, s ? "width" : "height")),
|
|
2722
2734
|
[n, s]
|
|
2723
|
-
), l =
|
|
2735
|
+
), l = Ot(i, !0, _("skipAnimationFrameInResizeObserver"));
|
|
2724
2736
|
return E.useEffect(() => {
|
|
2725
2737
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2726
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2738
|
+
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: l, style: ke(r), children: t });
|
|
2727
2739
|
}, vr = ({ children: t }) => {
|
|
2728
|
-
const e = E.useContext(
|
|
2740
|
+
const e = E.useContext(pe), n = wt("windowViewportRect"), o = wt("fixedItemHeight"), r = _("customScrollParent"), s = _("useWindowScroll"), i = _("topListHeight"), l = Ue(
|
|
2729
2741
|
n,
|
|
2730
2742
|
r,
|
|
2731
|
-
|
|
2732
|
-
), u =
|
|
2743
|
+
_("skipAnimationFrameInResizeObserver")
|
|
2744
|
+
), u = _("alignToBottom");
|
|
2733
2745
|
return E.useEffect(() => {
|
|
2734
2746
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2735
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2747
|
+
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: l, style: en(u, s, i), children: t });
|
|
2736
2748
|
}, Tr = ({ children: t }) => {
|
|
2737
|
-
const e =
|
|
2738
|
-
return /* @__PURE__ */
|
|
2749
|
+
const e = _("TopItemListComponent") ?? "div", n = _("headerHeight"), o = { ...gr, marginTop: `${n}px` }, r = _("context");
|
|
2750
|
+
return /* @__PURE__ */ G(e, { style: o, ...rt(e, r), children: t });
|
|
2739
2751
|
}, Cr = /* @__PURE__ */ E.memo(function(e) {
|
|
2740
|
-
const n =
|
|
2752
|
+
const n = _("useWindowScroll"), o = _("topItemsIndexes").length > 0, r = _("customScrollParent"), s = _("context");
|
|
2741
2753
|
return /* @__PURE__ */ Kt(r || n ? yr : wr, { ...e, context: s, children: [
|
|
2742
|
-
o && /* @__PURE__ */
|
|
2754
|
+
o && /* @__PURE__ */ G(Tr, { children: /* @__PURE__ */ G(En, { showTopList: !0 }) }),
|
|
2743
2755
|
/* @__PURE__ */ Kt(r || n ? vr : xr, { children: [
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ G(Ir, {}),
|
|
2757
|
+
/* @__PURE__ */ G(En, {}),
|
|
2758
|
+
/* @__PURE__ */ G(Sr, {})
|
|
2747
2759
|
] })
|
|
2748
2760
|
] });
|
|
2749
2761
|
}), {
|
|
2750
2762
|
Component: ao,
|
|
2751
2763
|
useEmitter: rn,
|
|
2752
|
-
useEmitterValue:
|
|
2764
|
+
useEmitterValue: _,
|
|
2753
2765
|
usePublisher: wt
|
|
2754
2766
|
} = /* @__PURE__ */ Je(
|
|
2755
2767
|
ar,
|
|
@@ -2813,7 +2825,7 @@ const xr = ({ children: t }) => {
|
|
|
2813
2825
|
}
|
|
2814
2826
|
},
|
|
2815
2827
|
Cr
|
|
2816
|
-
), wr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue:
|
|
2828
|
+
), wr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: _, usePublisher: wt }), yr = /* @__PURE__ */ on({ useEmitter: rn, useEmitterValue: _, usePublisher: wt }), es = ao, ns = ao, br = /* @__PURE__ */ Y(() => {
|
|
2817
2829
|
const t = y((d) => /* @__PURE__ */ Kt("td", { children: [
|
|
2818
2830
|
"Item $",
|
|
2819
2831
|
d
|
|
@@ -2821,9 +2833,9 @@ const xr = ({ children: t }) => {
|
|
|
2821
2833
|
"Group ",
|
|
2822
2834
|
d
|
|
2823
2835
|
] })), o = y(null), r = y(null), s = y({}), i = y(tn), l = y(te), u = (d, f = null) => gt(
|
|
2824
|
-
|
|
2836
|
+
v(
|
|
2825
2837
|
s,
|
|
2826
|
-
|
|
2838
|
+
B((S) => S[d]),
|
|
2827
2839
|
ot()
|
|
2828
2840
|
),
|
|
2829
2841
|
f
|
|
@@ -2851,14 +2863,14 @@ const xr = ({ children: t }) => {
|
|
|
2851
2863
|
}), Rr = /* @__PURE__ */ Y(
|
|
2852
2864
|
([t, e]) => ({ ...t, ...e }),
|
|
2853
2865
|
st(so, br)
|
|
2854
|
-
), Hr = ({ height: t }) => /* @__PURE__ */
|
|
2855
|
-
const n = D("listState"), o = D("computeItemKey"), r = D("firstItemIndex"), s = D("context"), i = D("isSeeking"), l = D("fixedHeaderHeight"), u = D("groupIndices").length > 0, d = D("itemContent"), f = D("groupContent"),
|
|
2866
|
+
), Hr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Er = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), kr = { overflowAnchor: "none" }, kn = { position: Qe(), zIndex: 2, overflowAnchor: "none" }, Bn = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2867
|
+
const n = D("listState"), o = D("computeItemKey"), r = D("firstItemIndex"), s = D("context"), i = D("isSeeking"), l = D("fixedHeaderHeight"), u = D("groupIndices").length > 0, d = D("itemContent"), f = D("groupContent"), S = D("ScrollSeekPlaceholder") ?? Hr, h = D("GroupComponent"), m = D("TableRowComponent"), T = (e ? n.topItems : []).reduce((g, x, a) => (a === 0 ? g.push(x.size) : g.push(g[a - 1] + x.size), g), []);
|
|
2856
2868
|
return (e ? n.topItems : n.items).map((g) => {
|
|
2857
|
-
const
|
|
2869
|
+
const x = g.originalIndex, a = o(x + r, g.data, s), C = e ? x === 0 ? 0 : T[x - 1] : 0;
|
|
2858
2870
|
return i ? /* @__PURE__ */ Ut(
|
|
2859
|
-
|
|
2871
|
+
S,
|
|
2860
2872
|
{
|
|
2861
|
-
...rt(
|
|
2873
|
+
...rt(S, s),
|
|
2862
2874
|
height: g.size,
|
|
2863
2875
|
index: g.index,
|
|
2864
2876
|
key: a,
|
|
@@ -2868,7 +2880,7 @@ const xr = ({ children: t }) => {
|
|
|
2868
2880
|
h,
|
|
2869
2881
|
{
|
|
2870
2882
|
...rt(h, s),
|
|
2871
|
-
"data-index":
|
|
2883
|
+
"data-index": x,
|
|
2872
2884
|
"data-item-index": g.index,
|
|
2873
2885
|
"data-known-size": g.size,
|
|
2874
2886
|
key: a,
|
|
@@ -2883,7 +2895,7 @@ const xr = ({ children: t }) => {
|
|
|
2883
2895
|
{
|
|
2884
2896
|
...rt(m, s),
|
|
2885
2897
|
...uo(m, g.data),
|
|
2886
|
-
"data-index":
|
|
2898
|
+
"data-index": x,
|
|
2887
2899
|
"data-item-index": g.index,
|
|
2888
2900
|
"data-known-size": g.size,
|
|
2889
2901
|
"data-item-group-index": g.groupIndex,
|
|
@@ -2894,71 +2906,71 @@ const xr = ({ children: t }) => {
|
|
|
2894
2906
|
);
|
|
2895
2907
|
});
|
|
2896
2908
|
}), Br = /* @__PURE__ */ E.memo(function() {
|
|
2897
|
-
const e = D("listState"), n = D("topItemsIndexes").length > 0, o = bt("sizeRanges"), r = D("useWindowScroll"), s = D("customScrollParent"), i = bt("windowScrollContainerState"), l = bt("scrollContainerState"), u = s || r ? i : l, d = D("trackItemSizes"), f = D("itemSize"),
|
|
2909
|
+
const e = D("listState"), n = D("topItemsIndexes").length > 0, o = bt("sizeRanges"), r = D("useWindowScroll"), s = D("customScrollParent"), i = bt("windowScrollContainerState"), l = bt("scrollContainerState"), u = s || r ? i : l, d = D("trackItemSizes"), f = D("itemSize"), S = D("log"), { callbackRef: h, ref: m } = An(
|
|
2898
2910
|
o,
|
|
2899
2911
|
f,
|
|
2900
2912
|
d,
|
|
2901
2913
|
u,
|
|
2902
|
-
|
|
2914
|
+
S,
|
|
2903
2915
|
void 0,
|
|
2904
2916
|
s,
|
|
2905
2917
|
!1,
|
|
2906
2918
|
D("skipAnimationFrameInResizeObserver")
|
|
2907
|
-
), [
|
|
2908
|
-
sn("deviation", (
|
|
2909
|
-
|
|
2919
|
+
), [T, R] = E.useState(0);
|
|
2920
|
+
sn("deviation", (O) => {
|
|
2921
|
+
T !== O && (m.current.style.marginTop = `${O}px`, R(O));
|
|
2910
2922
|
});
|
|
2911
2923
|
const g = bt("deviationCommitted");
|
|
2912
|
-
|
|
2913
|
-
g(
|
|
2914
|
-
}, [
|
|
2915
|
-
const
|
|
2916
|
-
if (w === 0 &&
|
|
2917
|
-
return /* @__PURE__ */
|
|
2918
|
-
const
|
|
2919
|
-
return /* @__PURE__ */ Kt(C, { "data-testid": "virtuoso-item-list", ref: h, ...rt(C,
|
|
2924
|
+
He(() => {
|
|
2925
|
+
g(T);
|
|
2926
|
+
}, [T, g]);
|
|
2927
|
+
const x = D("EmptyPlaceholder"), a = D("FillerRow") ?? Er, C = D("TableBodyComponent"), I = D("paddingTopAddition"), w = D("statefulTotalCount"), k = D("context");
|
|
2928
|
+
if (w === 0 && x !== null && x !== void 0)
|
|
2929
|
+
return /* @__PURE__ */ G(x, { ...rt(x, k) });
|
|
2930
|
+
const A = (n ? e.topItems : []).reduce((O, F) => O + F.size, 0), c = e.offsetTop + I + T - A, p = e.offsetBottom, b = c > 0 ? /* @__PURE__ */ G(a, { context: k, height: c }, "padding-top") : null, L = p > 0 ? /* @__PURE__ */ G(a, { context: k, height: p }, "padding-bottom") : null;
|
|
2931
|
+
return /* @__PURE__ */ Kt(C, { "data-testid": "virtuoso-item-list", ref: h, ...rt(C, k), children: [
|
|
2920
2932
|
b,
|
|
2921
|
-
n && /* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
|
|
2933
|
+
n && /* @__PURE__ */ G(Bn, { showTopList: !0 }),
|
|
2934
|
+
/* @__PURE__ */ G(Bn, {}),
|
|
2935
|
+
L
|
|
2924
2936
|
] });
|
|
2925
|
-
}),
|
|
2926
|
-
const e = E.useContext(
|
|
2937
|
+
}), Lr = ({ children: t }) => {
|
|
2938
|
+
const e = E.useContext(pe), n = bt("viewportHeight"), o = bt("fixedItemHeight"), r = Ot(
|
|
2927
2939
|
E.useMemo(() => re(n, (s) => Bt(s, "height")), [n]),
|
|
2928
2940
|
!0,
|
|
2929
2941
|
D("skipAnimationFrameInResizeObserver")
|
|
2930
2942
|
);
|
|
2931
2943
|
return E.useEffect(() => {
|
|
2932
2944
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2933
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2934
|
-
},
|
|
2935
|
-
const e = E.useContext(
|
|
2945
|
+
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: r, style: ke(!1), children: t });
|
|
2946
|
+
}, Or = ({ children: t }) => {
|
|
2947
|
+
const e = E.useContext(pe), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r = D("customScrollParent"), s = D("useWindowScroll"), i = Ue(
|
|
2936
2948
|
n,
|
|
2937
2949
|
r,
|
|
2938
2950
|
D("skipAnimationFrameInResizeObserver")
|
|
2939
2951
|
);
|
|
2940
2952
|
return E.useEffect(() => {
|
|
2941
2953
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2942
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
2954
|
+
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: i, style: en(!1, s), children: t });
|
|
2943
2955
|
}, zr = /* @__PURE__ */ E.memo(function(e) {
|
|
2944
|
-
const n = D("useWindowScroll"), o = D("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = D("fixedHeaderContent"), l = D("fixedFooterContent"), u = D("context"), d =
|
|
2956
|
+
const n = D("useWindowScroll"), o = D("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = D("fixedHeaderContent"), l = D("fixedFooterContent"), u = D("context"), d = Ot(
|
|
2945
2957
|
E.useMemo(() => re(r, (a) => Bt(a, "height")), [r]),
|
|
2946
2958
|
!0,
|
|
2947
2959
|
D("skipAnimationFrameInResizeObserver")
|
|
2948
|
-
), f =
|
|
2960
|
+
), f = Ot(
|
|
2949
2961
|
E.useMemo(() => re(s, (a) => Bt(a, "height")), [s]),
|
|
2950
2962
|
!0,
|
|
2951
2963
|
D("skipAnimationFrameInResizeObserver")
|
|
2952
|
-
),
|
|
2953
|
-
|
|
2964
|
+
), S = o || n ? Vr : Fr, h = o || n ? Or : Lr, m = D("TableComponent"), T = D("TableHeadComponent"), R = D("TableFooterComponent"), g = i ? /* @__PURE__ */ G(
|
|
2965
|
+
T,
|
|
2954
2966
|
{
|
|
2955
2967
|
ref: d,
|
|
2956
2968
|
style: { position: "sticky", top: 0, zIndex: 2 },
|
|
2957
|
-
...rt(
|
|
2969
|
+
...rt(T, u),
|
|
2958
2970
|
children: i()
|
|
2959
2971
|
},
|
|
2960
2972
|
"TableHead"
|
|
2961
|
-
) : null,
|
|
2973
|
+
) : null, x = l ? /* @__PURE__ */ G(
|
|
2962
2974
|
R,
|
|
2963
2975
|
{
|
|
2964
2976
|
ref: f,
|
|
@@ -2968,10 +2980,10 @@ const xr = ({ children: t }) => {
|
|
|
2968
2980
|
},
|
|
2969
2981
|
"TableFoot"
|
|
2970
2982
|
) : null;
|
|
2971
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ G(S, { ...e, ...rt(S, u), children: /* @__PURE__ */ G(h, { children: /* @__PURE__ */ Kt(m, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...rt(m, u), children: [
|
|
2972
2984
|
g,
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
|
|
2985
|
+
/* @__PURE__ */ G(Br, {}, "TableBody"),
|
|
2986
|
+
x
|
|
2975
2987
|
] }) }) });
|
|
2976
2988
|
}), {
|
|
2977
2989
|
Component: fo,
|
|
@@ -3037,7 +3049,7 @@ const xr = ({ children: t }) => {
|
|
|
3037
3049
|
}
|
|
3038
3050
|
},
|
|
3039
3051
|
zr
|
|
3040
|
-
), Fr = /* @__PURE__ */ nn({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), Vr = /* @__PURE__ */ on({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), os = fo, rs = fo,
|
|
3052
|
+
), Fr = /* @__PURE__ */ nn({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), Vr = /* @__PURE__ */ on({ useEmitter: sn, useEmitterValue: D, usePublisher: bt }), os = fo, rs = fo, Ln = {
|
|
3041
3053
|
bottom: 0,
|
|
3042
3054
|
itemHeight: 0,
|
|
3043
3055
|
items: [],
|
|
@@ -3053,91 +3065,91 @@ const xr = ({ children: t }) => {
|
|
|
3053
3065
|
offsetBottom: 0,
|
|
3054
3066
|
offsetTop: 0,
|
|
3055
3067
|
top: 0
|
|
3056
|
-
}, { ceil:
|
|
3068
|
+
}, { ceil: On, floor: ye, max: oe, min: Ve, round: zn } = Math;
|
|
3057
3069
|
function Fn(t, e, n) {
|
|
3058
3070
|
return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
|
|
3059
3071
|
}
|
|
3060
|
-
function
|
|
3072
|
+
function Mr(t) {
|
|
3061
3073
|
return {
|
|
3062
3074
|
...Wr,
|
|
3063
3075
|
items: t
|
|
3064
3076
|
};
|
|
3065
3077
|
}
|
|
3066
|
-
function
|
|
3078
|
+
function xe(t, e) {
|
|
3067
3079
|
return t !== void 0 && t.width === e.width && t.height === e.height;
|
|
3068
3080
|
}
|
|
3069
|
-
function
|
|
3081
|
+
function Pr(t, e) {
|
|
3070
3082
|
return t !== void 0 && t.column === e.column && t.row === e.row;
|
|
3071
3083
|
}
|
|
3072
|
-
const
|
|
3084
|
+
const Gr = /* @__PURE__ */ Y(
|
|
3073
3085
|
([
|
|
3074
3086
|
{ increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
|
|
3075
|
-
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: u, scrollTop: d, smoothScrollTargetReached: f, viewportHeight:
|
|
3087
|
+
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: u, scrollTop: d, smoothScrollTargetReached: f, viewportHeight: S },
|
|
3076
3088
|
h,
|
|
3077
3089
|
m,
|
|
3078
|
-
{ didMount:
|
|
3079
|
-
{ customScrollParent: g, useWindowScroll:
|
|
3090
|
+
{ didMount: T, propsReady: R },
|
|
3091
|
+
{ customScrollParent: g, useWindowScroll: x, windowScrollContainerState: a, windowScrollTo: C, windowViewportRect: I },
|
|
3080
3092
|
w
|
|
3081
3093
|
]) => {
|
|
3082
|
-
const
|
|
3094
|
+
const k = y(0), A = y(0), c = y(Ln), p = y({ height: 0, width: 0 }), b = y({ height: 0, width: 0 }), L = U(), O = U(), F = y(0), P = y(null), Z = y({ column: 0, row: 0 }), W = U(), ft = U(), K = y(!1), lt = y(0), ct = y(!0), It = y(!1), Ft = y(!1);
|
|
3083
3095
|
X(
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
$(
|
|
3096
|
+
v(
|
|
3097
|
+
T,
|
|
3098
|
+
$(lt),
|
|
3087
3099
|
V(([H, j]) => !Ae(j))
|
|
3088
3100
|
),
|
|
3089
3101
|
() => {
|
|
3090
|
-
|
|
3102
|
+
N(ct, !1);
|
|
3091
3103
|
}
|
|
3092
3104
|
), X(
|
|
3093
|
-
|
|
3094
|
-
mt(
|
|
3095
|
-
V(([H, j, q, Q, ,
|
|
3105
|
+
v(
|
|
3106
|
+
mt(T, ct, b, p, lt, It),
|
|
3107
|
+
V(([H, j, q, Q, , ut]) => H && !j && q.height !== 0 && Q.height !== 0 && !ut)
|
|
3096
3108
|
),
|
|
3097
3109
|
([, , , , H]) => {
|
|
3098
3110
|
if (H === void 0) {
|
|
3099
|
-
|
|
3111
|
+
N(ct, !0);
|
|
3100
3112
|
return;
|
|
3101
3113
|
}
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
}), Et(
|
|
3105
|
-
|
|
3114
|
+
N(It, !0), qe(1, () => {
|
|
3115
|
+
N(L, H);
|
|
3116
|
+
}), Et(v(d), () => {
|
|
3117
|
+
N(e, [0, 0]), N(ct, !0);
|
|
3106
3118
|
});
|
|
3107
3119
|
}
|
|
3108
3120
|
), z(
|
|
3109
|
-
|
|
3121
|
+
v(
|
|
3110
3122
|
ft,
|
|
3111
3123
|
V((H) => H != null && H.scrollTop > 0),
|
|
3112
3124
|
Ct(0)
|
|
3113
3125
|
),
|
|
3114
|
-
|
|
3126
|
+
A
|
|
3115
3127
|
), X(
|
|
3116
|
-
|
|
3117
|
-
|
|
3128
|
+
v(
|
|
3129
|
+
T,
|
|
3118
3130
|
$(ft),
|
|
3119
3131
|
V(([, H]) => H != null)
|
|
3120
3132
|
),
|
|
3121
3133
|
([, H]) => {
|
|
3122
|
-
H && (
|
|
3123
|
-
|
|
3124
|
-
}),
|
|
3134
|
+
H && (N(p, H.viewport), N(b, H.item), N(Z, H.gap), H.scrollTop > 0 && (N(K, !0), Et(v(d, jt(1)), (j) => {
|
|
3135
|
+
N(K, !1);
|
|
3136
|
+
}), N(u, { top: H.scrollTop })));
|
|
3125
3137
|
}
|
|
3126
3138
|
), z(
|
|
3127
|
-
|
|
3139
|
+
v(
|
|
3128
3140
|
p,
|
|
3129
|
-
|
|
3141
|
+
B(({ height: H }) => H)
|
|
3130
3142
|
),
|
|
3131
|
-
|
|
3143
|
+
S
|
|
3132
3144
|
), z(
|
|
3133
|
-
|
|
3145
|
+
v(
|
|
3134
3146
|
mt(
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3147
|
+
M(p, xe),
|
|
3148
|
+
M(b, xe),
|
|
3149
|
+
M(Z, (H, j) => H !== void 0 && H.column === j.column && H.row === j.row),
|
|
3150
|
+
M(d)
|
|
3139
3151
|
),
|
|
3140
|
-
|
|
3152
|
+
B(([H, j, q, Q]) => ({
|
|
3141
3153
|
gap: q,
|
|
3142
3154
|
item: j,
|
|
3143
3155
|
scrollTop: Q,
|
|
@@ -3146,63 +3158,63 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3146
3158
|
),
|
|
3147
3159
|
W
|
|
3148
3160
|
), z(
|
|
3149
|
-
|
|
3161
|
+
v(
|
|
3150
3162
|
mt(
|
|
3151
|
-
|
|
3163
|
+
M(k),
|
|
3152
3164
|
o,
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
P
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3165
|
+
M(Z, Pr),
|
|
3166
|
+
M(b, xe),
|
|
3167
|
+
M(p, xe),
|
|
3168
|
+
M(P),
|
|
3169
|
+
M(A),
|
|
3170
|
+
M(K),
|
|
3171
|
+
M(ct),
|
|
3172
|
+
M(lt)
|
|
3161
3173
|
),
|
|
3162
3174
|
V(([, , , , , , , H]) => !H),
|
|
3163
|
-
|
|
3175
|
+
B(
|
|
3164
3176
|
([
|
|
3165
3177
|
H,
|
|
3166
3178
|
[j, q],
|
|
3167
3179
|
Q,
|
|
3168
|
-
|
|
3180
|
+
ut,
|
|
3169
3181
|
it,
|
|
3170
3182
|
et,
|
|
3171
3183
|
dt,
|
|
3172
3184
|
,
|
|
3173
3185
|
Tt,
|
|
3174
|
-
|
|
3186
|
+
at
|
|
3175
3187
|
]) => {
|
|
3176
|
-
const { column:
|
|
3188
|
+
const { column: Mt, row: ee } = Q, { height: ge, width: Be } = ut, { width: ln } = it;
|
|
3177
3189
|
if (dt === 0 && (H === 0 || ln === 0))
|
|
3178
|
-
return
|
|
3190
|
+
return Ln;
|
|
3179
3191
|
if (Be === 0) {
|
|
3180
|
-
const fn = Ye(
|
|
3181
|
-
return
|
|
3192
|
+
const fn = Ye(at, H), go = fn + Math.max(dt - 1, 0);
|
|
3193
|
+
return Mr(Fn(fn, go, et));
|
|
3182
3194
|
}
|
|
3183
|
-
const
|
|
3195
|
+
const Ie = mo(ln, Be, Mt);
|
|
3184
3196
|
let Zt, _t;
|
|
3185
|
-
Tt ? j === 0 && q === 0 && dt > 0 ? (Zt = 0, _t = dt - 1) : (Zt =
|
|
3186
|
-
const cn = Fn(Zt, _t, et), { bottom: un, top: an } = Vn(it, Q,
|
|
3187
|
-
return { bottom: un, itemHeight:
|
|
3197
|
+
Tt ? j === 0 && q === 0 && dt > 0 ? (Zt = 0, _t = dt - 1) : (Zt = Ie * ye((j + ee) / (ge + ee)), _t = Ie * On((q + ee) / (ge + ee)) - 1, _t = Ve(H - 1, oe(_t, Ie - 1)), Zt = Ve(_t, oe(0, Zt))) : (Zt = 0, _t = -1);
|
|
3198
|
+
const cn = Fn(Zt, _t, et), { bottom: un, top: an } = Vn(it, Q, ut, cn), dn = On(H / Ie), ho = dn * ge + (dn - 1) * ee - un;
|
|
3199
|
+
return { bottom: un, itemHeight: ge, items: cn, itemWidth: Be, offsetBottom: ho, offsetTop: an, top: an };
|
|
3188
3200
|
}
|
|
3189
3201
|
)
|
|
3190
3202
|
),
|
|
3191
3203
|
c
|
|
3192
3204
|
), z(
|
|
3193
|
-
|
|
3194
|
-
|
|
3205
|
+
v(
|
|
3206
|
+
P,
|
|
3195
3207
|
V((H) => H !== null),
|
|
3196
|
-
|
|
3208
|
+
B((H) => H.length)
|
|
3197
3209
|
),
|
|
3198
|
-
|
|
3210
|
+
k
|
|
3199
3211
|
), z(
|
|
3200
|
-
|
|
3212
|
+
v(
|
|
3201
3213
|
mt(p, b, c, Z),
|
|
3202
3214
|
V(([H, j, { items: q }]) => q.length > 0 && j.height !== 0 && H.height !== 0),
|
|
3203
|
-
|
|
3204
|
-
const { bottom:
|
|
3205
|
-
return [it,
|
|
3215
|
+
B(([H, j, { items: q }, Q]) => {
|
|
3216
|
+
const { bottom: ut, top: it } = Vn(H, Q, j, q);
|
|
3217
|
+
return [it, ut];
|
|
3206
3218
|
}),
|
|
3207
3219
|
ot(Jt)
|
|
3208
3220
|
),
|
|
@@ -3210,46 +3222,46 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3210
3222
|
);
|
|
3211
3223
|
const vt = y(!1);
|
|
3212
3224
|
z(
|
|
3213
|
-
|
|
3225
|
+
v(
|
|
3214
3226
|
d,
|
|
3215
3227
|
$(vt),
|
|
3216
|
-
|
|
3228
|
+
B(([H, j]) => j || H !== 0)
|
|
3217
3229
|
),
|
|
3218
3230
|
vt
|
|
3219
3231
|
);
|
|
3220
|
-
const
|
|
3221
|
-
|
|
3222
|
-
mt(c,
|
|
3232
|
+
const Lt = yt(
|
|
3233
|
+
v(
|
|
3234
|
+
mt(c, k),
|
|
3223
3235
|
// A data publish rebuilds gridState before it updates totalCount. Skipping that intermediate step
|
|
3224
3236
|
// avoids reporting the previous end index against the new data.
|
|
3225
3237
|
V(([{ items: H }, j]) => {
|
|
3226
|
-
const q = tt(
|
|
3238
|
+
const q = tt(P);
|
|
3227
3239
|
return H.length > 0 && (q === null || q.length === j);
|
|
3228
3240
|
}),
|
|
3229
3241
|
$(vt),
|
|
3230
3242
|
V(([[H, j], q]) => {
|
|
3231
|
-
const
|
|
3232
|
-
return (q || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === j) &&
|
|
3243
|
+
const ut = H.items[H.items.length - 1].index === j - 1;
|
|
3244
|
+
return (q || H.bottom > 0 && H.itemHeight > 0 && H.offsetBottom === 0 && H.items.length === j) && ut;
|
|
3233
3245
|
}),
|
|
3234
3246
|
// Keying on the data array lets replaced data with a previously reported length fire again, matching
|
|
3235
3247
|
// the list. withLatestFrom(data) subscribes after gridState and would still hold the previous array.
|
|
3236
|
-
|
|
3248
|
+
B(([[, H]]) => [H - 1, tt(P)]),
|
|
3237
3249
|
ot(Jt),
|
|
3238
|
-
|
|
3250
|
+
B(([H]) => H)
|
|
3239
3251
|
)
|
|
3240
|
-
),
|
|
3241
|
-
|
|
3242
|
-
|
|
3252
|
+
), he = yt(
|
|
3253
|
+
v(
|
|
3254
|
+
M(c),
|
|
3243
3255
|
V(({ items: H }) => H.length > 0 && H[0].index === 0),
|
|
3244
3256
|
Ct(0),
|
|
3245
3257
|
ot()
|
|
3246
3258
|
)
|
|
3247
3259
|
), Yt = yt(
|
|
3248
|
-
|
|
3249
|
-
|
|
3260
|
+
v(
|
|
3261
|
+
M(c),
|
|
3250
3262
|
$(K),
|
|
3251
3263
|
V(([{ items: H }, j]) => H.length > 0 && !j),
|
|
3252
|
-
|
|
3264
|
+
B(([{ items: H }]) => ({
|
|
3253
3265
|
endIndex: H[H.length - 1].index,
|
|
3254
3266
|
startIndex: H[0].index
|
|
3255
3267
|
})),
|
|
@@ -3258,54 +3270,54 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3258
3270
|
)
|
|
3259
3271
|
);
|
|
3260
3272
|
z(Yt, m.scrollSeekRangeChanged), z(
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
$(p, b,
|
|
3264
|
-
|
|
3273
|
+
v(
|
|
3274
|
+
L,
|
|
3275
|
+
$(p, b, k, Z),
|
|
3276
|
+
B(([H, j, q, Q, ut]) => {
|
|
3265
3277
|
const it = Xn(H), { align: et, behavior: dt, offset: Tt } = it;
|
|
3266
|
-
let
|
|
3267
|
-
|
|
3268
|
-
let
|
|
3269
|
-
return et === "end" ?
|
|
3278
|
+
let at = it.index;
|
|
3279
|
+
at === "LAST" && (at = Q - 1), at = oe(0, Ve(Q - 1, at));
|
|
3280
|
+
let Mt = _e(j, ut, q, at);
|
|
3281
|
+
return et === "end" ? Mt = zn(Mt - j.height + q.height) : et === "center" && (Mt = zn(Mt - j.height / 2 + q.height / 2)), Tt !== void 0 && Tt !== 0 && (Mt += Tt), { behavior: dt, top: Mt };
|
|
3270
3282
|
})
|
|
3271
3283
|
),
|
|
3272
3284
|
u
|
|
3273
3285
|
);
|
|
3274
3286
|
const Vt = gt(
|
|
3275
|
-
|
|
3287
|
+
v(
|
|
3276
3288
|
c,
|
|
3277
|
-
|
|
3289
|
+
B((H) => H.offsetBottom + H.bottom)
|
|
3278
3290
|
),
|
|
3279
3291
|
0
|
|
3280
3292
|
);
|
|
3281
3293
|
return z(
|
|
3282
|
-
|
|
3294
|
+
v(
|
|
3283
3295
|
I,
|
|
3284
|
-
|
|
3296
|
+
B((H) => ({ height: H.visibleHeight, width: H.visibleWidth }))
|
|
3285
3297
|
),
|
|
3286
3298
|
p
|
|
3287
3299
|
), {
|
|
3288
3300
|
customScrollParent: g,
|
|
3289
3301
|
// input
|
|
3290
|
-
data:
|
|
3302
|
+
data: P,
|
|
3291
3303
|
deviation: F,
|
|
3292
3304
|
footerHeight: r,
|
|
3293
3305
|
gap: Z,
|
|
3294
3306
|
headerHeight: s,
|
|
3295
3307
|
increaseViewportBy: t,
|
|
3296
|
-
initialItemCount:
|
|
3308
|
+
initialItemCount: A,
|
|
3297
3309
|
itemDimensions: b,
|
|
3298
3310
|
overscan: n,
|
|
3299
3311
|
restoreStateFrom: ft,
|
|
3300
3312
|
scrollBy: i,
|
|
3301
3313
|
scrollContainerState: l,
|
|
3302
|
-
scrollHeight:
|
|
3314
|
+
scrollHeight: O,
|
|
3303
3315
|
scrollTo: u,
|
|
3304
|
-
scrollToIndex:
|
|
3316
|
+
scrollToIndex: L,
|
|
3305
3317
|
scrollTop: d,
|
|
3306
3318
|
smoothScrollTargetReached: f,
|
|
3307
|
-
totalCount:
|
|
3308
|
-
useWindowScroll:
|
|
3319
|
+
totalCount: k,
|
|
3320
|
+
useWindowScroll: x,
|
|
3309
3321
|
viewportDimensions: p,
|
|
3310
3322
|
windowScrollContainerState: a,
|
|
3311
3323
|
windowScrollTo: C,
|
|
@@ -3314,22 +3326,22 @@ const Mr = /* @__PURE__ */ Y(
|
|
|
3314
3326
|
// output
|
|
3315
3327
|
gridState: c,
|
|
3316
3328
|
horizontalDirection: Ft,
|
|
3317
|
-
initialTopMostItemIndex:
|
|
3329
|
+
initialTopMostItemIndex: lt,
|
|
3318
3330
|
totalListHeight: Vt,
|
|
3319
3331
|
...h,
|
|
3320
|
-
endReached:
|
|
3332
|
+
endReached: Lt,
|
|
3321
3333
|
propsReady: R,
|
|
3322
3334
|
rangeChanged: Yt,
|
|
3323
|
-
startReached:
|
|
3335
|
+
startReached: he,
|
|
3324
3336
|
stateChanged: W,
|
|
3325
3337
|
stateRestoreInProgress: K,
|
|
3326
3338
|
...w
|
|
3327
3339
|
};
|
|
3328
3340
|
},
|
|
3329
|
-
st(Ze, St, me, oo, At, Xe,
|
|
3341
|
+
st(Ze, St, me, oo, At, Xe, Gt)
|
|
3330
3342
|
);
|
|
3331
3343
|
function mo(t, e, n) {
|
|
3332
|
-
return oe(1,
|
|
3344
|
+
return oe(1, ye((t + n) / (ye(e) + n)));
|
|
3333
3345
|
}
|
|
3334
3346
|
function Vn(t, e, n, o) {
|
|
3335
3347
|
const { height: r } = n;
|
|
@@ -3339,19 +3351,19 @@ function Vn(t, e, n, o) {
|
|
|
3339
3351
|
return { bottom: _e(t, e, n, o[o.length - 1].index) + r, top: s };
|
|
3340
3352
|
}
|
|
3341
3353
|
function _e(t, e, n, o) {
|
|
3342
|
-
const r = mo(t.width, n.width, e.column), s =
|
|
3354
|
+
const r = mo(t.width, n.width, e.column), s = ye(o / r), i = s * n.height + oe(0, s - 1) * e.row;
|
|
3343
3355
|
return i > 0 ? i + e.row : i;
|
|
3344
3356
|
}
|
|
3345
3357
|
const Ar = /* @__PURE__ */ Y(() => {
|
|
3346
|
-
const t = y((
|
|
3347
|
-
|
|
3358
|
+
const t = y((S) => `Item ${S}`), e = y({}), n = y(null), o = y("virtuoso-grid-item"), r = y("virtuoso-grid-list"), s = y(tn), i = y("div"), l = y(te), u = (S, h = null) => gt(
|
|
3359
|
+
v(
|
|
3348
3360
|
e,
|
|
3349
|
-
|
|
3361
|
+
B((m) => m[S]),
|
|
3350
3362
|
ot()
|
|
3351
3363
|
),
|
|
3352
3364
|
h
|
|
3353
3365
|
), d = y(!1), f = y(!1);
|
|
3354
|
-
return z(
|
|
3366
|
+
return z(M(f), d), {
|
|
3355
3367
|
components: e,
|
|
3356
3368
|
computeItemKey: s,
|
|
3357
3369
|
context: n,
|
|
@@ -3371,44 +3383,44 @@ const Ar = /* @__PURE__ */ Y(() => {
|
|
|
3371
3383
|
};
|
|
3372
3384
|
}), _r = /* @__PURE__ */ Y(
|
|
3373
3385
|
([t, e]) => ({ ...t, ...e }),
|
|
3374
|
-
st(
|
|
3386
|
+
st(Gr, Ar)
|
|
3375
3387
|
), Nr = /* @__PURE__ */ E.memo(function() {
|
|
3376
|
-
const e = nt("gridState"), n = nt("listClassName"), o = nt("itemClassName"), r = nt("itemContent"), s = nt("computeItemKey"), i = nt("isSeeking"), l = Rt("scrollHeight"), u = nt("ItemComponent"), d = nt("ListComponent"), f = nt("ScrollSeekPlaceholder"),
|
|
3388
|
+
const e = nt("gridState"), n = nt("listClassName"), o = nt("itemClassName"), r = nt("itemContent"), s = nt("computeItemKey"), i = nt("isSeeking"), l = Rt("scrollHeight"), u = nt("ItemComponent"), d = nt("ListComponent"), f = nt("ScrollSeekPlaceholder"), S = nt("context"), h = Rt("itemDimensions"), m = Rt("gap"), T = nt("log"), R = nt("stateRestoreInProgress"), g = Rt("reportReadyState"), x = Ot(
|
|
3377
3389
|
E.useMemo(
|
|
3378
3390
|
() => (a) => {
|
|
3379
3391
|
const C = a.parentElement.parentElement.scrollHeight;
|
|
3380
3392
|
l(C);
|
|
3381
3393
|
const I = a.firstChild;
|
|
3382
3394
|
if (I !== null) {
|
|
3383
|
-
const { height: w, width:
|
|
3384
|
-
h({ height: w, width:
|
|
3395
|
+
const { height: w, width: k } = I.getBoundingClientRect();
|
|
3396
|
+
h({ height: w, width: k });
|
|
3385
3397
|
}
|
|
3386
3398
|
m({
|
|
3387
|
-
column: Wn("column-gap", getComputedStyle(a).columnGap,
|
|
3388
|
-
row: Wn("row-gap", getComputedStyle(a).rowGap,
|
|
3399
|
+
column: Wn("column-gap", getComputedStyle(a).columnGap, T),
|
|
3400
|
+
row: Wn("row-gap", getComputedStyle(a).rowGap, T)
|
|
3389
3401
|
});
|
|
3390
3402
|
},
|
|
3391
|
-
[l, h, m,
|
|
3403
|
+
[l, h, m, T]
|
|
3392
3404
|
),
|
|
3393
3405
|
!0,
|
|
3394
3406
|
!1
|
|
3395
3407
|
);
|
|
3396
|
-
return
|
|
3408
|
+
return He(() => {
|
|
3397
3409
|
e.itemHeight > 0 && e.itemWidth > 0 && g(!0);
|
|
3398
|
-
}, [e]), R ? null : /* @__PURE__ */
|
|
3410
|
+
}, [e]), R ? null : /* @__PURE__ */ G(
|
|
3399
3411
|
d,
|
|
3400
3412
|
{
|
|
3401
3413
|
className: n,
|
|
3402
|
-
ref:
|
|
3403
|
-
...rt(d,
|
|
3414
|
+
ref: x,
|
|
3415
|
+
...rt(d, S),
|
|
3404
3416
|
"data-testid": "virtuoso-item-list",
|
|
3405
3417
|
style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
|
|
3406
3418
|
children: e.items.map((a) => {
|
|
3407
|
-
const C = s(a.index, a.data,
|
|
3408
|
-
return i ? /* @__PURE__ */
|
|
3419
|
+
const C = s(a.index, a.data, S);
|
|
3420
|
+
return i ? /* @__PURE__ */ G(
|
|
3409
3421
|
f,
|
|
3410
3422
|
{
|
|
3411
|
-
...rt(f,
|
|
3423
|
+
...rt(f, S),
|
|
3412
3424
|
height: e.itemHeight,
|
|
3413
3425
|
index: a.index,
|
|
3414
3426
|
width: e.itemWidth
|
|
@@ -3417,18 +3429,18 @@ const Ar = /* @__PURE__ */ Y(() => {
|
|
|
3417
3429
|
) : /* @__PURE__ */ Ut(
|
|
3418
3430
|
u,
|
|
3419
3431
|
{
|
|
3420
|
-
...rt(u,
|
|
3432
|
+
...rt(u, S),
|
|
3421
3433
|
className: o,
|
|
3422
3434
|
"data-index": a.index,
|
|
3423
3435
|
key: C
|
|
3424
3436
|
},
|
|
3425
|
-
r(a.index, a.data,
|
|
3437
|
+
r(a.index, a.data, S)
|
|
3426
3438
|
);
|
|
3427
3439
|
})
|
|
3428
3440
|
}
|
|
3429
3441
|
);
|
|
3430
3442
|
}), Dr = E.memo(function() {
|
|
3431
|
-
const e = nt("HeaderComponent"), n = Rt("headerHeight"), o = nt("headerFooterTag"), r =
|
|
3443
|
+
const e = nt("HeaderComponent"), n = Rt("headerHeight"), o = nt("headerFooterTag"), r = Ot(
|
|
3432
3444
|
E.useMemo(
|
|
3433
3445
|
() => (i) => {
|
|
3434
3446
|
n(Bt(i, "height"));
|
|
@@ -3438,9 +3450,9 @@ const Ar = /* @__PURE__ */ Y(() => {
|
|
|
3438
3450
|
!0,
|
|
3439
3451
|
!1
|
|
3440
3452
|
), s = nt("context");
|
|
3441
|
-
return e != null ? /* @__PURE__ */
|
|
3453
|
+
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
|
|
3442
3454
|
}), $r = E.memo(function() {
|
|
3443
|
-
const e = nt("FooterComponent"), n = Rt("footerHeight"), o = nt("headerFooterTag"), r =
|
|
3455
|
+
const e = nt("FooterComponent"), n = Rt("footerHeight"), o = nt("headerFooterTag"), r = Ot(
|
|
3444
3456
|
E.useMemo(
|
|
3445
3457
|
() => (i) => {
|
|
3446
3458
|
n(Bt(i, "height"));
|
|
@@ -3450,9 +3462,9 @@ const Ar = /* @__PURE__ */ Y(() => {
|
|
|
3450
3462
|
!0,
|
|
3451
3463
|
!1
|
|
3452
3464
|
), s = nt("context");
|
|
3453
|
-
return e != null ? /* @__PURE__ */
|
|
3465
|
+
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...rt(e, s) }) }) : null;
|
|
3454
3466
|
}), Ur = ({ children: t }) => {
|
|
3455
|
-
const e = E.useContext(io), n = Rt("itemDimensions"), o = Rt("viewportDimensions"), r =
|
|
3467
|
+
const e = E.useContext(io), n = Rt("itemDimensions"), o = Rt("viewportDimensions"), r = Ot(
|
|
3456
3468
|
E.useMemo(
|
|
3457
3469
|
() => (s) => {
|
|
3458
3470
|
o(s.getBoundingClientRect());
|
|
@@ -3464,18 +3476,18 @@ const Ar = /* @__PURE__ */ Y(() => {
|
|
|
3464
3476
|
);
|
|
3465
3477
|
return E.useEffect(() => {
|
|
3466
3478
|
e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
|
|
3467
|
-
}, [e, o, n]), /* @__PURE__ */
|
|
3479
|
+
}, [e, o, n]), /* @__PURE__ */ G("div", { ref: r, style: ke(!1), children: t });
|
|
3468
3480
|
}, Kr = ({ children: t }) => {
|
|
3469
3481
|
const e = E.useContext(io), n = Rt("windowViewportRect"), o = Rt("itemDimensions"), r = nt("customScrollParent"), s = nt("useWindowScroll"), i = Ue(n, r, !1);
|
|
3470
3482
|
return E.useEffect(() => {
|
|
3471
3483
|
e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
|
|
3472
|
-
}, [e, n, o]), /* @__PURE__ */
|
|
3484
|
+
}, [e, n, o]), /* @__PURE__ */ G("div", { ref: i, style: en(!1, s), children: t });
|
|
3473
3485
|
}, jr = /* @__PURE__ */ E.memo(function({ ...e }) {
|
|
3474
3486
|
const n = nt("useWindowScroll"), o = nt("customScrollParent"), r = o || n ? Zr : Yr, s = o || n ? Kr : Ur, i = nt("context");
|
|
3475
|
-
return /* @__PURE__ */
|
|
3476
|
-
/* @__PURE__ */
|
|
3477
|
-
/* @__PURE__ */
|
|
3478
|
-
/* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ G(r, { ...e, ...rt(r, i), children: /* @__PURE__ */ Kt(s, { children: [
|
|
3488
|
+
/* @__PURE__ */ G(Dr, {}),
|
|
3489
|
+
/* @__PURE__ */ G(Nr, {}),
|
|
3490
|
+
/* @__PURE__ */ G($r, {})
|
|
3479
3491
|
] }) });
|
|
3480
3492
|
}), {
|
|
3481
3493
|
Component: qr,
|
|
@@ -3536,5 +3548,5 @@ export {
|
|
|
3536
3548
|
es as Virtuoso,
|
|
3537
3549
|
ss as VirtuosoGrid,
|
|
3538
3550
|
io as VirtuosoGridMockContext,
|
|
3539
|
-
|
|
3551
|
+
pe as VirtuosoMockContext
|
|
3540
3552
|
};
|