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