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