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