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