react-window 2.2.7 → 2.3.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 +33 -0
- package/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +45 -2
- package/dist/react-window.js +515 -494
- package/dist/react-window.js.map +1 -1
- package/package.json +30 -28
package/dist/react-window.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
function
|
|
2
|
+
import { jsx as se } from "react/jsx-runtime";
|
|
3
|
+
import { useState as L, useLayoutEffect as ie, useEffect as Z, useMemo as R, useRef as P, useCallback as B, memo as ae, useImperativeHandle as fe, createElement as Q } from "react";
|
|
4
|
+
function be(e) {
|
|
5
5
|
let t = e;
|
|
6
6
|
for (; t; ) {
|
|
7
7
|
if (t.dir)
|
|
@@ -10,14 +10,14 @@ function xe(e) {
|
|
|
10
10
|
}
|
|
11
11
|
return !1;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const [s, r] =
|
|
15
|
-
return
|
|
16
|
-
e && (t || r(
|
|
13
|
+
function Ie(e, t) {
|
|
14
|
+
const [s, r] = L(t === "rtl");
|
|
15
|
+
return ie(() => {
|
|
16
|
+
e && (t || r(be(e)));
|
|
17
17
|
}, [t, e]), s;
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
function
|
|
19
|
+
const J = typeof window < "u" ? ie : Z;
|
|
20
|
+
function ce(e) {
|
|
21
21
|
if (e !== void 0)
|
|
22
22
|
switch (typeof e) {
|
|
23
23
|
case "number":
|
|
@@ -29,101 +29,101 @@ function ie(e) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function we({
|
|
33
33
|
box: e,
|
|
34
34
|
defaultHeight: t,
|
|
35
35
|
defaultWidth: s,
|
|
36
36
|
disabled: r,
|
|
37
37
|
element: n,
|
|
38
|
-
mode:
|
|
39
|
-
style:
|
|
38
|
+
mode: i,
|
|
39
|
+
style: l
|
|
40
40
|
}) {
|
|
41
|
-
const { styleHeight: f, styleWidth:
|
|
41
|
+
const { styleHeight: f, styleWidth: a } = R(
|
|
42
42
|
() => ({
|
|
43
|
-
styleHeight:
|
|
44
|
-
styleWidth:
|
|
43
|
+
styleHeight: ce(l?.height),
|
|
44
|
+
styleWidth: ce(l?.width)
|
|
45
45
|
}),
|
|
46
|
-
[
|
|
47
|
-
), [
|
|
46
|
+
[l?.height, l?.width]
|
|
47
|
+
), [o, d] = L({
|
|
48
48
|
height: t,
|
|
49
49
|
width: s
|
|
50
|
-
}),
|
|
51
|
-
return
|
|
52
|
-
if (n === null ||
|
|
50
|
+
}), c = r || i === "only-height" && f !== void 0 || i === "only-width" && a !== void 0 || f !== void 0 && a !== void 0;
|
|
51
|
+
return J(() => {
|
|
52
|
+
if (n === null || c)
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
55
|
-
for (const I of
|
|
56
|
-
const { contentRect:
|
|
57
|
-
n ===
|
|
58
|
-
height:
|
|
59
|
-
width:
|
|
54
|
+
const g = new ResizeObserver((x) => {
|
|
55
|
+
for (const I of x) {
|
|
56
|
+
const { contentRect: h, target: z } = I;
|
|
57
|
+
n === z && d((u) => u.height === h.height && u.width === h.width ? u : {
|
|
58
|
+
height: h.height,
|
|
59
|
+
width: h.width
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
return
|
|
64
|
-
|
|
63
|
+
return g.observe(n, { box: e }), () => {
|
|
64
|
+
g?.unobserve(n);
|
|
65
65
|
};
|
|
66
|
-
}, [e,
|
|
66
|
+
}, [e, c, n, f, a]), R(
|
|
67
67
|
() => ({
|
|
68
|
-
height: f ??
|
|
69
|
-
width:
|
|
68
|
+
height: f ?? o.height,
|
|
69
|
+
width: a ?? o.width
|
|
70
70
|
}),
|
|
71
|
-
[
|
|
71
|
+
[o, f, a]
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const t =
|
|
76
|
-
throw new Error("Cannot call
|
|
74
|
+
function de(e) {
|
|
75
|
+
const t = P(() => {
|
|
76
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
77
77
|
});
|
|
78
|
-
return
|
|
78
|
+
return J(() => {
|
|
79
79
|
t.current = e;
|
|
80
|
-
}, [e]),
|
|
80
|
+
}, [e]), B((...s) => t.current?.(...s), [t]);
|
|
81
81
|
}
|
|
82
|
-
let
|
|
83
|
-
function
|
|
84
|
-
if (
|
|
82
|
+
let F = null;
|
|
83
|
+
function me(e = !1) {
|
|
84
|
+
if (F === null || e) {
|
|
85
85
|
const t = document.createElement("div"), s = t.style;
|
|
86
86
|
s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
|
|
87
87
|
const r = document.createElement("div"), n = r.style;
|
|
88
|
-
return n.width = "100px", n.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
88
|
+
return n.width = "100px", n.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? F = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? F = "negative" : F = "positive-ascending"), document.body.removeChild(t), F;
|
|
89
89
|
}
|
|
90
|
-
return
|
|
90
|
+
return F;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function C({
|
|
93
93
|
containerElement: e,
|
|
94
94
|
direction: t,
|
|
95
95
|
isRtl: s,
|
|
96
96
|
scrollOffset: r
|
|
97
97
|
}) {
|
|
98
98
|
if (t === "horizontal" && s)
|
|
99
|
-
switch (
|
|
99
|
+
switch (me()) {
|
|
100
100
|
case "negative":
|
|
101
101
|
return -r;
|
|
102
102
|
case "positive-descending": {
|
|
103
103
|
if (e) {
|
|
104
|
-
const { clientWidth: n, scrollLeft:
|
|
105
|
-
return
|
|
104
|
+
const { clientWidth: n, scrollLeft: i, scrollWidth: l } = e;
|
|
105
|
+
return l - n - i;
|
|
106
106
|
}
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
return r;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function k(e, t = "Assertion error") {
|
|
113
113
|
if (!e)
|
|
114
114
|
throw console.error(t), Error(t);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function X(e, t) {
|
|
117
117
|
if (e === t)
|
|
118
118
|
return !0;
|
|
119
|
-
if (!!e != !!t || (
|
|
119
|
+
if (!!e != !!t || (k(e !== void 0), k(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
|
|
120
120
|
return !1;
|
|
121
121
|
for (const s in e)
|
|
122
122
|
if (!Object.is(t[s], e[s]))
|
|
123
123
|
return !1;
|
|
124
124
|
return !0;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function ue({
|
|
127
127
|
cachedBounds: e,
|
|
128
128
|
itemCount: t,
|
|
129
129
|
itemSize: s
|
|
@@ -136,76 +136,76 @@ function fe({
|
|
|
136
136
|
const r = e.get(
|
|
137
137
|
e.size === 0 ? 0 : e.size - 1
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
k(r !== void 0, "Unexpected bounds cache miss");
|
|
140
140
|
const n = (r.scrollOffset + r.size) / e.size;
|
|
141
141
|
return t * n;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Oe({
|
|
145
145
|
align: e,
|
|
146
146
|
cachedBounds: t,
|
|
147
147
|
index: s,
|
|
148
148
|
itemCount: r,
|
|
149
149
|
itemSize: n,
|
|
150
|
-
containerScrollOffset:
|
|
151
|
-
containerSize:
|
|
150
|
+
containerScrollOffset: i,
|
|
151
|
+
containerSize: l
|
|
152
152
|
}) {
|
|
153
153
|
if (s < 0 || s >= r)
|
|
154
154
|
throw RangeError(`Invalid index specified: ${s}`, {
|
|
155
155
|
cause: `Index ${s} is not within the range of 0 - ${r - 1}`
|
|
156
156
|
});
|
|
157
|
-
const f =
|
|
157
|
+
const f = ue({
|
|
158
158
|
cachedBounds: t,
|
|
159
159
|
itemCount: r,
|
|
160
160
|
itemSize: n
|
|
161
|
-
}),
|
|
161
|
+
}), a = t.get(s), o = Math.max(
|
|
162
162
|
0,
|
|
163
|
-
Math.min(f -
|
|
163
|
+
Math.min(f - l, a.scrollOffset)
|
|
164
164
|
), d = Math.max(
|
|
165
165
|
0,
|
|
166
|
-
|
|
166
|
+
a.scrollOffset - l + a.size
|
|
167
167
|
);
|
|
168
|
-
switch (e === "smart" && (
|
|
168
|
+
switch (e === "smart" && (i >= d && i <= o ? e = "auto" : e = "center"), e) {
|
|
169
169
|
case "start":
|
|
170
|
-
return
|
|
170
|
+
return o;
|
|
171
171
|
case "end":
|
|
172
172
|
return d;
|
|
173
173
|
case "center":
|
|
174
|
-
return
|
|
174
|
+
return a.scrollOffset <= l / 2 ? 0 : a.scrollOffset + a.size / 2 >= f - l / 2 ? f - l : a.scrollOffset + a.size / 2 - l / 2;
|
|
175
175
|
case "auto":
|
|
176
176
|
default:
|
|
177
|
-
return
|
|
177
|
+
return i >= d && i <= o ? i : i < d ? d : o;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function ee({
|
|
181
181
|
cachedBounds: e,
|
|
182
182
|
containerScrollOffset: t,
|
|
183
183
|
containerSize: s,
|
|
184
184
|
itemCount: r,
|
|
185
185
|
overscanCount: n
|
|
186
186
|
}) {
|
|
187
|
-
const
|
|
188
|
-
let
|
|
189
|
-
for (; d <
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
187
|
+
const i = r - 1;
|
|
188
|
+
let l = 0, f = -1, a = 0, o = -1, d = 0;
|
|
189
|
+
for (; d < i; ) {
|
|
190
|
+
const c = e.get(d);
|
|
191
|
+
if (c.scrollOffset + c.size > t)
|
|
192
192
|
break;
|
|
193
193
|
d++;
|
|
194
194
|
}
|
|
195
|
-
for (
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
195
|
+
for (l = d, a = Math.max(0, l - n); d < i; ) {
|
|
196
|
+
const c = e.get(d);
|
|
197
|
+
if (c.scrollOffset + c.size >= t + s)
|
|
198
198
|
break;
|
|
199
199
|
d++;
|
|
200
200
|
}
|
|
201
|
-
return f = Math.min(
|
|
202
|
-
startIndexVisible:
|
|
201
|
+
return f = Math.min(i, d), o = Math.min(r - 1, f + n), l < 0 && (l = 0, f = -1, a = 0, o = -1), {
|
|
202
|
+
startIndexVisible: l,
|
|
203
203
|
stopIndexVisible: f,
|
|
204
|
-
startIndexOverscan:
|
|
205
|
-
stopIndexOverscan:
|
|
204
|
+
startIndexOverscan: a,
|
|
205
|
+
stopIndexOverscan: o
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function ye({
|
|
209
209
|
itemCount: e,
|
|
210
210
|
itemProps: t,
|
|
211
211
|
itemSize: s
|
|
@@ -213,12 +213,12 @@ function me({
|
|
|
213
213
|
const r = /* @__PURE__ */ new Map();
|
|
214
214
|
return {
|
|
215
215
|
get(n) {
|
|
216
|
-
for (
|
|
217
|
-
const
|
|
216
|
+
for (k(n < e, `Invalid index ${n}`); r.size - 1 < n; ) {
|
|
217
|
+
const l = r.size;
|
|
218
218
|
let f;
|
|
219
219
|
switch (typeof s) {
|
|
220
220
|
case "function": {
|
|
221
|
-
f = s(
|
|
221
|
+
f = s(l, t);
|
|
222
222
|
break;
|
|
223
223
|
}
|
|
224
224
|
case "number": {
|
|
@@ -226,43 +226,43 @@ function me({
|
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
if (
|
|
230
|
-
r.set(
|
|
229
|
+
if (l === 0)
|
|
230
|
+
r.set(l, {
|
|
231
231
|
size: f,
|
|
232
232
|
scrollOffset: 0
|
|
233
233
|
});
|
|
234
234
|
else {
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
const a = r.get(l - 1);
|
|
236
|
+
k(
|
|
237
|
+
a !== void 0,
|
|
238
238
|
`Unexpected bounds cache miss for index ${n}`
|
|
239
|
-
), r.set(
|
|
240
|
-
scrollOffset:
|
|
239
|
+
), r.set(l, {
|
|
240
|
+
scrollOffset: a.scrollOffset + a.size,
|
|
241
241
|
size: f
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
const
|
|
246
|
-
return
|
|
247
|
-
|
|
245
|
+
const i = r.get(n);
|
|
246
|
+
return k(
|
|
247
|
+
i !== void 0,
|
|
248
248
|
`Unexpected bounds cache miss for index ${n}`
|
|
249
|
-
),
|
|
249
|
+
), i;
|
|
250
250
|
},
|
|
251
|
-
set(n,
|
|
252
|
-
r.set(n,
|
|
251
|
+
set(n, i) {
|
|
252
|
+
r.set(n, i);
|
|
253
253
|
},
|
|
254
254
|
get size() {
|
|
255
255
|
return r.size;
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function ze({
|
|
260
260
|
itemCount: e,
|
|
261
261
|
itemProps: t,
|
|
262
262
|
itemSize: s
|
|
263
263
|
}) {
|
|
264
|
-
return
|
|
265
|
-
() =>
|
|
264
|
+
return R(
|
|
265
|
+
() => ye({
|
|
266
266
|
itemCount: e,
|
|
267
267
|
itemProps: t,
|
|
268
268
|
itemSize: s
|
|
@@ -270,17 +270,17 @@ function Oe({
|
|
|
270
270
|
[e, t, s]
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Se({
|
|
274
274
|
containerSize: e,
|
|
275
275
|
itemSize: t
|
|
276
276
|
}) {
|
|
277
277
|
let s;
|
|
278
278
|
switch (typeof t) {
|
|
279
279
|
case "string": {
|
|
280
|
-
|
|
280
|
+
k(
|
|
281
281
|
t.endsWith("%"),
|
|
282
282
|
`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
|
|
283
|
-
),
|
|
283
|
+
), k(
|
|
284
284
|
e !== void 0,
|
|
285
285
|
"Container size must be defined if a percentage item size is specified"
|
|
286
286
|
), s = e * parseInt(t) / 100;
|
|
@@ -293,397 +293,416 @@ function ye({
|
|
|
293
293
|
}
|
|
294
294
|
return s;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function re({
|
|
297
297
|
containerElement: e,
|
|
298
298
|
containerStyle: t,
|
|
299
299
|
defaultContainerSize: s = 0,
|
|
300
300
|
direction: r,
|
|
301
301
|
isRtl: n = !1,
|
|
302
|
-
itemCount:
|
|
303
|
-
itemProps:
|
|
302
|
+
itemCount: i,
|
|
303
|
+
itemProps: l,
|
|
304
304
|
itemSize: f,
|
|
305
|
-
onResize:
|
|
306
|
-
overscanCount:
|
|
305
|
+
onResize: a,
|
|
306
|
+
overscanCount: o
|
|
307
307
|
}) {
|
|
308
|
-
const { height: d = s, width:
|
|
308
|
+
const { height: d = s, width: c = s } = we({
|
|
309
309
|
defaultHeight: r === "vertical" ? s : void 0,
|
|
310
310
|
defaultWidth: r === "horizontal" ? s : void 0,
|
|
311
311
|
element: e,
|
|
312
312
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
313
313
|
style: t
|
|
314
|
-
}),
|
|
314
|
+
}), g = P({
|
|
315
315
|
height: 0,
|
|
316
316
|
width: 0
|
|
317
|
-
}),
|
|
318
|
-
|
|
319
|
-
if (typeof
|
|
320
|
-
const
|
|
321
|
-
(
|
|
317
|
+
}), x = r === "vertical" ? d : c, I = Se({ containerSize: x, itemSize: f });
|
|
318
|
+
ie(() => {
|
|
319
|
+
if (typeof a == "function") {
|
|
320
|
+
const p = g.current;
|
|
321
|
+
(p.height !== d || p.width !== c) && (a({ height: d, width: c }, { ...p }), p.height = d, p.width = c);
|
|
322
322
|
}
|
|
323
|
-
}, [d,
|
|
324
|
-
const
|
|
325
|
-
itemCount:
|
|
326
|
-
itemProps:
|
|
323
|
+
}, [d, a, c]);
|
|
324
|
+
const h = ze({
|
|
325
|
+
itemCount: i,
|
|
326
|
+
itemProps: l,
|
|
327
327
|
itemSize: I
|
|
328
|
-
}),
|
|
329
|
-
(
|
|
330
|
-
[
|
|
331
|
-
), [
|
|
332
|
-
() =>
|
|
333
|
-
cachedBounds:
|
|
328
|
+
}), z = B(
|
|
329
|
+
(p) => h.get(p),
|
|
330
|
+
[h]
|
|
331
|
+
), [u, j] = L(
|
|
332
|
+
() => ee({
|
|
333
|
+
cachedBounds: h,
|
|
334
334
|
// TODO Potentially support a defaultScrollOffset prop?
|
|
335
335
|
containerScrollOffset: 0,
|
|
336
|
-
containerSize:
|
|
337
|
-
itemCount:
|
|
338
|
-
overscanCount:
|
|
336
|
+
containerSize: x,
|
|
337
|
+
itemCount: i,
|
|
338
|
+
overscanCount: o
|
|
339
339
|
})
|
|
340
340
|
), {
|
|
341
|
-
startIndexVisible:
|
|
342
|
-
startIndexOverscan:
|
|
343
|
-
stopIndexVisible:
|
|
344
|
-
stopIndexOverscan:
|
|
341
|
+
startIndexVisible: T,
|
|
342
|
+
startIndexOverscan: E,
|
|
343
|
+
stopIndexVisible: D,
|
|
344
|
+
stopIndexOverscan: v
|
|
345
345
|
} = {
|
|
346
|
-
startIndexVisible: Math.min(
|
|
347
|
-
startIndexOverscan: Math.min(
|
|
348
|
-
stopIndexVisible: Math.min(
|
|
349
|
-
stopIndexOverscan: Math.min(
|
|
350
|
-
},
|
|
351
|
-
() =>
|
|
352
|
-
cachedBounds:
|
|
353
|
-
itemCount:
|
|
346
|
+
startIndexVisible: Math.min(i - 1, u.startIndexVisible),
|
|
347
|
+
startIndexOverscan: Math.min(i - 1, u.startIndexOverscan),
|
|
348
|
+
stopIndexVisible: Math.min(i - 1, u.stopIndexVisible),
|
|
349
|
+
stopIndexOverscan: Math.min(i - 1, u.stopIndexOverscan)
|
|
350
|
+
}, U = B(
|
|
351
|
+
() => ue({
|
|
352
|
+
cachedBounds: h,
|
|
353
|
+
itemCount: i,
|
|
354
354
|
itemSize: I
|
|
355
355
|
}),
|
|
356
|
-
[
|
|
357
|
-
),
|
|
358
|
-
(
|
|
359
|
-
const
|
|
356
|
+
[h, i, I]
|
|
357
|
+
), m = B(
|
|
358
|
+
(p) => {
|
|
359
|
+
const O = C({
|
|
360
360
|
containerElement: e,
|
|
361
361
|
direction: r,
|
|
362
362
|
isRtl: n,
|
|
363
|
-
scrollOffset:
|
|
363
|
+
scrollOffset: p
|
|
364
364
|
});
|
|
365
|
-
return
|
|
366
|
-
cachedBounds:
|
|
367
|
-
containerScrollOffset:
|
|
368
|
-
containerSize:
|
|
369
|
-
itemCount:
|
|
370
|
-
overscanCount:
|
|
365
|
+
return ee({
|
|
366
|
+
cachedBounds: h,
|
|
367
|
+
containerScrollOffset: O,
|
|
368
|
+
containerSize: x,
|
|
369
|
+
itemCount: i,
|
|
370
|
+
overscanCount: o
|
|
371
371
|
});
|
|
372
372
|
},
|
|
373
373
|
[
|
|
374
|
-
|
|
374
|
+
h,
|
|
375
375
|
e,
|
|
376
|
-
|
|
376
|
+
x,
|
|
377
377
|
r,
|
|
378
378
|
n,
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
i,
|
|
380
|
+
o
|
|
381
381
|
]
|
|
382
382
|
);
|
|
383
|
-
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
}, [e, r,
|
|
383
|
+
J(() => {
|
|
384
|
+
const p = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
385
|
+
j(m(p));
|
|
386
|
+
}, [e, r, m]), J(() => {
|
|
387
387
|
if (!e)
|
|
388
388
|
return;
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
const { scrollLeft:
|
|
389
|
+
const p = () => {
|
|
390
|
+
j((O) => {
|
|
391
|
+
const { scrollLeft: M, scrollTop: S } = e, b = C({
|
|
392
392
|
containerElement: e,
|
|
393
393
|
direction: r,
|
|
394
394
|
isRtl: n,
|
|
395
|
-
scrollOffset: r === "vertical" ?
|
|
396
|
-
}),
|
|
397
|
-
cachedBounds:
|
|
398
|
-
containerScrollOffset:
|
|
399
|
-
containerSize:
|
|
400
|
-
itemCount:
|
|
401
|
-
overscanCount:
|
|
395
|
+
scrollOffset: r === "vertical" ? S : M
|
|
396
|
+
}), w = ee({
|
|
397
|
+
cachedBounds: h,
|
|
398
|
+
containerScrollOffset: b,
|
|
399
|
+
containerSize: x,
|
|
400
|
+
itemCount: i,
|
|
401
|
+
overscanCount: o
|
|
402
402
|
});
|
|
403
|
-
return
|
|
403
|
+
return X(w, O) ? O : w;
|
|
404
404
|
});
|
|
405
405
|
};
|
|
406
|
-
return e.addEventListener("scroll",
|
|
407
|
-
e.removeEventListener("scroll",
|
|
406
|
+
return e.addEventListener("scroll", p), () => {
|
|
407
|
+
e.removeEventListener("scroll", p);
|
|
408
408
|
};
|
|
409
409
|
}, [
|
|
410
|
-
|
|
410
|
+
h,
|
|
411
411
|
e,
|
|
412
|
-
|
|
412
|
+
x,
|
|
413
413
|
r,
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
i,
|
|
415
|
+
o
|
|
416
416
|
]);
|
|
417
|
-
const
|
|
417
|
+
const G = de(
|
|
418
418
|
({
|
|
419
|
-
align:
|
|
420
|
-
containerScrollOffset:
|
|
421
|
-
index:
|
|
419
|
+
align: p = "auto",
|
|
420
|
+
containerScrollOffset: O,
|
|
421
|
+
index: M
|
|
422
422
|
}) => {
|
|
423
|
-
let
|
|
424
|
-
align:
|
|
425
|
-
cachedBounds:
|
|
426
|
-
containerScrollOffset:
|
|
427
|
-
containerSize:
|
|
428
|
-
index:
|
|
429
|
-
itemCount:
|
|
423
|
+
let S = Oe({
|
|
424
|
+
align: p,
|
|
425
|
+
cachedBounds: h,
|
|
426
|
+
containerScrollOffset: O,
|
|
427
|
+
containerSize: x,
|
|
428
|
+
index: M,
|
|
429
|
+
itemCount: i,
|
|
430
430
|
itemSize: I
|
|
431
431
|
});
|
|
432
432
|
if (e) {
|
|
433
|
-
if (
|
|
433
|
+
if (S = C({
|
|
434
434
|
containerElement: e,
|
|
435
435
|
direction: r,
|
|
436
436
|
isRtl: n,
|
|
437
|
-
scrollOffset:
|
|
437
|
+
scrollOffset: S
|
|
438
438
|
}), typeof e.scrollTo != "function") {
|
|
439
|
-
const
|
|
440
|
-
|
|
439
|
+
const b = m(S);
|
|
440
|
+
X(u, b) || j(b);
|
|
441
441
|
}
|
|
442
|
-
return
|
|
442
|
+
return S;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
);
|
|
446
446
|
return {
|
|
447
|
-
getCellBounds:
|
|
448
|
-
getEstimatedSize:
|
|
449
|
-
scrollToIndex:
|
|
450
|
-
startIndexOverscan:
|
|
451
|
-
startIndexVisible:
|
|
452
|
-
stopIndexOverscan:
|
|
453
|
-
stopIndexVisible:
|
|
447
|
+
getCellBounds: z,
|
|
448
|
+
getEstimatedSize: U,
|
|
449
|
+
scrollToIndex: G,
|
|
450
|
+
startIndexOverscan: E,
|
|
451
|
+
startIndexVisible: T,
|
|
452
|
+
stopIndexOverscan: v,
|
|
453
|
+
stopIndexVisible: D
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
return
|
|
456
|
+
function he(e) {
|
|
457
|
+
return R(() => e, Object.values(e));
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function pe(e, t) {
|
|
460
460
|
const {
|
|
461
461
|
ariaAttributes: s,
|
|
462
462
|
style: r,
|
|
463
463
|
...n
|
|
464
464
|
} = e, {
|
|
465
|
-
ariaAttributes:
|
|
466
|
-
style:
|
|
465
|
+
ariaAttributes: i,
|
|
466
|
+
style: l,
|
|
467
467
|
...f
|
|
468
468
|
} = t;
|
|
469
|
-
return
|
|
469
|
+
return X(s, i) && X(r, l) && X(n, f);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function Ve({
|
|
472
472
|
cellComponent: e,
|
|
473
473
|
cellProps: t,
|
|
474
474
|
children: s,
|
|
475
475
|
className: r,
|
|
476
476
|
columnCount: n,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
477
|
+
columnKey: i,
|
|
478
|
+
columnWidth: l,
|
|
479
|
+
defaultHeight: f = 0,
|
|
480
|
+
defaultWidth: a = 0,
|
|
481
|
+
dir: o,
|
|
482
|
+
gridRef: d,
|
|
483
|
+
onCellsRendered: c,
|
|
484
|
+
onResize: g,
|
|
485
|
+
overscanCount: x = 3,
|
|
486
|
+
rowCount: I,
|
|
487
|
+
rowHeight: h,
|
|
488
|
+
rowKey: z,
|
|
487
489
|
style: u,
|
|
488
|
-
tagName:
|
|
489
|
-
...
|
|
490
|
+
tagName: j = "div",
|
|
491
|
+
...T
|
|
490
492
|
}) {
|
|
491
|
-
const
|
|
492
|
-
() =>
|
|
493
|
+
const E = he(t), D = R(
|
|
494
|
+
() => ae(e, pe),
|
|
493
495
|
[e]
|
|
494
|
-
), [
|
|
495
|
-
getCellBounds:
|
|
496
|
-
getEstimatedSize:
|
|
497
|
-
startIndexOverscan:
|
|
498
|
-
startIndexVisible:
|
|
496
|
+
), [v, U] = L(null), m = Ie(v, o), {
|
|
497
|
+
getCellBounds: G,
|
|
498
|
+
getEstimatedSize: p,
|
|
499
|
+
startIndexOverscan: O,
|
|
500
|
+
startIndexVisible: M,
|
|
499
501
|
scrollToIndex: S,
|
|
500
|
-
stopIndexOverscan:
|
|
501
|
-
stopIndexVisible:
|
|
502
|
-
} =
|
|
503
|
-
containerElement:
|
|
502
|
+
stopIndexOverscan: b,
|
|
503
|
+
stopIndexVisible: w
|
|
504
|
+
} = re({
|
|
505
|
+
containerElement: v,
|
|
504
506
|
containerStyle: u,
|
|
505
|
-
defaultContainerSize:
|
|
507
|
+
defaultContainerSize: a,
|
|
506
508
|
direction: "horizontal",
|
|
507
|
-
isRtl:
|
|
509
|
+
isRtl: m,
|
|
508
510
|
itemCount: n,
|
|
509
|
-
itemProps:
|
|
510
|
-
itemSize:
|
|
511
|
-
onResize:
|
|
512
|
-
overscanCount:
|
|
511
|
+
itemProps: E,
|
|
512
|
+
itemSize: l,
|
|
513
|
+
onResize: g,
|
|
514
|
+
overscanCount: x
|
|
513
515
|
}), {
|
|
514
|
-
getCellBounds:
|
|
515
|
-
getEstimatedSize:
|
|
516
|
-
startIndexOverscan:
|
|
517
|
-
startIndexVisible:
|
|
518
|
-
scrollToIndex:
|
|
519
|
-
stopIndexOverscan:
|
|
520
|
-
stopIndexVisible:
|
|
521
|
-
} =
|
|
522
|
-
containerElement:
|
|
516
|
+
getCellBounds: V,
|
|
517
|
+
getEstimatedSize: _,
|
|
518
|
+
startIndexOverscan: N,
|
|
519
|
+
startIndexVisible: oe,
|
|
520
|
+
scrollToIndex: K,
|
|
521
|
+
stopIndexOverscan: Y,
|
|
522
|
+
stopIndexVisible: le
|
|
523
|
+
} = re({
|
|
524
|
+
containerElement: v,
|
|
523
525
|
containerStyle: u,
|
|
524
|
-
defaultContainerSize:
|
|
526
|
+
defaultContainerSize: f,
|
|
525
527
|
direction: "vertical",
|
|
526
|
-
itemCount:
|
|
527
|
-
itemProps:
|
|
528
|
-
itemSize:
|
|
529
|
-
onResize:
|
|
530
|
-
overscanCount:
|
|
528
|
+
itemCount: I,
|
|
529
|
+
itemProps: E,
|
|
530
|
+
itemSize: h,
|
|
531
|
+
onResize: g,
|
|
532
|
+
overscanCount: x
|
|
531
533
|
});
|
|
532
|
-
|
|
533
|
-
|
|
534
|
+
fe(
|
|
535
|
+
d,
|
|
534
536
|
() => ({
|
|
535
537
|
get element() {
|
|
536
|
-
return
|
|
538
|
+
return v;
|
|
537
539
|
},
|
|
538
540
|
scrollToCell({
|
|
539
|
-
behavior:
|
|
540
|
-
columnAlign:
|
|
541
|
-
columnIndex:
|
|
542
|
-
rowAlign:
|
|
543
|
-
rowIndex:
|
|
541
|
+
behavior: $ = "auto",
|
|
542
|
+
columnAlign: y = "auto",
|
|
543
|
+
columnIndex: H,
|
|
544
|
+
rowAlign: W = "auto",
|
|
545
|
+
rowIndex: A
|
|
544
546
|
}) {
|
|
545
|
-
const
|
|
546
|
-
align:
|
|
547
|
-
containerScrollOffset:
|
|
548
|
-
index:
|
|
549
|
-
}),
|
|
550
|
-
align:
|
|
551
|
-
containerScrollOffset:
|
|
552
|
-
index:
|
|
547
|
+
const q = S({
|
|
548
|
+
align: y,
|
|
549
|
+
containerScrollOffset: v?.scrollLeft ?? 0,
|
|
550
|
+
index: H
|
|
551
|
+
}), ve = K({
|
|
552
|
+
align: W,
|
|
553
|
+
containerScrollOffset: v?.scrollTop ?? 0,
|
|
554
|
+
index: A
|
|
553
555
|
});
|
|
554
|
-
typeof
|
|
555
|
-
behavior:
|
|
556
|
-
left:
|
|
557
|
-
top:
|
|
556
|
+
typeof v?.scrollTo == "function" && v.scrollTo({
|
|
557
|
+
behavior: $,
|
|
558
|
+
left: q,
|
|
559
|
+
top: ve
|
|
558
560
|
});
|
|
559
561
|
},
|
|
560
562
|
scrollToColumn({
|
|
561
|
-
align:
|
|
562
|
-
behavior:
|
|
563
|
-
index:
|
|
563
|
+
align: $ = "auto",
|
|
564
|
+
behavior: y = "auto",
|
|
565
|
+
index: H
|
|
564
566
|
}) {
|
|
565
|
-
const
|
|
566
|
-
align:
|
|
567
|
-
containerScrollOffset:
|
|
568
|
-
index:
|
|
567
|
+
const W = S({
|
|
568
|
+
align: $,
|
|
569
|
+
containerScrollOffset: v?.scrollLeft ?? 0,
|
|
570
|
+
index: H
|
|
569
571
|
});
|
|
570
|
-
typeof
|
|
571
|
-
behavior:
|
|
572
|
-
left:
|
|
572
|
+
typeof v?.scrollTo == "function" && v.scrollTo({
|
|
573
|
+
behavior: y,
|
|
574
|
+
left: W
|
|
573
575
|
});
|
|
574
576
|
},
|
|
575
577
|
scrollToRow({
|
|
576
|
-
align:
|
|
577
|
-
behavior:
|
|
578
|
-
index:
|
|
578
|
+
align: $ = "auto",
|
|
579
|
+
behavior: y = "auto",
|
|
580
|
+
index: H
|
|
579
581
|
}) {
|
|
580
|
-
const
|
|
581
|
-
align:
|
|
582
|
-
containerScrollOffset:
|
|
583
|
-
index:
|
|
582
|
+
const W = K({
|
|
583
|
+
align: $,
|
|
584
|
+
containerScrollOffset: v?.scrollTop ?? 0,
|
|
585
|
+
index: H
|
|
584
586
|
});
|
|
585
|
-
typeof
|
|
586
|
-
behavior:
|
|
587
|
-
top:
|
|
587
|
+
typeof v?.scrollTo == "function" && v.scrollTo({
|
|
588
|
+
behavior: y,
|
|
589
|
+
top: W
|
|
588
590
|
});
|
|
589
591
|
}
|
|
590
592
|
}),
|
|
591
|
-
[
|
|
592
|
-
),
|
|
593
|
-
|
|
593
|
+
[v, S, K]
|
|
594
|
+
), Z(() => {
|
|
595
|
+
O >= 0 && b >= 0 && N >= 0 && Y >= 0 && c && c(
|
|
594
596
|
{
|
|
595
|
-
columnStartIndex:
|
|
596
|
-
columnStopIndex:
|
|
597
|
-
rowStartIndex:
|
|
598
|
-
rowStopIndex:
|
|
597
|
+
columnStartIndex: M,
|
|
598
|
+
columnStopIndex: w,
|
|
599
|
+
rowStartIndex: oe,
|
|
600
|
+
rowStopIndex: le
|
|
599
601
|
},
|
|
600
602
|
{
|
|
601
|
-
columnStartIndex:
|
|
602
|
-
columnStopIndex:
|
|
603
|
-
rowStartIndex:
|
|
604
|
-
rowStopIndex:
|
|
603
|
+
columnStartIndex: O,
|
|
604
|
+
columnStopIndex: b,
|
|
605
|
+
rowStartIndex: N,
|
|
606
|
+
rowStopIndex: Y
|
|
605
607
|
}
|
|
606
608
|
);
|
|
607
609
|
}, [
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
E,
|
|
610
|
+
c,
|
|
611
|
+
O,
|
|
612
|
+
M,
|
|
612
613
|
b,
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
614
|
+
w,
|
|
615
|
+
N,
|
|
616
|
+
oe,
|
|
617
|
+
Y,
|
|
618
|
+
le
|
|
617
619
|
]);
|
|
618
|
-
const
|
|
619
|
-
const
|
|
620
|
-
if (n > 0 &&
|
|
621
|
-
for (let
|
|
622
|
-
const
|
|
623
|
-
for (let
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
|
|
620
|
+
const ge = R(() => {
|
|
621
|
+
const $ = [];
|
|
622
|
+
if (n > 0 && I > 0)
|
|
623
|
+
for (let y = N; y <= Y; y++) {
|
|
624
|
+
const H = V(y), W = [];
|
|
625
|
+
for (let A = O; A <= b; A++) {
|
|
626
|
+
const q = G(A);
|
|
627
|
+
W.push(
|
|
628
|
+
/* @__PURE__ */ Q(
|
|
629
|
+
D,
|
|
628
630
|
{
|
|
629
|
-
...
|
|
631
|
+
...E,
|
|
630
632
|
ariaAttributes: {
|
|
631
|
-
"aria-colindex":
|
|
633
|
+
"aria-colindex": A + 1,
|
|
632
634
|
role: "gridcell"
|
|
633
635
|
},
|
|
634
|
-
columnIndex:
|
|
635
|
-
key:
|
|
636
|
-
|
|
636
|
+
columnIndex: A,
|
|
637
|
+
key: i ? i({
|
|
638
|
+
columnIndex: A,
|
|
639
|
+
data: E,
|
|
640
|
+
rowIndex: y
|
|
641
|
+
}) : A,
|
|
642
|
+
rowIndex: y,
|
|
637
643
|
style: {
|
|
638
644
|
position: "absolute",
|
|
639
|
-
left:
|
|
640
|
-
right:
|
|
641
|
-
transform: `translate(${
|
|
642
|
-
height:
|
|
643
|
-
width:
|
|
645
|
+
left: m ? void 0 : 0,
|
|
646
|
+
right: m ? 0 : void 0,
|
|
647
|
+
transform: `translate(${m ? -q.scrollOffset : q.scrollOffset}px, ${H.scrollOffset}px)`,
|
|
648
|
+
height: H.size,
|
|
649
|
+
width: q.size
|
|
644
650
|
}
|
|
645
651
|
}
|
|
646
652
|
)
|
|
647
653
|
);
|
|
648
654
|
}
|
|
649
|
-
|
|
650
|
-
/* @__PURE__ */
|
|
655
|
+
$.push(
|
|
656
|
+
/* @__PURE__ */ se(
|
|
657
|
+
"div",
|
|
658
|
+
{
|
|
659
|
+
role: "row",
|
|
660
|
+
"aria-rowindex": y + 1,
|
|
661
|
+
children: W
|
|
662
|
+
},
|
|
663
|
+
z ? z({
|
|
664
|
+
data: E,
|
|
665
|
+
rowIndex: y
|
|
666
|
+
}) : y
|
|
667
|
+
)
|
|
651
668
|
);
|
|
652
669
|
}
|
|
653
|
-
return
|
|
670
|
+
return $;
|
|
654
671
|
}, [
|
|
655
|
-
|
|
656
|
-
O,
|
|
657
|
-
n,
|
|
658
|
-
y,
|
|
672
|
+
D,
|
|
659
673
|
E,
|
|
660
|
-
|
|
661
|
-
|
|
674
|
+
n,
|
|
675
|
+
i,
|
|
676
|
+
O,
|
|
677
|
+
b,
|
|
678
|
+
G,
|
|
662
679
|
V,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
680
|
+
m,
|
|
681
|
+
I,
|
|
682
|
+
z,
|
|
683
|
+
N,
|
|
684
|
+
Y
|
|
685
|
+
]), xe = /* @__PURE__ */ se(
|
|
667
686
|
"div",
|
|
668
687
|
{
|
|
669
688
|
"aria-hidden": !0,
|
|
670
689
|
style: {
|
|
671
|
-
height:
|
|
672
|
-
width:
|
|
690
|
+
height: _(),
|
|
691
|
+
width: p(),
|
|
673
692
|
zIndex: -1
|
|
674
693
|
}
|
|
675
694
|
}
|
|
676
695
|
);
|
|
677
|
-
return
|
|
678
|
-
|
|
696
|
+
return Q(
|
|
697
|
+
j,
|
|
679
698
|
{
|
|
680
699
|
"aria-colcount": n,
|
|
681
|
-
"aria-rowcount":
|
|
700
|
+
"aria-rowcount": I,
|
|
682
701
|
role: "grid",
|
|
683
|
-
...
|
|
702
|
+
...T,
|
|
684
703
|
className: r,
|
|
685
|
-
dir:
|
|
686
|
-
ref:
|
|
704
|
+
dir: o,
|
|
705
|
+
ref: U,
|
|
687
706
|
style: {
|
|
688
707
|
position: "relative",
|
|
689
708
|
maxHeight: "100%",
|
|
@@ -693,136 +712,137 @@ function Ee({
|
|
|
693
712
|
...u
|
|
694
713
|
}
|
|
695
714
|
},
|
|
696
|
-
|
|
715
|
+
ge,
|
|
697
716
|
s,
|
|
698
|
-
|
|
717
|
+
xe
|
|
699
718
|
);
|
|
700
719
|
}
|
|
701
|
-
const
|
|
702
|
-
function
|
|
720
|
+
const Ae = L, ke = P;
|
|
721
|
+
function Te(e) {
|
|
703
722
|
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
704
723
|
}
|
|
705
|
-
const
|
|
706
|
-
function
|
|
724
|
+
const ne = "data-react-window-index";
|
|
725
|
+
function Le({
|
|
707
726
|
children: e,
|
|
708
727
|
className: t,
|
|
709
728
|
defaultHeight: s = 0,
|
|
710
729
|
listRef: r,
|
|
711
730
|
onResize: n,
|
|
712
|
-
onRowsRendered:
|
|
713
|
-
overscanCount:
|
|
731
|
+
onRowsRendered: i,
|
|
732
|
+
overscanCount: l = 3,
|
|
714
733
|
rowComponent: f,
|
|
715
|
-
rowCount:
|
|
716
|
-
rowHeight:
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
734
|
+
rowCount: a,
|
|
735
|
+
rowHeight: o,
|
|
736
|
+
rowKey: d,
|
|
737
|
+
rowProps: c,
|
|
738
|
+
tagName: g = "div",
|
|
739
|
+
style: x,
|
|
740
|
+
...I
|
|
721
741
|
}) {
|
|
722
|
-
const
|
|
723
|
-
() =>
|
|
742
|
+
const h = he(c), z = R(
|
|
743
|
+
() => ae(f, pe),
|
|
724
744
|
[f]
|
|
725
|
-
), [
|
|
726
|
-
getCellBounds:
|
|
727
|
-
getEstimatedSize:
|
|
728
|
-
scrollToIndex:
|
|
729
|
-
startIndexOverscan:
|
|
730
|
-
startIndexVisible:
|
|
731
|
-
stopIndexOverscan:
|
|
732
|
-
stopIndexVisible:
|
|
733
|
-
} =
|
|
734
|
-
containerElement:
|
|
735
|
-
containerStyle:
|
|
745
|
+
), [u, j] = L(null), T = Te(o), E = R(() => T ? (b) => o.getRowHeight(b) ?? o.getAverageRowHeight() : o, [T, o]), {
|
|
746
|
+
getCellBounds: D,
|
|
747
|
+
getEstimatedSize: v,
|
|
748
|
+
scrollToIndex: U,
|
|
749
|
+
startIndexOverscan: m,
|
|
750
|
+
startIndexVisible: G,
|
|
751
|
+
stopIndexOverscan: p,
|
|
752
|
+
stopIndexVisible: O
|
|
753
|
+
} = re({
|
|
754
|
+
containerElement: u,
|
|
755
|
+
containerStyle: x,
|
|
736
756
|
defaultContainerSize: s,
|
|
737
757
|
direction: "vertical",
|
|
738
|
-
itemCount:
|
|
739
|
-
itemProps:
|
|
740
|
-
itemSize:
|
|
758
|
+
itemCount: a,
|
|
759
|
+
itemProps: h,
|
|
760
|
+
itemSize: E,
|
|
741
761
|
onResize: n,
|
|
742
|
-
overscanCount:
|
|
762
|
+
overscanCount: l
|
|
743
763
|
});
|
|
744
|
-
|
|
764
|
+
fe(
|
|
745
765
|
r,
|
|
746
766
|
() => ({
|
|
747
767
|
get element() {
|
|
748
|
-
return
|
|
768
|
+
return u;
|
|
749
769
|
},
|
|
750
770
|
scrollToRow({
|
|
751
771
|
align: b = "auto",
|
|
752
|
-
behavior:
|
|
753
|
-
index:
|
|
772
|
+
behavior: w = "auto",
|
|
773
|
+
index: V
|
|
754
774
|
}) {
|
|
755
|
-
const
|
|
775
|
+
const _ = U({
|
|
756
776
|
align: b,
|
|
757
|
-
containerScrollOffset:
|
|
758
|
-
index:
|
|
777
|
+
containerScrollOffset: u?.scrollTop ?? 0,
|
|
778
|
+
index: V
|
|
759
779
|
});
|
|
760
|
-
typeof
|
|
761
|
-
behavior:
|
|
762
|
-
top:
|
|
780
|
+
typeof u?.scrollTo == "function" && u.scrollTo({
|
|
781
|
+
behavior: w,
|
|
782
|
+
top: _
|
|
763
783
|
});
|
|
764
784
|
}
|
|
765
785
|
}),
|
|
766
|
-
[
|
|
767
|
-
),
|
|
768
|
-
if (!
|
|
786
|
+
[u, U]
|
|
787
|
+
), J(() => {
|
|
788
|
+
if (!u)
|
|
769
789
|
return;
|
|
770
|
-
const b = Array.from(
|
|
771
|
-
if (
|
|
790
|
+
const b = Array.from(u.children).filter((w, V) => {
|
|
791
|
+
if (w.hasAttribute("aria-hidden"))
|
|
772
792
|
return !1;
|
|
773
|
-
const
|
|
774
|
-
return
|
|
793
|
+
const _ = `${m + V}`;
|
|
794
|
+
return w.setAttribute(ne, _), !0;
|
|
775
795
|
});
|
|
776
|
-
if (
|
|
777
|
-
return
|
|
796
|
+
if (T)
|
|
797
|
+
return o.observeRowElements(b);
|
|
778
798
|
}, [
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
]),
|
|
785
|
-
|
|
799
|
+
u,
|
|
800
|
+
T,
|
|
801
|
+
o,
|
|
802
|
+
m,
|
|
803
|
+
p
|
|
804
|
+
]), Z(() => {
|
|
805
|
+
m >= 0 && p >= 0 && i && i(
|
|
786
806
|
{
|
|
787
|
-
startIndex:
|
|
788
|
-
stopIndex:
|
|
807
|
+
startIndex: G,
|
|
808
|
+
stopIndex: O
|
|
789
809
|
},
|
|
790
810
|
{
|
|
791
|
-
startIndex:
|
|
792
|
-
stopIndex:
|
|
811
|
+
startIndex: m,
|
|
812
|
+
stopIndex: p
|
|
793
813
|
}
|
|
794
814
|
);
|
|
795
815
|
}, [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
816
|
+
i,
|
|
817
|
+
m,
|
|
818
|
+
G,
|
|
819
|
+
p,
|
|
820
|
+
O
|
|
801
821
|
]);
|
|
802
|
-
const
|
|
822
|
+
const M = R(() => {
|
|
803
823
|
const b = [];
|
|
804
|
-
if (
|
|
805
|
-
for (let
|
|
806
|
-
const
|
|
824
|
+
if (a > 0)
|
|
825
|
+
for (let w = m; w <= p; w++) {
|
|
826
|
+
const V = D(w);
|
|
807
827
|
b.push(
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
|
|
828
|
+
/* @__PURE__ */ Q(
|
|
829
|
+
z,
|
|
810
830
|
{
|
|
811
|
-
...
|
|
831
|
+
...h,
|
|
812
832
|
ariaAttributes: {
|
|
813
|
-
"aria-posinset":
|
|
814
|
-
"aria-setsize":
|
|
833
|
+
"aria-posinset": w + 1,
|
|
834
|
+
"aria-setsize": a,
|
|
815
835
|
role: "listitem"
|
|
816
836
|
},
|
|
817
|
-
key:
|
|
818
|
-
index:
|
|
837
|
+
key: d ? d(w, h) : w,
|
|
838
|
+
index: w,
|
|
819
839
|
style: {
|
|
820
840
|
position: "absolute",
|
|
821
841
|
left: 0,
|
|
822
|
-
transform: `translateY(${
|
|
842
|
+
transform: `translateY(${V.scrollOffset}px)`,
|
|
823
843
|
// In case of dynamic row heights, don't specify a height style
|
|
824
844
|
// otherwise a default/estimated height would mask the actual height
|
|
825
|
-
height:
|
|
845
|
+
height: T ? void 0 : V.size,
|
|
826
846
|
width: "100%"
|
|
827
847
|
}
|
|
828
848
|
}
|
|
@@ -831,49 +851,50 @@ function Ae({
|
|
|
831
851
|
}
|
|
832
852
|
return b;
|
|
833
853
|
}, [
|
|
834
|
-
u,
|
|
835
|
-
x,
|
|
836
|
-
O,
|
|
837
|
-
l,
|
|
838
|
-
I,
|
|
839
854
|
z,
|
|
840
|
-
|
|
841
|
-
|
|
855
|
+
D,
|
|
856
|
+
T,
|
|
857
|
+
a,
|
|
858
|
+
d,
|
|
859
|
+
h,
|
|
860
|
+
m,
|
|
861
|
+
p
|
|
862
|
+
]), S = /* @__PURE__ */ se(
|
|
842
863
|
"div",
|
|
843
864
|
{
|
|
844
865
|
"aria-hidden": !0,
|
|
845
866
|
style: {
|
|
846
|
-
height:
|
|
867
|
+
height: v(),
|
|
847
868
|
width: "100%",
|
|
848
869
|
zIndex: -1
|
|
849
870
|
}
|
|
850
871
|
}
|
|
851
872
|
);
|
|
852
|
-
return
|
|
853
|
-
|
|
873
|
+
return Q(
|
|
874
|
+
g,
|
|
854
875
|
{
|
|
855
876
|
role: "list",
|
|
856
|
-
...
|
|
877
|
+
...I,
|
|
857
878
|
className: t,
|
|
858
|
-
ref:
|
|
879
|
+
ref: j,
|
|
859
880
|
style: {
|
|
860
881
|
position: "relative",
|
|
861
882
|
maxHeight: "100%",
|
|
862
883
|
flexGrow: 1,
|
|
863
884
|
overflowY: "auto",
|
|
864
|
-
...
|
|
885
|
+
...x
|
|
865
886
|
}
|
|
866
887
|
},
|
|
867
|
-
|
|
888
|
+
M,
|
|
868
889
|
e,
|
|
869
|
-
|
|
890
|
+
S
|
|
870
891
|
);
|
|
871
892
|
}
|
|
872
|
-
function
|
|
893
|
+
function Me({
|
|
873
894
|
defaultRowHeight: e,
|
|
874
895
|
key: t
|
|
875
896
|
}) {
|
|
876
|
-
const [s, r] =
|
|
897
|
+
const [s, r] = L({
|
|
877
898
|
key: t,
|
|
878
899
|
map: /* @__PURE__ */ new Map()
|
|
879
900
|
});
|
|
@@ -881,83 +902,83 @@ function ke({
|
|
|
881
902
|
key: t,
|
|
882
903
|
map: /* @__PURE__ */ new Map()
|
|
883
904
|
});
|
|
884
|
-
const { map: n } = s,
|
|
885
|
-
let
|
|
886
|
-
return n.forEach((
|
|
887
|
-
|
|
888
|
-
}),
|
|
889
|
-
}, [e, n]),
|
|
890
|
-
(
|
|
891
|
-
const
|
|
892
|
-
return
|
|
905
|
+
const { map: n } = s, i = B(() => {
|
|
906
|
+
let c = 0;
|
|
907
|
+
return n.forEach((g) => {
|
|
908
|
+
c += g;
|
|
909
|
+
}), c === 0 ? e : c / n.size;
|
|
910
|
+
}, [e, n]), l = B(
|
|
911
|
+
(c) => {
|
|
912
|
+
const g = n.get(c);
|
|
913
|
+
return g !== void 0 ? g : (n.set(c, e), e);
|
|
893
914
|
},
|
|
894
915
|
[e, n]
|
|
895
|
-
), f =
|
|
896
|
-
r((
|
|
897
|
-
if (
|
|
898
|
-
return
|
|
899
|
-
const I = new Map(
|
|
900
|
-
return I.set(
|
|
901
|
-
...
|
|
916
|
+
), f = B((c, g) => {
|
|
917
|
+
r((x) => {
|
|
918
|
+
if (x.map.get(c) === g)
|
|
919
|
+
return x;
|
|
920
|
+
const I = new Map(x.map);
|
|
921
|
+
return I.set(c, g), {
|
|
922
|
+
...x,
|
|
902
923
|
map: I
|
|
903
924
|
};
|
|
904
925
|
});
|
|
905
|
-
}, []),
|
|
906
|
-
(
|
|
907
|
-
|
|
908
|
-
const { borderBoxSize:
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
`Invalid ${
|
|
926
|
+
}, []), a = de(
|
|
927
|
+
(c) => {
|
|
928
|
+
c.length !== 0 && c.forEach((g) => {
|
|
929
|
+
const { borderBoxSize: x, target: I } = g, h = I.getAttribute(ne);
|
|
930
|
+
k(
|
|
931
|
+
h !== null,
|
|
932
|
+
`Invalid ${ne} attribute value`
|
|
912
933
|
);
|
|
913
|
-
const
|
|
914
|
-
|
|
934
|
+
const z = parseInt(h), { blockSize: u } = x[0];
|
|
935
|
+
u && f(z, u);
|
|
915
936
|
});
|
|
916
937
|
}
|
|
917
|
-
), [
|
|
938
|
+
), [o] = L(() => {
|
|
918
939
|
if (typeof ResizeObserver < "u")
|
|
919
|
-
return new ResizeObserver(
|
|
940
|
+
return new ResizeObserver(a);
|
|
920
941
|
});
|
|
921
|
-
|
|
922
|
-
if (
|
|
942
|
+
Z(() => {
|
|
943
|
+
if (o)
|
|
923
944
|
return () => {
|
|
924
|
-
|
|
945
|
+
o.disconnect();
|
|
925
946
|
};
|
|
926
|
-
}, [
|
|
927
|
-
const d =
|
|
928
|
-
(
|
|
929
|
-
|
|
947
|
+
}, [o]);
|
|
948
|
+
const d = B(
|
|
949
|
+
(c) => o ? (c.forEach((g) => o.observe(g)), () => {
|
|
950
|
+
c.forEach((g) => o.unobserve(g));
|
|
930
951
|
}) : () => {
|
|
931
952
|
},
|
|
932
|
-
[
|
|
953
|
+
[o]
|
|
933
954
|
);
|
|
934
|
-
return
|
|
955
|
+
return R(
|
|
935
956
|
() => ({
|
|
936
|
-
getAverageRowHeight:
|
|
937
|
-
getRowHeight:
|
|
957
|
+
getAverageRowHeight: i,
|
|
958
|
+
getRowHeight: l,
|
|
938
959
|
setRowHeight: f,
|
|
939
960
|
observeRowElements: d
|
|
940
961
|
}),
|
|
941
|
-
[
|
|
962
|
+
[i, l, f, d]
|
|
942
963
|
);
|
|
943
964
|
}
|
|
944
|
-
const
|
|
945
|
-
let
|
|
946
|
-
function
|
|
947
|
-
if (
|
|
965
|
+
const $e = L, He = P;
|
|
966
|
+
let te = -1;
|
|
967
|
+
function We(e = !1) {
|
|
968
|
+
if (te === -1 || e) {
|
|
948
969
|
const t = document.createElement("div"), s = t.style;
|
|
949
|
-
s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(t),
|
|
970
|
+
s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(t), te = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
950
971
|
}
|
|
951
|
-
return
|
|
972
|
+
return te;
|
|
952
973
|
}
|
|
953
974
|
export {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
975
|
+
Ve as Grid,
|
|
976
|
+
Le as List,
|
|
977
|
+
We as getScrollbarSize,
|
|
978
|
+
Me as useDynamicRowHeight,
|
|
979
|
+
Ae as useGridCallbackRef,
|
|
980
|
+
ke as useGridRef,
|
|
981
|
+
$e as useListCallbackRef,
|
|
982
|
+
He as useListRef
|
|
962
983
|
};
|
|
963
984
|
//# sourceMappingURL=react-window.js.map
|