react-window 2.3.4 → 2.4.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 +56 -15
- package/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +100 -32
- package/dist/react-window.js +731 -633
- package/dist/react-window.js.map +1 -1
- package/package.json +6 -3
package/dist/react-window.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as re } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { useLayoutEffect as Te, useEffect as ne, useState as M, useSyncExternalStore as Re, useMemo as q, useRef as H, useCallback as U, memo as be, useImperativeHandle as xe, createElement as le, Fragment as ue } from "react";
|
|
4
|
+
const W = typeof window < "u" ? Te : ne;
|
|
5
|
+
function we(e) {
|
|
5
6
|
let t = e;
|
|
6
7
|
for (; t; ) {
|
|
7
8
|
if (t.dir)
|
|
@@ -10,20 +11,30 @@ function Oe(e) {
|
|
|
10
11
|
}
|
|
11
12
|
return !1;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const [s,
|
|
15
|
-
return
|
|
16
|
-
t ?
|
|
14
|
+
function Ae(e, t) {
|
|
15
|
+
const [s, o] = M(t === "rtl");
|
|
16
|
+
return W(() => {
|
|
17
|
+
t ? o(t === "rtl") : e && o(we(e));
|
|
17
18
|
}, [t, e]), s;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
function Me() {
|
|
21
|
+
return () => {
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function Ie() {
|
|
25
|
+
return Re(
|
|
26
|
+
Me,
|
|
27
|
+
() => !1,
|
|
28
|
+
() => !0
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function ae(e) {
|
|
21
32
|
return e?.ownerDocument.defaultView ?? window;
|
|
22
33
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
34
|
+
function Oe(e) {
|
|
35
|
+
return ae(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
25
36
|
}
|
|
26
|
-
function
|
|
37
|
+
function de(e) {
|
|
27
38
|
if (e !== void 0)
|
|
28
39
|
switch (typeof e) {
|
|
29
40
|
case "number":
|
|
@@ -35,105 +46,105 @@ function le(e) {
|
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
|
-
function
|
|
49
|
+
function Le({
|
|
39
50
|
box: e,
|
|
40
51
|
defaultHeight: t,
|
|
41
52
|
defaultWidth: s,
|
|
42
|
-
disabled:
|
|
43
|
-
element:
|
|
53
|
+
disabled: o,
|
|
54
|
+
element: r,
|
|
44
55
|
mode: i,
|
|
45
|
-
style:
|
|
56
|
+
style: n
|
|
46
57
|
}) {
|
|
47
|
-
const { styleHeight:
|
|
58
|
+
const { styleHeight: l, styleWidth: a } = q(
|
|
48
59
|
() => ({
|
|
49
|
-
styleHeight:
|
|
50
|
-
styleWidth:
|
|
60
|
+
styleHeight: de(n?.height),
|
|
61
|
+
styleWidth: de(n?.width)
|
|
51
62
|
}),
|
|
52
|
-
[
|
|
53
|
-
), [
|
|
63
|
+
[n?.height, n?.width]
|
|
64
|
+
), [v, f] = M({
|
|
54
65
|
height: t,
|
|
55
66
|
width: s
|
|
56
|
-
}),
|
|
57
|
-
return
|
|
58
|
-
if (
|
|
67
|
+
}), c = o || i === "only-height" && l !== void 0 || i === "only-width" && a !== void 0 || l !== void 0 && a !== void 0;
|
|
68
|
+
return W(() => {
|
|
69
|
+
if (r === null || c)
|
|
59
70
|
return;
|
|
60
|
-
const u =
|
|
71
|
+
const u = Oe(r);
|
|
61
72
|
if (!u)
|
|
62
73
|
return;
|
|
63
|
-
const
|
|
64
|
-
for (const
|
|
65
|
-
const { contentRect:
|
|
66
|
-
|
|
67
|
-
height:
|
|
68
|
-
width:
|
|
74
|
+
const p = new u((d) => {
|
|
75
|
+
for (const x of d) {
|
|
76
|
+
const { contentRect: h, target: O } = x;
|
|
77
|
+
r === O && f((b) => b.height === h.height && b.width === h.width ? b : {
|
|
78
|
+
height: h.height,
|
|
79
|
+
width: h.width
|
|
69
80
|
});
|
|
70
81
|
}
|
|
71
82
|
});
|
|
72
|
-
return
|
|
73
|
-
|
|
83
|
+
return p.observe(r, { box: e }), () => {
|
|
84
|
+
p?.unobserve(r);
|
|
74
85
|
};
|
|
75
|
-
}, [e,
|
|
86
|
+
}, [e, c, r, l, a]), q(
|
|
76
87
|
() => ({
|
|
77
|
-
height:
|
|
78
|
-
width:
|
|
88
|
+
height: l ?? v.height,
|
|
89
|
+
width: a ?? v.width
|
|
79
90
|
}),
|
|
80
|
-
[
|
|
91
|
+
[v, l, a]
|
|
81
92
|
);
|
|
82
93
|
}
|
|
83
|
-
function
|
|
84
|
-
const t =
|
|
94
|
+
function ee(e) {
|
|
95
|
+
const t = H(() => {
|
|
85
96
|
throw new Error("Cannot call an event handler while rendering.");
|
|
86
97
|
});
|
|
87
|
-
return
|
|
98
|
+
return W(() => {
|
|
88
99
|
t.current = e;
|
|
89
|
-
}, [e]),
|
|
100
|
+
}, [e]), U((...s) => t.current?.(...s), [t]);
|
|
90
101
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
let s =
|
|
102
|
+
const he = /* @__PURE__ */ new WeakMap();
|
|
103
|
+
function Ee(e = !1, t = document) {
|
|
104
|
+
let s = he.get(t);
|
|
94
105
|
if (s === void 0 || e) {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
const i = t.createElement("div"),
|
|
98
|
-
|
|
106
|
+
const o = t.createElement("div"), r = o.style;
|
|
107
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
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 ? s = "positive-descending" : (o.scrollLeft = 1, o.scrollLeft === 0 ? s = "negative" : s = "positive-ascending"), t.body.removeChild(o), he.set(t, s);
|
|
99
110
|
}
|
|
100
111
|
return s;
|
|
101
112
|
}
|
|
102
|
-
function
|
|
113
|
+
function C({
|
|
103
114
|
containerElement: e,
|
|
104
115
|
direction: t,
|
|
105
116
|
isRtl: s,
|
|
106
|
-
scrollOffset:
|
|
117
|
+
scrollOffset: o
|
|
107
118
|
}) {
|
|
108
119
|
if (t === "horizontal" && s)
|
|
109
|
-
switch (
|
|
120
|
+
switch (Ee(!1, e?.ownerDocument ?? document)) {
|
|
110
121
|
case "negative":
|
|
111
|
-
return -
|
|
122
|
+
return -o;
|
|
112
123
|
case "positive-descending": {
|
|
113
124
|
if (e) {
|
|
114
|
-
const { clientWidth:
|
|
115
|
-
return i -
|
|
125
|
+
const { clientWidth: r, scrollWidth: i } = e;
|
|
126
|
+
return i - r - o;
|
|
116
127
|
}
|
|
117
128
|
break;
|
|
118
129
|
}
|
|
119
130
|
}
|
|
120
|
-
return
|
|
131
|
+
return o;
|
|
121
132
|
}
|
|
122
|
-
function
|
|
133
|
+
function $(e, t = "Assertion error") {
|
|
123
134
|
if (!e)
|
|
124
135
|
throw console.error(t), Error(t);
|
|
125
136
|
}
|
|
126
|
-
function
|
|
137
|
+
function J(e, t) {
|
|
127
138
|
if (e === t)
|
|
128
139
|
return !0;
|
|
129
|
-
if (!!e != !!t || (
|
|
140
|
+
if (!!e != !!t || ($(e !== void 0), $(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
|
|
130
141
|
return !1;
|
|
131
142
|
for (const s in e)
|
|
132
143
|
if (!Object.hasOwn(t, s) || !Object.is(t[s], e[s]))
|
|
133
144
|
return !1;
|
|
134
145
|
return !0;
|
|
135
146
|
}
|
|
136
|
-
function
|
|
147
|
+
function ze({
|
|
137
148
|
cachedBounds: e,
|
|
138
149
|
itemCount: t,
|
|
139
150
|
itemSize: s
|
|
@@ -143,162 +154,162 @@ function pe({
|
|
|
143
154
|
if (typeof s == "number")
|
|
144
155
|
return t * s;
|
|
145
156
|
{
|
|
146
|
-
const
|
|
157
|
+
const o = e.get(
|
|
147
158
|
e.size === 0 ? 0 : e.size - 1
|
|
148
159
|
);
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
return t *
|
|
160
|
+
$(o !== void 0, "Unexpected bounds cache miss");
|
|
161
|
+
const r = (o.scrollOffset + o.size) / e.size;
|
|
162
|
+
return t * r;
|
|
152
163
|
}
|
|
153
164
|
}
|
|
154
|
-
function
|
|
165
|
+
function Ve({
|
|
155
166
|
align: e,
|
|
156
167
|
cachedBounds: t,
|
|
157
168
|
index: s,
|
|
158
|
-
itemCount:
|
|
159
|
-
itemSize:
|
|
169
|
+
itemCount: o,
|
|
170
|
+
itemSize: r,
|
|
160
171
|
containerScrollOffset: i,
|
|
161
|
-
containerSize:
|
|
172
|
+
containerSize: n
|
|
162
173
|
}) {
|
|
163
|
-
if (s < 0 || s >=
|
|
174
|
+
if (s < 0 || s >= o)
|
|
164
175
|
throw RangeError(`Invalid index specified: ${s}`, {
|
|
165
|
-
cause: `Index ${s} is not within the range of 0 - ${
|
|
176
|
+
cause: `Index ${s} is not within the range of 0 - ${o - 1}`
|
|
166
177
|
});
|
|
167
|
-
const
|
|
178
|
+
const l = t.get(s), a = ze({
|
|
168
179
|
cachedBounds: t,
|
|
169
|
-
itemCount:
|
|
170
|
-
itemSize:
|
|
171
|
-
}),
|
|
180
|
+
itemCount: o,
|
|
181
|
+
itemSize: r
|
|
182
|
+
}), v = Math.max(
|
|
172
183
|
0,
|
|
173
|
-
Math.min(
|
|
174
|
-
),
|
|
184
|
+
Math.min(a - n, l.scrollOffset)
|
|
185
|
+
), f = Math.max(
|
|
175
186
|
0,
|
|
176
|
-
|
|
177
|
-
),
|
|
178
|
-
switch (e === "smart" && (e =
|
|
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) {
|
|
179
190
|
case "start":
|
|
180
|
-
return
|
|
191
|
+
return v;
|
|
181
192
|
case "end":
|
|
182
|
-
return
|
|
193
|
+
return f;
|
|
183
194
|
case "center":
|
|
184
195
|
return Math.max(
|
|
185
196
|
0,
|
|
186
197
|
Math.min(
|
|
187
|
-
|
|
188
|
-
|
|
198
|
+
a - n,
|
|
199
|
+
l.scrollOffset + l.size / 2 - n / 2
|
|
189
200
|
)
|
|
190
201
|
);
|
|
191
202
|
case "auto":
|
|
192
203
|
default:
|
|
193
|
-
return
|
|
204
|
+
return c ? i : i < f ? f : v;
|
|
194
205
|
}
|
|
195
206
|
}
|
|
196
|
-
function
|
|
207
|
+
function ce({
|
|
197
208
|
cachedBounds: e,
|
|
198
209
|
containerScrollOffset: t,
|
|
199
210
|
containerSize: s,
|
|
200
|
-
itemCount:
|
|
201
|
-
overscanCount:
|
|
211
|
+
itemCount: o,
|
|
212
|
+
overscanCount: r
|
|
202
213
|
}) {
|
|
203
|
-
const i =
|
|
204
|
-
if (
|
|
214
|
+
const i = o - 1;
|
|
215
|
+
if (o === 0)
|
|
205
216
|
return {
|
|
206
217
|
startIndexVisible: 0,
|
|
207
218
|
stopIndexVisible: -1,
|
|
208
219
|
startIndexOverscan: 0,
|
|
209
220
|
stopIndexOverscan: -1
|
|
210
221
|
};
|
|
211
|
-
let
|
|
212
|
-
const { itemSize:
|
|
213
|
-
if (
|
|
214
|
-
|
|
222
|
+
let n, l;
|
|
223
|
+
const { itemSize: a } = e;
|
|
224
|
+
if (a !== void 0 && a > 0)
|
|
225
|
+
n = Math.max(
|
|
215
226
|
0,
|
|
216
|
-
Math.min(i, Math.floor(t /
|
|
217
|
-
),
|
|
218
|
-
|
|
227
|
+
Math.min(i, Math.floor(t / a))
|
|
228
|
+
), l = Math.max(
|
|
229
|
+
n,
|
|
219
230
|
Math.min(
|
|
220
231
|
i,
|
|
221
|
-
Math.ceil((t + s) /
|
|
232
|
+
Math.ceil((t + s) / a) - 1
|
|
222
233
|
)
|
|
223
234
|
);
|
|
224
235
|
else {
|
|
225
|
-
let
|
|
226
|
-
for (;
|
|
227
|
-
const
|
|
228
|
-
u.scrollOffset + u.size > t ?
|
|
236
|
+
let v = 0, f = Math.min(i, Math.max(0, e.size - 1));
|
|
237
|
+
for (; v < f; ) {
|
|
238
|
+
const c = Math.floor((v + f) / 2), u = e.get(c);
|
|
239
|
+
u.scrollOffset + u.size > t ? f = c : v = c + 1;
|
|
229
240
|
}
|
|
230
|
-
for (;
|
|
231
|
-
const
|
|
232
|
-
if (
|
|
233
|
-
|
|
241
|
+
for (; v < i; ) {
|
|
242
|
+
const c = e.get(v);
|
|
243
|
+
if (c.scrollOffset + c.size > t) break;
|
|
244
|
+
v++;
|
|
234
245
|
}
|
|
235
|
-
for (
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
246
|
+
for (n = v, l = v; l < i; ) {
|
|
247
|
+
const c = e.get(l);
|
|
248
|
+
if (c.scrollOffset + c.size >= t + s)
|
|
238
249
|
break;
|
|
239
|
-
|
|
250
|
+
l++;
|
|
240
251
|
}
|
|
241
252
|
}
|
|
242
253
|
return {
|
|
243
|
-
startIndexVisible:
|
|
244
|
-
stopIndexVisible:
|
|
245
|
-
startIndexOverscan: Math.max(0,
|
|
246
|
-
stopIndexOverscan: Math.min(i,
|
|
254
|
+
startIndexVisible: n,
|
|
255
|
+
stopIndexVisible: l,
|
|
256
|
+
startIndexOverscan: Math.max(0, n - r),
|
|
257
|
+
stopIndexOverscan: Math.min(i, l + r)
|
|
247
258
|
};
|
|
248
259
|
}
|
|
249
|
-
function
|
|
260
|
+
function ke({
|
|
250
261
|
itemCount: e,
|
|
251
262
|
itemProps: t,
|
|
252
263
|
itemSize: s
|
|
253
264
|
}) {
|
|
254
|
-
const
|
|
265
|
+
const o = /* @__PURE__ */ new Map();
|
|
255
266
|
return {
|
|
256
267
|
itemSize: typeof s == "number" ? s : void 0,
|
|
257
|
-
get(
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
let
|
|
261
|
-
return
|
|
268
|
+
get(r) {
|
|
269
|
+
if ($(r < e, `Invalid index ${r}`), typeof s == "number") {
|
|
270
|
+
$(r >= 0, `Invalid index ${r}`);
|
|
271
|
+
let n = o.get(r);
|
|
272
|
+
return n === void 0 && (n = { size: s, scrollOffset: r * s }, o.set(r, n)), n;
|
|
262
273
|
}
|
|
263
|
-
for (;
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
|
|
267
|
-
size:
|
|
274
|
+
for (; o.size - 1 < r; ) {
|
|
275
|
+
const n = o.size, l = s(n, t);
|
|
276
|
+
if (n === 0)
|
|
277
|
+
o.set(n, {
|
|
278
|
+
size: l,
|
|
268
279
|
scrollOffset: 0
|
|
269
280
|
});
|
|
270
281
|
else {
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
`Unexpected bounds cache miss for index ${
|
|
275
|
-
),
|
|
276
|
-
scrollOffset:
|
|
277
|
-
size:
|
|
282
|
+
const a = o.get(n - 1);
|
|
283
|
+
$(
|
|
284
|
+
a !== void 0,
|
|
285
|
+
`Unexpected bounds cache miss for index ${r}`
|
|
286
|
+
), o.set(n, {
|
|
287
|
+
scrollOffset: a.scrollOffset + a.size,
|
|
288
|
+
size: l
|
|
278
289
|
});
|
|
279
290
|
}
|
|
280
291
|
}
|
|
281
|
-
const i =
|
|
282
|
-
return
|
|
292
|
+
const i = o.get(r);
|
|
293
|
+
return $(
|
|
283
294
|
i !== void 0,
|
|
284
|
-
`Unexpected bounds cache miss for index ${
|
|
295
|
+
`Unexpected bounds cache miss for index ${r}`
|
|
285
296
|
), i;
|
|
286
297
|
},
|
|
287
|
-
set(
|
|
288
|
-
|
|
298
|
+
set(r, i) {
|
|
299
|
+
o.set(r, i);
|
|
289
300
|
},
|
|
290
301
|
get size() {
|
|
291
|
-
return
|
|
302
|
+
return o.size;
|
|
292
303
|
}
|
|
293
304
|
};
|
|
294
305
|
}
|
|
295
|
-
function
|
|
306
|
+
function Fe({
|
|
296
307
|
itemCount: e,
|
|
297
308
|
itemProps: t,
|
|
298
309
|
itemSize: s
|
|
299
310
|
}) {
|
|
300
|
-
return
|
|
301
|
-
() =>
|
|
311
|
+
return q(
|
|
312
|
+
() => ke({
|
|
302
313
|
itemCount: e,
|
|
303
314
|
itemProps: t,
|
|
304
315
|
itemSize: s
|
|
@@ -306,17 +317,17 @@ function Me({
|
|
|
306
317
|
[e, t, s]
|
|
307
318
|
);
|
|
308
319
|
}
|
|
309
|
-
function
|
|
320
|
+
function We({
|
|
310
321
|
containerSize: e,
|
|
311
322
|
itemSize: t
|
|
312
323
|
}) {
|
|
313
324
|
let s;
|
|
314
325
|
switch (typeof t) {
|
|
315
326
|
case "string": {
|
|
316
|
-
|
|
327
|
+
$(
|
|
317
328
|
t.endsWith("%"),
|
|
318
329
|
`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
|
|
319
|
-
),
|
|
330
|
+
), $(
|
|
320
331
|
e !== void 0,
|
|
321
332
|
"Container size must be defined if a percentage item size is specified"
|
|
322
333
|
), s = e * parseFloat(t) / 100;
|
|
@@ -329,501 +340,563 @@ function Ee({
|
|
|
329
340
|
}
|
|
330
341
|
return s;
|
|
331
342
|
}
|
|
332
|
-
function
|
|
343
|
+
function fe({
|
|
333
344
|
containerElement: e,
|
|
334
345
|
containerStyle: t,
|
|
335
346
|
defaultContainerSize: s = 0,
|
|
347
|
+
defaultScrollOffset: o = 0,
|
|
336
348
|
direction: r,
|
|
337
|
-
isRtl:
|
|
338
|
-
itemCount:
|
|
349
|
+
isRtl: i = !1,
|
|
350
|
+
itemCount: n,
|
|
339
351
|
itemProps: l,
|
|
340
352
|
itemSize: a,
|
|
341
|
-
onResize:
|
|
353
|
+
onResize: v,
|
|
342
354
|
overscanCount: f
|
|
343
355
|
}) {
|
|
344
|
-
const { height:
|
|
356
|
+
const { height: c = s, width: u = s } = Le({
|
|
345
357
|
defaultHeight: r === "vertical" ? s : void 0,
|
|
346
358
|
defaultWidth: r === "horizontal" ? s : void 0,
|
|
347
359
|
element: e,
|
|
348
360
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
349
361
|
style: t
|
|
350
|
-
}),
|
|
362
|
+
}), p = H({
|
|
351
363
|
height: 0,
|
|
352
364
|
width: 0
|
|
353
|
-
}), d = r === "vertical" ?
|
|
354
|
-
|
|
355
|
-
if (typeof
|
|
356
|
-
const
|
|
357
|
-
(
|
|
365
|
+
}), d = r === "vertical" ? c : u, x = We({ containerSize: d, itemSize: a });
|
|
366
|
+
W(() => {
|
|
367
|
+
if (typeof v == "function") {
|
|
368
|
+
const g = p.current;
|
|
369
|
+
(g.height !== c || g.width !== u) && (v({ height: c, width: u }, { ...g }), g.height = c, g.width = u);
|
|
358
370
|
}
|
|
359
|
-
}, [
|
|
360
|
-
const
|
|
361
|
-
itemCount:
|
|
371
|
+
}, [c, v, u]);
|
|
372
|
+
const h = Fe({
|
|
373
|
+
itemCount: n,
|
|
362
374
|
itemProps: l,
|
|
363
|
-
itemSize:
|
|
364
|
-
}),
|
|
365
|
-
(
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
375
|
+
itemSize: x
|
|
376
|
+
}), O = Ie(), [b] = M(
|
|
377
|
+
() => O ? 0 : o
|
|
378
|
+
), D = U(
|
|
379
|
+
(g) => h.get(g),
|
|
380
|
+
[h]
|
|
381
|
+
), [m, X] = M(
|
|
382
|
+
() => ce({
|
|
383
|
+
cachedBounds: h,
|
|
384
|
+
containerScrollOffset: b,
|
|
372
385
|
containerSize: d,
|
|
373
|
-
itemCount:
|
|
386
|
+
itemCount: n,
|
|
374
387
|
overscanCount: f
|
|
375
388
|
})
|
|
376
389
|
), {
|
|
377
|
-
startIndexVisible:
|
|
378
|
-
startIndexOverscan:
|
|
379
|
-
stopIndexVisible:
|
|
380
|
-
stopIndexOverscan:
|
|
390
|
+
startIndexVisible: L,
|
|
391
|
+
startIndexOverscan: j,
|
|
392
|
+
stopIndexVisible: I,
|
|
393
|
+
stopIndexOverscan: te
|
|
381
394
|
} = {
|
|
382
|
-
startIndexVisible: Math.min(
|
|
383
|
-
startIndexOverscan: Math.min(
|
|
384
|
-
stopIndexVisible: Math.min(
|
|
385
|
-
stopIndexOverscan: Math.min(
|
|
386
|
-
},
|
|
387
|
-
() =>
|
|
388
|
-
cachedBounds:
|
|
389
|
-
itemCount:
|
|
390
|
-
itemSize:
|
|
395
|
+
startIndexVisible: Math.min(n - 1, m.startIndexVisible),
|
|
396
|
+
startIndexOverscan: Math.min(n - 1, m.startIndexOverscan),
|
|
397
|
+
stopIndexVisible: Math.min(n - 1, m.stopIndexVisible),
|
|
398
|
+
stopIndexOverscan: Math.min(n - 1, m.stopIndexOverscan)
|
|
399
|
+
}, A = U(
|
|
400
|
+
() => ze({
|
|
401
|
+
cachedBounds: h,
|
|
402
|
+
itemCount: n,
|
|
403
|
+
itemSize: x
|
|
391
404
|
}),
|
|
392
|
-
[
|
|
393
|
-
),
|
|
394
|
-
(
|
|
395
|
-
const
|
|
405
|
+
[h, n, x]
|
|
406
|
+
), G = U(
|
|
407
|
+
(g) => {
|
|
408
|
+
const w = C({
|
|
396
409
|
containerElement: e,
|
|
397
410
|
direction: r,
|
|
398
|
-
isRtl:
|
|
399
|
-
scrollOffset:
|
|
411
|
+
isRtl: i,
|
|
412
|
+
scrollOffset: g
|
|
400
413
|
});
|
|
401
|
-
return
|
|
402
|
-
cachedBounds:
|
|
403
|
-
containerScrollOffset:
|
|
414
|
+
return ce({
|
|
415
|
+
cachedBounds: h,
|
|
416
|
+
containerScrollOffset: w,
|
|
404
417
|
containerSize: d,
|
|
405
|
-
itemCount:
|
|
418
|
+
itemCount: n,
|
|
406
419
|
overscanCount: f
|
|
407
420
|
});
|
|
408
421
|
},
|
|
409
422
|
[
|
|
410
|
-
|
|
423
|
+
h,
|
|
411
424
|
e,
|
|
412
425
|
d,
|
|
413
426
|
r,
|
|
414
|
-
n,
|
|
415
427
|
i,
|
|
428
|
+
n,
|
|
416
429
|
f
|
|
417
430
|
]
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
431
|
+
), Q = H(!1);
|
|
432
|
+
W(() => {
|
|
433
|
+
if (!e || n === 0 || Q.current || (Q.current = !0, o <= 0))
|
|
434
|
+
return;
|
|
435
|
+
const g = r === "horizontal" && we(e);
|
|
436
|
+
if (C({
|
|
437
|
+
containerElement: e,
|
|
438
|
+
direction: r,
|
|
439
|
+
isRtl: g,
|
|
440
|
+
scrollOffset: r === "vertical" ? e.scrollTop : e.scrollLeft
|
|
441
|
+
}) !== 0)
|
|
442
|
+
return;
|
|
443
|
+
const y = C({
|
|
444
|
+
containerElement: e,
|
|
445
|
+
direction: r,
|
|
446
|
+
isRtl: g,
|
|
447
|
+
scrollOffset: o
|
|
448
|
+
});
|
|
449
|
+
typeof e.scrollTo == "function" ? e.scrollTo({
|
|
450
|
+
behavior: "instant",
|
|
451
|
+
[r === "vertical" ? "top" : "left"]: y
|
|
452
|
+
}) : r === "vertical" ? e.scrollTop = y : e.scrollLeft = y;
|
|
453
|
+
}, [e, n]), W(() => {
|
|
454
|
+
const g = e ? G(
|
|
455
|
+
r === "vertical" ? e.scrollTop : e.scrollLeft
|
|
456
|
+
) : ce({
|
|
457
|
+
cachedBounds: h,
|
|
458
|
+
containerScrollOffset: b,
|
|
459
|
+
containerSize: d,
|
|
460
|
+
itemCount: n,
|
|
461
|
+
overscanCount: f
|
|
462
|
+
});
|
|
463
|
+
X((w) => J(g, w) ? w : g);
|
|
464
|
+
}, [
|
|
465
|
+
h,
|
|
466
|
+
e,
|
|
467
|
+
d,
|
|
468
|
+
r,
|
|
469
|
+
G,
|
|
470
|
+
b,
|
|
471
|
+
n,
|
|
472
|
+
f
|
|
473
|
+
]), W(() => {
|
|
423
474
|
if (!e)
|
|
424
475
|
return;
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
const { scrollLeft:
|
|
476
|
+
const g = () => {
|
|
477
|
+
X((w) => {
|
|
478
|
+
const { scrollLeft: y, scrollTop: T } = e, E = C({
|
|
428
479
|
containerElement: e,
|
|
429
480
|
direction: r,
|
|
430
|
-
isRtl:
|
|
431
|
-
scrollOffset: r === "vertical" ?
|
|
432
|
-
}),
|
|
433
|
-
cachedBounds:
|
|
434
|
-
containerScrollOffset:
|
|
481
|
+
isRtl: i,
|
|
482
|
+
scrollOffset: r === "vertical" ? T : y
|
|
483
|
+
}), V = ce({
|
|
484
|
+
cachedBounds: h,
|
|
485
|
+
containerScrollOffset: E,
|
|
435
486
|
containerSize: d,
|
|
436
|
-
itemCount:
|
|
487
|
+
itemCount: n,
|
|
437
488
|
overscanCount: f
|
|
438
489
|
});
|
|
439
|
-
return
|
|
490
|
+
return J(V, w) ? w : V;
|
|
440
491
|
});
|
|
441
492
|
};
|
|
442
|
-
return e.addEventListener("scroll",
|
|
443
|
-
e.removeEventListener("scroll",
|
|
493
|
+
return e.addEventListener("scroll", g), () => {
|
|
494
|
+
e.removeEventListener("scroll", g);
|
|
444
495
|
};
|
|
445
496
|
}, [
|
|
446
|
-
|
|
497
|
+
h,
|
|
447
498
|
e,
|
|
448
499
|
d,
|
|
449
500
|
r,
|
|
450
|
-
n,
|
|
451
501
|
i,
|
|
502
|
+
n,
|
|
452
503
|
f
|
|
453
504
|
]);
|
|
454
|
-
const
|
|
505
|
+
const z = ee(
|
|
455
506
|
({
|
|
456
|
-
align:
|
|
457
|
-
containerScrollOffset:
|
|
458
|
-
index:
|
|
507
|
+
align: g = "auto",
|
|
508
|
+
containerScrollOffset: w,
|
|
509
|
+
index: y
|
|
459
510
|
}) => {
|
|
460
|
-
let
|
|
461
|
-
align:
|
|
462
|
-
cachedBounds:
|
|
463
|
-
containerScrollOffset:
|
|
511
|
+
let T = Ve({
|
|
512
|
+
align: g,
|
|
513
|
+
cachedBounds: h,
|
|
514
|
+
containerScrollOffset: C({
|
|
464
515
|
containerElement: e,
|
|
465
516
|
direction: r,
|
|
466
|
-
isRtl:
|
|
467
|
-
scrollOffset:
|
|
517
|
+
isRtl: i,
|
|
518
|
+
scrollOffset: w
|
|
468
519
|
}),
|
|
469
520
|
containerSize: d,
|
|
470
|
-
index:
|
|
471
|
-
itemCount:
|
|
472
|
-
itemSize:
|
|
521
|
+
index: y,
|
|
522
|
+
itemCount: n,
|
|
523
|
+
itemSize: x
|
|
473
524
|
});
|
|
474
525
|
if (e) {
|
|
475
|
-
if (
|
|
526
|
+
if (T = C({
|
|
476
527
|
containerElement: e,
|
|
477
528
|
direction: r,
|
|
478
|
-
isRtl:
|
|
479
|
-
scrollOffset:
|
|
529
|
+
isRtl: i,
|
|
530
|
+
scrollOffset: T
|
|
480
531
|
}), typeof e.scrollTo != "function") {
|
|
481
|
-
const
|
|
482
|
-
|
|
532
|
+
const E = G(T);
|
|
533
|
+
J(m, E) || X(E);
|
|
483
534
|
}
|
|
484
|
-
return
|
|
535
|
+
return T;
|
|
485
536
|
}
|
|
486
537
|
}
|
|
487
538
|
);
|
|
488
539
|
return {
|
|
489
|
-
getCellBounds:
|
|
490
|
-
getEstimatedSize:
|
|
491
|
-
scrollToIndex:
|
|
492
|
-
startIndexOverscan:
|
|
493
|
-
startIndexVisible:
|
|
494
|
-
stopIndexOverscan:
|
|
495
|
-
stopIndexVisible:
|
|
540
|
+
getCellBounds: D,
|
|
541
|
+
getEstimatedSize: A,
|
|
542
|
+
scrollToIndex: z,
|
|
543
|
+
startIndexOverscan: j,
|
|
544
|
+
startIndexVisible: L,
|
|
545
|
+
stopIndexOverscan: te,
|
|
546
|
+
stopIndexVisible: I
|
|
496
547
|
};
|
|
497
548
|
}
|
|
498
|
-
function
|
|
499
|
-
const [t, s] =
|
|
500
|
-
return
|
|
549
|
+
function me(e) {
|
|
550
|
+
const [t, s] = M(e);
|
|
551
|
+
return J(t, e) ? t : (s(e), e);
|
|
501
552
|
}
|
|
502
|
-
function
|
|
553
|
+
function ye(e, t) {
|
|
503
554
|
const {
|
|
504
555
|
ariaAttributes: s,
|
|
505
|
-
style:
|
|
506
|
-
...
|
|
556
|
+
style: o,
|
|
557
|
+
...r
|
|
507
558
|
} = e, {
|
|
508
559
|
ariaAttributes: i,
|
|
509
|
-
style:
|
|
510
|
-
...
|
|
560
|
+
style: n,
|
|
561
|
+
...l
|
|
511
562
|
} = t;
|
|
512
|
-
return
|
|
563
|
+
return J(s, i) && J(o, n) && J(r, l);
|
|
513
564
|
}
|
|
514
|
-
function
|
|
565
|
+
function qe({
|
|
515
566
|
cellComponent: e,
|
|
516
567
|
cellProps: t,
|
|
517
568
|
children: s,
|
|
518
|
-
className:
|
|
519
|
-
columnCount:
|
|
569
|
+
className: o,
|
|
570
|
+
columnCount: r,
|
|
520
571
|
columnKey: i,
|
|
521
|
-
columnWidth:
|
|
522
|
-
defaultHeight:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
572
|
+
columnWidth: n,
|
|
573
|
+
defaultHeight: l = 0,
|
|
574
|
+
defaultScrollLeft: a = 0,
|
|
575
|
+
defaultScrollTop: v = 0,
|
|
576
|
+
defaultWidth: f = 0,
|
|
577
|
+
dir: c,
|
|
578
|
+
gridRef: u,
|
|
579
|
+
onCellsRendered: p,
|
|
580
|
+
onResize: d,
|
|
581
|
+
overscanCount: x = 3,
|
|
582
|
+
rowCount: h,
|
|
583
|
+
rowHeight: O,
|
|
584
|
+
rowKey: b,
|
|
585
|
+
style: D,
|
|
586
|
+
tagName: m = "div",
|
|
587
|
+
...X
|
|
535
588
|
}) {
|
|
536
|
-
const
|
|
537
|
-
() =>
|
|
589
|
+
const L = me(t), j = q(
|
|
590
|
+
() => be(e, ye),
|
|
538
591
|
[e]
|
|
539
|
-
), [
|
|
540
|
-
getCellBounds:
|
|
541
|
-
getEstimatedSize:
|
|
542
|
-
startIndexOverscan:
|
|
543
|
-
startIndexVisible:
|
|
544
|
-
scrollToIndex:
|
|
545
|
-
stopIndexOverscan:
|
|
546
|
-
stopIndexVisible:
|
|
547
|
-
} =
|
|
548
|
-
containerElement:
|
|
549
|
-
containerStyle:
|
|
550
|
-
defaultContainerSize:
|
|
592
|
+
), [I, te] = M(null), A = Ae(I, c), {
|
|
593
|
+
getCellBounds: G,
|
|
594
|
+
getEstimatedSize: Q,
|
|
595
|
+
startIndexOverscan: z,
|
|
596
|
+
startIndexVisible: g,
|
|
597
|
+
scrollToIndex: w,
|
|
598
|
+
stopIndexOverscan: y,
|
|
599
|
+
stopIndexVisible: T
|
|
600
|
+
} = fe({
|
|
601
|
+
containerElement: I,
|
|
602
|
+
containerStyle: D,
|
|
603
|
+
defaultContainerSize: f,
|
|
604
|
+
defaultScrollOffset: a,
|
|
551
605
|
direction: "horizontal",
|
|
552
|
-
isRtl:
|
|
553
|
-
itemCount:
|
|
554
|
-
itemProps:
|
|
555
|
-
itemSize:
|
|
556
|
-
onResize:
|
|
557
|
-
overscanCount:
|
|
606
|
+
isRtl: A,
|
|
607
|
+
itemCount: r,
|
|
608
|
+
itemProps: L,
|
|
609
|
+
itemSize: n,
|
|
610
|
+
onResize: d,
|
|
611
|
+
overscanCount: x
|
|
558
612
|
}), {
|
|
559
|
-
getCellBounds:
|
|
560
|
-
getEstimatedSize:
|
|
561
|
-
startIndexOverscan:
|
|
562
|
-
startIndexVisible:
|
|
563
|
-
scrollToIndex:
|
|
564
|
-
stopIndexOverscan:
|
|
565
|
-
stopIndexVisible:
|
|
566
|
-
} =
|
|
567
|
-
containerElement:
|
|
568
|
-
containerStyle:
|
|
569
|
-
defaultContainerSize:
|
|
613
|
+
getCellBounds: E,
|
|
614
|
+
getEstimatedSize: V,
|
|
615
|
+
startIndexOverscan: Z,
|
|
616
|
+
startIndexVisible: ie,
|
|
617
|
+
scrollToIndex: K,
|
|
618
|
+
stopIndexOverscan: N,
|
|
619
|
+
stopIndexVisible: k
|
|
620
|
+
} = fe({
|
|
621
|
+
containerElement: I,
|
|
622
|
+
containerStyle: D,
|
|
623
|
+
defaultContainerSize: l,
|
|
624
|
+
defaultScrollOffset: v,
|
|
570
625
|
direction: "vertical",
|
|
571
|
-
itemCount:
|
|
572
|
-
itemProps:
|
|
573
|
-
itemSize:
|
|
574
|
-
onResize:
|
|
575
|
-
overscanCount:
|
|
626
|
+
itemCount: h,
|
|
627
|
+
itemProps: L,
|
|
628
|
+
itemSize: O,
|
|
629
|
+
onResize: d,
|
|
630
|
+
overscanCount: x
|
|
576
631
|
});
|
|
577
|
-
|
|
578
|
-
|
|
632
|
+
xe(
|
|
633
|
+
u,
|
|
579
634
|
() => ({
|
|
580
635
|
get element() {
|
|
581
|
-
return
|
|
636
|
+
return I;
|
|
582
637
|
},
|
|
583
638
|
scrollToCell({
|
|
584
|
-
behavior:
|
|
585
|
-
columnAlign:
|
|
586
|
-
columnIndex:
|
|
587
|
-
rowAlign:
|
|
588
|
-
rowIndex:
|
|
639
|
+
behavior: F = "auto",
|
|
640
|
+
columnAlign: S = "auto",
|
|
641
|
+
columnIndex: _,
|
|
642
|
+
rowAlign: Y = "auto",
|
|
643
|
+
rowIndex: B
|
|
589
644
|
}) {
|
|
590
|
-
const
|
|
591
|
-
align:
|
|
592
|
-
containerScrollOffset:
|
|
645
|
+
const se = w({
|
|
646
|
+
align: S,
|
|
647
|
+
containerScrollOffset: I?.scrollLeft ?? 0,
|
|
648
|
+
index: _
|
|
649
|
+
}), Se = K({
|
|
650
|
+
align: Y,
|
|
651
|
+
containerScrollOffset: I?.scrollTop ?? 0,
|
|
593
652
|
index: B
|
|
594
|
-
}), Ie = te({
|
|
595
|
-
align: U,
|
|
596
|
-
containerScrollOffset: w?.scrollTop ?? 0,
|
|
597
|
-
index: k
|
|
598
653
|
});
|
|
599
|
-
typeof
|
|
600
|
-
behavior:
|
|
601
|
-
left:
|
|
602
|
-
top:
|
|
654
|
+
typeof I?.scrollTo == "function" && I.scrollTo({
|
|
655
|
+
behavior: F,
|
|
656
|
+
left: se,
|
|
657
|
+
top: Se
|
|
603
658
|
});
|
|
604
659
|
},
|
|
605
660
|
scrollToColumn({
|
|
606
|
-
align:
|
|
607
|
-
behavior:
|
|
608
|
-
index:
|
|
661
|
+
align: F = "auto",
|
|
662
|
+
behavior: S = "auto",
|
|
663
|
+
index: _
|
|
609
664
|
}) {
|
|
610
|
-
const
|
|
611
|
-
align:
|
|
612
|
-
containerScrollOffset:
|
|
613
|
-
index:
|
|
665
|
+
const Y = w({
|
|
666
|
+
align: F,
|
|
667
|
+
containerScrollOffset: I?.scrollLeft ?? 0,
|
|
668
|
+
index: _
|
|
614
669
|
});
|
|
615
|
-
typeof
|
|
616
|
-
behavior:
|
|
617
|
-
left:
|
|
670
|
+
typeof I?.scrollTo == "function" && I.scrollTo({
|
|
671
|
+
behavior: S,
|
|
672
|
+
left: Y
|
|
618
673
|
});
|
|
619
674
|
},
|
|
620
675
|
scrollToRow({
|
|
621
|
-
align:
|
|
622
|
-
behavior:
|
|
623
|
-
index:
|
|
676
|
+
align: F = "auto",
|
|
677
|
+
behavior: S = "auto",
|
|
678
|
+
index: _
|
|
624
679
|
}) {
|
|
625
|
-
const
|
|
626
|
-
align:
|
|
627
|
-
containerScrollOffset:
|
|
628
|
-
index:
|
|
680
|
+
const Y = K({
|
|
681
|
+
align: F,
|
|
682
|
+
containerScrollOffset: I?.scrollTop ?? 0,
|
|
683
|
+
index: _
|
|
629
684
|
});
|
|
630
|
-
typeof
|
|
631
|
-
behavior:
|
|
632
|
-
top:
|
|
685
|
+
typeof I?.scrollTo == "function" && I.scrollTo({
|
|
686
|
+
behavior: S,
|
|
687
|
+
top: Y
|
|
633
688
|
});
|
|
634
689
|
}
|
|
635
690
|
}),
|
|
636
|
-
[
|
|
637
|
-
),
|
|
638
|
-
|
|
691
|
+
[I, w, K]
|
|
692
|
+
), ne(() => {
|
|
693
|
+
z >= 0 && y >= 0 && Z >= 0 && N >= 0 && p && p(
|
|
639
694
|
{
|
|
640
|
-
columnStartIndex:
|
|
641
|
-
columnStopIndex:
|
|
642
|
-
rowStartIndex:
|
|
643
|
-
rowStopIndex:
|
|
695
|
+
columnStartIndex: g,
|
|
696
|
+
columnStopIndex: T,
|
|
697
|
+
rowStartIndex: ie,
|
|
698
|
+
rowStopIndex: k
|
|
644
699
|
},
|
|
645
700
|
{
|
|
646
|
-
columnStartIndex:
|
|
647
|
-
columnStopIndex:
|
|
648
|
-
rowStartIndex:
|
|
649
|
-
rowStopIndex:
|
|
701
|
+
columnStartIndex: z,
|
|
702
|
+
columnStopIndex: y,
|
|
703
|
+
rowStartIndex: Z,
|
|
704
|
+
rowStopIndex: N
|
|
650
705
|
}
|
|
651
706
|
);
|
|
652
707
|
}, [
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
708
|
+
p,
|
|
709
|
+
z,
|
|
710
|
+
g,
|
|
711
|
+
y,
|
|
712
|
+
T,
|
|
713
|
+
Z,
|
|
714
|
+
ie,
|
|
715
|
+
N,
|
|
716
|
+
k
|
|
662
717
|
]);
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
666
|
-
for (let
|
|
667
|
-
const
|
|
668
|
-
for (let
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
|
|
718
|
+
const R = q(() => {
|
|
719
|
+
const F = [];
|
|
720
|
+
if (r > 0 && h > 0)
|
|
721
|
+
for (let S = Z; S <= N; S++) {
|
|
722
|
+
const _ = E(S), Y = [];
|
|
723
|
+
for (let B = z; B <= y; B++) {
|
|
724
|
+
const se = G(B);
|
|
725
|
+
Y.push(
|
|
726
|
+
/* @__PURE__ */ le(
|
|
727
|
+
j,
|
|
673
728
|
{
|
|
674
|
-
...
|
|
729
|
+
...L,
|
|
675
730
|
ariaAttributes: {
|
|
676
|
-
"aria-colindex":
|
|
731
|
+
"aria-colindex": B + 1,
|
|
677
732
|
role: "gridcell"
|
|
678
733
|
},
|
|
679
|
-
columnIndex:
|
|
734
|
+
columnIndex: B,
|
|
680
735
|
key: i ? i({
|
|
681
|
-
columnIndex:
|
|
682
|
-
data:
|
|
683
|
-
rowIndex:
|
|
684
|
-
}) :
|
|
685
|
-
rowIndex:
|
|
736
|
+
columnIndex: B,
|
|
737
|
+
data: L,
|
|
738
|
+
rowIndex: S
|
|
739
|
+
}) : B,
|
|
740
|
+
rowIndex: S,
|
|
686
741
|
style: {
|
|
687
742
|
position: "absolute",
|
|
688
|
-
left:
|
|
689
|
-
right:
|
|
690
|
-
transform: `translate(${
|
|
691
|
-
height:
|
|
692
|
-
width:
|
|
743
|
+
left: A ? void 0 : 0,
|
|
744
|
+
right: A ? 0 : void 0,
|
|
745
|
+
transform: `translate(${A ? -se.scrollOffset : se.scrollOffset}px, ${_.scrollOffset}px)`,
|
|
746
|
+
height: _.size,
|
|
747
|
+
width: se.size
|
|
693
748
|
}
|
|
694
749
|
}
|
|
695
750
|
)
|
|
696
751
|
);
|
|
697
752
|
}
|
|
698
|
-
|
|
753
|
+
F.push(
|
|
699
754
|
/* @__PURE__ */ re(
|
|
700
755
|
"div",
|
|
701
756
|
{
|
|
702
757
|
role: "row",
|
|
703
|
-
"aria-rowindex":
|
|
704
|
-
children:
|
|
758
|
+
"aria-rowindex": S + 1,
|
|
759
|
+
children: Y
|
|
705
760
|
},
|
|
706
|
-
|
|
707
|
-
data:
|
|
708
|
-
rowIndex:
|
|
709
|
-
}) :
|
|
761
|
+
b ? b({
|
|
762
|
+
data: L,
|
|
763
|
+
rowIndex: S
|
|
764
|
+
}) : S
|
|
710
765
|
)
|
|
711
766
|
);
|
|
712
767
|
}
|
|
713
|
-
return
|
|
768
|
+
return F;
|
|
714
769
|
}, [
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
770
|
+
j,
|
|
771
|
+
L,
|
|
772
|
+
r,
|
|
718
773
|
i,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
774
|
+
z,
|
|
775
|
+
y,
|
|
776
|
+
G,
|
|
777
|
+
E,
|
|
722
778
|
A,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
]), we = /* @__PURE__ */ re(
|
|
779
|
+
h,
|
|
780
|
+
b,
|
|
781
|
+
Z,
|
|
782
|
+
N
|
|
783
|
+
]), P = /* @__PURE__ */ re(
|
|
729
784
|
"div",
|
|
730
785
|
{
|
|
731
786
|
"aria-hidden": !0,
|
|
732
787
|
style: {
|
|
733
|
-
height:
|
|
734
|
-
width:
|
|
788
|
+
height: V(),
|
|
789
|
+
width: Q(),
|
|
735
790
|
zIndex: -1
|
|
736
791
|
}
|
|
737
792
|
}
|
|
738
793
|
);
|
|
739
|
-
return
|
|
740
|
-
|
|
794
|
+
return le(
|
|
795
|
+
m,
|
|
741
796
|
{
|
|
742
|
-
"aria-colcount":
|
|
743
|
-
"aria-rowcount":
|
|
797
|
+
"aria-colcount": r,
|
|
798
|
+
"aria-rowcount": h,
|
|
744
799
|
role: "grid",
|
|
745
|
-
...
|
|
746
|
-
className:
|
|
747
|
-
dir:
|
|
748
|
-
ref:
|
|
800
|
+
...X,
|
|
801
|
+
className: o,
|
|
802
|
+
dir: c,
|
|
803
|
+
ref: te,
|
|
749
804
|
style: {
|
|
750
805
|
position: "relative",
|
|
751
806
|
maxHeight: "100%",
|
|
752
807
|
maxWidth: "100%",
|
|
753
808
|
flexGrow: 1,
|
|
754
809
|
overflow: "auto",
|
|
755
|
-
...
|
|
810
|
+
...D
|
|
756
811
|
}
|
|
757
812
|
},
|
|
758
|
-
|
|
813
|
+
R,
|
|
759
814
|
s,
|
|
760
|
-
|
|
815
|
+
P
|
|
761
816
|
);
|
|
762
817
|
}
|
|
763
|
-
const
|
|
764
|
-
function
|
|
818
|
+
const Ge = M, Ne = H;
|
|
819
|
+
function $e({
|
|
820
|
+
callback: e,
|
|
821
|
+
element: t,
|
|
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]);
|
|
836
|
+
}
|
|
837
|
+
function He(e) {
|
|
765
838
|
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
766
839
|
}
|
|
767
|
-
function
|
|
840
|
+
function je({
|
|
768
841
|
element: e,
|
|
769
842
|
getCellBounds: t,
|
|
770
843
|
isDynamicRowHeight: s,
|
|
771
|
-
rowCount:
|
|
772
|
-
rowElements:
|
|
844
|
+
rowCount: o,
|
|
845
|
+
rowElements: r,
|
|
773
846
|
scrollToIndex: i
|
|
774
847
|
}) {
|
|
775
|
-
const
|
|
848
|
+
const n = H(null), l = H(
|
|
776
849
|
void 0
|
|
777
|
-
),
|
|
778
|
-
|
|
779
|
-
}),
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
id:
|
|
783
|
-
view:
|
|
850
|
+
), a = ee(() => {
|
|
851
|
+
n.current = null, l.current !== void 0 && (l.current.view.cancelAnimationFrame(l.current.id), l.current = void 0);
|
|
852
|
+
}), v = ee(() => {
|
|
853
|
+
const c = ae(e);
|
|
854
|
+
l.current = {
|
|
855
|
+
id: c.requestAnimationFrame(f),
|
|
856
|
+
view: c
|
|
784
857
|
};
|
|
785
|
-
}),
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
if (!
|
|
789
|
-
if (!e || !s ||
|
|
790
|
-
|
|
858
|
+
}), f = ee(() => {
|
|
859
|
+
l.current = void 0;
|
|
860
|
+
const c = n.current;
|
|
861
|
+
if (!c) return;
|
|
862
|
+
if (!e || !s || c.index >= o || performance.now() >= c.deadline) {
|
|
863
|
+
a();
|
|
791
864
|
return;
|
|
792
865
|
}
|
|
793
866
|
const u = i({
|
|
794
|
-
align:
|
|
867
|
+
align: c.align,
|
|
795
868
|
containerScrollOffset: e.scrollTop,
|
|
796
|
-
index:
|
|
869
|
+
index: c.index
|
|
797
870
|
});
|
|
798
871
|
if (u !== void 0) {
|
|
799
|
-
const
|
|
872
|
+
const p = Math.max(
|
|
800
873
|
0,
|
|
801
874
|
Math.min(u, e.scrollHeight - e.clientHeight)
|
|
802
875
|
);
|
|
803
|
-
if (Math.abs(
|
|
804
|
-
|
|
876
|
+
if (Math.abs(p - e.scrollTop) > 1)
|
|
877
|
+
c.stableFrames = 0, e.scrollTo({ behavior: "instant", top: p });
|
|
805
878
|
else {
|
|
806
|
-
const
|
|
807
|
-
if (!(
|
|
808
|
-
(
|
|
809
|
-
) &&
|
|
810
|
-
const
|
|
879
|
+
const d = r.current;
|
|
880
|
+
if (!(d.some(
|
|
881
|
+
(O) => O.getAttribute(oe) === `${c.index}`
|
|
882
|
+
) && d.every((O) => {
|
|
883
|
+
const b = Number(O.getAttribute(oe));
|
|
811
884
|
return Math.abs(
|
|
812
|
-
t(
|
|
885
|
+
t(b).size - O.offsetHeight
|
|
813
886
|
) <= 1;
|
|
814
887
|
})))
|
|
815
|
-
|
|
816
|
-
else if (++
|
|
817
|
-
|
|
888
|
+
c.stableFrames = 0;
|
|
889
|
+
else if (++c.stableFrames >= 2) {
|
|
890
|
+
a();
|
|
818
891
|
return;
|
|
819
892
|
}
|
|
820
893
|
}
|
|
821
894
|
}
|
|
822
|
-
|
|
895
|
+
v();
|
|
823
896
|
});
|
|
824
|
-
return
|
|
897
|
+
return W(() => {
|
|
825
898
|
if (!e) return;
|
|
826
|
-
const
|
|
899
|
+
const c = (u) => {
|
|
827
900
|
switch (u.key) {
|
|
828
901
|
case "ArrowUp":
|
|
829
902
|
case "ArrowDown":
|
|
@@ -832,204 +905,221 @@ function Re({
|
|
|
832
905
|
case "Home":
|
|
833
906
|
case "End":
|
|
834
907
|
case " ":
|
|
835
|
-
|
|
908
|
+
a();
|
|
836
909
|
}
|
|
837
910
|
};
|
|
838
|
-
return e.addEventListener("wheel",
|
|
839
|
-
|
|
911
|
+
return e.addEventListener("wheel", a, { passive: !0 }), e.addEventListener("touchstart", a, { passive: !0 }), e.addEventListener("pointerdown", a), e.addEventListener("keydown", c), () => {
|
|
912
|
+
a(), e.removeEventListener("wheel", a), e.removeEventListener("touchstart", a), e.removeEventListener("pointerdown", a), e.removeEventListener("keydown", c);
|
|
840
913
|
};
|
|
841
|
-
}, [
|
|
914
|
+
}, [a, e]), U(
|
|
842
915
|
({
|
|
843
|
-
align:
|
|
916
|
+
align: c = "auto",
|
|
844
917
|
behavior: u = "auto",
|
|
845
|
-
index:
|
|
918
|
+
index: p
|
|
846
919
|
}) => {
|
|
847
|
-
s &&
|
|
920
|
+
s && c === "smart" && (c = i({
|
|
848
921
|
align: "auto",
|
|
849
922
|
containerScrollOffset: e?.scrollTop ?? 0,
|
|
850
|
-
index:
|
|
923
|
+
index: p
|
|
851
924
|
}) === (e?.scrollTop ?? 0) ? "auto" : "center");
|
|
852
|
-
const
|
|
853
|
-
align:
|
|
925
|
+
const d = i({
|
|
926
|
+
align: c,
|
|
854
927
|
containerScrollOffset: e?.scrollTop ?? 0,
|
|
855
|
-
index:
|
|
928
|
+
index: p
|
|
856
929
|
});
|
|
857
|
-
|
|
858
|
-
align:
|
|
859
|
-
index:
|
|
930
|
+
a(), typeof e?.scrollTo == "function" && (s && (n.current = {
|
|
931
|
+
align: c,
|
|
932
|
+
index: p,
|
|
860
933
|
deadline: performance.now() + 1e3,
|
|
861
934
|
stableFrames: 0
|
|
862
|
-
},
|
|
935
|
+
}, v()), e.scrollTo({
|
|
863
936
|
behavior: s ? "instant" : u,
|
|
864
|
-
top:
|
|
937
|
+
top: d
|
|
865
938
|
}));
|
|
866
939
|
},
|
|
867
940
|
[
|
|
868
|
-
|
|
941
|
+
a,
|
|
869
942
|
e,
|
|
870
943
|
s,
|
|
871
|
-
|
|
944
|
+
v,
|
|
872
945
|
i
|
|
873
946
|
]
|
|
874
947
|
);
|
|
875
948
|
}
|
|
876
|
-
const
|
|
877
|
-
function
|
|
949
|
+
const oe = "data-react-window-index", ve = "data-react-window-sizer";
|
|
950
|
+
function _e({
|
|
878
951
|
children: e,
|
|
879
952
|
className: t,
|
|
880
953
|
defaultHeight: s = 0,
|
|
954
|
+
defaultScrollOffset: o = 0,
|
|
881
955
|
listRef: r,
|
|
882
|
-
onResize:
|
|
883
|
-
onRowsRendered:
|
|
956
|
+
onResize: i,
|
|
957
|
+
onRowsRendered: n,
|
|
884
958
|
overscanCount: l = 3,
|
|
885
959
|
rowComponent: a,
|
|
886
|
-
rowCount:
|
|
960
|
+
rowCount: v,
|
|
887
961
|
rowHeight: f,
|
|
888
|
-
rowKey:
|
|
889
|
-
rowProps:
|
|
890
|
-
tagName:
|
|
962
|
+
rowKey: c,
|
|
963
|
+
rowProps: u,
|
|
964
|
+
tagName: p = "div",
|
|
891
965
|
style: d,
|
|
892
|
-
...
|
|
966
|
+
...x
|
|
893
967
|
}) {
|
|
894
|
-
const
|
|
895
|
-
() =>
|
|
968
|
+
const h = me(u), O = q(
|
|
969
|
+
() => be(a, ye),
|
|
896
970
|
[a]
|
|
897
|
-
), [
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
971
|
+
), [b, D] = M(null), m = He(f), X = q(() => m ? (k) => f.getRowHeight(k) ?? f.getAverageRowHeight() : f, [m, f]), L = Ie(), [j, I] = M(
|
|
972
|
+
() => L && m
|
|
973
|
+
), te = H(f);
|
|
974
|
+
W(() => {
|
|
975
|
+
j && te.current !== f && I(!1);
|
|
976
|
+
}, [j, f]), $e({
|
|
977
|
+
callback: () => I(!1),
|
|
978
|
+
element: b,
|
|
979
|
+
enabled: j
|
|
980
|
+
});
|
|
981
|
+
const {
|
|
982
|
+
getCellBounds: A,
|
|
983
|
+
getEstimatedSize: G,
|
|
984
|
+
scrollToIndex: Q,
|
|
985
|
+
startIndexOverscan: z,
|
|
986
|
+
startIndexVisible: g,
|
|
987
|
+
stopIndexOverscan: w,
|
|
988
|
+
stopIndexVisible: y
|
|
989
|
+
} = fe({
|
|
990
|
+
containerElement: b,
|
|
907
991
|
containerStyle: d,
|
|
908
992
|
defaultContainerSize: s,
|
|
993
|
+
defaultScrollOffset: o,
|
|
909
994
|
direction: "vertical",
|
|
910
|
-
itemCount:
|
|
911
|
-
itemProps:
|
|
912
|
-
itemSize:
|
|
913
|
-
onResize:
|
|
995
|
+
itemCount: v,
|
|
996
|
+
itemProps: h,
|
|
997
|
+
itemSize: X,
|
|
998
|
+
onResize: i,
|
|
914
999
|
overscanCount: l
|
|
915
|
-
}),
|
|
916
|
-
element:
|
|
917
|
-
getCellBounds:
|
|
918
|
-
isDynamicRowHeight:
|
|
919
|
-
rowCount:
|
|
920
|
-
rowElements:
|
|
921
|
-
scrollToIndex:
|
|
1000
|
+
}), T = H([]), E = je({
|
|
1001
|
+
element: b,
|
|
1002
|
+
getCellBounds: A,
|
|
1003
|
+
isDynamicRowHeight: m,
|
|
1004
|
+
rowCount: v,
|
|
1005
|
+
rowElements: T,
|
|
1006
|
+
scrollToIndex: Q
|
|
922
1007
|
});
|
|
923
|
-
|
|
1008
|
+
xe(
|
|
924
1009
|
r,
|
|
925
1010
|
() => ({
|
|
926
1011
|
get element() {
|
|
927
|
-
return
|
|
1012
|
+
return b;
|
|
928
1013
|
},
|
|
929
|
-
scrollToRow:
|
|
1014
|
+
scrollToRow: E
|
|
930
1015
|
}),
|
|
931
|
-
[
|
|
932
|
-
),
|
|
933
|
-
if (!
|
|
1016
|
+
[b, E]
|
|
1017
|
+
), W(() => {
|
|
1018
|
+
if (!b)
|
|
934
1019
|
return;
|
|
935
|
-
const
|
|
1020
|
+
const k = Array.from(b.children).slice(
|
|
936
1021
|
0,
|
|
937
|
-
|
|
938
|
-
).filter((
|
|
939
|
-
if (
|
|
1022
|
+
z < 0 ? 0 : w - z + 1
|
|
1023
|
+
).filter((R, P) => {
|
|
1024
|
+
if (R.hasAttribute(ve))
|
|
940
1025
|
return !1;
|
|
941
|
-
const
|
|
942
|
-
return
|
|
1026
|
+
const F = `${z + P}`;
|
|
1027
|
+
return R.setAttribute(oe, F), !0;
|
|
943
1028
|
});
|
|
944
|
-
if (
|
|
945
|
-
return f.observeRowElements(
|
|
1029
|
+
if (T.current = k, m)
|
|
1030
|
+
return f.observeRowElements(k);
|
|
946
1031
|
}, [
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
1032
|
+
O,
|
|
1033
|
+
b,
|
|
1034
|
+
m,
|
|
1035
|
+
v,
|
|
951
1036
|
f,
|
|
1037
|
+
c,
|
|
952
1038
|
h,
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
I >= 0 && b >= 0 && i && i(
|
|
1039
|
+
z,
|
|
1040
|
+
w
|
|
1041
|
+
]), ne(() => {
|
|
1042
|
+
z >= 0 && w >= 0 && n && n(
|
|
958
1043
|
{
|
|
959
|
-
startIndex:
|
|
960
|
-
stopIndex:
|
|
1044
|
+
startIndex: g,
|
|
1045
|
+
stopIndex: y
|
|
961
1046
|
},
|
|
962
1047
|
{
|
|
963
|
-
startIndex:
|
|
964
|
-
stopIndex:
|
|
1048
|
+
startIndex: z,
|
|
1049
|
+
stopIndex: w
|
|
965
1050
|
}
|
|
966
1051
|
);
|
|
967
1052
|
}, [
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1053
|
+
n,
|
|
1054
|
+
z,
|
|
1055
|
+
g,
|
|
1056
|
+
w,
|
|
1057
|
+
y
|
|
973
1058
|
]);
|
|
974
|
-
const
|
|
975
|
-
const
|
|
976
|
-
if (
|
|
977
|
-
for (let
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
/* @__PURE__ */
|
|
981
|
-
|
|
1059
|
+
const V = j && m && z === 0, Z = q(() => {
|
|
1060
|
+
const k = [];
|
|
1061
|
+
if (v > 0)
|
|
1062
|
+
for (let R = z; R <= w; R++) {
|
|
1063
|
+
const P = A(R);
|
|
1064
|
+
k.push(
|
|
1065
|
+
/* @__PURE__ */ le(
|
|
1066
|
+
O,
|
|
982
1067
|
{
|
|
983
|
-
...
|
|
1068
|
+
...h,
|
|
984
1069
|
ariaAttributes: {
|
|
985
|
-
"aria-posinset":
|
|
986
|
-
"aria-setsize":
|
|
1070
|
+
"aria-posinset": R + 1,
|
|
1071
|
+
"aria-setsize": v,
|
|
987
1072
|
role: "listitem"
|
|
988
1073
|
},
|
|
989
|
-
key:
|
|
990
|
-
index:
|
|
991
|
-
style: {
|
|
1074
|
+
key: c ? c(R, h) : R,
|
|
1075
|
+
index: R,
|
|
1076
|
+
style: V ? { width: "100%" } : {
|
|
992
1077
|
position: "absolute",
|
|
993
1078
|
left: 0,
|
|
994
|
-
transform: `translateY(${
|
|
1079
|
+
transform: `translateY(${P.scrollOffset}px)`,
|
|
995
1080
|
// In case of dynamic row heights, don't specify a height style
|
|
996
1081
|
// otherwise a default/estimated height would mask the actual height
|
|
997
|
-
height:
|
|
1082
|
+
height: m ? void 0 : P.size,
|
|
998
1083
|
width: "100%"
|
|
999
1084
|
}
|
|
1000
1085
|
}
|
|
1001
1086
|
)
|
|
1002
1087
|
);
|
|
1003
1088
|
}
|
|
1004
|
-
return
|
|
1089
|
+
return k;
|
|
1005
1090
|
}, [
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1091
|
+
O,
|
|
1092
|
+
A,
|
|
1093
|
+
m,
|
|
1094
|
+
V,
|
|
1095
|
+
v,
|
|
1009
1096
|
c,
|
|
1010
1097
|
h,
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
]), q = /* @__PURE__ */ re(
|
|
1098
|
+
z,
|
|
1099
|
+
w
|
|
1100
|
+
]), ie = /* @__PURE__ */ re(
|
|
1015
1101
|
"div",
|
|
1016
1102
|
{
|
|
1017
1103
|
"aria-hidden": !0,
|
|
1018
|
-
[
|
|
1104
|
+
[ve]: "",
|
|
1019
1105
|
style: {
|
|
1020
|
-
|
|
1106
|
+
// Rows rendered in flow layout already take up space
|
|
1107
|
+
position: V ? "absolute" : void 0,
|
|
1108
|
+
top: V ? 0 : void 0,
|
|
1109
|
+
height: G(),
|
|
1021
1110
|
width: "100%",
|
|
1022
1111
|
zIndex: -1
|
|
1023
1112
|
}
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1113
|
+
},
|
|
1114
|
+
"sizer"
|
|
1115
|
+
), K = /* @__PURE__ */ re(ue, { children: e }, "children"), N = /* @__PURE__ */ re(ue, { children: Z }, "rows");
|
|
1116
|
+
return le(
|
|
1117
|
+
p,
|
|
1028
1118
|
{
|
|
1029
1119
|
role: "list",
|
|
1030
|
-
...
|
|
1120
|
+
...x,
|
|
1031
1121
|
className: t,
|
|
1032
|
-
ref:
|
|
1122
|
+
ref: D,
|
|
1033
1123
|
style: {
|
|
1034
1124
|
position: "relative",
|
|
1035
1125
|
maxHeight: "100%",
|
|
@@ -1038,113 +1128,121 @@ function He({
|
|
|
1038
1128
|
...d
|
|
1039
1129
|
}
|
|
1040
1130
|
},
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
q
|
|
1131
|
+
...V ? [K, N] : [N, K],
|
|
1132
|
+
ie
|
|
1044
1133
|
);
|
|
1045
1134
|
}
|
|
1046
|
-
function
|
|
1135
|
+
function pe(e) {
|
|
1136
|
+
const t = /* @__PURE__ */ new Map();
|
|
1137
|
+
return e !== void 0 && e.forEach((s, o) => {
|
|
1138
|
+
Number.isFinite(s) && s > 0 && t.set(o, s);
|
|
1139
|
+
}), t;
|
|
1140
|
+
}
|
|
1141
|
+
function Ye({
|
|
1047
1142
|
defaultRowHeight: e,
|
|
1048
|
-
|
|
1143
|
+
initialRowHeights: t,
|
|
1144
|
+
key: s
|
|
1049
1145
|
}) {
|
|
1050
|
-
const [
|
|
1051
|
-
key:
|
|
1052
|
-
map:
|
|
1146
|
+
const [o, r] = M(() => ({
|
|
1147
|
+
key: s,
|
|
1148
|
+
map: pe(t)
|
|
1149
|
+
}));
|
|
1150
|
+
o.key !== s && r({
|
|
1151
|
+
key: s,
|
|
1152
|
+
map: pe(t)
|
|
1053
1153
|
});
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}, [e, n]), l = $(
|
|
1064
|
-
(o) => {
|
|
1065
|
-
const u = n.get(o);
|
|
1066
|
-
return u !== void 0 ? u : e;
|
|
1154
|
+
const { map: i } = o, n = U(() => {
|
|
1155
|
+
let u = 0;
|
|
1156
|
+
return i.forEach((p) => {
|
|
1157
|
+
u += p;
|
|
1158
|
+
}), u === 0 ? e : u / i.size;
|
|
1159
|
+
}, [e, i]), l = U(
|
|
1160
|
+
(u) => {
|
|
1161
|
+
const p = i.get(u);
|
|
1162
|
+
return p !== void 0 ? p : e;
|
|
1067
1163
|
},
|
|
1068
|
-
[e,
|
|
1069
|
-
), a =
|
|
1164
|
+
[e, i]
|
|
1165
|
+
), a = U((u, p) => {
|
|
1070
1166
|
r((d) => {
|
|
1071
|
-
if (d.map.get(
|
|
1167
|
+
if (d.map.get(u) === p)
|
|
1072
1168
|
return d;
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1169
|
+
const x = new Map(d.map);
|
|
1170
|
+
return x.set(u, p), {
|
|
1075
1171
|
...d,
|
|
1076
|
-
map:
|
|
1172
|
+
map: x
|
|
1077
1173
|
};
|
|
1078
1174
|
});
|
|
1079
|
-
}, []),
|
|
1080
|
-
(
|
|
1081
|
-
|
|
1082
|
-
const { borderBoxSize: d, target:
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
`Invalid ${
|
|
1175
|
+
}, []), v = ee(
|
|
1176
|
+
(u) => {
|
|
1177
|
+
u.length !== 0 && u.forEach((p) => {
|
|
1178
|
+
const { borderBoxSize: d, target: x } = p, h = x.getAttribute(oe);
|
|
1179
|
+
$(
|
|
1180
|
+
h !== null,
|
|
1181
|
+
`Invalid ${oe} attribute value`
|
|
1086
1182
|
);
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1183
|
+
const O = parseInt(h), { blockSize: b } = d[0];
|
|
1184
|
+
b && a(O, b);
|
|
1089
1185
|
});
|
|
1090
1186
|
}
|
|
1091
|
-
), f =
|
|
1092
|
-
|
|
1187
|
+
), f = H(null);
|
|
1188
|
+
ne(
|
|
1093
1189
|
() => () => {
|
|
1094
1190
|
f.current?.resizeObserver.disconnect(), f.current = null;
|
|
1095
1191
|
},
|
|
1096
1192
|
[]
|
|
1097
1193
|
);
|
|
1098
|
-
const
|
|
1099
|
-
(
|
|
1100
|
-
const
|
|
1101
|
-
return
|
|
1102
|
-
const
|
|
1103
|
-
if (f.current?.view !==
|
|
1194
|
+
const c = U(
|
|
1195
|
+
(u) => {
|
|
1196
|
+
const p = [];
|
|
1197
|
+
return u.forEach((d) => {
|
|
1198
|
+
const x = ae(d);
|
|
1199
|
+
if (f.current?.view !== x) {
|
|
1104
1200
|
f.current?.resizeObserver.disconnect();
|
|
1105
|
-
const
|
|
1106
|
-
f.current =
|
|
1107
|
-
resizeObserver: new
|
|
1108
|
-
view:
|
|
1201
|
+
const O = Oe(d);
|
|
1202
|
+
f.current = O ? {
|
|
1203
|
+
resizeObserver: new O(v),
|
|
1204
|
+
view: x
|
|
1109
1205
|
} : null;
|
|
1110
1206
|
}
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1207
|
+
const h = f.current?.resizeObserver;
|
|
1208
|
+
h && (h.observe(d), p.push([d, h]));
|
|
1113
1209
|
}), () => {
|
|
1114
|
-
|
|
1115
|
-
([d,
|
|
1210
|
+
p.forEach(
|
|
1211
|
+
([d, x]) => x.unobserve(d)
|
|
1116
1212
|
);
|
|
1117
1213
|
};
|
|
1118
1214
|
},
|
|
1119
|
-
[
|
|
1215
|
+
[v]
|
|
1120
1216
|
);
|
|
1121
|
-
return
|
|
1217
|
+
return q(
|
|
1122
1218
|
() => ({
|
|
1123
|
-
getAverageRowHeight:
|
|
1219
|
+
getAverageRowHeight: n,
|
|
1124
1220
|
getRowHeight: l,
|
|
1125
1221
|
setRowHeight: a,
|
|
1126
|
-
observeRowElements:
|
|
1222
|
+
observeRowElements: c
|
|
1127
1223
|
}),
|
|
1128
|
-
[
|
|
1224
|
+
[n, l, a, c]
|
|
1129
1225
|
);
|
|
1130
1226
|
}
|
|
1131
|
-
const
|
|
1132
|
-
function
|
|
1133
|
-
|
|
1227
|
+
const De = M, Xe = H, ge = /* @__PURE__ */ new WeakMap();
|
|
1228
|
+
function Ze(e = !1, t = typeof document < "u" ? document : void 0) {
|
|
1229
|
+
if (t === void 0)
|
|
1230
|
+
return 0;
|
|
1231
|
+
let s = ge.get(t);
|
|
1134
1232
|
if (s === void 0 || e) {
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1233
|
+
const o = t.createElement("div"), r = o.style;
|
|
1234
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", t.body.appendChild(o), s = o.offsetWidth - o.clientWidth, t.body.removeChild(o), ge.set(t, s);
|
|
1137
1235
|
}
|
|
1138
1236
|
return s;
|
|
1139
1237
|
}
|
|
1140
1238
|
export {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1239
|
+
qe as Grid,
|
|
1240
|
+
_e as List,
|
|
1241
|
+
Ze as getScrollbarSize,
|
|
1242
|
+
Ye as useDynamicRowHeight,
|
|
1243
|
+
Ge as useGridCallbackRef,
|
|
1244
|
+
Ne as useGridRef,
|
|
1245
|
+
De as useListCallbackRef,
|
|
1246
|
+
Xe as useListRef
|
|
1149
1247
|
};
|
|
1150
1248
|
//# sourceMappingURL=react-window.js.map
|