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