react-window 2.2.4 → 2.2.5-alpha.1
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/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +2 -2
- package/dist/react-window.js +388 -385
- package/dist/react-window.js.map +1 -1
- package/package.json +9 -2
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,158 @@ 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
|
+
// TODO Potentially support a defaultScrollOffset prop?
|
|
335
|
+
containerScrollOffset: 0,
|
|
336
|
+
containerSize: p,
|
|
337
|
+
itemCount: o,
|
|
338
|
+
overscanCount: a
|
|
339
|
+
})
|
|
340
|
+
), {
|
|
341
|
+
startIndexVisible: G,
|
|
342
|
+
startIndexOverscan: x,
|
|
343
|
+
stopIndexVisible: F,
|
|
344
|
+
stopIndexOverscan: V
|
|
345
|
+
} = {
|
|
346
|
+
startIndexVisible: Math.min(o - 1, m.startIndexVisible),
|
|
347
|
+
startIndexOverscan: Math.min(o - 1, m.startIndexOverscan),
|
|
348
|
+
stopIndexVisible: Math.min(o - 1, m.stopIndexVisible),
|
|
349
|
+
stopIndexOverscan: Math.min(o - 1, m.stopIndexOverscan)
|
|
350
|
+
}, z = D(
|
|
346
351
|
() => fe({
|
|
347
|
-
cachedBounds:
|
|
352
|
+
cachedBounds: u,
|
|
348
353
|
itemCount: o,
|
|
349
|
-
itemSize:
|
|
354
|
+
itemSize: I
|
|
350
355
|
}),
|
|
351
|
-
[
|
|
352
|
-
),
|
|
353
|
-
(
|
|
354
|
-
const
|
|
356
|
+
[u, o, I]
|
|
357
|
+
), $ = D(
|
|
358
|
+
(g) => {
|
|
359
|
+
const S = Z({
|
|
355
360
|
containerElement: e,
|
|
356
361
|
direction: r,
|
|
357
362
|
isRtl: n,
|
|
358
|
-
scrollOffset:
|
|
363
|
+
scrollOffset: g
|
|
359
364
|
});
|
|
360
|
-
return
|
|
361
|
-
cachedBounds:
|
|
362
|
-
containerScrollOffset:
|
|
363
|
-
containerSize:
|
|
365
|
+
return P({
|
|
366
|
+
cachedBounds: u,
|
|
367
|
+
containerScrollOffset: S,
|
|
368
|
+
containerSize: p,
|
|
364
369
|
itemCount: o,
|
|
365
|
-
overscanCount:
|
|
370
|
+
overscanCount: a
|
|
366
371
|
});
|
|
367
372
|
},
|
|
368
373
|
[
|
|
369
|
-
|
|
374
|
+
u,
|
|
370
375
|
e,
|
|
371
|
-
|
|
376
|
+
p,
|
|
372
377
|
r,
|
|
373
378
|
n,
|
|
374
379
|
o,
|
|
375
|
-
|
|
380
|
+
a
|
|
376
381
|
]
|
|
377
382
|
);
|
|
378
383
|
q(() => {
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
}, [e, r,
|
|
384
|
+
const g = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
385
|
+
O($(g));
|
|
386
|
+
}, [e, r, $]), q(() => {
|
|
382
387
|
if (!e)
|
|
383
388
|
return;
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
const { scrollLeft:
|
|
389
|
+
const g = () => {
|
|
390
|
+
O((S) => {
|
|
391
|
+
const { scrollLeft: E, scrollTop: b } = e, v = Z({
|
|
387
392
|
containerElement: e,
|
|
388
393
|
direction: r,
|
|
389
394
|
isRtl: n,
|
|
390
|
-
scrollOffset: r === "vertical" ?
|
|
391
|
-
}),
|
|
392
|
-
cachedBounds:
|
|
393
|
-
containerScrollOffset:
|
|
394
|
-
containerSize:
|
|
395
|
+
scrollOffset: r === "vertical" ? b : E
|
|
396
|
+
}), R = P({
|
|
397
|
+
cachedBounds: u,
|
|
398
|
+
containerScrollOffset: v,
|
|
399
|
+
containerSize: p,
|
|
395
400
|
itemCount: o,
|
|
396
|
-
overscanCount:
|
|
401
|
+
overscanCount: a
|
|
397
402
|
});
|
|
398
|
-
return Y(
|
|
403
|
+
return Y(R, S) ? S : R;
|
|
399
404
|
});
|
|
400
405
|
};
|
|
401
|
-
return e.addEventListener("scroll",
|
|
402
|
-
e.removeEventListener("scroll",
|
|
406
|
+
return e.addEventListener("scroll", g), () => {
|
|
407
|
+
e.removeEventListener("scroll", g);
|
|
403
408
|
};
|
|
404
409
|
}, [
|
|
405
|
-
|
|
410
|
+
u,
|
|
406
411
|
e,
|
|
407
|
-
|
|
412
|
+
p,
|
|
408
413
|
r,
|
|
409
414
|
o,
|
|
410
|
-
|
|
415
|
+
a
|
|
411
416
|
]);
|
|
412
|
-
const
|
|
417
|
+
const y = ae(
|
|
413
418
|
({
|
|
414
|
-
align:
|
|
415
|
-
containerScrollOffset:
|
|
416
|
-
index:
|
|
419
|
+
align: g = "auto",
|
|
420
|
+
containerScrollOffset: S,
|
|
421
|
+
index: E
|
|
417
422
|
}) => {
|
|
418
|
-
let
|
|
419
|
-
align:
|
|
420
|
-
cachedBounds:
|
|
421
|
-
containerScrollOffset:
|
|
422
|
-
containerSize:
|
|
423
|
-
index:
|
|
423
|
+
let b = we({
|
|
424
|
+
align: g,
|
|
425
|
+
cachedBounds: u,
|
|
426
|
+
containerScrollOffset: S,
|
|
427
|
+
containerSize: p,
|
|
428
|
+
index: E,
|
|
424
429
|
itemCount: o,
|
|
425
|
-
itemSize:
|
|
430
|
+
itemSize: I
|
|
426
431
|
});
|
|
427
432
|
if (e) {
|
|
428
|
-
if (
|
|
433
|
+
if (b = Z({
|
|
429
434
|
containerElement: e,
|
|
430
435
|
direction: r,
|
|
431
436
|
isRtl: n,
|
|
432
|
-
scrollOffset:
|
|
437
|
+
scrollOffset: b
|
|
433
438
|
}), typeof e.scrollTo != "function") {
|
|
434
|
-
const
|
|
435
|
-
Y(
|
|
439
|
+
const v = $(b);
|
|
440
|
+
Y(m, v) || O(v);
|
|
436
441
|
}
|
|
437
|
-
return
|
|
442
|
+
return b;
|
|
438
443
|
}
|
|
439
444
|
}
|
|
440
445
|
);
|
|
441
446
|
return {
|
|
442
|
-
getCellBounds:
|
|
443
|
-
getEstimatedSize:
|
|
444
|
-
scrollToIndex:
|
|
445
|
-
startIndexOverscan:
|
|
446
|
-
startIndexVisible:
|
|
447
|
-
stopIndexOverscan:
|
|
448
|
-
stopIndexVisible:
|
|
447
|
+
getCellBounds: w,
|
|
448
|
+
getEstimatedSize: z,
|
|
449
|
+
scrollToIndex: y,
|
|
450
|
+
startIndexOverscan: x,
|
|
451
|
+
startIndexVisible: G,
|
|
452
|
+
stopIndexOverscan: V,
|
|
453
|
+
stopIndexVisible: F
|
|
449
454
|
};
|
|
450
455
|
}
|
|
451
456
|
function de(e) {
|
|
452
|
-
return
|
|
457
|
+
return A(() => e, Object.values(e));
|
|
453
458
|
}
|
|
454
459
|
function ue(e, t) {
|
|
455
460
|
const {
|
|
@@ -473,221 +478,219 @@ function Ee({
|
|
|
473
478
|
defaultHeight: i = 0,
|
|
474
479
|
defaultWidth: f = 0,
|
|
475
480
|
dir: l,
|
|
476
|
-
gridRef:
|
|
481
|
+
gridRef: a,
|
|
477
482
|
onCellsRendered: d,
|
|
478
|
-
onResize:
|
|
479
|
-
overscanCount:
|
|
480
|
-
rowCount:
|
|
481
|
-
rowHeight:
|
|
482
|
-
style:
|
|
483
|
-
tagName:
|
|
484
|
-
...
|
|
483
|
+
onResize: c,
|
|
484
|
+
overscanCount: h = 3,
|
|
485
|
+
rowCount: p,
|
|
486
|
+
rowHeight: I,
|
|
487
|
+
style: u,
|
|
488
|
+
tagName: w = "div",
|
|
489
|
+
...m
|
|
485
490
|
}) {
|
|
486
|
-
const
|
|
491
|
+
const O = de(t), G = A(
|
|
487
492
|
() => le(e, ue),
|
|
488
493
|
[e]
|
|
489
|
-
), [
|
|
490
|
-
getCellBounds:
|
|
491
|
-
getEstimatedSize:
|
|
492
|
-
startIndexOverscan:
|
|
493
|
-
startIndexVisible:
|
|
494
|
-
scrollToIndex:
|
|
495
|
-
stopIndexOverscan:
|
|
496
|
-
stopIndexVisible:
|
|
497
|
-
} =
|
|
498
|
-
containerElement:
|
|
499
|
-
containerStyle:
|
|
494
|
+
), [x, F] = M(null), V = ve(x, l), {
|
|
495
|
+
getCellBounds: z,
|
|
496
|
+
getEstimatedSize: $,
|
|
497
|
+
startIndexOverscan: y,
|
|
498
|
+
startIndexVisible: g,
|
|
499
|
+
scrollToIndex: S,
|
|
500
|
+
stopIndexOverscan: E,
|
|
501
|
+
stopIndexVisible: b
|
|
502
|
+
} = te({
|
|
503
|
+
containerElement: x,
|
|
504
|
+
containerStyle: u,
|
|
500
505
|
defaultContainerSize: f,
|
|
501
506
|
direction: "horizontal",
|
|
502
|
-
isRtl:
|
|
507
|
+
isRtl: V,
|
|
503
508
|
itemCount: n,
|
|
504
|
-
itemProps:
|
|
509
|
+
itemProps: O,
|
|
505
510
|
itemSize: o,
|
|
506
|
-
onResize:
|
|
507
|
-
overscanCount:
|
|
511
|
+
onResize: c,
|
|
512
|
+
overscanCount: h
|
|
508
513
|
}), {
|
|
509
|
-
getCellBounds:
|
|
510
|
-
getEstimatedSize:
|
|
511
|
-
startIndexOverscan:
|
|
512
|
-
startIndexVisible:
|
|
514
|
+
getCellBounds: v,
|
|
515
|
+
getEstimatedSize: R,
|
|
516
|
+
startIndexOverscan: k,
|
|
517
|
+
startIndexVisible: ne,
|
|
513
518
|
scrollToIndex: Q,
|
|
514
519
|
stopIndexOverscan: _,
|
|
515
|
-
stopIndexVisible:
|
|
516
|
-
} =
|
|
517
|
-
containerElement:
|
|
518
|
-
containerStyle:
|
|
520
|
+
stopIndexVisible: oe
|
|
521
|
+
} = te({
|
|
522
|
+
containerElement: x,
|
|
523
|
+
containerStyle: u,
|
|
519
524
|
defaultContainerSize: i,
|
|
520
525
|
direction: "vertical",
|
|
521
|
-
itemCount:
|
|
522
|
-
itemProps:
|
|
523
|
-
itemSize:
|
|
524
|
-
onResize:
|
|
525
|
-
overscanCount:
|
|
526
|
+
itemCount: p,
|
|
527
|
+
itemProps: O,
|
|
528
|
+
itemSize: I,
|
|
529
|
+
onResize: c,
|
|
530
|
+
overscanCount: h
|
|
526
531
|
});
|
|
527
532
|
ce(
|
|
528
|
-
|
|
533
|
+
a,
|
|
529
534
|
() => ({
|
|
530
535
|
get element() {
|
|
531
|
-
return
|
|
536
|
+
return x;
|
|
532
537
|
},
|
|
533
538
|
scrollToCell({
|
|
534
|
-
behavior:
|
|
535
|
-
columnAlign:
|
|
536
|
-
columnIndex:
|
|
537
|
-
rowAlign:
|
|
538
|
-
rowIndex:
|
|
539
|
+
behavior: H = "auto",
|
|
540
|
+
columnAlign: T = "auto",
|
|
541
|
+
columnIndex: W,
|
|
542
|
+
rowAlign: B = "auto",
|
|
543
|
+
rowIndex: j
|
|
539
544
|
}) {
|
|
540
|
-
const N =
|
|
541
|
-
align:
|
|
542
|
-
containerScrollOffset:
|
|
543
|
-
index:
|
|
545
|
+
const N = S({
|
|
546
|
+
align: T,
|
|
547
|
+
containerScrollOffset: x?.scrollLeft ?? 0,
|
|
548
|
+
index: W
|
|
544
549
|
}), ge = Q({
|
|
545
|
-
align:
|
|
546
|
-
containerScrollOffset:
|
|
547
|
-
index:
|
|
550
|
+
align: B,
|
|
551
|
+
containerScrollOffset: x?.scrollTop ?? 0,
|
|
552
|
+
index: j
|
|
548
553
|
});
|
|
549
|
-
typeof
|
|
550
|
-
behavior:
|
|
554
|
+
typeof x?.scrollTo == "function" && x.scrollTo({
|
|
555
|
+
behavior: H,
|
|
551
556
|
left: N,
|
|
552
557
|
top: ge
|
|
553
558
|
});
|
|
554
559
|
},
|
|
555
560
|
scrollToColumn({
|
|
556
|
-
align:
|
|
557
|
-
behavior:
|
|
558
|
-
index:
|
|
561
|
+
align: H = "auto",
|
|
562
|
+
behavior: T = "auto",
|
|
563
|
+
index: W
|
|
559
564
|
}) {
|
|
560
|
-
const
|
|
561
|
-
align:
|
|
562
|
-
containerScrollOffset:
|
|
563
|
-
index:
|
|
565
|
+
const B = S({
|
|
566
|
+
align: H,
|
|
567
|
+
containerScrollOffset: x?.scrollLeft ?? 0,
|
|
568
|
+
index: W
|
|
564
569
|
});
|
|
565
|
-
typeof
|
|
566
|
-
behavior:
|
|
567
|
-
left:
|
|
570
|
+
typeof x?.scrollTo == "function" && x.scrollTo({
|
|
571
|
+
behavior: T,
|
|
572
|
+
left: B
|
|
568
573
|
});
|
|
569
574
|
},
|
|
570
575
|
scrollToRow({
|
|
571
|
-
align:
|
|
572
|
-
behavior:
|
|
573
|
-
index:
|
|
576
|
+
align: H = "auto",
|
|
577
|
+
behavior: T = "auto",
|
|
578
|
+
index: W
|
|
574
579
|
}) {
|
|
575
|
-
const
|
|
576
|
-
align:
|
|
577
|
-
containerScrollOffset:
|
|
578
|
-
index:
|
|
580
|
+
const B = Q({
|
|
581
|
+
align: H,
|
|
582
|
+
containerScrollOffset: x?.scrollTop ?? 0,
|
|
583
|
+
index: W
|
|
579
584
|
});
|
|
580
|
-
typeof
|
|
581
|
-
behavior:
|
|
582
|
-
top:
|
|
585
|
+
typeof x?.scrollTo == "function" && x.scrollTo({
|
|
586
|
+
behavior: T,
|
|
587
|
+
top: B
|
|
583
588
|
});
|
|
584
589
|
}
|
|
585
590
|
}),
|
|
586
|
-
[
|
|
591
|
+
[x, S, Q]
|
|
587
592
|
), J(() => {
|
|
588
|
-
|
|
593
|
+
y >= 0 && E >= 0 && k >= 0 && _ >= 0 && d && d(
|
|
589
594
|
{
|
|
590
|
-
columnStartIndex:
|
|
591
|
-
columnStopIndex:
|
|
592
|
-
rowStartIndex:
|
|
593
|
-
rowStopIndex:
|
|
595
|
+
columnStartIndex: g,
|
|
596
|
+
columnStopIndex: b,
|
|
597
|
+
rowStartIndex: ne,
|
|
598
|
+
rowStopIndex: oe
|
|
594
599
|
},
|
|
595
600
|
{
|
|
596
|
-
columnStartIndex:
|
|
597
|
-
columnStopIndex:
|
|
598
|
-
rowStartIndex:
|
|
601
|
+
columnStartIndex: y,
|
|
602
|
+
columnStopIndex: E,
|
|
603
|
+
rowStartIndex: k,
|
|
599
604
|
rowStopIndex: _
|
|
600
605
|
}
|
|
601
606
|
);
|
|
602
607
|
}, [
|
|
603
608
|
d,
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
609
|
+
y,
|
|
610
|
+
g,
|
|
611
|
+
E,
|
|
612
|
+
b,
|
|
613
|
+
k,
|
|
614
|
+
ne,
|
|
610
615
|
_,
|
|
611
|
-
|
|
616
|
+
oe
|
|
612
617
|
]);
|
|
613
|
-
const he =
|
|
614
|
-
const
|
|
615
|
-
if (n > 0 &&
|
|
616
|
-
for (let
|
|
617
|
-
const
|
|
618
|
-
for (let
|
|
619
|
-
const N =
|
|
620
|
-
|
|
618
|
+
const he = A(() => {
|
|
619
|
+
const H = [];
|
|
620
|
+
if (n > 0 && p > 0)
|
|
621
|
+
for (let T = k; T <= _; T++) {
|
|
622
|
+
const W = v(T), B = [];
|
|
623
|
+
for (let j = y; j <= E; j++) {
|
|
624
|
+
const N = z(j);
|
|
625
|
+
B.push(
|
|
621
626
|
/* @__PURE__ */ X(
|
|
622
|
-
|
|
627
|
+
G,
|
|
623
628
|
{
|
|
624
|
-
...
|
|
629
|
+
...O,
|
|
625
630
|
ariaAttributes: {
|
|
626
|
-
"aria-colindex":
|
|
631
|
+
"aria-colindex": j + 1,
|
|
627
632
|
role: "gridcell"
|
|
628
633
|
},
|
|
629
|
-
columnIndex:
|
|
630
|
-
key:
|
|
631
|
-
rowIndex:
|
|
634
|
+
columnIndex: j,
|
|
635
|
+
key: j,
|
|
636
|
+
rowIndex: T,
|
|
632
637
|
style: {
|
|
633
638
|
position: "absolute",
|
|
634
|
-
left:
|
|
635
|
-
right:
|
|
636
|
-
transform: `translate(${
|
|
637
|
-
height:
|
|
639
|
+
left: V ? void 0 : 0,
|
|
640
|
+
right: V ? 0 : void 0,
|
|
641
|
+
transform: `translate(${V ? -N.scrollOffset : N.scrollOffset}px, ${W.scrollOffset}px)`,
|
|
642
|
+
height: W.size,
|
|
638
643
|
width: N.size
|
|
639
644
|
}
|
|
640
645
|
}
|
|
641
646
|
)
|
|
642
647
|
);
|
|
643
648
|
}
|
|
644
|
-
|
|
645
|
-
/* @__PURE__ */
|
|
649
|
+
H.push(
|
|
650
|
+
/* @__PURE__ */ ee("div", { role: "row", "aria-rowindex": T + 1, children: B }, T)
|
|
646
651
|
);
|
|
647
652
|
}
|
|
648
|
-
return
|
|
653
|
+
return H;
|
|
649
654
|
}, [
|
|
650
|
-
|
|
651
|
-
y,
|
|
652
|
-
n,
|
|
655
|
+
G,
|
|
653
656
|
O,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
+
n,
|
|
658
|
+
y,
|
|
659
|
+
E,
|
|
660
|
+
z,
|
|
661
|
+
v,
|
|
662
|
+
V,
|
|
663
|
+
p,
|
|
657
664
|
k,
|
|
658
|
-
I,
|
|
659
|
-
M,
|
|
660
665
|
_
|
|
661
|
-
]), pe = /* @__PURE__ */
|
|
666
|
+
]), pe = /* @__PURE__ */ ee(
|
|
662
667
|
"div",
|
|
663
668
|
{
|
|
664
669
|
"aria-hidden": !0,
|
|
665
670
|
style: {
|
|
666
|
-
height:
|
|
667
|
-
width:
|
|
671
|
+
height: R(),
|
|
672
|
+
width: $(),
|
|
668
673
|
zIndex: -1
|
|
669
674
|
}
|
|
670
675
|
}
|
|
671
676
|
);
|
|
672
677
|
return X(
|
|
673
|
-
|
|
678
|
+
w,
|
|
674
679
|
{
|
|
675
680
|
"aria-colcount": n,
|
|
676
|
-
"aria-rowcount":
|
|
681
|
+
"aria-rowcount": p,
|
|
677
682
|
role: "grid",
|
|
678
|
-
...
|
|
683
|
+
...m,
|
|
679
684
|
className: r,
|
|
680
685
|
dir: l,
|
|
681
|
-
ref:
|
|
686
|
+
ref: F,
|
|
682
687
|
style: {
|
|
683
688
|
position: "relative",
|
|
684
|
-
width: "100%",
|
|
685
|
-
height: "100%",
|
|
686
689
|
maxHeight: "100%",
|
|
687
690
|
maxWidth: "100%",
|
|
688
691
|
flexGrow: 1,
|
|
689
692
|
overflow: "auto",
|
|
690
|
-
...
|
|
693
|
+
...u
|
|
691
694
|
}
|
|
692
695
|
},
|
|
693
696
|
he,
|
|
@@ -695,11 +698,11 @@ function Ee({
|
|
|
695
698
|
pe
|
|
696
699
|
);
|
|
697
700
|
}
|
|
698
|
-
const
|
|
701
|
+
const Re = M, Ve = K;
|
|
699
702
|
function ze(e) {
|
|
700
703
|
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
701
704
|
}
|
|
702
|
-
const
|
|
705
|
+
const se = "data-react-window-index";
|
|
703
706
|
function Ae({
|
|
704
707
|
children: e,
|
|
705
708
|
className: t,
|
|
@@ -710,31 +713,31 @@ function Ae({
|
|
|
710
713
|
overscanCount: i = 3,
|
|
711
714
|
rowComponent: f,
|
|
712
715
|
rowCount: l,
|
|
713
|
-
rowHeight:
|
|
716
|
+
rowHeight: a,
|
|
714
717
|
rowProps: d,
|
|
715
|
-
tagName:
|
|
716
|
-
style:
|
|
717
|
-
...
|
|
718
|
+
tagName: c = "div",
|
|
719
|
+
style: h,
|
|
720
|
+
...p
|
|
718
721
|
}) {
|
|
719
|
-
const
|
|
722
|
+
const I = de(d), u = A(
|
|
720
723
|
() => le(f, ue),
|
|
721
724
|
[f]
|
|
722
|
-
), [
|
|
723
|
-
getCellBounds:
|
|
724
|
-
getEstimatedSize:
|
|
725
|
-
scrollToIndex:
|
|
726
|
-
startIndexOverscan:
|
|
727
|
-
startIndexVisible:
|
|
728
|
-
stopIndexOverscan:
|
|
729
|
-
stopIndexVisible:
|
|
730
|
-
} =
|
|
731
|
-
containerElement:
|
|
732
|
-
containerStyle:
|
|
725
|
+
), [w, m] = M(null), O = ze(a), G = A(() => O ? (b) => a.getRowHeight(b) ?? a.getAverageRowHeight() : a, [O, a]), {
|
|
726
|
+
getCellBounds: x,
|
|
727
|
+
getEstimatedSize: F,
|
|
728
|
+
scrollToIndex: V,
|
|
729
|
+
startIndexOverscan: z,
|
|
730
|
+
startIndexVisible: $,
|
|
731
|
+
stopIndexOverscan: y,
|
|
732
|
+
stopIndexVisible: g
|
|
733
|
+
} = te({
|
|
734
|
+
containerElement: w,
|
|
735
|
+
containerStyle: h,
|
|
733
736
|
defaultContainerSize: s,
|
|
734
737
|
direction: "vertical",
|
|
735
738
|
itemCount: l,
|
|
736
|
-
itemProps:
|
|
737
|
-
itemSize:
|
|
739
|
+
itemProps: I,
|
|
740
|
+
itemSize: G,
|
|
738
741
|
onResize: n,
|
|
739
742
|
overscanCount: i
|
|
740
743
|
});
|
|
@@ -742,135 +745,135 @@ function Ae({
|
|
|
742
745
|
r,
|
|
743
746
|
() => ({
|
|
744
747
|
get element() {
|
|
745
|
-
return
|
|
748
|
+
return w;
|
|
746
749
|
},
|
|
747
750
|
scrollToRow({
|
|
748
|
-
align:
|
|
749
|
-
behavior:
|
|
750
|
-
index:
|
|
751
|
+
align: b = "auto",
|
|
752
|
+
behavior: v = "auto",
|
|
753
|
+
index: R
|
|
751
754
|
}) {
|
|
752
|
-
const
|
|
753
|
-
align:
|
|
754
|
-
containerScrollOffset:
|
|
755
|
-
index:
|
|
755
|
+
const k = V({
|
|
756
|
+
align: b,
|
|
757
|
+
containerScrollOffset: w?.scrollTop ?? 0,
|
|
758
|
+
index: R
|
|
756
759
|
});
|
|
757
|
-
typeof
|
|
758
|
-
behavior:
|
|
759
|
-
top:
|
|
760
|
+
typeof w?.scrollTo == "function" && w.scrollTo({
|
|
761
|
+
behavior: v,
|
|
762
|
+
top: k
|
|
760
763
|
});
|
|
761
764
|
}
|
|
762
765
|
}),
|
|
763
|
-
[
|
|
766
|
+
[w, V]
|
|
764
767
|
), q(() => {
|
|
765
|
-
if (!
|
|
768
|
+
if (!w)
|
|
766
769
|
return;
|
|
767
|
-
const
|
|
768
|
-
if (
|
|
770
|
+
const b = Array.from(w.children).filter((v, R) => {
|
|
771
|
+
if (v.hasAttribute("aria-hidden"))
|
|
769
772
|
return !1;
|
|
770
|
-
const
|
|
771
|
-
return
|
|
773
|
+
const k = `${z + R}`;
|
|
774
|
+
return v.setAttribute(se, k), !0;
|
|
772
775
|
});
|
|
773
|
-
if (
|
|
774
|
-
return
|
|
776
|
+
if (O)
|
|
777
|
+
return a.observeRowElements(b);
|
|
775
778
|
}, [
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
w,
|
|
780
|
+
O,
|
|
781
|
+
a,
|
|
782
|
+
z,
|
|
783
|
+
y
|
|
781
784
|
]), J(() => {
|
|
782
|
-
|
|
785
|
+
z >= 0 && y >= 0 && o && o(
|
|
783
786
|
{
|
|
784
|
-
startIndex:
|
|
785
|
-
stopIndex:
|
|
787
|
+
startIndex: $,
|
|
788
|
+
stopIndex: g
|
|
786
789
|
},
|
|
787
790
|
{
|
|
788
|
-
startIndex:
|
|
789
|
-
stopIndex:
|
|
791
|
+
startIndex: z,
|
|
792
|
+
stopIndex: y
|
|
790
793
|
}
|
|
791
794
|
);
|
|
792
795
|
}, [
|
|
793
796
|
o,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
797
|
+
z,
|
|
798
|
+
$,
|
|
799
|
+
y,
|
|
800
|
+
g
|
|
798
801
|
]);
|
|
799
|
-
const
|
|
800
|
-
const
|
|
802
|
+
const S = A(() => {
|
|
803
|
+
const b = [];
|
|
801
804
|
if (l > 0)
|
|
802
|
-
for (let
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
+
for (let v = z; v <= y; v++) {
|
|
806
|
+
const R = x(v);
|
|
807
|
+
b.push(
|
|
805
808
|
/* @__PURE__ */ X(
|
|
806
|
-
|
|
809
|
+
u,
|
|
807
810
|
{
|
|
808
|
-
...
|
|
811
|
+
...I,
|
|
809
812
|
ariaAttributes: {
|
|
810
|
-
"aria-posinset":
|
|
813
|
+
"aria-posinset": v + 1,
|
|
811
814
|
"aria-setsize": l,
|
|
812
815
|
role: "listitem"
|
|
813
816
|
},
|
|
814
|
-
key:
|
|
815
|
-
index:
|
|
817
|
+
key: v,
|
|
818
|
+
index: v,
|
|
816
819
|
style: {
|
|
817
820
|
position: "absolute",
|
|
818
821
|
left: 0,
|
|
819
|
-
transform: `translateY(${
|
|
822
|
+
transform: `translateY(${R.scrollOffset}px)`,
|
|
820
823
|
// In case of dynamic row heights, don't specify a height style
|
|
821
824
|
// otherwise a default/estimated height would mask the actual height
|
|
822
|
-
height:
|
|
825
|
+
height: O ? void 0 : R.size,
|
|
823
826
|
width: "100%"
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
829
|
)
|
|
827
830
|
);
|
|
828
831
|
}
|
|
829
|
-
return
|
|
832
|
+
return b;
|
|
830
833
|
}, [
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
+
u,
|
|
835
|
+
x,
|
|
836
|
+
O,
|
|
834
837
|
l,
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
]),
|
|
838
|
+
I,
|
|
839
|
+
z,
|
|
840
|
+
y
|
|
841
|
+
]), E = /* @__PURE__ */ ee(
|
|
839
842
|
"div",
|
|
840
843
|
{
|
|
841
844
|
"aria-hidden": !0,
|
|
842
845
|
style: {
|
|
843
|
-
height:
|
|
846
|
+
height: F(),
|
|
844
847
|
width: "100%",
|
|
845
848
|
zIndex: -1
|
|
846
849
|
}
|
|
847
850
|
}
|
|
848
851
|
);
|
|
849
852
|
return X(
|
|
850
|
-
|
|
853
|
+
c,
|
|
851
854
|
{
|
|
852
855
|
role: "list",
|
|
853
|
-
...
|
|
856
|
+
...p,
|
|
854
857
|
className: t,
|
|
855
|
-
ref:
|
|
858
|
+
ref: m,
|
|
856
859
|
style: {
|
|
857
860
|
position: "relative",
|
|
858
861
|
maxHeight: "100%",
|
|
859
862
|
flexGrow: 1,
|
|
860
863
|
overflowY: "auto",
|
|
861
|
-
...
|
|
864
|
+
...h
|
|
862
865
|
}
|
|
863
866
|
},
|
|
864
|
-
|
|
867
|
+
S,
|
|
865
868
|
e,
|
|
866
|
-
|
|
869
|
+
E
|
|
867
870
|
);
|
|
868
871
|
}
|
|
869
872
|
function ke({
|
|
870
873
|
defaultRowHeight: e,
|
|
871
874
|
key: t
|
|
872
875
|
}) {
|
|
873
|
-
const [s, r] =
|
|
876
|
+
const [s, r] = M({
|
|
874
877
|
key: t,
|
|
875
878
|
map: /* @__PURE__ */ new Map()
|
|
876
879
|
});
|
|
@@ -878,52 +881,52 @@ function ke({
|
|
|
878
881
|
key: t,
|
|
879
882
|
map: /* @__PURE__ */ new Map()
|
|
880
883
|
});
|
|
881
|
-
const { map: n } = s, o =
|
|
882
|
-
let
|
|
883
|
-
return n.forEach((
|
|
884
|
-
|
|
885
|
-
}),
|
|
886
|
-
}, [e, n]), i =
|
|
887
|
-
(
|
|
888
|
-
const
|
|
889
|
-
return
|
|
884
|
+
const { map: n } = s, o = D(() => {
|
|
885
|
+
let c = 0;
|
|
886
|
+
return n.forEach((h) => {
|
|
887
|
+
c += h;
|
|
888
|
+
}), c === 0 ? e : c / n.size;
|
|
889
|
+
}, [e, n]), i = D(
|
|
890
|
+
(c) => {
|
|
891
|
+
const h = n.get(c);
|
|
892
|
+
return h !== void 0 ? h : (n.set(c, e), e);
|
|
890
893
|
},
|
|
891
894
|
[e, n]
|
|
892
|
-
), f =
|
|
893
|
-
r((
|
|
894
|
-
if (
|
|
895
|
-
return
|
|
896
|
-
const
|
|
897
|
-
return
|
|
898
|
-
...
|
|
899
|
-
map:
|
|
895
|
+
), f = D((c, h) => {
|
|
896
|
+
r((p) => {
|
|
897
|
+
if (p.map.get(c) === h)
|
|
898
|
+
return p;
|
|
899
|
+
const I = new Map(p.map);
|
|
900
|
+
return I.set(c, h), {
|
|
901
|
+
...p,
|
|
902
|
+
map: I
|
|
900
903
|
};
|
|
901
904
|
});
|
|
902
905
|
}, []), l = ae(
|
|
903
|
-
(
|
|
904
|
-
|
|
905
|
-
const { borderBoxSize:
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
`Invalid ${
|
|
906
|
+
(c) => {
|
|
907
|
+
c.length !== 0 && c.forEach((h) => {
|
|
908
|
+
const { borderBoxSize: p, target: I } = h, u = I.getAttribute(se);
|
|
909
|
+
L(
|
|
910
|
+
u !== null,
|
|
911
|
+
`Invalid ${se} attribute value`
|
|
909
912
|
);
|
|
910
|
-
const
|
|
911
|
-
|
|
913
|
+
const w = parseInt(u), { blockSize: m } = p[0];
|
|
914
|
+
m && f(w, m);
|
|
912
915
|
});
|
|
913
916
|
}
|
|
914
|
-
), [
|
|
917
|
+
), [a] = M(
|
|
915
918
|
() => new ResizeObserver(l)
|
|
916
919
|
);
|
|
917
920
|
J(() => () => {
|
|
918
|
-
|
|
919
|
-
}, [
|
|
920
|
-
const d =
|
|
921
|
-
(
|
|
922
|
-
|
|
921
|
+
a.disconnect();
|
|
922
|
+
}, [a]);
|
|
923
|
+
const d = D(
|
|
924
|
+
(c) => (c.forEach((h) => a.observe(h)), () => {
|
|
925
|
+
c.forEach((h) => a.unobserve(h));
|
|
923
926
|
}),
|
|
924
|
-
[
|
|
927
|
+
[a]
|
|
925
928
|
);
|
|
926
|
-
return
|
|
929
|
+
return A(
|
|
927
930
|
() => ({
|
|
928
931
|
getAverageRowHeight: o,
|
|
929
932
|
getRowHeight: i,
|
|
@@ -933,7 +936,7 @@ function ke({
|
|
|
933
936
|
[o, i, f, d]
|
|
934
937
|
);
|
|
935
938
|
}
|
|
936
|
-
const Le =
|
|
939
|
+
const Le = M, Me = K;
|
|
937
940
|
let C = -1;
|
|
938
941
|
function $e(e = !1) {
|
|
939
942
|
if (C === -1 || e) {
|
|
@@ -947,8 +950,8 @@ export {
|
|
|
947
950
|
Ae as List,
|
|
948
951
|
$e as getScrollbarSize,
|
|
949
952
|
ke as useDynamicRowHeight,
|
|
950
|
-
|
|
951
|
-
|
|
953
|
+
Re as useGridCallbackRef,
|
|
954
|
+
Ve as useGridRef,
|
|
952
955
|
Le as useListCallbackRef,
|
|
953
956
|
Me as useListRef
|
|
954
957
|
};
|