react-virtuoso 4.12.6 → 4.12.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.mjs +1206 -1198
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as z, jsxs as Kt, Fragment as
|
|
1
|
+
import { jsx as z, jsxs as Kt, Fragment as so } from "react/jsx-runtime";
|
|
2
2
|
import H, { createElement as $t } from "react";
|
|
3
|
-
import
|
|
3
|
+
import io from "react-dom";
|
|
4
4
|
const we = 0, zt = 1, qt = 2, En = 4;
|
|
5
5
|
function ln(t) {
|
|
6
6
|
return () => t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function lo(t) {
|
|
9
9
|
t();
|
|
10
10
|
}
|
|
11
11
|
function ne(t, e) {
|
|
@@ -14,7 +14,7 @@ function ne(t, e) {
|
|
|
14
14
|
function cn(t, e) {
|
|
15
15
|
return () => t(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function co(t, e) {
|
|
18
18
|
return (n) => t(e, n);
|
|
19
19
|
}
|
|
20
20
|
function Me(t) {
|
|
@@ -22,12 +22,12 @@ function Me(t) {
|
|
|
22
22
|
}
|
|
23
23
|
function uo(...t) {
|
|
24
24
|
return () => {
|
|
25
|
-
t.map(
|
|
25
|
+
t.map(lo);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function Yt() {
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function ve(t, e) {
|
|
31
31
|
return e(t), t;
|
|
32
32
|
}
|
|
33
33
|
function ao(t, e) {
|
|
@@ -45,13 +45,13 @@ function W(t, e) {
|
|
|
45
45
|
function We(t) {
|
|
46
46
|
t(qt);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function st(t) {
|
|
49
49
|
return t(En);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return K(t,
|
|
51
|
+
function O(t, e) {
|
|
52
|
+
return K(t, co(e, we));
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function bt(t, e) {
|
|
55
55
|
const n = t(zt, (o) => {
|
|
56
56
|
n(), e(o);
|
|
57
57
|
});
|
|
@@ -82,7 +82,7 @@ function P(t) {
|
|
|
82
82
|
function E(t) {
|
|
83
83
|
return (e) => ne(e, t);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function yt(t) {
|
|
86
86
|
return (e) => () => {
|
|
87
87
|
e(t);
|
|
88
88
|
};
|
|
@@ -99,7 +99,7 @@ function x(t, ...e) {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Rt(t, e) {
|
|
103
103
|
return (n) => (o) => {
|
|
104
104
|
n(e = t(e, o));
|
|
105
105
|
};
|
|
@@ -117,15 +117,15 @@ function Lt(t) {
|
|
|
117
117
|
}, t));
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function _(...t) {
|
|
121
121
|
const e = new Array(t.length);
|
|
122
122
|
let n = 0, o = null;
|
|
123
123
|
const r = Math.pow(2, t.length) - 1;
|
|
124
124
|
return t.forEach((s, i) => {
|
|
125
125
|
const l = Math.pow(2, i);
|
|
126
126
|
K(s, (c) => {
|
|
127
|
-
const
|
|
128
|
-
n = n | l, e[i] = c,
|
|
127
|
+
const a = n;
|
|
128
|
+
n = n | l, e[i] = c, a !== r && n === r && o && (o(), o = null);
|
|
129
129
|
});
|
|
130
130
|
}), (s) => (i) => {
|
|
131
131
|
const l = () => {
|
|
@@ -150,7 +150,7 @@ function mo(t) {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function v(t) {
|
|
154
154
|
let e = t;
|
|
155
155
|
const n = $();
|
|
156
156
|
return (o, r) => {
|
|
@@ -169,7 +169,7 @@ function y(t) {
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
function ct(t, e) {
|
|
172
|
-
return
|
|
172
|
+
return ve(v(e), (n) => O(t, n));
|
|
173
173
|
}
|
|
174
174
|
function $() {
|
|
175
175
|
const t = [];
|
|
@@ -191,8 +191,8 @@ function $() {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
194
|
+
function ht(t) {
|
|
195
|
+
return ve($(), (e) => O(t, e));
|
|
196
196
|
}
|
|
197
197
|
function U(t, e = [], { singleton: n } = { singleton: !0 }) {
|
|
198
198
|
return {
|
|
@@ -245,7 +245,7 @@ function an(...t) {
|
|
|
245
245
|
}
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
-
var
|
|
248
|
+
var mt = /* @__PURE__ */ ((t) => (t[t.DEBUG = 0] = "DEBUG", t[t.INFO = 1] = "INFO", t[t.WARN = 2] = "WARN", t[t.ERROR = 3] = "ERROR", t))(mt || {});
|
|
249
249
|
const go = {
|
|
250
250
|
0: "debug",
|
|
251
251
|
3: "error",
|
|
@@ -253,14 +253,14 @@ const go = {
|
|
|
253
253
|
2: "warn"
|
|
254
254
|
}, Io = () => typeof globalThis > "u" ? window : globalThis, Vt = U(
|
|
255
255
|
() => {
|
|
256
|
-
const t =
|
|
256
|
+
const t = v(
|
|
257
257
|
3
|
|
258
258
|
/* ERROR */
|
|
259
259
|
);
|
|
260
260
|
return {
|
|
261
|
-
log:
|
|
261
|
+
log: v((n, o, r = 1) => {
|
|
262
262
|
var i;
|
|
263
|
-
const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i :
|
|
263
|
+
const s = (i = Io().VIRTUOSO_LOG_LEVEL) != null ? i : st(t);
|
|
264
264
|
r >= s && console[go[r]](
|
|
265
265
|
"%creact-virtuoso: %c%s %o",
|
|
266
266
|
"color: #0253b3; font-weight: bold",
|
|
@@ -276,48 +276,45 @@ const go = {
|
|
|
276
276
|
{ singleton: !0 }
|
|
277
277
|
);
|
|
278
278
|
function Ht(t, e, n) {
|
|
279
|
-
return
|
|
279
|
+
return Ge(t, e, n).callbackRef;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Ge(t, e, n) {
|
|
282
282
|
const o = H.useRef(null);
|
|
283
|
-
let r = (
|
|
283
|
+
let r = (i) => {
|
|
284
284
|
};
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
c.offsetParent !== null && t(c);
|
|
290
|
-
};
|
|
291
|
-
n ? l() : requestAnimationFrame(l);
|
|
292
|
-
}), [t]);
|
|
293
|
-
r = (i) => {
|
|
294
|
-
i && e ? (s.observe(i), o.current = i) : (o.current && s.unobserve(o.current), o.current = null);
|
|
285
|
+
const s = H.useMemo(() => typeof ResizeObserver < "u" ? new ResizeObserver((i) => {
|
|
286
|
+
const l = () => {
|
|
287
|
+
const c = i[0].target;
|
|
288
|
+
c.offsetParent !== null && t(c);
|
|
295
289
|
};
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
const
|
|
290
|
+
n ? l() : requestAnimationFrame(l);
|
|
291
|
+
}) : null, [t, n]);
|
|
292
|
+
return r = (i) => {
|
|
293
|
+
i && e ? (s == null || s.observe(i), o.current = i) : (o.current && (s == null || s.unobserve(o.current)), o.current = null);
|
|
294
|
+
}, { callbackRef: r, ref: o };
|
|
295
|
+
}
|
|
296
|
+
function kn(t, e, n, o, r, s, i, l, c) {
|
|
297
|
+
const a = H.useCallback(
|
|
298
|
+
(p) => {
|
|
299
|
+
const I = So(p.children, e, l ? "offsetWidth" : "offsetHeight", r);
|
|
300
|
+
let h = p.parentElement;
|
|
301
|
+
for (; !h.dataset.virtuosoScroller; )
|
|
302
|
+
h = h.parentElement;
|
|
303
|
+
const f = h.lastElementChild.dataset.viewportType === "window";
|
|
304
|
+
let C;
|
|
305
|
+
f && (C = h.ownerDocument.defaultView);
|
|
306
|
+
const w = i ? l ? i.scrollLeft : i.scrollTop : f ? l ? C.scrollX || C.document.documentElement.scrollLeft : C.scrollY || C.document.documentElement.scrollTop : l ? h.scrollLeft : h.scrollTop, S = i ? l ? i.scrollWidth : i.scrollHeight : f ? l ? C.document.documentElement.scrollWidth : C.document.documentElement.scrollHeight : l ? h.scrollWidth : h.scrollHeight, m = i ? l ? i.offsetWidth : i.offsetHeight : f ? l ? C.innerWidth : C.innerHeight : l ? h.offsetWidth : h.offsetHeight;
|
|
310
307
|
o({
|
|
311
|
-
scrollHeight:
|
|
312
|
-
scrollTop: Math.max(
|
|
313
|
-
viewportHeight:
|
|
308
|
+
scrollHeight: S,
|
|
309
|
+
scrollTop: Math.max(w, 0),
|
|
310
|
+
viewportHeight: m
|
|
314
311
|
}), s == null || s(
|
|
315
|
-
l ? dn("column-gap", getComputedStyle(
|
|
316
|
-
),
|
|
312
|
+
l ? dn("column-gap", getComputedStyle(p).columnGap, r) : dn("row-gap", getComputedStyle(p).rowGap, r)
|
|
313
|
+
), I !== null && t(I);
|
|
317
314
|
},
|
|
318
|
-
[t, e, r, s, i, o]
|
|
315
|
+
[t, e, r, s, i, o, l]
|
|
319
316
|
);
|
|
320
|
-
return
|
|
317
|
+
return Ge(a, n, c);
|
|
321
318
|
}
|
|
322
319
|
function So(t, e, n, o) {
|
|
323
320
|
const r = t.length;
|
|
@@ -328,90 +325,91 @@ function So(t, e, n, o) {
|
|
|
328
325
|
const l = t.item(i);
|
|
329
326
|
if (l.dataset.index === void 0)
|
|
330
327
|
continue;
|
|
331
|
-
const c = parseInt(l.dataset.index),
|
|
332
|
-
if (
|
|
328
|
+
const c = parseInt(l.dataset.index), a = parseFloat(l.dataset.knownSize), p = e(l, n);
|
|
329
|
+
if (p === 0 && o("Zero-sized element, this should not happen", { child: l }, mt.ERROR), p === a)
|
|
333
330
|
continue;
|
|
334
|
-
const
|
|
335
|
-
s.length === 0 ||
|
|
331
|
+
const I = s[s.length - 1];
|
|
332
|
+
s.length === 0 || I.size !== p || I.endIndex !== c - 1 ? s.push({ endIndex: c, size: p, startIndex: c }) : s[s.length - 1].endIndex++;
|
|
336
333
|
}
|
|
337
334
|
return s;
|
|
338
335
|
}
|
|
339
336
|
function dn(t, e, n) {
|
|
340
|
-
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e,
|
|
337
|
+
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
|
|
341
338
|
}
|
|
342
|
-
function
|
|
339
|
+
function _e(t, e, n) {
|
|
343
340
|
const o = H.useRef(null), r = H.useCallback(
|
|
344
341
|
(c) => {
|
|
345
342
|
if (!(c != null && c.offsetParent))
|
|
346
343
|
return;
|
|
347
|
-
const
|
|
348
|
-
let
|
|
344
|
+
const a = c.getBoundingClientRect(), p = a.width;
|
|
345
|
+
let I, h;
|
|
349
346
|
if (e) {
|
|
350
|
-
const
|
|
351
|
-
|
|
347
|
+
const f = e.getBoundingClientRect(), C = a.top - f.top;
|
|
348
|
+
h = f.height - Math.max(0, C), I = C + e.scrollTop;
|
|
352
349
|
} else {
|
|
353
|
-
const
|
|
354
|
-
|
|
350
|
+
const f = i.current.ownerDocument.defaultView;
|
|
351
|
+
h = f.innerHeight - Math.max(0, a.top), I = a.top + f.scrollY;
|
|
355
352
|
}
|
|
356
353
|
o.current = {
|
|
357
|
-
offsetTop:
|
|
358
|
-
visibleHeight:
|
|
359
|
-
visibleWidth:
|
|
354
|
+
offsetTop: I,
|
|
355
|
+
visibleHeight: h,
|
|
356
|
+
visibleWidth: p
|
|
360
357
|
}, t(o.current);
|
|
361
358
|
},
|
|
359
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
362
360
|
[t, e]
|
|
363
|
-
), { callbackRef: s, ref: i } =
|
|
361
|
+
), { callbackRef: s, ref: i } = Ge(r, !0, n), l = H.useCallback(() => {
|
|
364
362
|
r(i.current);
|
|
365
363
|
}, [r, i]);
|
|
366
364
|
return H.useEffect(() => {
|
|
367
365
|
var c;
|
|
368
366
|
if (e) {
|
|
369
367
|
e.addEventListener("scroll", l);
|
|
370
|
-
const
|
|
368
|
+
const a = new ResizeObserver(() => {
|
|
371
369
|
requestAnimationFrame(l);
|
|
372
370
|
});
|
|
373
|
-
return
|
|
374
|
-
e.removeEventListener("scroll", l),
|
|
371
|
+
return a.observe(e), () => {
|
|
372
|
+
e.removeEventListener("scroll", l), a.unobserve(e);
|
|
375
373
|
};
|
|
376
374
|
} else {
|
|
377
|
-
const
|
|
378
|
-
return
|
|
379
|
-
|
|
375
|
+
const a = (c = i.current) == null ? void 0 : c.ownerDocument.defaultView;
|
|
376
|
+
return a == null || a.addEventListener("scroll", l), a == null || a.addEventListener("resize", l), () => {
|
|
377
|
+
a == null || a.removeEventListener("scroll", l), a == null || a.removeEventListener("resize", l);
|
|
380
378
|
};
|
|
381
379
|
}
|
|
382
|
-
}, [l, e]), s;
|
|
380
|
+
}, [l, e, i]), s;
|
|
383
381
|
}
|
|
384
382
|
const at = U(
|
|
385
383
|
() => {
|
|
386
|
-
const t = $(), e = $(), n =
|
|
387
|
-
return
|
|
384
|
+
const t = $(), e = $(), n = v(0), o = $(), r = v(0), s = $(), i = $(), l = v(0), c = v(0), a = v(0), p = v(0), I = $(), h = $(), f = v(!1), C = v(!1), w = v(!1);
|
|
385
|
+
return O(
|
|
388
386
|
x(
|
|
389
387
|
t,
|
|
390
|
-
E(({ scrollTop:
|
|
388
|
+
E(({ scrollTop: S }) => S)
|
|
391
389
|
),
|
|
392
390
|
e
|
|
393
|
-
),
|
|
391
|
+
), O(
|
|
394
392
|
x(
|
|
395
393
|
t,
|
|
396
|
-
E(({ scrollHeight:
|
|
394
|
+
E(({ scrollHeight: S }) => S)
|
|
397
395
|
),
|
|
398
396
|
i
|
|
399
|
-
),
|
|
397
|
+
), O(e, r), {
|
|
400
398
|
deviation: n,
|
|
401
|
-
fixedFooterHeight:
|
|
399
|
+
fixedFooterHeight: a,
|
|
402
400
|
fixedHeaderHeight: c,
|
|
403
|
-
footerHeight:
|
|
401
|
+
footerHeight: p,
|
|
404
402
|
headerHeight: l,
|
|
405
|
-
horizontalDirection:
|
|
406
|
-
scrollBy:
|
|
403
|
+
horizontalDirection: C,
|
|
404
|
+
scrollBy: h,
|
|
407
405
|
// input
|
|
408
406
|
scrollContainerState: t,
|
|
409
407
|
scrollHeight: i,
|
|
410
|
-
scrollingInProgress:
|
|
408
|
+
scrollingInProgress: f,
|
|
411
409
|
// signals
|
|
412
|
-
scrollTo:
|
|
410
|
+
scrollTo: I,
|
|
413
411
|
scrollTop: e,
|
|
414
|
-
skipAnimationFrameInResizeObserver:
|
|
412
|
+
skipAnimationFrameInResizeObserver: w,
|
|
415
413
|
smoothScrollTargetReached: o,
|
|
416
414
|
// state
|
|
417
415
|
statefulScrollTop: r,
|
|
@@ -451,13 +449,13 @@ function Ct(t, e, n = "k") {
|
|
|
451
449
|
}
|
|
452
450
|
return Ct(t.l, e, n);
|
|
453
451
|
}
|
|
454
|
-
function
|
|
455
|
-
return j(t) ?
|
|
452
|
+
function pt(t, e, n) {
|
|
453
|
+
return j(t) ? zn(e, n, 1) : e === t.k ? ot(t, { k: e, v: n }) : e < t.k ? fn(ot(t, { l: pt(t.l, e, n) })) : fn(ot(t, { r: pt(t.r, e, n) }));
|
|
456
454
|
}
|
|
457
455
|
function Ut() {
|
|
458
456
|
return oe;
|
|
459
457
|
}
|
|
460
|
-
function
|
|
458
|
+
function ye(t, e, n) {
|
|
461
459
|
if (j(t))
|
|
462
460
|
return [];
|
|
463
461
|
const o = Ct(t, e)[0];
|
|
@@ -472,13 +470,13 @@ function Le(t, e) {
|
|
|
472
470
|
if (j(r))
|
|
473
471
|
return o;
|
|
474
472
|
{
|
|
475
|
-
const [s, i] =
|
|
476
|
-
return ge(ot(t, { k: s, l:
|
|
473
|
+
const [s, i] = Ln(o);
|
|
474
|
+
return ge(ot(t, { k: s, l: On(o), v: i }));
|
|
477
475
|
}
|
|
478
476
|
} else return e < n ? ge(ot(t, { l: Le(o, e) })) : ge(ot(t, { r: Le(r, e) }));
|
|
479
477
|
}
|
|
480
|
-
function
|
|
481
|
-
return j(t) ? [] : [...
|
|
478
|
+
function Gt(t) {
|
|
479
|
+
return j(t) ? [] : [...Gt(t.l), { k: t.k, v: t.v }, ...Gt(t.r)];
|
|
482
480
|
}
|
|
483
481
|
function ze(t, e, n) {
|
|
484
482
|
if (j(t))
|
|
@@ -493,7 +491,7 @@ function ge(t) {
|
|
|
493
491
|
return t;
|
|
494
492
|
if (n > o.lvl + 1) {
|
|
495
493
|
if (Ee(e))
|
|
496
|
-
return
|
|
494
|
+
return Vn(ot(t, { lvl: n - 1 }));
|
|
497
495
|
if (!j(e) && !j(e.r))
|
|
498
496
|
return ot(e.r, {
|
|
499
497
|
l: ot(e, { r: e.r.l }),
|
|
@@ -522,7 +520,7 @@ function ge(t) {
|
|
|
522
520
|
}
|
|
523
521
|
}
|
|
524
522
|
function ot(t, e) {
|
|
525
|
-
return
|
|
523
|
+
return zn(
|
|
526
524
|
e.k !== void 0 ? e.k : t.k,
|
|
527
525
|
e.v !== void 0 ? e.v : t.v,
|
|
528
526
|
e.lvl !== void 0 ? e.lvl : t.lvl,
|
|
@@ -530,22 +528,22 @@ function ot(t, e) {
|
|
|
530
528
|
e.r !== void 0 ? e.r : t.r
|
|
531
529
|
);
|
|
532
530
|
}
|
|
533
|
-
function
|
|
534
|
-
return j(t.r) ? t.l : ge(ot(t, { r:
|
|
531
|
+
function On(t) {
|
|
532
|
+
return j(t.r) ? t.l : ge(ot(t, { r: On(t.r) }));
|
|
535
533
|
}
|
|
536
534
|
function Ee(t) {
|
|
537
535
|
return j(t) || t.lvl > t.r.lvl;
|
|
538
536
|
}
|
|
539
|
-
function
|
|
540
|
-
return j(t.r) ? [t.k, t.v] :
|
|
537
|
+
function Ln(t) {
|
|
538
|
+
return j(t.r) ? [t.k, t.v] : Ln(t.r);
|
|
541
539
|
}
|
|
542
|
-
function
|
|
540
|
+
function zn(t, e, n, o = oe, r = oe) {
|
|
543
541
|
return { k: t, l: o, lvl: n, r, v: e };
|
|
544
542
|
}
|
|
545
543
|
function fn(t) {
|
|
546
|
-
return Ve(
|
|
544
|
+
return Ve(Vn(t));
|
|
547
545
|
}
|
|
548
|
-
function
|
|
546
|
+
function Vn(t) {
|
|
549
547
|
const { l: e } = t;
|
|
550
548
|
return !j(e) && e.lvl === t.lvl ? ot(e, { r: ot(t, { l: e.r }) }) : t;
|
|
551
549
|
}
|
|
@@ -556,18 +554,18 @@ function Ve(t) {
|
|
|
556
554
|
function xo(t) {
|
|
557
555
|
return Fn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
|
|
558
556
|
}
|
|
559
|
-
function
|
|
557
|
+
function Pn(t, e) {
|
|
560
558
|
return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
|
|
561
559
|
}
|
|
562
560
|
function se(t, e) {
|
|
563
561
|
return !!(t && t[0] === e[0] && t[1] === e[1]);
|
|
564
562
|
}
|
|
565
563
|
const Ne = U(
|
|
566
|
-
() => ({ recalcInProgress:
|
|
564
|
+
() => ({ recalcInProgress: v(!1) }),
|
|
567
565
|
[],
|
|
568
566
|
{ singleton: !0 }
|
|
569
567
|
);
|
|
570
|
-
function
|
|
568
|
+
function An(t, e, n) {
|
|
571
569
|
return t[Se(t, e, n)];
|
|
572
570
|
}
|
|
573
571
|
function Se(t, e, n, o = 0) {
|
|
@@ -595,7 +593,7 @@ function To(t, e, n, o) {
|
|
|
595
593
|
function wt(t, e) {
|
|
596
594
|
return Math.round(t.getBoundingClientRect()[e]);
|
|
597
595
|
}
|
|
598
|
-
function
|
|
596
|
+
function Re(t) {
|
|
599
597
|
return !j(t.groupOffsetTree);
|
|
600
598
|
}
|
|
601
599
|
function De({ index: t }, e) {
|
|
@@ -617,75 +615,75 @@ function wo(t, e) {
|
|
|
617
615
|
for (const o of e) {
|
|
618
616
|
const { endIndex: r, size: s, startIndex: i } = o;
|
|
619
617
|
if (n = Math.min(n, i), j(t)) {
|
|
620
|
-
t =
|
|
618
|
+
t = pt(t, 0, s);
|
|
621
619
|
continue;
|
|
622
620
|
}
|
|
623
|
-
const l =
|
|
624
|
-
if (l.some(
|
|
621
|
+
const l = ye(t, i - 1, r + 1);
|
|
622
|
+
if (l.some(Bo(o)))
|
|
625
623
|
continue;
|
|
626
|
-
let c = !1,
|
|
627
|
-
for (const { end:
|
|
628
|
-
c ? (r >=
|
|
629
|
-
|
|
624
|
+
let c = !1, a = !1;
|
|
625
|
+
for (const { end: p, start: I, value: h } of l)
|
|
626
|
+
c ? (r >= I || s === h) && (t = Le(t, I)) : (a = h !== s, c = !0), p > r && r >= I && h !== s && (t = pt(t, r + 1, h));
|
|
627
|
+
a && (t = pt(t, i, s));
|
|
630
628
|
}
|
|
631
629
|
return [t, n];
|
|
632
630
|
}
|
|
633
|
-
function
|
|
631
|
+
function vo(t) {
|
|
634
632
|
return typeof t.groupIndex < "u";
|
|
635
633
|
}
|
|
636
|
-
function
|
|
634
|
+
function yo({ offset: t }, e) {
|
|
637
635
|
return e === t ? 0 : e < t ? -1 : 1;
|
|
638
636
|
}
|
|
639
637
|
function ie(t, e, n) {
|
|
640
638
|
if (e.length === 0)
|
|
641
639
|
return 0;
|
|
642
|
-
const { index: o, offset: r, size: s } =
|
|
640
|
+
const { index: o, offset: r, size: s } = An(e, t, De), i = t - o, l = s * i + (i - 1) * n + r;
|
|
643
641
|
return l > 0 ? l + n : l;
|
|
644
642
|
}
|
|
645
|
-
function
|
|
646
|
-
if (!
|
|
643
|
+
function Mn(t, e) {
|
|
644
|
+
if (!Re(e))
|
|
647
645
|
return t;
|
|
648
646
|
let n = 0;
|
|
649
647
|
for (; e.groupIndices[n] <= t + n; )
|
|
650
648
|
n++;
|
|
651
649
|
return t + n;
|
|
652
650
|
}
|
|
653
|
-
function
|
|
654
|
-
if (
|
|
651
|
+
function Wn(t, e, n) {
|
|
652
|
+
if (vo(t))
|
|
655
653
|
return e.groupIndices[t.groupIndex] + 1;
|
|
656
654
|
{
|
|
657
655
|
const o = t.index === "LAST" ? n : t.index;
|
|
658
|
-
let r =
|
|
656
|
+
let r = Mn(o, e);
|
|
659
657
|
return r = Math.max(0, r, Math.min(n, r)), r;
|
|
660
658
|
}
|
|
661
659
|
}
|
|
662
|
-
function
|
|
663
|
-
return o > 0 && (e = Math.max(e,
|
|
660
|
+
function Ro(t, e, n, o = 0) {
|
|
661
|
+
return o > 0 && (e = Math.max(e, An(t, o, De).offset)), Fn(To(t, e, n, yo), Eo);
|
|
664
662
|
}
|
|
665
|
-
function
|
|
666
|
-
e.length > 0 && o("received item sizes", e,
|
|
663
|
+
function bo(t, [e, n, o, r]) {
|
|
664
|
+
e.length > 0 && o("received item sizes", e, mt.DEBUG);
|
|
667
665
|
const s = t.sizeTree;
|
|
668
666
|
let i = s, l = 0;
|
|
669
667
|
if (n.length > 0 && j(s) && e.length === 2) {
|
|
670
|
-
const
|
|
671
|
-
i = n.reduce((
|
|
668
|
+
const h = e[0].size, f = e[1].size;
|
|
669
|
+
i = n.reduce((C, w) => pt(pt(C, w, h), w + 1, f), i);
|
|
672
670
|
} else
|
|
673
671
|
[i, l] = wo(i, e);
|
|
674
672
|
if (i === s)
|
|
675
673
|
return t;
|
|
676
|
-
const { lastIndex: c, lastOffset:
|
|
674
|
+
const { lastIndex: c, lastOffset: a, lastSize: p, offsetTree: I } = Pe(t.offsetTree, l, i, r);
|
|
677
675
|
return {
|
|
678
676
|
groupIndices: n,
|
|
679
|
-
groupOffsetTree: n.reduce((
|
|
677
|
+
groupOffsetTree: n.reduce((h, f) => pt(h, f, ie(f, I, r)), Ut()),
|
|
680
678
|
lastIndex: c,
|
|
681
|
-
lastOffset:
|
|
682
|
-
lastSize:
|
|
683
|
-
offsetTree:
|
|
679
|
+
lastOffset: a,
|
|
680
|
+
lastSize: p,
|
|
681
|
+
offsetTree: I,
|
|
684
682
|
sizeTree: i
|
|
685
683
|
};
|
|
686
684
|
}
|
|
687
685
|
function Ho(t) {
|
|
688
|
-
return
|
|
686
|
+
return Gt(t).map(({ k: e, v: n }, o, r) => {
|
|
689
687
|
const s = r[o + 1];
|
|
690
688
|
return { endIndex: s ? s.k - 1 : 1 / 0, size: n, startIndex: e };
|
|
691
689
|
});
|
|
@@ -700,17 +698,17 @@ function Pe(t, e, n, o) {
|
|
|
700
698
|
let r = t, s = 0, i = 0, l = 0, c = 0;
|
|
701
699
|
if (e !== 0) {
|
|
702
700
|
c = Se(r, e - 1, De), l = r[c].offset;
|
|
703
|
-
const
|
|
704
|
-
s =
|
|
701
|
+
const p = Ct(n, e - 1);
|
|
702
|
+
s = p[0], i = p[1], r.length && r[c].size === Ct(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
|
|
705
703
|
} else
|
|
706
704
|
r = [];
|
|
707
|
-
for (const { start:
|
|
708
|
-
const
|
|
705
|
+
for (const { start: a, value: p } of ye(n, e, 1 / 0)) {
|
|
706
|
+
const I = a - s, h = I * i + l + I * o;
|
|
709
707
|
r.push({
|
|
710
|
-
index:
|
|
711
|
-
offset:
|
|
712
|
-
size:
|
|
713
|
-
}), s =
|
|
708
|
+
index: a,
|
|
709
|
+
offset: h,
|
|
710
|
+
size: p
|
|
711
|
+
}), s = a, l = h, i = p;
|
|
714
712
|
}
|
|
715
713
|
return {
|
|
716
714
|
lastIndex: s,
|
|
@@ -722,169 +720,169 @@ function Pe(t, e, n, o) {
|
|
|
722
720
|
function Eo(t) {
|
|
723
721
|
return { index: t.index, value: t };
|
|
724
722
|
}
|
|
725
|
-
function
|
|
723
|
+
function Bo(t) {
|
|
726
724
|
const { endIndex: e, size: n, startIndex: o } = t;
|
|
727
725
|
return (r) => r.start === o && (r.end === e || r.end === 1 / 0) && r.value === n;
|
|
728
726
|
}
|
|
729
|
-
const
|
|
727
|
+
const ko = {
|
|
730
728
|
offsetHeight: "height",
|
|
731
729
|
offsetWidth: "width"
|
|
732
730
|
}, Et = U(
|
|
733
731
|
([{ log: t }, { recalcInProgress: e }]) => {
|
|
734
|
-
const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l =
|
|
735
|
-
x(n,
|
|
736
|
-
|
|
737
|
-
),
|
|
732
|
+
const n = $(), o = $(), r = ct(o, 0), s = $(), i = $(), l = v(0), c = v([]), a = v(void 0), p = v(void 0), I = v((g, d) => wt(g, ko[d])), h = v(void 0), f = v(0), C = Co(), w = ct(
|
|
733
|
+
x(n, _(c, t, f), Rt(bo, C), Y()),
|
|
734
|
+
C
|
|
735
|
+
), S = ct(
|
|
738
736
|
x(
|
|
739
737
|
c,
|
|
740
738
|
Y(),
|
|
741
|
-
|
|
739
|
+
Rt((g, d) => ({ current: d, prev: g.current }), {
|
|
742
740
|
current: [],
|
|
743
741
|
prev: []
|
|
744
742
|
}),
|
|
745
|
-
E(({ prev:
|
|
743
|
+
E(({ prev: g }) => g)
|
|
746
744
|
),
|
|
747
745
|
[]
|
|
748
746
|
);
|
|
749
|
-
|
|
747
|
+
O(
|
|
750
748
|
x(
|
|
751
749
|
c,
|
|
752
|
-
P((
|
|
753
|
-
|
|
754
|
-
E(([
|
|
755
|
-
const
|
|
750
|
+
P((g) => g.length > 0),
|
|
751
|
+
_(w, f),
|
|
752
|
+
E(([g, d, b]) => {
|
|
753
|
+
const k = g.reduce((F, L, V) => pt(F, L, ie(L, d.offsetTree, b) || V), Ut());
|
|
756
754
|
return {
|
|
757
755
|
...d,
|
|
758
|
-
groupIndices:
|
|
759
|
-
groupOffsetTree:
|
|
756
|
+
groupIndices: g,
|
|
757
|
+
groupOffsetTree: k
|
|
760
758
|
};
|
|
761
759
|
})
|
|
762
760
|
),
|
|
763
|
-
|
|
764
|
-
),
|
|
761
|
+
w
|
|
762
|
+
), O(
|
|
765
763
|
x(
|
|
766
764
|
o,
|
|
767
|
-
|
|
768
|
-
P(([
|
|
769
|
-
E(([
|
|
765
|
+
_(w),
|
|
766
|
+
P(([g, { lastIndex: d }]) => g < d),
|
|
767
|
+
E(([g, { lastIndex: d, lastSize: b }]) => [
|
|
770
768
|
{
|
|
771
769
|
endIndex: d,
|
|
772
|
-
size:
|
|
773
|
-
startIndex:
|
|
770
|
+
size: b,
|
|
771
|
+
startIndex: g
|
|
774
772
|
}
|
|
775
773
|
])
|
|
776
774
|
),
|
|
777
775
|
n
|
|
778
|
-
),
|
|
779
|
-
const
|
|
776
|
+
), O(a, p);
|
|
777
|
+
const m = ct(
|
|
780
778
|
x(
|
|
781
|
-
|
|
782
|
-
E((
|
|
779
|
+
a,
|
|
780
|
+
E((g) => g === void 0)
|
|
783
781
|
),
|
|
784
782
|
!0
|
|
785
783
|
);
|
|
786
|
-
|
|
784
|
+
O(
|
|
787
785
|
x(
|
|
788
|
-
|
|
789
|
-
P((
|
|
790
|
-
E((
|
|
786
|
+
p,
|
|
787
|
+
P((g) => g !== void 0 && j(st(w).sizeTree)),
|
|
788
|
+
E((g) => [{ endIndex: 0, size: g, startIndex: 0 }])
|
|
791
789
|
),
|
|
792
790
|
n
|
|
793
791
|
);
|
|
794
|
-
const
|
|
792
|
+
const u = ht(
|
|
795
793
|
x(
|
|
796
794
|
n,
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
({ sizes:
|
|
800
|
-
changed:
|
|
801
|
-
sizes:
|
|
795
|
+
_(w),
|
|
796
|
+
Rt(
|
|
797
|
+
({ sizes: g }, [d, b]) => ({
|
|
798
|
+
changed: b !== g,
|
|
799
|
+
sizes: b
|
|
802
800
|
}),
|
|
803
|
-
{ changed: !1, sizes:
|
|
801
|
+
{ changed: !1, sizes: C }
|
|
804
802
|
),
|
|
805
|
-
E((
|
|
803
|
+
E((g) => g.changed)
|
|
806
804
|
)
|
|
807
805
|
);
|
|
808
806
|
K(
|
|
809
807
|
x(
|
|
810
808
|
l,
|
|
811
|
-
|
|
812
|
-
(
|
|
809
|
+
Rt(
|
|
810
|
+
(g, d) => ({ diff: g.prev - d, prev: d }),
|
|
813
811
|
{ diff: 0, prev: 0 }
|
|
814
812
|
),
|
|
815
|
-
E((
|
|
813
|
+
E((g) => g.diff)
|
|
816
814
|
),
|
|
817
|
-
(
|
|
818
|
-
const { groupIndices: d } =
|
|
819
|
-
if (
|
|
820
|
-
W(e, !0), W(s,
|
|
821
|
-
else if (
|
|
822
|
-
const
|
|
823
|
-
|
|
815
|
+
(g) => {
|
|
816
|
+
const { groupIndices: d } = st(w);
|
|
817
|
+
if (g > 0)
|
|
818
|
+
W(e, !0), W(s, g + mn(g, d));
|
|
819
|
+
else if (g < 0) {
|
|
820
|
+
const b = st(S);
|
|
821
|
+
b.length > 0 && (g -= mn(-g, b)), W(i, g);
|
|
824
822
|
}
|
|
825
823
|
}
|
|
826
|
-
), K(x(l,
|
|
827
|
-
|
|
824
|
+
), K(x(l, _(t)), ([g, d]) => {
|
|
825
|
+
g < 0 && d(
|
|
828
826
|
"`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",
|
|
829
827
|
{ firstItemIndex: l },
|
|
830
|
-
|
|
828
|
+
mt.ERROR
|
|
831
829
|
);
|
|
832
830
|
});
|
|
833
|
-
const T =
|
|
834
|
-
|
|
831
|
+
const T = ht(s);
|
|
832
|
+
O(
|
|
835
833
|
x(
|
|
836
834
|
s,
|
|
837
|
-
|
|
838
|
-
E(([
|
|
839
|
-
const
|
|
840
|
-
if (
|
|
835
|
+
_(w),
|
|
836
|
+
E(([g, d]) => {
|
|
837
|
+
const b = d.groupIndices.length > 0, k = [], F = d.lastSize;
|
|
838
|
+
if (b) {
|
|
841
839
|
const L = re(d.sizeTree, 0);
|
|
842
840
|
let V = 0, D = 0;
|
|
843
|
-
for (; V <
|
|
844
|
-
const
|
|
845
|
-
|
|
846
|
-
endIndex:
|
|
841
|
+
for (; V < g; ) {
|
|
842
|
+
const B = d.groupIndices[D], q = d.groupIndices.length === D + 1 ? 1 / 0 : d.groupIndices[D + 1] - B - 1;
|
|
843
|
+
k.push({
|
|
844
|
+
endIndex: B,
|
|
847
845
|
size: L,
|
|
848
|
-
startIndex:
|
|
849
|
-
}),
|
|
850
|
-
endIndex:
|
|
851
|
-
size:
|
|
852
|
-
startIndex:
|
|
846
|
+
startIndex: B
|
|
847
|
+
}), k.push({
|
|
848
|
+
endIndex: B + 1 + q - 1,
|
|
849
|
+
size: F,
|
|
850
|
+
startIndex: B + 1
|
|
853
851
|
}), D++, V += q + 1;
|
|
854
852
|
}
|
|
855
|
-
const J =
|
|
856
|
-
return V !==
|
|
857
|
-
(
|
|
858
|
-
let dt =
|
|
859
|
-
return
|
|
860
|
-
...
|
|
853
|
+
const J = Gt(d.sizeTree);
|
|
854
|
+
return V !== g && J.shift(), J.reduce(
|
|
855
|
+
(B, { k: q, v: it }) => {
|
|
856
|
+
let dt = B.ranges;
|
|
857
|
+
return B.prevSize !== 0 && (dt = [
|
|
858
|
+
...B.ranges,
|
|
861
859
|
{
|
|
862
|
-
endIndex: q +
|
|
863
|
-
size:
|
|
864
|
-
startIndex:
|
|
860
|
+
endIndex: q + g - 1,
|
|
861
|
+
size: B.prevSize,
|
|
862
|
+
startIndex: B.prevIndex
|
|
865
863
|
}
|
|
866
864
|
]), {
|
|
867
|
-
prevIndex: q +
|
|
868
|
-
prevSize:
|
|
865
|
+
prevIndex: q + g,
|
|
866
|
+
prevSize: it,
|
|
869
867
|
ranges: dt
|
|
870
868
|
};
|
|
871
869
|
},
|
|
872
870
|
{
|
|
873
|
-
prevIndex:
|
|
871
|
+
prevIndex: g,
|
|
874
872
|
prevSize: 0,
|
|
875
|
-
ranges:
|
|
873
|
+
ranges: k
|
|
876
874
|
}
|
|
877
875
|
).ranges;
|
|
878
876
|
}
|
|
879
|
-
return
|
|
877
|
+
return Gt(d.sizeTree).reduce(
|
|
880
878
|
(L, { k: V, v: D }) => ({
|
|
881
|
-
prevIndex: V +
|
|
879
|
+
prevIndex: V + g,
|
|
882
880
|
prevSize: D,
|
|
883
|
-
ranges: [...L.ranges, { endIndex: V +
|
|
881
|
+
ranges: [...L.ranges, { endIndex: V + g - 1, size: L.prevSize, startIndex: L.prevIndex }]
|
|
884
882
|
}),
|
|
885
883
|
{
|
|
886
884
|
prevIndex: 0,
|
|
887
|
-
prevSize:
|
|
885
|
+
prevSize: F,
|
|
888
886
|
ranges: []
|
|
889
887
|
}
|
|
890
888
|
).ranges;
|
|
@@ -892,80 +890,80 @@ const Bo = {
|
|
|
892
890
|
),
|
|
893
891
|
n
|
|
894
892
|
);
|
|
895
|
-
const
|
|
893
|
+
const R = ht(
|
|
896
894
|
x(
|
|
897
895
|
i,
|
|
898
|
-
|
|
899
|
-
E(([
|
|
900
|
-
const
|
|
901
|
-
return ie(
|
|
896
|
+
_(w, f),
|
|
897
|
+
E(([g, { offsetTree: d }, b]) => {
|
|
898
|
+
const k = -g;
|
|
899
|
+
return ie(k, d, b);
|
|
902
900
|
})
|
|
903
901
|
)
|
|
904
902
|
);
|
|
905
|
-
return
|
|
903
|
+
return O(
|
|
906
904
|
x(
|
|
907
905
|
i,
|
|
908
|
-
|
|
909
|
-
E(([
|
|
906
|
+
_(w, f),
|
|
907
|
+
E(([g, d, b]) => {
|
|
910
908
|
if (d.groupIndices.length > 0) {
|
|
911
909
|
if (j(d.sizeTree))
|
|
912
910
|
return d;
|
|
913
|
-
let
|
|
914
|
-
const L =
|
|
911
|
+
let F = Ut();
|
|
912
|
+
const L = st(S);
|
|
915
913
|
let V = 0, D = 0, J = 0;
|
|
916
|
-
for (; V < -
|
|
914
|
+
for (; V < -g; ) {
|
|
917
915
|
J = L[D];
|
|
918
|
-
const
|
|
919
|
-
D++, V +=
|
|
916
|
+
const B = L[D + 1] - J - 1;
|
|
917
|
+
D++, V += B + 1;
|
|
920
918
|
}
|
|
921
|
-
if (
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
const q = Ct(d.sizeTree, -
|
|
925
|
-
|
|
919
|
+
if (F = Gt(d.sizeTree).reduce((B, { k: q, v: it }) => pt(B, Math.max(0, q + g), it), F), V !== -g) {
|
|
920
|
+
const B = re(d.sizeTree, J);
|
|
921
|
+
F = pt(F, 0, B);
|
|
922
|
+
const q = Ct(d.sizeTree, -g + 1)[1];
|
|
923
|
+
F = pt(F, 1, q);
|
|
926
924
|
}
|
|
927
925
|
return {
|
|
928
926
|
...d,
|
|
929
|
-
sizeTree:
|
|
930
|
-
...Pe(d.offsetTree, 0,
|
|
927
|
+
sizeTree: F,
|
|
928
|
+
...Pe(d.offsetTree, 0, F, b)
|
|
931
929
|
};
|
|
932
930
|
} else {
|
|
933
|
-
const
|
|
931
|
+
const F = Gt(d.sizeTree).reduce((L, { k: V, v: D }) => pt(L, Math.max(0, V + g), D), Ut());
|
|
934
932
|
return {
|
|
935
933
|
...d,
|
|
936
|
-
sizeTree:
|
|
937
|
-
...Pe(d.offsetTree, 0,
|
|
934
|
+
sizeTree: F,
|
|
935
|
+
...Pe(d.offsetTree, 0, F, b)
|
|
938
936
|
};
|
|
939
937
|
}
|
|
940
938
|
})
|
|
941
939
|
),
|
|
942
|
-
|
|
940
|
+
w
|
|
943
941
|
), {
|
|
944
942
|
beforeUnshiftWith: T,
|
|
945
943
|
// input
|
|
946
|
-
data:
|
|
947
|
-
defaultItemSize:
|
|
944
|
+
data: h,
|
|
945
|
+
defaultItemSize: p,
|
|
948
946
|
firstItemIndex: l,
|
|
949
|
-
fixedItemSize:
|
|
950
|
-
gap:
|
|
947
|
+
fixedItemSize: a,
|
|
948
|
+
gap: f,
|
|
951
949
|
groupIndices: c,
|
|
952
|
-
itemSize:
|
|
953
|
-
listRefresh:
|
|
950
|
+
itemSize: I,
|
|
951
|
+
listRefresh: u,
|
|
954
952
|
shiftWith: i,
|
|
955
|
-
shiftWithOffset:
|
|
953
|
+
shiftWithOffset: R,
|
|
956
954
|
sizeRanges: n,
|
|
957
955
|
// output
|
|
958
|
-
sizes:
|
|
956
|
+
sizes: w,
|
|
959
957
|
statefulTotalCount: r,
|
|
960
958
|
totalCount: o,
|
|
961
|
-
trackItemSizes:
|
|
959
|
+
trackItemSizes: m,
|
|
962
960
|
unshiftWith: s
|
|
963
961
|
};
|
|
964
962
|
},
|
|
965
963
|
X(Vt, Ne),
|
|
966
964
|
{ singleton: !0 }
|
|
967
965
|
);
|
|
968
|
-
function
|
|
966
|
+
function Fo(t) {
|
|
969
967
|
return t.reduce(
|
|
970
968
|
(e, n) => (e.groupIndices.push(e.totalCount), e.totalCount += n + 1, e),
|
|
971
969
|
{
|
|
@@ -976,24 +974,24 @@ function Oo(t) {
|
|
|
976
974
|
}
|
|
977
975
|
const Gn = U(
|
|
978
976
|
([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
|
|
979
|
-
const s = $(), i = $(), l =
|
|
980
|
-
return
|
|
977
|
+
const s = $(), i = $(), l = ht(x(s, E(Fo)));
|
|
978
|
+
return O(
|
|
981
979
|
x(
|
|
982
980
|
l,
|
|
983
981
|
E((c) => c.totalCount)
|
|
984
982
|
),
|
|
985
983
|
n
|
|
986
|
-
),
|
|
984
|
+
), O(
|
|
987
985
|
x(
|
|
988
986
|
l,
|
|
989
987
|
E((c) => c.groupIndices)
|
|
990
988
|
),
|
|
991
989
|
t
|
|
992
|
-
),
|
|
990
|
+
), O(
|
|
993
991
|
x(
|
|
994
992
|
rt(r, e, o),
|
|
995
|
-
P(([c,
|
|
996
|
-
E(([c,
|
|
993
|
+
P(([c, a]) => Re(a)),
|
|
994
|
+
E(([c, a, p]) => Ct(a.groupOffsetTree, Math.max(c - p, 0), "v")[0]),
|
|
997
995
|
Y(),
|
|
998
996
|
E((c) => [c])
|
|
999
997
|
),
|
|
@@ -1003,7 +1001,7 @@ const Gn = U(
|
|
|
1003
1001
|
X(Et, at)
|
|
1004
1002
|
), Pt = U(
|
|
1005
1003
|
([{ log: t }]) => {
|
|
1006
|
-
const e =
|
|
1004
|
+
const e = v(!1), n = ht(
|
|
1007
1005
|
x(
|
|
1008
1006
|
e,
|
|
1009
1007
|
P((o) => o),
|
|
@@ -1011,15 +1009,15 @@ const Gn = U(
|
|
|
1011
1009
|
)
|
|
1012
1010
|
);
|
|
1013
1011
|
return K(e, (o) => {
|
|
1014
|
-
o &&
|
|
1012
|
+
o && st(t)("props updated", {}, mt.DEBUG);
|
|
1015
1013
|
}), { didMount: n, propsReady: e };
|
|
1016
1014
|
},
|
|
1017
1015
|
X(Vt),
|
|
1018
1016
|
{ singleton: !0 }
|
|
1019
|
-
),
|
|
1020
|
-
function
|
|
1017
|
+
), Oo = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1018
|
+
function _n(t) {
|
|
1021
1019
|
const e = typeof t == "number" ? { index: t } : t;
|
|
1022
|
-
return e.align || (e.align = "start"), (!e.behavior || !
|
|
1020
|
+
return e.align || (e.align = "start"), (!e.behavior || !Oo) && (e.behavior = "auto"), e.offset || (e.offset = 0), e;
|
|
1023
1021
|
}
|
|
1024
1022
|
const ce = U(
|
|
1025
1023
|
([
|
|
@@ -1030,55 +1028,55 @@ const ce = U(
|
|
|
1030
1028
|
footerHeight: i,
|
|
1031
1029
|
headerHeight: l,
|
|
1032
1030
|
scrollingInProgress: c,
|
|
1033
|
-
scrollTo:
|
|
1034
|
-
smoothScrollTargetReached:
|
|
1035
|
-
viewportHeight:
|
|
1031
|
+
scrollTo: a,
|
|
1032
|
+
smoothScrollTargetReached: p,
|
|
1033
|
+
viewportHeight: I
|
|
1036
1034
|
},
|
|
1037
|
-
{ log:
|
|
1035
|
+
{ log: h }
|
|
1038
1036
|
]) => {
|
|
1039
|
-
const
|
|
1040
|
-
let
|
|
1037
|
+
const f = $(), C = $(), w = v(0);
|
|
1038
|
+
let S = null, m = null, u = null;
|
|
1041
1039
|
function T() {
|
|
1042
|
-
|
|
1040
|
+
S && (S(), S = null), u && (u(), u = null), m && (clearTimeout(m), m = null), W(c, !1);
|
|
1043
1041
|
}
|
|
1044
|
-
return
|
|
1042
|
+
return O(
|
|
1045
1043
|
x(
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1044
|
+
f,
|
|
1045
|
+
_(n, I, o, w, l, i, h),
|
|
1046
|
+
_(t, s, r),
|
|
1049
1047
|
E(
|
|
1050
1048
|
([
|
|
1051
|
-
[
|
|
1049
|
+
[R, g, d, b, k, F, L, V],
|
|
1052
1050
|
D,
|
|
1053
1051
|
J,
|
|
1054
1052
|
nt
|
|
1055
1053
|
]) => {
|
|
1056
|
-
const
|
|
1057
|
-
let ut = ie(ft,
|
|
1058
|
-
q === "end" ? (ut += J + Ct(
|
|
1054
|
+
const B = _n(R), { align: q, behavior: it, offset: dt } = B, St = b - 1, ft = Wn(B, g, St);
|
|
1055
|
+
let ut = ie(ft, g.offsetTree, D) + F;
|
|
1056
|
+
q === "end" ? (ut += J + Ct(g.sizeTree, ft)[1] - d + nt, ft === St && (ut += L)) : q === "center" ? ut += (J + Ct(g.sizeTree, ft)[1] - d + nt) / 2 : ut -= k, dt && (ut += dt);
|
|
1059
1057
|
const At = (xt) => {
|
|
1060
|
-
T(), xt ? (V("retrying to scroll to", { location:
|
|
1058
|
+
T(), xt ? (V("retrying to scroll to", { location: R }, mt.DEBUG), W(f, R)) : (W(C, !0), V("list did not change, scroll successful", {}, mt.DEBUG));
|
|
1061
1059
|
};
|
|
1062
|
-
if (T(),
|
|
1060
|
+
if (T(), it === "smooth") {
|
|
1063
1061
|
let xt = !1;
|
|
1064
|
-
|
|
1062
|
+
u = K(e, (Xt) => {
|
|
1065
1063
|
xt = xt || Xt;
|
|
1066
|
-
}),
|
|
1064
|
+
}), S = bt(p, () => {
|
|
1067
1065
|
At(xt);
|
|
1068
1066
|
});
|
|
1069
1067
|
} else
|
|
1070
|
-
|
|
1071
|
-
return
|
|
1068
|
+
S = bt(x(e, Lo(150)), At);
|
|
1069
|
+
return m = setTimeout(() => {
|
|
1072
1070
|
T();
|
|
1073
|
-
}, 1200), W(c, !0), V("scrolling from index to", { behavior:
|
|
1071
|
+
}, 1200), W(c, !0), V("scrolling from index to", { behavior: it, index: ft, top: ut }, mt.DEBUG), { behavior: it, top: ut };
|
|
1074
1072
|
}
|
|
1075
1073
|
)
|
|
1076
1074
|
),
|
|
1077
|
-
|
|
1075
|
+
a
|
|
1078
1076
|
), {
|
|
1079
|
-
scrollTargetReached:
|
|
1080
|
-
scrollToIndex:
|
|
1081
|
-
topListHeight:
|
|
1077
|
+
scrollTargetReached: C,
|
|
1078
|
+
scrollToIndex: f,
|
|
1079
|
+
topListHeight: w
|
|
1082
1080
|
};
|
|
1083
1081
|
},
|
|
1084
1082
|
X(Et, at, Vt),
|
|
@@ -1105,41 +1103,41 @@ function Ue(t, e) {
|
|
|
1105
1103
|
}
|
|
1106
1104
|
const ue = U(
|
|
1107
1105
|
([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
|
|
1108
|
-
const l =
|
|
1109
|
-
return
|
|
1106
|
+
const l = v(!0), c = v(0), a = v(!0);
|
|
1107
|
+
return O(
|
|
1110
1108
|
x(
|
|
1111
1109
|
i,
|
|
1112
|
-
|
|
1113
|
-
P(([
|
|
1114
|
-
|
|
1110
|
+
_(c),
|
|
1111
|
+
P(([p, I]) => !!I),
|
|
1112
|
+
yt(!1)
|
|
1115
1113
|
),
|
|
1116
1114
|
l
|
|
1117
|
-
),
|
|
1115
|
+
), O(
|
|
1118
1116
|
x(
|
|
1119
1117
|
i,
|
|
1120
|
-
|
|
1121
|
-
P(([
|
|
1122
|
-
|
|
1118
|
+
_(c),
|
|
1119
|
+
P(([p, I]) => !!I),
|
|
1120
|
+
yt(!1)
|
|
1123
1121
|
),
|
|
1124
|
-
|
|
1122
|
+
a
|
|
1125
1123
|
), K(
|
|
1126
1124
|
x(
|
|
1127
1125
|
rt(e, i),
|
|
1128
|
-
|
|
1129
|
-
P(([[,
|
|
1130
|
-
|
|
1126
|
+
_(l, n, t, a),
|
|
1127
|
+
P(([[, p], I, { sizeTree: h }, f, C]) => p && (!j(h) || Me(f)) && !I && !C),
|
|
1128
|
+
_(c)
|
|
1131
1129
|
),
|
|
1132
|
-
([,
|
|
1133
|
-
|
|
1134
|
-
W(
|
|
1130
|
+
([, p]) => {
|
|
1131
|
+
bt(r, () => {
|
|
1132
|
+
W(a, !0);
|
|
1135
1133
|
}), $e(4, () => {
|
|
1136
|
-
|
|
1134
|
+
bt(o, () => {
|
|
1137
1135
|
W(l, !0);
|
|
1138
|
-
}), W(s,
|
|
1136
|
+
}), W(s, p);
|
|
1139
1137
|
});
|
|
1140
1138
|
}
|
|
1141
1139
|
), {
|
|
1142
|
-
initialItemFinalLocationReached:
|
|
1140
|
+
initialItemFinalLocationReached: a,
|
|
1143
1141
|
initialTopMostItemIndex: c,
|
|
1144
1142
|
scrolledToInitialItem: l
|
|
1145
1143
|
};
|
|
@@ -1147,7 +1145,7 @@ const ue = U(
|
|
|
1147
1145
|
X(Et, at, ce, Pt),
|
|
1148
1146
|
{ singleton: !0 }
|
|
1149
1147
|
);
|
|
1150
|
-
function
|
|
1148
|
+
function Nn(t, e) {
|
|
1151
1149
|
return Math.abs(t - e) < 1.01;
|
|
1152
1150
|
}
|
|
1153
1151
|
const le = "up", te = "down", zo = "none", Vo = {
|
|
@@ -1160,36 +1158,36 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1160
1158
|
viewportHeight: 0
|
|
1161
1159
|
}
|
|
1162
1160
|
}, Po = 0, ae = U(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
|
|
1163
|
-
const i =
|
|
1161
|
+
const i = v(!1), l = v(!0), c = $(), a = $(), p = v(4), I = v(Po), h = ct(
|
|
1164
1162
|
x(
|
|
1165
|
-
an(x(A(r), jt(1),
|
|
1163
|
+
an(x(A(r), jt(1), yt(!0)), x(A(r), jt(1), yt(!1), un(100))),
|
|
1166
1164
|
Y()
|
|
1167
1165
|
),
|
|
1168
1166
|
!1
|
|
1169
|
-
),
|
|
1170
|
-
x(an(x(n,
|
|
1167
|
+
), f = ct(
|
|
1168
|
+
x(an(x(n, yt(!0)), x(n, yt(!1), un(200))), Y()),
|
|
1171
1169
|
!1
|
|
1172
1170
|
);
|
|
1173
|
-
|
|
1171
|
+
O(
|
|
1174
1172
|
x(
|
|
1175
|
-
rt(A(r), A(
|
|
1176
|
-
E(([
|
|
1173
|
+
rt(A(r), A(I)),
|
|
1174
|
+
E(([u, T]) => u <= T),
|
|
1177
1175
|
Y()
|
|
1178
1176
|
),
|
|
1179
1177
|
l
|
|
1180
|
-
),
|
|
1181
|
-
const
|
|
1178
|
+
), O(x(l, Lt(50)), a);
|
|
1179
|
+
const C = ht(
|
|
1182
1180
|
x(
|
|
1183
|
-
rt(o, A(s), A(e), A(t), A(
|
|
1184
|
-
|
|
1185
|
-
const
|
|
1181
|
+
rt(o, A(s), A(e), A(t), A(p)),
|
|
1182
|
+
Rt((u, [{ scrollHeight: T, scrollTop: R }, g, d, b, k]) => {
|
|
1183
|
+
const F = R + g - T > -k, L = {
|
|
1186
1184
|
scrollHeight: T,
|
|
1187
|
-
scrollTop:
|
|
1188
|
-
viewportHeight:
|
|
1185
|
+
scrollTop: R,
|
|
1186
|
+
viewportHeight: g
|
|
1189
1187
|
};
|
|
1190
|
-
if (
|
|
1188
|
+
if (F) {
|
|
1191
1189
|
let D, J;
|
|
1192
|
-
return
|
|
1190
|
+
return R > u.state.scrollTop ? (D = "SCROLLED_DOWN", J = u.state.scrollTop - R) : (D = "SIZE_DECREASED", J = u.state.scrollTop - R || u.scrollTopDelta), {
|
|
1193
1191
|
atBottom: !0,
|
|
1194
1192
|
atBottomBecause: D,
|
|
1195
1193
|
scrollTopDelta: J,
|
|
@@ -1197,99 +1195,99 @@ const le = "up", te = "down", zo = "none", Vo = {
|
|
|
1197
1195
|
};
|
|
1198
1196
|
}
|
|
1199
1197
|
let V;
|
|
1200
|
-
return L.scrollHeight >
|
|
1198
|
+
return L.scrollHeight > u.state.scrollHeight ? V = "SIZE_INCREASED" : g < u.state.viewportHeight ? V = "VIEWPORT_HEIGHT_DECREASING" : R < u.state.scrollTop ? V = "SCROLLING_UPWARDS" : V = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
1201
1199
|
atBottom: !1,
|
|
1202
1200
|
notAtBottomBecause: V,
|
|
1203
1201
|
state: L
|
|
1204
1202
|
};
|
|
1205
1203
|
}, Vo),
|
|
1206
|
-
Y((
|
|
1204
|
+
Y((u, T) => u && u.atBottom === T.atBottom)
|
|
1207
1205
|
)
|
|
1208
|
-
),
|
|
1206
|
+
), w = ct(
|
|
1209
1207
|
x(
|
|
1210
1208
|
o,
|
|
1211
|
-
|
|
1212
|
-
(
|
|
1213
|
-
if (
|
|
1209
|
+
Rt(
|
|
1210
|
+
(u, { scrollHeight: T, scrollTop: R, viewportHeight: g }) => {
|
|
1211
|
+
if (Nn(u.scrollHeight, T))
|
|
1214
1212
|
return {
|
|
1215
1213
|
changed: !1,
|
|
1216
1214
|
jump: 0,
|
|
1217
1215
|
scrollHeight: T,
|
|
1218
|
-
scrollTop:
|
|
1216
|
+
scrollTop: R
|
|
1219
1217
|
};
|
|
1220
1218
|
{
|
|
1221
|
-
const d = T - (
|
|
1222
|
-
return
|
|
1219
|
+
const d = T - (R + g) < 1;
|
|
1220
|
+
return u.scrollTop !== R && d ? {
|
|
1223
1221
|
changed: !0,
|
|
1224
|
-
jump:
|
|
1222
|
+
jump: u.scrollTop - R,
|
|
1225
1223
|
scrollHeight: T,
|
|
1226
|
-
scrollTop:
|
|
1224
|
+
scrollTop: R
|
|
1227
1225
|
} : {
|
|
1228
1226
|
changed: !0,
|
|
1229
1227
|
jump: 0,
|
|
1230
1228
|
scrollHeight: T,
|
|
1231
|
-
scrollTop:
|
|
1229
|
+
scrollTop: R
|
|
1232
1230
|
};
|
|
1233
1231
|
}
|
|
1234
1232
|
},
|
|
1235
1233
|
{ changed: !1, jump: 0, scrollHeight: 0, scrollTop: 0 }
|
|
1236
1234
|
),
|
|
1237
|
-
P((
|
|
1238
|
-
E((
|
|
1235
|
+
P((u) => u.changed),
|
|
1236
|
+
E((u) => u.jump)
|
|
1239
1237
|
),
|
|
1240
1238
|
0
|
|
1241
1239
|
);
|
|
1242
|
-
|
|
1240
|
+
O(
|
|
1243
1241
|
x(
|
|
1244
|
-
|
|
1245
|
-
E((
|
|
1242
|
+
C,
|
|
1243
|
+
E((u) => u.atBottom)
|
|
1246
1244
|
),
|
|
1247
1245
|
i
|
|
1248
|
-
),
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1246
|
+
), O(x(i, Lt(50)), c);
|
|
1247
|
+
const S = v(te);
|
|
1248
|
+
O(
|
|
1251
1249
|
x(
|
|
1252
1250
|
o,
|
|
1253
|
-
E(({ scrollTop:
|
|
1251
|
+
E(({ scrollTop: u }) => u),
|
|
1254
1252
|
Y(),
|
|
1255
|
-
|
|
1256
|
-
(
|
|
1253
|
+
Rt(
|
|
1254
|
+
(u, T) => st(f) ? { direction: u.direction, prevScrollTop: T } : { direction: T < u.prevScrollTop ? le : te, prevScrollTop: T },
|
|
1257
1255
|
{ direction: te, prevScrollTop: 0 }
|
|
1258
1256
|
),
|
|
1259
|
-
E((
|
|
1257
|
+
E((u) => u.direction)
|
|
1260
1258
|
),
|
|
1261
|
-
|
|
1262
|
-
),
|
|
1263
|
-
const
|
|
1264
|
-
return
|
|
1259
|
+
S
|
|
1260
|
+
), O(x(o, Lt(50), yt(zo)), S);
|
|
1261
|
+
const m = v(0);
|
|
1262
|
+
return O(
|
|
1265
1263
|
x(
|
|
1266
|
-
|
|
1267
|
-
P((
|
|
1268
|
-
|
|
1264
|
+
h,
|
|
1265
|
+
P((u) => !u),
|
|
1266
|
+
yt(0)
|
|
1269
1267
|
),
|
|
1270
|
-
|
|
1271
|
-
),
|
|
1268
|
+
m
|
|
1269
|
+
), O(
|
|
1272
1270
|
x(
|
|
1273
1271
|
r,
|
|
1274
1272
|
Lt(100),
|
|
1275
|
-
|
|
1276
|
-
P(([
|
|
1277
|
-
|
|
1278
|
-
E(([
|
|
1273
|
+
_(h),
|
|
1274
|
+
P(([u, T]) => !!T),
|
|
1275
|
+
Rt(([u, T], [R]) => [T, R], [0, 0]),
|
|
1276
|
+
E(([u, T]) => T - u)
|
|
1279
1277
|
),
|
|
1280
|
-
|
|
1278
|
+
m
|
|
1281
1279
|
), {
|
|
1282
|
-
atBottomState:
|
|
1280
|
+
atBottomState: C,
|
|
1283
1281
|
atBottomStateChange: c,
|
|
1284
|
-
atBottomThreshold:
|
|
1285
|
-
atTopStateChange:
|
|
1286
|
-
atTopThreshold:
|
|
1282
|
+
atBottomThreshold: p,
|
|
1283
|
+
atTopStateChange: a,
|
|
1284
|
+
atTopThreshold: I,
|
|
1287
1285
|
isAtBottom: i,
|
|
1288
1286
|
isAtTop: l,
|
|
1289
|
-
isScrolling:
|
|
1290
|
-
lastJumpDueToItemResize:
|
|
1291
|
-
scrollDirection:
|
|
1292
|
-
scrollVelocity:
|
|
1287
|
+
isScrolling: h,
|
|
1288
|
+
lastJumpDueToItemResize: w,
|
|
1289
|
+
scrollDirection: S,
|
|
1290
|
+
scrollVelocity: m
|
|
1293
1291
|
};
|
|
1294
1292
|
}, X(at)), xe = "top", Te = "bottom", pn = "none";
|
|
1295
1293
|
function hn(t, e, n) {
|
|
@@ -1301,7 +1299,7 @@ function gn(t, e) {
|
|
|
1301
1299
|
}
|
|
1302
1300
|
const Ke = U(
|
|
1303
1301
|
([{ deviation: t, fixedHeaderHeight: e, headerHeight: n, scrollTop: o, viewportHeight: r }]) => {
|
|
1304
|
-
const s = $(), i =
|
|
1302
|
+
const s = $(), i = v(0), l = v(0), c = v(0), a = ct(
|
|
1305
1303
|
x(
|
|
1306
1304
|
rt(
|
|
1307
1305
|
A(o),
|
|
@@ -1316,26 +1314,26 @@ const Ke = U(
|
|
|
1316
1314
|
),
|
|
1317
1315
|
E(
|
|
1318
1316
|
([
|
|
1319
|
-
f,
|
|
1320
|
-
S,
|
|
1321
1317
|
p,
|
|
1322
|
-
[m, w],
|
|
1323
1318
|
I,
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1319
|
+
h,
|
|
1320
|
+
[f, C],
|
|
1321
|
+
w,
|
|
1322
|
+
S,
|
|
1323
|
+
m,
|
|
1324
|
+
u,
|
|
1327
1325
|
T
|
|
1328
1326
|
]) => {
|
|
1329
|
-
const
|
|
1330
|
-
let
|
|
1331
|
-
const
|
|
1332
|
-
return
|
|
1333
|
-
Math.max(
|
|
1334
|
-
|
|
1327
|
+
const R = p - u, g = S + m, d = Math.max(h - R, 0);
|
|
1328
|
+
let b = pn;
|
|
1329
|
+
const k = gn(T, xe), F = gn(T, Te);
|
|
1330
|
+
return f -= u, f += h + m, C += h + m, C -= u, f > p + g - k && (b = le), C < p - d + I + F && (b = te), b !== pn ? [
|
|
1331
|
+
Math.max(R - h - hn(w, xe, b) - k, 0),
|
|
1332
|
+
R - d - m + I + hn(w, Te, b) + F
|
|
1335
1333
|
] : null;
|
|
1336
1334
|
}
|
|
1337
1335
|
),
|
|
1338
|
-
P((
|
|
1336
|
+
P((p) => p != null),
|
|
1339
1337
|
Y(se)
|
|
1340
1338
|
),
|
|
1341
1339
|
[0, 0]
|
|
@@ -1347,15 +1345,15 @@ const Ke = U(
|
|
|
1347
1345
|
overscan: c,
|
|
1348
1346
|
topListHeight: i,
|
|
1349
1347
|
// output
|
|
1350
|
-
visibleRange:
|
|
1348
|
+
visibleRange: a
|
|
1351
1349
|
};
|
|
1352
1350
|
},
|
|
1353
1351
|
X(at),
|
|
1354
1352
|
{ singleton: !0 }
|
|
1355
1353
|
);
|
|
1356
1354
|
function Ao(t, e, n) {
|
|
1357
|
-
if (
|
|
1358
|
-
const o =
|
|
1355
|
+
if (Re(e)) {
|
|
1356
|
+
const o = Mn(t, e);
|
|
1359
1357
|
return [
|
|
1360
1358
|
{ index: Ct(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
|
|
1361
1359
|
{ data: n == null ? void 0 : n[0], index: o, offset: 0, size: 0 }
|
|
@@ -1363,7 +1361,7 @@ function Ao(t, e, n) {
|
|
|
1363
1361
|
}
|
|
1364
1362
|
return [{ data: n == null ? void 0 : n[0], index: t, offset: 0, size: 0 }];
|
|
1365
1363
|
}
|
|
1366
|
-
const
|
|
1364
|
+
const Be = {
|
|
1367
1365
|
bottom: 0,
|
|
1368
1366
|
firstItemIndex: 0,
|
|
1369
1367
|
items: [],
|
|
@@ -1376,230 +1374,230 @@ const ke = {
|
|
|
1376
1374
|
};
|
|
1377
1375
|
function Ie(t, e, n, o, r, s) {
|
|
1378
1376
|
const { lastIndex: i, lastOffset: l, lastSize: c } = r;
|
|
1379
|
-
let
|
|
1377
|
+
let a = 0, p = 0;
|
|
1380
1378
|
if (t.length > 0) {
|
|
1381
|
-
|
|
1382
|
-
const
|
|
1383
|
-
|
|
1379
|
+
a = t[0].offset;
|
|
1380
|
+
const w = t[t.length - 1];
|
|
1381
|
+
p = w.offset + w.size;
|
|
1384
1382
|
}
|
|
1385
|
-
const
|
|
1383
|
+
const I = n - i, h = l + I * c + (I - 1) * o, f = a, C = h - p;
|
|
1386
1384
|
return {
|
|
1387
|
-
bottom:
|
|
1385
|
+
bottom: p,
|
|
1388
1386
|
firstItemIndex: s,
|
|
1389
1387
|
items: In(t, r, s),
|
|
1390
|
-
offsetBottom:
|
|
1391
|
-
offsetTop:
|
|
1392
|
-
top:
|
|
1388
|
+
offsetBottom: C,
|
|
1389
|
+
offsetTop: a,
|
|
1390
|
+
top: f,
|
|
1393
1391
|
topItems: In(e, r, s),
|
|
1394
|
-
topListHeight: e.reduce((
|
|
1392
|
+
topListHeight: e.reduce((w, S) => S.size + w, 0),
|
|
1395
1393
|
totalCount: n
|
|
1396
1394
|
};
|
|
1397
1395
|
}
|
|
1398
|
-
function
|
|
1396
|
+
function Dn(t, e, n, o, r, s) {
|
|
1399
1397
|
let i = 0;
|
|
1400
1398
|
if (n.groupIndices.length > 0)
|
|
1401
|
-
for (const
|
|
1402
|
-
if (
|
|
1399
|
+
for (const p of n.groupIndices) {
|
|
1400
|
+
if (p - i >= t)
|
|
1403
1401
|
break;
|
|
1404
1402
|
i++;
|
|
1405
1403
|
}
|
|
1406
|
-
const l = t + i, c = Ue(e, l),
|
|
1407
|
-
data: s[
|
|
1408
|
-
index:
|
|
1404
|
+
const l = t + i, c = Ue(e, l), a = Array.from({ length: l }).map((p, I) => ({
|
|
1405
|
+
data: s[I + c],
|
|
1406
|
+
index: I + c,
|
|
1409
1407
|
offset: 0,
|
|
1410
1408
|
size: 0
|
|
1411
1409
|
}));
|
|
1412
|
-
return Ie(
|
|
1410
|
+
return Ie(a, [], l, r, n, o);
|
|
1413
1411
|
}
|
|
1414
1412
|
function In(t, e, n) {
|
|
1415
1413
|
if (t.length === 0)
|
|
1416
1414
|
return [];
|
|
1417
|
-
if (!
|
|
1418
|
-
return t.map((
|
|
1419
|
-
const o = t[0].index, r = t[t.length - 1].index, s = [], i =
|
|
1415
|
+
if (!Re(e))
|
|
1416
|
+
return t.map((a) => ({ ...a, index: a.index + n, originalIndex: a.index }));
|
|
1417
|
+
const o = t[0].index, r = t[t.length - 1].index, s = [], i = ye(e.groupOffsetTree, o, r);
|
|
1420
1418
|
let l, c = 0;
|
|
1421
|
-
for (const
|
|
1422
|
-
(!l || l.end <
|
|
1423
|
-
let
|
|
1424
|
-
|
|
1419
|
+
for (const a of t) {
|
|
1420
|
+
(!l || l.end < a.index) && (l = i.shift(), c = e.groupIndices.indexOf(l.start));
|
|
1421
|
+
let p;
|
|
1422
|
+
a.index === l.start ? p = {
|
|
1425
1423
|
index: c,
|
|
1426
1424
|
type: "group"
|
|
1427
|
-
} :
|
|
1425
|
+
} : p = {
|
|
1428
1426
|
groupIndex: c,
|
|
1429
|
-
index:
|
|
1427
|
+
index: a.index - (c + 1) + n
|
|
1430
1428
|
}, s.push({
|
|
1431
|
-
...
|
|
1432
|
-
data:
|
|
1433
|
-
offset:
|
|
1434
|
-
originalIndex:
|
|
1435
|
-
size:
|
|
1429
|
+
...p,
|
|
1430
|
+
data: a.data,
|
|
1431
|
+
offset: a.offset,
|
|
1432
|
+
originalIndex: a.index,
|
|
1433
|
+
size: a.size
|
|
1436
1434
|
});
|
|
1437
1435
|
}
|
|
1438
1436
|
return s;
|
|
1439
1437
|
}
|
|
1440
|
-
const
|
|
1438
|
+
const _t = U(
|
|
1441
1439
|
([
|
|
1442
1440
|
{ data: t, firstItemIndex: e, gap: n, sizes: o, totalCount: r },
|
|
1443
1441
|
s,
|
|
1444
1442
|
{ listBoundary: i, topListHeight: l, visibleRange: c },
|
|
1445
|
-
{ initialTopMostItemIndex:
|
|
1446
|
-
{ topListHeight:
|
|
1447
|
-
|
|
1448
|
-
{ didMount:
|
|
1449
|
-
{ recalcInProgress:
|
|
1443
|
+
{ initialTopMostItemIndex: a, scrolledToInitialItem: p },
|
|
1444
|
+
{ topListHeight: I },
|
|
1445
|
+
h,
|
|
1446
|
+
{ didMount: f },
|
|
1447
|
+
{ recalcInProgress: C }
|
|
1450
1448
|
]) => {
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
const
|
|
1449
|
+
const w = v([]), S = v(0), m = $();
|
|
1450
|
+
O(s.topItemsIndexes, w);
|
|
1451
|
+
const u = ct(
|
|
1454
1452
|
x(
|
|
1455
1453
|
rt(
|
|
1456
|
-
|
|
1457
|
-
|
|
1454
|
+
f,
|
|
1455
|
+
C,
|
|
1458
1456
|
A(c, se),
|
|
1459
1457
|
A(r),
|
|
1460
1458
|
A(o),
|
|
1461
|
-
A(
|
|
1462
|
-
|
|
1463
|
-
A(
|
|
1459
|
+
A(a),
|
|
1460
|
+
p,
|
|
1461
|
+
A(w),
|
|
1464
1462
|
A(e),
|
|
1465
1463
|
A(n),
|
|
1466
1464
|
t
|
|
1467
1465
|
),
|
|
1468
|
-
P(([d,
|
|
1469
|
-
const L =
|
|
1470
|
-
return d && !
|
|
1466
|
+
P(([d, b, , k, , , , , , , F]) => {
|
|
1467
|
+
const L = F && F.length !== k;
|
|
1468
|
+
return d && !b && !L;
|
|
1471
1469
|
}),
|
|
1472
1470
|
E(
|
|
1473
1471
|
([
|
|
1474
1472
|
,
|
|
1475
1473
|
,
|
|
1476
|
-
[d,
|
|
1477
|
-
|
|
1478
|
-
|
|
1474
|
+
[d, b],
|
|
1475
|
+
k,
|
|
1476
|
+
F,
|
|
1479
1477
|
L,
|
|
1480
1478
|
V,
|
|
1481
1479
|
D,
|
|
1482
1480
|
J,
|
|
1483
1481
|
nt,
|
|
1484
|
-
|
|
1482
|
+
B
|
|
1485
1483
|
]) => {
|
|
1486
|
-
const q =
|
|
1487
|
-
if (
|
|
1488
|
-
return { ...
|
|
1489
|
-
if (d === 0 &&
|
|
1490
|
-
return St === 0 ? { ...
|
|
1484
|
+
const q = F, { offsetTree: it, sizeTree: dt } = q, St = st(S);
|
|
1485
|
+
if (k === 0)
|
|
1486
|
+
return { ...Be, totalCount: k };
|
|
1487
|
+
if (d === 0 && b === 0)
|
|
1488
|
+
return St === 0 ? { ...Be, totalCount: k } : Dn(St, L, F, J, nt, B || []);
|
|
1491
1489
|
if (j(dt))
|
|
1492
1490
|
return St > 0 ? null : Ie(
|
|
1493
|
-
Ao(Ue(L,
|
|
1491
|
+
Ao(Ue(L, k), q, B),
|
|
1494
1492
|
[],
|
|
1495
|
-
|
|
1493
|
+
k,
|
|
1496
1494
|
nt,
|
|
1497
1495
|
q,
|
|
1498
1496
|
J
|
|
1499
1497
|
);
|
|
1500
1498
|
const ft = [];
|
|
1501
1499
|
if (D.length > 0) {
|
|
1502
|
-
const Mt = D[0],
|
|
1503
|
-
let
|
|
1504
|
-
for (const
|
|
1505
|
-
const N =
|
|
1506
|
-
for (let tt = Q; tt <=
|
|
1507
|
-
ft.push({ data:
|
|
1500
|
+
const Mt = D[0], vt = D[D.length - 1];
|
|
1501
|
+
let Bt = 0;
|
|
1502
|
+
for (const y of ye(dt, Mt, vt)) {
|
|
1503
|
+
const N = y.value, Q = Math.max(y.start, Mt), lt = Math.min(y.end, vt);
|
|
1504
|
+
for (let tt = Q; tt <= lt; tt++)
|
|
1505
|
+
ft.push({ data: B == null ? void 0 : B[tt], index: tt, offset: Bt, size: N }), Bt += N;
|
|
1508
1506
|
}
|
|
1509
1507
|
}
|
|
1510
1508
|
if (!V)
|
|
1511
|
-
return Ie([], ft,
|
|
1512
|
-
const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At =
|
|
1509
|
+
return Ie([], ft, k, nt, q, J);
|
|
1510
|
+
const ut = D.length > 0 ? D[D.length - 1] + 1 : 0, At = Ro(it, d, b, ut);
|
|
1513
1511
|
if (At.length === 0)
|
|
1514
1512
|
return null;
|
|
1515
|
-
const xt =
|
|
1516
|
-
for (const
|
|
1517
|
-
const
|
|
1518
|
-
let
|
|
1519
|
-
const Q =
|
|
1520
|
-
if (
|
|
1521
|
-
N += Math.floor((d -
|
|
1522
|
-
const tt = N -
|
|
1523
|
-
|
|
1513
|
+
const xt = k - 1, Xt = ve([], (Mt) => {
|
|
1514
|
+
for (const vt of At) {
|
|
1515
|
+
const Bt = vt.value;
|
|
1516
|
+
let y = Bt.offset, N = vt.start;
|
|
1517
|
+
const Q = Bt.size;
|
|
1518
|
+
if (Bt.offset < d) {
|
|
1519
|
+
N += Math.floor((d - Bt.offset + nt) / (Q + nt));
|
|
1520
|
+
const tt = N - vt.start;
|
|
1521
|
+
y += tt * Q + tt * nt;
|
|
1524
1522
|
}
|
|
1525
|
-
N < ut && (
|
|
1526
|
-
const
|
|
1527
|
-
for (let tt = N; tt <=
|
|
1528
|
-
Mt.push({ data:
|
|
1523
|
+
N < ut && (y += (ut - N) * Q, N = ut);
|
|
1524
|
+
const lt = Math.min(vt.end, xt);
|
|
1525
|
+
for (let tt = N; tt <= lt && !(y >= b); tt++)
|
|
1526
|
+
Mt.push({ data: B == null ? void 0 : B[tt], index: tt, offset: y, size: Q }), y += Q + nt;
|
|
1529
1527
|
}
|
|
1530
1528
|
});
|
|
1531
|
-
return Ie(Xt, ft,
|
|
1529
|
+
return Ie(Xt, ft, k, nt, q, J);
|
|
1532
1530
|
}
|
|
1533
1531
|
),
|
|
1534
1532
|
//@ts-expect-error filter needs to be fixed
|
|
1535
1533
|
P((d) => d !== null),
|
|
1536
1534
|
Y()
|
|
1537
1535
|
),
|
|
1538
|
-
|
|
1536
|
+
Be
|
|
1539
1537
|
);
|
|
1540
|
-
|
|
1538
|
+
O(
|
|
1541
1539
|
x(
|
|
1542
1540
|
t,
|
|
1543
1541
|
P(Me),
|
|
1544
1542
|
E((d) => d == null ? void 0 : d.length)
|
|
1545
1543
|
),
|
|
1546
1544
|
r
|
|
1547
|
-
),
|
|
1545
|
+
), O(
|
|
1548
1546
|
x(
|
|
1549
|
-
|
|
1547
|
+
u,
|
|
1550
1548
|
E((d) => d.topListHeight)
|
|
1551
1549
|
),
|
|
1552
|
-
|
|
1553
|
-
),
|
|
1550
|
+
I
|
|
1551
|
+
), O(I, l), O(
|
|
1554
1552
|
x(
|
|
1555
|
-
|
|
1553
|
+
u,
|
|
1556
1554
|
E((d) => [d.top, d.bottom])
|
|
1557
1555
|
),
|
|
1558
1556
|
i
|
|
1559
|
-
),
|
|
1557
|
+
), O(
|
|
1560
1558
|
x(
|
|
1561
|
-
|
|
1559
|
+
u,
|
|
1562
1560
|
E((d) => d.items)
|
|
1563
1561
|
),
|
|
1564
|
-
|
|
1562
|
+
m
|
|
1565
1563
|
);
|
|
1566
|
-
const T =
|
|
1564
|
+
const T = ht(
|
|
1567
1565
|
x(
|
|
1568
|
-
|
|
1566
|
+
u,
|
|
1569
1567
|
P(({ items: d }) => d.length > 0),
|
|
1570
|
-
|
|
1571
|
-
P(([{ items: d },
|
|
1572
|
-
E(([, d,
|
|
1568
|
+
_(r, t),
|
|
1569
|
+
P(([{ items: d }, b]) => d[d.length - 1].originalIndex === b - 1),
|
|
1570
|
+
E(([, d, b]) => [d - 1, b]),
|
|
1573
1571
|
Y(se),
|
|
1574
1572
|
E(([d]) => d)
|
|
1575
1573
|
)
|
|
1576
|
-
),
|
|
1574
|
+
), R = ht(
|
|
1577
1575
|
x(
|
|
1578
|
-
|
|
1576
|
+
u,
|
|
1579
1577
|
Lt(200),
|
|
1580
|
-
P(({ items: d, topItems:
|
|
1578
|
+
P(({ items: d, topItems: b }) => d.length > 0 && d[0].originalIndex === b.length),
|
|
1581
1579
|
E(({ items: d }) => d[0].index),
|
|
1582
1580
|
Y()
|
|
1583
1581
|
)
|
|
1584
|
-
),
|
|
1582
|
+
), g = ht(
|
|
1585
1583
|
x(
|
|
1586
|
-
|
|
1584
|
+
u,
|
|
1587
1585
|
P(({ items: d }) => d.length > 0),
|
|
1588
1586
|
E(({ items: d }) => {
|
|
1589
|
-
let
|
|
1590
|
-
for (; d[
|
|
1591
|
-
|
|
1592
|
-
for (; d[
|
|
1593
|
-
|
|
1587
|
+
let b = 0, k = d.length - 1;
|
|
1588
|
+
for (; d[b].type === "group" && b < k; )
|
|
1589
|
+
b++;
|
|
1590
|
+
for (; d[k].type === "group" && k > b; )
|
|
1591
|
+
k--;
|
|
1594
1592
|
return {
|
|
1595
|
-
endIndex: d[
|
|
1596
|
-
startIndex: d[
|
|
1593
|
+
endIndex: d[k].index,
|
|
1594
|
+
startIndex: d[b].index
|
|
1597
1595
|
};
|
|
1598
1596
|
}),
|
|
1599
|
-
Y(
|
|
1597
|
+
Y(Pn)
|
|
1600
1598
|
)
|
|
1601
1599
|
);
|
|
1602
|
-
return { endReached: T, initialItemCount:
|
|
1600
|
+
return { endReached: T, initialItemCount: S, itemsRendered: m, listState: u, rangeChanged: g, startReached: R, topItemsIndexes: w, ...h };
|
|
1603
1601
|
},
|
|
1604
1602
|
X(
|
|
1605
1603
|
Et,
|
|
@@ -1612,22 +1610,22 @@ const Gt = U(
|
|
|
1612
1610
|
Ne
|
|
1613
1611
|
),
|
|
1614
1612
|
{ singleton: !0 }
|
|
1615
|
-
),
|
|
1613
|
+
), $n = U(
|
|
1616
1614
|
([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
|
|
1617
1615
|
const s = $(), i = ct(
|
|
1618
1616
|
x(
|
|
1619
1617
|
rt(n, t, o, e, r),
|
|
1620
|
-
E(([l, c,
|
|
1618
|
+
E(([l, c, a, p, I]) => l + c + a + p + I.offsetBottom + I.bottom)
|
|
1621
1619
|
),
|
|
1622
1620
|
0
|
|
1623
1621
|
);
|
|
1624
|
-
return
|
|
1622
|
+
return O(A(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
1625
1623
|
},
|
|
1626
|
-
X(at,
|
|
1624
|
+
X(at, _t),
|
|
1627
1625
|
{ singleton: !0 }
|
|
1628
1626
|
), Mo = U(
|
|
1629
1627
|
([{ viewportHeight: t }, { totalListHeight: e }]) => {
|
|
1630
|
-
const n =
|
|
1628
|
+
const n = v(!1), o = ct(
|
|
1631
1629
|
x(
|
|
1632
1630
|
rt(n, t, e),
|
|
1633
1631
|
P(([r]) => r),
|
|
@@ -1639,99 +1637,101 @@ const Gt = U(
|
|
|
1639
1637
|
);
|
|
1640
1638
|
return { alignToBottom: n, paddingTopAddition: o };
|
|
1641
1639
|
},
|
|
1642
|
-
X(at,
|
|
1640
|
+
X(at, $n),
|
|
1643
1641
|
{ singleton: !0 }
|
|
1644
1642
|
);
|
|
1645
1643
|
function Sn(t) {
|
|
1646
1644
|
return t ? t === "smooth" ? "smooth" : "auto" : !1;
|
|
1647
1645
|
}
|
|
1648
|
-
const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t),
|
|
1646
|
+
const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), Go = U(
|
|
1649
1647
|
([
|
|
1650
|
-
{ listRefresh: t, totalCount: e },
|
|
1651
|
-
{ atBottomState:
|
|
1652
|
-
{ scrollToIndex:
|
|
1653
|
-
{ scrolledToInitialItem:
|
|
1654
|
-
{ didMount:
|
|
1655
|
-
{ log:
|
|
1656
|
-
{ scrollingInProgress:
|
|
1648
|
+
{ listRefresh: t, totalCount: e, fixedItemSize: n },
|
|
1649
|
+
{ atBottomState: o, isAtBottom: r },
|
|
1650
|
+
{ scrollToIndex: s },
|
|
1651
|
+
{ scrolledToInitialItem: i },
|
|
1652
|
+
{ didMount: l, propsReady: c },
|
|
1653
|
+
{ log: a },
|
|
1654
|
+
{ scrollingInProgress: p }
|
|
1657
1655
|
]) => {
|
|
1658
|
-
const
|
|
1659
|
-
let
|
|
1660
|
-
function
|
|
1661
|
-
W(
|
|
1656
|
+
const I = v(!1), h = $();
|
|
1657
|
+
let f = null;
|
|
1658
|
+
function C(S) {
|
|
1659
|
+
W(s, {
|
|
1662
1660
|
align: "end",
|
|
1663
|
-
behavior:
|
|
1661
|
+
behavior: S,
|
|
1664
1662
|
index: "LAST"
|
|
1665
1663
|
});
|
|
1666
1664
|
}
|
|
1667
1665
|
K(
|
|
1668
1666
|
x(
|
|
1669
|
-
rt(x(A(e), jt(1)),
|
|
1670
|
-
|
|
1671
|
-
E(([[
|
|
1672
|
-
let
|
|
1673
|
-
return
|
|
1667
|
+
rt(x(A(e), jt(1)), l),
|
|
1668
|
+
_(A(I), r, i, p),
|
|
1669
|
+
E(([[S, m], u, T, R, g]) => {
|
|
1670
|
+
let d = m && R, b = "auto";
|
|
1671
|
+
return d && (b = Wo(u, T || g), d = d && !!b), { followOutputBehavior: b, shouldFollow: d, totalCount: S };
|
|
1674
1672
|
}),
|
|
1675
|
-
P(({ shouldFollow:
|
|
1673
|
+
P(({ shouldFollow: S }) => S)
|
|
1676
1674
|
),
|
|
1677
|
-
({ followOutputBehavior:
|
|
1678
|
-
|
|
1679
|
-
|
|
1675
|
+
({ followOutputBehavior: S, totalCount: m }) => {
|
|
1676
|
+
f && (f(), f = null), st(n) ? requestAnimationFrame(() => {
|
|
1677
|
+
st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S);
|
|
1678
|
+
}) : f = bt(t, () => {
|
|
1679
|
+
st(a)("following output to ", { totalCount: m }, mt.DEBUG), C(S), f = null;
|
|
1680
1680
|
});
|
|
1681
1681
|
}
|
|
1682
1682
|
);
|
|
1683
|
-
function w(
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1683
|
+
function w(S) {
|
|
1684
|
+
const m = bt(o, (u) => {
|
|
1685
|
+
S && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && !f && (st(a)("scrolling to bottom due to increased size", {}, mt.DEBUG), C("auto"));
|
|
1686
1686
|
});
|
|
1687
|
-
setTimeout(
|
|
1687
|
+
setTimeout(m, 100);
|
|
1688
1688
|
}
|
|
1689
1689
|
return K(
|
|
1690
1690
|
x(
|
|
1691
|
-
rt(A(
|
|
1692
|
-
P(([
|
|
1693
|
-
|
|
1694
|
-
({ value:
|
|
1691
|
+
rt(A(I), e, c),
|
|
1692
|
+
P(([S, , m]) => S && m),
|
|
1693
|
+
Rt(
|
|
1694
|
+
({ value: S }, [, m]) => ({ refreshed: S === m, value: m }),
|
|
1695
1695
|
{ refreshed: !1, value: 0 }
|
|
1696
1696
|
),
|
|
1697
|
-
P(({ refreshed:
|
|
1698
|
-
|
|
1697
|
+
P(({ refreshed: S }) => S),
|
|
1698
|
+
_(I, e)
|
|
1699
1699
|
),
|
|
1700
|
-
([,
|
|
1701
|
-
|
|
1700
|
+
([, S]) => {
|
|
1701
|
+
st(i) && w(S !== !1);
|
|
1702
1702
|
}
|
|
1703
|
-
), K(
|
|
1704
|
-
w(
|
|
1705
|
-
}), K(rt(A(
|
|
1706
|
-
|
|
1707
|
-
}), { autoscrollToBottom:
|
|
1703
|
+
), K(h, () => {
|
|
1704
|
+
w(st(I) !== !1);
|
|
1705
|
+
}), K(rt(A(I), o), ([S, m]) => {
|
|
1706
|
+
S && !m.atBottom && m.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && C("auto");
|
|
1707
|
+
}), { autoscrollToBottom: h, followOutput: I };
|
|
1708
1708
|
},
|
|
1709
1709
|
X(Et, ae, ce, ue, Pt, Vt, at)
|
|
1710
|
-
),
|
|
1711
|
-
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (
|
|
1710
|
+
), _o = U(
|
|
1711
|
+
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (O(
|
|
1712
1712
|
x(
|
|
1713
1713
|
l,
|
|
1714
|
-
|
|
1714
|
+
_(s),
|
|
1715
1715
|
P(([, c]) => c !== 0),
|
|
1716
|
-
|
|
1717
|
-
E(([[, c],
|
|
1716
|
+
_(r, o, e, n, t),
|
|
1717
|
+
E(([[, c], a, p, I, h, f = []]) => Dn(c, a, p, I, h, f))
|
|
1718
1718
|
),
|
|
1719
1719
|
i
|
|
1720
1720
|
), {}),
|
|
1721
|
-
X(Et, ue,
|
|
1721
|
+
X(Et, ue, _t, Pt),
|
|
1722
1722
|
{ singleton: !0 }
|
|
1723
1723
|
), No = U(
|
|
1724
1724
|
([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
|
|
1725
|
-
const o =
|
|
1725
|
+
const o = v(0);
|
|
1726
1726
|
return K(
|
|
1727
1727
|
x(
|
|
1728
1728
|
t,
|
|
1729
|
-
|
|
1729
|
+
_(o),
|
|
1730
1730
|
P(([, r]) => r !== 0),
|
|
1731
1731
|
E(([, r]) => ({ top: r }))
|
|
1732
1732
|
),
|
|
1733
1733
|
(r) => {
|
|
1734
|
-
|
|
1734
|
+
bt(
|
|
1735
1735
|
x(
|
|
1736
1736
|
n,
|
|
1737
1737
|
jt(1),
|
|
@@ -1748,7 +1748,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1748
1748
|
initialScrollTop: o
|
|
1749
1749
|
};
|
|
1750
1750
|
},
|
|
1751
|
-
X(Pt, at,
|
|
1751
|
+
X(Pt, at, _t),
|
|
1752
1752
|
{ singleton: !0 }
|
|
1753
1753
|
), Do = ({
|
|
1754
1754
|
itemBottom: t,
|
|
@@ -1760,54 +1760,54 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1760
1760
|
([
|
|
1761
1761
|
{ gap: t, sizes: e, totalCount: n },
|
|
1762
1762
|
{ fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
|
|
1763
|
-
{ scrollToIndex:
|
|
1763
|
+
{ scrollToIndex: a }
|
|
1764
1764
|
]) => {
|
|
1765
|
-
const
|
|
1766
|
-
return
|
|
1765
|
+
const p = $();
|
|
1766
|
+
return O(
|
|
1767
1767
|
x(
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
E(([[
|
|
1772
|
-
const { align:
|
|
1768
|
+
p,
|
|
1769
|
+
_(e, c, n, s, r, o, l),
|
|
1770
|
+
_(t),
|
|
1771
|
+
E(([[I, h, f, C, w, S, m, u], T]) => {
|
|
1772
|
+
const { align: R, behavior: g, calculateViewLocation: d = Do, done: b, ...k } = I, F = Wn(I, h, C - 1), L = ie(F, h.offsetTree, T) + w + S, V = L + Ct(h.sizeTree, F)[1], D = u + S, J = u + f - m, nt = d({
|
|
1773
1773
|
itemBottom: V,
|
|
1774
1774
|
itemTop: L,
|
|
1775
|
-
locationParams: { align:
|
|
1775
|
+
locationParams: { align: R, behavior: g, ...k },
|
|
1776
1776
|
viewportBottom: J,
|
|
1777
1777
|
viewportTop: D
|
|
1778
1778
|
});
|
|
1779
|
-
return nt ?
|
|
1779
|
+
return nt ? b && bt(
|
|
1780
1780
|
x(
|
|
1781
1781
|
i,
|
|
1782
|
-
P((
|
|
1782
|
+
P((B) => !B),
|
|
1783
1783
|
// skips the initial publish of false, and the cleanup call.
|
|
1784
1784
|
// but if scrollingInProgress is true, we skip the initial publish.
|
|
1785
|
-
jt(
|
|
1785
|
+
jt(st(i) ? 1 : 2)
|
|
1786
1786
|
),
|
|
1787
|
-
|
|
1788
|
-
) :
|
|
1787
|
+
b
|
|
1788
|
+
) : b && b(), nt;
|
|
1789
1789
|
}),
|
|
1790
|
-
P((
|
|
1790
|
+
P((I) => I !== null)
|
|
1791
1791
|
),
|
|
1792
|
-
|
|
1792
|
+
a
|
|
1793
1793
|
), {
|
|
1794
|
-
scrollIntoView:
|
|
1794
|
+
scrollIntoView: p
|
|
1795
1795
|
};
|
|
1796
1796
|
},
|
|
1797
|
-
X(Et, at, ce,
|
|
1797
|
+
X(Et, at, ce, _t, Vt),
|
|
1798
1798
|
{ singleton: !0 }
|
|
1799
|
-
),
|
|
1799
|
+
), Un = U(
|
|
1800
1800
|
([{ scrollVelocity: t }]) => {
|
|
1801
|
-
const e =
|
|
1802
|
-
return
|
|
1801
|
+
const e = v(!1), n = $(), o = v(!1);
|
|
1802
|
+
return O(
|
|
1803
1803
|
x(
|
|
1804
1804
|
t,
|
|
1805
|
-
|
|
1805
|
+
_(o, e, n),
|
|
1806
1806
|
P(([r, s]) => !!s),
|
|
1807
1807
|
E(([r, s, i, l]) => {
|
|
1808
|
-
const { enter: c, exit:
|
|
1808
|
+
const { enter: c, exit: a } = s;
|
|
1809
1809
|
if (i) {
|
|
1810
|
-
if (
|
|
1810
|
+
if (a(r, l))
|
|
1811
1811
|
return !1;
|
|
1812
1812
|
} else if (c(r, l))
|
|
1813
1813
|
return !0;
|
|
@@ -1817,7 +1817,7 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1817
1817
|
),
|
|
1818
1818
|
e
|
|
1819
1819
|
), K(
|
|
1820
|
-
x(rt(e, t, n),
|
|
1820
|
+
x(rt(e, t, n), _(o)),
|
|
1821
1821
|
([[r, s, i], l]) => {
|
|
1822
1822
|
r && l && l.change && l.change(s, i);
|
|
1823
1823
|
}
|
|
@@ -1826,21 +1826,21 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1826
1826
|
X(ae),
|
|
1827
1827
|
{ singleton: !0 }
|
|
1828
1828
|
), je = U(([{ scrollContainerState: t, scrollTo: e }]) => {
|
|
1829
|
-
const n = $(), o = $(), r = $(), s =
|
|
1830
|
-
return
|
|
1829
|
+
const n = $(), o = $(), r = $(), s = v(!1), i = v(void 0);
|
|
1830
|
+
return O(
|
|
1831
1831
|
x(
|
|
1832
1832
|
rt(n, o),
|
|
1833
|
-
E(([{ scrollHeight: l, scrollTop: c, viewportHeight:
|
|
1833
|
+
E(([{ scrollHeight: l, scrollTop: c, viewportHeight: a }, { offsetTop: p }]) => ({
|
|
1834
1834
|
scrollHeight: l,
|
|
1835
|
-
scrollTop: Math.max(0, c -
|
|
1836
|
-
viewportHeight:
|
|
1835
|
+
scrollTop: Math.max(0, c - p),
|
|
1836
|
+
viewportHeight: a
|
|
1837
1837
|
}))
|
|
1838
1838
|
),
|
|
1839
1839
|
t
|
|
1840
|
-
),
|
|
1840
|
+
), O(
|
|
1841
1841
|
x(
|
|
1842
1842
|
e,
|
|
1843
|
-
|
|
1843
|
+
_(o),
|
|
1844
1844
|
E(([l, { offsetTop: c }]) => ({
|
|
1845
1845
|
...l,
|
|
1846
1846
|
top: l.top + c
|
|
@@ -1865,28 +1865,28 @@ const Wo = (t, e) => typeof t == "function" ? Sn(t(e)) : e && Sn(t), _o = U(
|
|
|
1865
1865
|
{ didMount: s },
|
|
1866
1866
|
{ useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
|
|
1867
1867
|
]) => {
|
|
1868
|
-
const
|
|
1869
|
-
return
|
|
1868
|
+
const a = $(), p = v(void 0), I = v(null), h = v(null);
|
|
1869
|
+
return O(l, I), O(c, h), K(
|
|
1870
1870
|
x(
|
|
1871
|
-
|
|
1872
|
-
|
|
1871
|
+
a,
|
|
1872
|
+
_(e, o, i, I, h, n)
|
|
1873
1873
|
),
|
|
1874
|
-
([
|
|
1875
|
-
const
|
|
1876
|
-
|
|
1874
|
+
([f, C, w, S, m, u, T]) => {
|
|
1875
|
+
const R = Ho(C.sizeTree);
|
|
1876
|
+
S && m !== null && u !== null && (w = m.scrollTop - u.offsetTop), w -= T, f({ ranges: R, scrollTop: w });
|
|
1877
1877
|
}
|
|
1878
|
-
),
|
|
1878
|
+
), O(x(p, P(Me), E(Ko)), r), O(
|
|
1879
1879
|
x(
|
|
1880
1880
|
s,
|
|
1881
|
-
|
|
1882
|
-
P(([,
|
|
1881
|
+
_(p),
|
|
1882
|
+
P(([, f]) => f !== void 0),
|
|
1883
1883
|
Y(),
|
|
1884
|
-
E(([,
|
|
1884
|
+
E(([, f]) => f.ranges)
|
|
1885
1885
|
),
|
|
1886
1886
|
t
|
|
1887
1887
|
), {
|
|
1888
|
-
getState:
|
|
1889
|
-
restoreStateFrom:
|
|
1888
|
+
getState: a,
|
|
1889
|
+
restoreStateFrom: p
|
|
1890
1890
|
};
|
|
1891
1891
|
},
|
|
1892
1892
|
X(Et, at, ue, Pt, je)
|
|
@@ -1895,8 +1895,8 @@ function Ko(t) {
|
|
|
1895
1895
|
return { align: "start", index: 0, offset: t.scrollTop };
|
|
1896
1896
|
}
|
|
1897
1897
|
const jo = U(([{ topItemsIndexes: t }]) => {
|
|
1898
|
-
const e =
|
|
1899
|
-
return
|
|
1898
|
+
const e = v(0);
|
|
1899
|
+
return O(
|
|
1900
1900
|
x(
|
|
1901
1901
|
e,
|
|
1902
1902
|
P((n) => n >= 0),
|
|
@@ -1904,90 +1904,90 @@ const jo = U(([{ topItemsIndexes: t }]) => {
|
|
|
1904
1904
|
),
|
|
1905
1905
|
t
|
|
1906
1906
|
), { topItemCount: e };
|
|
1907
|
-
}, X(
|
|
1908
|
-
function
|
|
1907
|
+
}, X(_t));
|
|
1908
|
+
function Kn(t) {
|
|
1909
1909
|
let e = !1, n;
|
|
1910
1910
|
return () => (e || (e = !0, n = t()), n);
|
|
1911
1911
|
}
|
|
1912
|
-
const qo =
|
|
1912
|
+
const qo = Kn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), Yo = U(
|
|
1913
1913
|
([
|
|
1914
1914
|
{ deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
|
|
1915
1915
|
{ isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
|
|
1916
1916
|
{ listState: c },
|
|
1917
|
-
{ beforeUnshiftWith:
|
|
1918
|
-
{ log:
|
|
1919
|
-
{ recalcInProgress:
|
|
1917
|
+
{ beforeUnshiftWith: a, gap: p, shiftWithOffset: I, sizes: h },
|
|
1918
|
+
{ log: f },
|
|
1919
|
+
{ recalcInProgress: C }
|
|
1920
1920
|
]) => {
|
|
1921
|
-
const
|
|
1921
|
+
const w = ht(
|
|
1922
1922
|
x(
|
|
1923
1923
|
c,
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
([,
|
|
1927
|
-
const
|
|
1924
|
+
_(i),
|
|
1925
|
+
Rt(
|
|
1926
|
+
([, m, u, T], [{ bottom: R, items: g, offsetBottom: d, totalCount: b }, k]) => {
|
|
1927
|
+
const F = R + d;
|
|
1928
1928
|
let L = 0;
|
|
1929
|
-
return
|
|
1929
|
+
return u === b && m.length > 0 && g.length > 0 && (g[0].originalIndex === 0 && m[0].originalIndex === 0 || (L = F - T, L !== 0 && (L += k))), [L, g, b, F];
|
|
1930
1930
|
},
|
|
1931
1931
|
[0, [], 0, 0]
|
|
1932
1932
|
),
|
|
1933
|
-
P(([
|
|
1934
|
-
|
|
1935
|
-
P(([,
|
|
1936
|
-
E(([[
|
|
1933
|
+
P(([m]) => m !== 0),
|
|
1934
|
+
_(o, l, n, r, f, C),
|
|
1935
|
+
P(([, m, u, T, , , R]) => !R && !T && m !== 0 && u === le),
|
|
1936
|
+
E(([[m], , , , , u]) => (u("Upward scrolling compensation", { amount: m }, mt.DEBUG), m))
|
|
1937
1937
|
)
|
|
1938
1938
|
);
|
|
1939
|
-
function
|
|
1940
|
-
|
|
1939
|
+
function S(m) {
|
|
1940
|
+
m > 0 ? (W(e, { behavior: "auto", top: -m }), W(t, 0)) : (W(t, 0), W(e, { behavior: "auto", top: -m }));
|
|
1941
1941
|
}
|
|
1942
|
-
return K(x(
|
|
1943
|
-
T && qo() ? W(t,
|
|
1942
|
+
return K(x(w, _(t, s)), ([m, u, T]) => {
|
|
1943
|
+
T && qo() ? W(t, u - m) : S(-m);
|
|
1944
1944
|
}), K(
|
|
1945
1945
|
x(
|
|
1946
|
-
rt(ct(s, !1), t,
|
|
1947
|
-
P(([
|
|
1948
|
-
E(([
|
|
1946
|
+
rt(ct(s, !1), t, C),
|
|
1947
|
+
P(([m, u, T]) => !m && !T && u !== 0),
|
|
1948
|
+
E(([m, u]) => u),
|
|
1949
1949
|
Lt(1)
|
|
1950
1950
|
),
|
|
1951
|
-
|
|
1952
|
-
),
|
|
1951
|
+
S
|
|
1952
|
+
), O(
|
|
1953
1953
|
x(
|
|
1954
|
-
|
|
1955
|
-
E((
|
|
1954
|
+
I,
|
|
1955
|
+
E((m) => ({ top: -m }))
|
|
1956
1956
|
),
|
|
1957
1957
|
e
|
|
1958
1958
|
), K(
|
|
1959
1959
|
x(
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
E(([
|
|
1963
|
-
function d(
|
|
1964
|
-
return
|
|
1960
|
+
a,
|
|
1961
|
+
_(h, p),
|
|
1962
|
+
E(([m, { groupIndices: u, lastSize: T, sizeTree: R }, g]) => {
|
|
1963
|
+
function d(b) {
|
|
1964
|
+
return b * (T + g);
|
|
1965
1965
|
}
|
|
1966
|
-
if (
|
|
1967
|
-
return d(
|
|
1966
|
+
if (u.length === 0)
|
|
1967
|
+
return d(m);
|
|
1968
1968
|
{
|
|
1969
|
-
let
|
|
1970
|
-
const
|
|
1971
|
-
let
|
|
1972
|
-
for (;
|
|
1973
|
-
|
|
1974
|
-
let V =
|
|
1975
|
-
|
|
1969
|
+
let b = 0;
|
|
1970
|
+
const k = re(R, 0);
|
|
1971
|
+
let F = 0, L = 0;
|
|
1972
|
+
for (; F < m; ) {
|
|
1973
|
+
F++, b += k;
|
|
1974
|
+
let V = u.length === L + 1 ? 1 / 0 : u[L + 1] - u[L] - 1;
|
|
1975
|
+
F + V > m && (b -= k, V = m - F + 1), F += V, b += d(V), L++;
|
|
1976
1976
|
}
|
|
1977
|
-
return
|
|
1977
|
+
return b;
|
|
1978
1978
|
}
|
|
1979
1979
|
})
|
|
1980
1980
|
),
|
|
1981
|
-
(
|
|
1982
|
-
W(t,
|
|
1983
|
-
W(e, { top:
|
|
1984
|
-
W(t, 0), W(
|
|
1981
|
+
(m) => {
|
|
1982
|
+
W(t, m), requestAnimationFrame(() => {
|
|
1983
|
+
W(e, { top: m }), requestAnimationFrame(() => {
|
|
1984
|
+
W(t, 0), W(C, !1);
|
|
1985
1985
|
});
|
|
1986
1986
|
});
|
|
1987
1987
|
}
|
|
1988
1988
|
), { deviation: t };
|
|
1989
1989
|
},
|
|
1990
|
-
X(at, ae,
|
|
1990
|
+
X(at, ae, _t, Et, Vt, Ne)
|
|
1991
1991
|
), Zo = U(
|
|
1992
1992
|
([
|
|
1993
1993
|
t,
|
|
@@ -1999,7 +1999,7 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
1999
1999
|
i,
|
|
2000
2000
|
l,
|
|
2001
2001
|
c,
|
|
2002
|
-
|
|
2002
|
+
a
|
|
2003
2003
|
]) => ({
|
|
2004
2004
|
...t,
|
|
2005
2005
|
...e,
|
|
@@ -2010,21 +2010,21 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2010
2010
|
...i,
|
|
2011
2011
|
...l,
|
|
2012
2012
|
...c,
|
|
2013
|
-
...
|
|
2013
|
+
...a
|
|
2014
2014
|
}),
|
|
2015
2015
|
X(
|
|
2016
2016
|
Ke,
|
|
2017
|
-
|
|
2017
|
+
_o,
|
|
2018
2018
|
Pt,
|
|
2019
|
-
Kn,
|
|
2020
2019
|
Un,
|
|
2020
|
+
$n,
|
|
2021
2021
|
No,
|
|
2022
2022
|
Mo,
|
|
2023
2023
|
je,
|
|
2024
2024
|
$o,
|
|
2025
2025
|
Vt
|
|
2026
2026
|
)
|
|
2027
|
-
),
|
|
2027
|
+
), jn = U(
|
|
2028
2028
|
([
|
|
2029
2029
|
{
|
|
2030
2030
|
data: t,
|
|
@@ -2036,64 +2036,64 @@ const qo = jn(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2036
2036
|
itemSize: i,
|
|
2037
2037
|
sizeRanges: l,
|
|
2038
2038
|
sizes: c,
|
|
2039
|
-
statefulTotalCount:
|
|
2040
|
-
totalCount:
|
|
2041
|
-
trackItemSizes:
|
|
2039
|
+
statefulTotalCount: a,
|
|
2040
|
+
totalCount: p,
|
|
2041
|
+
trackItemSizes: I
|
|
2042
2042
|
},
|
|
2043
|
-
{ initialItemFinalLocationReached:
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
{ listState:
|
|
2048
|
-
{ scrollToIndex:
|
|
2043
|
+
{ initialItemFinalLocationReached: h, initialTopMostItemIndex: f, scrolledToInitialItem: C },
|
|
2044
|
+
w,
|
|
2045
|
+
S,
|
|
2046
|
+
m,
|
|
2047
|
+
{ listState: u, topItemsIndexes: T, ...R },
|
|
2048
|
+
{ scrollToIndex: g },
|
|
2049
2049
|
d,
|
|
2050
|
-
{ topItemCount:
|
|
2051
|
-
{ groupCounts:
|
|
2052
|
-
|
|
2053
|
-
]) => (
|
|
2050
|
+
{ topItemCount: b },
|
|
2051
|
+
{ groupCounts: k },
|
|
2052
|
+
F
|
|
2053
|
+
]) => (O(R.rangeChanged, F.scrollSeekRangeChanged), O(
|
|
2054
2054
|
x(
|
|
2055
|
-
|
|
2055
|
+
F.windowViewportRect,
|
|
2056
2056
|
E((L) => L.visibleHeight)
|
|
2057
2057
|
),
|
|
2058
|
-
|
|
2058
|
+
w.viewportHeight
|
|
2059
2059
|
), {
|
|
2060
2060
|
data: t,
|
|
2061
2061
|
defaultItemHeight: e,
|
|
2062
2062
|
firstItemIndex: n,
|
|
2063
2063
|
fixedItemHeight: o,
|
|
2064
2064
|
gap: r,
|
|
2065
|
-
groupCounts:
|
|
2066
|
-
initialItemFinalLocationReached:
|
|
2067
|
-
initialTopMostItemIndex:
|
|
2068
|
-
scrolledToInitialItem:
|
|
2065
|
+
groupCounts: k,
|
|
2066
|
+
initialItemFinalLocationReached: h,
|
|
2067
|
+
initialTopMostItemIndex: f,
|
|
2068
|
+
scrolledToInitialItem: C,
|
|
2069
2069
|
sizeRanges: l,
|
|
2070
|
-
topItemCount:
|
|
2070
|
+
topItemCount: b,
|
|
2071
2071
|
topItemsIndexes: T,
|
|
2072
2072
|
// input
|
|
2073
|
-
totalCount:
|
|
2074
|
-
...
|
|
2073
|
+
totalCount: p,
|
|
2074
|
+
...m,
|
|
2075
2075
|
groupIndices: s,
|
|
2076
2076
|
itemSize: i,
|
|
2077
|
-
listState:
|
|
2078
|
-
scrollToIndex:
|
|
2077
|
+
listState: u,
|
|
2078
|
+
scrollToIndex: g,
|
|
2079
2079
|
// output
|
|
2080
|
-
statefulTotalCount:
|
|
2081
|
-
trackItemSizes:
|
|
2080
|
+
statefulTotalCount: a,
|
|
2081
|
+
trackItemSizes: I,
|
|
2082
2082
|
// exported from stateFlagsSystem
|
|
2083
|
-
...
|
|
2083
|
+
...R,
|
|
2084
2084
|
// the bag of IO from featureGroup1System
|
|
2085
|
-
...
|
|
2086
|
-
...
|
|
2085
|
+
...F,
|
|
2086
|
+
...w,
|
|
2087
2087
|
sizes: c,
|
|
2088
|
-
...
|
|
2088
|
+
...S
|
|
2089
2089
|
}),
|
|
2090
2090
|
X(
|
|
2091
2091
|
Et,
|
|
2092
2092
|
ue,
|
|
2093
2093
|
at,
|
|
2094
2094
|
Uo,
|
|
2095
|
-
|
|
2096
|
-
|
|
2095
|
+
Go,
|
|
2096
|
+
_t,
|
|
2097
2097
|
ce,
|
|
2098
2098
|
Yo,
|
|
2099
2099
|
jo,
|
|
@@ -2114,147 +2114,155 @@ function Xo(t, e) {
|
|
|
2114
2114
|
const pe = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
2115
2115
|
function qe(t, e, n) {
|
|
2116
2116
|
const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = H.createContext({});
|
|
2117
|
-
function c(
|
|
2118
|
-
|
|
2117
|
+
function c(m, u) {
|
|
2118
|
+
m.propsReady && W(m.propsReady, !1);
|
|
2119
2119
|
for (const T of o) {
|
|
2120
|
-
const
|
|
2121
|
-
W(
|
|
2120
|
+
const R = m[e.required[T]];
|
|
2121
|
+
W(R, u[T]);
|
|
2122
2122
|
}
|
|
2123
2123
|
for (const T of r)
|
|
2124
|
-
if (T in
|
|
2125
|
-
const
|
|
2126
|
-
W(
|
|
2124
|
+
if (T in u) {
|
|
2125
|
+
const R = m[e.optional[T]];
|
|
2126
|
+
W(R, u[T]);
|
|
2127
2127
|
}
|
|
2128
|
-
|
|
2128
|
+
m.propsReady && W(m.propsReady, !0);
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
return s.reduce((
|
|
2132
|
-
const
|
|
2133
|
-
W(
|
|
2134
|
-
},
|
|
2130
|
+
function a(m) {
|
|
2131
|
+
return s.reduce((u, T) => (u[T] = (R) => {
|
|
2132
|
+
const g = m[e.methods[T]];
|
|
2133
|
+
W(g, R);
|
|
2134
|
+
}, u), {});
|
|
2135
2135
|
}
|
|
2136
|
-
function
|
|
2137
|
-
return i.reduce((
|
|
2136
|
+
function p(m) {
|
|
2137
|
+
return i.reduce((u, T) => (u[T] = mo(m[e.events[T]]), u), {});
|
|
2138
2138
|
}
|
|
2139
|
-
const
|
|
2140
|
-
const { children: T, ...
|
|
2141
|
-
c(
|
|
2142
|
-
})), [d] = H.useState(cn(
|
|
2139
|
+
const I = H.forwardRef((m, u) => {
|
|
2140
|
+
const { children: T, ...R } = m, [g] = H.useState(() => ve(ho(t), (k) => {
|
|
2141
|
+
c(k, R);
|
|
2142
|
+
})), [d] = H.useState(cn(p, g));
|
|
2143
2143
|
pe(() => {
|
|
2144
|
-
for (const
|
|
2145
|
-
|
|
2144
|
+
for (const k of i)
|
|
2145
|
+
k in R && K(d[k], R[k]);
|
|
2146
2146
|
return () => {
|
|
2147
2147
|
Object.values(d).map(We);
|
|
2148
2148
|
};
|
|
2149
|
-
}, [
|
|
2150
|
-
c(
|
|
2151
|
-
}), H.useImperativeHandle(
|
|
2152
|
-
const
|
|
2153
|
-
return /* @__PURE__ */ z(l.Provider, { value:
|
|
2154
|
-
}),
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2149
|
+
}, [R, d, g]), pe(() => {
|
|
2150
|
+
c(g, R);
|
|
2151
|
+
}), H.useImperativeHandle(u, ln(a(g)));
|
|
2152
|
+
const b = n;
|
|
2153
|
+
return /* @__PURE__ */ z(l.Provider, { value: g, children: n ? /* @__PURE__ */ z(b, { ...Xo([...o, ...r, ...i], R), children: T }) : T });
|
|
2154
|
+
}), h = (m) => {
|
|
2155
|
+
const u = H.useContext(l);
|
|
2156
|
+
return H.useCallback(
|
|
2157
|
+
(T) => {
|
|
2158
|
+
W(u[m], T);
|
|
2159
|
+
},
|
|
2160
|
+
[u, m]
|
|
2161
|
+
);
|
|
2162
|
+
}, f = (m) => {
|
|
2163
|
+
const T = H.useContext(l)[m], R = H.useCallback(
|
|
2164
|
+
(g) => K(T, g),
|
|
2157
2165
|
[T]
|
|
2158
2166
|
);
|
|
2159
2167
|
return H.useSyncExternalStore(
|
|
2160
|
-
|
|
2161
|
-
() =>
|
|
2162
|
-
() =>
|
|
2168
|
+
R,
|
|
2169
|
+
() => st(T),
|
|
2170
|
+
() => st(T)
|
|
2163
2171
|
);
|
|
2164
|
-
},
|
|
2165
|
-
const T = H.useContext(l)[
|
|
2172
|
+
}, C = (m) => {
|
|
2173
|
+
const T = H.useContext(l)[m], [R, g] = H.useState(cn(st, T));
|
|
2166
2174
|
return pe(
|
|
2167
2175
|
() => K(T, (d) => {
|
|
2168
|
-
d !==
|
|
2176
|
+
d !== R && g(ln(d));
|
|
2169
2177
|
}),
|
|
2170
|
-
[T,
|
|
2171
|
-
),
|
|
2172
|
-
},
|
|
2178
|
+
[T, R]
|
|
2179
|
+
), R;
|
|
2180
|
+
}, w = H.version.startsWith("18") ? f : C;
|
|
2173
2181
|
return {
|
|
2174
|
-
Component:
|
|
2175
|
-
useEmitter: (
|
|
2176
|
-
const
|
|
2177
|
-
pe(() => K(
|
|
2182
|
+
Component: I,
|
|
2183
|
+
useEmitter: (m, u) => {
|
|
2184
|
+
const R = H.useContext(l)[m];
|
|
2185
|
+
pe(() => K(R, u), [u, R]);
|
|
2178
2186
|
},
|
|
2179
|
-
useEmitterValue:
|
|
2180
|
-
usePublisher:
|
|
2187
|
+
useEmitterValue: w,
|
|
2188
|
+
usePublisher: h
|
|
2181
2189
|
};
|
|
2182
2190
|
}
|
|
2183
|
-
const
|
|
2184
|
-
function
|
|
2191
|
+
const be = H.createContext(void 0), qn = H.createContext(void 0), Yn = typeof document < "u" ? H.useLayoutEffect : H.useEffect;
|
|
2192
|
+
function ke(t) {
|
|
2185
2193
|
return "self" in t;
|
|
2186
2194
|
}
|
|
2187
2195
|
function Jo(t) {
|
|
2188
2196
|
return "body" in t;
|
|
2189
2197
|
}
|
|
2190
|
-
function
|
|
2191
|
-
const i = H.useRef(null), l = H.useRef(null), c = H.useRef(null),
|
|
2192
|
-
(
|
|
2193
|
-
let
|
|
2194
|
-
const
|
|
2195
|
-
if (Jo(
|
|
2196
|
-
const
|
|
2197
|
-
|
|
2198
|
+
function Zn(t, e, n, o = Yt, r, s) {
|
|
2199
|
+
const i = H.useRef(null), l = H.useRef(null), c = H.useRef(null), a = H.useCallback(
|
|
2200
|
+
(h) => {
|
|
2201
|
+
let f, C, w;
|
|
2202
|
+
const S = h.target;
|
|
2203
|
+
if (Jo(S) || ke(S)) {
|
|
2204
|
+
const u = ke(S) ? S : S.defaultView;
|
|
2205
|
+
w = s ? u.scrollX : u.scrollY, f = s ? u.document.documentElement.scrollWidth : u.document.documentElement.scrollHeight, C = s ? u.innerWidth : u.innerHeight;
|
|
2198
2206
|
} else
|
|
2199
|
-
|
|
2200
|
-
const
|
|
2207
|
+
w = s ? S.scrollLeft : S.scrollTop, f = s ? S.scrollWidth : S.scrollHeight, C = s ? S.offsetWidth : S.offsetHeight;
|
|
2208
|
+
const m = () => {
|
|
2201
2209
|
t({
|
|
2202
|
-
scrollHeight:
|
|
2203
|
-
scrollTop: Math.max(
|
|
2204
|
-
viewportHeight:
|
|
2210
|
+
scrollHeight: f,
|
|
2211
|
+
scrollTop: Math.max(w, 0),
|
|
2212
|
+
viewportHeight: C
|
|
2205
2213
|
});
|
|
2206
2214
|
};
|
|
2207
|
-
|
|
2215
|
+
h.suppressFlushSync ? m() : io.flushSync(m), l.current !== null && (w === l.current || w <= 0 || w === f - C) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
|
|
2208
2216
|
},
|
|
2209
|
-
[t, e]
|
|
2217
|
+
[t, e, s]
|
|
2210
2218
|
);
|
|
2211
2219
|
H.useEffect(() => {
|
|
2212
|
-
const
|
|
2213
|
-
return o(r || i.current),
|
|
2214
|
-
o(null),
|
|
2220
|
+
const h = r || i.current;
|
|
2221
|
+
return o(r || i.current), a({ suppressFlushSync: !0, target: h }), h.addEventListener("scroll", a, { passive: !0 }), () => {
|
|
2222
|
+
o(null), h.removeEventListener("scroll", a);
|
|
2215
2223
|
};
|
|
2216
|
-
}, [i,
|
|
2217
|
-
function
|
|
2218
|
-
const
|
|
2219
|
-
if (!
|
|
2224
|
+
}, [i, a, n, o, r]);
|
|
2225
|
+
function p(h) {
|
|
2226
|
+
const f = i.current;
|
|
2227
|
+
if (!f || (s ? "offsetWidth" in f && f.offsetWidth === 0 : "offsetHeight" in f && f.offsetHeight === 0))
|
|
2220
2228
|
return;
|
|
2221
|
-
const
|
|
2222
|
-
let
|
|
2223
|
-
|
|
2224
|
-
wt(
|
|
2225
|
-
s ?
|
|
2226
|
-
),
|
|
2227
|
-
const
|
|
2228
|
-
if (
|
|
2229
|
-
t({ scrollHeight:
|
|
2229
|
+
const C = h.behavior === "smooth";
|
|
2230
|
+
let w, S, m;
|
|
2231
|
+
ke(f) ? (S = Math.max(
|
|
2232
|
+
wt(f.document.documentElement, s ? "width" : "height"),
|
|
2233
|
+
s ? f.document.documentElement.scrollWidth : f.document.documentElement.scrollHeight
|
|
2234
|
+
), w = s ? f.innerWidth : f.innerHeight, m = s ? window.scrollX : window.scrollY) : (S = f[s ? "scrollWidth" : "scrollHeight"], w = wt(f, s ? "width" : "height"), m = f[s ? "scrollLeft" : "scrollTop"]);
|
|
2235
|
+
const u = S - w;
|
|
2236
|
+
if (h.top = Math.ceil(Math.max(Math.min(u, h.top), 0)), Nn(w, S) || h.top === m) {
|
|
2237
|
+
t({ scrollHeight: S, scrollTop: m, viewportHeight: w }), C && e(!0);
|
|
2230
2238
|
return;
|
|
2231
2239
|
}
|
|
2232
|
-
|
|
2240
|
+
C ? (l.current = h.top, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
2233
2241
|
c.current = null, l.current = null, e(!0);
|
|
2234
|
-
}, 1e3)) : l.current = null, s && (
|
|
2242
|
+
}, 1e3)) : l.current = null, s && (h = { behavior: h.behavior, left: h.top }), f.scrollTo(h);
|
|
2235
2243
|
}
|
|
2236
|
-
function
|
|
2237
|
-
s && (
|
|
2244
|
+
function I(h) {
|
|
2245
|
+
s && (h = { behavior: h.behavior, left: h.top }), i.current.scrollBy(h);
|
|
2238
2246
|
}
|
|
2239
|
-
return { scrollByCallback:
|
|
2247
|
+
return { scrollByCallback: I, scrollerRef: i, scrollToCallback: p };
|
|
2240
2248
|
}
|
|
2241
|
-
const
|
|
2249
|
+
const Fe = "-webkit-sticky", xn = "sticky", Xn = Kn(() => {
|
|
2242
2250
|
if (typeof document > "u")
|
|
2243
2251
|
return xn;
|
|
2244
2252
|
const t = document.createElement("div");
|
|
2245
|
-
return t.style.position =
|
|
2253
|
+
return t.style.position = Fe, t.style.position === Fe ? Fe : xn;
|
|
2246
2254
|
});
|
|
2247
2255
|
function Ye(t) {
|
|
2248
2256
|
return t;
|
|
2249
2257
|
}
|
|
2250
2258
|
const Qo = /* @__PURE__ */ U(() => {
|
|
2251
|
-
const t =
|
|
2259
|
+
const t = v((c) => `Item ${c}`), e = v(null), n = v((c) => `Group ${c}`), o = v({}), r = v(Ye), s = v("div"), i = v(Yt), l = (c, a = null) => ct(
|
|
2252
2260
|
x(
|
|
2253
2261
|
o,
|
|
2254
|
-
E((
|
|
2262
|
+
E((p) => p[c]),
|
|
2255
2263
|
Y()
|
|
2256
2264
|
),
|
|
2257
|
-
|
|
2265
|
+
a
|
|
2258
2266
|
);
|
|
2259
2267
|
return {
|
|
2260
2268
|
components: o,
|
|
@@ -2276,81 +2284,81 @@ const Qo = /* @__PURE__ */ U(() => {
|
|
|
2276
2284
|
};
|
|
2277
2285
|
}), tr = /* @__PURE__ */ U(
|
|
2278
2286
|
([t, e]) => ({ ...t, ...e }),
|
|
2279
|
-
X(
|
|
2280
|
-
), er = ({ height: t }) => /* @__PURE__ */ z("div", { style: { height: t } }), nr = { overflowAnchor: "none", position:
|
|
2281
|
-
const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l,
|
|
2287
|
+
X(jn, Qo)
|
|
2288
|
+
), er = ({ height: t }) => /* @__PURE__ */ z("div", { style: { height: t } }), nr = { overflowAnchor: "none", position: Xn(), zIndex: 1 }, Jn = { overflowAnchor: "none" }, or = { ...Jn, display: "inline-block", height: "100%" }, Tn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
|
|
2289
|
+
const n = M("listState"), o = gt("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = gt("windowScrollContainerState"), l = gt("scrollContainerState"), c = s || r ? i : l, a = M("itemContent"), p = M("context"), I = M("groupContent"), h = M("trackItemSizes"), f = M("itemSize"), C = M("log"), w = gt("gap"), S = M("horizontalDirection"), { callbackRef: m } = kn(
|
|
2282
2290
|
o,
|
|
2283
|
-
|
|
2284
|
-
|
|
2291
|
+
f,
|
|
2292
|
+
h,
|
|
2285
2293
|
e ? Yt : c,
|
|
2294
|
+
C,
|
|
2286
2295
|
w,
|
|
2287
|
-
I,
|
|
2288
2296
|
s,
|
|
2289
|
-
|
|
2297
|
+
S,
|
|
2290
2298
|
M("skipAnimationFrameInResizeObserver")
|
|
2291
|
-
), [
|
|
2292
|
-
Je("deviation", (
|
|
2293
|
-
|
|
2299
|
+
), [u, T] = H.useState(0);
|
|
2300
|
+
Je("deviation", (B) => {
|
|
2301
|
+
u !== B && T(B);
|
|
2294
2302
|
});
|
|
2295
|
-
const
|
|
2303
|
+
const R = M("EmptyPlaceholder"), g = M("ScrollSeekPlaceholder") || er, d = M("ListComponent"), b = M("ItemComponent"), k = M("GroupComponent"), F = M("computeItemKey"), L = M("isSeeking"), V = M("groupIndices").length > 0, D = M("alignToBottom"), J = M("initialItemFinalLocationReached"), nt = e ? {} : {
|
|
2296
2304
|
boxSizing: "border-box",
|
|
2297
|
-
...
|
|
2305
|
+
...S ? {
|
|
2298
2306
|
display: "inline-block",
|
|
2299
2307
|
height: "100%",
|
|
2300
|
-
marginLeft:
|
|
2308
|
+
marginLeft: u !== 0 ? u : D ? "auto" : 0,
|
|
2301
2309
|
paddingLeft: n.offsetTop,
|
|
2302
2310
|
paddingRight: n.offsetBottom,
|
|
2303
2311
|
whiteSpace: "nowrap"
|
|
2304
2312
|
} : {
|
|
2305
|
-
marginTop:
|
|
2313
|
+
marginTop: u !== 0 ? u : D ? "auto" : 0,
|
|
2306
2314
|
paddingBottom: n.offsetBottom,
|
|
2307
2315
|
paddingTop: n.offsetTop
|
|
2308
2316
|
},
|
|
2309
2317
|
...J ? {} : { visibility: "hidden" }
|
|
2310
2318
|
};
|
|
2311
|
-
return !e && n.totalCount === 0 &&
|
|
2319
|
+
return !e && n.totalCount === 0 && R ? /* @__PURE__ */ z(R, { ...Z(R, p) }) : /* @__PURE__ */ z(
|
|
2312
2320
|
d,
|
|
2313
2321
|
{
|
|
2314
|
-
...Z(d,
|
|
2322
|
+
...Z(d, p),
|
|
2315
2323
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
2316
|
-
ref:
|
|
2324
|
+
ref: m,
|
|
2317
2325
|
style: nt,
|
|
2318
|
-
children: (e ? n.topItems : n.items).map((
|
|
2319
|
-
const q =
|
|
2326
|
+
children: (e ? n.topItems : n.items).map((B) => {
|
|
2327
|
+
const q = B.originalIndex, it = F(q + n.firstItemIndex, B.data, p);
|
|
2320
2328
|
return L ? /* @__PURE__ */ $t(
|
|
2321
|
-
|
|
2329
|
+
g,
|
|
2322
2330
|
{
|
|
2323
|
-
...Z(
|
|
2324
|
-
height:
|
|
2325
|
-
index:
|
|
2326
|
-
key:
|
|
2327
|
-
type:
|
|
2328
|
-
...
|
|
2331
|
+
...Z(g, p),
|
|
2332
|
+
height: B.size,
|
|
2333
|
+
index: B.index,
|
|
2334
|
+
key: it,
|
|
2335
|
+
type: B.type || "item",
|
|
2336
|
+
...B.type === "group" ? {} : { groupIndex: B.groupIndex }
|
|
2329
2337
|
}
|
|
2330
|
-
) :
|
|
2331
|
-
|
|
2338
|
+
) : B.type === "group" ? /* @__PURE__ */ $t(
|
|
2339
|
+
k,
|
|
2332
2340
|
{
|
|
2333
|
-
...Z(
|
|
2341
|
+
...Z(k, p),
|
|
2334
2342
|
"data-index": q,
|
|
2335
|
-
"data-item-index":
|
|
2336
|
-
"data-known-size":
|
|
2337
|
-
key:
|
|
2343
|
+
"data-item-index": B.index,
|
|
2344
|
+
"data-known-size": B.size,
|
|
2345
|
+
key: it,
|
|
2338
2346
|
style: nr
|
|
2339
2347
|
},
|
|
2340
|
-
|
|
2348
|
+
I(B.index, p)
|
|
2341
2349
|
) : /* @__PURE__ */ $t(
|
|
2342
|
-
|
|
2350
|
+
b,
|
|
2343
2351
|
{
|
|
2344
|
-
...Z(
|
|
2345
|
-
...
|
|
2352
|
+
...Z(b, p),
|
|
2353
|
+
...Qn(b, B.data),
|
|
2346
2354
|
"data-index": q,
|
|
2347
|
-
"data-item-group-index":
|
|
2348
|
-
"data-item-index":
|
|
2349
|
-
"data-known-size":
|
|
2350
|
-
key:
|
|
2351
|
-
style:
|
|
2355
|
+
"data-item-group-index": B.groupIndex,
|
|
2356
|
+
"data-item-index": B.index,
|
|
2357
|
+
"data-known-size": B.size,
|
|
2358
|
+
key: it,
|
|
2359
|
+
style: S ? or : Jn
|
|
2352
2360
|
},
|
|
2353
|
-
V ?
|
|
2361
|
+
V ? a(B.index, B.groupIndex, B.data, p) : a(B.index, B.data, p)
|
|
2354
2362
|
);
|
|
2355
2363
|
})
|
|
2356
2364
|
}
|
|
@@ -2372,7 +2380,7 @@ const Qo = /* @__PURE__ */ U(() => {
|
|
|
2372
2380
|
width: "100%",
|
|
2373
2381
|
...t ? { display: "flex", flexDirection: "column" } : {}
|
|
2374
2382
|
}), ir = {
|
|
2375
|
-
position:
|
|
2383
|
+
position: Xn(),
|
|
2376
2384
|
top: 0,
|
|
2377
2385
|
width: "100%",
|
|
2378
2386
|
zIndex: 1
|
|
@@ -2381,7 +2389,7 @@ function Z(t, e) {
|
|
|
2381
2389
|
if (typeof t != "string")
|
|
2382
2390
|
return { context: e };
|
|
2383
2391
|
}
|
|
2384
|
-
function
|
|
2392
|
+
function Qn(t, e) {
|
|
2385
2393
|
return { item: typeof t == "string" ? void 0 : e };
|
|
2386
2394
|
}
|
|
2387
2395
|
const lr = /* @__PURE__ */ H.memo(function() {
|
|
@@ -2411,24 +2419,24 @@ const lr = /* @__PURE__ */ H.memo(function() {
|
|
|
2411
2419
|
});
|
|
2412
2420
|
function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2413
2421
|
return H.memo(function({ children: s, style: i, ...l }) {
|
|
2414
|
-
const c = n("scrollContainerState"),
|
|
2422
|
+
const c = n("scrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("scrollerRef"), h = e("context"), f = e("horizontalDirection") || !1, { scrollByCallback: C, scrollerRef: w, scrollToCallback: S } = Zn(
|
|
2415
2423
|
c,
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2424
|
+
p,
|
|
2425
|
+
a,
|
|
2426
|
+
I,
|
|
2419
2427
|
void 0,
|
|
2420
|
-
|
|
2428
|
+
f
|
|
2421
2429
|
);
|
|
2422
|
-
return t("scrollTo",
|
|
2423
|
-
|
|
2430
|
+
return t("scrollTo", S), t("scrollBy", C), /* @__PURE__ */ z(
|
|
2431
|
+
a,
|
|
2424
2432
|
{
|
|
2425
2433
|
"data-testid": "virtuoso-scroller",
|
|
2426
2434
|
"data-virtuoso-scroller": !0,
|
|
2427
|
-
ref:
|
|
2428
|
-
style: { ...
|
|
2435
|
+
ref: w,
|
|
2436
|
+
style: { ...f ? sr : rr, ...i },
|
|
2429
2437
|
tabIndex: 0,
|
|
2430
2438
|
...l,
|
|
2431
|
-
...Z(
|
|
2439
|
+
...Z(a, h),
|
|
2432
2440
|
children: s
|
|
2433
2441
|
}
|
|
2434
2442
|
);
|
|
@@ -2436,33 +2444,33 @@ function Ze({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2436
2444
|
}
|
|
2437
2445
|
function Xe({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2438
2446
|
return H.memo(function({ children: s, style: i, ...l }) {
|
|
2439
|
-
const c = n("windowScrollContainerState"),
|
|
2447
|
+
const c = n("windowScrollContainerState"), a = e("ScrollerComponent"), p = n("smoothScrollTargetReached"), I = e("totalListHeight"), h = e("deviation"), f = e("customScrollParent"), C = e("context"), w = H.useRef(null), S = e("scrollerRef"), { scrollByCallback: m, scrollerRef: u, scrollToCallback: T } = Zn(
|
|
2440
2448
|
c,
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2449
|
+
p,
|
|
2450
|
+
a,
|
|
2451
|
+
S,
|
|
2452
|
+
f
|
|
2445
2453
|
);
|
|
2446
|
-
return
|
|
2447
|
-
var
|
|
2448
|
-
return
|
|
2449
|
-
|
|
2454
|
+
return Yn(() => {
|
|
2455
|
+
var R;
|
|
2456
|
+
return u.current = f || ((R = w.current) == null ? void 0 : R.ownerDocument.defaultView), () => {
|
|
2457
|
+
u.current = null;
|
|
2450
2458
|
};
|
|
2451
|
-
}, [
|
|
2452
|
-
|
|
2459
|
+
}, [u, f]), t("windowScrollTo", T), t("scrollBy", m), /* @__PURE__ */ z(
|
|
2460
|
+
a,
|
|
2453
2461
|
{
|
|
2454
|
-
ref:
|
|
2462
|
+
ref: w,
|
|
2455
2463
|
"data-virtuoso-scroller": !0,
|
|
2456
|
-
style: { position: "relative", ...i, ...
|
|
2464
|
+
style: { position: "relative", ...i, ...I !== 0 ? { height: I + h } : {} },
|
|
2457
2465
|
...l,
|
|
2458
|
-
...Z(
|
|
2466
|
+
...Z(a, C),
|
|
2459
2467
|
children: s
|
|
2460
2468
|
}
|
|
2461
2469
|
);
|
|
2462
2470
|
});
|
|
2463
2471
|
}
|
|
2464
2472
|
const ur = ({ children: t }) => {
|
|
2465
|
-
const e = H.useContext(
|
|
2473
|
+
const e = H.useContext(be), n = gt("viewportHeight"), o = gt("fixedItemHeight"), r = M("alignToBottom"), s = M("horizontalDirection"), i = H.useMemo(
|
|
2466
2474
|
() => ne(n, (c) => wt(c, s ? "width" : "height")),
|
|
2467
2475
|
[n, s]
|
|
2468
2476
|
), l = Ht(i, !0, M("skipAnimationFrameInResizeObserver"));
|
|
@@ -2470,7 +2478,7 @@ const ur = ({ children: t }) => {
|
|
|
2470
2478
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2471
2479
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: l, style: Zt(r), children: t });
|
|
2472
2480
|
}, ar = ({ children: t }) => {
|
|
2473
|
-
const e = H.useContext(
|
|
2481
|
+
const e = H.useContext(be), n = gt("windowViewportRect"), o = gt("fixedItemHeight"), r = M("customScrollParent"), s = _e(
|
|
2474
2482
|
n,
|
|
2475
2483
|
r,
|
|
2476
2484
|
M("skipAnimationFrameInResizeObserver")
|
|
@@ -2492,79 +2500,79 @@ const ur = ({ children: t }) => {
|
|
|
2492
2500
|
] })
|
|
2493
2501
|
] });
|
|
2494
2502
|
}), {
|
|
2495
|
-
Component:
|
|
2503
|
+
Component: to,
|
|
2496
2504
|
useEmitter: Je,
|
|
2497
2505
|
useEmitterValue: M,
|
|
2498
2506
|
usePublisher: gt
|
|
2499
2507
|
} = /* @__PURE__ */ qe(
|
|
2500
2508
|
tr,
|
|
2501
2509
|
{
|
|
2502
|
-
|
|
2503
|
-
atBottomStateChange: "atBottomStateChange",
|
|
2504
|
-
atTopStateChange: "atTopStateChange",
|
|
2505
|
-
endReached: "endReached",
|
|
2506
|
-
groupIndices: "groupIndices",
|
|
2507
|
-
isScrolling: "isScrolling",
|
|
2508
|
-
itemsRendered: "itemsRendered",
|
|
2509
|
-
rangeChanged: "rangeChanged",
|
|
2510
|
-
startReached: "startReached",
|
|
2511
|
-
totalListHeightChanged: "totalListHeightChanged"
|
|
2512
|
-
},
|
|
2513
|
-
methods: {
|
|
2514
|
-
autoscrollToBottom: "autoscrollToBottom",
|
|
2515
|
-
getState: "getState",
|
|
2516
|
-
scrollBy: "scrollBy",
|
|
2517
|
-
scrollIntoView: "scrollIntoView",
|
|
2518
|
-
scrollTo: "scrollTo",
|
|
2519
|
-
scrollToIndex: "scrollToIndex"
|
|
2520
|
-
},
|
|
2510
|
+
required: {},
|
|
2521
2511
|
optional: {
|
|
2522
|
-
|
|
2512
|
+
restoreStateFrom: "restoreStateFrom",
|
|
2513
|
+
context: "context",
|
|
2514
|
+
followOutput: "followOutput",
|
|
2515
|
+
itemContent: "itemContent",
|
|
2516
|
+
groupContent: "groupContent",
|
|
2517
|
+
overscan: "overscan",
|
|
2518
|
+
increaseViewportBy: "increaseViewportBy",
|
|
2519
|
+
totalCount: "totalCount",
|
|
2520
|
+
groupCounts: "groupCounts",
|
|
2521
|
+
topItemCount: "topItemCount",
|
|
2522
|
+
firstItemIndex: "firstItemIndex",
|
|
2523
|
+
initialTopMostItemIndex: "initialTopMostItemIndex",
|
|
2524
|
+
components: "components",
|
|
2523
2525
|
atBottomThreshold: "atBottomThreshold",
|
|
2524
2526
|
atTopThreshold: "atTopThreshold",
|
|
2525
|
-
components: "components",
|
|
2526
2527
|
computeItemKey: "computeItemKey",
|
|
2527
|
-
context: "context",
|
|
2528
|
-
customScrollParent: "customScrollParent",
|
|
2529
|
-
data: "data",
|
|
2530
2528
|
defaultItemHeight: "defaultItemHeight",
|
|
2531
|
-
firstItemIndex: "firstItemIndex",
|
|
2532
2529
|
fixedItemHeight: "fixedItemHeight",
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
groupCounts: "groupCounts",
|
|
2530
|
+
itemSize: "itemSize",
|
|
2531
|
+
scrollSeekConfiguration: "scrollSeekConfiguration",
|
|
2536
2532
|
headerFooterTag: "HeaderFooterTag",
|
|
2537
|
-
|
|
2538
|
-
increaseViewportBy: "increaseViewportBy",
|
|
2533
|
+
data: "data",
|
|
2539
2534
|
initialItemCount: "initialItemCount",
|
|
2540
2535
|
initialScrollTop: "initialScrollTop",
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
logLevel: "logLevel",
|
|
2545
|
-
overscan: "overscan",
|
|
2546
|
-
restoreStateFrom: "restoreStateFrom",
|
|
2536
|
+
alignToBottom: "alignToBottom",
|
|
2537
|
+
useWindowScroll: "useWindowScroll",
|
|
2538
|
+
customScrollParent: "customScrollParent",
|
|
2547
2539
|
scrollerRef: "scrollerRef",
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2540
|
+
logLevel: "logLevel",
|
|
2541
|
+
horizontalDirection: "horizontalDirection",
|
|
2542
|
+
skipAnimationFrameInResizeObserver: "skipAnimationFrameInResizeObserver"
|
|
2543
|
+
},
|
|
2544
|
+
methods: {
|
|
2545
|
+
scrollToIndex: "scrollToIndex",
|
|
2546
|
+
scrollIntoView: "scrollIntoView",
|
|
2547
|
+
scrollTo: "scrollTo",
|
|
2548
|
+
scrollBy: "scrollBy",
|
|
2549
|
+
autoscrollToBottom: "autoscrollToBottom",
|
|
2550
|
+
getState: "getState"
|
|
2553
2551
|
},
|
|
2554
|
-
|
|
2552
|
+
events: {
|
|
2553
|
+
isScrolling: "isScrolling",
|
|
2554
|
+
endReached: "endReached",
|
|
2555
|
+
startReached: "startReached",
|
|
2556
|
+
rangeChanged: "rangeChanged",
|
|
2557
|
+
atBottomStateChange: "atBottomStateChange",
|
|
2558
|
+
atTopStateChange: "atTopStateChange",
|
|
2559
|
+
totalListHeightChanged: "totalListHeightChanged",
|
|
2560
|
+
itemsRendered: "itemsRendered",
|
|
2561
|
+
groupIndices: "groupIndices"
|
|
2562
|
+
}
|
|
2555
2563
|
},
|
|
2556
2564
|
fr
|
|
2557
|
-
), mr = /* @__PURE__ */ Ze({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), pr = /* @__PURE__ */ Xe({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), Kr =
|
|
2558
|
-
const t =
|
|
2565
|
+
), mr = /* @__PURE__ */ Ze({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), pr = /* @__PURE__ */ Xe({ useEmitter: Je, useEmitterValue: M, usePublisher: gt }), Kr = to, jr = to, hr = /* @__PURE__ */ U(() => {
|
|
2566
|
+
const t = v((c) => /* @__PURE__ */ Kt("td", { children: [
|
|
2559
2567
|
"Item $",
|
|
2560
2568
|
c
|
|
2561
|
-
] })), e =
|
|
2569
|
+
] })), e = v(null), n = v(null), o = v(null), r = v({}), s = v(Ye), i = v(Yt), l = (c, a = null) => ct(
|
|
2562
2570
|
x(
|
|
2563
2571
|
r,
|
|
2564
|
-
E((
|
|
2572
|
+
E((p) => p[c]),
|
|
2565
2573
|
Y()
|
|
2566
2574
|
),
|
|
2567
|
-
|
|
2575
|
+
a
|
|
2568
2576
|
);
|
|
2569
2577
|
return {
|
|
2570
2578
|
components: r,
|
|
@@ -2586,171 +2594,171 @@ const ur = ({ children: t }) => {
|
|
|
2586
2594
|
};
|
|
2587
2595
|
}), gr = /* @__PURE__ */ U(
|
|
2588
2596
|
([t, e]) => ({ ...t, ...e }),
|
|
2589
|
-
X(
|
|
2597
|
+
X(jn, hr)
|
|
2590
2598
|
), Ir = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { height: t } }) }), Sr = ({ height: t }) => /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", { style: { border: 0, height: t, padding: 0 } }) }), xr = { overflowAnchor: "none" }, Cn = /* @__PURE__ */ H.memo(function({ showTopList: e = !1 }) {
|
|
2591
|
-
const n =
|
|
2592
|
-
const
|
|
2599
|
+
const n = G("listState"), o = G("computeItemKey"), r = G("firstItemIndex"), s = G("isSeeking"), i = G("ScrollSeekPlaceholder") || Ir, l = G("context"), c = G("TableRowComponent"), a = G("fixedHeaderHeight"), p = G("itemContent"), I = (e ? n.topItems : []).reduce((f, C, w) => (w === 0 ? f.push(C.size) : f.push(f[w - 1] + C.size), f), []), h = (e ? n.topItems : n.items).map((f) => {
|
|
2600
|
+
const C = f.originalIndex, w = o(C + r, f.data, l), S = e ? C === 0 ? 0 : I[C - 1] : 0;
|
|
2593
2601
|
return s ? /* @__PURE__ */ $t(
|
|
2594
2602
|
i,
|
|
2595
2603
|
{
|
|
2596
2604
|
...Z(i, l),
|
|
2597
|
-
height:
|
|
2598
|
-
index:
|
|
2599
|
-
key:
|
|
2600
|
-
type:
|
|
2605
|
+
height: f.size,
|
|
2606
|
+
index: f.index,
|
|
2607
|
+
key: w,
|
|
2608
|
+
type: f.type || "item"
|
|
2601
2609
|
}
|
|
2602
2610
|
) : /* @__PURE__ */ $t(
|
|
2603
2611
|
c,
|
|
2604
2612
|
{
|
|
2605
2613
|
...Z(c, l),
|
|
2606
|
-
...
|
|
2607
|
-
"data-index":
|
|
2608
|
-
"data-item-index":
|
|
2609
|
-
"data-known-size":
|
|
2610
|
-
key:
|
|
2611
|
-
style: e ? { overflowAnchor: "none", position: "sticky", top:
|
|
2614
|
+
...Qn(c, f.data),
|
|
2615
|
+
"data-index": C,
|
|
2616
|
+
"data-item-index": f.index,
|
|
2617
|
+
"data-known-size": f.size,
|
|
2618
|
+
key: w,
|
|
2619
|
+
style: e ? { overflowAnchor: "none", position: "sticky", top: a + S, zIndex: 2 } : xr
|
|
2612
2620
|
},
|
|
2613
|
-
f
|
|
2621
|
+
p(f.index, f.data, l)
|
|
2614
2622
|
);
|
|
2615
2623
|
});
|
|
2616
|
-
return /* @__PURE__ */ z(
|
|
2624
|
+
return /* @__PURE__ */ z(so, { children: h });
|
|
2617
2625
|
}), Tr = /* @__PURE__ */ H.memo(function() {
|
|
2618
|
-
const e =
|
|
2626
|
+
const e = G("listState"), n = G("topItemsIndexes").length > 0, o = Tt("sizeRanges"), r = G("useWindowScroll"), s = G("customScrollParent"), i = Tt("windowScrollContainerState"), l = Tt("scrollContainerState"), c = s || r ? i : l, a = G("trackItemSizes"), p = G("itemSize"), I = G("log"), { callbackRef: h, ref: f } = kn(
|
|
2619
2627
|
o,
|
|
2620
|
-
|
|
2621
|
-
|
|
2628
|
+
p,
|
|
2629
|
+
a,
|
|
2622
2630
|
c,
|
|
2623
|
-
|
|
2631
|
+
I,
|
|
2624
2632
|
void 0,
|
|
2625
2633
|
s,
|
|
2626
2634
|
!1,
|
|
2627
|
-
|
|
2628
|
-
), [
|
|
2635
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2636
|
+
), [C, w] = H.useState(0);
|
|
2629
2637
|
Qe("deviation", (V) => {
|
|
2630
|
-
|
|
2638
|
+
C !== V && (f.current.style.marginTop = `${V}px`, w(V));
|
|
2631
2639
|
});
|
|
2632
|
-
const
|
|
2633
|
-
if (
|
|
2634
|
-
return /* @__PURE__ */ z(
|
|
2635
|
-
const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0),
|
|
2636
|
-
return /* @__PURE__ */ Kt(
|
|
2637
|
-
|
|
2640
|
+
const S = G("EmptyPlaceholder"), m = G("FillerRow") || Sr, u = G("TableBodyComponent"), T = G("paddingTopAddition"), R = G("statefulTotalCount"), g = G("context");
|
|
2641
|
+
if (R === 0 && S)
|
|
2642
|
+
return /* @__PURE__ */ z(S, { ...Z(S, g) });
|
|
2643
|
+
const d = (n ? e.topItems : []).reduce((V, D) => V + D.size, 0), b = e.offsetTop + T + C - d, k = e.offsetBottom, F = b > 0 ? /* @__PURE__ */ z(m, { context: g, height: b }, "padding-top") : null, L = k > 0 ? /* @__PURE__ */ z(m, { context: g, height: k }, "padding-bottom") : null;
|
|
2644
|
+
return /* @__PURE__ */ Kt(u, { "data-testid": "virtuoso-item-list", ref: h, ...Z(u, g), children: [
|
|
2645
|
+
F,
|
|
2638
2646
|
n && /* @__PURE__ */ z(Cn, { showTopList: !0 }),
|
|
2639
2647
|
/* @__PURE__ */ z(Cn, {}),
|
|
2640
2648
|
L
|
|
2641
2649
|
] });
|
|
2642
2650
|
}), Cr = ({ children: t }) => {
|
|
2643
|
-
const e = H.useContext(
|
|
2651
|
+
const e = H.useContext(be), n = Tt("viewportHeight"), o = Tt("fixedItemHeight"), r = Ht(
|
|
2644
2652
|
H.useMemo(() => ne(n, (s) => wt(s, "height")), [n]),
|
|
2645
2653
|
!0,
|
|
2646
|
-
|
|
2654
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2647
2655
|
);
|
|
2648
2656
|
return H.useEffect(() => {
|
|
2649
2657
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2650
2658
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "element", ref: r, style: Zt(!1), children: t });
|
|
2651
2659
|
}, wr = ({ children: t }) => {
|
|
2652
|
-
const e = H.useContext(
|
|
2660
|
+
const e = H.useContext(be), n = Tt("windowViewportRect"), o = Tt("fixedItemHeight"), r = G("customScrollParent"), s = _e(
|
|
2653
2661
|
n,
|
|
2654
2662
|
r,
|
|
2655
|
-
|
|
2663
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2656
2664
|
);
|
|
2657
2665
|
return H.useEffect(() => {
|
|
2658
2666
|
e && (o(e.itemHeight), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2659
2667
|
}, [e, n, o]), /* @__PURE__ */ z("div", { "data-viewport-type": "window", ref: s, style: Zt(!1), children: t });
|
|
2660
|
-
},
|
|
2661
|
-
const n =
|
|
2662
|
-
H.useMemo(() => ne(r, (
|
|
2668
|
+
}, vr = /* @__PURE__ */ H.memo(function(e) {
|
|
2669
|
+
const n = G("useWindowScroll"), o = G("customScrollParent"), r = Tt("fixedHeaderHeight"), s = Tt("fixedFooterHeight"), i = G("fixedHeaderContent"), l = G("fixedFooterContent"), c = G("context"), a = Ht(
|
|
2670
|
+
H.useMemo(() => ne(r, (u) => wt(u, "height")), [r]),
|
|
2663
2671
|
!0,
|
|
2664
|
-
|
|
2665
|
-
),
|
|
2666
|
-
H.useMemo(() => ne(s, (
|
|
2672
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2673
|
+
), p = Ht(
|
|
2674
|
+
H.useMemo(() => ne(s, (u) => wt(u, "height")), [s]),
|
|
2667
2675
|
!0,
|
|
2668
|
-
|
|
2669
|
-
),
|
|
2670
|
-
|
|
2676
|
+
G("skipAnimationFrameInResizeObserver")
|
|
2677
|
+
), I = o || n ? br : Rr, h = o || n ? wr : Cr, f = G("TableComponent"), C = G("TableHeadComponent"), w = G("TableFooterComponent"), S = i ? /* @__PURE__ */ z(
|
|
2678
|
+
C,
|
|
2671
2679
|
{
|
|
2672
|
-
ref:
|
|
2680
|
+
ref: a,
|
|
2673
2681
|
style: { position: "sticky", top: 0, zIndex: 2 },
|
|
2674
|
-
...Z(
|
|
2682
|
+
...Z(C, c),
|
|
2675
2683
|
children: i()
|
|
2676
2684
|
},
|
|
2677
2685
|
"TableHead"
|
|
2678
|
-
) : null,
|
|
2679
|
-
|
|
2686
|
+
) : null, m = l ? /* @__PURE__ */ z(
|
|
2687
|
+
w,
|
|
2680
2688
|
{
|
|
2681
|
-
ref:
|
|
2689
|
+
ref: p,
|
|
2682
2690
|
style: { bottom: 0, position: "sticky", zIndex: 1 },
|
|
2683
|
-
...Z(
|
|
2691
|
+
...Z(w, c),
|
|
2684
2692
|
children: l()
|
|
2685
2693
|
},
|
|
2686
2694
|
"TableFoot"
|
|
2687
2695
|
) : null;
|
|
2688
|
-
return /* @__PURE__ */ z(
|
|
2689
|
-
|
|
2696
|
+
return /* @__PURE__ */ z(I, { ...e, ...Z(I, c), children: /* @__PURE__ */ z(h, { children: /* @__PURE__ */ Kt(f, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...Z(f, c), children: [
|
|
2697
|
+
S,
|
|
2690
2698
|
/* @__PURE__ */ z(Tr, {}, "TableBody"),
|
|
2691
|
-
|
|
2699
|
+
m
|
|
2692
2700
|
] }) }) });
|
|
2693
2701
|
}), {
|
|
2694
|
-
Component:
|
|
2702
|
+
Component: yr,
|
|
2695
2703
|
useEmitter: Qe,
|
|
2696
|
-
useEmitterValue:
|
|
2704
|
+
useEmitterValue: G,
|
|
2697
2705
|
usePublisher: Tt
|
|
2698
2706
|
} = /* @__PURE__ */ qe(
|
|
2699
2707
|
gr,
|
|
2700
2708
|
{
|
|
2701
|
-
|
|
2702
|
-
atBottomStateChange: "atBottomStateChange",
|
|
2703
|
-
atTopStateChange: "atTopStateChange",
|
|
2704
|
-
endReached: "endReached",
|
|
2705
|
-
groupIndices: "groupIndices",
|
|
2706
|
-
isScrolling: "isScrolling",
|
|
2707
|
-
itemsRendered: "itemsRendered",
|
|
2708
|
-
rangeChanged: "rangeChanged",
|
|
2709
|
-
startReached: "startReached",
|
|
2710
|
-
totalListHeightChanged: "totalListHeightChanged"
|
|
2711
|
-
},
|
|
2712
|
-
methods: {
|
|
2713
|
-
getState: "getState",
|
|
2714
|
-
scrollBy: "scrollBy",
|
|
2715
|
-
scrollIntoView: "scrollIntoView",
|
|
2716
|
-
scrollTo: "scrollTo",
|
|
2717
|
-
scrollToIndex: "scrollToIndex"
|
|
2718
|
-
},
|
|
2709
|
+
required: {},
|
|
2719
2710
|
optional: {
|
|
2720
|
-
|
|
2711
|
+
restoreStateFrom: "restoreStateFrom",
|
|
2712
|
+
context: "context",
|
|
2713
|
+
followOutput: "followOutput",
|
|
2714
|
+
firstItemIndex: "firstItemIndex",
|
|
2715
|
+
itemContent: "itemContent",
|
|
2716
|
+
fixedHeaderContent: "fixedHeaderContent",
|
|
2717
|
+
fixedFooterContent: "fixedFooterContent",
|
|
2718
|
+
overscan: "overscan",
|
|
2719
|
+
increaseViewportBy: "increaseViewportBy",
|
|
2720
|
+
totalCount: "totalCount",
|
|
2721
|
+
topItemCount: "topItemCount",
|
|
2722
|
+
initialTopMostItemIndex: "initialTopMostItemIndex",
|
|
2723
|
+
components: "components",
|
|
2724
|
+
groupCounts: "groupCounts",
|
|
2721
2725
|
atBottomThreshold: "atBottomThreshold",
|
|
2722
2726
|
atTopThreshold: "atTopThreshold",
|
|
2723
|
-
components: "components",
|
|
2724
2727
|
computeItemKey: "computeItemKey",
|
|
2725
|
-
context: "context",
|
|
2726
|
-
customScrollParent: "customScrollParent",
|
|
2727
|
-
data: "data",
|
|
2728
2728
|
defaultItemHeight: "defaultItemHeight",
|
|
2729
|
-
firstItemIndex: "firstItemIndex",
|
|
2730
|
-
fixedFooterContent: "fixedFooterContent",
|
|
2731
|
-
fixedHeaderContent: "fixedHeaderContent",
|
|
2732
2729
|
fixedItemHeight: "fixedItemHeight",
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2730
|
+
itemSize: "itemSize",
|
|
2731
|
+
scrollSeekConfiguration: "scrollSeekConfiguration",
|
|
2732
|
+
data: "data",
|
|
2736
2733
|
initialItemCount: "initialItemCount",
|
|
2737
2734
|
initialScrollTop: "initialScrollTop",
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
logLevel: "logLevel",
|
|
2742
|
-
overscan: "overscan",
|
|
2743
|
-
restoreStateFrom: "restoreStateFrom",
|
|
2735
|
+
alignToBottom: "alignToBottom",
|
|
2736
|
+
useWindowScroll: "useWindowScroll",
|
|
2737
|
+
customScrollParent: "customScrollParent",
|
|
2744
2738
|
scrollerRef: "scrollerRef",
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2739
|
+
logLevel: "logLevel"
|
|
2740
|
+
},
|
|
2741
|
+
methods: {
|
|
2742
|
+
scrollToIndex: "scrollToIndex",
|
|
2743
|
+
scrollIntoView: "scrollIntoView",
|
|
2744
|
+
scrollTo: "scrollTo",
|
|
2745
|
+
scrollBy: "scrollBy",
|
|
2746
|
+
getState: "getState"
|
|
2749
2747
|
},
|
|
2750
|
-
|
|
2748
|
+
events: {
|
|
2749
|
+
isScrolling: "isScrolling",
|
|
2750
|
+
endReached: "endReached",
|
|
2751
|
+
startReached: "startReached",
|
|
2752
|
+
rangeChanged: "rangeChanged",
|
|
2753
|
+
atBottomStateChange: "atBottomStateChange",
|
|
2754
|
+
atTopStateChange: "atTopStateChange",
|
|
2755
|
+
totalListHeightChanged: "totalListHeightChanged",
|
|
2756
|
+
itemsRendered: "itemsRendered",
|
|
2757
|
+
groupIndices: "groupIndices"
|
|
2758
|
+
}
|
|
2751
2759
|
},
|
|
2752
|
-
|
|
2753
|
-
),
|
|
2760
|
+
vr
|
|
2761
|
+
), Rr = /* @__PURE__ */ Ze({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), br = /* @__PURE__ */ Xe({ useEmitter: Qe, useEmitterValue: G, usePublisher: Tt }), qr = yr, wn = {
|
|
2754
2762
|
bottom: 0,
|
|
2755
2763
|
itemHeight: 0,
|
|
2756
2764
|
items: [],
|
|
@@ -2766,8 +2774,8 @@ const ur = ({ children: t }) => {
|
|
|
2766
2774
|
offsetBottom: 0,
|
|
2767
2775
|
offsetTop: 0,
|
|
2768
2776
|
top: 0
|
|
2769
|
-
}, { ceil:
|
|
2770
|
-
function
|
|
2777
|
+
}, { ceil: vn, floor: Ce, max: ee, min: Oe, round: yn } = Math;
|
|
2778
|
+
function Rn(t, e, n) {
|
|
2771
2779
|
return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
|
|
2772
2780
|
}
|
|
2773
2781
|
function Er(t) {
|
|
@@ -2779,260 +2787,260 @@ function Er(t) {
|
|
|
2779
2787
|
function he(t, e) {
|
|
2780
2788
|
return t && t.width === e.width && t.height === e.height;
|
|
2781
2789
|
}
|
|
2782
|
-
function
|
|
2790
|
+
function Br(t, e) {
|
|
2783
2791
|
return t && t.column === e.column && t.row === e.row;
|
|
2784
2792
|
}
|
|
2785
|
-
const
|
|
2793
|
+
const kr = /* @__PURE__ */ U(
|
|
2786
2794
|
([
|
|
2787
2795
|
{ increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
|
|
2788
|
-
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop:
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
{ didMount:
|
|
2792
|
-
{ customScrollParent:
|
|
2793
|
-
|
|
2796
|
+
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: a, smoothScrollTargetReached: p, viewportHeight: I },
|
|
2797
|
+
h,
|
|
2798
|
+
f,
|
|
2799
|
+
{ didMount: C, propsReady: w },
|
|
2800
|
+
{ customScrollParent: S, useWindowScroll: m, windowScrollContainerState: u, windowScrollTo: T, windowViewportRect: R },
|
|
2801
|
+
g
|
|
2794
2802
|
]) => {
|
|
2795
|
-
const d =
|
|
2803
|
+
const d = v(0), b = v(0), k = v(wn), F = v({ height: 0, width: 0 }), L = v({ height: 0, width: 0 }), V = $(), D = $(), J = v(0), nt = v(null), B = v({ column: 0, row: 0 }), q = $(), it = $(), dt = v(!1), St = v(0), ft = v(!0), ut = v(!1), At = v(!1);
|
|
2796
2804
|
K(
|
|
2797
2805
|
x(
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
P(([
|
|
2806
|
+
C,
|
|
2807
|
+
_(St),
|
|
2808
|
+
P(([y, N]) => !!N)
|
|
2801
2809
|
),
|
|
2802
2810
|
() => {
|
|
2803
2811
|
W(ft, !1);
|
|
2804
2812
|
}
|
|
2805
2813
|
), K(
|
|
2806
2814
|
x(
|
|
2807
|
-
rt(
|
|
2808
|
-
P(([
|
|
2815
|
+
rt(C, ft, L, F, St, ut),
|
|
2816
|
+
P(([y, N, Q, lt, , tt]) => y && !N && Q.height !== 0 && lt.height !== 0 && !tt)
|
|
2809
2817
|
),
|
|
2810
|
-
([, , , ,
|
|
2818
|
+
([, , , , y]) => {
|
|
2811
2819
|
W(ut, !0), $e(1, () => {
|
|
2812
|
-
W(V,
|
|
2813
|
-
}),
|
|
2820
|
+
W(V, y);
|
|
2821
|
+
}), bt(x(a), () => {
|
|
2814
2822
|
W(e, [0, 0]), W(ft, !0);
|
|
2815
2823
|
});
|
|
2816
2824
|
}
|
|
2817
|
-
),
|
|
2825
|
+
), O(
|
|
2818
2826
|
x(
|
|
2819
|
-
|
|
2820
|
-
P((
|
|
2821
|
-
|
|
2827
|
+
it,
|
|
2828
|
+
P((y) => y != null && y.scrollTop > 0),
|
|
2829
|
+
yt(0)
|
|
2822
2830
|
),
|
|
2823
|
-
|
|
2831
|
+
b
|
|
2824
2832
|
), K(
|
|
2825
2833
|
x(
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
P(([,
|
|
2834
|
+
C,
|
|
2835
|
+
_(it),
|
|
2836
|
+
P(([, y]) => y != null)
|
|
2829
2837
|
),
|
|
2830
|
-
([,
|
|
2831
|
-
|
|
2838
|
+
([, y]) => {
|
|
2839
|
+
y && (W(F, y.viewport), W(L, y.item), W(B, y.gap), y.scrollTop > 0 && (W(dt, !0), bt(x(a, jt(1)), (N) => {
|
|
2832
2840
|
W(dt, !1);
|
|
2833
|
-
}), W(c, { top:
|
|
2841
|
+
}), W(c, { top: y.scrollTop })));
|
|
2834
2842
|
}
|
|
2835
|
-
),
|
|
2843
|
+
), O(
|
|
2836
2844
|
x(
|
|
2837
|
-
|
|
2838
|
-
E(({ height:
|
|
2845
|
+
F,
|
|
2846
|
+
E(({ height: y }) => y)
|
|
2839
2847
|
),
|
|
2840
|
-
|
|
2841
|
-
),
|
|
2848
|
+
I
|
|
2849
|
+
), O(
|
|
2842
2850
|
x(
|
|
2843
2851
|
rt(
|
|
2844
|
-
A(
|
|
2852
|
+
A(F, he),
|
|
2845
2853
|
A(L, he),
|
|
2846
|
-
A(
|
|
2847
|
-
A(
|
|
2854
|
+
A(B, (y, N) => y && y.column === N.column && y.row === N.row),
|
|
2855
|
+
A(a)
|
|
2848
2856
|
),
|
|
2849
|
-
E(([
|
|
2857
|
+
E(([y, N, Q, lt]) => ({
|
|
2850
2858
|
gap: Q,
|
|
2851
2859
|
item: N,
|
|
2852
|
-
scrollTop:
|
|
2853
|
-
viewport:
|
|
2860
|
+
scrollTop: lt,
|
|
2861
|
+
viewport: y
|
|
2854
2862
|
}))
|
|
2855
2863
|
),
|
|
2856
2864
|
q
|
|
2857
|
-
),
|
|
2865
|
+
), O(
|
|
2858
2866
|
x(
|
|
2859
2867
|
rt(
|
|
2860
2868
|
A(d),
|
|
2861
2869
|
o,
|
|
2862
|
-
A(
|
|
2870
|
+
A(B, Br),
|
|
2863
2871
|
A(L, he),
|
|
2864
|
-
A(
|
|
2872
|
+
A(F, he),
|
|
2865
2873
|
A(nt),
|
|
2866
|
-
A(
|
|
2874
|
+
A(b),
|
|
2867
2875
|
A(dt),
|
|
2868
2876
|
A(ft),
|
|
2869
2877
|
A(St)
|
|
2870
2878
|
),
|
|
2871
|
-
P(([, , , , , , ,
|
|
2879
|
+
P(([, , , , , , , y]) => !y),
|
|
2872
2880
|
E(
|
|
2873
2881
|
([
|
|
2874
|
-
|
|
2882
|
+
y,
|
|
2875
2883
|
[N, Q],
|
|
2876
|
-
|
|
2884
|
+
lt,
|
|
2877
2885
|
tt,
|
|
2878
|
-
|
|
2886
|
+
kt,
|
|
2879
2887
|
Jt,
|
|
2880
2888
|
Nt,
|
|
2881
2889
|
,
|
|
2882
2890
|
de,
|
|
2883
|
-
|
|
2891
|
+
Ft
|
|
2884
2892
|
]) => {
|
|
2885
|
-
const { column:
|
|
2886
|
-
if (Nt === 0 && (
|
|
2893
|
+
const { column: Ot, row: Qt } = lt, { height: fe, width: He } = tt, { width: tn } = kt;
|
|
2894
|
+
if (Nt === 0 && (y === 0 || tn === 0))
|
|
2887
2895
|
return wn;
|
|
2888
2896
|
if (He === 0) {
|
|
2889
|
-
const sn = Ue(
|
|
2890
|
-
return Er(
|
|
2897
|
+
const sn = Ue(Ft, y), ro = sn + Math.max(Nt - 1, 0);
|
|
2898
|
+
return Er(Rn(sn, ro, Jt));
|
|
2891
2899
|
}
|
|
2892
|
-
const me =
|
|
2900
|
+
const me = eo(tn, He, Ot);
|
|
2893
2901
|
let Dt, Wt;
|
|
2894
|
-
de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me *
|
|
2895
|
-
const en =
|
|
2896
|
-
return { bottom: nn, itemHeight: fe, items: en, itemWidth: He, offsetBottom:
|
|
2902
|
+
de ? N === 0 && Q === 0 && Nt > 0 ? (Dt = 0, Wt = Nt - 1) : (Dt = me * Ce((N + Qt) / (fe + Qt)), Wt = me * vn((Q + Qt) / (fe + Qt)) - 1, Wt = Oe(y - 1, ee(Wt, me - 1)), Dt = Oe(Wt, ee(0, Dt))) : (Dt = 0, Wt = -1);
|
|
2903
|
+
const en = Rn(Dt, Wt, Jt), { bottom: nn, top: on } = bn(kt, lt, tt, en), rn = vn(y / me), oo = rn * fe + (rn - 1) * Qt - nn;
|
|
2904
|
+
return { bottom: nn, itemHeight: fe, items: en, itemWidth: He, offsetBottom: oo, offsetTop: on, top: on };
|
|
2897
2905
|
}
|
|
2898
2906
|
)
|
|
2899
2907
|
),
|
|
2900
|
-
|
|
2901
|
-
),
|
|
2908
|
+
k
|
|
2909
|
+
), O(
|
|
2902
2910
|
x(
|
|
2903
2911
|
nt,
|
|
2904
|
-
P((
|
|
2905
|
-
E((
|
|
2912
|
+
P((y) => y !== null),
|
|
2913
|
+
E((y) => y.length)
|
|
2906
2914
|
),
|
|
2907
2915
|
d
|
|
2908
|
-
),
|
|
2916
|
+
), O(
|
|
2909
2917
|
x(
|
|
2910
|
-
rt(
|
|
2911
|
-
P(([
|
|
2912
|
-
E(([
|
|
2913
|
-
const { bottom: tt, top:
|
|
2914
|
-
return [
|
|
2918
|
+
rt(F, L, k, B),
|
|
2919
|
+
P(([y, N, { items: Q }]) => Q.length > 0 && N.height !== 0 && y.height !== 0),
|
|
2920
|
+
E(([y, N, { items: Q }, lt]) => {
|
|
2921
|
+
const { bottom: tt, top: kt } = bn(y, lt, N, Q);
|
|
2922
|
+
return [kt, tt];
|
|
2915
2923
|
}),
|
|
2916
2924
|
Y(se)
|
|
2917
2925
|
),
|
|
2918
2926
|
e
|
|
2919
2927
|
);
|
|
2920
|
-
const xt =
|
|
2921
|
-
|
|
2928
|
+
const xt = v(!1);
|
|
2929
|
+
O(
|
|
2922
2930
|
x(
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
E(([
|
|
2931
|
+
a,
|
|
2932
|
+
_(xt),
|
|
2933
|
+
E(([y, N]) => N || y !== 0)
|
|
2926
2934
|
),
|
|
2927
2935
|
xt
|
|
2928
2936
|
);
|
|
2929
|
-
const Xt =
|
|
2937
|
+
const Xt = ht(
|
|
2930
2938
|
x(
|
|
2931
|
-
rt(
|
|
2932
|
-
P(([{ items:
|
|
2933
|
-
|
|
2934
|
-
P(([[
|
|
2935
|
-
const tt =
|
|
2936
|
-
return (Q ||
|
|
2939
|
+
rt(k, d),
|
|
2940
|
+
P(([{ items: y }]) => y.length > 0),
|
|
2941
|
+
_(xt),
|
|
2942
|
+
P(([[y, N], Q]) => {
|
|
2943
|
+
const tt = y.items[y.items.length - 1].index === N - 1;
|
|
2944
|
+
return (Q || y.bottom > 0 && y.itemHeight > 0 && y.offsetBottom === 0 && y.items.length === N) && tt;
|
|
2937
2945
|
}),
|
|
2938
|
-
E(([[,
|
|
2946
|
+
E(([[, y]]) => y - 1),
|
|
2939
2947
|
Y()
|
|
2940
2948
|
)
|
|
2941
|
-
), Mt =
|
|
2949
|
+
), Mt = ht(
|
|
2942
2950
|
x(
|
|
2943
|
-
A(
|
|
2944
|
-
P(({ items:
|
|
2945
|
-
|
|
2951
|
+
A(k),
|
|
2952
|
+
P(({ items: y }) => y.length > 0 && y[0].index === 0),
|
|
2953
|
+
yt(0),
|
|
2946
2954
|
Y()
|
|
2947
2955
|
)
|
|
2948
|
-
),
|
|
2956
|
+
), vt = ht(
|
|
2949
2957
|
x(
|
|
2950
|
-
A(
|
|
2951
|
-
|
|
2952
|
-
P(([{ items:
|
|
2953
|
-
E(([{ items:
|
|
2954
|
-
endIndex:
|
|
2955
|
-
startIndex:
|
|
2958
|
+
A(k),
|
|
2959
|
+
_(dt),
|
|
2960
|
+
P(([{ items: y }, N]) => y.length > 0 && !N),
|
|
2961
|
+
E(([{ items: y }]) => ({
|
|
2962
|
+
endIndex: y[y.length - 1].index,
|
|
2963
|
+
startIndex: y[0].index
|
|
2956
2964
|
})),
|
|
2957
|
-
Y(
|
|
2965
|
+
Y(Pn),
|
|
2958
2966
|
Lt(0)
|
|
2959
2967
|
)
|
|
2960
2968
|
);
|
|
2961
|
-
|
|
2969
|
+
O(vt, f.scrollSeekRangeChanged), O(
|
|
2962
2970
|
x(
|
|
2963
2971
|
V,
|
|
2964
|
-
|
|
2965
|
-
E(([
|
|
2966
|
-
const
|
|
2967
|
-
let
|
|
2968
|
-
|
|
2969
|
-
let
|
|
2970
|
-
return Jt === "end" ?
|
|
2972
|
+
_(F, L, d, B),
|
|
2973
|
+
E(([y, N, Q, lt, tt]) => {
|
|
2974
|
+
const kt = _n(y), { align: Jt, behavior: Nt, offset: de } = kt;
|
|
2975
|
+
let Ft = kt.index;
|
|
2976
|
+
Ft === "LAST" && (Ft = lt - 1), Ft = ee(0, Ft, Oe(lt - 1, Ft));
|
|
2977
|
+
let Ot = Ae(N, tt, Q, Ft);
|
|
2978
|
+
return Jt === "end" ? Ot = yn(Ot - N.height + Q.height) : Jt === "center" && (Ot = yn(Ot - N.height / 2 + Q.height / 2)), de && (Ot += de), { behavior: Nt, top: Ot };
|
|
2971
2979
|
})
|
|
2972
2980
|
),
|
|
2973
2981
|
c
|
|
2974
2982
|
);
|
|
2975
|
-
const
|
|
2983
|
+
const Bt = ct(
|
|
2976
2984
|
x(
|
|
2977
|
-
|
|
2978
|
-
E((
|
|
2985
|
+
k,
|
|
2986
|
+
E((y) => y.offsetBottom + y.bottom)
|
|
2979
2987
|
),
|
|
2980
2988
|
0
|
|
2981
2989
|
);
|
|
2982
|
-
return
|
|
2990
|
+
return O(
|
|
2983
2991
|
x(
|
|
2984
|
-
|
|
2985
|
-
E((
|
|
2992
|
+
R,
|
|
2993
|
+
E((y) => ({ height: y.visibleHeight, width: y.visibleWidth }))
|
|
2986
2994
|
),
|
|
2987
|
-
|
|
2995
|
+
F
|
|
2988
2996
|
), {
|
|
2989
|
-
customScrollParent:
|
|
2997
|
+
customScrollParent: S,
|
|
2990
2998
|
// input
|
|
2991
2999
|
data: nt,
|
|
2992
3000
|
deviation: J,
|
|
2993
3001
|
footerHeight: r,
|
|
2994
|
-
gap:
|
|
3002
|
+
gap: B,
|
|
2995
3003
|
headerHeight: s,
|
|
2996
3004
|
increaseViewportBy: t,
|
|
2997
|
-
initialItemCount:
|
|
3005
|
+
initialItemCount: b,
|
|
2998
3006
|
itemDimensions: L,
|
|
2999
3007
|
overscan: n,
|
|
3000
|
-
restoreStateFrom:
|
|
3008
|
+
restoreStateFrom: it,
|
|
3001
3009
|
scrollBy: i,
|
|
3002
3010
|
scrollContainerState: l,
|
|
3003
3011
|
scrollHeight: D,
|
|
3004
3012
|
scrollTo: c,
|
|
3005
3013
|
scrollToIndex: V,
|
|
3006
|
-
scrollTop:
|
|
3007
|
-
smoothScrollTargetReached:
|
|
3014
|
+
scrollTop: a,
|
|
3015
|
+
smoothScrollTargetReached: p,
|
|
3008
3016
|
totalCount: d,
|
|
3009
|
-
useWindowScroll:
|
|
3010
|
-
viewportDimensions:
|
|
3011
|
-
windowScrollContainerState:
|
|
3017
|
+
useWindowScroll: m,
|
|
3018
|
+
viewportDimensions: F,
|
|
3019
|
+
windowScrollContainerState: u,
|
|
3012
3020
|
windowScrollTo: T,
|
|
3013
|
-
windowViewportRect:
|
|
3014
|
-
...
|
|
3021
|
+
windowViewportRect: R,
|
|
3022
|
+
...f,
|
|
3015
3023
|
// output
|
|
3016
|
-
gridState:
|
|
3024
|
+
gridState: k,
|
|
3017
3025
|
horizontalDirection: At,
|
|
3018
3026
|
initialTopMostItemIndex: St,
|
|
3019
|
-
totalListHeight:
|
|
3020
|
-
...
|
|
3027
|
+
totalListHeight: Bt,
|
|
3028
|
+
...h,
|
|
3021
3029
|
endReached: Xt,
|
|
3022
|
-
propsReady:
|
|
3023
|
-
rangeChanged:
|
|
3030
|
+
propsReady: w,
|
|
3031
|
+
rangeChanged: vt,
|
|
3024
3032
|
startReached: Mt,
|
|
3025
3033
|
stateChanged: q,
|
|
3026
3034
|
stateRestoreInProgress: dt,
|
|
3027
|
-
...
|
|
3035
|
+
...g
|
|
3028
3036
|
};
|
|
3029
3037
|
},
|
|
3030
|
-
X(Ke, at, ae,
|
|
3038
|
+
X(Ke, at, ae, Un, Pt, je, Vt)
|
|
3031
3039
|
);
|
|
3032
|
-
function
|
|
3040
|
+
function eo(t, e, n) {
|
|
3033
3041
|
return ee(1, Ce((t + n) / (Ce(e) + n)));
|
|
3034
3042
|
}
|
|
3035
|
-
function
|
|
3043
|
+
function bn(t, e, n, o) {
|
|
3036
3044
|
const { height: r } = n;
|
|
3037
3045
|
if (r === void 0 || o.length === 0)
|
|
3038
3046
|
return { bottom: 0, top: 0 };
|
|
@@ -3040,19 +3048,19 @@ function Rn(t, e, n, o) {
|
|
|
3040
3048
|
return { bottom: Ae(t, e, n, o[o.length - 1].index) + r, top: s };
|
|
3041
3049
|
}
|
|
3042
3050
|
function Ae(t, e, n, o) {
|
|
3043
|
-
const r =
|
|
3051
|
+
const r = eo(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + ee(0, s - 1) * e.row;
|
|
3044
3052
|
return i > 0 ? i + e.row : i;
|
|
3045
3053
|
}
|
|
3046
|
-
const
|
|
3047
|
-
const t =
|
|
3054
|
+
const Fr = /* @__PURE__ */ U(() => {
|
|
3055
|
+
const t = v((I) => `Item ${I}`), e = v({}), n = v(null), o = v("virtuoso-grid-item"), r = v("virtuoso-grid-list"), s = v(Ye), i = v("div"), l = v(Yt), c = (I, h = null) => ct(
|
|
3048
3056
|
x(
|
|
3049
3057
|
e,
|
|
3050
|
-
E((
|
|
3058
|
+
E((f) => f[I]),
|
|
3051
3059
|
Y()
|
|
3052
3060
|
),
|
|
3053
|
-
|
|
3054
|
-
),
|
|
3055
|
-
return
|
|
3061
|
+
h
|
|
3062
|
+
), a = v(!1), p = v(!1);
|
|
3063
|
+
return O(A(p), a), {
|
|
3056
3064
|
components: e,
|
|
3057
3065
|
computeItemKey: s,
|
|
3058
3066
|
context: n,
|
|
@@ -3064,66 +3072,66 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3064
3072
|
itemContent: t,
|
|
3065
3073
|
listClassName: r,
|
|
3066
3074
|
ListComponent: c("List", "div"),
|
|
3067
|
-
readyStateChanged:
|
|
3068
|
-
reportReadyState:
|
|
3075
|
+
readyStateChanged: a,
|
|
3076
|
+
reportReadyState: p,
|
|
3069
3077
|
ScrollerComponent: c("Scroller", "div"),
|
|
3070
3078
|
scrollerRef: l,
|
|
3071
3079
|
ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
|
|
3072
3080
|
};
|
|
3073
|
-
}),
|
|
3081
|
+
}), Or = /* @__PURE__ */ U(
|
|
3074
3082
|
([t, e]) => ({ ...t, ...e }),
|
|
3075
|
-
X(
|
|
3083
|
+
X(kr, Fr)
|
|
3076
3084
|
), Lr = /* @__PURE__ */ H.memo(function() {
|
|
3077
|
-
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"),
|
|
3085
|
+
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = It("scrollHeight"), c = et("ItemComponent"), a = et("ListComponent"), p = et("ScrollSeekPlaceholder"), I = et("context"), h = It("itemDimensions"), f = It("gap"), C = et("log"), w = et("stateRestoreInProgress"), S = It("reportReadyState"), m = Ht(
|
|
3078
3086
|
H.useMemo(
|
|
3079
|
-
() => (
|
|
3080
|
-
const T =
|
|
3087
|
+
() => (u) => {
|
|
3088
|
+
const T = u.parentElement.parentElement.scrollHeight;
|
|
3081
3089
|
l(T);
|
|
3082
|
-
const
|
|
3083
|
-
if (
|
|
3084
|
-
const { height:
|
|
3085
|
-
|
|
3090
|
+
const R = u.firstChild;
|
|
3091
|
+
if (R) {
|
|
3092
|
+
const { height: g, width: d } = R.getBoundingClientRect();
|
|
3093
|
+
h({ height: g, width: d });
|
|
3086
3094
|
}
|
|
3087
|
-
|
|
3088
|
-
column: Hn("column-gap", getComputedStyle(
|
|
3089
|
-
row: Hn("row-gap", getComputedStyle(
|
|
3095
|
+
f({
|
|
3096
|
+
column: Hn("column-gap", getComputedStyle(u).columnGap, C),
|
|
3097
|
+
row: Hn("row-gap", getComputedStyle(u).rowGap, C)
|
|
3090
3098
|
});
|
|
3091
3099
|
},
|
|
3092
|
-
[l,
|
|
3100
|
+
[l, h, f, C]
|
|
3093
3101
|
),
|
|
3094
3102
|
!0,
|
|
3095
3103
|
!1
|
|
3096
3104
|
);
|
|
3097
|
-
return
|
|
3098
|
-
e.itemHeight > 0 && e.itemWidth > 0 &&
|
|
3099
|
-
}, [e]),
|
|
3100
|
-
|
|
3105
|
+
return Yn(() => {
|
|
3106
|
+
e.itemHeight > 0 && e.itemWidth > 0 && S(!0);
|
|
3107
|
+
}, [e]), w ? null : /* @__PURE__ */ z(
|
|
3108
|
+
a,
|
|
3101
3109
|
{
|
|
3102
3110
|
className: n,
|
|
3103
|
-
ref:
|
|
3104
|
-
...Z(
|
|
3111
|
+
ref: m,
|
|
3112
|
+
...Z(a, I),
|
|
3105
3113
|
"data-testid": "virtuoso-item-list",
|
|
3106
3114
|
style: { paddingBottom: e.offsetBottom, paddingTop: e.offsetTop },
|
|
3107
|
-
children: e.items.map((
|
|
3108
|
-
const T = s(
|
|
3115
|
+
children: e.items.map((u) => {
|
|
3116
|
+
const T = s(u.index, u.data, I);
|
|
3109
3117
|
return i ? /* @__PURE__ */ z(
|
|
3110
|
-
|
|
3118
|
+
p,
|
|
3111
3119
|
{
|
|
3112
|
-
...Z(
|
|
3120
|
+
...Z(p, I),
|
|
3113
3121
|
height: e.itemHeight,
|
|
3114
|
-
index:
|
|
3122
|
+
index: u.index,
|
|
3115
3123
|
width: e.itemWidth
|
|
3116
3124
|
},
|
|
3117
3125
|
T
|
|
3118
3126
|
) : /* @__PURE__ */ $t(
|
|
3119
3127
|
c,
|
|
3120
3128
|
{
|
|
3121
|
-
...Z(c,
|
|
3129
|
+
...Z(c, I),
|
|
3122
3130
|
className: o,
|
|
3123
|
-
"data-index":
|
|
3131
|
+
"data-index": u.index,
|
|
3124
3132
|
key: T
|
|
3125
3133
|
},
|
|
3126
|
-
r(
|
|
3134
|
+
r(u.index, u.data, I)
|
|
3127
3135
|
);
|
|
3128
3136
|
})
|
|
3129
3137
|
}
|
|
@@ -3153,7 +3161,7 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3153
3161
|
), s = et("context");
|
|
3154
3162
|
return e ? /* @__PURE__ */ z(o, { ref: r, children: /* @__PURE__ */ z(e, { ...Z(e, s) }) }) : null;
|
|
3155
3163
|
}), Pr = ({ children: t }) => {
|
|
3156
|
-
const e = H.useContext(
|
|
3164
|
+
const e = H.useContext(qn), n = It("itemDimensions"), o = It("viewportDimensions"), r = Ht(
|
|
3157
3165
|
H.useMemo(
|
|
3158
3166
|
() => (s) => {
|
|
3159
3167
|
o(s.getBoundingClientRect());
|
|
@@ -3167,12 +3175,12 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3167
3175
|
e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
|
|
3168
3176
|
}, [e, o, n]), /* @__PURE__ */ z("div", { ref: r, style: Zt(!1), children: t });
|
|
3169
3177
|
}, Ar = ({ children: t }) => {
|
|
3170
|
-
const e = H.useContext(
|
|
3178
|
+
const e = H.useContext(qn), n = It("windowViewportRect"), o = It("itemDimensions"), r = et("customScrollParent"), s = _e(n, r, !1);
|
|
3171
3179
|
return H.useEffect(() => {
|
|
3172
3180
|
e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
|
|
3173
3181
|
}, [e, n, o]), /* @__PURE__ */ z("div", { ref: s, style: Zt(!1), children: t });
|
|
3174
3182
|
}, Mr = /* @__PURE__ */ H.memo(function({ ...e }) {
|
|
3175
|
-
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ?
|
|
3183
|
+
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? _r : Gr, s = o || n ? Ar : Pr, i = et("context");
|
|
3176
3184
|
return /* @__PURE__ */ z(r, { ...e, ...Z(r, i), children: /* @__PURE__ */ Kt(s, { children: [
|
|
3177
3185
|
/* @__PURE__ */ z(zr, {}),
|
|
3178
3186
|
/* @__PURE__ */ z(Lr, {}),
|
|
@@ -3180,61 +3188,61 @@ const Or = /* @__PURE__ */ U(() => {
|
|
|
3180
3188
|
] }) });
|
|
3181
3189
|
}), {
|
|
3182
3190
|
Component: Wr,
|
|
3183
|
-
useEmitter:
|
|
3191
|
+
useEmitter: no,
|
|
3184
3192
|
useEmitterValue: et,
|
|
3185
3193
|
usePublisher: It
|
|
3186
3194
|
} = /* @__PURE__ */ qe(
|
|
3187
|
-
|
|
3195
|
+
Or,
|
|
3188
3196
|
{
|
|
3189
|
-
events: {
|
|
3190
|
-
atBottomStateChange: "atBottomStateChange",
|
|
3191
|
-
atTopStateChange: "atTopStateChange",
|
|
3192
|
-
endReached: "endReached",
|
|
3193
|
-
isScrolling: "isScrolling",
|
|
3194
|
-
rangeChanged: "rangeChanged",
|
|
3195
|
-
readyStateChanged: "readyStateChanged",
|
|
3196
|
-
startReached: "startReached",
|
|
3197
|
-
stateChanged: "stateChanged"
|
|
3198
|
-
},
|
|
3199
|
-
methods: {
|
|
3200
|
-
scrollBy: "scrollBy",
|
|
3201
|
-
scrollTo: "scrollTo",
|
|
3202
|
-
scrollToIndex: "scrollToIndex"
|
|
3203
|
-
},
|
|
3204
3197
|
optional: {
|
|
3198
|
+
context: "context",
|
|
3199
|
+
totalCount: "totalCount",
|
|
3200
|
+
overscan: "overscan",
|
|
3201
|
+
itemContent: "itemContent",
|
|
3205
3202
|
components: "components",
|
|
3206
3203
|
computeItemKey: "computeItemKey",
|
|
3207
|
-
context: "context",
|
|
3208
|
-
customScrollParent: "customScrollParent",
|
|
3209
3204
|
data: "data",
|
|
3210
|
-
headerFooterTag: "headerFooterTag",
|
|
3211
|
-
increaseViewportBy: "increaseViewportBy",
|
|
3212
3205
|
initialItemCount: "initialItemCount",
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
itemContent: "itemContent",
|
|
3206
|
+
scrollSeekConfiguration: "scrollSeekConfiguration",
|
|
3207
|
+
headerFooterTag: "headerFooterTag",
|
|
3216
3208
|
listClassName: "listClassName",
|
|
3209
|
+
itemClassName: "itemClassName",
|
|
3210
|
+
useWindowScroll: "useWindowScroll",
|
|
3211
|
+
customScrollParent: "customScrollParent",
|
|
3212
|
+
scrollerRef: "scrollerRef",
|
|
3217
3213
|
logLevel: "logLevel",
|
|
3218
|
-
overscan: "overscan",
|
|
3219
3214
|
restoreStateFrom: "restoreStateFrom",
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3215
|
+
initialTopMostItemIndex: "initialTopMostItemIndex",
|
|
3216
|
+
increaseViewportBy: "increaseViewportBy"
|
|
3217
|
+
},
|
|
3218
|
+
methods: {
|
|
3219
|
+
scrollTo: "scrollTo",
|
|
3220
|
+
scrollBy: "scrollBy",
|
|
3221
|
+
scrollToIndex: "scrollToIndex"
|
|
3222
|
+
},
|
|
3223
|
+
events: {
|
|
3224
|
+
isScrolling: "isScrolling",
|
|
3225
|
+
endReached: "endReached",
|
|
3226
|
+
startReached: "startReached",
|
|
3227
|
+
rangeChanged: "rangeChanged",
|
|
3228
|
+
atBottomStateChange: "atBottomStateChange",
|
|
3229
|
+
atTopStateChange: "atTopStateChange",
|
|
3230
|
+
stateChanged: "stateChanged",
|
|
3231
|
+
readyStateChanged: "readyStateChanged"
|
|
3224
3232
|
}
|
|
3225
3233
|
},
|
|
3226
3234
|
Mr
|
|
3227
|
-
),
|
|
3235
|
+
), Gr = /* @__PURE__ */ Ze({ useEmitter: no, useEmitterValue: et, usePublisher: It }), _r = /* @__PURE__ */ Xe({ useEmitter: no, useEmitterValue: et, usePublisher: It });
|
|
3228
3236
|
function Hn(t, e, n) {
|
|
3229
|
-
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e,
|
|
3237
|
+
return e !== "normal" && !(e != null && e.endsWith("px")) && n(`${t} was not resolved to pixel value correctly`, e, mt.WARN), e === "normal" ? 0 : parseInt(e != null ? e : "0", 10);
|
|
3230
3238
|
}
|
|
3231
3239
|
const Yr = Wr;
|
|
3232
3240
|
export {
|
|
3233
3241
|
jr as GroupedVirtuoso,
|
|
3234
|
-
|
|
3242
|
+
mt as LogLevel,
|
|
3235
3243
|
qr as TableVirtuoso,
|
|
3236
3244
|
Kr as Virtuoso,
|
|
3237
3245
|
Yr as VirtuosoGrid,
|
|
3238
|
-
|
|
3239
|
-
|
|
3246
|
+
qn as VirtuosoGridMockContext,
|
|
3247
|
+
be as VirtuosoMockContext
|
|
3240
3248
|
};
|