react-virtuoso 4.18.7 → 4.18.9
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/README.md +8 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +534 -527
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as G, jsxs as $t } from "react/jsx-runtime";
|
|
2
2
|
import E, { createElement as Dt } from "react";
|
|
3
|
-
import
|
|
4
|
-
const we = 0, Pt = 1, Xt = 2,
|
|
3
|
+
import xo from "react-dom";
|
|
4
|
+
const we = 0, Pt = 1, Xt = 2, Pn = 4;
|
|
5
5
|
function fn(t) {
|
|
6
6
|
return () => t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function vo(t) {
|
|
9
9
|
t();
|
|
10
10
|
}
|
|
11
11
|
function re(t, e) {
|
|
@@ -14,15 +14,15 @@ function re(t, e) {
|
|
|
14
14
|
function mn(t, e) {
|
|
15
15
|
return () => t(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function To(t, e) {
|
|
18
18
|
return (n) => t(e, n);
|
|
19
19
|
}
|
|
20
20
|
function _e(t) {
|
|
21
21
|
return t !== void 0;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Co(...t) {
|
|
24
24
|
return () => {
|
|
25
|
-
t.map(
|
|
25
|
+
t.map(vo);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function Jt() {
|
|
@@ -30,7 +30,7 @@ function Jt() {
|
|
|
30
30
|
function ye(t, e) {
|
|
31
31
|
return e(t), t;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function wo(t, e) {
|
|
34
34
|
return e(t);
|
|
35
35
|
}
|
|
36
36
|
function rt(...t) {
|
|
@@ -46,10 +46,10 @@ function Ne(t) {
|
|
|
46
46
|
t(Xt);
|
|
47
47
|
}
|
|
48
48
|
function it(t) {
|
|
49
|
-
return t(
|
|
49
|
+
return t(Pn);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return Y(t,
|
|
51
|
+
function z(t, e) {
|
|
52
|
+
return Y(t, To(e, we));
|
|
53
53
|
}
|
|
54
54
|
function yt(t, e) {
|
|
55
55
|
const n = t(Pt, (o) => {
|
|
@@ -65,10 +65,10 @@ function pn(t) {
|
|
|
65
65
|
}, t);
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Gn(t, e) {
|
|
69
69
|
return t === e;
|
|
70
70
|
}
|
|
71
|
-
function nt(t =
|
|
71
|
+
function nt(t = Gn) {
|
|
72
72
|
let e;
|
|
73
73
|
return (n) => (o) => {
|
|
74
74
|
t(e, o) || (e = o, n(o));
|
|
@@ -88,7 +88,7 @@ function Bt(t) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
function x(t, ...e) {
|
|
91
|
-
const n =
|
|
91
|
+
const n = yo(...e);
|
|
92
92
|
return ((o, r) => {
|
|
93
93
|
switch (o) {
|
|
94
94
|
case Xt:
|
|
@@ -99,7 +99,7 @@ function x(t, ...e) {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function Ot(t, e) {
|
|
103
103
|
return (n) => (o) => {
|
|
104
104
|
n(e = t(e, o));
|
|
105
105
|
};
|
|
@@ -118,7 +118,7 @@ function zt(t) {
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
function $(...t) {
|
|
121
|
-
const e =
|
|
121
|
+
const e = Array.from({ length: t.length });
|
|
122
122
|
let n = 0, o = null;
|
|
123
123
|
const r = 2 ** t.length - 1;
|
|
124
124
|
return t.forEach((s, i) => {
|
|
@@ -134,10 +134,10 @@ function $(...t) {
|
|
|
134
134
|
n === r ? l() : o = l;
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
return (e) => t.reduceRight(
|
|
137
|
+
function yo(...t) {
|
|
138
|
+
return (e) => t.reduceRight(wo, e);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function bo(t) {
|
|
141
141
|
let e, n;
|
|
142
142
|
const o = () => e?.();
|
|
143
143
|
return function(r, s) {
|
|
@@ -162,14 +162,14 @@ function T(t) {
|
|
|
162
162
|
r(e);
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
|
-
case
|
|
165
|
+
case Pn:
|
|
166
166
|
return e;
|
|
167
167
|
}
|
|
168
168
|
return n(o, r);
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
function ht(t, e) {
|
|
172
|
-
return ye(T(e), (n) =>
|
|
172
|
+
return ye(T(e), (n) => z(t, n));
|
|
173
173
|
}
|
|
174
174
|
function U() {
|
|
175
175
|
const t = [];
|
|
@@ -181,7 +181,7 @@ function U() {
|
|
|
181
181
|
});
|
|
182
182
|
return;
|
|
183
183
|
case Xt:
|
|
184
|
-
t.splice(0
|
|
184
|
+
t.splice(0);
|
|
185
185
|
return;
|
|
186
186
|
case Pt:
|
|
187
187
|
return t.push(n), () => {
|
|
@@ -192,18 +192,20 @@ function U() {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
function Tt(t) {
|
|
195
|
-
return ye(U(), (e) =>
|
|
195
|
+
return ye(U(), (e) => z(t, e));
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
const Ro = { singleton: !0 };
|
|
198
|
+
function j(t, e = [], n = Ro) {
|
|
199
|
+
const { singleton: o } = n;
|
|
198
200
|
return {
|
|
199
201
|
constructor: t,
|
|
200
202
|
dependencies: e,
|
|
201
|
-
id:
|
|
202
|
-
singleton:
|
|
203
|
+
id: Ho(),
|
|
204
|
+
singleton: o
|
|
203
205
|
};
|
|
204
206
|
}
|
|
205
|
-
const
|
|
206
|
-
function
|
|
207
|
+
const Ho = () => /* @__PURE__ */ Symbol("id");
|
|
208
|
+
function Eo(t) {
|
|
207
209
|
const e = /* @__PURE__ */ new Map(), n = ({ constructor: o, dependencies: r, id: s, singleton: i }) => {
|
|
208
210
|
if (i && e.has(s))
|
|
209
211
|
return e.get(s);
|
|
@@ -213,7 +215,7 @@ function Ro(t) {
|
|
|
213
215
|
return n(t);
|
|
214
216
|
}
|
|
215
217
|
function at(...t) {
|
|
216
|
-
const e = U(), n =
|
|
218
|
+
const e = U(), n = Array.from({ length: t.length });
|
|
217
219
|
let o = 0;
|
|
218
220
|
const r = 2 ** t.length - 1;
|
|
219
221
|
return t.forEach((s, i) => {
|
|
@@ -232,7 +234,7 @@ function at(...t) {
|
|
|
232
234
|
}
|
|
233
235
|
};
|
|
234
236
|
}
|
|
235
|
-
function W(t, e =
|
|
237
|
+
function W(t, e = Gn) {
|
|
236
238
|
return x(t, nt(e));
|
|
237
239
|
}
|
|
238
240
|
function Fe(...t) {
|
|
@@ -241,7 +243,7 @@ function Fe(...t) {
|
|
|
241
243
|
case Xt:
|
|
242
244
|
return;
|
|
243
245
|
case Pt:
|
|
244
|
-
return
|
|
246
|
+
return Co(...t.map((o) => Y(o, n)));
|
|
245
247
|
}
|
|
246
248
|
};
|
|
247
249
|
}
|
|
@@ -254,18 +256,18 @@ const ft = {
|
|
|
254
256
|
WARN: 2,
|
|
255
257
|
/** Error messages for failures (default level) */
|
|
256
258
|
ERROR: 3
|
|
257
|
-
},
|
|
259
|
+
}, Bo = {
|
|
258
260
|
[ft.DEBUG]: "debug",
|
|
259
261
|
[ft.ERROR]: "error",
|
|
260
262
|
[ft.INFO]: "log",
|
|
261
263
|
[ft.WARN]: "warn"
|
|
262
|
-
},
|
|
264
|
+
}, Oo = () => typeof globalThis > "u" ? window : globalThis, Gt = j(
|
|
263
265
|
() => {
|
|
264
266
|
const t = T(ft.ERROR);
|
|
265
267
|
return {
|
|
266
268
|
log: T((n, o, r = ft.INFO) => {
|
|
267
|
-
const s =
|
|
268
|
-
r >= s && console[
|
|
269
|
+
const s = Oo().VIRTUOSO_LOG_LEVEL ?? it(t);
|
|
270
|
+
r >= s && console[Bo[r]](
|
|
269
271
|
"%creact-virtuoso: %c%s %o",
|
|
270
272
|
"color: #0253b3; font-weight: bold",
|
|
271
273
|
"color: initial",
|
|
@@ -279,27 +281,27 @@ const ft = {
|
|
|
279
281
|
[],
|
|
280
282
|
{ singleton: !0 }
|
|
281
283
|
), Ve = /* @__PURE__ */ new WeakMap();
|
|
282
|
-
function
|
|
284
|
+
function Mn(t) {
|
|
283
285
|
return "self" in t ? t.document.documentElement : t;
|
|
284
286
|
}
|
|
285
|
-
function
|
|
286
|
-
const e =
|
|
287
|
+
function Lo(t) {
|
|
288
|
+
const e = Mn(t), n = Ve.get(e);
|
|
287
289
|
if (n !== void 0)
|
|
288
290
|
return n;
|
|
289
291
|
const o = e.ownerDocument.defaultView.getComputedStyle(e).direction === "rtl";
|
|
290
292
|
return Ve.set(e, o), o;
|
|
291
293
|
}
|
|
292
294
|
function hn(t) {
|
|
293
|
-
Ve.delete(
|
|
295
|
+
Ve.delete(Mn(t));
|
|
294
296
|
}
|
|
295
297
|
function An(t, e) {
|
|
296
|
-
return
|
|
298
|
+
return Lo(t) ? -e : e;
|
|
297
299
|
}
|
|
298
300
|
const _t = An;
|
|
299
301
|
function gn(t, e) {
|
|
300
302
|
return An(t, e);
|
|
301
303
|
}
|
|
302
|
-
function
|
|
304
|
+
function Lt(t, e, n) {
|
|
303
305
|
return De(t, e, n).callbackRef;
|
|
304
306
|
}
|
|
305
307
|
function De(t, e, n) {
|
|
@@ -317,14 +319,14 @@ function De(t, e, n) {
|
|
|
317
319
|
i && e ? (s?.observe(i), o.current = i) : (o.current && s?.unobserve(o.current), o.current = null);
|
|
318
320
|
}, { callbackRef: r, ref: o };
|
|
319
321
|
}
|
|
320
|
-
function
|
|
322
|
+
function _n(t, e, n, o, r, s, i, l, c) {
|
|
321
323
|
const d = E.useCallback(
|
|
322
324
|
(m) => {
|
|
323
|
-
const v =
|
|
325
|
+
const v = ko(m.children, e, l ? "offsetWidth" : "offsetHeight", r);
|
|
324
326
|
let p = m.parentElement;
|
|
325
327
|
for (; p.dataset.virtuosoScroller === void 0; )
|
|
326
328
|
p = p.parentElement;
|
|
327
|
-
const I = p.lastElementChild
|
|
329
|
+
const I = p.lastElementChild?.dataset.viewportType === "window";
|
|
328
330
|
let w;
|
|
329
331
|
I && (w = p.ownerDocument.defaultView);
|
|
330
332
|
const R = i ? l ? i.scrollWidth : i.scrollHeight : I ? l ? w.document.documentElement.scrollWidth : w.document.documentElement.scrollHeight : l ? p.scrollWidth : p.scrollHeight, h = i ? l ? i.offsetWidth : i.offsetHeight : I ? l ? w.innerWidth : w.innerHeight : l ? p.offsetWidth : p.offsetHeight, f = i ? l ? _t(i, i.scrollLeft) : i.scrollTop : I ? l ? _t(w, w.scrollX || w.document.documentElement.scrollLeft) : w.scrollY || w.document.documentElement.scrollTop : l ? _t(p, p.scrollLeft) : p.scrollTop;
|
|
@@ -340,7 +342,7 @@ function Mn(t, e, n, o, r, s, i, l, c) {
|
|
|
340
342
|
);
|
|
341
343
|
return De(d, n, c);
|
|
342
344
|
}
|
|
343
|
-
function
|
|
345
|
+
function ko(t, e, n, o) {
|
|
344
346
|
const r = t.length;
|
|
345
347
|
if (r === 0)
|
|
346
348
|
return null;
|
|
@@ -349,7 +351,7 @@ function Lo(t, e, n, o) {
|
|
|
349
351
|
const l = t.item(i);
|
|
350
352
|
if (l.dataset.index === void 0)
|
|
351
353
|
continue;
|
|
352
|
-
const c = parseInt(l.dataset.index), d = parseFloat(l.dataset.knownSize), m = e(l, n);
|
|
354
|
+
const c = parseInt(l.dataset.index, 10), d = parseFloat(l.dataset.knownSize), m = e(l, n);
|
|
353
355
|
if (m === 0 && o("Zero-sized element, this should not happen", { child: l }, ft.ERROR), m === d)
|
|
354
356
|
continue;
|
|
355
357
|
const v = s[s.length - 1];
|
|
@@ -405,19 +407,19 @@ function $e(t, e, n) {
|
|
|
405
407
|
const It = j(
|
|
406
408
|
() => {
|
|
407
409
|
const t = U(), e = U(), n = T(0), o = U(), r = T(0), s = U(), i = U(), l = T(0), c = T(0), d = T(0), m = T(0), v = U(), p = U(), I = T(!1), w = T(!1), R = T(!1);
|
|
408
|
-
return
|
|
410
|
+
return z(
|
|
409
411
|
x(
|
|
410
412
|
t,
|
|
411
413
|
B(({ scrollTop: h }) => h)
|
|
412
414
|
),
|
|
413
415
|
e
|
|
414
|
-
),
|
|
416
|
+
), z(
|
|
415
417
|
x(
|
|
416
418
|
t,
|
|
417
419
|
B(({ scrollHeight: h }) => h)
|
|
418
420
|
),
|
|
419
421
|
i
|
|
420
|
-
),
|
|
422
|
+
), z(e, r), {
|
|
421
423
|
deviation: n,
|
|
422
424
|
fixedFooterHeight: d,
|
|
423
425
|
fixedHeaderHeight: c,
|
|
@@ -442,7 +444,7 @@ const It = j(
|
|
|
442
444
|
[],
|
|
443
445
|
{ singleton: !0 }
|
|
444
446
|
), se = { lvl: 0 };
|
|
445
|
-
function
|
|
447
|
+
function Nn(t, e) {
|
|
446
448
|
const n = t.length;
|
|
447
449
|
if (n === 0)
|
|
448
450
|
return [];
|
|
@@ -473,7 +475,7 @@ function Rt(t, e, n = "k") {
|
|
|
473
475
|
return Rt(t.l, e, n);
|
|
474
476
|
}
|
|
475
477
|
function vt(t, e, n) {
|
|
476
|
-
return J(t) ?
|
|
478
|
+
return J(t) ? Un(e, n, 1) : e === t.k ? dt(t, { k: e, v: n }) : e < t.k ? Sn(dt(t, { l: vt(t.l, e, n) })) : Sn(dt(t, { r: vt(t.r, e, n) }));
|
|
477
479
|
}
|
|
478
480
|
function Yt() {
|
|
479
481
|
return se;
|
|
@@ -482,7 +484,7 @@ function Zt(t, e, n) {
|
|
|
482
484
|
if (J(t))
|
|
483
485
|
return [];
|
|
484
486
|
const o = Rt(t, e)[0];
|
|
485
|
-
return
|
|
487
|
+
return zo(Pe(t, o, n));
|
|
486
488
|
}
|
|
487
489
|
function We(t, e) {
|
|
488
490
|
if (J(t))
|
|
@@ -493,8 +495,8 @@ function We(t, e) {
|
|
|
493
495
|
return r;
|
|
494
496
|
if (J(r))
|
|
495
497
|
return o;
|
|
496
|
-
const [s, i] =
|
|
497
|
-
return xe(dt(t, { k: s, l:
|
|
498
|
+
const [s, i] = $n(o);
|
|
499
|
+
return xe(dt(t, { k: s, l: Dn(o), v: i }));
|
|
498
500
|
}
|
|
499
501
|
return e < n ? xe(dt(t, { l: We(o, e) })) : xe(dt(t, { r: We(r, e) }));
|
|
500
502
|
}
|
|
@@ -514,7 +516,7 @@ function xe(t) {
|
|
|
514
516
|
return t;
|
|
515
517
|
if (n > o.lvl + 1) {
|
|
516
518
|
if (Be(e))
|
|
517
|
-
return
|
|
519
|
+
return Kn(dt(t, { lvl: n - 1 }));
|
|
518
520
|
if (!J(e) && !J(e.r))
|
|
519
521
|
return dt(e.r, {
|
|
520
522
|
l: dt(e, { r: e.r.l }),
|
|
@@ -542,30 +544,30 @@ function xe(t) {
|
|
|
542
544
|
throw new Error("Unexpected empty nodes");
|
|
543
545
|
}
|
|
544
546
|
function dt(t, e) {
|
|
545
|
-
return
|
|
546
|
-
e.k
|
|
547
|
-
e.v
|
|
548
|
-
e.lvl
|
|
549
|
-
e.l
|
|
550
|
-
e.r
|
|
547
|
+
return Un(
|
|
548
|
+
e.k === void 0 ? t.k : e.k,
|
|
549
|
+
e.v === void 0 ? t.v : e.v,
|
|
550
|
+
e.lvl === void 0 ? t.lvl : e.lvl,
|
|
551
|
+
e.l === void 0 ? t.l : e.l,
|
|
552
|
+
e.r === void 0 ? t.r : e.r
|
|
551
553
|
);
|
|
552
554
|
}
|
|
553
|
-
function
|
|
554
|
-
return J(t.r) ? t.l : xe(dt(t, { r:
|
|
555
|
+
function Dn(t) {
|
|
556
|
+
return J(t.r) ? t.l : xe(dt(t, { r: Dn(t.r) }));
|
|
555
557
|
}
|
|
556
558
|
function Be(t) {
|
|
557
559
|
return J(t) || t.lvl > t.r.lvl;
|
|
558
560
|
}
|
|
559
|
-
function
|
|
560
|
-
return J(t.r) ? [t.k, t.v] :
|
|
561
|
+
function $n(t) {
|
|
562
|
+
return J(t.r) ? [t.k, t.v] : $n(t.r);
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function Un(t, e, n, o = se, r = se) {
|
|
563
565
|
return { k: t, l: o, lvl: n, r, v: e };
|
|
564
566
|
}
|
|
565
567
|
function Sn(t) {
|
|
566
|
-
return Ge(
|
|
568
|
+
return Ge(Kn(t));
|
|
567
569
|
}
|
|
568
|
-
function
|
|
570
|
+
function Kn(t) {
|
|
569
571
|
const { l: e } = t;
|
|
570
572
|
return !J(e) && e.lvl === t.lvl ? dt(e, { r: dt(t, { l: e.r }) }) : t;
|
|
571
573
|
}
|
|
@@ -573,10 +575,10 @@ function Ge(t) {
|
|
|
573
575
|
const { lvl: e, r: n } = t;
|
|
574
576
|
return !J(n) && !J(n.r) && n.lvl === e && n.r.lvl === e ? dt(n, { l: dt(t, { r: n.l }), lvl: e + 1 }) : t;
|
|
575
577
|
}
|
|
576
|
-
function
|
|
577
|
-
return
|
|
578
|
+
function zo(t) {
|
|
579
|
+
return Nn(t, ({ k: e, v: n }) => ({ index: e, value: n }));
|
|
578
580
|
}
|
|
579
|
-
function
|
|
581
|
+
function jn(t, e) {
|
|
580
582
|
return !!(t && t.startIndex === e.startIndex && t.endIndex === e.endIndex);
|
|
581
583
|
}
|
|
582
584
|
function le(t, e) {
|
|
@@ -587,7 +589,7 @@ const Ue = j(
|
|
|
587
589
|
[],
|
|
588
590
|
{ singleton: !0 }
|
|
589
591
|
);
|
|
590
|
-
function
|
|
592
|
+
function qn(t, e, n) {
|
|
591
593
|
return t[Te(t, e, n)];
|
|
592
594
|
}
|
|
593
595
|
function Te(t, e, n, o = 0) {
|
|
@@ -608,7 +610,7 @@ function Te(t, e, n, o = 0) {
|
|
|
608
610
|
}
|
|
609
611
|
throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`);
|
|
610
612
|
}
|
|
611
|
-
function
|
|
613
|
+
function Fo(t, e, n, o) {
|
|
612
614
|
const r = Te(t, e, o), s = Te(t, n, o, r);
|
|
613
615
|
return t.slice(r, s + 1);
|
|
614
616
|
}
|
|
@@ -621,7 +623,7 @@ function be(t) {
|
|
|
621
623
|
function Ke({ index: t }, e) {
|
|
622
624
|
return e === t ? 0 : e < t ? -1 : 1;
|
|
623
625
|
}
|
|
624
|
-
function
|
|
626
|
+
function Vo() {
|
|
625
627
|
return {
|
|
626
628
|
groupIndices: [],
|
|
627
629
|
groupOffsetTree: Yt(),
|
|
@@ -632,7 +634,7 @@ function zo() {
|
|
|
632
634
|
sizeTree: Yt()
|
|
633
635
|
};
|
|
634
636
|
}
|
|
635
|
-
function
|
|
637
|
+
function Wo(t, e) {
|
|
636
638
|
let n = J(t) ? 0 : 1 / 0;
|
|
637
639
|
for (const o of e) {
|
|
638
640
|
const { endIndex: r, size: s, startIndex: i } = o;
|
|
@@ -641,7 +643,7 @@ function Fo(t, e) {
|
|
|
641
643
|
continue;
|
|
642
644
|
}
|
|
643
645
|
const l = Zt(t, i - 1, r + 1);
|
|
644
|
-
if (l.some(
|
|
646
|
+
if (l.some(Do(o)))
|
|
645
647
|
continue;
|
|
646
648
|
let c = !1, d = !1;
|
|
647
649
|
for (const { end: m, start: v, value: p } of l)
|
|
@@ -650,19 +652,19 @@ function Fo(t, e) {
|
|
|
650
652
|
}
|
|
651
653
|
return [t, n];
|
|
652
654
|
}
|
|
653
|
-
function
|
|
654
|
-
return
|
|
655
|
+
function Po(t) {
|
|
656
|
+
return t.groupIndex !== void 0;
|
|
655
657
|
}
|
|
656
|
-
function
|
|
658
|
+
function Go({ offset: t }, e) {
|
|
657
659
|
return e === t ? 0 : e < t ? -1 : 1;
|
|
658
660
|
}
|
|
659
661
|
function ce(t, e, n) {
|
|
660
662
|
if (e.length === 0)
|
|
661
663
|
return 0;
|
|
662
|
-
const { index: o, offset: r, size: s } =
|
|
664
|
+
const { index: o, offset: r, size: s } = qn(e, t, Ke), i = t - o, l = s * i + (i - 1) * n + r;
|
|
663
665
|
return l > 0 ? l + n : l;
|
|
664
666
|
}
|
|
665
|
-
function
|
|
667
|
+
function Yn(t, e) {
|
|
666
668
|
if (!be(e))
|
|
667
669
|
return t;
|
|
668
670
|
let n = 0;
|
|
@@ -670,17 +672,17 @@ function qn(t, e) {
|
|
|
670
672
|
n++;
|
|
671
673
|
return t + n;
|
|
672
674
|
}
|
|
673
|
-
function
|
|
674
|
-
if (
|
|
675
|
+
function Zn(t, e, n) {
|
|
676
|
+
if (Po(t))
|
|
675
677
|
return e.groupIndices[t.groupIndex] + 1;
|
|
676
678
|
const o = t.index === "LAST" ? n : t.index;
|
|
677
|
-
let r =
|
|
678
|
-
return r = Math.max(0,
|
|
679
|
+
let r = Yn(o, e);
|
|
680
|
+
return r = Math.max(0, Math.min(n, r)), r;
|
|
679
681
|
}
|
|
680
|
-
function
|
|
681
|
-
return o > 0 && (e = Math.max(e,
|
|
682
|
+
function Mo(t, e, n, o = 0) {
|
|
683
|
+
return o > 0 && (e = Math.max(e, qn(t, o, Ke).offset)), Nn(Fo(t, e, n, Go), No);
|
|
682
684
|
}
|
|
683
|
-
function
|
|
685
|
+
function Ao(t, [e, n, o, r]) {
|
|
684
686
|
e.length > 0 && o("received item sizes", e, ft.DEBUG);
|
|
685
687
|
const s = t.sizeTree;
|
|
686
688
|
let i = s, l = 0;
|
|
@@ -688,10 +690,10 @@ function Go(t, [e, n, o, r]) {
|
|
|
688
690
|
const p = e[0].size, I = e[1].size;
|
|
689
691
|
i = n.reduce((w, R) => vt(vt(w, R, p), R + 1, I), i);
|
|
690
692
|
} else
|
|
691
|
-
[i, l] =
|
|
693
|
+
[i, l] = Wo(i, e);
|
|
692
694
|
if (i === s)
|
|
693
695
|
return t;
|
|
694
|
-
const { lastIndex: c, lastOffset: d, lastSize: m, offsetTree: v } =
|
|
696
|
+
const { lastIndex: c, lastOffset: d, lastSize: m, offsetTree: v } = Me(t.offsetTree, l, i, r);
|
|
695
697
|
return {
|
|
696
698
|
groupIndices: n,
|
|
697
699
|
groupOffsetTree: n.reduce((p, I) => vt(p, I, ce(I, v, r)), Yt()),
|
|
@@ -702,10 +704,10 @@ function Go(t, [e, n, o, r]) {
|
|
|
702
704
|
sizeTree: i
|
|
703
705
|
};
|
|
704
706
|
}
|
|
705
|
-
function
|
|
707
|
+
function _o(t) {
|
|
706
708
|
return Nt(t).map(({ k: e, v: n }, o, r) => {
|
|
707
709
|
const s = r[o + 1];
|
|
708
|
-
return { endIndex: s
|
|
710
|
+
return { endIndex: s === void 0 ? 1 / 0 : s.k - 1, size: n, startIndex: e };
|
|
709
711
|
});
|
|
710
712
|
}
|
|
711
713
|
function xn(t, e) {
|
|
@@ -714,14 +716,15 @@ function xn(t, e) {
|
|
|
714
716
|
n += e[o + 1] - e[o] - 1, o++;
|
|
715
717
|
return o - (n === t ? 0 : 1);
|
|
716
718
|
}
|
|
717
|
-
function
|
|
719
|
+
function Me(t, e, n, o) {
|
|
718
720
|
let r = t, s = 0, i = 0, l = 0, c = 0;
|
|
719
|
-
if (e
|
|
721
|
+
if (e === 0)
|
|
722
|
+
r = [];
|
|
723
|
+
else {
|
|
720
724
|
c = Te(r, e - 1, Ke), l = r[c].offset;
|
|
721
725
|
const m = Rt(n, e - 1);
|
|
722
726
|
s = m[0], i = m[1], r.length && r[c].size === Rt(n, e)[1] && (c -= 1), r = r.slice(0, c + 1);
|
|
723
|
-
}
|
|
724
|
-
r = [];
|
|
727
|
+
}
|
|
725
728
|
for (const { start: d, value: m } of Zt(n, e, 1 / 0)) {
|
|
726
729
|
const v = d - s, p = v * i + l + v * o;
|
|
727
730
|
r.push({
|
|
@@ -737,26 +740,26 @@ function Ae(t, e, n, o) {
|
|
|
737
740
|
offsetTree: r
|
|
738
741
|
};
|
|
739
742
|
}
|
|
740
|
-
function
|
|
743
|
+
function No(t) {
|
|
741
744
|
return { index: t.index, value: t };
|
|
742
745
|
}
|
|
743
|
-
function
|
|
746
|
+
function Do(t) {
|
|
744
747
|
const { endIndex: e, size: n, startIndex: o } = t;
|
|
745
748
|
return (r) => r.start === o && (r.end === e || r.end === 1 / 0) && r.value === n;
|
|
746
749
|
}
|
|
747
|
-
const
|
|
750
|
+
const $o = {
|
|
748
751
|
offsetHeight: "height",
|
|
749
752
|
offsetWidth: "width"
|
|
750
753
|
}, kt = j(
|
|
751
754
|
([{ log: t }, { recalcInProgress: e }]) => {
|
|
752
|
-
const n = U(), o = U(), r = ht(o, 0), s = U(), i = U(), l = T(0), c = T([]), d = T(void 0), m = T(void 0), v = T(void 0), p = T(void 0), I = T((u, g) => Ht(u,
|
|
753
|
-
x(n, $(c, t, R),
|
|
755
|
+
const n = U(), o = U(), r = ht(o, 0), s = U(), i = U(), l = T(0), c = T([]), d = T(void 0), m = T(void 0), v = T(void 0), p = T(void 0), I = T((u, g) => Ht(u, $o[g])), w = T(void 0), R = T(0), h = Vo(), f = ht(
|
|
756
|
+
x(n, $(c, t, R), Ot(Ao, h), nt()),
|
|
754
757
|
h
|
|
755
758
|
), a = ht(
|
|
756
759
|
x(
|
|
757
760
|
c,
|
|
758
761
|
nt(),
|
|
759
|
-
|
|
762
|
+
Ot((u, g) => ({ current: g, prev: u.current }), {
|
|
760
763
|
current: [],
|
|
761
764
|
prev: []
|
|
762
765
|
}),
|
|
@@ -764,22 +767,22 @@ const No = {
|
|
|
764
767
|
),
|
|
765
768
|
[]
|
|
766
769
|
);
|
|
767
|
-
|
|
770
|
+
z(
|
|
768
771
|
x(
|
|
769
772
|
c,
|
|
770
773
|
P((u) => u.length > 0),
|
|
771
774
|
$(f, R),
|
|
772
775
|
B(([u, g, C]) => {
|
|
773
|
-
const
|
|
776
|
+
const k = u.reduce((O, V, N) => vt(O, V, ce(V, g.offsetTree, C) || N), Yt());
|
|
774
777
|
return {
|
|
775
778
|
...g,
|
|
776
779
|
groupIndices: u,
|
|
777
|
-
groupOffsetTree:
|
|
780
|
+
groupOffsetTree: k
|
|
778
781
|
};
|
|
779
782
|
})
|
|
780
783
|
),
|
|
781
784
|
f
|
|
782
|
-
),
|
|
785
|
+
), z(
|
|
783
786
|
x(
|
|
784
787
|
o,
|
|
785
788
|
$(f),
|
|
@@ -793,7 +796,7 @@ const No = {
|
|
|
793
796
|
])
|
|
794
797
|
),
|
|
795
798
|
n
|
|
796
|
-
),
|
|
799
|
+
), z(d, m);
|
|
797
800
|
const S = ht(
|
|
798
801
|
x(
|
|
799
802
|
d,
|
|
@@ -801,7 +804,7 @@ const No = {
|
|
|
801
804
|
),
|
|
802
805
|
!0
|
|
803
806
|
);
|
|
804
|
-
|
|
807
|
+
z(
|
|
805
808
|
x(
|
|
806
809
|
m,
|
|
807
810
|
P((u) => u !== void 0 && J(it(f).sizeTree)),
|
|
@@ -814,49 +817,49 @@ const No = {
|
|
|
814
817
|
})
|
|
815
818
|
),
|
|
816
819
|
n
|
|
817
|
-
),
|
|
820
|
+
), z(
|
|
818
821
|
x(
|
|
819
822
|
p,
|
|
820
823
|
P((u) => u !== void 0 && u.length > 0 && J(it(f).sizeTree)),
|
|
821
824
|
B((u) => {
|
|
822
825
|
const g = [];
|
|
823
|
-
let C = u[0],
|
|
824
|
-
for (let
|
|
825
|
-
const V = u[
|
|
826
|
+
let C = u[0], k = 0;
|
|
827
|
+
for (let O = 1; O < u.length; O++) {
|
|
828
|
+
const V = u[O];
|
|
826
829
|
V !== C && (g.push({
|
|
827
|
-
endIndex:
|
|
830
|
+
endIndex: O - 1,
|
|
828
831
|
size: C,
|
|
829
|
-
startIndex:
|
|
830
|
-
}), C = V,
|
|
832
|
+
startIndex: k
|
|
833
|
+
}), C = V, k = O);
|
|
831
834
|
}
|
|
832
835
|
return g.push({
|
|
833
836
|
endIndex: u.length - 1,
|
|
834
837
|
size: C,
|
|
835
|
-
startIndex:
|
|
838
|
+
startIndex: k
|
|
836
839
|
}), g;
|
|
837
840
|
})
|
|
838
841
|
),
|
|
839
842
|
n
|
|
840
|
-
),
|
|
843
|
+
), z(
|
|
841
844
|
x(
|
|
842
845
|
c,
|
|
843
846
|
$(v, m),
|
|
844
847
|
P(([, u, g]) => u !== void 0 && g !== void 0),
|
|
845
848
|
B(([u, g, C]) => {
|
|
846
|
-
const
|
|
847
|
-
for (let
|
|
848
|
-
const V = u[
|
|
849
|
-
|
|
849
|
+
const k = [];
|
|
850
|
+
for (let O = 0; O < u.length; O++) {
|
|
851
|
+
const V = u[O], N = u[O + 1];
|
|
852
|
+
k.push({
|
|
850
853
|
startIndex: V,
|
|
851
854
|
endIndex: V,
|
|
852
855
|
size: g
|
|
853
|
-
}), N !== void 0 &&
|
|
856
|
+
}), N !== void 0 && k.push({
|
|
854
857
|
startIndex: V + 1,
|
|
855
858
|
endIndex: N - 1,
|
|
856
859
|
size: C
|
|
857
860
|
});
|
|
858
861
|
}
|
|
859
|
-
return
|
|
862
|
+
return k;
|
|
860
863
|
})
|
|
861
864
|
),
|
|
862
865
|
n
|
|
@@ -865,7 +868,7 @@ const No = {
|
|
|
865
868
|
x(
|
|
866
869
|
n,
|
|
867
870
|
$(f),
|
|
868
|
-
|
|
871
|
+
Ot(
|
|
869
872
|
({ sizes: u }, [g, C]) => ({
|
|
870
873
|
changed: C !== u,
|
|
871
874
|
sizes: C
|
|
@@ -878,7 +881,7 @@ const No = {
|
|
|
878
881
|
Y(
|
|
879
882
|
x(
|
|
880
883
|
l,
|
|
881
|
-
|
|
884
|
+
Ot(
|
|
882
885
|
(u, g) => ({ diff: u.prev - g, prev: g }),
|
|
883
886
|
{ diff: 0, prev: 0 }
|
|
884
887
|
),
|
|
@@ -901,24 +904,24 @@ const No = {
|
|
|
901
904
|
);
|
|
902
905
|
});
|
|
903
906
|
const y = Tt(s);
|
|
904
|
-
|
|
907
|
+
z(
|
|
905
908
|
x(
|
|
906
909
|
s,
|
|
907
910
|
$(f),
|
|
908
911
|
B(([u, g]) => {
|
|
909
|
-
const C = g.groupIndices.length > 0,
|
|
912
|
+
const C = g.groupIndices.length > 0, k = [], O = g.lastSize;
|
|
910
913
|
if (C) {
|
|
911
914
|
const V = ie(g.sizeTree, 0);
|
|
912
915
|
let N = 0, Z = 0;
|
|
913
916
|
for (; N < u; ) {
|
|
914
917
|
const q = g.groupIndices[Z], Q = g.groupIndices.length === Z + 1 ? 1 / 0 : g.groupIndices[Z + 1] - q - 1;
|
|
915
|
-
|
|
918
|
+
k.push({
|
|
916
919
|
endIndex: q,
|
|
917
920
|
size: V,
|
|
918
921
|
startIndex: q
|
|
919
|
-
}),
|
|
922
|
+
}), k.push({
|
|
920
923
|
endIndex: q + 1 + Q - 1,
|
|
921
|
-
size:
|
|
924
|
+
size: O,
|
|
922
925
|
startIndex: q + 1
|
|
923
926
|
}), Z++, N += Q + 1;
|
|
924
927
|
}
|
|
@@ -942,7 +945,7 @@ const No = {
|
|
|
942
945
|
{
|
|
943
946
|
prevIndex: u,
|
|
944
947
|
prevSize: 0,
|
|
945
|
-
ranges:
|
|
948
|
+
ranges: k
|
|
946
949
|
}
|
|
947
950
|
).ranges;
|
|
948
951
|
}
|
|
@@ -954,7 +957,7 @@ const No = {
|
|
|
954
957
|
}),
|
|
955
958
|
{
|
|
956
959
|
prevIndex: 0,
|
|
957
|
-
prevSize:
|
|
960
|
+
prevSize: O,
|
|
958
961
|
ranges: []
|
|
959
962
|
}
|
|
960
963
|
).ranges;
|
|
@@ -962,17 +965,17 @@ const No = {
|
|
|
962
965
|
),
|
|
963
966
|
n
|
|
964
967
|
);
|
|
965
|
-
const
|
|
968
|
+
const L = Tt(
|
|
966
969
|
x(
|
|
967
970
|
i,
|
|
968
971
|
$(f, R),
|
|
969
972
|
B(([u, { offsetTree: g }, C]) => {
|
|
970
|
-
const
|
|
971
|
-
return ce(
|
|
973
|
+
const k = -u;
|
|
974
|
+
return ce(k, g, C);
|
|
972
975
|
})
|
|
973
976
|
)
|
|
974
977
|
);
|
|
975
|
-
return
|
|
978
|
+
return z(
|
|
976
979
|
x(
|
|
977
980
|
i,
|
|
978
981
|
$(f, R),
|
|
@@ -997,14 +1000,14 @@ const No = {
|
|
|
997
1000
|
return {
|
|
998
1001
|
...g,
|
|
999
1002
|
sizeTree: V,
|
|
1000
|
-
...
|
|
1003
|
+
...Me(g.offsetTree, 0, V, C)
|
|
1001
1004
|
};
|
|
1002
1005
|
}
|
|
1003
|
-
const
|
|
1006
|
+
const O = Nt(g.sizeTree).reduce((V, { k: N, v: Z }) => vt(V, Math.max(0, N + u), Z), Yt());
|
|
1004
1007
|
return {
|
|
1005
1008
|
...g,
|
|
1006
|
-
sizeTree:
|
|
1007
|
-
...
|
|
1009
|
+
sizeTree: O,
|
|
1010
|
+
...Me(g.offsetTree, 0, O, C)
|
|
1008
1011
|
};
|
|
1009
1012
|
})
|
|
1010
1013
|
),
|
|
@@ -1023,7 +1026,7 @@ const No = {
|
|
|
1023
1026
|
itemSize: I,
|
|
1024
1027
|
listRefresh: H,
|
|
1025
1028
|
shiftWith: i,
|
|
1026
|
-
shiftWithOffset:
|
|
1029
|
+
shiftWithOffset: L,
|
|
1027
1030
|
sizeRanges: n,
|
|
1028
1031
|
// output
|
|
1029
1032
|
sizes: f,
|
|
@@ -1036,7 +1039,7 @@ const No = {
|
|
|
1036
1039
|
rt(Gt, Ue),
|
|
1037
1040
|
{ singleton: !0 }
|
|
1038
1041
|
);
|
|
1039
|
-
function
|
|
1042
|
+
function Uo(t) {
|
|
1040
1043
|
return t.reduce(
|
|
1041
1044
|
(e, n) => (e.groupIndices.push(e.totalCount), e.totalCount += n + 1, e),
|
|
1042
1045
|
{
|
|
@@ -1045,22 +1048,22 @@ function Do(t) {
|
|
|
1045
1048
|
}
|
|
1046
1049
|
);
|
|
1047
1050
|
}
|
|
1048
|
-
const
|
|
1051
|
+
const Xn = j(
|
|
1049
1052
|
([{ groupIndices: t, sizes: e, totalCount: n }, { headerHeight: o, scrollTop: r }]) => {
|
|
1050
|
-
const s = U(), i = U(), l = Tt(x(s, B(
|
|
1051
|
-
return
|
|
1053
|
+
const s = U(), i = U(), l = Tt(x(s, B(Uo)));
|
|
1054
|
+
return z(
|
|
1052
1055
|
x(
|
|
1053
1056
|
l,
|
|
1054
1057
|
B((c) => c.totalCount)
|
|
1055
1058
|
),
|
|
1056
1059
|
n
|
|
1057
|
-
),
|
|
1060
|
+
), z(
|
|
1058
1061
|
x(
|
|
1059
1062
|
l,
|
|
1060
1063
|
B((c) => c.groupIndices)
|
|
1061
1064
|
),
|
|
1062
1065
|
t
|
|
1063
|
-
),
|
|
1066
|
+
), z(
|
|
1064
1067
|
x(
|
|
1065
1068
|
at(r, e, o),
|
|
1066
1069
|
P(([c, d]) => be(d)),
|
|
@@ -1072,7 +1075,7 @@ const Zn = j(
|
|
|
1072
1075
|
), { groupCounts: s, topItemsIndexes: i };
|
|
1073
1076
|
},
|
|
1074
1077
|
rt(kt, It)
|
|
1075
|
-
),
|
|
1078
|
+
), Mt = j(
|
|
1076
1079
|
([{ log: t }]) => {
|
|
1077
1080
|
const e = T(!1), n = Tt(
|
|
1078
1081
|
x(
|
|
@@ -1087,10 +1090,10 @@ const Zn = j(
|
|
|
1087
1090
|
},
|
|
1088
1091
|
rt(Gt),
|
|
1089
1092
|
{ singleton: !0 }
|
|
1090
|
-
),
|
|
1091
|
-
function
|
|
1092
|
-
const e = typeof t == "number" ? { index: t } : t;
|
|
1093
|
-
return e.align || (e.align = "start"), (!e.behavior ||
|
|
1093
|
+
), Ko = typeof document < "u" && "scrollBehavior" in document.documentElement.style;
|
|
1094
|
+
function Jn(t) {
|
|
1095
|
+
const e = typeof t == "number" ? { index: t } : { ...t };
|
|
1096
|
+
return e.align || (e.align = "start"), (!e.behavior || !Ko) && (e.behavior = "auto"), e.offset === void 0 && (e.offset = 0), e;
|
|
1094
1097
|
}
|
|
1095
1098
|
const fe = j(
|
|
1096
1099
|
([
|
|
@@ -1112,23 +1115,23 @@ const fe = j(
|
|
|
1112
1115
|
function S() {
|
|
1113
1116
|
h !== null && (h(), h = null), a !== null && (a(), a = null), f && (clearTimeout(f), f = null), _(c, !1);
|
|
1114
1117
|
}
|
|
1115
|
-
return
|
|
1118
|
+
return z(
|
|
1116
1119
|
x(
|
|
1117
1120
|
I,
|
|
1118
1121
|
$(n, v, o, R, l, i, p),
|
|
1119
1122
|
$(t, s, r),
|
|
1120
1123
|
B(
|
|
1121
1124
|
([
|
|
1122
|
-
[H, y,
|
|
1125
|
+
[H, y, L, u, g, C, k, O],
|
|
1123
1126
|
V,
|
|
1124
1127
|
N,
|
|
1125
1128
|
Z
|
|
1126
1129
|
]) => {
|
|
1127
|
-
const F =
|
|
1130
|
+
const F = Jn(H), { align: mt, behavior: q, offset: Q } = F, gt = u - 1, ut = Zn(F, y, gt);
|
|
1128
1131
|
let St = ce(ut, y.offsetTree, V) + C;
|
|
1129
|
-
mt === "end" ? (St += N + Rt(y.sizeTree, ut)[1] -
|
|
1132
|
+
mt === "end" ? (St += N + Rt(y.sizeTree, ut)[1] - L + Z, ut === gt && (St += k)) : mt === "center" ? St += (N + Rt(y.sizeTree, ut)[1] - L + Z) / 2 : St -= g, Q !== void 0 && Q !== 0 && (St += Q);
|
|
1130
1133
|
const Ft = (pt) => {
|
|
1131
|
-
S(), pt ? (
|
|
1134
|
+
S(), pt ? (O("retrying to scroll to", { location: H }, ft.DEBUG), _(I, H)) : (_(w, !0), O("list did not change, scroll successful", {}, ft.DEBUG));
|
|
1132
1135
|
};
|
|
1133
1136
|
if (S(), q === "smooth") {
|
|
1134
1137
|
let pt = !1;
|
|
@@ -1138,10 +1141,10 @@ const fe = j(
|
|
|
1138
1141
|
Ft(pt);
|
|
1139
1142
|
});
|
|
1140
1143
|
} else
|
|
1141
|
-
h = yt(x(e,
|
|
1144
|
+
h = yt(x(e, jo(150)), Ft);
|
|
1142
1145
|
return f = setTimeout(() => {
|
|
1143
1146
|
S();
|
|
1144
|
-
}, 1200), _(c, !0),
|
|
1147
|
+
}, 1200), _(c, !0), O("scrolling from index to", { behavior: q, index: ut, top: St }, ft.DEBUG), { behavior: q, top: St };
|
|
1145
1148
|
}
|
|
1146
1149
|
)
|
|
1147
1150
|
),
|
|
@@ -1155,7 +1158,7 @@ const fe = j(
|
|
|
1155
1158
|
rt(kt, It, Gt),
|
|
1156
1159
|
{ singleton: !0 }
|
|
1157
1160
|
);
|
|
1158
|
-
function
|
|
1161
|
+
function jo(t) {
|
|
1159
1162
|
return (e) => {
|
|
1160
1163
|
const n = setTimeout(() => {
|
|
1161
1164
|
e(!1);
|
|
@@ -1171,25 +1174,28 @@ function je(t, e) {
|
|
|
1171
1174
|
});
|
|
1172
1175
|
}
|
|
1173
1176
|
function qe(t, e) {
|
|
1174
|
-
const n = e - 1;
|
|
1175
|
-
return
|
|
1177
|
+
const n = e - 1, o = typeof t == "number" ? t : t.index === "LAST" ? n : t.index;
|
|
1178
|
+
return Math.max(0, Math.min(o, n));
|
|
1179
|
+
}
|
|
1180
|
+
function vn(t) {
|
|
1181
|
+
return typeof t == "number" ? t === 0 : t.index === 0 && (t.align === void 0 || t.align === "start") && (t.offset === void 0 || t.offset === 0);
|
|
1176
1182
|
}
|
|
1177
1183
|
const me = j(
|
|
1178
1184
|
([{ defaultItemSize: t, listRefresh: e, sizes: n }, { scrollTop: o }, { scrollTargetReached: r, scrollToIndex: s }, { didMount: i }]) => {
|
|
1179
1185
|
const l = T(!0), c = T(0), d = T(!0);
|
|
1180
|
-
return
|
|
1186
|
+
return z(
|
|
1181
1187
|
x(
|
|
1182
1188
|
i,
|
|
1183
1189
|
$(c),
|
|
1184
|
-
P(([m, v]) => v
|
|
1190
|
+
P(([m, v]) => !vn(v)),
|
|
1185
1191
|
Bt(!1)
|
|
1186
1192
|
),
|
|
1187
1193
|
l
|
|
1188
|
-
),
|
|
1194
|
+
), z(
|
|
1189
1195
|
x(
|
|
1190
1196
|
i,
|
|
1191
1197
|
$(c),
|
|
1192
|
-
P(([m, v]) => v
|
|
1198
|
+
P(([m, v]) => !vn(v)),
|
|
1193
1199
|
Bt(!1)
|
|
1194
1200
|
),
|
|
1195
1201
|
d
|
|
@@ -1215,13 +1221,13 @@ const me = j(
|
|
|
1215
1221
|
scrolledToInitialItem: l
|
|
1216
1222
|
};
|
|
1217
1223
|
},
|
|
1218
|
-
rt(kt, It, fe,
|
|
1224
|
+
rt(kt, It, fe, Mt),
|
|
1219
1225
|
{ singleton: !0 }
|
|
1220
1226
|
);
|
|
1221
|
-
function
|
|
1227
|
+
function Qn(t, e) {
|
|
1222
1228
|
return Math.abs(t - e) < 1.01;
|
|
1223
1229
|
}
|
|
1224
|
-
const ue = "up", ne = "down",
|
|
1230
|
+
const ue = "up", ne = "down", qo = "none", Yo = {
|
|
1225
1231
|
atBottom: !1,
|
|
1226
1232
|
notAtBottomBecause: "NOT_SHOWING_LAST_ITEM",
|
|
1227
1233
|
state: {
|
|
@@ -1230,8 +1236,8 @@ const ue = "up", ne = "down", Ko = "none", jo = {
|
|
|
1230
1236
|
scrollTop: 0,
|
|
1231
1237
|
viewportHeight: 0
|
|
1232
1238
|
}
|
|
1233
|
-
},
|
|
1234
|
-
const i = T(!1), l = T(!0), c = U(), d = U(), m = T(4), v = T(
|
|
1239
|
+
}, Zo = 0, pe = j(([{ footerHeight: t, headerHeight: e, scrollBy: n, scrollContainerState: o, scrollTop: r, viewportHeight: s }]) => {
|
|
1240
|
+
const i = T(!1), l = T(!0), c = U(), d = U(), m = T(4), v = T(Zo), p = ht(
|
|
1235
1241
|
x(
|
|
1236
1242
|
Fe(x(W(r), Ut(1), Bt(!0)), x(W(r), Ut(1), Bt(!1), pn(100))),
|
|
1237
1243
|
nt()
|
|
@@ -1241,19 +1247,19 @@ const ue = "up", ne = "down", Ko = "none", jo = {
|
|
|
1241
1247
|
x(Fe(x(n, Bt(!0)), x(n, Bt(!1), pn(200))), nt()),
|
|
1242
1248
|
!1
|
|
1243
1249
|
);
|
|
1244
|
-
|
|
1250
|
+
z(
|
|
1245
1251
|
x(
|
|
1246
1252
|
at(W(r), W(v)),
|
|
1247
1253
|
B(([a, S]) => a <= S),
|
|
1248
1254
|
nt()
|
|
1249
1255
|
),
|
|
1250
1256
|
l
|
|
1251
|
-
),
|
|
1257
|
+
), z(x(l, zt(50)), d);
|
|
1252
1258
|
const w = Tt(
|
|
1253
1259
|
x(
|
|
1254
1260
|
at(o, W(s), W(e), W(t), W(m)),
|
|
1255
|
-
|
|
1256
|
-
const C = H + y - S > -g,
|
|
1261
|
+
Ot((a, [{ scrollHeight: S, scrollTop: H }, y, L, u, g]) => {
|
|
1262
|
+
const C = H + y - S > -g, k = {
|
|
1257
1263
|
scrollHeight: S,
|
|
1258
1264
|
scrollTop: H,
|
|
1259
1265
|
viewportHeight: y
|
|
@@ -1264,26 +1270,26 @@ const ue = "up", ne = "down", Ko = "none", jo = {
|
|
|
1264
1270
|
atBottom: !0,
|
|
1265
1271
|
atBottomBecause: V,
|
|
1266
1272
|
scrollTopDelta: N,
|
|
1267
|
-
state:
|
|
1273
|
+
state: k
|
|
1268
1274
|
};
|
|
1269
1275
|
}
|
|
1270
|
-
let
|
|
1271
|
-
return
|
|
1276
|
+
let O;
|
|
1277
|
+
return k.scrollHeight > a.state.scrollHeight ? O = "SIZE_INCREASED" : y < a.state.viewportHeight ? O = "VIEWPORT_HEIGHT_DECREASING" : H < a.state.scrollTop ? O = "SCROLLING_UPWARDS" : O = "NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM", {
|
|
1272
1278
|
atBottom: !1,
|
|
1273
|
-
notAtBottomBecause:
|
|
1274
|
-
state:
|
|
1279
|
+
notAtBottomBecause: O,
|
|
1280
|
+
state: k
|
|
1275
1281
|
};
|
|
1276
|
-
},
|
|
1282
|
+
}, Yo),
|
|
1277
1283
|
nt((a, S) => a !== void 0 && a.atBottom === S.atBottom)
|
|
1278
1284
|
)
|
|
1279
1285
|
), R = ht(
|
|
1280
1286
|
x(
|
|
1281
1287
|
o,
|
|
1282
|
-
|
|
1288
|
+
Ot(
|
|
1283
1289
|
(a, { scrollHeight: S, scrollTop: H, viewportHeight: y }) => {
|
|
1284
|
-
if (!
|
|
1285
|
-
const
|
|
1286
|
-
return a.scrollTop !== H &&
|
|
1290
|
+
if (!Qn(a.scrollHeight, S)) {
|
|
1291
|
+
const L = S - (H + y) < 1;
|
|
1292
|
+
return a.scrollTop !== H && L ? {
|
|
1287
1293
|
changed: !0,
|
|
1288
1294
|
jump: a.scrollTop - H,
|
|
1289
1295
|
scrollHeight: S,
|
|
@@ -1309,42 +1315,42 @@ const ue = "up", ne = "down", Ko = "none", jo = {
|
|
|
1309
1315
|
),
|
|
1310
1316
|
0
|
|
1311
1317
|
);
|
|
1312
|
-
|
|
1318
|
+
z(
|
|
1313
1319
|
x(
|
|
1314
1320
|
w,
|
|
1315
1321
|
B((a) => a.atBottom)
|
|
1316
1322
|
),
|
|
1317
1323
|
i
|
|
1318
|
-
),
|
|
1324
|
+
), z(x(i, zt(50)), c);
|
|
1319
1325
|
const h = T(ne);
|
|
1320
|
-
|
|
1326
|
+
z(
|
|
1321
1327
|
x(
|
|
1322
1328
|
o,
|
|
1323
1329
|
B(({ scrollTop: a }) => a),
|
|
1324
1330
|
nt(),
|
|
1325
|
-
|
|
1331
|
+
Ot(
|
|
1326
1332
|
(a, S) => it(I) ? { direction: a.direction, prevScrollTop: S } : { direction: S < a.prevScrollTop ? ue : ne, prevScrollTop: S },
|
|
1327
1333
|
{ direction: ne, prevScrollTop: 0 }
|
|
1328
1334
|
),
|
|
1329
1335
|
B((a) => a.direction)
|
|
1330
1336
|
),
|
|
1331
1337
|
h
|
|
1332
|
-
),
|
|
1338
|
+
), z(x(o, zt(50), Bt(qo)), h);
|
|
1333
1339
|
const f = T(0);
|
|
1334
|
-
return
|
|
1340
|
+
return z(
|
|
1335
1341
|
x(
|
|
1336
1342
|
p,
|
|
1337
1343
|
P((a) => !a),
|
|
1338
1344
|
Bt(0)
|
|
1339
1345
|
),
|
|
1340
1346
|
f
|
|
1341
|
-
),
|
|
1347
|
+
), z(
|
|
1342
1348
|
x(
|
|
1343
1349
|
r,
|
|
1344
1350
|
zt(100),
|
|
1345
1351
|
$(p),
|
|
1346
1352
|
P(([a, S]) => S),
|
|
1347
|
-
|
|
1353
|
+
Ot(([a, S], [H]) => [S, H], [0, 0]),
|
|
1348
1354
|
B(([a, S]) => S - a)
|
|
1349
1355
|
),
|
|
1350
1356
|
f
|
|
@@ -1361,11 +1367,11 @@ const ue = "up", ne = "down", Ko = "none", jo = {
|
|
|
1361
1367
|
scrollDirection: h,
|
|
1362
1368
|
scrollVelocity: f
|
|
1363
1369
|
};
|
|
1364
|
-
}, rt(It)), ae = "top", de = "bottom",
|
|
1365
|
-
function
|
|
1370
|
+
}, rt(It)), ae = "top", de = "bottom", Tn = "none";
|
|
1371
|
+
function Cn(t, e, n) {
|
|
1366
1372
|
return typeof t == "number" ? n === ue && e === ae || n === ne && e === de ? t : 0 : n === ue ? e === ae ? t.main : t.reverse : e === de ? t.main : t.reverse;
|
|
1367
1373
|
}
|
|
1368
|
-
function
|
|
1374
|
+
function wn(t, e) {
|
|
1369
1375
|
return typeof t == "number" ? t : t[e] ?? 0;
|
|
1370
1376
|
}
|
|
1371
1377
|
const Ye = j(
|
|
@@ -1395,12 +1401,12 @@ const Ye = j(
|
|
|
1395
1401
|
a,
|
|
1396
1402
|
S
|
|
1397
1403
|
]) => {
|
|
1398
|
-
const H = m - a, y = h + f,
|
|
1399
|
-
let u =
|
|
1400
|
-
const g =
|
|
1401
|
-
return I -= a, I += p + f, w += p + f, w -= a, I > m + y - g && (u = ue), w < m -
|
|
1402
|
-
Math.max(H - p -
|
|
1403
|
-
H -
|
|
1404
|
+
const H = m - a, y = h + f, L = Math.max(p - H, 0);
|
|
1405
|
+
let u = Tn;
|
|
1406
|
+
const g = wn(S, ae), C = wn(S, de);
|
|
1407
|
+
return I -= a, I += p + f, w += p + f, w -= a, I > m + y - g && (u = ue), w < m - L + v + C && (u = ne), u !== Tn ? [
|
|
1408
|
+
Math.max(H - p - Cn(R, ae, u) - g, 0),
|
|
1409
|
+
H - L - f + v + Cn(R, de, u) + C
|
|
1404
1410
|
] : null;
|
|
1405
1411
|
}
|
|
1406
1412
|
),
|
|
@@ -1422,9 +1428,9 @@ const Ye = j(
|
|
|
1422
1428
|
rt(It),
|
|
1423
1429
|
{ singleton: !0 }
|
|
1424
1430
|
);
|
|
1425
|
-
function
|
|
1431
|
+
function Xo(t, e, n) {
|
|
1426
1432
|
if (be(e)) {
|
|
1427
|
-
const o =
|
|
1433
|
+
const o = Yn(t, e);
|
|
1428
1434
|
return [
|
|
1429
1435
|
{ index: Rt(e.groupOffsetTree, o)[0], offset: 0, size: 0 },
|
|
1430
1436
|
{ data: n?.[0], index: o, offset: 0, size: 0 }
|
|
@@ -1432,7 +1438,7 @@ function Yo(t, e, n) {
|
|
|
1432
1438
|
}
|
|
1433
1439
|
return [{ data: n?.[0], index: t, offset: 0, size: 0 }];
|
|
1434
1440
|
}
|
|
1435
|
-
const
|
|
1441
|
+
const Oe = {
|
|
1436
1442
|
bottom: 0,
|
|
1437
1443
|
firstItemIndex: 0,
|
|
1438
1444
|
items: [],
|
|
@@ -1455,16 +1461,16 @@ function ve(t, e, n, o, r, s) {
|
|
|
1455
1461
|
return {
|
|
1456
1462
|
bottom: m,
|
|
1457
1463
|
firstItemIndex: s,
|
|
1458
|
-
items:
|
|
1464
|
+
items: yn(t, r, s),
|
|
1459
1465
|
offsetBottom: w,
|
|
1460
1466
|
offsetTop: d,
|
|
1461
1467
|
top: I,
|
|
1462
|
-
topItems:
|
|
1468
|
+
topItems: yn(e, r, s),
|
|
1463
1469
|
topListHeight: e.reduce((R, h) => h.size + R, 0),
|
|
1464
1470
|
totalCount: n
|
|
1465
1471
|
};
|
|
1466
1472
|
}
|
|
1467
|
-
function
|
|
1473
|
+
function to(t, e, n, o, r, s) {
|
|
1468
1474
|
let i = 0;
|
|
1469
1475
|
if (n.groupIndices.length > 0)
|
|
1470
1476
|
for (const m of n.groupIndices) {
|
|
@@ -1480,7 +1486,7 @@ function Qn(t, e, n, o, r, s) {
|
|
|
1480
1486
|
}));
|
|
1481
1487
|
return ve(d, [], l, r, n, o);
|
|
1482
1488
|
}
|
|
1483
|
-
function
|
|
1489
|
+
function yn(t, e, n) {
|
|
1484
1490
|
if (t.length === 0)
|
|
1485
1491
|
return [];
|
|
1486
1492
|
if (!be(e))
|
|
@@ -1506,7 +1512,7 @@ function wn(t, e, n) {
|
|
|
1506
1512
|
}
|
|
1507
1513
|
return s;
|
|
1508
1514
|
}
|
|
1509
|
-
function
|
|
1515
|
+
function bn(t, e) {
|
|
1510
1516
|
return t === void 0 ? 0 : typeof t == "number" ? t : t[e] ?? 0;
|
|
1511
1517
|
}
|
|
1512
1518
|
const Kt = j(
|
|
@@ -1521,7 +1527,7 @@ const Kt = j(
|
|
|
1521
1527
|
{ recalcInProgress: w }
|
|
1522
1528
|
]) => {
|
|
1523
1529
|
const R = T([]), h = T(0), f = U(), a = T(0);
|
|
1524
|
-
|
|
1530
|
+
z(s.topItemsIndexes, R);
|
|
1525
1531
|
const S = ht(
|
|
1526
1532
|
x(
|
|
1527
1533
|
at(
|
|
@@ -1538,9 +1544,9 @@ const Kt = j(
|
|
|
1538
1544
|
W(a),
|
|
1539
1545
|
t
|
|
1540
1546
|
),
|
|
1541
|
-
P(([u, g, , C, , , , , , , ,
|
|
1542
|
-
const
|
|
1543
|
-
return u && !g && !
|
|
1547
|
+
P(([u, g, , C, , , , , , , , k]) => {
|
|
1548
|
+
const O = k !== void 0 && k.length !== C;
|
|
1549
|
+
return u && !g && !O;
|
|
1544
1550
|
}),
|
|
1545
1551
|
B(
|
|
1546
1552
|
([
|
|
@@ -1548,8 +1554,8 @@ const Kt = j(
|
|
|
1548
1554
|
,
|
|
1549
1555
|
[u, g],
|
|
1550
1556
|
C,
|
|
1551
|
-
|
|
1552
|
-
|
|
1557
|
+
k,
|
|
1558
|
+
O,
|
|
1553
1559
|
V,
|
|
1554
1560
|
N,
|
|
1555
1561
|
Z,
|
|
@@ -1557,14 +1563,14 @@ const Kt = j(
|
|
|
1557
1563
|
mt,
|
|
1558
1564
|
q
|
|
1559
1565
|
]) => {
|
|
1560
|
-
const Q =
|
|
1566
|
+
const Q = k, { offsetTree: gt, sizeTree: ut } = Q, St = it(h);
|
|
1561
1567
|
if (C === 0)
|
|
1562
|
-
return { ...
|
|
1568
|
+
return { ...Oe, totalCount: C };
|
|
1563
1569
|
if (u === 0 && g === 0)
|
|
1564
|
-
return St === 0 ? { ...
|
|
1570
|
+
return St === 0 ? { ...Oe, totalCount: C } : to(St, O, k, Z, F, q || []);
|
|
1565
1571
|
if (J(ut))
|
|
1566
1572
|
return St > 0 ? null : ve(
|
|
1567
|
-
|
|
1573
|
+
Xo(qe(O, C), Q, q),
|
|
1568
1574
|
[],
|
|
1569
1575
|
C,
|
|
1570
1576
|
F,
|
|
@@ -1583,7 +1589,7 @@ const Kt = j(
|
|
|
1583
1589
|
}
|
|
1584
1590
|
if (!V)
|
|
1585
1591
|
return ve([], Ft, C, F, Q, Z);
|
|
1586
|
-
const pt = N.length > 0 ? N[N.length - 1] + 1 : 0, jt =
|
|
1592
|
+
const pt = N.length > 0 ? N[N.length - 1] + 1 : 0, jt = Mo(gt, u, g, pt);
|
|
1587
1593
|
if (jt.length === 0)
|
|
1588
1594
|
return null;
|
|
1589
1595
|
const Qt = C - 1, Et = ye([], (D) => {
|
|
@@ -1601,7 +1607,7 @@ const Kt = j(
|
|
|
1601
1607
|
for (let ct = X; ct <= xt && !(tt >= g); ct++)
|
|
1602
1608
|
D.push({ data: q?.[ct], index: ct, offset: tt, size: lt }), tt += lt + F;
|
|
1603
1609
|
}
|
|
1604
|
-
}), te =
|
|
1610
|
+
}), te = bn(mt, ae), b = bn(mt, de);
|
|
1605
1611
|
if (Et.length > 0 && (te > 0 || b > 0)) {
|
|
1606
1612
|
const D = Et[0], K = Et[Et.length - 1];
|
|
1607
1613
|
if (te > 0 && D.index > pt) {
|
|
@@ -1629,28 +1635,28 @@ const Kt = j(
|
|
|
1629
1635
|
P((u) => u !== null),
|
|
1630
1636
|
nt()
|
|
1631
1637
|
),
|
|
1632
|
-
|
|
1638
|
+
Oe
|
|
1633
1639
|
);
|
|
1634
|
-
|
|
1640
|
+
z(
|
|
1635
1641
|
x(
|
|
1636
1642
|
t,
|
|
1637
1643
|
P(_e),
|
|
1638
1644
|
B((u) => u?.length)
|
|
1639
1645
|
),
|
|
1640
1646
|
r
|
|
1641
|
-
),
|
|
1647
|
+
), z(
|
|
1642
1648
|
x(
|
|
1643
1649
|
S,
|
|
1644
1650
|
B((u) => u.topListHeight)
|
|
1645
1651
|
),
|
|
1646
1652
|
v
|
|
1647
|
-
),
|
|
1653
|
+
), z(v, l), z(
|
|
1648
1654
|
x(
|
|
1649
1655
|
S,
|
|
1650
1656
|
B((u) => [u.top, u.bottom])
|
|
1651
1657
|
),
|
|
1652
1658
|
i
|
|
1653
|
-
),
|
|
1659
|
+
), z(
|
|
1654
1660
|
x(
|
|
1655
1661
|
S,
|
|
1656
1662
|
B((u) => u.items)
|
|
@@ -1675,10 +1681,11 @@ const Kt = j(
|
|
|
1675
1681
|
B(({ items: u }) => u[0].index),
|
|
1676
1682
|
nt()
|
|
1677
1683
|
)
|
|
1678
|
-
),
|
|
1684
|
+
), L = Tt(
|
|
1679
1685
|
x(
|
|
1680
1686
|
S,
|
|
1681
1687
|
P(({ items: u }) => u.length > 0),
|
|
1688
|
+
// oxlint-disable-next-line array-callback-return -- callback always returns after trimming group sentinels
|
|
1682
1689
|
B(({ items: u }) => {
|
|
1683
1690
|
let g = 0, C = u.length - 1;
|
|
1684
1691
|
for (; u[g].type === "group" && g < C; )
|
|
@@ -1690,7 +1697,7 @@ const Kt = j(
|
|
|
1690
1697
|
startIndex: u[g].index
|
|
1691
1698
|
};
|
|
1692
1699
|
}),
|
|
1693
|
-
nt(
|
|
1700
|
+
nt(jn)
|
|
1694
1701
|
)
|
|
1695
1702
|
);
|
|
1696
1703
|
return {
|
|
@@ -1699,7 +1706,7 @@ const Kt = j(
|
|
|
1699
1706
|
itemsRendered: f,
|
|
1700
1707
|
listState: S,
|
|
1701
1708
|
minOverscanItemCount: a,
|
|
1702
|
-
rangeChanged:
|
|
1709
|
+
rangeChanged: L,
|
|
1703
1710
|
startReached: y,
|
|
1704
1711
|
topItemsIndexes: R,
|
|
1705
1712
|
...p
|
|
@@ -1707,16 +1714,16 @@ const Kt = j(
|
|
|
1707
1714
|
},
|
|
1708
1715
|
rt(
|
|
1709
1716
|
kt,
|
|
1710
|
-
|
|
1717
|
+
Xn,
|
|
1711
1718
|
Ye,
|
|
1712
1719
|
me,
|
|
1713
1720
|
fe,
|
|
1714
1721
|
pe,
|
|
1715
|
-
|
|
1722
|
+
Mt,
|
|
1716
1723
|
Ue
|
|
1717
1724
|
),
|
|
1718
1725
|
{ singleton: !0 }
|
|
1719
|
-
),
|
|
1726
|
+
), eo = j(
|
|
1720
1727
|
([{ fixedFooterHeight: t, fixedHeaderHeight: e, footerHeight: n, headerHeight: o }, { listState: r }]) => {
|
|
1721
1728
|
const s = U(), i = ht(
|
|
1722
1729
|
x(
|
|
@@ -1725,11 +1732,11 @@ const Kt = j(
|
|
|
1725
1732
|
),
|
|
1726
1733
|
0
|
|
1727
1734
|
);
|
|
1728
|
-
return
|
|
1735
|
+
return z(W(i), s), { totalListHeight: i, totalListHeightChanged: s };
|
|
1729
1736
|
},
|
|
1730
1737
|
rt(It, Kt),
|
|
1731
1738
|
{ singleton: !0 }
|
|
1732
|
-
),
|
|
1739
|
+
), Jo = j(
|
|
1733
1740
|
([{ viewportHeight: t }, { totalListHeight: e }]) => {
|
|
1734
1741
|
const n = T(!1), o = ht(
|
|
1735
1742
|
x(
|
|
@@ -1743,37 +1750,37 @@ const Kt = j(
|
|
|
1743
1750
|
);
|
|
1744
1751
|
return { alignToBottom: n, paddingTopAddition: o };
|
|
1745
1752
|
},
|
|
1746
|
-
rt(It,
|
|
1753
|
+
rt(It, eo),
|
|
1747
1754
|
{ singleton: !0 }
|
|
1748
|
-
),
|
|
1755
|
+
), no = j(() => ({
|
|
1749
1756
|
context: T(null)
|
|
1750
|
-
})),
|
|
1757
|
+
})), Qo = ({
|
|
1751
1758
|
itemBottom: t,
|
|
1752
1759
|
itemTop: e,
|
|
1753
1760
|
locationParams: { align: n, behavior: o, ...r },
|
|
1754
1761
|
viewportBottom: s,
|
|
1755
1762
|
viewportTop: i
|
|
1756
|
-
}) => e < i ? { ...r, align: n ?? "start", ...o
|
|
1763
|
+
}) => e < i ? { ...r, align: n ?? "start", ...o === void 0 ? {} : { behavior: o } } : t > s ? { ...r, align: n ?? "end", ...o === void 0 ? {} : { behavior: o } } : null, oo = j(
|
|
1757
1764
|
([
|
|
1758
1765
|
{ gap: t, sizes: e, totalCount: n },
|
|
1759
1766
|
{ fixedFooterHeight: o, fixedHeaderHeight: r, headerHeight: s, scrollingInProgress: i, scrollTop: l, viewportHeight: c },
|
|
1760
1767
|
{ scrollToIndex: d }
|
|
1761
1768
|
]) => {
|
|
1762
1769
|
const m = U();
|
|
1763
|
-
return
|
|
1770
|
+
return z(
|
|
1764
1771
|
x(
|
|
1765
1772
|
m,
|
|
1766
1773
|
$(e, c, n, s, r, o, l),
|
|
1767
1774
|
$(t),
|
|
1768
1775
|
B(([[v, p, I, w, R, h, f, a], S]) => {
|
|
1769
|
-
const { calculateViewLocation: H =
|
|
1776
|
+
const { calculateViewLocation: H = Qo, done: y, ...L } = v, u = Zn(v, p, w - 1), g = ce(u, p.offsetTree, S) + R + h, C = g + Rt(p.sizeTree, u)[1], k = a + h, O = a + I - f, V = H({
|
|
1770
1777
|
itemBottom: C,
|
|
1771
1778
|
itemTop: g,
|
|
1772
|
-
locationParams:
|
|
1773
|
-
viewportBottom:
|
|
1774
|
-
viewportTop:
|
|
1779
|
+
locationParams: L,
|
|
1780
|
+
viewportBottom: O,
|
|
1781
|
+
viewportTop: k
|
|
1775
1782
|
});
|
|
1776
|
-
return V
|
|
1783
|
+
return V === null ? y?.() : y && yt(
|
|
1777
1784
|
x(
|
|
1778
1785
|
i,
|
|
1779
1786
|
P((N) => !N),
|
|
@@ -1782,7 +1789,7 @@ const Kt = j(
|
|
|
1782
1789
|
Ut(it(i) ? 1 : 2)
|
|
1783
1790
|
),
|
|
1784
1791
|
y
|
|
1785
|
-
)
|
|
1792
|
+
), V;
|
|
1786
1793
|
}),
|
|
1787
1794
|
P((v) => v !== null)
|
|
1788
1795
|
),
|
|
@@ -1794,10 +1801,10 @@ const Kt = j(
|
|
|
1794
1801
|
rt(kt, It, fe, Kt, Gt),
|
|
1795
1802
|
{ singleton: !0 }
|
|
1796
1803
|
);
|
|
1797
|
-
function
|
|
1804
|
+
function Rn(t) {
|
|
1798
1805
|
return t === !1 ? !1 : t === "smooth" ? "smooth" : "auto";
|
|
1799
1806
|
}
|
|
1800
|
-
const
|
|
1807
|
+
const tr = (t, e) => typeof t == "function" ? Rn(t(e)) : e && Rn(t), er = j(
|
|
1801
1808
|
([
|
|
1802
1809
|
{ listRefresh: t, totalCount: e, fixedItemSize: n, data: o },
|
|
1803
1810
|
{ atBottomState: r, isAtBottom: s },
|
|
@@ -1822,32 +1829,32 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1822
1829
|
x(
|
|
1823
1830
|
at(x(W(e), Ut(1)), c),
|
|
1824
1831
|
$(W(w), s, l, v),
|
|
1825
|
-
B(([[y,
|
|
1826
|
-
let
|
|
1827
|
-
return
|
|
1832
|
+
B(([[y, L], u, g, C, k]) => {
|
|
1833
|
+
let O = L && C, V = "auto";
|
|
1834
|
+
return O && (V = tr(u, g || k), O = O && V !== !1), { followOutputBehavior: V, shouldFollow: O, totalCount: y };
|
|
1828
1835
|
}),
|
|
1829
1836
|
P(({ shouldFollow: y }) => y)
|
|
1830
1837
|
),
|
|
1831
|
-
({ followOutputBehavior: y, totalCount:
|
|
1832
|
-
h !== null && (h(), h = null), it(n)
|
|
1833
|
-
it(m)("following output to ", { totalCount:
|
|
1834
|
-
}) :
|
|
1835
|
-
it(m)("following output to ", { totalCount:
|
|
1838
|
+
({ followOutputBehavior: y, totalCount: L }) => {
|
|
1839
|
+
h !== null && (h(), h = null), it(n) === void 0 ? h = yt(t, () => {
|
|
1840
|
+
it(m)("following output to ", { totalCount: L }, ft.DEBUG), f(y), h = null;
|
|
1841
|
+
}) : requestAnimationFrame(() => {
|
|
1842
|
+
it(m)("following output to ", { totalCount: L }, ft.DEBUG), f(y);
|
|
1836
1843
|
});
|
|
1837
1844
|
}
|
|
1838
1845
|
);
|
|
1839
1846
|
function a(y) {
|
|
1840
|
-
const
|
|
1847
|
+
const L = yt(r, (u) => {
|
|
1841
1848
|
y && !u.atBottom && u.notAtBottomBecause === "SIZE_INCREASED" && h === null && (it(m)("scrolling to bottom due to increased size", {}, ft.DEBUG), f("auto"));
|
|
1842
1849
|
});
|
|
1843
|
-
setTimeout(
|
|
1850
|
+
setTimeout(L, 100);
|
|
1844
1851
|
}
|
|
1845
1852
|
Y(
|
|
1846
1853
|
x(
|
|
1847
1854
|
at(W(w), e, d),
|
|
1848
|
-
P(([y, ,
|
|
1849
|
-
|
|
1850
|
-
({ value: y }, [,
|
|
1855
|
+
P(([y, , L]) => y !== !1 && L),
|
|
1856
|
+
Ot(
|
|
1857
|
+
({ value: y }, [, L]) => ({ refreshed: y === L, value: L }),
|
|
1851
1858
|
{ refreshed: !1, value: 0 }
|
|
1852
1859
|
),
|
|
1853
1860
|
P(({ refreshed: y }) => y),
|
|
@@ -1858,11 +1865,11 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1858
1865
|
}
|
|
1859
1866
|
), Y(R, () => {
|
|
1860
1867
|
a(it(w) !== !1);
|
|
1861
|
-
}), Y(at(W(w), r), ([y,
|
|
1862
|
-
y !== !1 && !
|
|
1868
|
+
}), Y(at(W(w), r), ([y, L]) => {
|
|
1869
|
+
y !== !1 && !L.atBottom && L.notAtBottomBecause === "VIEWPORT_HEIGHT_DECREASING" && f("auto");
|
|
1863
1870
|
});
|
|
1864
1871
|
const S = T(null), H = U();
|
|
1865
|
-
return
|
|
1872
|
+
return z(
|
|
1866
1873
|
Fe(
|
|
1867
1874
|
x(
|
|
1868
1875
|
W(o),
|
|
@@ -1875,15 +1882,15 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1875
1882
|
x(
|
|
1876
1883
|
at(x(H, Ut(1)), c),
|
|
1877
1884
|
$(W(S), l, v, p),
|
|
1878
|
-
B(([[y,
|
|
1885
|
+
B(([[y, L], u, g, C, k]) => L && g && u?.({ context: k, totalCount: y, scrollingInProgress: C })),
|
|
1879
1886
|
P((y) => !!y),
|
|
1880
1887
|
zt(0)
|
|
1881
1888
|
),
|
|
1882
1889
|
(y) => {
|
|
1883
|
-
h !== null && (h(), h = null), it(n)
|
|
1884
|
-
it(m)("scrolling into view", {}), _(I, y);
|
|
1885
|
-
}) : h = yt(t, () => {
|
|
1890
|
+
h !== null && (h(), h = null), it(n) === void 0 ? h = yt(t, () => {
|
|
1886
1891
|
it(m)("scrolling into view", {}), _(I, y), h = null;
|
|
1892
|
+
}) : requestAnimationFrame(() => {
|
|
1893
|
+
it(m)("scrolling into view", {}), _(I, y);
|
|
1887
1894
|
});
|
|
1888
1895
|
}
|
|
1889
1896
|
), { autoscrollToBottom: R, followOutput: w, scrollIntoViewOnChange: S };
|
|
@@ -1893,26 +1900,26 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1893
1900
|
pe,
|
|
1894
1901
|
fe,
|
|
1895
1902
|
me,
|
|
1896
|
-
|
|
1903
|
+
Mt,
|
|
1897
1904
|
Gt,
|
|
1898
1905
|
It,
|
|
1899
|
-
|
|
1900
|
-
|
|
1906
|
+
no,
|
|
1907
|
+
oo
|
|
1901
1908
|
)
|
|
1902
|
-
),
|
|
1903
|
-
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (
|
|
1909
|
+
), nr = j(
|
|
1910
|
+
([{ data: t, firstItemIndex: e, gap: n, sizes: o }, { initialTopMostItemIndex: r }, { initialItemCount: s, listState: i }, { didMount: l }]) => (z(
|
|
1904
1911
|
x(
|
|
1905
1912
|
l,
|
|
1906
1913
|
$(s),
|
|
1907
1914
|
P(([, c]) => c !== 0),
|
|
1908
1915
|
$(r, o, e, n, t),
|
|
1909
|
-
B(([[, c], d, m, v, p, I = []]) =>
|
|
1916
|
+
B(([[, c], d, m, v, p, I = []]) => to(c, d, m, v, p, I))
|
|
1910
1917
|
),
|
|
1911
1918
|
i
|
|
1912
1919
|
), {}),
|
|
1913
|
-
rt(kt, me, Kt,
|
|
1920
|
+
rt(kt, me, Kt, Mt),
|
|
1914
1921
|
{ singleton: !0 }
|
|
1915
|
-
),
|
|
1922
|
+
), or = j(
|
|
1916
1923
|
([{ didMount: t }, { scrollTo: e }, { listState: n }]) => {
|
|
1917
1924
|
const o = T(0);
|
|
1918
1925
|
return Y(
|
|
@@ -1940,12 +1947,12 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1940
1947
|
initialScrollTop: o
|
|
1941
1948
|
};
|
|
1942
1949
|
},
|
|
1943
|
-
rt(
|
|
1950
|
+
rt(Mt, It, Kt),
|
|
1944
1951
|
{ singleton: !0 }
|
|
1945
|
-
),
|
|
1952
|
+
), ro = j(
|
|
1946
1953
|
([{ scrollVelocity: t }]) => {
|
|
1947
1954
|
const e = T(!1), n = U(), o = T(!1);
|
|
1948
|
-
return
|
|
1955
|
+
return z(
|
|
1949
1956
|
x(
|
|
1950
1957
|
t,
|
|
1951
1958
|
$(o, e, n),
|
|
@@ -1973,7 +1980,7 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1973
1980
|
{ singleton: !0 }
|
|
1974
1981
|
), Ze = j(([{ scrollContainerState: t, scrollTo: e }]) => {
|
|
1975
1982
|
const n = U(), o = U(), r = U(), s = T(!1), i = T(void 0);
|
|
1976
|
-
return
|
|
1983
|
+
return z(
|
|
1977
1984
|
x(
|
|
1978
1985
|
at(n, o),
|
|
1979
1986
|
B(([{ scrollTop: l, viewportHeight: c }, { offsetTop: d, listHeight: m }]) => ({
|
|
@@ -1983,7 +1990,7 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
1983
1990
|
}))
|
|
1984
1991
|
),
|
|
1985
1992
|
t
|
|
1986
|
-
),
|
|
1993
|
+
), z(
|
|
1987
1994
|
x(
|
|
1988
1995
|
e,
|
|
1989
1996
|
$(o),
|
|
@@ -2003,7 +2010,7 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
2003
2010
|
windowScrollTo: r,
|
|
2004
2011
|
windowViewportRect: o
|
|
2005
2012
|
};
|
|
2006
|
-
}, rt(It)),
|
|
2013
|
+
}, rt(It)), rr = j(
|
|
2007
2014
|
([
|
|
2008
2015
|
{ sizeRanges: t, sizes: e },
|
|
2009
2016
|
{ headerHeight: n, scrollTop: o },
|
|
@@ -2012,16 +2019,16 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
2012
2019
|
{ useWindowScroll: i, windowScrollContainerState: l, windowViewportRect: c }
|
|
2013
2020
|
]) => {
|
|
2014
2021
|
const d = U(), m = T(void 0), v = T(null), p = T(null);
|
|
2015
|
-
return
|
|
2022
|
+
return z(l, v), z(c, p), Y(
|
|
2016
2023
|
x(
|
|
2017
2024
|
d,
|
|
2018
2025
|
$(e, o, i, v, p, n)
|
|
2019
2026
|
),
|
|
2020
2027
|
([I, w, R, h, f, a, S]) => {
|
|
2021
|
-
const H =
|
|
2028
|
+
const H = _o(w.sizeTree);
|
|
2022
2029
|
h && f !== null && a !== null && (R = f.scrollTop - a.offsetTop), R -= S, I({ ranges: H, scrollTop: R });
|
|
2023
2030
|
}
|
|
2024
|
-
),
|
|
2031
|
+
), z(x(m, P(_e), B(sr)), r), z(
|
|
2025
2032
|
x(
|
|
2026
2033
|
s,
|
|
2027
2034
|
$(m),
|
|
@@ -2035,14 +2042,14 @@ const Jo = (t, e) => typeof t == "function" ? bn(t(e)) : e && bn(t), Qo = j(
|
|
|
2035
2042
|
restoreStateFrom: m
|
|
2036
2043
|
};
|
|
2037
2044
|
},
|
|
2038
|
-
rt(kt, It, me,
|
|
2045
|
+
rt(kt, It, me, Mt, Ze)
|
|
2039
2046
|
);
|
|
2040
|
-
function
|
|
2047
|
+
function sr(t) {
|
|
2041
2048
|
return { align: "start", index: 0, offset: t.scrollTop };
|
|
2042
2049
|
}
|
|
2043
|
-
const
|
|
2050
|
+
const ir = j(([{ topItemsIndexes: t }]) => {
|
|
2044
2051
|
const e = T(0);
|
|
2045
|
-
return
|
|
2052
|
+
return z(
|
|
2046
2053
|
x(
|
|
2047
2054
|
e,
|
|
2048
2055
|
P((n) => n >= 0),
|
|
@@ -2051,11 +2058,11 @@ const rr = j(([{ topItemsIndexes: t }]) => {
|
|
|
2051
2058
|
t
|
|
2052
2059
|
), { topItemCount: e };
|
|
2053
2060
|
}, rt(Kt));
|
|
2054
|
-
function
|
|
2061
|
+
function so(t) {
|
|
2055
2062
|
let e = !1, n;
|
|
2056
2063
|
return (() => (e || (e = !0, n = t()), n));
|
|
2057
2064
|
}
|
|
2058
|
-
const
|
|
2065
|
+
const lr = so(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.test(navigator.userAgent)), cr = j(
|
|
2059
2066
|
([
|
|
2060
2067
|
{ deviation: t, scrollBy: e, scrollingInProgress: n, scrollTop: o },
|
|
2061
2068
|
{ isAtBottom: r, isScrolling: s, lastJumpDueToItemResize: i, scrollDirection: l },
|
|
@@ -2068,11 +2075,11 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2068
2075
|
x(
|
|
2069
2076
|
c,
|
|
2070
2077
|
$(i),
|
|
2071
|
-
|
|
2072
|
-
([, f, a, S], [{ bottom: H, items: y, offsetBottom:
|
|
2073
|
-
const C = H +
|
|
2074
|
-
let
|
|
2075
|
-
return a === u && f.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && f[0].originalIndex === 0 || (
|
|
2078
|
+
Ot(
|
|
2079
|
+
([, f, a, S], [{ bottom: H, items: y, offsetBottom: L, totalCount: u }, g]) => {
|
|
2080
|
+
const C = H + L;
|
|
2081
|
+
let k = 0;
|
|
2082
|
+
return a === u && f.length > 0 && y.length > 0 && (y[0].originalIndex === 0 && f[0].originalIndex === 0 || (k = C - S, k !== 0 && (k += g))), [k, y, u, C];
|
|
2076
2083
|
},
|
|
2077
2084
|
[0, [], 0, 0]
|
|
2078
2085
|
),
|
|
@@ -2086,7 +2093,7 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2086
2093
|
f > 0 ? (_(e, { behavior: "auto", top: -f }), _(t, 0)) : (_(t, 0), _(e, { behavior: "auto", top: -f }));
|
|
2087
2094
|
}
|
|
2088
2095
|
return Y(x(R, $(t, s)), ([f, a, S]) => {
|
|
2089
|
-
S &&
|
|
2096
|
+
S && lr() ? _(t, a - f) : h(-f);
|
|
2090
2097
|
}), Y(
|
|
2091
2098
|
x(
|
|
2092
2099
|
at(ht(s, !1), t, w),
|
|
@@ -2095,7 +2102,7 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2095
2102
|
zt(1)
|
|
2096
2103
|
),
|
|
2097
2104
|
h
|
|
2098
|
-
),
|
|
2105
|
+
), z(
|
|
2099
2106
|
x(
|
|
2100
2107
|
v,
|
|
2101
2108
|
B((f) => ({ top: -f }))
|
|
@@ -2106,18 +2113,18 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2106
2113
|
d,
|
|
2107
2114
|
$(p, m),
|
|
2108
2115
|
B(([f, { groupIndices: a, lastSize: S, sizeTree: H }, y]) => {
|
|
2109
|
-
function O
|
|
2110
|
-
return
|
|
2116
|
+
function L(O) {
|
|
2117
|
+
return O * (S + y);
|
|
2111
2118
|
}
|
|
2112
2119
|
if (a.length === 0)
|
|
2113
|
-
return
|
|
2120
|
+
return L(f);
|
|
2114
2121
|
let u = 0;
|
|
2115
2122
|
const g = ie(H, 0);
|
|
2116
|
-
let C = 0,
|
|
2123
|
+
let C = 0, k = 0;
|
|
2117
2124
|
for (; C < f; ) {
|
|
2118
2125
|
C++, u += g;
|
|
2119
|
-
let
|
|
2120
|
-
C +
|
|
2126
|
+
let O = a.length === k + 1 ? 1 / 0 : a[k + 1] - a[k] - 1;
|
|
2127
|
+
C + O > f && (u -= g, O = f - C + 1), C += O, u += L(O), k++;
|
|
2121
2128
|
}
|
|
2122
2129
|
return u;
|
|
2123
2130
|
})
|
|
@@ -2132,7 +2139,7 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2132
2139
|
), { deviation: t };
|
|
2133
2140
|
},
|
|
2134
2141
|
rt(It, pe, Kt, kt, Gt, Ue)
|
|
2135
|
-
),
|
|
2142
|
+
), ur = j(
|
|
2136
2143
|
([
|
|
2137
2144
|
t,
|
|
2138
2145
|
e,
|
|
@@ -2160,18 +2167,18 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2160
2167
|
}),
|
|
2161
2168
|
rt(
|
|
2162
2169
|
Ye,
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2170
|
+
nr,
|
|
2171
|
+
Mt,
|
|
2172
|
+
ro,
|
|
2173
|
+
eo,
|
|
2174
|
+
or,
|
|
2175
|
+
Jo,
|
|
2169
2176
|
Ze,
|
|
2170
|
-
|
|
2177
|
+
oo,
|
|
2171
2178
|
Gt,
|
|
2172
|
-
|
|
2179
|
+
no
|
|
2173
2180
|
)
|
|
2174
|
-
),
|
|
2181
|
+
), io = j(
|
|
2175
2182
|
([
|
|
2176
2183
|
{
|
|
2177
2184
|
data: t,
|
|
@@ -2195,13 +2202,13 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2195
2202
|
S,
|
|
2196
2203
|
H,
|
|
2197
2204
|
{ scrollToIndex: y },
|
|
2198
|
-
|
|
2205
|
+
L,
|
|
2199
2206
|
{ topItemCount: u },
|
|
2200
2207
|
{ groupCounts: g },
|
|
2201
2208
|
C
|
|
2202
2209
|
]) => {
|
|
2203
|
-
const { listState:
|
|
2204
|
-
return
|
|
2210
|
+
const { listState: k, minOverscanItemCount: O, topItemsIndexes: V, rangeChanged: N, ...Z } = H;
|
|
2211
|
+
return z(N, C.scrollSeekRangeChanged), z(
|
|
2205
2212
|
x(
|
|
2206
2213
|
C.windowViewportRect,
|
|
2207
2214
|
B((F) => F.visibleHeight)
|
|
@@ -2227,8 +2234,8 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2227
2234
|
...S,
|
|
2228
2235
|
groupIndices: i,
|
|
2229
2236
|
itemSize: c,
|
|
2230
|
-
listState:
|
|
2231
|
-
minOverscanItemCount:
|
|
2237
|
+
listState: k,
|
|
2238
|
+
minOverscanItemCount: O,
|
|
2232
2239
|
scrollToIndex: y,
|
|
2233
2240
|
// output
|
|
2234
2241
|
statefulTotalCount: v,
|
|
@@ -2247,17 +2254,17 @@ const sr = ro(() => /iP(ad|od|hone)/i.test(navigator.userAgent) && /WebKit/i.tes
|
|
|
2247
2254
|
kt,
|
|
2248
2255
|
me,
|
|
2249
2256
|
It,
|
|
2250
|
-
|
|
2251
|
-
|
|
2257
|
+
rr,
|
|
2258
|
+
er,
|
|
2252
2259
|
Kt,
|
|
2253
2260
|
fe,
|
|
2261
|
+
cr,
|
|
2254
2262
|
ir,
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
lr
|
|
2263
|
+
Xn,
|
|
2264
|
+
ur
|
|
2258
2265
|
)
|
|
2259
2266
|
);
|
|
2260
|
-
function
|
|
2267
|
+
function ar(t, e) {
|
|
2261
2268
|
const n = {}, o = {};
|
|
2262
2269
|
let r = 0;
|
|
2263
2270
|
const s = t.length;
|
|
@@ -2267,7 +2274,7 @@ function cr(t, e) {
|
|
|
2267
2274
|
Object.hasOwn(o, i) || (n[i] = e[i]);
|
|
2268
2275
|
return n;
|
|
2269
2276
|
}
|
|
2270
|
-
const Ie = typeof document
|
|
2277
|
+
const Ie = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
|
|
2271
2278
|
function Xe(t, e, n) {
|
|
2272
2279
|
const o = Object.keys(e.required || {}), r = Object.keys(e.optional || {}), s = Object.keys(e.methods || {}), i = Object.keys(e.events || {}), l = E.createContext({});
|
|
2273
2280
|
function c(f, a) {
|
|
@@ -2290,23 +2297,23 @@ function Xe(t, e, n) {
|
|
|
2290
2297
|
}, a), {});
|
|
2291
2298
|
}
|
|
2292
2299
|
function m(f) {
|
|
2293
|
-
return i.reduce((a, S) => (a[S] =
|
|
2300
|
+
return i.reduce((a, S) => (a[S] = bo(f[e.events[S]]), a), {});
|
|
2294
2301
|
}
|
|
2295
2302
|
const v = E.forwardRef(function(a, S) {
|
|
2296
|
-
const { children: H, ...y } = a, [
|
|
2303
|
+
const { children: H, ...y } = a, [L] = E.useState(() => ye(Eo(t), (C) => {
|
|
2297
2304
|
c(C, y);
|
|
2298
|
-
})), [u] = E.useState(mn(m,
|
|
2305
|
+
})), [u] = E.useState(mn(m, L));
|
|
2299
2306
|
Ie(() => {
|
|
2300
2307
|
for (const C of i)
|
|
2301
2308
|
C in y && Y(u[C], y[C]);
|
|
2302
2309
|
return () => {
|
|
2303
2310
|
Object.values(u).map(Ne);
|
|
2304
2311
|
};
|
|
2305
|
-
}, [y, u,
|
|
2306
|
-
c(
|
|
2307
|
-
}), E.useImperativeHandle(S, fn(d(
|
|
2312
|
+
}, [y, u, L]), Ie(() => {
|
|
2313
|
+
c(L, y);
|
|
2314
|
+
}), E.useImperativeHandle(S, fn(d(L)));
|
|
2308
2315
|
const g = n;
|
|
2309
|
-
return /* @__PURE__ */ G(l.Provider, { value:
|
|
2316
|
+
return /* @__PURE__ */ G(l.Provider, { value: L, children: n === void 0 ? H : /* @__PURE__ */ G(g, { ...ar([...o, ...r, ...i], y), children: H }) });
|
|
2310
2317
|
}), p = (f) => {
|
|
2311
2318
|
const a = E.useContext(l);
|
|
2312
2319
|
return E.useCallback(
|
|
@@ -2328,12 +2335,12 @@ function Xe(t, e, n) {
|
|
|
2328
2335
|
}, w = (f) => {
|
|
2329
2336
|
const S = E.useContext(l)[f], [H, y] = E.useState(mn(it, S));
|
|
2330
2337
|
return Ie(
|
|
2331
|
-
() => Y(S, (
|
|
2332
|
-
|
|
2338
|
+
() => Y(S, (L) => {
|
|
2339
|
+
L !== H && y(fn(L));
|
|
2333
2340
|
}),
|
|
2334
2341
|
[S, H]
|
|
2335
2342
|
), H;
|
|
2336
|
-
}, R = parseInt(E.version) >= 18 ? I : w;
|
|
2343
|
+
}, R = parseInt(E.version, 10) >= 18 ? I : w;
|
|
2337
2344
|
return {
|
|
2338
2345
|
Component: v,
|
|
2339
2346
|
useEmitter: (f, a) => {
|
|
@@ -2344,24 +2351,24 @@ function Xe(t, e, n) {
|
|
|
2344
2351
|
usePublisher: p
|
|
2345
2352
|
};
|
|
2346
2353
|
}
|
|
2347
|
-
const Re = E.createContext(void 0),
|
|
2354
|
+
const Re = E.createContext(void 0), lo = E.createContext(void 0), Le = "-webkit-sticky", Hn = "sticky", Je = so(() => {
|
|
2348
2355
|
if (typeof document > "u")
|
|
2349
|
-
return
|
|
2356
|
+
return Hn;
|
|
2350
2357
|
const t = document.createElement("div");
|
|
2351
|
-
return t.style.position =
|
|
2352
|
-
}),
|
|
2358
|
+
return t.style.position = Le, t.style.position === Le ? Le : Hn;
|
|
2359
|
+
}), co = typeof document > "u" ? E.useEffect : E.useLayoutEffect;
|
|
2353
2360
|
function ke(t) {
|
|
2354
2361
|
return "self" in t;
|
|
2355
2362
|
}
|
|
2356
|
-
function
|
|
2363
|
+
function dr(t) {
|
|
2357
2364
|
return "body" in t;
|
|
2358
2365
|
}
|
|
2359
|
-
function
|
|
2366
|
+
function uo(t, e, n, o = Jt, r, s) {
|
|
2360
2367
|
const i = E.useRef(null), l = E.useRef(null), c = E.useRef(null), d = E.useCallback(
|
|
2361
2368
|
(p) => {
|
|
2362
2369
|
let I, w, R;
|
|
2363
2370
|
const h = p.target;
|
|
2364
|
-
if (
|
|
2371
|
+
if (dr(h) || ke(h)) {
|
|
2365
2372
|
const a = ke(h) ? h : h.defaultView;
|
|
2366
2373
|
R = s === !0 ? _t(a, a.scrollX) : a.scrollY, I = s === !0 ? a.document.documentElement.scrollWidth : a.document.documentElement.scrollHeight, w = s === !0 ? a.innerWidth : a.innerHeight;
|
|
2367
2374
|
} else
|
|
@@ -2373,13 +2380,13 @@ function co(t, e, n, o = Jt, r, s) {
|
|
|
2373
2380
|
viewportHeight: w
|
|
2374
2381
|
});
|
|
2375
2382
|
};
|
|
2376
|
-
p.suppressFlushSync === !0 ? f() :
|
|
2383
|
+
p.suppressFlushSync === !0 ? f() : xo.flushSync(f), l.current !== null && (R === l.current || R <= 0 || R === I - w) && (l.current = null, e(!0), c.current && (clearTimeout(c.current), c.current = null));
|
|
2377
2384
|
},
|
|
2378
2385
|
[t, e, s]
|
|
2379
2386
|
);
|
|
2380
2387
|
E.useEffect(() => {
|
|
2381
|
-
const p = r
|
|
2382
|
-
return hn(p), o(r
|
|
2388
|
+
const p = r ?? i.current;
|
|
2389
|
+
return hn(p), o(r ?? i.current), d({ suppressFlushSync: !0, target: p }), p.addEventListener("scroll", d, { passive: !0 }), () => {
|
|
2383
2390
|
hn(p), o(null), p.removeEventListener("scroll", d);
|
|
2384
2391
|
};
|
|
2385
2392
|
}, [i, d, n, o, r]);
|
|
@@ -2399,21 +2406,21 @@ function co(t, e, n, o = Jt, r, s) {
|
|
|
2399
2406
|
return;
|
|
2400
2407
|
}
|
|
2401
2408
|
const S = Math.ceil(Math.max(Math.min(a, p.top), 0));
|
|
2402
|
-
if (p.top = S,
|
|
2409
|
+
if (p.top = S, Qn(R, h) || S === f) {
|
|
2403
2410
|
t({ scrollHeight: h, scrollTop: f, viewportHeight: R }), w && e(!0);
|
|
2404
2411
|
return;
|
|
2405
2412
|
}
|
|
2406
2413
|
w ? (l.current = S, c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
2407
2414
|
c.current = null, l.current = null, e(!0);
|
|
2408
2415
|
}, 1e3)) : l.current = null, s === !0 && (p = {
|
|
2409
|
-
...p.behavior
|
|
2416
|
+
...p.behavior === void 0 ? {} : { behavior: p.behavior },
|
|
2410
2417
|
left: gn(I, S)
|
|
2411
2418
|
}), I.scrollTo(p);
|
|
2412
2419
|
}
|
|
2413
2420
|
function v(p) {
|
|
2414
2421
|
s === !0 && (p = {
|
|
2415
|
-
...p.behavior
|
|
2416
|
-
...p.top
|
|
2422
|
+
...p.behavior === void 0 ? {} : { behavior: p.behavior },
|
|
2423
|
+
...p.top === void 0 ? {} : { left: gn(i.current, p.top) }
|
|
2417
2424
|
}), i.current.scrollBy(p);
|
|
2418
2425
|
}
|
|
2419
2426
|
return { scrollByCallback: v, scrollerRef: i, scrollToCallback: m };
|
|
@@ -2421,7 +2428,7 @@ function co(t, e, n, o = Jt, r, s) {
|
|
|
2421
2428
|
function Qe(t) {
|
|
2422
2429
|
return t;
|
|
2423
2430
|
}
|
|
2424
|
-
const
|
|
2431
|
+
const fr = /* @__PURE__ */ j(() => {
|
|
2425
2432
|
const t = T((l) => `Item ${l}`), e = T((l) => `Group ${l}`), n = T({}), o = T(Qe), r = T("div"), s = T(Jt), i = (l, c = null) => ht(
|
|
2426
2433
|
x(
|
|
2427
2434
|
n,
|
|
@@ -2447,11 +2454,11 @@ const ar = /* @__PURE__ */ j(() => {
|
|
|
2447
2454
|
ScrollSeekPlaceholder: i("ScrollSeekPlaceholder"),
|
|
2448
2455
|
TopItemListComponent: i("TopItemList")
|
|
2449
2456
|
};
|
|
2450
|
-
}),
|
|
2457
|
+
}), mr = /* @__PURE__ */ j(
|
|
2451
2458
|
([t, e]) => ({ ...t, ...e }),
|
|
2452
|
-
rt(
|
|
2453
|
-
),
|
|
2454
|
-
const n =
|
|
2459
|
+
rt(io, fr)
|
|
2460
|
+
), pr = ({ height: t }) => /* @__PURE__ */ G("div", { style: { height: t } }), hr = { overflowAnchor: "none", position: Je(), zIndex: 1 }, ao = { overflowAnchor: "none" }, gr = { ...ao, display: "inline-block", height: "100%" }, En = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2461
|
+
const n = M("listState"), o = Ct("sizeRanges"), r = M("useWindowScroll"), s = M("customScrollParent"), i = Ct("windowScrollContainerState"), l = Ct("scrollContainerState"), c = s || r ? i : l, d = M("itemContent"), m = M("context"), v = M("groupContent"), p = M("trackItemSizes"), I = M("itemSize"), w = M("log"), R = Ct("gap"), h = M("horizontalDirection"), { callbackRef: f } = _n(
|
|
2455
2462
|
o,
|
|
2456
2463
|
I,
|
|
2457
2464
|
p,
|
|
@@ -2460,37 +2467,37 @@ const ar = /* @__PURE__ */ j(() => {
|
|
|
2460
2467
|
R,
|
|
2461
2468
|
s,
|
|
2462
2469
|
h,
|
|
2463
|
-
|
|
2470
|
+
M("skipAnimationFrameInResizeObserver")
|
|
2464
2471
|
), [a, S] = E.useState(0);
|
|
2465
2472
|
on("deviation", (F) => {
|
|
2466
2473
|
a !== F && S(F);
|
|
2467
2474
|
});
|
|
2468
|
-
const H =
|
|
2475
|
+
const H = M("EmptyPlaceholder"), y = M("ScrollSeekPlaceholder") ?? pr, L = M("ListComponent"), u = M("ItemComponent"), g = M("GroupComponent"), C = M("computeItemKey"), k = M("isSeeking"), O = M("groupIndices").length > 0, V = M("alignToBottom"), N = M("initialItemFinalLocationReached"), Z = e ? {} : {
|
|
2469
2476
|
boxSizing: "border-box",
|
|
2470
2477
|
...h ? {
|
|
2471
2478
|
display: "inline-block",
|
|
2472
2479
|
height: "100%",
|
|
2473
|
-
marginInlineStart: a
|
|
2480
|
+
marginInlineStart: a === 0 ? V ? "auto" : 0 : a,
|
|
2474
2481
|
paddingInlineEnd: n.offsetBottom,
|
|
2475
2482
|
paddingInlineStart: n.offsetTop,
|
|
2476
2483
|
whiteSpace: "nowrap"
|
|
2477
2484
|
} : {
|
|
2478
|
-
marginTop: a
|
|
2485
|
+
marginTop: a === 0 ? V ? "auto" : 0 : a,
|
|
2479
2486
|
paddingBottom: n.offsetBottom,
|
|
2480
2487
|
paddingTop: n.offsetTop
|
|
2481
2488
|
},
|
|
2482
2489
|
...N ? {} : { visibility: "hidden" }
|
|
2483
2490
|
};
|
|
2484
2491
|
return !e && n.totalCount === 0 && H !== null && H !== void 0 ? /* @__PURE__ */ G(H, { ...ot(H, m) }) : /* @__PURE__ */ G(
|
|
2485
|
-
|
|
2492
|
+
L,
|
|
2486
2493
|
{
|
|
2487
|
-
...ot(
|
|
2494
|
+
...ot(L, m),
|
|
2488
2495
|
"data-testid": e ? "virtuoso-top-item-list" : "virtuoso-item-list",
|
|
2489
2496
|
ref: f,
|
|
2490
2497
|
style: Z,
|
|
2491
2498
|
children: (e ? n.topItems : n.items).map((F) => {
|
|
2492
2499
|
const mt = F.originalIndex, q = C(mt + n.firstItemIndex, F.data, m);
|
|
2493
|
-
return
|
|
2500
|
+
return k ? /* @__PURE__ */ Dt(
|
|
2494
2501
|
y,
|
|
2495
2502
|
{
|
|
2496
2503
|
...ot(y, m),
|
|
@@ -2508,33 +2515,33 @@ const ar = /* @__PURE__ */ j(() => {
|
|
|
2508
2515
|
"data-item-index": F.index,
|
|
2509
2516
|
"data-known-size": F.size,
|
|
2510
2517
|
key: q,
|
|
2511
|
-
style:
|
|
2518
|
+
style: hr
|
|
2512
2519
|
},
|
|
2513
2520
|
v(F.index, m)
|
|
2514
2521
|
) : /* @__PURE__ */ Dt(
|
|
2515
2522
|
u,
|
|
2516
2523
|
{
|
|
2517
2524
|
...ot(u, m),
|
|
2518
|
-
...
|
|
2525
|
+
...fo(u, F.data),
|
|
2519
2526
|
"data-index": mt,
|
|
2520
2527
|
"data-item-group-index": F.groupIndex,
|
|
2521
2528
|
"data-item-index": F.index,
|
|
2522
2529
|
"data-known-size": F.size,
|
|
2523
2530
|
key: q,
|
|
2524
|
-
style: h ?
|
|
2531
|
+
style: h ? gr : ao
|
|
2525
2532
|
},
|
|
2526
|
-
|
|
2533
|
+
O ? d(F.index, F.groupIndex, F.data, m) : d(F.index, F.data, m)
|
|
2527
2534
|
);
|
|
2528
2535
|
})
|
|
2529
2536
|
}
|
|
2530
2537
|
);
|
|
2531
|
-
}),
|
|
2538
|
+
}), Ir = {
|
|
2532
2539
|
height: "100%",
|
|
2533
2540
|
outline: "none",
|
|
2534
2541
|
overflowY: "auto",
|
|
2535
2542
|
position: "relative",
|
|
2536
2543
|
WebkitOverflowScrolling: "touch"
|
|
2537
|
-
},
|
|
2544
|
+
}, Sr = {
|
|
2538
2545
|
outline: "none",
|
|
2539
2546
|
overflowX: "auto",
|
|
2540
2547
|
position: "relative"
|
|
@@ -2548,7 +2555,7 @@ const ar = /* @__PURE__ */ j(() => {
|
|
|
2548
2555
|
...He(t),
|
|
2549
2556
|
position: e ? "relative" : "absolute",
|
|
2550
2557
|
top: e ? -n : 0
|
|
2551
|
-
}),
|
|
2558
|
+
}), xr = {
|
|
2552
2559
|
position: Je(),
|
|
2553
2560
|
top: 0,
|
|
2554
2561
|
width: "100%",
|
|
@@ -2558,11 +2565,11 @@ function ot(t, e) {
|
|
|
2558
2565
|
if (typeof t != "string")
|
|
2559
2566
|
return { context: e };
|
|
2560
2567
|
}
|
|
2561
|
-
function
|
|
2568
|
+
function fo(t, e) {
|
|
2562
2569
|
return { item: typeof t == "string" ? void 0 : e };
|
|
2563
2570
|
}
|
|
2564
|
-
const
|
|
2565
|
-
const e =
|
|
2571
|
+
const vr = /* @__PURE__ */ E.memo(function() {
|
|
2572
|
+
const e = M("HeaderComponent"), n = Ct("headerHeight"), o = M("HeaderFooterTag"), r = Lt(
|
|
2566
2573
|
E.useMemo(
|
|
2567
2574
|
() => (i) => {
|
|
2568
2575
|
n(Ht(i, "height"));
|
|
@@ -2570,11 +2577,11 @@ const Sr = /* @__PURE__ */ E.memo(function() {
|
|
|
2570
2577
|
[n]
|
|
2571
2578
|
),
|
|
2572
2579
|
!0,
|
|
2573
|
-
|
|
2574
|
-
), s =
|
|
2580
|
+
M("skipAnimationFrameInResizeObserver")
|
|
2581
|
+
), s = M("context");
|
|
2575
2582
|
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
|
|
2576
|
-
}),
|
|
2577
|
-
const e =
|
|
2583
|
+
}), Tr = /* @__PURE__ */ E.memo(function() {
|
|
2584
|
+
const e = M("FooterComponent"), n = Ct("footerHeight"), o = M("HeaderFooterTag"), r = Lt(
|
|
2578
2585
|
E.useMemo(
|
|
2579
2586
|
() => (i) => {
|
|
2580
2587
|
n(Ht(i, "height"));
|
|
@@ -2582,13 +2589,13 @@ const Sr = /* @__PURE__ */ E.memo(function() {
|
|
|
2582
2589
|
[n]
|
|
2583
2590
|
),
|
|
2584
2591
|
!0,
|
|
2585
|
-
|
|
2586
|
-
), s =
|
|
2592
|
+
M("skipAnimationFrameInResizeObserver")
|
|
2593
|
+
), s = M("context");
|
|
2587
2594
|
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
|
|
2588
2595
|
});
|
|
2589
2596
|
function en({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2590
2597
|
return E.memo(function({ children: s, style: i, context: l, ...c }) {
|
|
2591
|
-
const d = n("scrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("scrollerRef"), I = e("horizontalDirection") || !1, { scrollByCallback: w, scrollerRef: R, scrollToCallback: h } =
|
|
2598
|
+
const d = n("scrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("scrollerRef"), I = e("horizontalDirection") || !1, { scrollByCallback: w, scrollerRef: R, scrollToCallback: h } = uo(
|
|
2592
2599
|
d,
|
|
2593
2600
|
v,
|
|
2594
2601
|
m,
|
|
@@ -2602,7 +2609,7 @@ function en({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2602
2609
|
"data-testid": "virtuoso-scroller",
|
|
2603
2610
|
"data-virtuoso-scroller": !0,
|
|
2604
2611
|
ref: R,
|
|
2605
|
-
style: { ...I ?
|
|
2612
|
+
style: { ...I ? Sr : Ir, ...i },
|
|
2606
2613
|
tabIndex: 0,
|
|
2607
2614
|
...c,
|
|
2608
2615
|
...ot(m, l),
|
|
@@ -2613,21 +2620,21 @@ function en({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2613
2620
|
}
|
|
2614
2621
|
function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
2615
2622
|
return E.memo(function({ children: s, style: i, context: l, ...c }) {
|
|
2616
|
-
const d = n("windowScrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("totalListHeight"), I = e("deviation"), w = e("customScrollParent"), R = E.useRef(null), h = e("scrollerRef"), { scrollByCallback: f, scrollerRef: a, scrollToCallback: S } =
|
|
2623
|
+
const d = n("windowScrollContainerState"), m = e("ScrollerComponent"), v = n("smoothScrollTargetReached"), p = e("totalListHeight"), I = e("deviation"), w = e("customScrollParent"), R = E.useRef(null), h = e("scrollerRef"), { scrollByCallback: f, scrollerRef: a, scrollToCallback: S } = uo(
|
|
2617
2624
|
d,
|
|
2618
2625
|
v,
|
|
2619
2626
|
m,
|
|
2620
2627
|
h,
|
|
2621
2628
|
w
|
|
2622
2629
|
);
|
|
2623
|
-
return
|
|
2630
|
+
return co(() => (a.current = w ?? R.current?.ownerDocument.defaultView, () => {
|
|
2624
2631
|
a.current = null;
|
|
2625
2632
|
}), [a, w]), t("windowScrollTo", S), t("scrollBy", f), /* @__PURE__ */ G(
|
|
2626
2633
|
m,
|
|
2627
2634
|
{
|
|
2628
2635
|
ref: R,
|
|
2629
2636
|
"data-virtuoso-scroller": !0,
|
|
2630
|
-
style: { position: "relative", ...i, ...p
|
|
2637
|
+
style: { position: "relative", ...i, ...p === 0 ? void 0 : { height: p + I } },
|
|
2631
2638
|
...c,
|
|
2632
2639
|
...ot(m, l),
|
|
2633
2640
|
children: s
|
|
@@ -2635,43 +2642,43 @@ function nn({ useEmitter: t, useEmitterValue: e, usePublisher: n }) {
|
|
|
2635
2642
|
);
|
|
2636
2643
|
});
|
|
2637
2644
|
}
|
|
2638
|
-
const
|
|
2639
|
-
const e = E.useContext(Re), n = Ct("viewportHeight"), o = Ct("fixedItemHeight"), r =
|
|
2645
|
+
const Cr = ({ children: t }) => {
|
|
2646
|
+
const e = E.useContext(Re), n = Ct("viewportHeight"), o = Ct("fixedItemHeight"), r = M("alignToBottom"), s = M("horizontalDirection"), i = E.useMemo(
|
|
2640
2647
|
() => re(n, (c) => Ht(c, s ? "width" : "height")),
|
|
2641
2648
|
[n, s]
|
|
2642
|
-
), l =
|
|
2649
|
+
), l = Lt(i, !0, M("skipAnimationFrameInResizeObserver"));
|
|
2643
2650
|
return E.useEffect(() => {
|
|
2644
2651
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2645
2652
|
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: l, style: He(r), children: t });
|
|
2646
|
-
},
|
|
2647
|
-
const e = E.useContext(Re), n = Ct("windowViewportRect"), o = Ct("fixedItemHeight"), r =
|
|
2653
|
+
}, wr = ({ children: t }) => {
|
|
2654
|
+
const e = E.useContext(Re), n = Ct("windowViewportRect"), o = Ct("fixedItemHeight"), r = M("customScrollParent"), s = M("useWindowScroll"), i = M("topListHeight"), l = $e(
|
|
2648
2655
|
n,
|
|
2649
2656
|
r,
|
|
2650
|
-
|
|
2651
|
-
), c =
|
|
2657
|
+
M("skipAnimationFrameInResizeObserver")
|
|
2658
|
+
), c = M("alignToBottom");
|
|
2652
2659
|
return E.useEffect(() => {
|
|
2653
2660
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2654
2661
|
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: l, style: tn(c, s, i), children: t });
|
|
2655
|
-
},
|
|
2656
|
-
const e =
|
|
2662
|
+
}, yr = ({ children: t }) => {
|
|
2663
|
+
const e = M("TopItemListComponent") ?? "div", n = M("headerHeight"), o = { ...xr, marginTop: `${n}px` }, r = M("context");
|
|
2657
2664
|
return /* @__PURE__ */ G(e, { style: o, ...ot(e, r), children: t });
|
|
2658
|
-
},
|
|
2659
|
-
const n =
|
|
2660
|
-
return /* @__PURE__ */ $t(r || n ?
|
|
2661
|
-
o && /* @__PURE__ */ G(
|
|
2662
|
-
/* @__PURE__ */ $t(r || n ?
|
|
2663
|
-
/* @__PURE__ */ G(
|
|
2664
|
-
/* @__PURE__ */ G(
|
|
2665
|
-
/* @__PURE__ */ G(
|
|
2665
|
+
}, br = /* @__PURE__ */ E.memo(function(e) {
|
|
2666
|
+
const n = M("useWindowScroll"), o = M("topItemsIndexes").length > 0, r = M("customScrollParent"), s = M("context");
|
|
2667
|
+
return /* @__PURE__ */ $t(r || n ? Hr : Rr, { ...e, context: s, children: [
|
|
2668
|
+
o && /* @__PURE__ */ G(yr, { children: /* @__PURE__ */ G(En, { showTopList: !0 }) }),
|
|
2669
|
+
/* @__PURE__ */ $t(r || n ? wr : Cr, { children: [
|
|
2670
|
+
/* @__PURE__ */ G(vr, {}),
|
|
2671
|
+
/* @__PURE__ */ G(En, {}),
|
|
2672
|
+
/* @__PURE__ */ G(Tr, {})
|
|
2666
2673
|
] })
|
|
2667
2674
|
] });
|
|
2668
2675
|
}), {
|
|
2669
|
-
Component:
|
|
2676
|
+
Component: mo,
|
|
2670
2677
|
useEmitter: on,
|
|
2671
|
-
useEmitterValue:
|
|
2678
|
+
useEmitterValue: M,
|
|
2672
2679
|
usePublisher: Ct
|
|
2673
2680
|
} = /* @__PURE__ */ Xe(
|
|
2674
|
-
|
|
2681
|
+
mr,
|
|
2675
2682
|
{
|
|
2676
2683
|
optional: {
|
|
2677
2684
|
restoreStateFrom: "restoreStateFrom",
|
|
@@ -2731,8 +2738,8 @@ const vr = ({ children: t }) => {
|
|
|
2731
2738
|
groupIndices: "groupIndices"
|
|
2732
2739
|
}
|
|
2733
2740
|
},
|
|
2734
|
-
|
|
2735
|
-
),
|
|
2741
|
+
br
|
|
2742
|
+
), Rr = /* @__PURE__ */ en({ useEmitter: on, useEmitterValue: M, usePublisher: Ct }), Hr = /* @__PURE__ */ nn({ useEmitter: on, useEmitterValue: M, usePublisher: Ct }), rs = mo, ss = mo, Er = /* @__PURE__ */ j(() => {
|
|
2736
2743
|
const t = T((d) => /* @__PURE__ */ $t("td", { children: [
|
|
2737
2744
|
"Item $",
|
|
2738
2745
|
d
|
|
@@ -2767,11 +2774,11 @@ const vr = ({ children: t }) => {
|
|
|
2767
2774
|
TableRowComponent: c("TableRow", "tr"),
|
|
2768
2775
|
GroupComponent: c("Group", "tr")
|
|
2769
2776
|
};
|
|
2770
|
-
}),
|
|
2777
|
+
}), Br = /* @__PURE__ */ j(
|
|
2771
2778
|
([t, e]) => ({ ...t, ...e }),
|
|
2772
|
-
rt(
|
|
2773
|
-
),
|
|
2774
|
-
const n =
|
|
2779
|
+
rt(io, Er)
|
|
2780
|
+
), Or = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { height: t } }) }), Lr = ({ height: t }) => /* @__PURE__ */ G("tr", { children: /* @__PURE__ */ G("td", { style: { border: 0, height: t, padding: 0 } }) }), kr = { overflowAnchor: "none" }, Bn = { position: Je(), zIndex: 2, overflowAnchor: "none" }, On = /* @__PURE__ */ E.memo(function({ showTopList: e = !1 }) {
|
|
2781
|
+
const n = A("listState"), o = A("computeItemKey"), r = A("firstItemIndex"), s = A("context"), i = A("isSeeking"), l = A("fixedHeaderHeight"), c = A("groupIndices").length > 0, d = A("itemContent"), m = A("groupContent"), v = A("ScrollSeekPlaceholder") ?? Or, p = A("GroupComponent"), I = A("TableRowComponent"), w = (e ? n.topItems : []).reduce((h, f, a) => (a === 0 ? h.push(f.size) : h.push(h[a - 1] + f.size), h), []);
|
|
2775
2782
|
return (e ? n.topItems : n.items).map((h) => {
|
|
2776
2783
|
const f = h.originalIndex, a = o(f + r, h.data, s), S = e ? f === 0 ? 0 : w[f - 1] : 0;
|
|
2777
2784
|
return i ? /* @__PURE__ */ Dt(
|
|
@@ -2792,7 +2799,7 @@ const vr = ({ children: t }) => {
|
|
|
2792
2799
|
"data-known-size": h.size,
|
|
2793
2800
|
key: a,
|
|
2794
2801
|
style: {
|
|
2795
|
-
...
|
|
2802
|
+
...Bn,
|
|
2796
2803
|
top: l
|
|
2797
2804
|
}
|
|
2798
2805
|
},
|
|
@@ -2801,19 +2808,19 @@ const vr = ({ children: t }) => {
|
|
|
2801
2808
|
I,
|
|
2802
2809
|
{
|
|
2803
2810
|
...ot(I, s),
|
|
2804
|
-
...
|
|
2811
|
+
...fo(I, h.data),
|
|
2805
2812
|
"data-index": f,
|
|
2806
2813
|
"data-item-index": h.index,
|
|
2807
2814
|
"data-known-size": h.size,
|
|
2808
2815
|
"data-item-group-index": h.groupIndex,
|
|
2809
2816
|
key: a,
|
|
2810
|
-
style: e ? { ...
|
|
2817
|
+
style: e ? { ...Bn, top: l + S } : kr
|
|
2811
2818
|
},
|
|
2812
2819
|
c ? d(h.index, h.groupIndex, h.data, s) : d(h.index, h.data, s)
|
|
2813
2820
|
);
|
|
2814
2821
|
});
|
|
2815
|
-
}),
|
|
2816
|
-
const e =
|
|
2822
|
+
}), zr = /* @__PURE__ */ E.memo(function() {
|
|
2823
|
+
const e = A("listState"), n = A("topItemsIndexes").length > 0, o = bt("sizeRanges"), r = A("useWindowScroll"), s = A("customScrollParent"), i = bt("windowScrollContainerState"), l = bt("scrollContainerState"), c = s || r ? i : l, d = A("trackItemSizes"), m = A("itemSize"), v = A("log"), { callbackRef: p, ref: I } = _n(
|
|
2817
2824
|
o,
|
|
2818
2825
|
m,
|
|
2819
2826
|
d,
|
|
@@ -2822,49 +2829,49 @@ const vr = ({ children: t }) => {
|
|
|
2822
2829
|
void 0,
|
|
2823
2830
|
s,
|
|
2824
2831
|
!1,
|
|
2825
|
-
|
|
2832
|
+
A("skipAnimationFrameInResizeObserver")
|
|
2826
2833
|
), [w, R] = E.useState(0);
|
|
2827
|
-
rn("deviation", (
|
|
2828
|
-
w !==
|
|
2834
|
+
rn("deviation", (O) => {
|
|
2835
|
+
w !== O && (I.current.style.marginTop = `${O}px`, R(O));
|
|
2829
2836
|
});
|
|
2830
|
-
const h =
|
|
2837
|
+
const h = A("EmptyPlaceholder"), f = A("FillerRow") ?? Lr, a = A("TableBodyComponent"), S = A("paddingTopAddition"), H = A("statefulTotalCount"), y = A("context");
|
|
2831
2838
|
if (H === 0 && h !== null && h !== void 0)
|
|
2832
2839
|
return /* @__PURE__ */ G(h, { ...ot(h, y) });
|
|
2833
|
-
const
|
|
2840
|
+
const L = (n ? e.topItems : []).reduce((O, V) => O + V.size, 0), u = e.offsetTop + S + w - L, g = e.offsetBottom, C = u > 0 ? /* @__PURE__ */ G(f, { context: y, height: u }, "padding-top") : null, k = g > 0 ? /* @__PURE__ */ G(f, { context: y, height: g }, "padding-bottom") : null;
|
|
2834
2841
|
return /* @__PURE__ */ $t(a, { "data-testid": "virtuoso-item-list", ref: p, ...ot(a, y), children: [
|
|
2835
2842
|
C,
|
|
2836
|
-
n && /* @__PURE__ */ G(
|
|
2837
|
-
/* @__PURE__ */ G(
|
|
2838
|
-
|
|
2843
|
+
n && /* @__PURE__ */ G(On, { showTopList: !0 }),
|
|
2844
|
+
/* @__PURE__ */ G(On, {}),
|
|
2845
|
+
k
|
|
2839
2846
|
] });
|
|
2840
|
-
}),
|
|
2841
|
-
const e = E.useContext(Re), n = bt("viewportHeight"), o = bt("fixedItemHeight"), r =
|
|
2847
|
+
}), Fr = ({ children: t }) => {
|
|
2848
|
+
const e = E.useContext(Re), n = bt("viewportHeight"), o = bt("fixedItemHeight"), r = Lt(
|
|
2842
2849
|
E.useMemo(() => re(n, (s) => Ht(s, "height")), [n]),
|
|
2843
2850
|
!0,
|
|
2844
|
-
|
|
2851
|
+
A("skipAnimationFrameInResizeObserver")
|
|
2845
2852
|
);
|
|
2846
2853
|
return E.useEffect(() => {
|
|
2847
2854
|
e && (n(e.viewportHeight), o(e.itemHeight));
|
|
2848
2855
|
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "element", ref: r, style: He(!1), children: t });
|
|
2849
|
-
},
|
|
2850
|
-
const e = E.useContext(Re), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r =
|
|
2856
|
+
}, Vr = ({ children: t }) => {
|
|
2857
|
+
const e = E.useContext(Re), n = bt("windowViewportRect"), o = bt("fixedItemHeight"), r = A("customScrollParent"), s = A("useWindowScroll"), i = $e(
|
|
2851
2858
|
n,
|
|
2852
2859
|
r,
|
|
2853
|
-
|
|
2860
|
+
A("skipAnimationFrameInResizeObserver")
|
|
2854
2861
|
);
|
|
2855
2862
|
return E.useEffect(() => {
|
|
2856
2863
|
e && (o(e.itemHeight), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: 100 }));
|
|
2857
2864
|
}, [e, n, o]), /* @__PURE__ */ G("div", { "data-viewport-type": "window", ref: i, style: tn(!1, s), children: t });
|
|
2858
|
-
},
|
|
2859
|
-
const n =
|
|
2865
|
+
}, Wr = /* @__PURE__ */ E.memo(function(e) {
|
|
2866
|
+
const n = A("useWindowScroll"), o = A("customScrollParent"), r = bt("fixedHeaderHeight"), s = bt("fixedFooterHeight"), i = A("fixedHeaderContent"), l = A("fixedFooterContent"), c = A("context"), d = Lt(
|
|
2860
2867
|
E.useMemo(() => re(r, (a) => Ht(a, "height")), [r]),
|
|
2861
2868
|
!0,
|
|
2862
|
-
|
|
2863
|
-
), m =
|
|
2869
|
+
A("skipAnimationFrameInResizeObserver")
|
|
2870
|
+
), m = Lt(
|
|
2864
2871
|
E.useMemo(() => re(s, (a) => Ht(a, "height")), [s]),
|
|
2865
2872
|
!0,
|
|
2866
|
-
|
|
2867
|
-
), v = o || n ?
|
|
2873
|
+
A("skipAnimationFrameInResizeObserver")
|
|
2874
|
+
), v = o || n ? Gr : Pr, p = o || n ? Vr : Fr, I = A("TableComponent"), w = A("TableHeadComponent"), R = A("TableFooterComponent"), h = i ? /* @__PURE__ */ G(
|
|
2868
2875
|
w,
|
|
2869
2876
|
{
|
|
2870
2877
|
ref: d,
|
|
@@ -2885,16 +2892,16 @@ const vr = ({ children: t }) => {
|
|
|
2885
2892
|
) : null;
|
|
2886
2893
|
return /* @__PURE__ */ G(v, { ...e, ...ot(v, c), children: /* @__PURE__ */ G(p, { children: /* @__PURE__ */ $t(I, { style: { borderSpacing: 0, overflowAnchor: "none" }, ...ot(I, c), children: [
|
|
2887
2894
|
h,
|
|
2888
|
-
/* @__PURE__ */ G(
|
|
2895
|
+
/* @__PURE__ */ G(zr, {}, "TableBody"),
|
|
2889
2896
|
f
|
|
2890
2897
|
] }) }) });
|
|
2891
2898
|
}), {
|
|
2892
|
-
Component:
|
|
2899
|
+
Component: po,
|
|
2893
2900
|
useEmitter: rn,
|
|
2894
|
-
useEmitterValue:
|
|
2901
|
+
useEmitterValue: A,
|
|
2895
2902
|
usePublisher: bt
|
|
2896
2903
|
} = /* @__PURE__ */ Xe(
|
|
2897
|
-
|
|
2904
|
+
Br,
|
|
2898
2905
|
{
|
|
2899
2906
|
optional: {
|
|
2900
2907
|
restoreStateFrom: "restoreStateFrom",
|
|
@@ -2950,8 +2957,8 @@ const vr = ({ children: t }) => {
|
|
|
2950
2957
|
groupIndices: "groupIndices"
|
|
2951
2958
|
}
|
|
2952
2959
|
},
|
|
2953
|
-
|
|
2954
|
-
),
|
|
2960
|
+
Wr
|
|
2961
|
+
), Pr = /* @__PURE__ */ en({ useEmitter: rn, useEmitterValue: A, usePublisher: bt }), Gr = /* @__PURE__ */ nn({ useEmitter: rn, useEmitterValue: A, usePublisher: bt }), is = po, ls = po, Ln = {
|
|
2955
2962
|
bottom: 0,
|
|
2956
2963
|
itemHeight: 0,
|
|
2957
2964
|
items: [],
|
|
@@ -2959,7 +2966,7 @@ const vr = ({ children: t }) => {
|
|
|
2959
2966
|
offsetBottom: 0,
|
|
2960
2967
|
offsetTop: 0,
|
|
2961
2968
|
top: 0
|
|
2962
|
-
},
|
|
2969
|
+
}, Mr = {
|
|
2963
2970
|
bottom: 0,
|
|
2964
2971
|
itemHeight: 0,
|
|
2965
2972
|
items: [{ index: 0 }],
|
|
@@ -2967,23 +2974,23 @@ const vr = ({ children: t }) => {
|
|
|
2967
2974
|
offsetBottom: 0,
|
|
2968
2975
|
offsetTop: 0,
|
|
2969
2976
|
top: 0
|
|
2970
|
-
}, { ceil:
|
|
2971
|
-
function
|
|
2977
|
+
}, { ceil: kn, floor: Ce, max: oe, min: ze, round: zn } = Math;
|
|
2978
|
+
function Fn(t, e, n) {
|
|
2972
2979
|
return Array.from({ length: e - t + 1 }).map((o, r) => ({ data: n === null ? null : n[r + t], index: r + t }));
|
|
2973
2980
|
}
|
|
2974
|
-
function
|
|
2981
|
+
function Ar(t) {
|
|
2975
2982
|
return {
|
|
2976
|
-
...
|
|
2983
|
+
...Mr,
|
|
2977
2984
|
items: t
|
|
2978
2985
|
};
|
|
2979
2986
|
}
|
|
2980
2987
|
function Se(t, e) {
|
|
2981
2988
|
return t !== void 0 && t.width === e.width && t.height === e.height;
|
|
2982
2989
|
}
|
|
2983
|
-
function
|
|
2990
|
+
function _r(t, e) {
|
|
2984
2991
|
return t !== void 0 && t.column === e.column && t.row === e.row;
|
|
2985
2992
|
}
|
|
2986
|
-
const
|
|
2993
|
+
const Nr = /* @__PURE__ */ j(
|
|
2987
2994
|
([
|
|
2988
2995
|
{ increaseViewportBy: t, listBoundary: e, overscan: n, visibleRange: o },
|
|
2989
2996
|
{ footerHeight: r, headerHeight: s, scrollBy: i, scrollContainerState: l, scrollTo: c, scrollTop: d, smoothScrollTargetReached: m, viewportHeight: v },
|
|
@@ -2993,7 +3000,7 @@ const Mr = /* @__PURE__ */ j(
|
|
|
2993
3000
|
{ customScrollParent: h, useWindowScroll: f, windowScrollContainerState: a, windowScrollTo: S, windowViewportRect: H },
|
|
2994
3001
|
y
|
|
2995
3002
|
]) => {
|
|
2996
|
-
const
|
|
3003
|
+
const L = T(0), u = T(0), g = T(Ln), C = T({ height: 0, width: 0 }), k = T({ height: 0, width: 0 }), O = U(), V = U(), N = T(0), Z = T(null), F = T({ column: 0, row: 0 }), mt = U(), q = U(), Q = T(!1), gt = T(0), ut = T(!0), St = T(!1), Ft = T(!1);
|
|
2997
3004
|
Y(
|
|
2998
3005
|
x(
|
|
2999
3006
|
w,
|
|
@@ -3005,17 +3012,17 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3005
3012
|
}
|
|
3006
3013
|
), Y(
|
|
3007
3014
|
x(
|
|
3008
|
-
at(w, ut,
|
|
3015
|
+
at(w, ut, k, C, gt, St),
|
|
3009
3016
|
P(([b, D, K, st, , tt]) => b && !D && K.height !== 0 && st.height !== 0 && !tt)
|
|
3010
3017
|
),
|
|
3011
3018
|
([, , , , b]) => {
|
|
3012
3019
|
_(St, !0), je(1, () => {
|
|
3013
|
-
_(
|
|
3020
|
+
_(O, b);
|
|
3014
3021
|
}), yt(x(d), () => {
|
|
3015
3022
|
_(e, [0, 0]), _(ut, !0);
|
|
3016
3023
|
});
|
|
3017
3024
|
}
|
|
3018
|
-
),
|
|
3025
|
+
), z(
|
|
3019
3026
|
x(
|
|
3020
3027
|
q,
|
|
3021
3028
|
P((b) => b != null && b.scrollTop > 0),
|
|
@@ -3029,21 +3036,21 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3029
3036
|
P(([, b]) => b != null)
|
|
3030
3037
|
),
|
|
3031
3038
|
([, b]) => {
|
|
3032
|
-
b && (_(C, b.viewport), _(
|
|
3039
|
+
b && (_(C, b.viewport), _(k, b.item), _(F, b.gap), b.scrollTop > 0 && (_(Q, !0), yt(x(d, Ut(1)), (D) => {
|
|
3033
3040
|
_(Q, !1);
|
|
3034
3041
|
}), _(c, { top: b.scrollTop })));
|
|
3035
3042
|
}
|
|
3036
|
-
),
|
|
3043
|
+
), z(
|
|
3037
3044
|
x(
|
|
3038
3045
|
C,
|
|
3039
3046
|
B(({ height: b }) => b)
|
|
3040
3047
|
),
|
|
3041
3048
|
v
|
|
3042
|
-
),
|
|
3049
|
+
), z(
|
|
3043
3050
|
x(
|
|
3044
3051
|
at(
|
|
3045
3052
|
W(C, Se),
|
|
3046
|
-
W(
|
|
3053
|
+
W(k, Se),
|
|
3047
3054
|
W(F, (b, D) => b !== void 0 && b.column === D.column && b.row === D.row),
|
|
3048
3055
|
W(d)
|
|
3049
3056
|
),
|
|
@@ -3055,13 +3062,13 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3055
3062
|
}))
|
|
3056
3063
|
),
|
|
3057
3064
|
mt
|
|
3058
|
-
),
|
|
3065
|
+
), z(
|
|
3059
3066
|
x(
|
|
3060
3067
|
at(
|
|
3061
|
-
W(
|
|
3068
|
+
W(L),
|
|
3062
3069
|
o,
|
|
3063
|
-
W(F,
|
|
3064
|
-
W(
|
|
3070
|
+
W(F, _r),
|
|
3071
|
+
W(k, Se),
|
|
3065
3072
|
W(C, Se),
|
|
3066
3073
|
W(Z),
|
|
3067
3074
|
W(u),
|
|
@@ -3087,31 +3094,31 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3087
3094
|
if (xt === 0 && (b === 0 || sn === 0))
|
|
3088
3095
|
return Ln;
|
|
3089
3096
|
if (Ee === 0) {
|
|
3090
|
-
const dn = qe(Vt, b),
|
|
3091
|
-
return
|
|
3097
|
+
const dn = qe(Vt, b), So = dn + Math.max(xt - 1, 0);
|
|
3098
|
+
return Ar(Fn(dn, So, lt));
|
|
3092
3099
|
}
|
|
3093
|
-
const ge =
|
|
3094
|
-
let qt,
|
|
3095
|
-
ct ? D === 0 && K === 0 && xt > 0 ? (qt = 0,
|
|
3096
|
-
const ln =
|
|
3097
|
-
return { bottom: cn, itemHeight: he, items: ln, itemWidth: Ee, offsetBottom:
|
|
3100
|
+
const ge = ho(sn, Ee, Wt);
|
|
3101
|
+
let qt, At;
|
|
3102
|
+
ct ? D === 0 && K === 0 && xt > 0 ? (qt = 0, At = xt - 1) : (qt = ge * Ce((D + ee) / (he + ee)), At = ge * kn((K + ee) / (he + ee)) - 1, At = ze(b - 1, oe(At, ge - 1)), qt = ze(At, oe(0, qt))) : (qt = 0, At = -1);
|
|
3103
|
+
const ln = Fn(qt, At, lt), { bottom: cn, top: un } = Vn(X, st, tt, ln), an = kn(b / ge), Io = an * he + (an - 1) * ee - cn;
|
|
3104
|
+
return { bottom: cn, itemHeight: he, items: ln, itemWidth: Ee, offsetBottom: Io, offsetTop: un, top: un };
|
|
3098
3105
|
}
|
|
3099
3106
|
)
|
|
3100
3107
|
),
|
|
3101
3108
|
g
|
|
3102
|
-
),
|
|
3109
|
+
), z(
|
|
3103
3110
|
x(
|
|
3104
3111
|
Z,
|
|
3105
3112
|
P((b) => b !== null),
|
|
3106
3113
|
B((b) => b.length)
|
|
3107
3114
|
),
|
|
3108
|
-
|
|
3109
|
-
),
|
|
3115
|
+
L
|
|
3116
|
+
), z(
|
|
3110
3117
|
x(
|
|
3111
|
-
at(C,
|
|
3118
|
+
at(C, k, g, F),
|
|
3112
3119
|
P(([b, D, { items: K }]) => K.length > 0 && D.height !== 0 && b.height !== 0),
|
|
3113
3120
|
B(([b, D, { items: K }, st]) => {
|
|
3114
|
-
const { bottom: tt, top: X } =
|
|
3121
|
+
const { bottom: tt, top: X } = Vn(b, st, D, K);
|
|
3115
3122
|
return [X, tt];
|
|
3116
3123
|
}),
|
|
3117
3124
|
nt(le)
|
|
@@ -3119,7 +3126,7 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3119
3126
|
e
|
|
3120
3127
|
);
|
|
3121
3128
|
const pt = T(!1);
|
|
3122
|
-
|
|
3129
|
+
z(
|
|
3123
3130
|
x(
|
|
3124
3131
|
d,
|
|
3125
3132
|
$(pt),
|
|
@@ -3129,7 +3136,7 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3129
3136
|
);
|
|
3130
3137
|
const jt = Tt(
|
|
3131
3138
|
x(
|
|
3132
|
-
at(g,
|
|
3139
|
+
at(g, L),
|
|
3133
3140
|
P(([{ items: b }]) => b.length > 0),
|
|
3134
3141
|
$(pt),
|
|
3135
3142
|
P(([[b, D], K]) => {
|
|
@@ -3155,20 +3162,20 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3155
3162
|
endIndex: b[b.length - 1].index,
|
|
3156
3163
|
startIndex: b[0].index
|
|
3157
3164
|
})),
|
|
3158
|
-
nt(
|
|
3165
|
+
nt(jn),
|
|
3159
3166
|
zt(0)
|
|
3160
3167
|
)
|
|
3161
3168
|
);
|
|
3162
|
-
|
|
3169
|
+
z(Et, I.scrollSeekRangeChanged), z(
|
|
3163
3170
|
x(
|
|
3164
|
-
|
|
3165
|
-
$(C,
|
|
3171
|
+
O,
|
|
3172
|
+
$(C, k, L, F),
|
|
3166
3173
|
B(([b, D, K, st, tt]) => {
|
|
3167
|
-
const X =
|
|
3174
|
+
const X = Jn(b), { align: lt, behavior: xt, offset: ct } = X;
|
|
3168
3175
|
let Vt = X.index;
|
|
3169
3176
|
Vt === "LAST" && (Vt = st - 1), Vt = oe(0, Vt, ze(st - 1, Vt));
|
|
3170
|
-
let Wt =
|
|
3171
|
-
return lt === "end" ? Wt =
|
|
3177
|
+
let Wt = Ae(D, tt, K, Vt);
|
|
3178
|
+
return lt === "end" ? Wt = zn(Wt - D.height + K.height) : lt === "center" && (Wt = zn(Wt - D.height / 2 + K.height / 2)), ct !== void 0 && ct !== 0 && (Wt += ct), { behavior: xt, top: Wt };
|
|
3172
3179
|
})
|
|
3173
3180
|
),
|
|
3174
3181
|
c
|
|
@@ -3180,7 +3187,7 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3180
3187
|
),
|
|
3181
3188
|
0
|
|
3182
3189
|
);
|
|
3183
|
-
return
|
|
3190
|
+
return z(
|
|
3184
3191
|
x(
|
|
3185
3192
|
H,
|
|
3186
3193
|
B((b) => ({ height: b.visibleHeight, width: b.visibleWidth }))
|
|
@@ -3196,17 +3203,17 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3196
3203
|
headerHeight: s,
|
|
3197
3204
|
increaseViewportBy: t,
|
|
3198
3205
|
initialItemCount: u,
|
|
3199
|
-
itemDimensions:
|
|
3206
|
+
itemDimensions: k,
|
|
3200
3207
|
overscan: n,
|
|
3201
3208
|
restoreStateFrom: q,
|
|
3202
3209
|
scrollBy: i,
|
|
3203
3210
|
scrollContainerState: l,
|
|
3204
3211
|
scrollHeight: V,
|
|
3205
3212
|
scrollTo: c,
|
|
3206
|
-
scrollToIndex:
|
|
3213
|
+
scrollToIndex: O,
|
|
3207
3214
|
scrollTop: d,
|
|
3208
3215
|
smoothScrollTargetReached: m,
|
|
3209
|
-
totalCount:
|
|
3216
|
+
totalCount: L,
|
|
3210
3217
|
useWindowScroll: f,
|
|
3211
3218
|
viewportDimensions: C,
|
|
3212
3219
|
windowScrollContainerState: a,
|
|
@@ -3228,23 +3235,23 @@ const Mr = /* @__PURE__ */ j(
|
|
|
3228
3235
|
...y
|
|
3229
3236
|
};
|
|
3230
3237
|
},
|
|
3231
|
-
rt(Ye, It, pe,
|
|
3238
|
+
rt(Ye, It, pe, ro, Mt, Ze, Gt)
|
|
3232
3239
|
);
|
|
3233
|
-
function
|
|
3240
|
+
function ho(t, e, n) {
|
|
3234
3241
|
return oe(1, Ce((t + n) / (Ce(e) + n)));
|
|
3235
3242
|
}
|
|
3236
|
-
function
|
|
3243
|
+
function Vn(t, e, n, o) {
|
|
3237
3244
|
const { height: r } = n;
|
|
3238
3245
|
if (r === void 0 || o.length === 0)
|
|
3239
3246
|
return { bottom: 0, top: 0 };
|
|
3240
|
-
const s =
|
|
3241
|
-
return { bottom:
|
|
3247
|
+
const s = Ae(t, e, n, o[0].index);
|
|
3248
|
+
return { bottom: Ae(t, e, n, o[o.length - 1].index) + r, top: s };
|
|
3242
3249
|
}
|
|
3243
|
-
function
|
|
3244
|
-
const r =
|
|
3250
|
+
function Ae(t, e, n, o) {
|
|
3251
|
+
const r = ho(t.width, n.width, e.column), s = Ce(o / r), i = s * n.height + oe(0, s - 1) * e.row;
|
|
3245
3252
|
return i > 0 ? i + e.row : i;
|
|
3246
3253
|
}
|
|
3247
|
-
const
|
|
3254
|
+
const Dr = /* @__PURE__ */ j(() => {
|
|
3248
3255
|
const t = T((v) => `Item ${v}`), e = T({}), n = T(null), o = T("virtuoso-grid-item"), r = T("virtuoso-grid-list"), s = T(Qe), i = T("div"), l = T(Jt), c = (v, p = null) => ht(
|
|
3249
3256
|
x(
|
|
3250
3257
|
e,
|
|
@@ -3253,7 +3260,7 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3253
3260
|
),
|
|
3254
3261
|
p
|
|
3255
3262
|
), d = T(!1), m = T(!1);
|
|
3256
|
-
return
|
|
3263
|
+
return z(W(m), d), {
|
|
3257
3264
|
components: e,
|
|
3258
3265
|
computeItemKey: s,
|
|
3259
3266
|
context: n,
|
|
@@ -3271,23 +3278,23 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3271
3278
|
scrollerRef: l,
|
|
3272
3279
|
ScrollSeekPlaceholder: c("ScrollSeekPlaceholder", "div")
|
|
3273
3280
|
};
|
|
3274
|
-
}),
|
|
3281
|
+
}), $r = /* @__PURE__ */ j(
|
|
3275
3282
|
([t, e]) => ({ ...t, ...e }),
|
|
3276
|
-
rt(
|
|
3277
|
-
),
|
|
3278
|
-
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = wt("scrollHeight"), c = et("ItemComponent"), d = et("ListComponent"), m = et("ScrollSeekPlaceholder"), v = et("context"), p = wt("itemDimensions"), I = wt("gap"), w = et("log"), R = et("stateRestoreInProgress"), h = wt("reportReadyState"), f =
|
|
3283
|
+
rt(Nr, Dr)
|
|
3284
|
+
), Ur = /* @__PURE__ */ E.memo(function() {
|
|
3285
|
+
const e = et("gridState"), n = et("listClassName"), o = et("itemClassName"), r = et("itemContent"), s = et("computeItemKey"), i = et("isSeeking"), l = wt("scrollHeight"), c = et("ItemComponent"), d = et("ListComponent"), m = et("ScrollSeekPlaceholder"), v = et("context"), p = wt("itemDimensions"), I = wt("gap"), w = et("log"), R = et("stateRestoreInProgress"), h = wt("reportReadyState"), f = Lt(
|
|
3279
3286
|
E.useMemo(
|
|
3280
3287
|
() => (a) => {
|
|
3281
3288
|
const S = a.parentElement.parentElement.scrollHeight;
|
|
3282
3289
|
l(S);
|
|
3283
3290
|
const H = a.firstChild;
|
|
3284
3291
|
if (H !== null) {
|
|
3285
|
-
const { height: y, width:
|
|
3286
|
-
p({ height: y, width:
|
|
3292
|
+
const { height: y, width: L } = H.getBoundingClientRect();
|
|
3293
|
+
p({ height: y, width: L });
|
|
3287
3294
|
}
|
|
3288
3295
|
I({
|
|
3289
|
-
column:
|
|
3290
|
-
row:
|
|
3296
|
+
column: Wn("column-gap", getComputedStyle(a).columnGap, w),
|
|
3297
|
+
row: Wn("row-gap", getComputedStyle(a).rowGap, w)
|
|
3291
3298
|
});
|
|
3292
3299
|
},
|
|
3293
3300
|
[l, p, I, w]
|
|
@@ -3295,7 +3302,7 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3295
3302
|
!0,
|
|
3296
3303
|
!1
|
|
3297
3304
|
);
|
|
3298
|
-
return
|
|
3305
|
+
return co(() => {
|
|
3299
3306
|
e.itemHeight > 0 && e.itemWidth > 0 && h(!0);
|
|
3300
3307
|
}, [e]), R ? null : /* @__PURE__ */ G(
|
|
3301
3308
|
d,
|
|
@@ -3329,8 +3336,8 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3329
3336
|
})
|
|
3330
3337
|
}
|
|
3331
3338
|
);
|
|
3332
|
-
}),
|
|
3333
|
-
const e = et("HeaderComponent"), n = wt("headerHeight"), o = et("headerFooterTag"), r =
|
|
3339
|
+
}), Kr = E.memo(function() {
|
|
3340
|
+
const e = et("HeaderComponent"), n = wt("headerHeight"), o = et("headerFooterTag"), r = Lt(
|
|
3334
3341
|
E.useMemo(
|
|
3335
3342
|
() => (i) => {
|
|
3336
3343
|
n(Ht(i, "height"));
|
|
@@ -3341,8 +3348,8 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3341
3348
|
!1
|
|
3342
3349
|
), s = et("context");
|
|
3343
3350
|
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
|
|
3344
|
-
}),
|
|
3345
|
-
const e = et("FooterComponent"), n = wt("footerHeight"), o = et("headerFooterTag"), r =
|
|
3351
|
+
}), jr = E.memo(function() {
|
|
3352
|
+
const e = et("FooterComponent"), n = wt("footerHeight"), o = et("headerFooterTag"), r = Lt(
|
|
3346
3353
|
E.useMemo(
|
|
3347
3354
|
() => (i) => {
|
|
3348
3355
|
n(Ht(i, "height"));
|
|
@@ -3353,8 +3360,8 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3353
3360
|
!1
|
|
3354
3361
|
), s = et("context");
|
|
3355
3362
|
return e != null ? /* @__PURE__ */ G(o, { ref: r, children: /* @__PURE__ */ G(e, { ...ot(e, s) }) }) : null;
|
|
3356
|
-
}),
|
|
3357
|
-
const e = E.useContext(
|
|
3363
|
+
}), qr = ({ children: t }) => {
|
|
3364
|
+
const e = E.useContext(lo), n = wt("itemDimensions"), o = wt("viewportDimensions"), r = Lt(
|
|
3358
3365
|
E.useMemo(
|
|
3359
3366
|
() => (s) => {
|
|
3360
3367
|
o(s.getBoundingClientRect());
|
|
@@ -3367,25 +3374,25 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3367
3374
|
return E.useEffect(() => {
|
|
3368
3375
|
e && (o({ height: e.viewportHeight, width: e.viewportWidth }), n({ height: e.itemHeight, width: e.itemWidth }));
|
|
3369
3376
|
}, [e, o, n]), /* @__PURE__ */ G("div", { ref: r, style: He(!1), children: t });
|
|
3370
|
-
},
|
|
3371
|
-
const e = E.useContext(
|
|
3377
|
+
}, Yr = ({ children: t }) => {
|
|
3378
|
+
const e = E.useContext(lo), n = wt("windowViewportRect"), o = wt("itemDimensions"), r = et("customScrollParent"), s = et("useWindowScroll"), i = $e(n, r, !1);
|
|
3372
3379
|
return E.useEffect(() => {
|
|
3373
3380
|
e && (o({ height: e.itemHeight, width: e.itemWidth }), n({ listHeight: 0, offsetTop: 0, visibleHeight: e.viewportHeight, visibleWidth: e.viewportWidth }));
|
|
3374
3381
|
}, [e, n, o]), /* @__PURE__ */ G("div", { ref: i, style: tn(!1, s), children: t });
|
|
3375
|
-
},
|
|
3376
|
-
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ?
|
|
3382
|
+
}, Zr = /* @__PURE__ */ E.memo(function({ ...e }) {
|
|
3383
|
+
const n = et("useWindowScroll"), o = et("customScrollParent"), r = o || n ? Qr : Jr, s = o || n ? Yr : qr, i = et("context");
|
|
3377
3384
|
return /* @__PURE__ */ G(r, { ...e, ...ot(r, i), children: /* @__PURE__ */ $t(s, { children: [
|
|
3378
|
-
/* @__PURE__ */ G(
|
|
3379
|
-
/* @__PURE__ */ G(
|
|
3380
|
-
/* @__PURE__ */ G(
|
|
3385
|
+
/* @__PURE__ */ G(Kr, {}),
|
|
3386
|
+
/* @__PURE__ */ G(Ur, {}),
|
|
3387
|
+
/* @__PURE__ */ G(jr, {})
|
|
3381
3388
|
] }) });
|
|
3382
3389
|
}), {
|
|
3383
|
-
Component:
|
|
3384
|
-
useEmitter:
|
|
3390
|
+
Component: Xr,
|
|
3391
|
+
useEmitter: go,
|
|
3385
3392
|
useEmitterValue: et,
|
|
3386
3393
|
usePublisher: wt
|
|
3387
3394
|
} = /* @__PURE__ */ Xe(
|
|
3388
|
-
|
|
3395
|
+
$r,
|
|
3389
3396
|
{
|
|
3390
3397
|
optional: {
|
|
3391
3398
|
context: "context",
|
|
@@ -3424,19 +3431,19 @@ const _r = /* @__PURE__ */ j(() => {
|
|
|
3424
3431
|
readyStateChanged: "readyStateChanged"
|
|
3425
3432
|
}
|
|
3426
3433
|
},
|
|
3427
|
-
|
|
3428
|
-
),
|
|
3429
|
-
function
|
|
3434
|
+
Zr
|
|
3435
|
+
), Jr = /* @__PURE__ */ en({ useEmitter: go, useEmitterValue: et, usePublisher: wt }), Qr = /* @__PURE__ */ nn({ useEmitter: go, useEmitterValue: et, usePublisher: wt });
|
|
3436
|
+
function Wn(t, e, n) {
|
|
3430
3437
|
return e !== "normal" && e?.endsWith("px") !== !0 && n(`${t} was not resolved to pixel value correctly`, e, ft.WARN), e === "normal" ? 0 : parseInt(e ?? "0", 10);
|
|
3431
3438
|
}
|
|
3432
|
-
const
|
|
3439
|
+
const cs = Xr;
|
|
3433
3440
|
export {
|
|
3434
|
-
|
|
3435
|
-
|
|
3441
|
+
ls as GroupedTableVirtuoso,
|
|
3442
|
+
ss as GroupedVirtuoso,
|
|
3436
3443
|
ft as LogLevel,
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3444
|
+
is as TableVirtuoso,
|
|
3445
|
+
rs as Virtuoso,
|
|
3446
|
+
cs as VirtuosoGrid,
|
|
3447
|
+
lo as VirtuosoGridMockContext,
|
|
3441
3448
|
Re as VirtuosoMockContext
|
|
3442
3449
|
};
|