react-window 2.0.0-alpha.3 → 2.0.0-alpha.4
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.d.ts +2 -2
- package/dist/react-window.js +191 -184
- package/docs/assets/index-BsBvdJUI.css +1 -0
- package/docs/assets/{index-C0dH_qJq.js → index-D8tyZCWm.js} +16 -16
- package/docs/generated/js-docs/Grid.json +1 -1
- package/docs/generated/js-docs/List.json +1 -1
- package/docs/index.html +2 -2
- package/docs/stats.html +1 -1
- package/package.json +1 -1
- package/docs/assets/index-DuD8RcK_.css +0 -1
package/dist/react-window.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
-
import { useLayoutEffect as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
2
|
+
import { useLayoutEffect as D, useEffect as W, useMemo as k, useState as L, useRef as B, useCallback as P, memo as N, useImperativeHandle as Y, createElement as q } from "react";
|
|
3
|
+
const U = typeof window < "u" ? D : W;
|
|
4
|
+
function V(t) {
|
|
5
5
|
if (t !== void 0)
|
|
6
6
|
switch (typeof t) {
|
|
7
7
|
case "number":
|
|
@@ -13,143 +13,143 @@ function B(t) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function J({
|
|
17
17
|
box: t,
|
|
18
|
-
defaultHeight:
|
|
19
|
-
defaultWidth:
|
|
18
|
+
defaultHeight: o,
|
|
19
|
+
defaultWidth: n,
|
|
20
20
|
disabled: s,
|
|
21
21
|
element: e,
|
|
22
22
|
mode: f,
|
|
23
|
-
style:
|
|
23
|
+
style: l
|
|
24
24
|
}) {
|
|
25
|
-
const { styleHeight: c, styleWidth:
|
|
25
|
+
const { styleHeight: c, styleWidth: r } = k(
|
|
26
26
|
() => ({
|
|
27
|
-
styleHeight:
|
|
28
|
-
styleWidth:
|
|
27
|
+
styleHeight: V(l?.height),
|
|
28
|
+
styleWidth: V(l?.width)
|
|
29
29
|
}),
|
|
30
|
-
[
|
|
30
|
+
[l?.height, l?.width]
|
|
31
31
|
), [u, w] = L({
|
|
32
|
-
height:
|
|
33
|
-
width:
|
|
34
|
-
}), I = s || f === "only-height" && c !== void 0 || f === "only-width" &&
|
|
35
|
-
return
|
|
32
|
+
height: o,
|
|
33
|
+
width: n
|
|
34
|
+
}), I = s || f === "only-height" && c !== void 0 || f === "only-width" && r !== void 0 || c !== void 0 && r !== void 0;
|
|
35
|
+
return U(() => {
|
|
36
36
|
if (e === null || I)
|
|
37
37
|
return;
|
|
38
38
|
const O = new ResizeObserver((S) => {
|
|
39
39
|
for (const m of S) {
|
|
40
|
-
const { contentRect:
|
|
41
|
-
e === b && w((
|
|
42
|
-
height:
|
|
43
|
-
width:
|
|
40
|
+
const { contentRect: a, target: b } = m;
|
|
41
|
+
e === b && w((d) => d.height === a.height && d.width === a.width ? d : {
|
|
42
|
+
height: a.height,
|
|
43
|
+
width: a.width
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
return O.observe(e, { box: t }), () => {
|
|
48
48
|
O?.unobserve(e);
|
|
49
49
|
};
|
|
50
|
-
}, [t, I, e, c,
|
|
50
|
+
}, [t, I, e, c, r]), k(
|
|
51
51
|
() => ({
|
|
52
52
|
height: c ?? u.height,
|
|
53
|
-
width:
|
|
53
|
+
width: r ?? u.width
|
|
54
54
|
}),
|
|
55
|
-
[u, c,
|
|
55
|
+
[u, c, r]
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
|
-
function $(t,
|
|
58
|
+
function $(t, o = "Assertion error") {
|
|
59
59
|
if (!t)
|
|
60
|
-
throw console.error(
|
|
60
|
+
throw console.error(o), Error(o);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function K({
|
|
63
63
|
cachedBounds: t,
|
|
64
|
-
itemCount:
|
|
65
|
-
itemSize:
|
|
64
|
+
itemCount: o,
|
|
65
|
+
itemSize: n
|
|
66
66
|
}) {
|
|
67
|
-
if (typeof
|
|
68
|
-
return
|
|
67
|
+
if (typeof n == "number")
|
|
68
|
+
return o * n;
|
|
69
69
|
if (t.size > 0) {
|
|
70
70
|
const s = t.get(t.size - 1);
|
|
71
71
|
$(s !== void 0, "Unexpected bounds cache miss");
|
|
72
72
|
const e = (s.scrollOffset + s.size) / t.size;
|
|
73
|
-
return
|
|
73
|
+
return o * e;
|
|
74
74
|
} else
|
|
75
75
|
return 0;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function Q({
|
|
78
78
|
align: t,
|
|
79
|
-
cachedBounds:
|
|
80
|
-
index:
|
|
79
|
+
cachedBounds: o,
|
|
80
|
+
index: n,
|
|
81
81
|
itemCount: s,
|
|
82
82
|
containerScrollOffset: e,
|
|
83
83
|
containerSize: f
|
|
84
84
|
}) {
|
|
85
|
-
const
|
|
85
|
+
const l = o.get(s - 1).scrollOffset, c = l + l - f, r = Math.max(
|
|
86
86
|
0,
|
|
87
|
-
|
|
87
|
+
o.get(n + 1).scrollOffset - f
|
|
88
88
|
), u = Math.min(
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
l,
|
|
90
|
+
o.get(n).scrollOffset
|
|
91
91
|
);
|
|
92
|
-
switch (t === "smart" && (e >=
|
|
92
|
+
switch (t === "smart" && (e >= r && e <= u ? t = "auto" : t = "center"), t) {
|
|
93
93
|
case "start":
|
|
94
94
|
return Math.min(c, u);
|
|
95
95
|
case "end":
|
|
96
|
-
return
|
|
96
|
+
return r;
|
|
97
97
|
case "center": {
|
|
98
98
|
const w = Math.round(
|
|
99
|
-
|
|
99
|
+
r + (u - r) / 2
|
|
100
100
|
);
|
|
101
101
|
return w < Math.ceil(f / 2) ? 0 : w > c ? c : w;
|
|
102
102
|
}
|
|
103
103
|
case "auto":
|
|
104
104
|
default:
|
|
105
|
-
return e >=
|
|
105
|
+
return e >= r && e <= u ? e : e < r ? r : u;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function X({
|
|
109
109
|
cachedBounds: t,
|
|
110
|
-
containerScrollOffset:
|
|
111
|
-
containerSize:
|
|
110
|
+
containerScrollOffset: o,
|
|
111
|
+
containerSize: n,
|
|
112
112
|
itemCount: s,
|
|
113
113
|
overscanCount: e
|
|
114
114
|
}) {
|
|
115
115
|
const f = s - 1;
|
|
116
|
-
let
|
|
117
|
-
for (;
|
|
118
|
-
const u = t.get(
|
|
119
|
-
if (u.scrollOffset + u.size >
|
|
116
|
+
let l = 0, c = -1, r = 0;
|
|
117
|
+
for (; r < f; ) {
|
|
118
|
+
const u = t.get(r);
|
|
119
|
+
if (u.scrollOffset + u.size > o)
|
|
120
120
|
break;
|
|
121
|
-
|
|
121
|
+
r++;
|
|
122
122
|
}
|
|
123
|
-
for (
|
|
124
|
-
const u = t.get(
|
|
125
|
-
if (u.scrollOffset + u.size >=
|
|
123
|
+
for (l = r, l = Math.max(0, l - e); r < f; ) {
|
|
124
|
+
const u = t.get(r);
|
|
125
|
+
if (u.scrollOffset + u.size >= o + n)
|
|
126
126
|
break;
|
|
127
|
-
|
|
127
|
+
r++;
|
|
128
128
|
}
|
|
129
|
-
return c = Math.min(f,
|
|
129
|
+
return c = Math.min(f, r), c = Math.min(s - 1, c + e), l < 0 ? [0, -1] : [l, c];
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Z({
|
|
132
132
|
itemCount: t,
|
|
133
|
-
itemProps:
|
|
134
|
-
itemSize:
|
|
133
|
+
itemProps: o,
|
|
134
|
+
itemSize: n
|
|
135
135
|
}) {
|
|
136
136
|
const s = /* @__PURE__ */ new Map();
|
|
137
137
|
return {
|
|
138
138
|
get(e) {
|
|
139
139
|
for ($(e < t, `Invalid index ${e}`); s.size - 1 < e; ) {
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
s.set(
|
|
140
|
+
const l = s.size, c = typeof n == "number" ? n : n(l, o);
|
|
141
|
+
if (l === 0)
|
|
142
|
+
s.set(l, {
|
|
143
143
|
size: c,
|
|
144
144
|
scrollOffset: 0
|
|
145
145
|
});
|
|
146
146
|
else {
|
|
147
|
-
const
|
|
147
|
+
const r = s.get(l - 1);
|
|
148
148
|
$(
|
|
149
|
-
|
|
149
|
+
r !== void 0,
|
|
150
150
|
`Unexpected bounds cache miss for index ${e}`
|
|
151
|
-
), s.set(
|
|
152
|
-
scrollOffset:
|
|
151
|
+
), s.set(l, {
|
|
152
|
+
scrollOffset: r.scrollOffset + r.size,
|
|
153
153
|
size: c
|
|
154
154
|
});
|
|
155
155
|
}
|
|
@@ -170,75 +170,83 @@ function C({
|
|
|
170
170
|
}
|
|
171
171
|
function tt({
|
|
172
172
|
itemCount: t,
|
|
173
|
-
itemProps:
|
|
174
|
-
itemSize:
|
|
173
|
+
itemProps: o,
|
|
174
|
+
itemSize: n
|
|
175
175
|
}) {
|
|
176
|
-
return
|
|
177
|
-
() =>
|
|
176
|
+
return k(
|
|
177
|
+
() => Z({
|
|
178
178
|
itemCount: t,
|
|
179
|
-
itemProps:
|
|
180
|
-
itemSize:
|
|
179
|
+
itemProps: o,
|
|
180
|
+
itemSize: n
|
|
181
181
|
}),
|
|
182
|
-
[t,
|
|
182
|
+
[t, o, n]
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
+
function et(t) {
|
|
186
|
+
const o = B(() => {
|
|
187
|
+
throw new Error("Cannot call an event handler while rendering.");
|
|
188
|
+
});
|
|
189
|
+
return U(() => {
|
|
190
|
+
o.current = t;
|
|
191
|
+
}, [t]), P((n) => o.current?.(n), [o]);
|
|
192
|
+
}
|
|
185
193
|
function G({
|
|
186
194
|
containerElement: t,
|
|
187
|
-
containerStyle:
|
|
188
|
-
defaultContainerSize:
|
|
195
|
+
containerStyle: o,
|
|
196
|
+
defaultContainerSize: n = 0,
|
|
189
197
|
direction: s,
|
|
190
198
|
itemCount: e,
|
|
191
199
|
itemProps: f,
|
|
192
|
-
itemSize:
|
|
200
|
+
itemSize: l,
|
|
193
201
|
overscanCount: c
|
|
194
202
|
}) {
|
|
195
|
-
const [
|
|
196
|
-
Math.min(e - 1,
|
|
197
|
-
Math.min(e - 1,
|
|
198
|
-
], { height: O =
|
|
199
|
-
defaultHeight: s === "vertical" ?
|
|
200
|
-
defaultWidth: s === "horizontal" ?
|
|
203
|
+
const [r, u] = L([0, -1]), [w, I] = [
|
|
204
|
+
Math.min(e - 1, r[0]),
|
|
205
|
+
Math.min(e - 1, r[1])
|
|
206
|
+
], { height: O = n, width: S = n } = J({
|
|
207
|
+
defaultHeight: s === "vertical" ? n : void 0,
|
|
208
|
+
defaultWidth: s === "horizontal" ? n : void 0,
|
|
201
209
|
element: t,
|
|
202
210
|
mode: s === "vertical" ? "only-height" : "only-width",
|
|
203
|
-
style:
|
|
204
|
-
}), m = s === "vertical" ? O : S,
|
|
211
|
+
style: o
|
|
212
|
+
}), m = s === "vertical" ? O : S, a = tt({
|
|
205
213
|
itemCount: e,
|
|
206
214
|
itemProps: f,
|
|
207
|
-
itemSize:
|
|
215
|
+
itemSize: l
|
|
208
216
|
}), b = P(
|
|
209
|
-
(i) =>
|
|
210
|
-
[
|
|
211
|
-
),
|
|
212
|
-
() =>
|
|
213
|
-
cachedBounds:
|
|
217
|
+
(i) => a.get(i),
|
|
218
|
+
[a]
|
|
219
|
+
), d = P(
|
|
220
|
+
() => K({
|
|
221
|
+
cachedBounds: a,
|
|
214
222
|
itemCount: e,
|
|
215
|
-
itemSize:
|
|
223
|
+
itemSize: l
|
|
216
224
|
}),
|
|
217
|
-
[
|
|
218
|
-
),
|
|
219
|
-
(i) =>
|
|
220
|
-
cachedBounds:
|
|
225
|
+
[a, e, l]
|
|
226
|
+
), E = P(
|
|
227
|
+
(i) => X({
|
|
228
|
+
cachedBounds: a,
|
|
221
229
|
containerScrollOffset: i,
|
|
222
230
|
containerSize: m,
|
|
223
231
|
itemCount: e,
|
|
224
232
|
overscanCount: c
|
|
225
233
|
}),
|
|
226
|
-
[
|
|
234
|
+
[a, m, e, c]
|
|
227
235
|
);
|
|
228
|
-
|
|
236
|
+
U(() => {
|
|
229
237
|
const i = (s === "vertical" ? t?.scrollTop : t?.scrollLeft) ?? 0;
|
|
230
|
-
u(
|
|
231
|
-
}, [t, s,
|
|
232
|
-
const g =
|
|
238
|
+
u(E(i));
|
|
239
|
+
}, [t, s, E]);
|
|
240
|
+
const g = et(
|
|
233
241
|
({
|
|
234
242
|
align: i = "auto",
|
|
235
243
|
behavior: p = "auto",
|
|
236
244
|
containerScrollOffset: z,
|
|
237
245
|
index: x
|
|
238
246
|
}) => {
|
|
239
|
-
const h =
|
|
247
|
+
const h = Q({
|
|
240
248
|
align: i,
|
|
241
|
-
cachedBounds:
|
|
249
|
+
cachedBounds: a,
|
|
242
250
|
containerScrollOffset: z,
|
|
243
251
|
containerSize: m,
|
|
244
252
|
index: x,
|
|
@@ -251,14 +259,13 @@ function G({
|
|
|
251
259
|
behavior: p || void 0,
|
|
252
260
|
top: h
|
|
253
261
|
});
|
|
254
|
-
}
|
|
255
|
-
[d, t, m, s, e]
|
|
262
|
+
}
|
|
256
263
|
);
|
|
257
264
|
return {
|
|
258
265
|
getCellBounds: b,
|
|
259
|
-
getEstimatedHeight:
|
|
266
|
+
getEstimatedHeight: d,
|
|
260
267
|
onScroll: () => {
|
|
261
|
-
const i =
|
|
268
|
+
const i = E(
|
|
262
269
|
(s === "vertical" ? t?.scrollTop : t?.scrollLeft) ?? 0
|
|
263
270
|
);
|
|
264
271
|
(i[0] !== w || i[1] !== I) && u(i);
|
|
@@ -269,83 +276,83 @@ function G({
|
|
|
269
276
|
};
|
|
270
277
|
}
|
|
271
278
|
function A(t) {
|
|
272
|
-
return
|
|
279
|
+
return k(() => t, Object.values(t));
|
|
273
280
|
}
|
|
274
|
-
function
|
|
275
|
-
if (t ===
|
|
281
|
+
function F(t, o) {
|
|
282
|
+
if (t === o)
|
|
276
283
|
return !0;
|
|
277
|
-
if (!!t != !!
|
|
284
|
+
if (!!t != !!o || ($(t !== void 0), $(o !== void 0), Object.keys(t).length !== Object.keys(o).length))
|
|
278
285
|
return !1;
|
|
279
|
-
for (const
|
|
280
|
-
if (!Object.is(
|
|
286
|
+
for (const n in t)
|
|
287
|
+
if (!Object.is(o[n], t[n]))
|
|
281
288
|
return !1;
|
|
282
289
|
return !0;
|
|
283
290
|
}
|
|
284
|
-
function _(t,
|
|
285
|
-
const { style:
|
|
286
|
-
return
|
|
291
|
+
function _(t, o) {
|
|
292
|
+
const { style: n, ...s } = t, { style: e, ...f } = o;
|
|
293
|
+
return F(n, e) && F(s, f);
|
|
287
294
|
}
|
|
288
|
-
const
|
|
295
|
+
const C = () => {
|
|
289
296
|
};
|
|
290
|
-
function
|
|
297
|
+
function rt({
|
|
291
298
|
cellComponent: t,
|
|
292
|
-
cellProps:
|
|
293
|
-
className:
|
|
299
|
+
cellProps: o,
|
|
300
|
+
className: n,
|
|
294
301
|
columnCount: s,
|
|
295
302
|
columnWidth: e,
|
|
296
303
|
defaultHeight: f = 0,
|
|
297
|
-
defaultWidth:
|
|
304
|
+
defaultWidth: l = 0,
|
|
298
305
|
gridRef: c,
|
|
299
|
-
onCellsRendered:
|
|
300
|
-
onScroll: u =
|
|
306
|
+
onCellsRendered: r,
|
|
307
|
+
onScroll: u = C,
|
|
301
308
|
overscanCount: w = 3,
|
|
302
309
|
rowCount: I,
|
|
303
310
|
rowHeight: O,
|
|
304
311
|
style: S,
|
|
305
312
|
...m
|
|
306
313
|
}) {
|
|
307
|
-
const
|
|
308
|
-
() =>
|
|
314
|
+
const a = A(o), b = k(
|
|
315
|
+
() => N(t, _),
|
|
309
316
|
[t]
|
|
310
|
-
), [
|
|
311
|
-
containerElement:
|
|
312
|
-
defaultContainerSize:
|
|
317
|
+
), [d, E] = L(null), g = G({
|
|
318
|
+
containerElement: d,
|
|
319
|
+
defaultContainerSize: l,
|
|
313
320
|
direction: "horizontal",
|
|
314
321
|
itemCount: s,
|
|
315
|
-
itemProps:
|
|
322
|
+
itemProps: a,
|
|
316
323
|
itemSize: e,
|
|
317
324
|
overscanCount: w
|
|
318
325
|
}), i = G({
|
|
319
|
-
containerElement:
|
|
326
|
+
containerElement: d,
|
|
320
327
|
defaultContainerSize: f,
|
|
321
328
|
direction: "vertical",
|
|
322
329
|
itemCount: I,
|
|
323
|
-
itemProps:
|
|
330
|
+
itemProps: a,
|
|
324
331
|
itemSize: O,
|
|
325
332
|
overscanCount: w
|
|
326
333
|
}), { startIndex: p, stopIndex: z } = g, { startIndex: x, stopIndex: h } = i;
|
|
327
|
-
|
|
334
|
+
Y(
|
|
328
335
|
c,
|
|
329
336
|
() => ({
|
|
330
337
|
get element() {
|
|
331
|
-
return
|
|
338
|
+
return d;
|
|
332
339
|
},
|
|
333
340
|
scrollToCell({
|
|
334
341
|
behavior: v = "auto",
|
|
335
342
|
columnAlign: y = "auto",
|
|
336
343
|
columnIndex: T,
|
|
337
|
-
rowAlign:
|
|
344
|
+
rowAlign: H = "auto",
|
|
338
345
|
rowIndex: R
|
|
339
346
|
}) {
|
|
340
347
|
i?.scrollToIndex({
|
|
341
|
-
align:
|
|
348
|
+
align: H,
|
|
342
349
|
behavior: v,
|
|
343
|
-
containerScrollOffset:
|
|
350
|
+
containerScrollOffset: d?.scrollTop ?? 0,
|
|
344
351
|
index: R
|
|
345
352
|
}), g?.scrollToIndex({
|
|
346
353
|
align: y,
|
|
347
354
|
behavior: v,
|
|
348
|
-
containerScrollOffset:
|
|
355
|
+
containerScrollOffset: d?.scrollLeft ?? 0,
|
|
349
356
|
index: T
|
|
350
357
|
});
|
|
351
358
|
},
|
|
@@ -357,7 +364,7 @@ function ot({
|
|
|
357
364
|
g?.scrollToIndex({
|
|
358
365
|
align: v,
|
|
359
366
|
behavior: y,
|
|
360
|
-
containerScrollOffset:
|
|
367
|
+
containerScrollOffset: d?.scrollLeft ?? 0,
|
|
361
368
|
index: T
|
|
362
369
|
});
|
|
363
370
|
},
|
|
@@ -369,40 +376,40 @@ function ot({
|
|
|
369
376
|
i?.scrollToIndex({
|
|
370
377
|
align: v,
|
|
371
378
|
behavior: y,
|
|
372
|
-
containerScrollOffset:
|
|
379
|
+
containerScrollOffset: d?.scrollTop ?? 0,
|
|
373
380
|
index: T
|
|
374
381
|
});
|
|
375
382
|
}
|
|
376
383
|
}),
|
|
377
|
-
[g,
|
|
384
|
+
[g, d, i]
|
|
378
385
|
), W(() => {
|
|
379
|
-
p >= 0 && z >= 0 && x >= 0 && h >= 0 &&
|
|
386
|
+
p >= 0 && z >= 0 && x >= 0 && h >= 0 && r && r({
|
|
380
387
|
columnStartIndex: p,
|
|
381
388
|
columnStopIndex: z,
|
|
382
389
|
rowStartIndex: x,
|
|
383
390
|
rowStopIndex: h
|
|
384
391
|
});
|
|
385
392
|
}, [
|
|
386
|
-
|
|
393
|
+
r,
|
|
387
394
|
p,
|
|
388
395
|
z,
|
|
389
396
|
x,
|
|
390
397
|
h
|
|
391
398
|
]);
|
|
392
|
-
const
|
|
399
|
+
const M = k(() => {
|
|
393
400
|
const v = [];
|
|
394
401
|
if (g && s > 0 && i && I > 0)
|
|
395
402
|
for (let y = x; y <= h; y++) {
|
|
396
403
|
const T = i.getCellBounds(y);
|
|
397
|
-
for (let
|
|
398
|
-
const R = g.getCellBounds(
|
|
404
|
+
for (let H = p; H <= z; H++) {
|
|
405
|
+
const R = g.getCellBounds(H);
|
|
399
406
|
v.push(
|
|
400
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ q(
|
|
401
408
|
b,
|
|
402
409
|
{
|
|
403
|
-
...
|
|
404
|
-
columnIndex:
|
|
405
|
-
key: `${y}-${
|
|
410
|
+
...a,
|
|
411
|
+
columnIndex: H,
|
|
412
|
+
key: `${y}-${H}`,
|
|
406
413
|
rowIndex: y,
|
|
407
414
|
style: {
|
|
408
415
|
position: "absolute",
|
|
@@ -419,7 +426,7 @@ function ot({
|
|
|
419
426
|
return v;
|
|
420
427
|
}, [
|
|
421
428
|
b,
|
|
422
|
-
|
|
429
|
+
a,
|
|
423
430
|
s,
|
|
424
431
|
p,
|
|
425
432
|
z,
|
|
@@ -434,11 +441,11 @@ function ot({
|
|
|
434
441
|
{
|
|
435
442
|
role: "grid",
|
|
436
443
|
...m,
|
|
437
|
-
className:
|
|
444
|
+
className: n,
|
|
438
445
|
onScroll: (v) => {
|
|
439
446
|
g.onScroll(), i.onScroll(), u(v);
|
|
440
447
|
},
|
|
441
|
-
ref:
|
|
448
|
+
ref: E,
|
|
442
449
|
style: {
|
|
443
450
|
...S,
|
|
444
451
|
maxHeight: "100%",
|
|
@@ -449,54 +456,54 @@ function ot({
|
|
|
449
456
|
children: /* @__PURE__ */ j(
|
|
450
457
|
"div",
|
|
451
458
|
{
|
|
452
|
-
className:
|
|
459
|
+
className: n,
|
|
453
460
|
style: {
|
|
454
461
|
position: "relative",
|
|
455
462
|
height: i?.getEstimatedHeight(),
|
|
456
463
|
width: g?.getEstimatedHeight()
|
|
457
464
|
},
|
|
458
|
-
children:
|
|
465
|
+
children: M
|
|
459
466
|
}
|
|
460
467
|
)
|
|
461
468
|
}
|
|
462
469
|
);
|
|
463
470
|
}
|
|
464
|
-
const
|
|
465
|
-
function
|
|
471
|
+
const nt = L, lt = B;
|
|
472
|
+
function it({
|
|
466
473
|
className: t,
|
|
467
|
-
defaultHeight:
|
|
468
|
-
listRef:
|
|
474
|
+
defaultHeight: o = 0,
|
|
475
|
+
listRef: n,
|
|
469
476
|
onRowsRendered: s,
|
|
470
|
-
onScroll: e =
|
|
477
|
+
onScroll: e = C,
|
|
471
478
|
overscanCount: f = 3,
|
|
472
|
-
rowComponent:
|
|
479
|
+
rowComponent: l,
|
|
473
480
|
rowCount: c,
|
|
474
|
-
rowHeight:
|
|
481
|
+
rowHeight: r,
|
|
475
482
|
rowProps: u,
|
|
476
483
|
style: w,
|
|
477
484
|
...I
|
|
478
485
|
}) {
|
|
479
|
-
const O = A(u), S =
|
|
480
|
-
() =>
|
|
481
|
-
[
|
|
482
|
-
), [m,
|
|
486
|
+
const O = A(u), S = k(
|
|
487
|
+
() => N(l, _),
|
|
488
|
+
[l]
|
|
489
|
+
), [m, a] = L(null), {
|
|
483
490
|
getCellBounds: b,
|
|
484
|
-
getEstimatedHeight:
|
|
485
|
-
onScroll:
|
|
491
|
+
getEstimatedHeight: d,
|
|
492
|
+
onScroll: E,
|
|
486
493
|
scrollToIndex: g,
|
|
487
494
|
startIndex: i,
|
|
488
495
|
stopIndex: p
|
|
489
496
|
} = G({
|
|
490
497
|
containerElement: m,
|
|
491
|
-
defaultContainerSize:
|
|
498
|
+
defaultContainerSize: o,
|
|
492
499
|
direction: "vertical",
|
|
493
500
|
itemCount: c,
|
|
494
501
|
itemProps: O,
|
|
495
|
-
itemSize:
|
|
502
|
+
itemSize: r,
|
|
496
503
|
overscanCount: f
|
|
497
504
|
});
|
|
498
|
-
|
|
499
|
-
|
|
505
|
+
Y(
|
|
506
|
+
n,
|
|
500
507
|
() => ({
|
|
501
508
|
get element() {
|
|
502
509
|
return m;
|
|
@@ -504,13 +511,13 @@ function nt({
|
|
|
504
511
|
scrollToRow({
|
|
505
512
|
align: x = "auto",
|
|
506
513
|
behavior: h = "auto",
|
|
507
|
-
index:
|
|
514
|
+
index: M
|
|
508
515
|
}) {
|
|
509
516
|
g({
|
|
510
517
|
align: x,
|
|
511
518
|
behavior: h,
|
|
512
519
|
containerScrollOffset: m?.scrollTop ?? 0,
|
|
513
|
-
index:
|
|
520
|
+
index: M
|
|
514
521
|
});
|
|
515
522
|
}
|
|
516
523
|
}),
|
|
@@ -521,13 +528,13 @@ function nt({
|
|
|
521
528
|
stopIndex: p
|
|
522
529
|
});
|
|
523
530
|
}, [s, i, p]);
|
|
524
|
-
const z =
|
|
531
|
+
const z = k(() => {
|
|
525
532
|
const x = [];
|
|
526
533
|
if (c > 0)
|
|
527
534
|
for (let h = i; h <= p; h++) {
|
|
528
|
-
const
|
|
535
|
+
const M = b(h);
|
|
529
536
|
x.push(
|
|
530
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ q(
|
|
531
538
|
S,
|
|
532
539
|
{
|
|
533
540
|
...O,
|
|
@@ -536,8 +543,8 @@ function nt({
|
|
|
536
543
|
style: {
|
|
537
544
|
position: "absolute",
|
|
538
545
|
left: 0,
|
|
539
|
-
transform: `translateY(${
|
|
540
|
-
height:
|
|
546
|
+
transform: `translateY(${M.scrollOffset}px)`,
|
|
547
|
+
height: M.size,
|
|
541
548
|
width: "100%"
|
|
542
549
|
}
|
|
543
550
|
}
|
|
@@ -553,9 +560,9 @@ function nt({
|
|
|
553
560
|
...I,
|
|
554
561
|
className: t,
|
|
555
562
|
onScroll: (x) => {
|
|
556
|
-
|
|
563
|
+
E(), e(x);
|
|
557
564
|
},
|
|
558
|
-
ref:
|
|
565
|
+
ref: a,
|
|
559
566
|
style: {
|
|
560
567
|
...w,
|
|
561
568
|
maxHeight: "100%",
|
|
@@ -567,7 +574,7 @@ function nt({
|
|
|
567
574
|
{
|
|
568
575
|
className: t,
|
|
569
576
|
style: {
|
|
570
|
-
height:
|
|
577
|
+
height: d(),
|
|
571
578
|
position: "relative",
|
|
572
579
|
width: "100%"
|
|
573
580
|
},
|
|
@@ -577,12 +584,12 @@ function nt({
|
|
|
577
584
|
}
|
|
578
585
|
);
|
|
579
586
|
}
|
|
580
|
-
const
|
|
587
|
+
const ct = L, ft = B;
|
|
581
588
|
export {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
589
|
+
rt as Grid,
|
|
590
|
+
it as List,
|
|
591
|
+
nt as useGridCallbackRef,
|
|
585
592
|
lt as useGridRef,
|
|
586
|
-
|
|
587
|
-
|
|
593
|
+
ct as useListCallbackRef,
|
|
594
|
+
ft as useListRef
|
|
588
595
|
};
|