react-window 2.3.2 → 2.3.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/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.js +200 -200
- package/dist/react-window.js.map +1 -1
- package/package.json +1 -1
package/dist/react-window.js
CHANGED
|
@@ -34,36 +34,36 @@ function we({
|
|
|
34
34
|
defaultHeight: t,
|
|
35
35
|
defaultWidth: s,
|
|
36
36
|
disabled: r,
|
|
37
|
-
element:
|
|
38
|
-
mode:
|
|
39
|
-
style:
|
|
37
|
+
element: n,
|
|
38
|
+
mode: o,
|
|
39
|
+
style: d
|
|
40
40
|
}) {
|
|
41
41
|
const { styleHeight: l, styleWidth: c } = H(
|
|
42
42
|
() => ({
|
|
43
|
-
styleHeight: ae(
|
|
44
|
-
styleWidth: ae(
|
|
43
|
+
styleHeight: ae(d?.height),
|
|
44
|
+
styleWidth: ae(d?.width)
|
|
45
45
|
}),
|
|
46
|
-
[
|
|
47
|
-
), [f,
|
|
46
|
+
[d?.height, d?.width]
|
|
47
|
+
), [f, a] = V({
|
|
48
48
|
height: t,
|
|
49
49
|
width: s
|
|
50
|
-
}),
|
|
50
|
+
}), i = r || o === "only-height" && l !== void 0 || o === "only-width" && c !== void 0 || l !== void 0 && c !== void 0;
|
|
51
51
|
return Y(() => {
|
|
52
|
-
if (
|
|
52
|
+
if (n === null || i)
|
|
53
53
|
return;
|
|
54
54
|
const u = new ResizeObserver((h) => {
|
|
55
55
|
for (const x of h) {
|
|
56
56
|
const { contentRect: p, target: w } = x;
|
|
57
|
-
|
|
57
|
+
n === w && a((g) => g.height === p.height && g.width === p.width ? g : {
|
|
58
58
|
height: p.height,
|
|
59
59
|
width: p.width
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
return u.observe(
|
|
64
|
-
u?.unobserve(
|
|
63
|
+
return u.observe(n, { box: e }), () => {
|
|
64
|
+
u?.unobserve(n);
|
|
65
65
|
};
|
|
66
|
-
}, [e,
|
|
66
|
+
}, [e, i, n, l, c]), H(
|
|
67
67
|
() => ({
|
|
68
68
|
height: l ?? f.height,
|
|
69
69
|
width: c ?? f.width
|
|
@@ -84,8 +84,8 @@ function Ie(e = !1) {
|
|
|
84
84
|
if (N === null || e) {
|
|
85
85
|
const t = document.createElement("div"), s = t.style;
|
|
86
86
|
s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
|
|
87
|
-
const r = document.createElement("div"),
|
|
88
|
-
return
|
|
87
|
+
const r = document.createElement("div"), n = r.style;
|
|
88
|
+
return n.width = "100px", n.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? N = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? N = "negative" : N = "positive-ascending"), document.body.removeChild(t), N;
|
|
89
89
|
}
|
|
90
90
|
return N;
|
|
91
91
|
}
|
|
@@ -101,8 +101,8 @@ function K({
|
|
|
101
101
|
return -r;
|
|
102
102
|
case "positive-descending": {
|
|
103
103
|
if (e) {
|
|
104
|
-
const { clientWidth:
|
|
105
|
-
return
|
|
104
|
+
const { clientWidth: n, scrollWidth: o } = e;
|
|
105
|
+
return o - n - r;
|
|
106
106
|
}
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
@@ -137,8 +137,8 @@ function ue({
|
|
|
137
137
|
e.size === 0 ? 0 : e.size - 1
|
|
138
138
|
);
|
|
139
139
|
L(r !== void 0, "Unexpected bounds cache miss");
|
|
140
|
-
const
|
|
141
|
-
return t *
|
|
140
|
+
const n = (r.scrollOffset + r.size) / e.size;
|
|
141
|
+
return t * n;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
function Oe({
|
|
@@ -146,9 +146,9 @@ function Oe({
|
|
|
146
146
|
cachedBounds: t,
|
|
147
147
|
index: s,
|
|
148
148
|
itemCount: r,
|
|
149
|
-
itemSize:
|
|
150
|
-
containerScrollOffset:
|
|
151
|
-
containerSize:
|
|
149
|
+
itemSize: n,
|
|
150
|
+
containerScrollOffset: o,
|
|
151
|
+
containerSize: d
|
|
152
152
|
}) {
|
|
153
153
|
if (s < 0 || s >= r)
|
|
154
154
|
throw RangeError(`Invalid index specified: ${s}`, {
|
|
@@ -157,30 +157,30 @@ function Oe({
|
|
|
157
157
|
const l = t.get(s), c = ue({
|
|
158
158
|
cachedBounds: t,
|
|
159
159
|
itemCount: r,
|
|
160
|
-
itemSize:
|
|
160
|
+
itemSize: n
|
|
161
161
|
}), f = Math.max(
|
|
162
162
|
0,
|
|
163
|
-
Math.min(c -
|
|
164
|
-
),
|
|
163
|
+
Math.min(c - d, l.scrollOffset)
|
|
164
|
+
), a = Math.max(
|
|
165
165
|
0,
|
|
166
|
-
l.scrollOffset -
|
|
167
|
-
),
|
|
168
|
-
switch (e === "smart" && (e =
|
|
166
|
+
l.scrollOffset - d + l.size
|
|
167
|
+
), i = l.size > d ? o >= l.scrollOffset && o <= a : o >= a && o <= l.scrollOffset;
|
|
168
|
+
switch (e === "smart" && (e = i ? "auto" : "center"), e) {
|
|
169
169
|
case "start":
|
|
170
170
|
return f;
|
|
171
171
|
case "end":
|
|
172
|
-
return
|
|
172
|
+
return a;
|
|
173
173
|
case "center":
|
|
174
174
|
return Math.max(
|
|
175
175
|
0,
|
|
176
176
|
Math.min(
|
|
177
|
-
c -
|
|
178
|
-
l.scrollOffset + l.size / 2 -
|
|
177
|
+
c - d,
|
|
178
|
+
l.scrollOffset + l.size / 2 - d / 2
|
|
179
179
|
)
|
|
180
180
|
);
|
|
181
181
|
case "auto":
|
|
182
182
|
default:
|
|
183
|
-
return
|
|
183
|
+
return i ? o : o < a ? a : f;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
function re({
|
|
@@ -188,9 +188,9 @@ function re({
|
|
|
188
188
|
containerScrollOffset: t,
|
|
189
189
|
containerSize: s,
|
|
190
190
|
itemCount: r,
|
|
191
|
-
overscanCount:
|
|
191
|
+
overscanCount: n
|
|
192
192
|
}) {
|
|
193
|
-
const
|
|
193
|
+
const o = r - 1;
|
|
194
194
|
if (r === 0)
|
|
195
195
|
return {
|
|
196
196
|
startIndexVisible: 0,
|
|
@@ -198,42 +198,42 @@ function re({
|
|
|
198
198
|
startIndexOverscan: 0,
|
|
199
199
|
stopIndexOverscan: -1
|
|
200
200
|
};
|
|
201
|
-
let
|
|
201
|
+
let d, l;
|
|
202
202
|
const { itemSize: c } = e;
|
|
203
203
|
if (c !== void 0 && c > 0)
|
|
204
|
-
|
|
204
|
+
d = Math.max(
|
|
205
205
|
0,
|
|
206
|
-
Math.min(
|
|
206
|
+
Math.min(o, Math.floor(t / c))
|
|
207
207
|
), l = Math.max(
|
|
208
|
-
|
|
208
|
+
d,
|
|
209
209
|
Math.min(
|
|
210
|
-
|
|
210
|
+
o,
|
|
211
211
|
Math.ceil((t + s) / c) - 1
|
|
212
212
|
)
|
|
213
213
|
);
|
|
214
214
|
else {
|
|
215
|
-
let f = 0,
|
|
216
|
-
for (;
|
|
217
|
-
const u = e.get(i);
|
|
218
|
-
|
|
219
|
-
f = i + 1, i = Math.min(n, i + d), d *= 2;
|
|
215
|
+
let f = 0, a = Math.min(o, Math.max(0, e.size - 1));
|
|
216
|
+
for (; f < a; ) {
|
|
217
|
+
const i = Math.floor((f + a) / 2), u = e.get(i);
|
|
218
|
+
u.scrollOffset + u.size > t ? a = i : f = i + 1;
|
|
220
219
|
}
|
|
221
|
-
for (; f <
|
|
222
|
-
const
|
|
223
|
-
|
|
220
|
+
for (; f < o; ) {
|
|
221
|
+
const i = e.get(f);
|
|
222
|
+
if (i.scrollOffset + i.size > t) break;
|
|
223
|
+
f++;
|
|
224
224
|
}
|
|
225
|
-
for (
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
225
|
+
for (d = f, l = f; l < o; ) {
|
|
226
|
+
const i = e.get(l);
|
|
227
|
+
if (i.scrollOffset + i.size >= t + s)
|
|
228
228
|
break;
|
|
229
229
|
l++;
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
return {
|
|
233
|
-
startIndexVisible:
|
|
233
|
+
startIndexVisible: d,
|
|
234
234
|
stopIndexVisible: l,
|
|
235
|
-
startIndexOverscan: Math.max(0,
|
|
236
|
-
stopIndexOverscan: Math.min(
|
|
235
|
+
startIndexOverscan: Math.max(0, d - n),
|
|
236
|
+
stopIndexOverscan: Math.min(o, l + n)
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
239
|
function ze({
|
|
@@ -244,38 +244,38 @@ function ze({
|
|
|
244
244
|
const r = /* @__PURE__ */ new Map();
|
|
245
245
|
return {
|
|
246
246
|
itemSize: typeof s == "number" ? s : void 0,
|
|
247
|
-
get(
|
|
248
|
-
if (L(
|
|
249
|
-
L(
|
|
250
|
-
let
|
|
251
|
-
return
|
|
247
|
+
get(n) {
|
|
248
|
+
if (L(n < e, `Invalid index ${n}`), typeof s == "number") {
|
|
249
|
+
L(n >= 0, `Invalid index ${n}`);
|
|
250
|
+
let d = r.get(n);
|
|
251
|
+
return d === void 0 && (d = { size: s, scrollOffset: n * s }, r.set(n, d)), d;
|
|
252
252
|
}
|
|
253
|
-
for (; r.size - 1 <
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
r.set(
|
|
253
|
+
for (; r.size - 1 < n; ) {
|
|
254
|
+
const d = r.size, l = s(d, t);
|
|
255
|
+
if (d === 0)
|
|
256
|
+
r.set(d, {
|
|
257
257
|
size: l,
|
|
258
258
|
scrollOffset: 0
|
|
259
259
|
});
|
|
260
260
|
else {
|
|
261
|
-
const c = r.get(
|
|
261
|
+
const c = r.get(d - 1);
|
|
262
262
|
L(
|
|
263
263
|
c !== void 0,
|
|
264
|
-
`Unexpected bounds cache miss for index ${
|
|
265
|
-
), r.set(
|
|
264
|
+
`Unexpected bounds cache miss for index ${n}`
|
|
265
|
+
), r.set(d, {
|
|
266
266
|
scrollOffset: c.scrollOffset + c.size,
|
|
267
267
|
size: l
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const o = r.get(n);
|
|
272
272
|
return L(
|
|
273
|
-
|
|
274
|
-
`Unexpected bounds cache miss for index ${
|
|
275
|
-
),
|
|
273
|
+
o !== void 0,
|
|
274
|
+
`Unexpected bounds cache miss for index ${n}`
|
|
275
|
+
), o;
|
|
276
276
|
},
|
|
277
|
-
set(
|
|
278
|
-
r.set(
|
|
277
|
+
set(n, o) {
|
|
278
|
+
r.set(n, o);
|
|
279
279
|
},
|
|
280
280
|
get size() {
|
|
281
281
|
return r.size;
|
|
@@ -324,14 +324,14 @@ function ie({
|
|
|
324
324
|
containerStyle: t,
|
|
325
325
|
defaultContainerSize: s = 0,
|
|
326
326
|
direction: r,
|
|
327
|
-
isRtl:
|
|
328
|
-
itemCount:
|
|
329
|
-
itemProps:
|
|
327
|
+
isRtl: n = !1,
|
|
328
|
+
itemCount: o,
|
|
329
|
+
itemProps: d,
|
|
330
330
|
itemSize: l,
|
|
331
331
|
onResize: c,
|
|
332
332
|
overscanCount: f
|
|
333
333
|
}) {
|
|
334
|
-
const { height:
|
|
334
|
+
const { height: a = s, width: i = s } = we({
|
|
335
335
|
defaultHeight: r === "vertical" ? s : void 0,
|
|
336
336
|
defaultWidth: r === "horizontal" ? s : void 0,
|
|
337
337
|
element: e,
|
|
@@ -340,16 +340,16 @@ function ie({
|
|
|
340
340
|
}), u = q({
|
|
341
341
|
height: 0,
|
|
342
342
|
width: 0
|
|
343
|
-
}), h = r === "vertical" ?
|
|
343
|
+
}), h = r === "vertical" ? a : i, x = Se({ containerSize: h, itemSize: l });
|
|
344
344
|
ce(() => {
|
|
345
345
|
if (typeof c == "function") {
|
|
346
346
|
const v = u.current;
|
|
347
|
-
(v.height !==
|
|
347
|
+
(v.height !== a || v.width !== i) && (c({ height: a, width: i }, { ...v }), v.height = a, v.width = i);
|
|
348
348
|
}
|
|
349
|
-
}, [
|
|
349
|
+
}, [a, c, i]);
|
|
350
350
|
const p = ye({
|
|
351
|
-
itemCount:
|
|
352
|
-
itemProps:
|
|
351
|
+
itemCount: o,
|
|
352
|
+
itemProps: d,
|
|
353
353
|
itemSize: x
|
|
354
354
|
}), w = $(
|
|
355
355
|
(v) => p.get(v),
|
|
@@ -360,39 +360,39 @@ function ie({
|
|
|
360
360
|
// TODO Potentially support a defaultScrollOffset prop?
|
|
361
361
|
containerScrollOffset: 0,
|
|
362
362
|
containerSize: h,
|
|
363
|
-
itemCount:
|
|
363
|
+
itemCount: o,
|
|
364
364
|
overscanCount: f
|
|
365
365
|
})
|
|
366
366
|
), {
|
|
367
367
|
startIndexVisible: T,
|
|
368
|
-
startIndexOverscan:
|
|
368
|
+
startIndexOverscan: E,
|
|
369
369
|
stopIndexVisible: F,
|
|
370
370
|
stopIndexOverscan: b
|
|
371
371
|
} = {
|
|
372
|
-
startIndexVisible: Math.min(
|
|
373
|
-
startIndexOverscan: Math.min(
|
|
374
|
-
stopIndexVisible: Math.min(
|
|
375
|
-
stopIndexOverscan: Math.min(
|
|
372
|
+
startIndexVisible: Math.min(o - 1, g.startIndexVisible),
|
|
373
|
+
startIndexOverscan: Math.min(o - 1, g.startIndexOverscan),
|
|
374
|
+
stopIndexVisible: Math.min(o - 1, g.stopIndexVisible),
|
|
375
|
+
stopIndexOverscan: Math.min(o - 1, g.stopIndexOverscan)
|
|
376
376
|
}, X = $(
|
|
377
377
|
() => ue({
|
|
378
378
|
cachedBounds: p,
|
|
379
|
-
itemCount:
|
|
379
|
+
itemCount: o,
|
|
380
380
|
itemSize: x
|
|
381
381
|
}),
|
|
382
|
-
[p,
|
|
382
|
+
[p, o, x]
|
|
383
383
|
), m = $(
|
|
384
384
|
(v) => {
|
|
385
385
|
const I = K({
|
|
386
386
|
containerElement: e,
|
|
387
387
|
direction: r,
|
|
388
|
-
isRtl:
|
|
388
|
+
isRtl: n,
|
|
389
389
|
scrollOffset: v
|
|
390
390
|
});
|
|
391
391
|
return re({
|
|
392
392
|
cachedBounds: p,
|
|
393
393
|
containerScrollOffset: I,
|
|
394
394
|
containerSize: h,
|
|
395
|
-
itemCount:
|
|
395
|
+
itemCount: o,
|
|
396
396
|
overscanCount: f
|
|
397
397
|
});
|
|
398
398
|
},
|
|
@@ -401,8 +401,8 @@ function ie({
|
|
|
401
401
|
e,
|
|
402
402
|
h,
|
|
403
403
|
r,
|
|
404
|
-
o,
|
|
405
404
|
n,
|
|
405
|
+
o,
|
|
406
406
|
f
|
|
407
407
|
]
|
|
408
408
|
);
|
|
@@ -417,13 +417,13 @@ function ie({
|
|
|
417
417
|
const { scrollLeft: R, scrollTop: z } = e, y = K({
|
|
418
418
|
containerElement: e,
|
|
419
419
|
direction: r,
|
|
420
|
-
isRtl:
|
|
420
|
+
isRtl: n,
|
|
421
421
|
scrollOffset: r === "vertical" ? z : R
|
|
422
422
|
}), G = re({
|
|
423
423
|
cachedBounds: p,
|
|
424
424
|
containerScrollOffset: y,
|
|
425
425
|
containerSize: h,
|
|
426
|
-
itemCount:
|
|
426
|
+
itemCount: o,
|
|
427
427
|
overscanCount: f
|
|
428
428
|
});
|
|
429
429
|
return _(G, I) ? I : G;
|
|
@@ -437,8 +437,8 @@ function ie({
|
|
|
437
437
|
e,
|
|
438
438
|
h,
|
|
439
439
|
r,
|
|
440
|
-
o,
|
|
441
440
|
n,
|
|
441
|
+
o,
|
|
442
442
|
f
|
|
443
443
|
]);
|
|
444
444
|
const U = ee(
|
|
@@ -453,19 +453,19 @@ function ie({
|
|
|
453
453
|
containerScrollOffset: K({
|
|
454
454
|
containerElement: e,
|
|
455
455
|
direction: r,
|
|
456
|
-
isRtl:
|
|
456
|
+
isRtl: n,
|
|
457
457
|
scrollOffset: I
|
|
458
458
|
}),
|
|
459
459
|
containerSize: h,
|
|
460
460
|
index: R,
|
|
461
|
-
itemCount:
|
|
461
|
+
itemCount: o,
|
|
462
462
|
itemSize: x
|
|
463
463
|
});
|
|
464
464
|
if (e) {
|
|
465
465
|
if (z = K({
|
|
466
466
|
containerElement: e,
|
|
467
467
|
direction: r,
|
|
468
|
-
isRtl:
|
|
468
|
+
isRtl: n,
|
|
469
469
|
scrollOffset: z
|
|
470
470
|
}), typeof e.scrollTo != "function") {
|
|
471
471
|
const y = m(z);
|
|
@@ -479,7 +479,7 @@ function ie({
|
|
|
479
479
|
getCellBounds: w,
|
|
480
480
|
getEstimatedSize: X,
|
|
481
481
|
scrollToIndex: U,
|
|
482
|
-
startIndexOverscan:
|
|
482
|
+
startIndexOverscan: E,
|
|
483
483
|
startIndexVisible: T,
|
|
484
484
|
stopIndexOverscan: b,
|
|
485
485
|
stopIndexVisible: F
|
|
@@ -493,27 +493,27 @@ function pe(e, t) {
|
|
|
493
493
|
const {
|
|
494
494
|
ariaAttributes: s,
|
|
495
495
|
style: r,
|
|
496
|
-
...
|
|
496
|
+
...n
|
|
497
497
|
} = e, {
|
|
498
|
-
ariaAttributes:
|
|
499
|
-
style:
|
|
498
|
+
ariaAttributes: o,
|
|
499
|
+
style: d,
|
|
500
500
|
...l
|
|
501
501
|
} = t;
|
|
502
|
-
return _(s,
|
|
502
|
+
return _(s, o) && _(r, d) && _(n, l);
|
|
503
503
|
}
|
|
504
504
|
function Le({
|
|
505
505
|
cellComponent: e,
|
|
506
506
|
cellProps: t,
|
|
507
507
|
children: s,
|
|
508
508
|
className: r,
|
|
509
|
-
columnCount:
|
|
510
|
-
columnKey:
|
|
511
|
-
columnWidth:
|
|
509
|
+
columnCount: n,
|
|
510
|
+
columnKey: o,
|
|
511
|
+
columnWidth: d,
|
|
512
512
|
defaultHeight: l = 0,
|
|
513
513
|
defaultWidth: c = 0,
|
|
514
514
|
dir: f,
|
|
515
|
-
gridRef:
|
|
516
|
-
onCellsRendered:
|
|
515
|
+
gridRef: a,
|
|
516
|
+
onCellsRendered: i,
|
|
517
517
|
onResize: u,
|
|
518
518
|
overscanCount: h = 3,
|
|
519
519
|
rowCount: x,
|
|
@@ -523,7 +523,7 @@ function Le({
|
|
|
523
523
|
tagName: B = "div",
|
|
524
524
|
...T
|
|
525
525
|
}) {
|
|
526
|
-
const
|
|
526
|
+
const E = he(t), F = H(
|
|
527
527
|
() => fe(e, pe),
|
|
528
528
|
[e]
|
|
529
529
|
), [b, X] = V(null), m = me(b, f), {
|
|
@@ -540,13 +540,13 @@ function Le({
|
|
|
540
540
|
defaultContainerSize: c,
|
|
541
541
|
direction: "horizontal",
|
|
542
542
|
isRtl: m,
|
|
543
|
-
itemCount:
|
|
544
|
-
itemProps:
|
|
545
|
-
itemSize:
|
|
543
|
+
itemCount: n,
|
|
544
|
+
itemProps: E,
|
|
545
|
+
itemSize: d,
|
|
546
546
|
onResize: u,
|
|
547
547
|
overscanCount: h
|
|
548
548
|
}), {
|
|
549
|
-
getCellBounds:
|
|
549
|
+
getCellBounds: M,
|
|
550
550
|
getEstimatedSize: S,
|
|
551
551
|
startIndexOverscan: A,
|
|
552
552
|
startIndexVisible: P,
|
|
@@ -559,13 +559,13 @@ function Le({
|
|
|
559
559
|
defaultContainerSize: l,
|
|
560
560
|
direction: "vertical",
|
|
561
561
|
itemCount: x,
|
|
562
|
-
itemProps:
|
|
562
|
+
itemProps: E,
|
|
563
563
|
itemSize: p,
|
|
564
564
|
onResize: u,
|
|
565
565
|
overscanCount: h
|
|
566
566
|
});
|
|
567
567
|
de(
|
|
568
|
-
|
|
568
|
+
a,
|
|
569
569
|
() => ({
|
|
570
570
|
get element() {
|
|
571
571
|
return b;
|
|
@@ -625,7 +625,7 @@ function Le({
|
|
|
625
625
|
}),
|
|
626
626
|
[b, z, se]
|
|
627
627
|
), te(() => {
|
|
628
|
-
I >= 0 && y >= 0 && A >= 0 && J >= 0 &&
|
|
628
|
+
I >= 0 && y >= 0 && A >= 0 && J >= 0 && i && i(
|
|
629
629
|
{
|
|
630
630
|
columnStartIndex: R,
|
|
631
631
|
columnStopIndex: G,
|
|
@@ -640,7 +640,7 @@ function Le({
|
|
|
640
640
|
}
|
|
641
641
|
);
|
|
642
642
|
}, [
|
|
643
|
-
|
|
643
|
+
i,
|
|
644
644
|
I,
|
|
645
645
|
R,
|
|
646
646
|
y,
|
|
@@ -652,24 +652,24 @@ function Le({
|
|
|
652
652
|
]);
|
|
653
653
|
const ge = H(() => {
|
|
654
654
|
const W = [];
|
|
655
|
-
if (
|
|
655
|
+
if (n > 0 && x > 0)
|
|
656
656
|
for (let O = A; O <= J; O++) {
|
|
657
|
-
const j =
|
|
657
|
+
const j = M(O), D = [];
|
|
658
658
|
for (let k = I; k <= y; k++) {
|
|
659
659
|
const Q = U(k);
|
|
660
660
|
D.push(
|
|
661
661
|
/* @__PURE__ */ C(
|
|
662
662
|
F,
|
|
663
663
|
{
|
|
664
|
-
...
|
|
664
|
+
...E,
|
|
665
665
|
ariaAttributes: {
|
|
666
666
|
"aria-colindex": k + 1,
|
|
667
667
|
role: "gridcell"
|
|
668
668
|
},
|
|
669
669
|
columnIndex: k,
|
|
670
|
-
key:
|
|
670
|
+
key: o ? o({
|
|
671
671
|
columnIndex: k,
|
|
672
|
-
data:
|
|
672
|
+
data: E,
|
|
673
673
|
rowIndex: O
|
|
674
674
|
}) : k,
|
|
675
675
|
rowIndex: O,
|
|
@@ -694,7 +694,7 @@ function Le({
|
|
|
694
694
|
children: D
|
|
695
695
|
},
|
|
696
696
|
w ? w({
|
|
697
|
-
data:
|
|
697
|
+
data: E,
|
|
698
698
|
rowIndex: O
|
|
699
699
|
}) : O
|
|
700
700
|
)
|
|
@@ -703,13 +703,13 @@ function Le({
|
|
|
703
703
|
return W;
|
|
704
704
|
}, [
|
|
705
705
|
F,
|
|
706
|
-
|
|
707
|
-
o,
|
|
706
|
+
E,
|
|
708
707
|
n,
|
|
708
|
+
o,
|
|
709
709
|
I,
|
|
710
710
|
y,
|
|
711
711
|
U,
|
|
712
|
-
|
|
712
|
+
M,
|
|
713
713
|
m,
|
|
714
714
|
x,
|
|
715
715
|
w,
|
|
@@ -729,7 +729,7 @@ function Le({
|
|
|
729
729
|
return C(
|
|
730
730
|
B,
|
|
731
731
|
{
|
|
732
|
-
"aria-colcount":
|
|
732
|
+
"aria-colcount": n,
|
|
733
733
|
"aria-rowcount": x,
|
|
734
734
|
role: "grid",
|
|
735
735
|
...T,
|
|
@@ -754,48 +754,48 @@ const Ve = V, Re = q;
|
|
|
754
754
|
function Te(e) {
|
|
755
755
|
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Ee({
|
|
758
758
|
element: e,
|
|
759
759
|
getCellBounds: t,
|
|
760
760
|
isDynamicRowHeight: s,
|
|
761
761
|
rowCount: r,
|
|
762
|
-
rowElements:
|
|
763
|
-
scrollToIndex:
|
|
762
|
+
rowElements: n,
|
|
763
|
+
scrollToIndex: o
|
|
764
764
|
}) {
|
|
765
|
-
const
|
|
766
|
-
|
|
765
|
+
const d = q(null), l = q(void 0), c = ee(() => {
|
|
766
|
+
d.current = null, l.current !== void 0 && (cancelAnimationFrame(l.current), l.current = void 0);
|
|
767
767
|
}), f = ee(() => {
|
|
768
768
|
l.current = void 0;
|
|
769
|
-
const
|
|
770
|
-
if (!
|
|
771
|
-
if (!e || !s ||
|
|
769
|
+
const a = d.current;
|
|
770
|
+
if (!a) return;
|
|
771
|
+
if (!e || !s || a.index >= r || performance.now() >= a.deadline) {
|
|
772
772
|
c();
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
|
-
const
|
|
776
|
-
align:
|
|
775
|
+
const i = o({
|
|
776
|
+
align: a.align,
|
|
777
777
|
containerScrollOffset: e.scrollTop,
|
|
778
|
-
index:
|
|
778
|
+
index: a.index
|
|
779
779
|
});
|
|
780
|
-
if (
|
|
780
|
+
if (i !== void 0) {
|
|
781
781
|
const u = Math.max(
|
|
782
782
|
0,
|
|
783
|
-
Math.min(
|
|
783
|
+
Math.min(i, e.scrollHeight - e.clientHeight)
|
|
784
784
|
);
|
|
785
785
|
if (Math.abs(u - e.scrollTop) > 1)
|
|
786
|
-
|
|
786
|
+
a.stableFrames = 0, e.scrollTo({ behavior: "instant", top: u });
|
|
787
787
|
else {
|
|
788
|
-
const h =
|
|
788
|
+
const h = n.current;
|
|
789
789
|
if (!(h.some(
|
|
790
|
-
(w) => w.getAttribute(Z) === `${
|
|
790
|
+
(w) => w.getAttribute(Z) === `${a.index}`
|
|
791
791
|
) && h.every((w) => {
|
|
792
792
|
const g = Number(w.getAttribute(Z));
|
|
793
793
|
return Math.abs(
|
|
794
794
|
t(g).size - w.offsetHeight
|
|
795
795
|
) <= 1;
|
|
796
796
|
})))
|
|
797
|
-
|
|
798
|
-
else if (++
|
|
797
|
+
a.stableFrames = 0;
|
|
798
|
+
else if (++a.stableFrames >= 2) {
|
|
799
799
|
c();
|
|
800
800
|
return;
|
|
801
801
|
}
|
|
@@ -805,8 +805,8 @@ function Me({
|
|
|
805
805
|
});
|
|
806
806
|
return Y(() => {
|
|
807
807
|
if (!e) return;
|
|
808
|
-
const
|
|
809
|
-
switch (
|
|
808
|
+
const a = (i) => {
|
|
809
|
+
switch (i.key) {
|
|
810
810
|
case "ArrowUp":
|
|
811
811
|
case "ArrowDown":
|
|
812
812
|
case "PageUp":
|
|
@@ -817,36 +817,36 @@ function Me({
|
|
|
817
817
|
c();
|
|
818
818
|
}
|
|
819
819
|
};
|
|
820
|
-
return e.addEventListener("wheel", c, { passive: !0 }), e.addEventListener("touchstart", c, { passive: !0 }), e.addEventListener("pointerdown", c), e.addEventListener("keydown",
|
|
821
|
-
c(), e.removeEventListener("wheel", c), e.removeEventListener("touchstart", c), e.removeEventListener("pointerdown", c), e.removeEventListener("keydown",
|
|
820
|
+
return e.addEventListener("wheel", c, { passive: !0 }), e.addEventListener("touchstart", c, { passive: !0 }), e.addEventListener("pointerdown", c), e.addEventListener("keydown", a), () => {
|
|
821
|
+
c(), e.removeEventListener("wheel", c), e.removeEventListener("touchstart", c), e.removeEventListener("pointerdown", c), e.removeEventListener("keydown", a);
|
|
822
822
|
};
|
|
823
823
|
}, [c, e]), $(
|
|
824
824
|
({
|
|
825
|
-
align:
|
|
826
|
-
behavior:
|
|
825
|
+
align: a = "auto",
|
|
826
|
+
behavior: i = "auto",
|
|
827
827
|
index: u
|
|
828
828
|
}) => {
|
|
829
|
-
s &&
|
|
829
|
+
s && a === "smart" && (a = o({
|
|
830
830
|
align: "auto",
|
|
831
831
|
containerScrollOffset: e?.scrollTop ?? 0,
|
|
832
832
|
index: u
|
|
833
833
|
}) === (e?.scrollTop ?? 0) ? "auto" : "center");
|
|
834
|
-
const h =
|
|
835
|
-
align:
|
|
834
|
+
const h = o({
|
|
835
|
+
align: a,
|
|
836
836
|
containerScrollOffset: e?.scrollTop ?? 0,
|
|
837
837
|
index: u
|
|
838
838
|
});
|
|
839
|
-
c(), typeof e?.scrollTo == "function" && (s && (
|
|
840
|
-
align:
|
|
839
|
+
c(), typeof e?.scrollTo == "function" && (s && (d.current = {
|
|
840
|
+
align: a,
|
|
841
841
|
index: u,
|
|
842
842
|
deadline: performance.now() + 1e3,
|
|
843
843
|
stableFrames: 0
|
|
844
844
|
}, l.current = requestAnimationFrame(f)), e.scrollTo({
|
|
845
|
-
behavior: s ? "instant" :
|
|
845
|
+
behavior: s ? "instant" : i,
|
|
846
846
|
top: h
|
|
847
847
|
}));
|
|
848
848
|
},
|
|
849
|
-
[c, f, e, s,
|
|
849
|
+
[c, f, e, s, o]
|
|
850
850
|
);
|
|
851
851
|
}
|
|
852
852
|
const Z = "data-react-window-index";
|
|
@@ -855,22 +855,22 @@ function ke({
|
|
|
855
855
|
className: t,
|
|
856
856
|
defaultHeight: s = 0,
|
|
857
857
|
listRef: r,
|
|
858
|
-
onResize:
|
|
859
|
-
onRowsRendered:
|
|
860
|
-
overscanCount:
|
|
858
|
+
onResize: n,
|
|
859
|
+
onRowsRendered: o,
|
|
860
|
+
overscanCount: d = 3,
|
|
861
861
|
rowComponent: l,
|
|
862
862
|
rowCount: c,
|
|
863
863
|
rowHeight: f,
|
|
864
|
-
rowKey:
|
|
865
|
-
rowProps:
|
|
864
|
+
rowKey: a,
|
|
865
|
+
rowProps: i,
|
|
866
866
|
tagName: u = "div",
|
|
867
867
|
style: h,
|
|
868
868
|
...x
|
|
869
869
|
}) {
|
|
870
|
-
const p = he(
|
|
870
|
+
const p = he(i), w = H(
|
|
871
871
|
() => fe(l, pe),
|
|
872
872
|
[l]
|
|
873
|
-
), [g, B] = V(null), T = Te(f),
|
|
873
|
+
), [g, B] = V(null), T = Te(f), E = H(() => T ? (M) => f.getRowHeight(M) ?? f.getAverageRowHeight() : f, [T, f]), {
|
|
874
874
|
getCellBounds: F,
|
|
875
875
|
getEstimatedSize: b,
|
|
876
876
|
scrollToIndex: X,
|
|
@@ -885,10 +885,10 @@ function ke({
|
|
|
885
885
|
direction: "vertical",
|
|
886
886
|
itemCount: c,
|
|
887
887
|
itemProps: p,
|
|
888
|
-
itemSize:
|
|
889
|
-
onResize:
|
|
890
|
-
overscanCount:
|
|
891
|
-
}), R = q([]), z =
|
|
888
|
+
itemSize: E,
|
|
889
|
+
onResize: n,
|
|
890
|
+
overscanCount: d
|
|
891
|
+
}), R = q([]), z = Ee({
|
|
892
892
|
element: g,
|
|
893
893
|
getCellBounds: F,
|
|
894
894
|
isDynamicRowHeight: T,
|
|
@@ -908,7 +908,7 @@ function ke({
|
|
|
908
908
|
), Y(() => {
|
|
909
909
|
if (!g)
|
|
910
910
|
return;
|
|
911
|
-
const
|
|
911
|
+
const M = Array.from(g.children).slice(
|
|
912
912
|
0,
|
|
913
913
|
m < 0 ? 0 : v - m + 1
|
|
914
914
|
).filter((S, A) => {
|
|
@@ -917,20 +917,20 @@ function ke({
|
|
|
917
917
|
const P = `${m + A}`;
|
|
918
918
|
return S.setAttribute(Z, P), !0;
|
|
919
919
|
});
|
|
920
|
-
if (R.current =
|
|
921
|
-
return f.observeRowElements(
|
|
920
|
+
if (R.current = M, T)
|
|
921
|
+
return f.observeRowElements(M);
|
|
922
922
|
}, [
|
|
923
923
|
w,
|
|
924
924
|
g,
|
|
925
925
|
T,
|
|
926
926
|
c,
|
|
927
927
|
f,
|
|
928
|
-
|
|
928
|
+
a,
|
|
929
929
|
p,
|
|
930
930
|
m,
|
|
931
931
|
v
|
|
932
932
|
]), te(() => {
|
|
933
|
-
m >= 0 && v >= 0 &&
|
|
933
|
+
m >= 0 && v >= 0 && o && o(
|
|
934
934
|
{
|
|
935
935
|
startIndex: U,
|
|
936
936
|
stopIndex: I
|
|
@@ -941,18 +941,18 @@ function ke({
|
|
|
941
941
|
}
|
|
942
942
|
);
|
|
943
943
|
}, [
|
|
944
|
-
|
|
944
|
+
o,
|
|
945
945
|
m,
|
|
946
946
|
U,
|
|
947
947
|
v,
|
|
948
948
|
I
|
|
949
949
|
]);
|
|
950
950
|
const y = H(() => {
|
|
951
|
-
const
|
|
951
|
+
const M = [];
|
|
952
952
|
if (c > 0)
|
|
953
953
|
for (let S = m; S <= v; S++) {
|
|
954
954
|
const A = F(S);
|
|
955
|
-
|
|
955
|
+
M.push(
|
|
956
956
|
/* @__PURE__ */ C(
|
|
957
957
|
w,
|
|
958
958
|
{
|
|
@@ -962,7 +962,7 @@ function ke({
|
|
|
962
962
|
"aria-setsize": c,
|
|
963
963
|
role: "listitem"
|
|
964
964
|
},
|
|
965
|
-
key:
|
|
965
|
+
key: a ? a(S, p) : S,
|
|
966
966
|
index: S,
|
|
967
967
|
style: {
|
|
968
968
|
position: "absolute",
|
|
@@ -977,13 +977,13 @@ function ke({
|
|
|
977
977
|
)
|
|
978
978
|
);
|
|
979
979
|
}
|
|
980
|
-
return
|
|
980
|
+
return M;
|
|
981
981
|
}, [
|
|
982
982
|
w,
|
|
983
983
|
F,
|
|
984
984
|
T,
|
|
985
985
|
c,
|
|
986
|
-
|
|
986
|
+
a,
|
|
987
987
|
p,
|
|
988
988
|
m,
|
|
989
989
|
v
|
|
@@ -1030,30 +1030,30 @@ function $e({
|
|
|
1030
1030
|
key: t,
|
|
1031
1031
|
map: /* @__PURE__ */ new Map()
|
|
1032
1032
|
});
|
|
1033
|
-
const { map:
|
|
1034
|
-
let
|
|
1035
|
-
return
|
|
1036
|
-
|
|
1037
|
-
}),
|
|
1038
|
-
}, [e,
|
|
1039
|
-
(
|
|
1040
|
-
const u =
|
|
1033
|
+
const { map: n } = s, o = $(() => {
|
|
1034
|
+
let i = 0;
|
|
1035
|
+
return n.forEach((u) => {
|
|
1036
|
+
i += u;
|
|
1037
|
+
}), i === 0 ? e : i / n.size;
|
|
1038
|
+
}, [e, n]), d = $(
|
|
1039
|
+
(i) => {
|
|
1040
|
+
const u = n.get(i);
|
|
1041
1041
|
return u !== void 0 ? u : e;
|
|
1042
1042
|
},
|
|
1043
|
-
[e,
|
|
1044
|
-
), l = $((
|
|
1043
|
+
[e, n]
|
|
1044
|
+
), l = $((i, u) => {
|
|
1045
1045
|
r((h) => {
|
|
1046
|
-
if (h.map.get(
|
|
1046
|
+
if (h.map.get(i) === u)
|
|
1047
1047
|
return h;
|
|
1048
1048
|
const x = new Map(h.map);
|
|
1049
|
-
return x.set(
|
|
1049
|
+
return x.set(i, u), {
|
|
1050
1050
|
...h,
|
|
1051
1051
|
map: x
|
|
1052
1052
|
};
|
|
1053
1053
|
});
|
|
1054
1054
|
}, []), c = ee(
|
|
1055
|
-
(
|
|
1056
|
-
|
|
1055
|
+
(i) => {
|
|
1056
|
+
i.length !== 0 && i.forEach((u) => {
|
|
1057
1057
|
const { borderBoxSize: h, target: x } = u, p = x.getAttribute(Z);
|
|
1058
1058
|
L(
|
|
1059
1059
|
p !== null,
|
|
@@ -1073,21 +1073,21 @@ function $e({
|
|
|
1073
1073
|
f.disconnect();
|
|
1074
1074
|
};
|
|
1075
1075
|
}, [f]);
|
|
1076
|
-
const
|
|
1077
|
-
(
|
|
1078
|
-
|
|
1076
|
+
const a = $(
|
|
1077
|
+
(i) => f ? (i.forEach((u) => f.observe(u)), () => {
|
|
1078
|
+
i.forEach((u) => f.unobserve(u));
|
|
1079
1079
|
}) : () => {
|
|
1080
1080
|
},
|
|
1081
1081
|
[f]
|
|
1082
1082
|
);
|
|
1083
1083
|
return H(
|
|
1084
1084
|
() => ({
|
|
1085
|
-
getAverageRowHeight:
|
|
1086
|
-
getRowHeight:
|
|
1085
|
+
getAverageRowHeight: o,
|
|
1086
|
+
getRowHeight: d,
|
|
1087
1087
|
setRowHeight: l,
|
|
1088
|
-
observeRowElements:
|
|
1088
|
+
observeRowElements: a
|
|
1089
1089
|
}),
|
|
1090
|
-
[
|
|
1090
|
+
[o, d, l, a]
|
|
1091
1091
|
);
|
|
1092
1092
|
}
|
|
1093
1093
|
const He = V, Fe = q;
|