react-window 2.5.0 → 2.5.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/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +4 -4
- package/dist/react-window.js +664 -638
- package/dist/react-window.js.map +1 -1
- package/package.json +2 -2
package/dist/react-window.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useLayoutEffect as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
2
|
+
import { jsx as ue } from "react/jsx-runtime";
|
|
3
|
+
import { useLayoutEffect as _e, useEffect as le, useState as C, useSyncExternalStore as Be, useMemo as q, useRef as P, useCallback as X, memo as Le, useImperativeHandle as Me, createElement as he, Fragment as be } from "react";
|
|
4
|
+
const B = typeof window < "u" ? _e : le;
|
|
5
|
+
function Ae(e) {
|
|
6
6
|
let t = e;
|
|
7
7
|
for (; t; ) {
|
|
8
8
|
if (t.dir)
|
|
@@ -11,30 +11,30 @@ function Me(e) {
|
|
|
11
11
|
}
|
|
12
12
|
return !1;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const [r, o] =
|
|
16
|
-
return
|
|
17
|
-
t ? o(t === "rtl") : e && o(
|
|
14
|
+
function Ee(e, t) {
|
|
15
|
+
const [r, o] = C(t === "rtl");
|
|
16
|
+
return B(() => {
|
|
17
|
+
t ? o(t === "rtl") : e && o(Ae(e));
|
|
18
18
|
}, [t, e]), r;
|
|
19
19
|
}
|
|
20
20
|
function Pe() {
|
|
21
21
|
return () => {
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function We() {
|
|
25
25
|
return Be(
|
|
26
26
|
Pe,
|
|
27
27
|
() => !1,
|
|
28
28
|
() => !0
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Z(e) {
|
|
32
32
|
return e?.ownerDocument.defaultView ?? window;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
34
|
+
function we(e) {
|
|
35
|
+
return Z(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function me(e) {
|
|
38
38
|
if (e !== void 0)
|
|
39
39
|
switch (typeof e) {
|
|
40
40
|
case "number":
|
|
@@ -46,7 +46,7 @@ function xe(e) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function De({
|
|
50
50
|
box: e,
|
|
51
51
|
defaultHeight: t,
|
|
52
52
|
defaultWidth: r,
|
|
@@ -55,58 +55,58 @@ function _e({
|
|
|
55
55
|
mode: i,
|
|
56
56
|
style: n
|
|
57
57
|
}) {
|
|
58
|
-
const { styleHeight:
|
|
58
|
+
const { styleHeight: d, styleWidth: v } = q(
|
|
59
59
|
() => ({
|
|
60
|
-
styleHeight:
|
|
61
|
-
styleWidth:
|
|
60
|
+
styleHeight: me(n?.height),
|
|
61
|
+
styleWidth: me(n?.width)
|
|
62
62
|
}),
|
|
63
63
|
[n?.height, n?.width]
|
|
64
|
-
), [h, f] =
|
|
64
|
+
), [h, f] = C({
|
|
65
65
|
height: t,
|
|
66
66
|
width: r
|
|
67
|
-
}),
|
|
68
|
-
return
|
|
69
|
-
if (s === null ||
|
|
67
|
+
}), u = o || i === "only-height" && d !== void 0 || i === "only-width" && v !== void 0 || d !== void 0 && v !== void 0;
|
|
68
|
+
return B(() => {
|
|
69
|
+
if (s === null || u)
|
|
70
70
|
return;
|
|
71
|
-
const a =
|
|
71
|
+
const a = we(s);
|
|
72
72
|
if (!a)
|
|
73
73
|
return;
|
|
74
|
-
const
|
|
75
|
-
for (const
|
|
76
|
-
const { contentRect:
|
|
77
|
-
s ===
|
|
78
|
-
height:
|
|
79
|
-
width:
|
|
74
|
+
const c = new a((l) => {
|
|
75
|
+
for (const p of l) {
|
|
76
|
+
const { contentRect: b, target: S } = p;
|
|
77
|
+
s === S && f((w) => w.height === b.height && w.width === b.width ? w : {
|
|
78
|
+
height: b.height,
|
|
79
|
+
width: b.width
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
return
|
|
84
|
-
|
|
83
|
+
return c.observe(s, { box: e }), () => {
|
|
84
|
+
c?.unobserve(s);
|
|
85
85
|
};
|
|
86
|
-
}, [e,
|
|
86
|
+
}, [e, u, s, d, v]), q(
|
|
87
87
|
() => ({
|
|
88
|
-
height:
|
|
88
|
+
height: d ?? h.height,
|
|
89
89
|
width: v ?? h.width
|
|
90
90
|
}),
|
|
91
|
-
[h,
|
|
91
|
+
[h, d, v]
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
function ie(e) {
|
|
95
|
-
const t =
|
|
95
|
+
const t = P(() => {
|
|
96
96
|
throw new Error("Cannot call an event handler while rendering.");
|
|
97
97
|
});
|
|
98
|
-
return
|
|
98
|
+
return B(() => {
|
|
99
99
|
t.current = e;
|
|
100
|
-
}, [e]),
|
|
100
|
+
}, [e]), X((...r) => t.current?.(...r), [t]);
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const xe = /* @__PURE__ */ new WeakMap();
|
|
103
103
|
function Ue(e = !1, t = document) {
|
|
104
|
-
let r =
|
|
104
|
+
let r = xe.get(t);
|
|
105
105
|
if (r === void 0 || e) {
|
|
106
106
|
const o = t.createElement("div"), s = o.style;
|
|
107
107
|
s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
|
|
108
108
|
const i = t.createElement("div"), n = i.style;
|
|
109
|
-
n.width = "100px", n.height = "100px", o.appendChild(i), t.body.appendChild(o), o.scrollLeft > 0 ? r = "positive-descending" : (o.scrollLeft = 1, o.scrollLeft === 0 ? r = "negative" : r = "positive-ascending"), t.body.removeChild(o),
|
|
109
|
+
n.width = "100px", n.height = "100px", o.appendChild(i), t.body.appendChild(o), o.scrollLeft > 0 ? r = "positive-descending" : (o.scrollLeft = 1, o.scrollLeft === 0 ? r = "negative" : r = "positive-ascending"), t.body.removeChild(o), xe.set(t, r);
|
|
110
110
|
}
|
|
111
111
|
return r;
|
|
112
112
|
}
|
|
@@ -130,29 +130,29 @@ function ne({
|
|
|
130
130
|
}
|
|
131
131
|
return o;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function Ce({
|
|
134
134
|
container: e,
|
|
135
135
|
element: t,
|
|
136
136
|
onChange: r
|
|
137
137
|
}) {
|
|
138
|
-
const o =
|
|
139
|
-
|
|
140
|
-
(
|
|
141
|
-
|
|
138
|
+
const o = Z(t), s = we(t), i = o.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), n = s ? new s(r) : void 0, d = (u) => !u.isConnected || (u.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, v = i ? new i((u) => {
|
|
139
|
+
u.some(
|
|
140
|
+
(c) => Array.from(c.addedNodes).some(d) || // Removed nodes preceded the element if the node after them still does (or contains the element)
|
|
141
|
+
c.removedNodes.length > 0 && c.nextSibling !== null && d(c.nextSibling)
|
|
142
142
|
) && (f(), r());
|
|
143
143
|
}) : void 0, h = /* @__PURE__ */ new Set(), f = () => {
|
|
144
144
|
for (const a of h)
|
|
145
145
|
n?.unobserve(a);
|
|
146
146
|
h.clear(), v?.disconnect();
|
|
147
|
-
let
|
|
148
|
-
for (;
|
|
149
|
-
const a =
|
|
147
|
+
let u = t;
|
|
148
|
+
for (; u !== e; ) {
|
|
149
|
+
const a = u.parentElement;
|
|
150
150
|
if (a === null)
|
|
151
151
|
break;
|
|
152
152
|
if (n)
|
|
153
|
-
for (let
|
|
154
|
-
h.add(
|
|
155
|
-
v?.observe(a, { childList: !0 }),
|
|
153
|
+
for (let c = u.previousElementSibling; c !== null; c = c.previousElementSibling)
|
|
154
|
+
h.add(c), n.observe(c);
|
|
155
|
+
v?.observe(a, { childList: !0 }), u = a;
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
return f(), () => {
|
|
@@ -163,9 +163,9 @@ function ce(e) {
|
|
|
163
163
|
return e.window === e;
|
|
164
164
|
}
|
|
165
165
|
function $e(e, t) {
|
|
166
|
-
return t === "window" ? e ?
|
|
166
|
+
return t === "window" ? e ? Z(e) : null : t ?? null;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function de(e, t) {
|
|
169
169
|
return ce(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
170
170
|
}
|
|
171
171
|
function je(e, t) {
|
|
@@ -176,10 +176,10 @@ function ae(e, t) {
|
|
|
176
176
|
e && typeof e.scrollTo == "function" && e.scrollTo(t);
|
|
177
177
|
}
|
|
178
178
|
function qe(e, t) {
|
|
179
|
-
const { overflowX: r, overflowY: o } =
|
|
179
|
+
const { overflowX: r, overflowY: o } = Z(e).getComputedStyle(e), s = t === "vertical" ? o : r;
|
|
180
180
|
return s === "visible" || s === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Oe({
|
|
183
183
|
containerElement: e,
|
|
184
184
|
direction: t,
|
|
185
185
|
isRtl: r,
|
|
@@ -188,32 +188,32 @@ function Ie({
|
|
|
188
188
|
const s = t === "vertical";
|
|
189
189
|
let i, n;
|
|
190
190
|
if (ce(o)) {
|
|
191
|
-
const { documentElement:
|
|
192
|
-
i = 0, n = s ?
|
|
191
|
+
const { documentElement: w } = o.document;
|
|
192
|
+
i = 0, n = s ? w.clientHeight : w.clientWidth;
|
|
193
193
|
} else {
|
|
194
|
-
const
|
|
195
|
-
i = s ?
|
|
194
|
+
const w = o.getBoundingClientRect();
|
|
195
|
+
i = s ? w.top + o.clientTop : w.left + o.clientLeft, n = s ? o.clientHeight : o.clientWidth;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const d = i + n, v = e.getBoundingClientRect(), h = s ? v.top + e.clientTop : v.left + e.clientLeft, f = s ? e.clientHeight : e.clientWidth, u = h + f, a = ne({
|
|
198
198
|
containerElement: e,
|
|
199
199
|
direction: t,
|
|
200
200
|
isRtl: r,
|
|
201
201
|
scrollOffset: s ? e.scrollTop : e.scrollLeft
|
|
202
|
-
}),
|
|
202
|
+
}), l = !s && r ? u - d : i - h, p = l + n, b = Math.max(0, l), S = Math.min(f, p);
|
|
203
203
|
return {
|
|
204
|
-
offset: a +
|
|
205
|
-
size: Math.max(0,
|
|
206
|
-
viewportOffset: a +
|
|
204
|
+
offset: a + b,
|
|
205
|
+
size: Math.max(0, S - b),
|
|
206
|
+
viewportOffset: a + l,
|
|
207
207
|
viewportSize: n
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ie({
|
|
211
211
|
direction: e,
|
|
212
212
|
isRtl: t,
|
|
213
213
|
scrollTarget: r,
|
|
214
214
|
viewportSize: o
|
|
215
215
|
}) {
|
|
216
|
-
const s = ce(r) ? r.document.documentElement : r, i =
|
|
216
|
+
const s = ce(r) ? r.document.documentElement : r, i = Z(s).getComputedStyle(s), n = (h) => {
|
|
217
217
|
const f = parseFloat(h ?? "");
|
|
218
218
|
return !Number.isFinite(f) || f < 0 ? 0 : h.endsWith("px") ? f : h.endsWith("%") ? f * o / 100 : 0;
|
|
219
219
|
};
|
|
@@ -222,24 +222,24 @@ function Oe({
|
|
|
222
222
|
end: n(i.scrollPaddingBottom),
|
|
223
223
|
start: n(i.scrollPaddingTop)
|
|
224
224
|
};
|
|
225
|
-
const
|
|
226
|
-
return t ? { end:
|
|
225
|
+
const d = n(i.scrollPaddingLeft), v = n(i.scrollPaddingRight);
|
|
226
|
+
return t ? { end: d, start: v } : { end: v, start: d };
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function Y(e, t = "Assertion error") {
|
|
229
229
|
if (!e)
|
|
230
230
|
throw console.error(t), Error(t);
|
|
231
231
|
}
|
|
232
232
|
function se(e, t) {
|
|
233
233
|
if (e === t)
|
|
234
234
|
return !0;
|
|
235
|
-
if (!!e != !!t || (
|
|
235
|
+
if (!!e != !!t || (Y(e !== void 0), Y(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
|
|
236
236
|
return !1;
|
|
237
237
|
for (const r in e)
|
|
238
238
|
if (!Object.hasOwn(t, r) || !Object.is(t[r], e[r]))
|
|
239
239
|
return !1;
|
|
240
240
|
return !0;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Ve({
|
|
243
243
|
cachedBounds: e,
|
|
244
244
|
itemCount: t,
|
|
245
245
|
itemSize: r
|
|
@@ -252,7 +252,7 @@ function We({
|
|
|
252
252
|
const o = e.get(
|
|
253
253
|
e.size === 0 ? 0 : e.size - 1
|
|
254
254
|
);
|
|
255
|
-
|
|
255
|
+
Y(o !== void 0, "Unexpected bounds cache miss");
|
|
256
256
|
const s = (o.scrollOffset + o.size) / e.size;
|
|
257
257
|
return t * s;
|
|
258
258
|
}
|
|
@@ -265,29 +265,29 @@ function Se({
|
|
|
265
265
|
itemCount: s,
|
|
266
266
|
itemSize: i,
|
|
267
267
|
containerScrollOffset: n,
|
|
268
|
-
containerSize:
|
|
268
|
+
containerSize: d
|
|
269
269
|
}) {
|
|
270
270
|
if (o < 0 || o >= s)
|
|
271
271
|
throw RangeError(`Invalid index specified: ${o}`, {
|
|
272
272
|
cause: `Index ${o} is not within the range of 0 - ${s - 1}`
|
|
273
273
|
});
|
|
274
|
-
const v = t.get(o), h =
|
|
274
|
+
const v = t.get(o), h = Ve({
|
|
275
275
|
cachedBounds: t,
|
|
276
276
|
itemCount: s,
|
|
277
277
|
itemSize: i
|
|
278
|
-
}), f = (
|
|
279
|
-
switch (e === "smart" && (e =
|
|
278
|
+
}), f = (l) => r ? Math.max(0, Math.min(h - d, l)) : l, u = f(v.scrollOffset), a = r ? Math.max(0, v.scrollOffset - d + v.size) : v.scrollOffset - d + v.size, c = v.size > d ? n >= v.scrollOffset && n <= a : n >= a && n <= v.scrollOffset;
|
|
279
|
+
switch (e === "smart" && (e = c ? "auto" : "center"), e) {
|
|
280
280
|
case "start":
|
|
281
|
-
return
|
|
281
|
+
return u;
|
|
282
282
|
case "end":
|
|
283
283
|
return a;
|
|
284
284
|
case "center":
|
|
285
285
|
return f(
|
|
286
|
-
v.scrollOffset + v.size / 2 -
|
|
286
|
+
v.scrollOffset + v.size / 2 - d / 2
|
|
287
287
|
);
|
|
288
288
|
case "auto":
|
|
289
289
|
default:
|
|
290
|
-
return
|
|
290
|
+
return c ? n : n < a ? a : u;
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
function fe({
|
|
@@ -305,45 +305,45 @@ function fe({
|
|
|
305
305
|
startIndexOverscan: 0,
|
|
306
306
|
stopIndexOverscan: -1
|
|
307
307
|
};
|
|
308
|
-
let n,
|
|
308
|
+
let n, d;
|
|
309
309
|
const { itemSize: v } = e;
|
|
310
310
|
if (v !== void 0)
|
|
311
311
|
v > 0 ? (n = Math.max(
|
|
312
312
|
0,
|
|
313
313
|
Math.min(i, Math.floor(t / v))
|
|
314
|
-
),
|
|
314
|
+
), d = Math.max(
|
|
315
315
|
n,
|
|
316
316
|
Math.min(
|
|
317
317
|
i,
|
|
318
318
|
Math.ceil((t + r) / v) - 1
|
|
319
319
|
)
|
|
320
|
-
)) : (n = 0,
|
|
320
|
+
)) : (n = 0, d = 0);
|
|
321
321
|
else {
|
|
322
322
|
let h = 0, f = Math.min(i, Math.max(0, e.size - 1));
|
|
323
323
|
for (; h < f; ) {
|
|
324
|
-
const
|
|
325
|
-
a.scrollOffset + a.size > t ? f =
|
|
324
|
+
const u = Math.floor((h + f) / 2), a = e.get(u);
|
|
325
|
+
a.scrollOffset + a.size > t ? f = u : h = u + 1;
|
|
326
326
|
}
|
|
327
327
|
for (; h < i; ) {
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
328
|
+
const u = e.get(h);
|
|
329
|
+
if (u.scrollOffset + u.size > t) break;
|
|
330
330
|
h++;
|
|
331
331
|
}
|
|
332
|
-
for (n = h,
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
332
|
+
for (n = h, d = h; d < i; ) {
|
|
333
|
+
const u = e.get(d);
|
|
334
|
+
if (u.scrollOffset + u.size >= t + r)
|
|
335
335
|
break;
|
|
336
|
-
|
|
336
|
+
d++;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
return {
|
|
340
340
|
startIndexVisible: n,
|
|
341
|
-
stopIndexVisible:
|
|
341
|
+
stopIndexVisible: d,
|
|
342
342
|
startIndexOverscan: Math.max(0, n - s),
|
|
343
|
-
stopIndexOverscan: Math.min(i,
|
|
343
|
+
stopIndexOverscan: Math.min(i, d + s)
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ge({
|
|
347
347
|
itemCount: e,
|
|
348
348
|
itemProps: t,
|
|
349
349
|
itemSize: r
|
|
@@ -352,28 +352,28 @@ function Ce({
|
|
|
352
352
|
return {
|
|
353
353
|
itemSize: typeof r == "number" ? r : void 0,
|
|
354
354
|
get(s) {
|
|
355
|
-
if (
|
|
356
|
-
return
|
|
355
|
+
if (Y(s < e, `Invalid index ${s}`), typeof r == "number")
|
|
356
|
+
return Y(s >= 0, `Invalid index ${s}`), { size: r, scrollOffset: s * r };
|
|
357
357
|
for (; o.size - 1 < s; ) {
|
|
358
|
-
const n = o.size,
|
|
358
|
+
const n = o.size, d = r(n, t);
|
|
359
359
|
if (n === 0)
|
|
360
360
|
o.set(n, {
|
|
361
|
-
size:
|
|
361
|
+
size: d,
|
|
362
362
|
scrollOffset: 0
|
|
363
363
|
});
|
|
364
364
|
else {
|
|
365
365
|
const v = o.get(n - 1);
|
|
366
|
-
|
|
366
|
+
Y(
|
|
367
367
|
v !== void 0,
|
|
368
368
|
`Unexpected bounds cache miss for index ${s}`
|
|
369
369
|
), o.set(n, {
|
|
370
370
|
scrollOffset: v.scrollOffset + v.size,
|
|
371
|
-
size:
|
|
371
|
+
size: d
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
const i = o.get(s);
|
|
376
|
-
return
|
|
376
|
+
return Y(
|
|
377
377
|
i !== void 0,
|
|
378
378
|
`Unexpected bounds cache miss for index ${s}`
|
|
379
379
|
), i;
|
|
@@ -386,13 +386,13 @@ function Ce({
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Xe({
|
|
390
390
|
itemCount: e,
|
|
391
391
|
itemProps: t,
|
|
392
392
|
itemSize: r
|
|
393
393
|
}) {
|
|
394
|
-
return
|
|
395
|
-
() =>
|
|
394
|
+
return q(
|
|
395
|
+
() => Ge({
|
|
396
396
|
itemCount: e,
|
|
397
397
|
itemProps: t,
|
|
398
398
|
itemSize: r
|
|
@@ -400,17 +400,17 @@ function Ge({
|
|
|
400
400
|
[e, t, r]
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Ye({
|
|
404
404
|
containerSize: e,
|
|
405
405
|
itemSize: t
|
|
406
406
|
}) {
|
|
407
407
|
let r;
|
|
408
408
|
switch (typeof t) {
|
|
409
409
|
case "string": {
|
|
410
|
-
|
|
410
|
+
Y(
|
|
411
411
|
t.endsWith("%"),
|
|
412
412
|
`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
|
|
413
|
-
),
|
|
413
|
+
), Y(
|
|
414
414
|
e !== void 0,
|
|
415
415
|
"Container size must be defined if a percentage item size is specified"
|
|
416
416
|
), r = e * parseFloat(t) / 100;
|
|
@@ -423,7 +423,7 @@ function Xe({
|
|
|
423
423
|
}
|
|
424
424
|
return typeof r == "number" && !(Number.isFinite(r) && r > 0) && (r = 0), r;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function pe({
|
|
427
427
|
containerElement: e,
|
|
428
428
|
containerStyle: t,
|
|
429
429
|
defaultContainerSize: r = 0,
|
|
@@ -431,80 +431,80 @@ function he({
|
|
|
431
431
|
direction: s,
|
|
432
432
|
isRtl: i = !1,
|
|
433
433
|
itemCount: n,
|
|
434
|
-
itemProps:
|
|
434
|
+
itemProps: d,
|
|
435
435
|
itemSize: v,
|
|
436
436
|
onResize: h,
|
|
437
437
|
overscanCount: f,
|
|
438
|
-
scrollElement:
|
|
438
|
+
scrollElement: u
|
|
439
439
|
}) {
|
|
440
|
-
const a =
|
|
440
|
+
const a = u !== void 0, c = a ? $e(e, u) : e, { height: l = r, width: p = r } = De({
|
|
441
441
|
defaultHeight: s === "vertical" ? r : void 0,
|
|
442
442
|
defaultWidth: s === "horizontal" ? r : void 0,
|
|
443
443
|
element: e,
|
|
444
444
|
mode: s === "vertical" ? "only-height" : "only-width",
|
|
445
445
|
style: t
|
|
446
|
-
}),
|
|
446
|
+
}), b = P({
|
|
447
447
|
height: 0,
|
|
448
448
|
width: 0
|
|
449
|
-
}), [
|
|
450
|
-
|
|
449
|
+
}), [S, w] = C(r), m = a ? S : s === "vertical" ? l : p, T = Ye({ containerSize: m, itemSize: v });
|
|
450
|
+
B(() => {
|
|
451
451
|
if (typeof h == "function") {
|
|
452
|
-
const
|
|
453
|
-
(
|
|
452
|
+
const z = b.current;
|
|
453
|
+
(z.height !== l || z.width !== p) && (h({ height: l, width: p }, { ...z }), z.height = l, z.width = p);
|
|
454
454
|
}
|
|
455
|
-
}, [
|
|
456
|
-
const
|
|
455
|
+
}, [l, h, p]);
|
|
456
|
+
const g = Xe({
|
|
457
457
|
itemCount: n,
|
|
458
|
-
itemProps:
|
|
459
|
-
itemSize:
|
|
460
|
-
}),
|
|
461
|
-
() =>
|
|
462
|
-
),
|
|
463
|
-
(
|
|
464
|
-
[
|
|
465
|
-
), [
|
|
458
|
+
itemProps: d,
|
|
459
|
+
itemSize: T
|
|
460
|
+
}), J = We(), [k] = C(
|
|
461
|
+
() => J || a ? 0 : o
|
|
462
|
+
), E = X(
|
|
463
|
+
(z) => g.get(z),
|
|
464
|
+
[g]
|
|
465
|
+
), [L, $] = C(
|
|
466
466
|
() => fe({
|
|
467
|
-
cachedBounds:
|
|
468
|
-
containerScrollOffset:
|
|
467
|
+
cachedBounds: g,
|
|
468
|
+
containerScrollOffset: k,
|
|
469
469
|
containerSize: m,
|
|
470
470
|
itemCount: n,
|
|
471
471
|
overscanCount: f
|
|
472
472
|
})
|
|
473
473
|
), {
|
|
474
|
-
startIndexVisible:
|
|
474
|
+
startIndexVisible: _,
|
|
475
475
|
startIndexOverscan: Q,
|
|
476
476
|
stopIndexVisible: te,
|
|
477
477
|
stopIndexOverscan: R
|
|
478
478
|
} = {
|
|
479
|
-
startIndexVisible: Math.min(n - 1,
|
|
480
|
-
startIndexOverscan: Math.min(n - 1,
|
|
481
|
-
stopIndexVisible: Math.min(n - 1,
|
|
482
|
-
stopIndexOverscan: Math.min(n - 1,
|
|
483
|
-
},
|
|
484
|
-
() =>
|
|
485
|
-
cachedBounds:
|
|
479
|
+
startIndexVisible: Math.min(n - 1, L.startIndexVisible),
|
|
480
|
+
startIndexOverscan: Math.min(n - 1, L.startIndexOverscan),
|
|
481
|
+
stopIndexVisible: Math.min(n - 1, L.stopIndexVisible),
|
|
482
|
+
stopIndexOverscan: Math.min(n - 1, L.stopIndexOverscan)
|
|
483
|
+
}, O = X(
|
|
484
|
+
() => Ve({
|
|
485
|
+
cachedBounds: g,
|
|
486
486
|
itemCount: n,
|
|
487
|
-
itemSize:
|
|
487
|
+
itemSize: T
|
|
488
488
|
}),
|
|
489
|
-
[
|
|
490
|
-
), H =
|
|
491
|
-
(
|
|
492
|
-
const
|
|
489
|
+
[g, n, T]
|
|
490
|
+
), H = X(
|
|
491
|
+
(z) => {
|
|
492
|
+
const x = ne({
|
|
493
493
|
containerElement: e,
|
|
494
494
|
direction: s,
|
|
495
495
|
isRtl: i,
|
|
496
|
-
scrollOffset:
|
|
496
|
+
scrollOffset: z
|
|
497
497
|
});
|
|
498
498
|
return fe({
|
|
499
|
-
cachedBounds:
|
|
500
|
-
containerScrollOffset:
|
|
499
|
+
cachedBounds: g,
|
|
500
|
+
containerScrollOffset: x,
|
|
501
501
|
containerSize: m,
|
|
502
502
|
itemCount: n,
|
|
503
503
|
overscanCount: f
|
|
504
504
|
});
|
|
505
505
|
},
|
|
506
506
|
[
|
|
507
|
-
|
|
507
|
+
g,
|
|
508
508
|
e,
|
|
509
509
|
m,
|
|
510
510
|
s,
|
|
@@ -512,77 +512,77 @@ function he({
|
|
|
512
512
|
n,
|
|
513
513
|
f
|
|
514
514
|
]
|
|
515
|
-
),
|
|
516
|
-
|
|
517
|
-
if (!e || n === 0 || a ||
|
|
515
|
+
), I = P(!1);
|
|
516
|
+
B(() => {
|
|
517
|
+
if (!e || n === 0 || a || I.current || (I.current = !0, o <= 0))
|
|
518
518
|
return;
|
|
519
|
-
const
|
|
519
|
+
const z = s === "horizontal" && Ae(e);
|
|
520
520
|
if (ne({
|
|
521
521
|
containerElement: e,
|
|
522
522
|
direction: s,
|
|
523
|
-
isRtl:
|
|
523
|
+
isRtl: z,
|
|
524
524
|
scrollOffset: s === "vertical" ? e.scrollTop : e.scrollLeft
|
|
525
525
|
}) !== 0)
|
|
526
526
|
return;
|
|
527
|
-
const
|
|
527
|
+
const A = ne({
|
|
528
528
|
containerElement: e,
|
|
529
529
|
direction: s,
|
|
530
|
-
isRtl:
|
|
530
|
+
isRtl: z,
|
|
531
531
|
scrollOffset: o
|
|
532
532
|
});
|
|
533
533
|
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
534
534
|
behavior: "instant",
|
|
535
|
-
[s === "vertical" ? "top" : "left"]:
|
|
536
|
-
}) : s === "vertical" ? e.scrollTop =
|
|
537
|
-
}, [e, n]),
|
|
538
|
-
if (a && e &&
|
|
535
|
+
[s === "vertical" ? "top" : "left"]: A
|
|
536
|
+
}) : s === "vertical" ? e.scrollTop = A : e.scrollLeft = A;
|
|
537
|
+
}, [e, n]), B(() => {
|
|
538
|
+
if (a && e && c)
|
|
539
539
|
return;
|
|
540
|
-
const
|
|
540
|
+
const z = e && !a ? H(
|
|
541
541
|
s === "vertical" ? e.scrollTop : e.scrollLeft
|
|
542
542
|
) : fe({
|
|
543
|
-
cachedBounds:
|
|
544
|
-
containerScrollOffset:
|
|
543
|
+
cachedBounds: g,
|
|
544
|
+
containerScrollOffset: k,
|
|
545
545
|
containerSize: m,
|
|
546
546
|
itemCount: n,
|
|
547
547
|
overscanCount: f
|
|
548
548
|
});
|
|
549
|
-
|
|
549
|
+
$((x) => se(z, x) ? x : z);
|
|
550
550
|
}, [
|
|
551
|
-
|
|
551
|
+
g,
|
|
552
552
|
e,
|
|
553
553
|
m,
|
|
554
554
|
s,
|
|
555
555
|
H,
|
|
556
|
-
|
|
556
|
+
k,
|
|
557
557
|
a,
|
|
558
558
|
n,
|
|
559
559
|
f,
|
|
560
|
-
|
|
561
|
-
]),
|
|
560
|
+
c
|
|
561
|
+
]), B(() => {
|
|
562
562
|
if (!e || a)
|
|
563
563
|
return;
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
const { scrollLeft:
|
|
564
|
+
const z = () => {
|
|
565
|
+
$((x) => {
|
|
566
|
+
const { scrollLeft: A, scrollTop: N } = e, W = ne({
|
|
567
567
|
containerElement: e,
|
|
568
568
|
direction: s,
|
|
569
569
|
isRtl: i,
|
|
570
|
-
scrollOffset: s === "vertical" ?
|
|
570
|
+
scrollOffset: s === "vertical" ? N : A
|
|
571
571
|
}), D = fe({
|
|
572
|
-
cachedBounds:
|
|
573
|
-
containerScrollOffset:
|
|
572
|
+
cachedBounds: g,
|
|
573
|
+
containerScrollOffset: W,
|
|
574
574
|
containerSize: m,
|
|
575
575
|
itemCount: n,
|
|
576
576
|
overscanCount: f
|
|
577
577
|
});
|
|
578
|
-
return se(D,
|
|
578
|
+
return se(D, x) ? x : D;
|
|
579
579
|
});
|
|
580
580
|
};
|
|
581
|
-
return e.addEventListener("scroll",
|
|
582
|
-
e.removeEventListener("scroll",
|
|
581
|
+
return e.addEventListener("scroll", z), () => {
|
|
582
|
+
e.removeEventListener("scroll", z);
|
|
583
583
|
};
|
|
584
584
|
}, [
|
|
585
|
-
|
|
585
|
+
g,
|
|
586
586
|
e,
|
|
587
587
|
m,
|
|
588
588
|
s,
|
|
@@ -592,154 +592,154 @@ function he({
|
|
|
592
592
|
f
|
|
593
593
|
]);
|
|
594
594
|
const K = ie(() => {
|
|
595
|
-
if (!e || !
|
|
595
|
+
if (!e || !c)
|
|
596
596
|
return;
|
|
597
|
-
const { offset:
|
|
597
|
+
const { offset: z, size: x, viewportSize: A } = Oe({
|
|
598
598
|
containerElement: e,
|
|
599
599
|
direction: s,
|
|
600
600
|
isRtl: i,
|
|
601
|
-
scrollTarget:
|
|
601
|
+
scrollTarget: c
|
|
602
602
|
});
|
|
603
|
-
|
|
604
|
-
const
|
|
605
|
-
cachedBounds:
|
|
606
|
-
containerScrollOffset:
|
|
607
|
-
containerSize:
|
|
603
|
+
w(A);
|
|
604
|
+
const N = fe({
|
|
605
|
+
cachedBounds: g,
|
|
606
|
+
containerScrollOffset: z,
|
|
607
|
+
containerSize: x,
|
|
608
608
|
itemCount: n,
|
|
609
609
|
overscanCount: f
|
|
610
610
|
});
|
|
611
|
-
|
|
611
|
+
$((W) => se(N, W) ? W : N);
|
|
612
612
|
});
|
|
613
|
-
|
|
613
|
+
B(() => {
|
|
614
614
|
a && K();
|
|
615
|
-
}),
|
|
616
|
-
if (!a || !e || !
|
|
615
|
+
}), B(() => {
|
|
616
|
+
if (!a || !e || !c)
|
|
617
617
|
return;
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
let
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
const
|
|
624
|
-
container: ce(
|
|
618
|
+
const z = Z(e), x = () => K();
|
|
619
|
+
c.addEventListener("scroll", x, { passive: !0 }), e.addEventListener("scroll", x, { passive: !0 }), z.addEventListener("resize", x);
|
|
620
|
+
let A;
|
|
621
|
+
const N = we(e);
|
|
622
|
+
N && !ce(c) && (A = new N(x), A.observe(c));
|
|
623
|
+
const W = Ce({
|
|
624
|
+
container: ce(c) ? c.document.documentElement : c,
|
|
625
625
|
element: e,
|
|
626
|
-
onChange:
|
|
626
|
+
onChange: x
|
|
627
627
|
});
|
|
628
628
|
return () => {
|
|
629
|
-
|
|
629
|
+
c.removeEventListener("scroll", x), e.removeEventListener("scroll", x), z.removeEventListener("resize", x), A?.disconnect(), W();
|
|
630
630
|
};
|
|
631
631
|
}, [
|
|
632
632
|
e,
|
|
633
633
|
a,
|
|
634
|
-
|
|
634
|
+
c,
|
|
635
635
|
K
|
|
636
636
|
]);
|
|
637
637
|
const re = ie(
|
|
638
638
|
({
|
|
639
|
-
align:
|
|
640
|
-
index:
|
|
639
|
+
align: z = "auto",
|
|
640
|
+
index: x
|
|
641
641
|
}) => {
|
|
642
|
-
const
|
|
643
|
-
clamp:
|
|
644
|
-
containerScrollOffset:
|
|
645
|
-
containerSize:
|
|
642
|
+
const A = ({
|
|
643
|
+
clamp: V,
|
|
644
|
+
containerScrollOffset: F,
|
|
645
|
+
containerSize: M,
|
|
646
646
|
padding: y
|
|
647
647
|
}) => {
|
|
648
648
|
if (y.start === 0 && y.end === 0)
|
|
649
649
|
return Se({
|
|
650
|
-
align:
|
|
651
|
-
cachedBounds:
|
|
652
|
-
clamp:
|
|
653
|
-
containerScrollOffset:
|
|
654
|
-
containerSize:
|
|
655
|
-
index:
|
|
650
|
+
align: z,
|
|
651
|
+
cachedBounds: g,
|
|
652
|
+
clamp: V,
|
|
653
|
+
containerScrollOffset: F,
|
|
654
|
+
containerSize: M,
|
|
655
|
+
index: x,
|
|
656
656
|
itemCount: n,
|
|
657
|
-
itemSize:
|
|
657
|
+
itemSize: T
|
|
658
658
|
});
|
|
659
|
-
const
|
|
660
|
-
align:
|
|
661
|
-
cachedBounds:
|
|
659
|
+
const U = Se({
|
|
660
|
+
align: z,
|
|
661
|
+
cachedBounds: g,
|
|
662
662
|
clamp: !1,
|
|
663
|
-
containerScrollOffset:
|
|
663
|
+
containerScrollOffset: F + y.start,
|
|
664
664
|
containerSize: Math.max(
|
|
665
665
|
0,
|
|
666
|
-
|
|
666
|
+
M - y.start - y.end
|
|
667
667
|
),
|
|
668
|
-
index:
|
|
668
|
+
index: x,
|
|
669
669
|
itemCount: n,
|
|
670
|
-
itemSize:
|
|
670
|
+
itemSize: T
|
|
671
671
|
}) - y.start;
|
|
672
|
-
return
|
|
672
|
+
return V ? Math.max(0, Math.min(O() - M, U)) : U;
|
|
673
673
|
};
|
|
674
|
-
if (a && e &&
|
|
675
|
-
const { viewportOffset:
|
|
674
|
+
if (a && e && c && !qe(e, s)) {
|
|
675
|
+
const { viewportOffset: V, viewportSize: F } = Oe({
|
|
676
676
|
containerElement: e,
|
|
677
677
|
direction: s,
|
|
678
678
|
isRtl: i,
|
|
679
|
-
scrollTarget:
|
|
680
|
-
}), y =
|
|
679
|
+
scrollTarget: c
|
|
680
|
+
}), y = A({
|
|
681
681
|
clamp: !1,
|
|
682
|
-
containerScrollOffset:
|
|
683
|
-
containerSize:
|
|
684
|
-
padding:
|
|
682
|
+
containerScrollOffset: V,
|
|
683
|
+
containerSize: F,
|
|
684
|
+
padding: Ie({
|
|
685
685
|
direction: s,
|
|
686
686
|
isRtl: i,
|
|
687
|
-
scrollTarget:
|
|
688
|
-
viewportSize:
|
|
687
|
+
scrollTarget: c,
|
|
688
|
+
viewportSize: F
|
|
689
689
|
})
|
|
690
|
-
}) -
|
|
690
|
+
}) - V, U = s === "horizontal" && i ? -y : y;
|
|
691
691
|
return {
|
|
692
|
-
scrollOffset:
|
|
693
|
-
scrollTarget:
|
|
692
|
+
scrollOffset: de(c, s) + U,
|
|
693
|
+
scrollTarget: c
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
|
-
const
|
|
697
|
-
let D =
|
|
696
|
+
const N = e ? s === "vertical" ? e.scrollTop : e.scrollLeft : 0, W = a && e ? s === "vertical" ? e.clientHeight : e.clientWidth : m;
|
|
697
|
+
let D = A({
|
|
698
698
|
clamp: !0,
|
|
699
699
|
containerScrollOffset: ne({
|
|
700
700
|
containerElement: e,
|
|
701
701
|
direction: s,
|
|
702
702
|
isRtl: i,
|
|
703
|
-
scrollOffset:
|
|
703
|
+
scrollOffset: N
|
|
704
704
|
}),
|
|
705
|
-
containerSize:
|
|
706
|
-
padding: e ?
|
|
705
|
+
containerSize: W,
|
|
706
|
+
padding: e ? Ie({
|
|
707
707
|
direction: s,
|
|
708
708
|
isRtl: i,
|
|
709
709
|
scrollTarget: e,
|
|
710
|
-
viewportSize:
|
|
710
|
+
viewportSize: W
|
|
711
711
|
}) : { end: 0, start: 0 }
|
|
712
712
|
});
|
|
713
|
-
if (e && (!a ||
|
|
713
|
+
if (e && (!a || c)) {
|
|
714
714
|
if (D = ne({
|
|
715
715
|
containerElement: e,
|
|
716
716
|
direction: s,
|
|
717
717
|
isRtl: i,
|
|
718
718
|
scrollOffset: D
|
|
719
719
|
}), !a && typeof e.scrollTo != "function") {
|
|
720
|
-
const
|
|
721
|
-
se(
|
|
720
|
+
const V = H(D);
|
|
721
|
+
se(L, V) || $(V);
|
|
722
722
|
}
|
|
723
723
|
return { scrollOffset: D, scrollTarget: e };
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
726
|
);
|
|
727
727
|
return {
|
|
728
|
-
getCellBounds:
|
|
729
|
-
getEstimatedSize:
|
|
728
|
+
getCellBounds: E,
|
|
729
|
+
getEstimatedSize: O,
|
|
730
730
|
getScrollPositionForIndex: re,
|
|
731
|
-
scrollTarget:
|
|
731
|
+
scrollTarget: c,
|
|
732
732
|
startIndexOverscan: Q,
|
|
733
|
-
startIndexVisible:
|
|
733
|
+
startIndexVisible: _,
|
|
734
734
|
stopIndexOverscan: R,
|
|
735
735
|
stopIndexVisible: te
|
|
736
736
|
};
|
|
737
737
|
}
|
|
738
|
-
function
|
|
739
|
-
const [t, r] =
|
|
738
|
+
function Fe(e) {
|
|
739
|
+
const [t, r] = C(e);
|
|
740
740
|
return se(t, e) ? t : (r(e), e);
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function He(e, t) {
|
|
743
743
|
const {
|
|
744
744
|
ariaAttributes: r,
|
|
745
745
|
style: o,
|
|
@@ -747,11 +747,11 @@ function Fe(e, t) {
|
|
|
747
747
|
} = e, {
|
|
748
748
|
ariaAttributes: i,
|
|
749
749
|
style: n,
|
|
750
|
-
...
|
|
750
|
+
...d
|
|
751
751
|
} = t;
|
|
752
|
-
return se(r, i) && se(o, n) && se(s,
|
|
752
|
+
return se(r, i) && se(o, n) && se(s, d);
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function rt({
|
|
755
755
|
cellComponent: e,
|
|
756
756
|
cellProps: t,
|
|
757
757
|
children: r,
|
|
@@ -759,162 +759,162 @@ function et({
|
|
|
759
759
|
columnCount: s,
|
|
760
760
|
columnKey: i,
|
|
761
761
|
columnWidth: n,
|
|
762
|
-
defaultHeight:
|
|
762
|
+
defaultHeight: d = 0,
|
|
763
763
|
defaultScrollLeft: v = 0,
|
|
764
764
|
defaultScrollTop: h = 0,
|
|
765
765
|
defaultWidth: f = 0,
|
|
766
|
-
dir:
|
|
766
|
+
dir: u,
|
|
767
767
|
gridRef: a,
|
|
768
|
-
onCellsRendered:
|
|
769
|
-
onResize:
|
|
770
|
-
overscanCount:
|
|
771
|
-
rowCount:
|
|
772
|
-
rowHeight:
|
|
773
|
-
rowKey:
|
|
768
|
+
onCellsRendered: c,
|
|
769
|
+
onResize: l,
|
|
770
|
+
overscanCount: p = 3,
|
|
771
|
+
rowCount: b,
|
|
772
|
+
rowHeight: S,
|
|
773
|
+
rowKey: w,
|
|
774
774
|
scrollElement: m,
|
|
775
|
-
style:
|
|
776
|
-
tagName:
|
|
777
|
-
...
|
|
775
|
+
style: T,
|
|
776
|
+
tagName: g = "div",
|
|
777
|
+
...J
|
|
778
778
|
}) {
|
|
779
|
-
const
|
|
780
|
-
() =>
|
|
779
|
+
const k = Fe(t), E = q(
|
|
780
|
+
() => Le(e, He),
|
|
781
781
|
[e]
|
|
782
|
-
), [
|
|
782
|
+
), [L, $] = C(null), _ = Ee(L, u), {
|
|
783
783
|
getCellBounds: Q,
|
|
784
784
|
getEstimatedSize: te,
|
|
785
785
|
startIndexOverscan: R,
|
|
786
|
-
startIndexVisible:
|
|
786
|
+
startIndexVisible: O,
|
|
787
787
|
getScrollPositionForIndex: H,
|
|
788
|
-
stopIndexOverscan:
|
|
788
|
+
stopIndexOverscan: I,
|
|
789
789
|
stopIndexVisible: K
|
|
790
|
-
} =
|
|
791
|
-
containerElement:
|
|
792
|
-
containerStyle:
|
|
790
|
+
} = pe({
|
|
791
|
+
containerElement: L,
|
|
792
|
+
containerStyle: T,
|
|
793
793
|
defaultContainerSize: f,
|
|
794
794
|
defaultScrollOffset: v,
|
|
795
795
|
direction: "horizontal",
|
|
796
|
-
isRtl:
|
|
796
|
+
isRtl: _,
|
|
797
797
|
itemCount: s,
|
|
798
|
-
itemProps:
|
|
798
|
+
itemProps: k,
|
|
799
799
|
itemSize: n,
|
|
800
|
-
onResize:
|
|
801
|
-
overscanCount:
|
|
800
|
+
onResize: l,
|
|
801
|
+
overscanCount: p,
|
|
802
802
|
scrollElement: m
|
|
803
803
|
}), {
|
|
804
804
|
getCellBounds: re,
|
|
805
|
-
getEstimatedSize:
|
|
806
|
-
startIndexOverscan:
|
|
807
|
-
startIndexVisible:
|
|
808
|
-
getScrollPositionForIndex:
|
|
809
|
-
stopIndexOverscan:
|
|
805
|
+
getEstimatedSize: z,
|
|
806
|
+
startIndexOverscan: x,
|
|
807
|
+
startIndexVisible: A,
|
|
808
|
+
getScrollPositionForIndex: N,
|
|
809
|
+
stopIndexOverscan: W,
|
|
810
810
|
stopIndexVisible: D
|
|
811
|
-
} =
|
|
812
|
-
containerElement:
|
|
813
|
-
containerStyle:
|
|
814
|
-
defaultContainerSize:
|
|
811
|
+
} = pe({
|
|
812
|
+
containerElement: L,
|
|
813
|
+
containerStyle: T,
|
|
814
|
+
defaultContainerSize: d,
|
|
815
815
|
defaultScrollOffset: h,
|
|
816
816
|
direction: "vertical",
|
|
817
|
-
itemCount:
|
|
818
|
-
itemProps:
|
|
819
|
-
itemSize:
|
|
820
|
-
onResize:
|
|
821
|
-
overscanCount:
|
|
817
|
+
itemCount: b,
|
|
818
|
+
itemProps: k,
|
|
819
|
+
itemSize: S,
|
|
820
|
+
onResize: l,
|
|
821
|
+
overscanCount: p,
|
|
822
822
|
scrollElement: m
|
|
823
823
|
});
|
|
824
|
-
|
|
824
|
+
Me(
|
|
825
825
|
a,
|
|
826
826
|
() => ({
|
|
827
827
|
get element() {
|
|
828
|
-
return
|
|
828
|
+
return L;
|
|
829
829
|
},
|
|
830
830
|
scrollToCell({
|
|
831
|
-
behavior:
|
|
831
|
+
behavior: M = "auto",
|
|
832
832
|
columnAlign: y = "auto",
|
|
833
|
-
columnIndex:
|
|
834
|
-
rowAlign:
|
|
833
|
+
columnIndex: U,
|
|
834
|
+
rowAlign: j = "auto",
|
|
835
835
|
rowIndex: ee
|
|
836
836
|
}) {
|
|
837
|
-
const
|
|
837
|
+
const G = H({
|
|
838
838
|
align: y,
|
|
839
|
-
index:
|
|
840
|
-
}), oe =
|
|
841
|
-
align:
|
|
839
|
+
index: U
|
|
840
|
+
}), oe = N({
|
|
841
|
+
align: j,
|
|
842
842
|
index: ee
|
|
843
843
|
});
|
|
844
|
-
|
|
845
|
-
behavior:
|
|
846
|
-
left:
|
|
844
|
+
G && oe && G.scrollTarget === oe.scrollTarget ? ae(oe.scrollTarget, {
|
|
845
|
+
behavior: M,
|
|
846
|
+
left: G.scrollOffset,
|
|
847
847
|
top: oe.scrollOffset
|
|
848
|
-
}) : (
|
|
849
|
-
behavior:
|
|
850
|
-
left:
|
|
848
|
+
}) : (G && ae(G.scrollTarget, {
|
|
849
|
+
behavior: M,
|
|
850
|
+
left: G.scrollOffset
|
|
851
851
|
}), oe && ae(oe.scrollTarget, {
|
|
852
|
-
behavior:
|
|
852
|
+
behavior: M,
|
|
853
853
|
top: oe.scrollOffset
|
|
854
854
|
}));
|
|
855
855
|
},
|
|
856
856
|
scrollToColumn({
|
|
857
|
-
align:
|
|
857
|
+
align: M = "auto",
|
|
858
858
|
behavior: y = "auto",
|
|
859
|
-
index:
|
|
859
|
+
index: U
|
|
860
860
|
}) {
|
|
861
|
-
const
|
|
862
|
-
|
|
861
|
+
const j = H({ align: M, index: U });
|
|
862
|
+
j && ae(j.scrollTarget, {
|
|
863
863
|
behavior: y,
|
|
864
|
-
left:
|
|
864
|
+
left: j.scrollOffset
|
|
865
865
|
});
|
|
866
866
|
},
|
|
867
867
|
scrollToRow({
|
|
868
|
-
align:
|
|
868
|
+
align: M = "auto",
|
|
869
869
|
behavior: y = "auto",
|
|
870
|
-
index:
|
|
870
|
+
index: U
|
|
871
871
|
}) {
|
|
872
|
-
const
|
|
873
|
-
|
|
872
|
+
const j = N({ align: M, index: U });
|
|
873
|
+
j && ae(j.scrollTarget, {
|
|
874
874
|
behavior: y,
|
|
875
|
-
top:
|
|
875
|
+
top: j.scrollOffset
|
|
876
876
|
});
|
|
877
877
|
}
|
|
878
878
|
}),
|
|
879
|
-
[
|
|
879
|
+
[L, H, N]
|
|
880
880
|
), le(() => {
|
|
881
|
-
R >= 0 &&
|
|
881
|
+
R >= 0 && I >= 0 && x >= 0 && W >= 0 && c && c(
|
|
882
882
|
{
|
|
883
|
-
columnStartIndex:
|
|
883
|
+
columnStartIndex: O,
|
|
884
884
|
columnStopIndex: K,
|
|
885
|
-
rowStartIndex:
|
|
885
|
+
rowStartIndex: A,
|
|
886
886
|
rowStopIndex: D
|
|
887
887
|
},
|
|
888
888
|
{
|
|
889
889
|
columnStartIndex: R,
|
|
890
|
-
columnStopIndex:
|
|
891
|
-
rowStartIndex:
|
|
892
|
-
rowStopIndex:
|
|
890
|
+
columnStopIndex: I,
|
|
891
|
+
rowStartIndex: x,
|
|
892
|
+
rowStopIndex: W
|
|
893
893
|
}
|
|
894
894
|
);
|
|
895
895
|
}, [
|
|
896
|
-
|
|
896
|
+
c,
|
|
897
897
|
R,
|
|
898
|
-
I,
|
|
899
898
|
O,
|
|
899
|
+
I,
|
|
900
900
|
K,
|
|
901
|
-
|
|
902
|
-
M,
|
|
901
|
+
x,
|
|
903
902
|
A,
|
|
903
|
+
W,
|
|
904
904
|
D
|
|
905
905
|
]);
|
|
906
|
-
const
|
|
907
|
-
const
|
|
908
|
-
if (s > 0 &&
|
|
909
|
-
for (let y =
|
|
910
|
-
const
|
|
911
|
-
for (let ee = R; ee <=
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
|
|
906
|
+
const V = q(() => {
|
|
907
|
+
const M = [];
|
|
908
|
+
if (s > 0 && b > 0)
|
|
909
|
+
for (let y = x; y <= W; y++) {
|
|
910
|
+
const U = re(y), j = [];
|
|
911
|
+
for (let ee = R; ee <= I; ee++) {
|
|
912
|
+
const G = Q(ee);
|
|
913
|
+
j.push(
|
|
914
|
+
/* @__PURE__ */ he(
|
|
915
|
+
E,
|
|
916
916
|
{
|
|
917
|
-
...
|
|
917
|
+
...k,
|
|
918
918
|
ariaAttributes: {
|
|
919
919
|
"aria-colindex": ee + 1,
|
|
920
920
|
role: "gridcell"
|
|
@@ -922,73 +922,73 @@ function et({
|
|
|
922
922
|
columnIndex: ee,
|
|
923
923
|
key: i ? i({
|
|
924
924
|
columnIndex: ee,
|
|
925
|
-
data:
|
|
925
|
+
data: k,
|
|
926
926
|
rowIndex: y
|
|
927
927
|
}) : ee,
|
|
928
928
|
rowIndex: y,
|
|
929
929
|
style: {
|
|
930
930
|
position: "absolute",
|
|
931
|
-
left:
|
|
932
|
-
right:
|
|
933
|
-
transform: `translate(${
|
|
934
|
-
height:
|
|
935
|
-
width:
|
|
931
|
+
left: _ ? void 0 : 0,
|
|
932
|
+
right: _ ? 0 : void 0,
|
|
933
|
+
transform: `translate(${_ ? -G.scrollOffset : G.scrollOffset}px, ${U.scrollOffset}px)`,
|
|
934
|
+
height: U.size,
|
|
935
|
+
width: G.size
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
)
|
|
939
939
|
);
|
|
940
940
|
}
|
|
941
|
-
|
|
942
|
-
/* @__PURE__ */
|
|
941
|
+
M.push(
|
|
942
|
+
/* @__PURE__ */ ue(
|
|
943
943
|
"div",
|
|
944
944
|
{
|
|
945
945
|
role: "row",
|
|
946
946
|
"aria-rowindex": y + 1,
|
|
947
|
-
children:
|
|
947
|
+
children: j
|
|
948
948
|
},
|
|
949
|
-
|
|
950
|
-
data:
|
|
949
|
+
w ? w({
|
|
950
|
+
data: k,
|
|
951
951
|
rowIndex: y
|
|
952
952
|
}) : y
|
|
953
953
|
)
|
|
954
954
|
);
|
|
955
955
|
}
|
|
956
|
-
return
|
|
956
|
+
return M;
|
|
957
957
|
}, [
|
|
958
|
-
|
|
959
|
-
|
|
958
|
+
E,
|
|
959
|
+
k,
|
|
960
960
|
s,
|
|
961
961
|
i,
|
|
962
962
|
R,
|
|
963
|
-
|
|
963
|
+
I,
|
|
964
964
|
Q,
|
|
965
965
|
re,
|
|
966
|
-
|
|
966
|
+
_,
|
|
967
|
+
b,
|
|
967
968
|
w,
|
|
968
969
|
x,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
]), W = /* @__PURE__ */ de(
|
|
970
|
+
W
|
|
971
|
+
]), F = /* @__PURE__ */ ue(
|
|
972
972
|
"div",
|
|
973
973
|
{
|
|
974
974
|
"aria-hidden": !0,
|
|
975
975
|
style: {
|
|
976
|
-
height:
|
|
976
|
+
height: z(),
|
|
977
977
|
width: te(),
|
|
978
978
|
zIndex: -1
|
|
979
979
|
}
|
|
980
980
|
}
|
|
981
981
|
);
|
|
982
|
-
return
|
|
983
|
-
|
|
982
|
+
return he(
|
|
983
|
+
g,
|
|
984
984
|
{
|
|
985
985
|
"aria-colcount": s,
|
|
986
|
-
"aria-rowcount":
|
|
986
|
+
"aria-rowcount": b,
|
|
987
987
|
role: "grid",
|
|
988
|
-
...
|
|
988
|
+
...J,
|
|
989
989
|
className: o,
|
|
990
|
-
dir:
|
|
991
|
-
ref:
|
|
990
|
+
dir: u,
|
|
991
|
+
ref: $,
|
|
992
992
|
style: {
|
|
993
993
|
position: "relative",
|
|
994
994
|
// Grids that scroll with an outer element render at their full height,
|
|
@@ -999,20 +999,24 @@ function et({
|
|
|
999
999
|
},
|
|
1000
1000
|
flexGrow: 1,
|
|
1001
1001
|
overflow: "auto",
|
|
1002
|
-
...
|
|
1002
|
+
...T
|
|
1003
1003
|
}
|
|
1004
1004
|
},
|
|
1005
|
-
|
|
1005
|
+
V,
|
|
1006
1006
|
r,
|
|
1007
|
-
|
|
1007
|
+
F
|
|
1008
1008
|
);
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1010
|
+
const ot = C, nt = P, ke = "data-react-window-index", Ze = "data-index";
|
|
1011
1011
|
function ge(e) {
|
|
1012
|
-
const t = e.getAttribute(
|
|
1012
|
+
const t = e.getAttribute(ke) ?? e.getAttribute(Ze);
|
|
1013
1013
|
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
1014
1014
|
}
|
|
1015
|
-
|
|
1015
|
+
const Je = 1e3, ze = 500;
|
|
1016
|
+
function Qe(e) {
|
|
1017
|
+
return 1 - Math.pow(1 - e, 3);
|
|
1018
|
+
}
|
|
1019
|
+
function Ne({
|
|
1016
1020
|
direction: e,
|
|
1017
1021
|
element: t,
|
|
1018
1022
|
getCellBounds: r,
|
|
@@ -1020,65 +1024,81 @@ function ke({
|
|
|
1020
1024
|
itemCount: s,
|
|
1021
1025
|
itemElements: i,
|
|
1022
1026
|
scrollTarget: n,
|
|
1023
|
-
getScrollPositionForIndex:
|
|
1027
|
+
getScrollPositionForIndex: d
|
|
1024
1028
|
}) {
|
|
1025
|
-
const v = e === "vertical", h =
|
|
1029
|
+
const v = e === "vertical", h = P(null), f = P(
|
|
1026
1030
|
void 0
|
|
1027
|
-
),
|
|
1031
|
+
), u = ie(() => {
|
|
1028
1032
|
h.current = null, f.current !== void 0 && (f.current.view.cancelAnimationFrame(f.current.id), f.current = void 0);
|
|
1029
1033
|
}), a = ie(() => {
|
|
1030
|
-
const
|
|
1034
|
+
const l = Z(t);
|
|
1031
1035
|
f.current = {
|
|
1032
|
-
id:
|
|
1033
|
-
view:
|
|
1036
|
+
id: l.requestAnimationFrame(c),
|
|
1037
|
+
view: l
|
|
1034
1038
|
};
|
|
1035
|
-
}),
|
|
1039
|
+
}), c = ie(() => {
|
|
1036
1040
|
f.current = void 0;
|
|
1037
|
-
const
|
|
1038
|
-
if (!
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
+
const l = h.current;
|
|
1042
|
+
if (!l) return;
|
|
1043
|
+
const p = performance.now();
|
|
1044
|
+
if (!t || !o || l.index >= s || l.animation !== void 0 && p >= l.animation.deadline) {
|
|
1045
|
+
u();
|
|
1041
1046
|
return;
|
|
1042
1047
|
}
|
|
1043
|
-
const
|
|
1044
|
-
align:
|
|
1045
|
-
index:
|
|
1048
|
+
const b = d({
|
|
1049
|
+
align: l.align,
|
|
1050
|
+
index: l.index
|
|
1046
1051
|
});
|
|
1047
|
-
if (
|
|
1048
|
-
const { scrollOffset:
|
|
1052
|
+
if (b !== void 0) {
|
|
1053
|
+
const { scrollOffset: S, scrollTarget: w } = b, m = Math.max(
|
|
1049
1054
|
0,
|
|
1050
|
-
Math.min(
|
|
1055
|
+
Math.min(S, je(w, e))
|
|
1051
1056
|
);
|
|
1052
|
-
if (
|
|
1053
|
-
|
|
1057
|
+
if (l.animation === void 0) {
|
|
1058
|
+
const g = l.smooth ? ze : 0;
|
|
1059
|
+
l.animation = {
|
|
1060
|
+
deadline: p + g + Je,
|
|
1061
|
+
startOffset: de(w, e),
|
|
1062
|
+
startTime: p
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
const T = l.smooth ? (p - l.animation.startTime) / ze : 1;
|
|
1066
|
+
if (T < 1) {
|
|
1067
|
+
const { startOffset: g } = l.animation;
|
|
1068
|
+
l.stableFrames = 0, w.scrollTo({
|
|
1054
1069
|
behavior: "instant",
|
|
1055
|
-
[v ? "top" : "left"]:
|
|
1070
|
+
[v ? "top" : "left"]: g + (m - g) * Qe(T)
|
|
1071
|
+
});
|
|
1072
|
+
} else if (Math.abs(m - de(w, e)) > 1)
|
|
1073
|
+
l.stableFrames = 0, w.scrollTo({
|
|
1074
|
+
behavior: "instant",
|
|
1075
|
+
[v ? "top" : "left"]: m
|
|
1056
1076
|
});
|
|
1057
1077
|
else {
|
|
1058
|
-
const
|
|
1059
|
-
if (!(
|
|
1060
|
-
(
|
|
1061
|
-
) &&
|
|
1062
|
-
const L = ge(
|
|
1078
|
+
const g = i.current;
|
|
1079
|
+
if (!(g.some(
|
|
1080
|
+
(E) => ge(E) === l.index
|
|
1081
|
+
) && g.every((E) => {
|
|
1082
|
+
const L = ge(E);
|
|
1063
1083
|
if (L === void 0 || L >= s)
|
|
1064
1084
|
return !0;
|
|
1065
|
-
const
|
|
1066
|
-
return Math.abs(r(L).size -
|
|
1085
|
+
const $ = v ? E.offsetHeight : E.offsetWidth;
|
|
1086
|
+
return Math.abs(r(L).size - $) <= 1;
|
|
1067
1087
|
})))
|
|
1068
|
-
|
|
1069
|
-
else if (++
|
|
1070
|
-
|
|
1088
|
+
l.stableFrames = 0;
|
|
1089
|
+
else if (++l.stableFrames >= 2) {
|
|
1090
|
+
u();
|
|
1071
1091
|
return;
|
|
1072
1092
|
}
|
|
1073
1093
|
}
|
|
1074
1094
|
}
|
|
1075
1095
|
a();
|
|
1076
1096
|
});
|
|
1077
|
-
return
|
|
1078
|
-
const
|
|
1079
|
-
if (!
|
|
1080
|
-
const
|
|
1081
|
-
switch (
|
|
1097
|
+
return B(() => {
|
|
1098
|
+
const l = n ?? t;
|
|
1099
|
+
if (!l) return;
|
|
1100
|
+
const p = (b) => {
|
|
1101
|
+
switch (b.key) {
|
|
1082
1102
|
case "ArrowUp":
|
|
1083
1103
|
case "ArrowDown":
|
|
1084
1104
|
case "ArrowLeft":
|
|
@@ -1088,47 +1108,53 @@ function ke({
|
|
|
1088
1108
|
case "Home":
|
|
1089
1109
|
case "End":
|
|
1090
1110
|
case " ":
|
|
1091
|
-
|
|
1111
|
+
u();
|
|
1092
1112
|
}
|
|
1093
1113
|
};
|
|
1094
|
-
return
|
|
1095
|
-
|
|
1114
|
+
return l.addEventListener("wheel", u, { passive: !0 }), l.addEventListener("touchstart", u, { passive: !0 }), l.addEventListener("pointerdown", u), l.addEventListener("keydown", p), () => {
|
|
1115
|
+
u(), l.removeEventListener("wheel", u), l.removeEventListener("touchstart", u), l.removeEventListener("pointerdown", u), l.removeEventListener("keydown", p);
|
|
1096
1116
|
};
|
|
1097
|
-
}, [
|
|
1117
|
+
}, [u, t, n]), X(
|
|
1098
1118
|
({
|
|
1099
|
-
align:
|
|
1100
|
-
behavior:
|
|
1101
|
-
index:
|
|
1119
|
+
align: l = "auto",
|
|
1120
|
+
behavior: p = "auto",
|
|
1121
|
+
index: b
|
|
1102
1122
|
}) => {
|
|
1103
|
-
if (o &&
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1123
|
+
if (o && l === "smart") {
|
|
1124
|
+
const w = d({ align: "auto", index: b });
|
|
1125
|
+
l = w === void 0 || w.scrollOffset === de(w.scrollTarget, e) ? "auto" : "center";
|
|
1106
1126
|
}
|
|
1107
|
-
const
|
|
1108
|
-
if (
|
|
1109
|
-
const { scrollOffset:
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1127
|
+
const S = d({ align: l, index: b });
|
|
1128
|
+
if (u(), S && typeof S.scrollTarget.scrollTo == "function") {
|
|
1129
|
+
const { scrollOffset: w, scrollTarget: m } = S;
|
|
1130
|
+
if (o) {
|
|
1131
|
+
const T = p === "smooth" && t?.ownerDocument.visibilityState !== "hidden";
|
|
1132
|
+
if (h.current = {
|
|
1133
|
+
align: l,
|
|
1134
|
+
index: b,
|
|
1135
|
+
smooth: T,
|
|
1136
|
+
stableFrames: 0
|
|
1137
|
+
}, a(), T)
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
m.scrollTo({
|
|
1141
|
+
behavior: o ? "instant" : p,
|
|
1142
|
+
[v ? "top" : "left"]: w
|
|
1118
1143
|
});
|
|
1119
1144
|
}
|
|
1120
1145
|
},
|
|
1121
1146
|
[
|
|
1122
|
-
|
|
1147
|
+
u,
|
|
1123
1148
|
e,
|
|
1149
|
+
t,
|
|
1124
1150
|
o,
|
|
1125
1151
|
v,
|
|
1126
1152
|
a,
|
|
1127
|
-
|
|
1153
|
+
d
|
|
1128
1154
|
]
|
|
1129
1155
|
);
|
|
1130
1156
|
}
|
|
1131
|
-
function
|
|
1157
|
+
function Ke({
|
|
1132
1158
|
callback: e,
|
|
1133
1159
|
element: t,
|
|
1134
1160
|
enabled: r = !0
|
|
@@ -1137,7 +1163,7 @@ function Ze({
|
|
|
1137
1163
|
le(() => {
|
|
1138
1164
|
if (!r || !t)
|
|
1139
1165
|
return;
|
|
1140
|
-
const s =
|
|
1166
|
+
const s = Z(t);
|
|
1141
1167
|
let i = s.requestAnimationFrame(() => {
|
|
1142
1168
|
i = s.requestAnimationFrame(o);
|
|
1143
1169
|
});
|
|
@@ -1146,11 +1172,11 @@ function Ze({
|
|
|
1146
1172
|
};
|
|
1147
1173
|
}, [t, r, o]);
|
|
1148
1174
|
}
|
|
1149
|
-
function
|
|
1175
|
+
function ve(e) {
|
|
1150
1176
|
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1151
1177
|
}
|
|
1152
|
-
const
|
|
1153
|
-
function
|
|
1178
|
+
const ye = "data-react-window-sizer";
|
|
1179
|
+
function it({
|
|
1154
1180
|
children: e,
|
|
1155
1181
|
className: t,
|
|
1156
1182
|
defaultHeight: r = 0,
|
|
@@ -1158,283 +1184,283 @@ function rt({
|
|
|
1158
1184
|
listRef: s,
|
|
1159
1185
|
onResize: i,
|
|
1160
1186
|
onRowsRendered: n,
|
|
1161
|
-
overscanCount:
|
|
1187
|
+
overscanCount: d = 3,
|
|
1162
1188
|
rowComponent: v,
|
|
1163
1189
|
rowCount: h,
|
|
1164
1190
|
rowHeight: f,
|
|
1165
|
-
rowKey:
|
|
1191
|
+
rowKey: u,
|
|
1166
1192
|
rowProps: a,
|
|
1167
|
-
scrollElement:
|
|
1168
|
-
tagName:
|
|
1169
|
-
style:
|
|
1170
|
-
...
|
|
1193
|
+
scrollElement: c,
|
|
1194
|
+
tagName: l = "div",
|
|
1195
|
+
style: p,
|
|
1196
|
+
...b
|
|
1171
1197
|
}) {
|
|
1172
|
-
const
|
|
1173
|
-
() =>
|
|
1198
|
+
const S = Fe(a), w = q(
|
|
1199
|
+
() => Le(v, He),
|
|
1174
1200
|
[v]
|
|
1175
|
-
), [m,
|
|
1176
|
-
() =>
|
|
1177
|
-
),
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}, [
|
|
1181
|
-
callback: () =>
|
|
1201
|
+
), [m, T] = C(null), g = ve(f), J = q(() => g ? (V) => f.getRowHeight(V) ?? f.getAverageRowHeight() : f, [g, f]), k = We(), [E, L] = C(
|
|
1202
|
+
() => k && g
|
|
1203
|
+
), $ = P(f);
|
|
1204
|
+
B(() => {
|
|
1205
|
+
E && $.current !== f && L(!1);
|
|
1206
|
+
}, [E, f]), Ke({
|
|
1207
|
+
callback: () => L(!1),
|
|
1182
1208
|
element: m,
|
|
1183
|
-
enabled:
|
|
1209
|
+
enabled: E
|
|
1184
1210
|
});
|
|
1185
1211
|
const {
|
|
1186
|
-
getCellBounds:
|
|
1212
|
+
getCellBounds: _,
|
|
1187
1213
|
getEstimatedSize: Q,
|
|
1188
1214
|
scrollTarget: te,
|
|
1189
1215
|
getScrollPositionForIndex: R,
|
|
1190
|
-
startIndexOverscan:
|
|
1216
|
+
startIndexOverscan: O,
|
|
1191
1217
|
startIndexVisible: H,
|
|
1192
|
-
stopIndexOverscan:
|
|
1218
|
+
stopIndexOverscan: I,
|
|
1193
1219
|
stopIndexVisible: K
|
|
1194
|
-
} =
|
|
1220
|
+
} = pe({
|
|
1195
1221
|
containerElement: m,
|
|
1196
|
-
containerStyle:
|
|
1222
|
+
containerStyle: p,
|
|
1197
1223
|
defaultContainerSize: r,
|
|
1198
1224
|
defaultScrollOffset: o,
|
|
1199
1225
|
direction: "vertical",
|
|
1200
1226
|
itemCount: h,
|
|
1201
|
-
itemProps:
|
|
1202
|
-
itemSize:
|
|
1227
|
+
itemProps: S,
|
|
1228
|
+
itemSize: J,
|
|
1203
1229
|
onResize: i,
|
|
1204
|
-
overscanCount:
|
|
1205
|
-
scrollElement:
|
|
1206
|
-
}), re =
|
|
1230
|
+
overscanCount: d,
|
|
1231
|
+
scrollElement: c
|
|
1232
|
+
}), re = P([]), z = Ne({
|
|
1207
1233
|
direction: "vertical",
|
|
1208
1234
|
element: m,
|
|
1209
|
-
getCellBounds:
|
|
1210
|
-
isDynamicSize:
|
|
1235
|
+
getCellBounds: _,
|
|
1236
|
+
isDynamicSize: g,
|
|
1211
1237
|
itemCount: h,
|
|
1212
1238
|
itemElements: re,
|
|
1213
1239
|
scrollTarget: te,
|
|
1214
1240
|
getScrollPositionForIndex: R
|
|
1215
1241
|
});
|
|
1216
|
-
|
|
1242
|
+
Me(
|
|
1217
1243
|
s,
|
|
1218
1244
|
() => ({
|
|
1219
1245
|
get element() {
|
|
1220
1246
|
return m;
|
|
1221
1247
|
},
|
|
1222
|
-
scrollToRow:
|
|
1248
|
+
scrollToRow: z
|
|
1223
1249
|
}),
|
|
1224
|
-
[m,
|
|
1225
|
-
),
|
|
1250
|
+
[m, z]
|
|
1251
|
+
), B(() => {
|
|
1226
1252
|
if (!m)
|
|
1227
1253
|
return;
|
|
1228
|
-
const
|
|
1254
|
+
const V = Array.from(m.children).slice(
|
|
1229
1255
|
0,
|
|
1230
|
-
|
|
1231
|
-
).filter((
|
|
1232
|
-
if (
|
|
1256
|
+
O < 0 ? 0 : I - O + 1
|
|
1257
|
+
).filter((F, M) => {
|
|
1258
|
+
if (F.hasAttribute(ye))
|
|
1233
1259
|
return !1;
|
|
1234
|
-
const y = `${
|
|
1235
|
-
return
|
|
1260
|
+
const y = `${O + M}`;
|
|
1261
|
+
return F.setAttribute(ke, y), !0;
|
|
1236
1262
|
});
|
|
1237
|
-
if (re.current =
|
|
1238
|
-
return f.observeRowElements(
|
|
1263
|
+
if (re.current = V, g)
|
|
1264
|
+
return f.observeRowElements(V);
|
|
1239
1265
|
}, [
|
|
1240
|
-
|
|
1266
|
+
w,
|
|
1241
1267
|
m,
|
|
1242
|
-
|
|
1268
|
+
g,
|
|
1243
1269
|
h,
|
|
1244
1270
|
f,
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1271
|
+
u,
|
|
1272
|
+
S,
|
|
1273
|
+
O,
|
|
1274
|
+
I
|
|
1249
1275
|
]), le(() => {
|
|
1250
|
-
|
|
1276
|
+
O >= 0 && I >= 0 && n && n(
|
|
1251
1277
|
{
|
|
1252
1278
|
startIndex: H,
|
|
1253
1279
|
stopIndex: K
|
|
1254
1280
|
},
|
|
1255
1281
|
{
|
|
1256
|
-
startIndex:
|
|
1257
|
-
stopIndex:
|
|
1282
|
+
startIndex: O,
|
|
1283
|
+
stopIndex: I
|
|
1258
1284
|
}
|
|
1259
1285
|
);
|
|
1260
1286
|
}, [
|
|
1261
1287
|
n,
|
|
1262
|
-
I,
|
|
1263
|
-
H,
|
|
1264
1288
|
O,
|
|
1289
|
+
H,
|
|
1290
|
+
I,
|
|
1265
1291
|
K
|
|
1266
1292
|
]);
|
|
1267
|
-
const
|
|
1268
|
-
const
|
|
1293
|
+
const x = E && g && O === 0, A = q(() => {
|
|
1294
|
+
const V = [];
|
|
1269
1295
|
if (h > 0)
|
|
1270
|
-
for (let
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
|
|
1296
|
+
for (let F = O; F <= I; F++) {
|
|
1297
|
+
const M = _(F);
|
|
1298
|
+
V.push(
|
|
1299
|
+
/* @__PURE__ */ he(
|
|
1300
|
+
w,
|
|
1275
1301
|
{
|
|
1276
|
-
...
|
|
1302
|
+
...S,
|
|
1277
1303
|
ariaAttributes: {
|
|
1278
|
-
"aria-posinset":
|
|
1304
|
+
"aria-posinset": F + 1,
|
|
1279
1305
|
"aria-setsize": h,
|
|
1280
1306
|
role: "listitem"
|
|
1281
1307
|
},
|
|
1282
|
-
key:
|
|
1283
|
-
index:
|
|
1284
|
-
style:
|
|
1308
|
+
key: u ? u(F, S) : F,
|
|
1309
|
+
index: F,
|
|
1310
|
+
style: x ? { width: "100%" } : {
|
|
1285
1311
|
position: "absolute",
|
|
1286
1312
|
left: 0,
|
|
1287
|
-
transform: `translateY(${
|
|
1313
|
+
transform: `translateY(${M.scrollOffset}px)`,
|
|
1288
1314
|
// In case of dynamic row heights, don't specify a height style
|
|
1289
1315
|
// otherwise a default/estimated height would mask the actual height
|
|
1290
|
-
height:
|
|
1316
|
+
height: g ? void 0 : M.size,
|
|
1291
1317
|
width: "100%"
|
|
1292
1318
|
}
|
|
1293
1319
|
}
|
|
1294
1320
|
)
|
|
1295
1321
|
);
|
|
1296
1322
|
}
|
|
1297
|
-
return
|
|
1323
|
+
return V;
|
|
1298
1324
|
}, [
|
|
1325
|
+
w,
|
|
1326
|
+
_,
|
|
1327
|
+
g,
|
|
1299
1328
|
x,
|
|
1300
|
-
P,
|
|
1301
|
-
z,
|
|
1302
|
-
p,
|
|
1303
1329
|
h,
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
]),
|
|
1330
|
+
u,
|
|
1331
|
+
S,
|
|
1332
|
+
O,
|
|
1333
|
+
I
|
|
1334
|
+
]), N = /* @__PURE__ */ ue(
|
|
1309
1335
|
"div",
|
|
1310
1336
|
{
|
|
1311
1337
|
"aria-hidden": !0,
|
|
1312
|
-
[
|
|
1338
|
+
[ye]: "",
|
|
1313
1339
|
style: {
|
|
1314
1340
|
// Rows rendered in flow layout already take up space
|
|
1315
|
-
position:
|
|
1316
|
-
top:
|
|
1341
|
+
position: x ? "absolute" : void 0,
|
|
1342
|
+
top: x ? 0 : void 0,
|
|
1317
1343
|
height: Q(),
|
|
1318
1344
|
width: "100%",
|
|
1319
1345
|
zIndex: -1
|
|
1320
1346
|
}
|
|
1321
1347
|
},
|
|
1322
1348
|
"sizer"
|
|
1323
|
-
),
|
|
1324
|
-
return
|
|
1325
|
-
|
|
1349
|
+
), W = /* @__PURE__ */ ue(be, { children: e }, "children"), D = /* @__PURE__ */ ue(be, { children: A }, "rows");
|
|
1350
|
+
return he(
|
|
1351
|
+
l,
|
|
1326
1352
|
{
|
|
1327
1353
|
role: "list",
|
|
1328
|
-
...
|
|
1354
|
+
...b,
|
|
1329
1355
|
className: t,
|
|
1330
|
-
ref:
|
|
1356
|
+
ref: T,
|
|
1331
1357
|
style: {
|
|
1332
1358
|
position: "relative",
|
|
1333
1359
|
flexGrow: 1,
|
|
1334
1360
|
// Lists that scroll with an outer element render at their full height (and must not clip sticky rows)
|
|
1335
|
-
...
|
|
1361
|
+
...c === void 0 && {
|
|
1336
1362
|
maxHeight: "100%",
|
|
1337
1363
|
overflowY: "auto"
|
|
1338
1364
|
},
|
|
1339
|
-
...
|
|
1365
|
+
...p
|
|
1340
1366
|
}
|
|
1341
1367
|
},
|
|
1342
|
-
...
|
|
1343
|
-
|
|
1368
|
+
...x ? [W, D] : [D, W],
|
|
1369
|
+
N
|
|
1344
1370
|
);
|
|
1345
1371
|
}
|
|
1346
|
-
function
|
|
1372
|
+
function Re(e) {
|
|
1347
1373
|
const t = /* @__PURE__ */ new Map();
|
|
1348
1374
|
return e !== void 0 && e.forEach((r, o) => {
|
|
1349
1375
|
Number.isFinite(r) && r > 0 && t.set(o, r);
|
|
1350
1376
|
}), t;
|
|
1351
1377
|
}
|
|
1352
|
-
function
|
|
1378
|
+
function lt({
|
|
1353
1379
|
defaultRowHeight: e,
|
|
1354
1380
|
initialRowHeights: t,
|
|
1355
1381
|
key: r
|
|
1356
1382
|
}) {
|
|
1357
|
-
const [o, s] =
|
|
1383
|
+
const [o, s] = C(() => ({
|
|
1358
1384
|
key: r,
|
|
1359
|
-
map:
|
|
1385
|
+
map: Re(t)
|
|
1360
1386
|
}));
|
|
1361
1387
|
o.key !== r && s({
|
|
1362
1388
|
key: r,
|
|
1363
|
-
map:
|
|
1389
|
+
map: Re(t)
|
|
1364
1390
|
});
|
|
1365
|
-
const { map: i } = o, n =
|
|
1391
|
+
const { map: i } = o, n = X(() => {
|
|
1366
1392
|
let a = 0;
|
|
1367
|
-
return i.forEach((
|
|
1368
|
-
a +=
|
|
1393
|
+
return i.forEach((c) => {
|
|
1394
|
+
a += c;
|
|
1369
1395
|
}), a === 0 ? e : a / i.size;
|
|
1370
|
-
}, [e, i]),
|
|
1396
|
+
}, [e, i]), d = X(
|
|
1371
1397
|
(a) => {
|
|
1372
|
-
const
|
|
1373
|
-
return
|
|
1398
|
+
const c = i.get(a);
|
|
1399
|
+
return c !== void 0 ? c : e;
|
|
1374
1400
|
},
|
|
1375
1401
|
[e, i]
|
|
1376
|
-
), v =
|
|
1377
|
-
s((
|
|
1378
|
-
if (
|
|
1379
|
-
return
|
|
1380
|
-
const
|
|
1381
|
-
return
|
|
1382
|
-
...
|
|
1383
|
-
map:
|
|
1402
|
+
), v = X((a, c) => {
|
|
1403
|
+
s((l) => {
|
|
1404
|
+
if (l.map.get(a) === c)
|
|
1405
|
+
return l;
|
|
1406
|
+
const p = new Map(l.map);
|
|
1407
|
+
return p.set(a, c), {
|
|
1408
|
+
...l,
|
|
1409
|
+
map: p
|
|
1384
1410
|
};
|
|
1385
1411
|
});
|
|
1386
1412
|
}, []), h = ie(
|
|
1387
1413
|
(a) => {
|
|
1388
|
-
a.length !== 0 && a.forEach((
|
|
1389
|
-
const { borderBoxSize:
|
|
1390
|
-
if (
|
|
1414
|
+
a.length !== 0 && a.forEach((c) => {
|
|
1415
|
+
const { borderBoxSize: l, target: p } = c, b = ge(p);
|
|
1416
|
+
if (b === void 0)
|
|
1391
1417
|
return;
|
|
1392
|
-
const { blockSize:
|
|
1393
|
-
|
|
1418
|
+
const { blockSize: S } = l[0];
|
|
1419
|
+
S && v(b, S);
|
|
1394
1420
|
});
|
|
1395
1421
|
}
|
|
1396
|
-
), f =
|
|
1422
|
+
), f = P(null);
|
|
1397
1423
|
le(
|
|
1398
1424
|
() => () => {
|
|
1399
1425
|
f.current?.resizeObserver.disconnect(), f.current = null;
|
|
1400
1426
|
},
|
|
1401
1427
|
[]
|
|
1402
1428
|
);
|
|
1403
|
-
const
|
|
1429
|
+
const u = X(
|
|
1404
1430
|
(a) => {
|
|
1405
|
-
const
|
|
1406
|
-
return a.forEach((
|
|
1407
|
-
const
|
|
1408
|
-
if (f.current?.view !==
|
|
1431
|
+
const c = [];
|
|
1432
|
+
return a.forEach((l) => {
|
|
1433
|
+
const p = Z(l);
|
|
1434
|
+
if (f.current?.view !== p) {
|
|
1409
1435
|
f.current?.resizeObserver.disconnect();
|
|
1410
|
-
const
|
|
1411
|
-
f.current =
|
|
1412
|
-
resizeObserver: new
|
|
1413
|
-
view:
|
|
1436
|
+
const S = we(l);
|
|
1437
|
+
f.current = S ? {
|
|
1438
|
+
resizeObserver: new S(h),
|
|
1439
|
+
view: p
|
|
1414
1440
|
} : null;
|
|
1415
1441
|
}
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1442
|
+
const b = f.current?.resizeObserver;
|
|
1443
|
+
b && (b.observe(l), c.push([l, b]));
|
|
1418
1444
|
}), () => {
|
|
1419
|
-
|
|
1420
|
-
([
|
|
1445
|
+
c.forEach(
|
|
1446
|
+
([l, p]) => p.unobserve(l)
|
|
1421
1447
|
);
|
|
1422
1448
|
};
|
|
1423
1449
|
},
|
|
1424
1450
|
[h]
|
|
1425
1451
|
);
|
|
1426
|
-
return
|
|
1452
|
+
return q(
|
|
1427
1453
|
() => ({
|
|
1428
1454
|
getAverageRowHeight: n,
|
|
1429
|
-
getRowHeight:
|
|
1455
|
+
getRowHeight: d,
|
|
1430
1456
|
setRowHeight: v,
|
|
1431
|
-
observeRowElements:
|
|
1457
|
+
observeRowElements: u
|
|
1432
1458
|
}),
|
|
1433
|
-
[n,
|
|
1459
|
+
[n, d, v, u]
|
|
1434
1460
|
);
|
|
1435
1461
|
}
|
|
1436
|
-
const
|
|
1437
|
-
function
|
|
1462
|
+
const ct = C, at = P, et = {};
|
|
1463
|
+
function ft({
|
|
1438
1464
|
count: e,
|
|
1439
1465
|
defaultScrollOffset: t = 0,
|
|
1440
1466
|
defaultSize: r = 0,
|
|
@@ -1442,160 +1468,160 @@ function lt({
|
|
|
1442
1468
|
direction: s = "vertical",
|
|
1443
1469
|
element: i,
|
|
1444
1470
|
itemSize: n,
|
|
1445
|
-
onItemsRendered:
|
|
1471
|
+
onItemsRendered: d,
|
|
1446
1472
|
overscanCount: v = 3,
|
|
1447
1473
|
scrollElement: h
|
|
1448
1474
|
}) {
|
|
1449
|
-
const f =
|
|
1450
|
-
|
|
1475
|
+
const f = ve(n);
|
|
1476
|
+
Y(
|
|
1451
1477
|
!f || s === "vertical",
|
|
1452
1478
|
"Dynamic item sizes are only supported for vertical content"
|
|
1453
1479
|
);
|
|
1454
|
-
const
|
|
1455
|
-
getCellBounds:
|
|
1456
|
-
getEstimatedSize:
|
|
1457
|
-
scrollTarget:
|
|
1458
|
-
getScrollPositionForIndex:
|
|
1459
|
-
startIndexOverscan:
|
|
1460
|
-
startIndexVisible:
|
|
1480
|
+
const u = q(() => ve(n) ? (R) => n.getRowHeight(R) ?? n.getAverageRowHeight() : n, [n]), a = Ee(i, o), {
|
|
1481
|
+
getCellBounds: c,
|
|
1482
|
+
getEstimatedSize: l,
|
|
1483
|
+
scrollTarget: p,
|
|
1484
|
+
getScrollPositionForIndex: b,
|
|
1485
|
+
startIndexOverscan: S,
|
|
1486
|
+
startIndexVisible: w,
|
|
1461
1487
|
stopIndexOverscan: m,
|
|
1462
|
-
stopIndexVisible:
|
|
1463
|
-
} =
|
|
1488
|
+
stopIndexVisible: T
|
|
1489
|
+
} = pe({
|
|
1464
1490
|
containerElement: i,
|
|
1465
1491
|
defaultContainerSize: r,
|
|
1466
1492
|
defaultScrollOffset: t,
|
|
1467
1493
|
direction: s,
|
|
1468
1494
|
isRtl: s === "horizontal" && a,
|
|
1469
1495
|
itemCount: e,
|
|
1470
|
-
itemProps:
|
|
1471
|
-
itemSize:
|
|
1496
|
+
itemProps: et,
|
|
1497
|
+
itemSize: u,
|
|
1472
1498
|
onResize: void 0,
|
|
1473
1499
|
overscanCount: v,
|
|
1474
1500
|
scrollElement: h
|
|
1475
|
-
}),
|
|
1476
|
-
R !== null &&
|
|
1477
|
-
}, []),
|
|
1478
|
-
|
|
1479
|
-
const R =
|
|
1480
|
-
|
|
1481
|
-
if (!
|
|
1482
|
-
R.delete(
|
|
1501
|
+
}), g = P(/* @__PURE__ */ new Set()), J = P(/* @__PURE__ */ new WeakSet()), k = P([]), E = P({ dynamicRowHeight: null, unobserve: /* @__PURE__ */ new Map() }), L = X((R) => {
|
|
1502
|
+
R !== null && g.current.add(R);
|
|
1503
|
+
}, []), $ = i;
|
|
1504
|
+
B(() => {
|
|
1505
|
+
const R = g.current, O = E.current, H = ve(n) ? n : null;
|
|
1506
|
+
O.dynamicRowHeight?.observeRowElements !== H?.observeRowElements && (O.unobserve.forEach((I) => I()), O.unobserve.clear()), O.dynamicRowHeight = H, R.forEach((I) => {
|
|
1507
|
+
if (!I.isConnected)
|
|
1508
|
+
R.delete(I), O.unobserve.get(I)?.(), O.unobserve.delete(I);
|
|
1483
1509
|
else if (H && // Like List, measure items once the element has mounted
|
|
1484
1510
|
// (e.g. so the dynamic row height cache has finished mounting too)
|
|
1485
|
-
|
|
1486
|
-
if (ge(
|
|
1487
|
-
|
|
1511
|
+
$ !== null && !O.unobserve.has(I)) {
|
|
1512
|
+
if (ge(I) === void 0) {
|
|
1513
|
+
J.current.has(I) || (J.current.add(I), console.warn(
|
|
1488
1514
|
"useVirtualizer: Items passed to measureElement must specify their index with a data-index attribute",
|
|
1489
|
-
|
|
1515
|
+
I
|
|
1490
1516
|
));
|
|
1491
1517
|
return;
|
|
1492
1518
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
H.observeRowElements([
|
|
1519
|
+
O.unobserve.set(
|
|
1520
|
+
I,
|
|
1521
|
+
H.observeRowElements([I])
|
|
1496
1522
|
);
|
|
1497
1523
|
}
|
|
1498
|
-
}),
|
|
1524
|
+
}), k.current = Array.from(R);
|
|
1499
1525
|
}), le(() => {
|
|
1500
|
-
const R =
|
|
1526
|
+
const R = E.current;
|
|
1501
1527
|
return () => {
|
|
1502
|
-
R.unobserve.forEach((
|
|
1528
|
+
R.unobserve.forEach((O) => O()), R.unobserve.clear(), R.dynamicRowHeight = null;
|
|
1503
1529
|
};
|
|
1504
1530
|
}, []);
|
|
1505
|
-
const
|
|
1531
|
+
const _ = Ne({
|
|
1506
1532
|
direction: s,
|
|
1507
1533
|
element: i,
|
|
1508
|
-
getCellBounds:
|
|
1534
|
+
getCellBounds: c,
|
|
1509
1535
|
isDynamicSize: f,
|
|
1510
1536
|
itemCount: e,
|
|
1511
|
-
itemElements:
|
|
1512
|
-
scrollTarget:
|
|
1513
|
-
getScrollPositionForIndex:
|
|
1537
|
+
itemElements: k,
|
|
1538
|
+
scrollTarget: p,
|
|
1539
|
+
getScrollPositionForIndex: b
|
|
1514
1540
|
});
|
|
1515
1541
|
le(() => {
|
|
1516
|
-
|
|
1517
|
-
{ startIndex:
|
|
1518
|
-
{ startIndex:
|
|
1542
|
+
S >= 0 && m >= 0 && d && d(
|
|
1543
|
+
{ startIndex: w, stopIndex: T },
|
|
1544
|
+
{ startIndex: S, stopIndex: m }
|
|
1519
1545
|
);
|
|
1520
1546
|
}, [
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1547
|
+
d,
|
|
1548
|
+
S,
|
|
1549
|
+
w,
|
|
1524
1550
|
m,
|
|
1525
|
-
|
|
1551
|
+
T
|
|
1526
1552
|
]);
|
|
1527
|
-
const Q =
|
|
1553
|
+
const Q = q(() => {
|
|
1528
1554
|
const R = [];
|
|
1529
1555
|
if (e > 0)
|
|
1530
|
-
for (let
|
|
1531
|
-
const { scrollOffset: H, size:
|
|
1532
|
-
R.push({ index:
|
|
1556
|
+
for (let O = S; O <= m; O++) {
|
|
1557
|
+
const { scrollOffset: H, size: I } = c(O);
|
|
1558
|
+
R.push({ index: O, offset: H, size: I });
|
|
1533
1559
|
}
|
|
1534
1560
|
return R;
|
|
1535
|
-
}, [e,
|
|
1536
|
-
return
|
|
1561
|
+
}, [e, c, S, m]), te = l();
|
|
1562
|
+
return q(
|
|
1537
1563
|
() => ({
|
|
1538
1564
|
items: Q,
|
|
1539
|
-
measureElement:
|
|
1540
|
-
scrollToIndex:
|
|
1565
|
+
measureElement: L,
|
|
1566
|
+
scrollToIndex: _,
|
|
1541
1567
|
totalSize: te,
|
|
1542
1568
|
visibleRange: {
|
|
1543
|
-
startIndex:
|
|
1544
|
-
stopIndex:
|
|
1569
|
+
startIndex: w,
|
|
1570
|
+
stopIndex: T
|
|
1545
1571
|
}
|
|
1546
1572
|
}),
|
|
1547
1573
|
[
|
|
1548
1574
|
Q,
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1575
|
+
L,
|
|
1576
|
+
_,
|
|
1577
|
+
w,
|
|
1578
|
+
T,
|
|
1553
1579
|
te
|
|
1554
1580
|
]
|
|
1555
1581
|
);
|
|
1556
1582
|
}
|
|
1557
|
-
function
|
|
1583
|
+
function ut(e, {
|
|
1558
1584
|
delay: t = 150
|
|
1559
1585
|
} = {}) {
|
|
1560
|
-
const [r, o] =
|
|
1561
|
-
return
|
|
1586
|
+
const [r, o] = C(!1);
|
|
1587
|
+
return B(() => {
|
|
1562
1588
|
if (!e)
|
|
1563
1589
|
return;
|
|
1564
|
-
const s = e === "window" ? window :
|
|
1565
|
-
let
|
|
1590
|
+
const s = e === "window" ? window : Z(e), i = e === "window" ? s : e, n = "onscrollend" in s;
|
|
1591
|
+
let d, v = 0;
|
|
1566
1592
|
const h = () => {
|
|
1567
|
-
performance.now() - v >= t ? (
|
|
1593
|
+
performance.now() - v >= t ? (d = void 0, o(!1)) : d = s.requestAnimationFrame(h);
|
|
1568
1594
|
}, f = () => {
|
|
1569
|
-
o(!0), n || (v = performance.now(),
|
|
1570
|
-
},
|
|
1595
|
+
o(!0), n || (v = performance.now(), d === void 0 && (d = s.requestAnimationFrame(h)));
|
|
1596
|
+
}, u = () => {
|
|
1571
1597
|
o(!1);
|
|
1572
1598
|
};
|
|
1573
|
-
return i.addEventListener("scroll", f, { passive: !0 }), n && i.addEventListener("scrollend",
|
|
1574
|
-
i.removeEventListener("scroll", f), i.removeEventListener("scrollend",
|
|
1599
|
+
return i.addEventListener("scroll", f, { passive: !0 }), n && i.addEventListener("scrollend", u), () => {
|
|
1600
|
+
i.removeEventListener("scroll", f), i.removeEventListener("scrollend", u), d !== void 0 && s.cancelAnimationFrame(d), o(!1);
|
|
1575
1601
|
};
|
|
1576
1602
|
}, [t, e]), r;
|
|
1577
1603
|
}
|
|
1578
|
-
const
|
|
1579
|
-
function
|
|
1604
|
+
const Te = /* @__PURE__ */ new WeakMap();
|
|
1605
|
+
function dt(e = !1, t = typeof document < "u" ? document : void 0) {
|
|
1580
1606
|
if (t === void 0)
|
|
1581
1607
|
return 0;
|
|
1582
|
-
let r =
|
|
1608
|
+
let r = Te.get(t);
|
|
1583
1609
|
if (r === void 0 || e) {
|
|
1584
1610
|
const o = t.createElement("div"), s = o.style;
|
|
1585
|
-
s.width = "50px", s.height = "50px", s.overflow = "scroll", t.body.appendChild(o), r = o.offsetWidth - o.clientWidth, t.body.removeChild(o),
|
|
1611
|
+
s.width = "50px", s.height = "50px", s.overflow = "scroll", t.body.appendChild(o), r = o.offsetWidth - o.clientWidth, t.body.removeChild(o), Te.set(t, r);
|
|
1586
1612
|
}
|
|
1587
1613
|
return r;
|
|
1588
1614
|
}
|
|
1589
1615
|
export {
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1616
|
+
rt as Grid,
|
|
1617
|
+
it as List,
|
|
1618
|
+
dt as getScrollbarSize,
|
|
1619
|
+
lt as useDynamicRowHeight,
|
|
1620
|
+
ot as useGridCallbackRef,
|
|
1621
|
+
nt as useGridRef,
|
|
1622
|
+
ut as useIsScrolling,
|
|
1623
|
+
ct as useListCallbackRef,
|
|
1624
|
+
at as useListRef,
|
|
1625
|
+
ft as useVirtualizer
|
|
1600
1626
|
};
|
|
1601
1627
|
//# sourceMappingURL=react-window.js.map
|