react-window 2.0.0-alpha.0 → 2.0.0-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 -22
- package/dist/react-window.d.ts +6 -6
- package/dist/react-window.js +433 -669
- package/docs/assets/{index-fVOw1dKb.js → index-B8YZlUKM.js} +17 -17
- package/docs/assets/index-BMf3NlnJ.css +1 -0
- package/docs/data/addresses.json +21935 -5957
- package/docs/data/contacts.json +300 -300
- package/docs/generated/code-snippets/CellComponent.json +1 -1
- package/docs/generated/code-snippets/FixedHeightRowComponent.json +1 -1
- package/docs/generated/code-snippets/FlexboxLayout.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 -1
- package/docs/generated/code-snippets/listRefClickEventHandler.json +2 -1
- package/docs/generated/code-snippets/rowHeight.json +2 -2
- package/docs/generated/js-docs/Grid.json +6 -2
- package/docs/index.html +2 -2
- package/docs/stats.html +1 -1
- package/package.json +1 -1
- package/docs/assets/index-DlGpNu0r.css +0 -1
package/dist/react-window.js
CHANGED
|
@@ -1,772 +1,535 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var re;
|
|
13
|
-
function xe() {
|
|
14
|
-
if (re) return D;
|
|
15
|
-
re = 1;
|
|
16
|
-
var i = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
17
|
-
function n(o, r, s) {
|
|
18
|
-
var c = null;
|
|
19
|
-
if (s !== void 0 && (c = "" + s), r.key !== void 0 && (c = "" + r.key), "key" in r) {
|
|
20
|
-
s = {};
|
|
21
|
-
for (var a in r)
|
|
22
|
-
a !== "key" && (s[a] = r[a]);
|
|
23
|
-
} else s = r;
|
|
24
|
-
return r = s.ref, {
|
|
25
|
-
$$typeof: i,
|
|
26
|
-
type: o,
|
|
27
|
-
key: c,
|
|
28
|
-
ref: r !== void 0 ? r : null,
|
|
29
|
-
props: s
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return D.Fragment = t, D.jsx = n, D.jsxs = n, D;
|
|
33
|
-
}
|
|
34
|
-
var U = {};
|
|
35
|
-
/**
|
|
36
|
-
* @license React
|
|
37
|
-
* react-jsx-runtime.development.js
|
|
38
|
-
*
|
|
39
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
-
*
|
|
41
|
-
* This source code is licensed under the MIT license found in the
|
|
42
|
-
* LICENSE file in the root directory of this source tree.
|
|
43
|
-
*/
|
|
44
|
-
var se;
|
|
45
|
-
function Te() {
|
|
46
|
-
return se || (se = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
function i(e) {
|
|
48
|
-
if (e == null) return null;
|
|
49
|
-
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof === C ? null : e.displayName || e.name || null;
|
|
51
|
-
if (typeof e == "string") return e;
|
|
52
|
-
switch (e) {
|
|
53
|
-
case T:
|
|
54
|
-
return "Fragment";
|
|
55
|
-
case b:
|
|
56
|
-
return "Profiler";
|
|
57
|
-
case S:
|
|
58
|
-
return "StrictMode";
|
|
59
|
-
case I:
|
|
60
|
-
return "Suspense";
|
|
61
|
-
case f:
|
|
62
|
-
return "SuspenseList";
|
|
63
|
-
case Y:
|
|
64
|
-
return "Activity";
|
|
65
|
-
}
|
|
66
|
-
if (typeof e == "object")
|
|
67
|
-
switch (typeof e.tag == "number" && console.error(
|
|
68
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
-
), e.$$typeof) {
|
|
70
|
-
case w:
|
|
71
|
-
return "Portal";
|
|
72
|
-
case P:
|
|
73
|
-
return (e.displayName || "Context") + ".Provider";
|
|
74
|
-
case A:
|
|
75
|
-
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case W:
|
|
77
|
-
var l = e.render;
|
|
78
|
-
return e = e.displayName, e || (e = l.displayName || l.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case v:
|
|
80
|
-
return l = e.displayName || null, l !== null ? l : i(e.type) || "Memo";
|
|
81
|
-
case $:
|
|
82
|
-
l = e._payload, e = e._init;
|
|
83
|
-
try {
|
|
84
|
-
return i(e(l));
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
function t(e) {
|
|
91
|
-
return "" + e;
|
|
92
|
-
}
|
|
93
|
-
function n(e) {
|
|
94
|
-
try {
|
|
95
|
-
t(e);
|
|
96
|
-
var l = !1;
|
|
97
|
-
} catch {
|
|
98
|
-
l = !0;
|
|
99
|
-
}
|
|
100
|
-
if (l) {
|
|
101
|
-
l = console;
|
|
102
|
-
var u = l.error, h = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
-
return u.call(
|
|
104
|
-
l,
|
|
105
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
h
|
|
107
|
-
), t(e);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
function o(e) {
|
|
111
|
-
if (e === T) return "<>";
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof === $)
|
|
113
|
-
return "<...>";
|
|
114
|
-
try {
|
|
115
|
-
var l = i(e);
|
|
116
|
-
return l ? "<" + l + ">" : "<...>";
|
|
117
|
-
} catch {
|
|
118
|
-
return "<...>";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function r() {
|
|
122
|
-
var e = N.A;
|
|
123
|
-
return e === null ? null : e.getOwner();
|
|
124
|
-
}
|
|
125
|
-
function s() {
|
|
126
|
-
return Error("react-stack-top-frame");
|
|
127
|
-
}
|
|
128
|
-
function c(e) {
|
|
129
|
-
if (V.call(e, "key")) {
|
|
130
|
-
var l = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
-
if (l && l.isReactWarning) return !1;
|
|
132
|
-
}
|
|
133
|
-
return e.key !== void 0;
|
|
134
|
-
}
|
|
135
|
-
function a(e, l) {
|
|
136
|
-
function u() {
|
|
137
|
-
_ || (_ = !0, console.error(
|
|
138
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
l
|
|
140
|
-
));
|
|
141
|
-
}
|
|
142
|
-
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
-
get: u,
|
|
144
|
-
configurable: !0
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
function g() {
|
|
148
|
-
var e = i(this.type);
|
|
149
|
-
return j[e] || (j[e] = !0, console.error(
|
|
150
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
-
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
-
}
|
|
153
|
-
function R(e, l, u, h, M, z, H, J) {
|
|
154
|
-
return u = z.ref, e = {
|
|
155
|
-
$$typeof: O,
|
|
156
|
-
type: e,
|
|
157
|
-
key: l,
|
|
158
|
-
props: z,
|
|
159
|
-
_owner: M
|
|
160
|
-
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
|
-
enumerable: !1,
|
|
162
|
-
get: g
|
|
163
|
-
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
|
-
configurable: !1,
|
|
165
|
-
enumerable: !1,
|
|
166
|
-
writable: !0,
|
|
167
|
-
value: 0
|
|
168
|
-
}), Object.defineProperty(e, "_debugInfo", {
|
|
169
|
-
configurable: !1,
|
|
170
|
-
enumerable: !1,
|
|
171
|
-
writable: !0,
|
|
172
|
-
value: null
|
|
173
|
-
}), Object.defineProperty(e, "_debugStack", {
|
|
174
|
-
configurable: !1,
|
|
175
|
-
enumerable: !1,
|
|
176
|
-
writable: !0,
|
|
177
|
-
value: H
|
|
178
|
-
}), Object.defineProperty(e, "_debugTask", {
|
|
179
|
-
configurable: !1,
|
|
180
|
-
enumerable: !1,
|
|
181
|
-
writable: !0,
|
|
182
|
-
value: J
|
|
183
|
-
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
|
-
}
|
|
185
|
-
function k(e, l, u, h, M, z, H, J) {
|
|
186
|
-
var d = l.children;
|
|
187
|
-
if (d !== void 0)
|
|
188
|
-
if (h)
|
|
189
|
-
if (p(d)) {
|
|
190
|
-
for (h = 0; h < d.length; h++)
|
|
191
|
-
m(d[h]);
|
|
192
|
-
Object.freeze && Object.freeze(d);
|
|
193
|
-
} else
|
|
194
|
-
console.error(
|
|
195
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
|
-
);
|
|
197
|
-
else m(d);
|
|
198
|
-
if (V.call(l, "key")) {
|
|
199
|
-
d = i(e);
|
|
200
|
-
var L = Object.keys(l).filter(function(pe) {
|
|
201
|
-
return pe !== "key";
|
|
202
|
-
});
|
|
203
|
-
h = 0 < L.length ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}", te[d + h] || (L = 0 < L.length ? "{" + L.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
205
|
-
let props = %s;
|
|
206
|
-
<%s {...props} />
|
|
207
|
-
React keys must be passed directly to JSX without using spread:
|
|
208
|
-
let props = %s;
|
|
209
|
-
<%s key={someKey} {...props} />`,
|
|
210
|
-
h,
|
|
211
|
-
d,
|
|
212
|
-
L,
|
|
213
|
-
d
|
|
214
|
-
), te[d + h] = !0);
|
|
215
|
-
}
|
|
216
|
-
if (d = null, u !== void 0 && (n(u), d = "" + u), c(l) && (n(l.key), d = "" + l.key), "key" in l) {
|
|
217
|
-
u = {};
|
|
218
|
-
for (var X in l)
|
|
219
|
-
X !== "key" && (u[X] = l[X]);
|
|
220
|
-
} else u = l;
|
|
221
|
-
return d && a(
|
|
222
|
-
u,
|
|
223
|
-
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
-
), R(
|
|
225
|
-
e,
|
|
226
|
-
d,
|
|
227
|
-
z,
|
|
228
|
-
M,
|
|
229
|
-
r(),
|
|
230
|
-
u,
|
|
231
|
-
H,
|
|
232
|
-
J
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
function m(e) {
|
|
236
|
-
typeof e == "object" && e !== null && e.$$typeof === O && e._store && (e._store.validated = 1);
|
|
237
|
-
}
|
|
238
|
-
var x = Ee, O = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), P = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), Y = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), N = x.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, p = Array.isArray, E = console.createTask ? console.createTask : function() {
|
|
239
|
-
return null;
|
|
240
|
-
};
|
|
241
|
-
x = {
|
|
242
|
-
"react-stack-bottom-frame": function(e) {
|
|
243
|
-
return e();
|
|
244
|
-
}
|
|
245
|
-
};
|
|
246
|
-
var _, j = {}, F = x["react-stack-bottom-frame"].bind(
|
|
247
|
-
x,
|
|
248
|
-
s
|
|
249
|
-
)(), ee = E(o(s)), te = {};
|
|
250
|
-
U.Fragment = T, U.jsx = function(e, l, u, h, M) {
|
|
251
|
-
var z = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
252
|
-
return k(
|
|
253
|
-
e,
|
|
254
|
-
l,
|
|
255
|
-
u,
|
|
256
|
-
!1,
|
|
257
|
-
h,
|
|
258
|
-
M,
|
|
259
|
-
z ? Error("react-stack-top-frame") : F,
|
|
260
|
-
z ? E(o(e)) : ee
|
|
261
|
-
);
|
|
262
|
-
}, U.jsxs = function(e, l, u, h, M) {
|
|
263
|
-
var z = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
264
|
-
return k(
|
|
265
|
-
e,
|
|
266
|
-
l,
|
|
267
|
-
u,
|
|
268
|
-
!0,
|
|
269
|
-
h,
|
|
270
|
-
M,
|
|
271
|
-
z ? Error("react-stack-top-frame") : F,
|
|
272
|
-
z ? E(o(e)) : ee
|
|
273
|
-
);
|
|
274
|
-
};
|
|
275
|
-
}()), U;
|
|
276
|
-
}
|
|
277
|
-
var ne;
|
|
278
|
-
function we() {
|
|
279
|
-
return ne || (ne = 1, process.env.NODE_ENV === "production" ? G.exports = xe() : G.exports = Te()), G.exports;
|
|
280
|
-
}
|
|
281
|
-
var q = we();
|
|
282
|
-
function oe(i) {
|
|
283
|
-
if (i !== void 0)
|
|
284
|
-
switch (typeof i) {
|
|
1
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
+
import { useLayoutEffect as J, useEffect as W, useMemo as E, useState as P, useCallback as L, memo as V, useImperativeHandle as U, createElement as F, useRef as Y } from "react";
|
|
3
|
+
function B(t) {
|
|
4
|
+
if (t !== void 0)
|
|
5
|
+
switch (typeof t) {
|
|
285
6
|
case "number":
|
|
286
|
-
return
|
|
7
|
+
return t;
|
|
287
8
|
case "string": {
|
|
288
|
-
if (
|
|
289
|
-
return parseFloat(
|
|
9
|
+
if (t.endsWith("px"))
|
|
10
|
+
return parseFloat(t);
|
|
290
11
|
break;
|
|
291
12
|
}
|
|
292
13
|
}
|
|
293
14
|
}
|
|
294
|
-
const
|
|
295
|
-
function
|
|
296
|
-
box:
|
|
297
|
-
defaultHeight:
|
|
15
|
+
const q = typeof window < "u" ? J : W;
|
|
16
|
+
function K({
|
|
17
|
+
box: t,
|
|
18
|
+
defaultHeight: r,
|
|
298
19
|
defaultWidth: n,
|
|
299
|
-
disabled:
|
|
300
|
-
element:
|
|
301
|
-
mode:
|
|
302
|
-
style:
|
|
20
|
+
disabled: s,
|
|
21
|
+
element: e,
|
|
22
|
+
mode: c,
|
|
23
|
+
style: l
|
|
303
24
|
}) {
|
|
304
|
-
const { styleHeight:
|
|
25
|
+
const { styleHeight: f, styleWidth: o } = E(
|
|
305
26
|
() => ({
|
|
306
|
-
styleHeight:
|
|
307
|
-
styleWidth:
|
|
27
|
+
styleHeight: B(l?.height),
|
|
28
|
+
styleWidth: B(l?.width)
|
|
308
29
|
}),
|
|
309
|
-
[
|
|
310
|
-
), [
|
|
311
|
-
height:
|
|
30
|
+
[l?.height, l?.width]
|
|
31
|
+
), [u, a] = P({
|
|
32
|
+
height: r,
|
|
312
33
|
width: n
|
|
313
|
-
}),
|
|
314
|
-
return
|
|
315
|
-
if (
|
|
34
|
+
}), O = s || c === "only-height" && f !== void 0 || c === "only-width" && o !== void 0 || f !== void 0 && o !== void 0;
|
|
35
|
+
return q(() => {
|
|
36
|
+
if (e === null || O)
|
|
316
37
|
return;
|
|
317
|
-
const
|
|
318
|
-
for (const
|
|
319
|
-
const { contentRect:
|
|
320
|
-
|
|
321
|
-
height:
|
|
322
|
-
width:
|
|
38
|
+
const b = new ResizeObserver((m) => {
|
|
39
|
+
for (const d of m) {
|
|
40
|
+
const { contentRect: w, target: g } = d;
|
|
41
|
+
e === g && a((v) => v.height === w.height && v.width === w.width ? v : {
|
|
42
|
+
height: w.height,
|
|
43
|
+
width: w.width
|
|
323
44
|
});
|
|
324
45
|
}
|
|
325
46
|
});
|
|
326
|
-
return
|
|
327
|
-
|
|
47
|
+
return b.observe(e, { box: t }), () => {
|
|
48
|
+
b?.unobserve(e);
|
|
328
49
|
};
|
|
329
|
-
}, [
|
|
50
|
+
}, [t, O, e, f, o]), E(
|
|
330
51
|
() => ({
|
|
331
|
-
height:
|
|
332
|
-
width:
|
|
52
|
+
height: f ?? u.height,
|
|
53
|
+
width: o ?? u.width
|
|
333
54
|
}),
|
|
334
|
-
[
|
|
55
|
+
[u, f, o]
|
|
335
56
|
);
|
|
336
57
|
}
|
|
337
|
-
function
|
|
338
|
-
|
|
58
|
+
function $(t, r = "Assertion error") {
|
|
59
|
+
if (!t)
|
|
60
|
+
throw console.error(r), Error(r);
|
|
339
61
|
}
|
|
340
|
-
function
|
|
341
|
-
|
|
342
|
-
|
|
62
|
+
function Q({
|
|
63
|
+
cachedBounds: t,
|
|
64
|
+
itemCount: r,
|
|
65
|
+
itemSize: n
|
|
66
|
+
}) {
|
|
67
|
+
if (typeof n == "number")
|
|
68
|
+
return r * n;
|
|
69
|
+
if (t.size > 0) {
|
|
70
|
+
const s = t.get(t.size - 1);
|
|
71
|
+
$(s !== void 0, "Unexpected bounds cache miss");
|
|
72
|
+
const e = (s.scrollOffset + s.size) / t.size;
|
|
73
|
+
return r * e;
|
|
74
|
+
} else
|
|
75
|
+
return 0;
|
|
343
76
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return
|
|
369
|
-
if (this.#e.size > 0) {
|
|
370
|
-
const t = this.#e.get(this.#e.size - 1);
|
|
371
|
-
B(t !== void 0, "Unexpected bounds cache miss");
|
|
372
|
-
const n = (t.scrollOffset + t.size) / this.#e.size;
|
|
373
|
-
return this.#s * n;
|
|
374
|
-
} else
|
|
375
|
-
return 0;
|
|
376
|
-
}
|
|
377
|
-
getIndices() {
|
|
378
|
-
return this.#i < 0 ? [0, -1] : [this.#i, this.#a];
|
|
379
|
-
}
|
|
380
|
-
getItemBounds(t) {
|
|
381
|
-
if (typeof this.#r == "number")
|
|
382
|
-
return {
|
|
383
|
-
scrollOffset: t * this.#r,
|
|
384
|
-
size: this.#r
|
|
385
|
-
};
|
|
386
|
-
for (; this.#e.size - 1 < t; ) {
|
|
387
|
-
const o = this.#e.size, r = typeof this.#r == "number" ? this.#r : this.#r(o);
|
|
388
|
-
if (o === 0)
|
|
389
|
-
this.#e.set(o, {
|
|
390
|
-
size: r,
|
|
391
|
-
scrollOffset: 0
|
|
392
|
-
});
|
|
393
|
-
else {
|
|
394
|
-
const s = this.#e.get(o - 1);
|
|
395
|
-
B(
|
|
396
|
-
s !== void 0,
|
|
397
|
-
`Unexpected bounds cache miss for index ${t}`
|
|
398
|
-
), this.#e.set(o, {
|
|
399
|
-
scrollOffset: s.scrollOffset + s.size,
|
|
400
|
-
size: r
|
|
401
|
-
});
|
|
402
|
-
}
|
|
77
|
+
function X({
|
|
78
|
+
align: t,
|
|
79
|
+
cachedBounds: r,
|
|
80
|
+
index: n,
|
|
81
|
+
itemCount: s,
|
|
82
|
+
containerScrollOffset: e,
|
|
83
|
+
containerSize: c
|
|
84
|
+
}) {
|
|
85
|
+
const l = r.get(s - 1).scrollOffset, f = l + l - c, o = Math.max(
|
|
86
|
+
0,
|
|
87
|
+
r.get(n + 1).scrollOffset - c
|
|
88
|
+
), u = Math.min(
|
|
89
|
+
l,
|
|
90
|
+
r.get(n).scrollOffset
|
|
91
|
+
);
|
|
92
|
+
switch (t === "smart" && (e >= o && e <= u ? t = "auto" : t = "center"), t) {
|
|
93
|
+
case "start":
|
|
94
|
+
return Math.min(f, u);
|
|
95
|
+
case "end":
|
|
96
|
+
return o;
|
|
97
|
+
case "center": {
|
|
98
|
+
const a = Math.round(
|
|
99
|
+
o + (u - o) / 2
|
|
100
|
+
);
|
|
101
|
+
return a < Math.ceil(c / 2) ? 0 : a > f ? f : a;
|
|
403
102
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
`Unexpected bounds cache miss for index ${t}`
|
|
408
|
-
), n;
|
|
409
|
-
}
|
|
410
|
-
resize(t) {
|
|
411
|
-
this.#n = t, this.#f();
|
|
103
|
+
case "auto":
|
|
104
|
+
default:
|
|
105
|
+
return e >= o && e <= u ? e : e < o ? o : u;
|
|
412
106
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
top: r
|
|
429
|
-
});
|
|
107
|
+
}
|
|
108
|
+
function Z({
|
|
109
|
+
cachedBounds: t,
|
|
110
|
+
containerScrollOffset: r,
|
|
111
|
+
containerSize: n,
|
|
112
|
+
itemCount: s,
|
|
113
|
+
overscanCount: e
|
|
114
|
+
}) {
|
|
115
|
+
const c = s - 1;
|
|
116
|
+
let l = 0, f = -1, o = 0;
|
|
117
|
+
for (; o < c; ) {
|
|
118
|
+
const u = t.get(o);
|
|
119
|
+
if (u.scrollOffset + u.size > r)
|
|
120
|
+
break;
|
|
121
|
+
o++;
|
|
430
122
|
}
|
|
431
|
-
|
|
432
|
-
|
|
123
|
+
for (l = o, l = Math.max(0, l - e); o < c; ) {
|
|
124
|
+
const u = t.get(o);
|
|
125
|
+
if (u.scrollOffset + u.size >= r + n)
|
|
126
|
+
break;
|
|
127
|
+
o++;
|
|
433
128
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
s
|
|
457
|
-
|
|
458
|
-
|
|
129
|
+
return f = Math.min(c, o), f = Math.min(s - 1, f + e), l < 0 ? [0, -1] : [l, f];
|
|
130
|
+
}
|
|
131
|
+
function _({
|
|
132
|
+
itemCount: t,
|
|
133
|
+
itemProps: r,
|
|
134
|
+
itemSize: n
|
|
135
|
+
}) {
|
|
136
|
+
const s = /* @__PURE__ */ new Map();
|
|
137
|
+
return {
|
|
138
|
+
get(e) {
|
|
139
|
+
for ($(e < t, `Invalid index ${e}`); s.size - 1 < e; ) {
|
|
140
|
+
const l = s.size, f = typeof n == "number" ? n : n(l, r);
|
|
141
|
+
if (l === 0)
|
|
142
|
+
s.set(l, {
|
|
143
|
+
size: f,
|
|
144
|
+
scrollOffset: 0
|
|
145
|
+
});
|
|
146
|
+
else {
|
|
147
|
+
const o = s.get(l - 1);
|
|
148
|
+
$(
|
|
149
|
+
o !== void 0,
|
|
150
|
+
`Unexpected bounds cache miss for index ${e}`
|
|
151
|
+
), s.set(l, {
|
|
152
|
+
scrollOffset: o.scrollOffset + o.size,
|
|
153
|
+
size: f
|
|
154
|
+
});
|
|
155
|
+
}
|
|
459
156
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
for (; r < t; ) {
|
|
472
|
-
const s = this.getItemBounds(r);
|
|
473
|
-
if (s.scrollOffset + s.size > this.#t)
|
|
474
|
-
break;
|
|
475
|
-
r++;
|
|
476
|
-
}
|
|
477
|
-
for (n = r, n = Math.max(0, n - this.#u); r < t; ) {
|
|
478
|
-
const s = this.getItemBounds(r);
|
|
479
|
-
if (s.scrollOffset + s.size >= this.#t + this.#n)
|
|
480
|
-
break;
|
|
481
|
-
r++;
|
|
157
|
+
const c = s.get(e);
|
|
158
|
+
return $(
|
|
159
|
+
c !== void 0,
|
|
160
|
+
`Unexpected bounds cache miss for index ${e}`
|
|
161
|
+
), c;
|
|
162
|
+
},
|
|
163
|
+
set(e, c) {
|
|
164
|
+
s.set(e, c);
|
|
165
|
+
},
|
|
166
|
+
get size() {
|
|
167
|
+
return s.size;
|
|
482
168
|
}
|
|
483
|
-
|
|
484
|
-
}
|
|
169
|
+
};
|
|
485
170
|
}
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
element: o,
|
|
491
|
-
itemSize: r,
|
|
492
|
-
overscanCount: s,
|
|
493
|
-
size: c
|
|
171
|
+
function N({
|
|
172
|
+
itemCount: t,
|
|
173
|
+
itemProps: r,
|
|
174
|
+
itemSize: n
|
|
494
175
|
}) {
|
|
495
|
-
|
|
496
|
-
() =>
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
overscanCount: s
|
|
503
|
-
}) : null,
|
|
504
|
-
[i, t, n, o, r, s]
|
|
176
|
+
return E(
|
|
177
|
+
() => _({
|
|
178
|
+
itemCount: t,
|
|
179
|
+
itemProps: r,
|
|
180
|
+
itemSize: n
|
|
181
|
+
}),
|
|
182
|
+
[t, r, n]
|
|
505
183
|
);
|
|
506
|
-
return ce(() => {
|
|
507
|
-
c !== void 0 && a?.resize(c);
|
|
508
|
-
}, [c, a]), ge(
|
|
509
|
-
a?.subscribe ?? be,
|
|
510
|
-
a?.version ?? ie,
|
|
511
|
-
a?.version ?? ie
|
|
512
|
-
), a;
|
|
513
184
|
}
|
|
514
|
-
function
|
|
515
|
-
|
|
185
|
+
function R({
|
|
186
|
+
containerElement: t,
|
|
187
|
+
containerStyle: r,
|
|
188
|
+
defaultContainerSize: n = 0,
|
|
189
|
+
direction: s,
|
|
190
|
+
itemCount: e,
|
|
191
|
+
itemProps: c,
|
|
192
|
+
itemSize: l,
|
|
193
|
+
overscanCount: f
|
|
194
|
+
}) {
|
|
195
|
+
const [[o, u], a] = P([0, -1]), { height: O = n, width: b = n } = K({
|
|
196
|
+
defaultHeight: s === "vertical" ? n : void 0,
|
|
197
|
+
defaultWidth: s === "horizontal" ? n : void 0,
|
|
198
|
+
element: t,
|
|
199
|
+
mode: s === "vertical" ? "only-height" : "only-width",
|
|
200
|
+
style: r
|
|
201
|
+
}), m = s === "vertical" ? O : b, d = N({
|
|
202
|
+
itemCount: e,
|
|
203
|
+
itemProps: c,
|
|
204
|
+
itemSize: l
|
|
205
|
+
}), w = L(
|
|
206
|
+
(i) => d.get(i),
|
|
207
|
+
[d]
|
|
208
|
+
), g = L(
|
|
209
|
+
() => Q({
|
|
210
|
+
cachedBounds: d,
|
|
211
|
+
itemCount: e,
|
|
212
|
+
itemSize: l
|
|
213
|
+
}),
|
|
214
|
+
[d, e, l]
|
|
215
|
+
), v = L(
|
|
216
|
+
(i) => Z({
|
|
217
|
+
cachedBounds: d,
|
|
218
|
+
containerScrollOffset: i,
|
|
219
|
+
containerSize: m,
|
|
220
|
+
itemCount: e,
|
|
221
|
+
overscanCount: f
|
|
222
|
+
}),
|
|
223
|
+
[d, m, e, f]
|
|
224
|
+
);
|
|
225
|
+
q(() => {
|
|
226
|
+
a(v(0));
|
|
227
|
+
}, [v]);
|
|
228
|
+
const p = L(
|
|
229
|
+
({
|
|
230
|
+
align: i = "auto",
|
|
231
|
+
behavior: x = "auto",
|
|
232
|
+
containerScrollOffset: z,
|
|
233
|
+
index: I
|
|
234
|
+
}) => {
|
|
235
|
+
const h = X({
|
|
236
|
+
align: i,
|
|
237
|
+
cachedBounds: d,
|
|
238
|
+
containerScrollOffset: z,
|
|
239
|
+
containerSize: m,
|
|
240
|
+
index: I,
|
|
241
|
+
itemCount: e
|
|
242
|
+
});
|
|
243
|
+
s === "horizontal" ? t?.scrollTo({
|
|
244
|
+
left: h,
|
|
245
|
+
behavior: x || void 0
|
|
246
|
+
}) : t?.scrollTo({
|
|
247
|
+
behavior: x || void 0,
|
|
248
|
+
top: h
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
[d, t, m, s, e]
|
|
252
|
+
);
|
|
253
|
+
return {
|
|
254
|
+
getCellBounds: w,
|
|
255
|
+
getEstimatedHeight: g,
|
|
256
|
+
onScroll: () => {
|
|
257
|
+
const i = v(
|
|
258
|
+
(s === "vertical" ? t?.scrollTop : t?.scrollLeft) ?? 0
|
|
259
|
+
);
|
|
260
|
+
(i[0] !== o || i[1] !== u) && a(i);
|
|
261
|
+
},
|
|
262
|
+
scrollToIndex: p,
|
|
263
|
+
startIndex: o,
|
|
264
|
+
stopIndex: u
|
|
265
|
+
};
|
|
516
266
|
}
|
|
517
|
-
function
|
|
518
|
-
return
|
|
267
|
+
function A(t) {
|
|
268
|
+
return E(() => t, Object.values(t));
|
|
519
269
|
}
|
|
520
|
-
function
|
|
521
|
-
if (
|
|
270
|
+
function G(t, r) {
|
|
271
|
+
if (t === r)
|
|
522
272
|
return !0;
|
|
523
|
-
if (!!
|
|
273
|
+
if (!!t != !!r || ($(t !== void 0), $(r !== void 0), Object.keys(t).length !== Object.keys(r).length))
|
|
524
274
|
return !1;
|
|
525
|
-
for (const n in
|
|
526
|
-
if (!Object.is(
|
|
275
|
+
for (const n in t)
|
|
276
|
+
if (!Object.is(r[n], t[n]))
|
|
527
277
|
return !1;
|
|
528
278
|
return !0;
|
|
529
279
|
}
|
|
530
|
-
function
|
|
531
|
-
const { style: n, ...
|
|
532
|
-
return
|
|
280
|
+
function D(t, r) {
|
|
281
|
+
const { style: n, ...s } = t, { style: e, ...c } = r;
|
|
282
|
+
return G(n, e) && G(s, c);
|
|
533
283
|
}
|
|
534
|
-
function
|
|
535
|
-
cellComponent:
|
|
536
|
-
cellProps:
|
|
284
|
+
function et({
|
|
285
|
+
cellComponent: t,
|
|
286
|
+
cellProps: r,
|
|
537
287
|
className: n,
|
|
538
|
-
columnCount:
|
|
539
|
-
columnWidth:
|
|
540
|
-
defaultHeight:
|
|
541
|
-
defaultWidth:
|
|
542
|
-
gridRef:
|
|
543
|
-
onCellsRendered:
|
|
544
|
-
overscanCount:
|
|
545
|
-
rowCount:
|
|
546
|
-
rowHeight:
|
|
547
|
-
style:
|
|
548
|
-
...
|
|
288
|
+
columnCount: s,
|
|
289
|
+
columnWidth: e,
|
|
290
|
+
defaultHeight: c = 0,
|
|
291
|
+
defaultWidth: l = 0,
|
|
292
|
+
gridRef: f,
|
|
293
|
+
onCellsRendered: o,
|
|
294
|
+
overscanCount: u = 3,
|
|
295
|
+
rowCount: a,
|
|
296
|
+
rowHeight: O,
|
|
297
|
+
style: b,
|
|
298
|
+
...m
|
|
549
299
|
}) {
|
|
550
|
-
const
|
|
551
|
-
() =>
|
|
552
|
-
[
|
|
553
|
-
), [
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
element: S,
|
|
557
|
-
style: x
|
|
558
|
-
}), W = y(() => typeof r == "number" ? r : (p) => r(p, w), [r, w]), I = y(() => typeof m == "number" ? m : (p) => m(p, w), [m, w]), f = Z({
|
|
559
|
-
count: o,
|
|
560
|
-
defaultSize: c,
|
|
300
|
+
const d = A(r), w = E(
|
|
301
|
+
() => V(t, D),
|
|
302
|
+
[t]
|
|
303
|
+
), [g, v] = P(null), p = R({
|
|
304
|
+
containerElement: g,
|
|
305
|
+
defaultContainerSize: l,
|
|
561
306
|
direction: "horizontal",
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
}),
|
|
567
|
-
|
|
568
|
-
|
|
307
|
+
itemCount: s,
|
|
308
|
+
itemProps: d,
|
|
309
|
+
itemSize: e,
|
|
310
|
+
overscanCount: u
|
|
311
|
+
}), i = R({
|
|
312
|
+
containerElement: g,
|
|
313
|
+
defaultContainerSize: c,
|
|
569
314
|
direction: "vertical",
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}),
|
|
575
|
-
|
|
576
|
-
|
|
315
|
+
itemCount: a,
|
|
316
|
+
itemProps: d,
|
|
317
|
+
itemSize: O,
|
|
318
|
+
overscanCount: u
|
|
319
|
+
}), { startIndex: x, stopIndex: z } = p, { startIndex: I, stopIndex: h } = i;
|
|
320
|
+
U(
|
|
321
|
+
f,
|
|
577
322
|
() => ({
|
|
578
323
|
get element() {
|
|
579
|
-
return
|
|
324
|
+
return g;
|
|
580
325
|
},
|
|
581
326
|
scrollToCell({
|
|
582
|
-
behavior:
|
|
583
|
-
columnAlign:
|
|
584
|
-
columnIndex:
|
|
585
|
-
rowAlign:
|
|
586
|
-
rowIndex:
|
|
327
|
+
behavior: S = "auto",
|
|
328
|
+
columnAlign: y = "auto",
|
|
329
|
+
columnIndex: T,
|
|
330
|
+
rowAlign: H = "auto",
|
|
331
|
+
rowIndex: k
|
|
587
332
|
}) {
|
|
588
|
-
|
|
589
|
-
align:
|
|
590
|
-
behavior:
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
align:
|
|
595
|
-
|
|
333
|
+
i?.scrollToIndex({
|
|
334
|
+
align: H,
|
|
335
|
+
behavior: S,
|
|
336
|
+
containerScrollOffset: g?.scrollTop ?? 0,
|
|
337
|
+
index: k
|
|
338
|
+
}), p?.scrollToIndex({
|
|
339
|
+
align: y,
|
|
340
|
+
behavior: S,
|
|
341
|
+
containerScrollOffset: g?.scrollLeft ?? 0,
|
|
342
|
+
index: T
|
|
596
343
|
});
|
|
597
344
|
},
|
|
598
345
|
scrollToColumn({
|
|
599
|
-
align:
|
|
600
|
-
behavior:
|
|
601
|
-
index:
|
|
346
|
+
align: S = "auto",
|
|
347
|
+
behavior: y = "auto",
|
|
348
|
+
index: T
|
|
602
349
|
}) {
|
|
603
|
-
|
|
604
|
-
align:
|
|
605
|
-
behavior:
|
|
606
|
-
|
|
350
|
+
p?.scrollToIndex({
|
|
351
|
+
align: S,
|
|
352
|
+
behavior: y,
|
|
353
|
+
containerScrollOffset: g?.scrollLeft ?? 0,
|
|
354
|
+
index: T
|
|
607
355
|
});
|
|
608
356
|
},
|
|
609
357
|
scrollToRow({
|
|
610
|
-
align:
|
|
611
|
-
behavior:
|
|
612
|
-
index:
|
|
358
|
+
align: S = "auto",
|
|
359
|
+
behavior: y = "auto",
|
|
360
|
+
index: T
|
|
613
361
|
}) {
|
|
614
|
-
|
|
362
|
+
i?.scrollToIndex({
|
|
363
|
+
align: S,
|
|
364
|
+
behavior: y,
|
|
365
|
+
containerScrollOffset: g?.scrollTop ?? 0,
|
|
366
|
+
index: T
|
|
367
|
+
});
|
|
615
368
|
}
|
|
616
369
|
}),
|
|
617
|
-
[
|
|
618
|
-
),
|
|
619
|
-
|
|
620
|
-
columnStartIndex:
|
|
621
|
-
columnStopIndex:
|
|
622
|
-
rowStartIndex:
|
|
623
|
-
rowStopIndex:
|
|
370
|
+
[p, g, i]
|
|
371
|
+
), W(() => {
|
|
372
|
+
x >= 0 && z >= 0 && I >= 0 && h >= 0 && o && o({
|
|
373
|
+
columnStartIndex: x,
|
|
374
|
+
columnStopIndex: z,
|
|
375
|
+
rowStartIndex: I,
|
|
376
|
+
rowStopIndex: h
|
|
624
377
|
});
|
|
625
378
|
}, [
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
379
|
+
o,
|
|
380
|
+
x,
|
|
381
|
+
z,
|
|
382
|
+
I,
|
|
383
|
+
h
|
|
631
384
|
]);
|
|
632
|
-
const
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
635
|
-
for (let
|
|
636
|
-
const
|
|
637
|
-
for (let
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
|
|
385
|
+
const M = E(() => {
|
|
386
|
+
const S = [];
|
|
387
|
+
if (p && s > 0 && i && a > 0)
|
|
388
|
+
for (let y = I; y <= h; y++) {
|
|
389
|
+
const T = i.getCellBounds(y);
|
|
390
|
+
for (let H = x; H <= z; H++) {
|
|
391
|
+
const k = p.getCellBounds(H);
|
|
392
|
+
S.push(
|
|
393
|
+
/* @__PURE__ */ F(
|
|
394
|
+
w,
|
|
642
395
|
{
|
|
643
|
-
...
|
|
644
|
-
columnIndex:
|
|
645
|
-
key: `${
|
|
646
|
-
rowIndex:
|
|
396
|
+
...d,
|
|
397
|
+
columnIndex: H,
|
|
398
|
+
key: `${y}-${H}`,
|
|
399
|
+
rowIndex: y,
|
|
647
400
|
style: {
|
|
648
401
|
position: "absolute",
|
|
649
402
|
left: 0,
|
|
650
|
-
transform: `translate(${
|
|
651
|
-
height:
|
|
652
|
-
width:
|
|
403
|
+
transform: `translate(${k.scrollOffset}px, ${T.scrollOffset}px)`,
|
|
404
|
+
height: T.size,
|
|
405
|
+
width: k.size
|
|
653
406
|
}
|
|
654
407
|
}
|
|
655
408
|
)
|
|
656
409
|
);
|
|
657
410
|
}
|
|
658
411
|
}
|
|
659
|
-
return
|
|
412
|
+
return S;
|
|
660
413
|
}, [
|
|
661
|
-
T,
|
|
662
414
|
w,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
415
|
+
d,
|
|
416
|
+
s,
|
|
417
|
+
x,
|
|
418
|
+
z,
|
|
419
|
+
p,
|
|
420
|
+
a,
|
|
421
|
+
I,
|
|
422
|
+
h,
|
|
423
|
+
i
|
|
671
424
|
]);
|
|
672
|
-
return /* @__PURE__ */
|
|
425
|
+
return /* @__PURE__ */ j(
|
|
673
426
|
"div",
|
|
674
427
|
{
|
|
675
428
|
role: "grid",
|
|
676
|
-
...
|
|
429
|
+
...m,
|
|
677
430
|
className: n,
|
|
678
|
-
|
|
431
|
+
onScroll: () => {
|
|
432
|
+
p.onScroll(), i.onScroll();
|
|
433
|
+
},
|
|
434
|
+
ref: v,
|
|
679
435
|
style: {
|
|
680
|
-
...
|
|
436
|
+
...b,
|
|
681
437
|
maxHeight: "100%",
|
|
682
438
|
maxWidth: "100%",
|
|
683
439
|
flexGrow: 1,
|
|
684
440
|
overflow: "auto"
|
|
685
441
|
},
|
|
686
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ j(
|
|
687
443
|
"div",
|
|
688
444
|
{
|
|
689
445
|
className: n,
|
|
690
446
|
style: {
|
|
691
447
|
position: "relative",
|
|
692
|
-
height:
|
|
693
|
-
width:
|
|
448
|
+
height: i?.getEstimatedHeight(),
|
|
449
|
+
width: p?.getEstimatedHeight()
|
|
694
450
|
},
|
|
695
|
-
children:
|
|
451
|
+
children: M
|
|
696
452
|
}
|
|
697
453
|
)
|
|
698
454
|
}
|
|
699
455
|
);
|
|
700
456
|
}
|
|
701
|
-
const
|
|
702
|
-
function
|
|
703
|
-
className:
|
|
704
|
-
defaultHeight:
|
|
457
|
+
const st = Y;
|
|
458
|
+
function ot({
|
|
459
|
+
className: t,
|
|
460
|
+
defaultHeight: r = 0,
|
|
705
461
|
listRef: n,
|
|
706
|
-
onRowsRendered:
|
|
707
|
-
overscanCount:
|
|
708
|
-
rowComponent:
|
|
709
|
-
rowCount:
|
|
710
|
-
rowHeight:
|
|
711
|
-
rowProps:
|
|
712
|
-
style:
|
|
713
|
-
...
|
|
462
|
+
onRowsRendered: s,
|
|
463
|
+
overscanCount: e = 3,
|
|
464
|
+
rowComponent: c,
|
|
465
|
+
rowCount: l,
|
|
466
|
+
rowHeight: f,
|
|
467
|
+
rowProps: o,
|
|
468
|
+
style: u,
|
|
469
|
+
...a
|
|
714
470
|
}) {
|
|
715
|
-
const
|
|
716
|
-
() =>
|
|
717
|
-
[
|
|
718
|
-
), [
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
471
|
+
const O = A(o), b = E(
|
|
472
|
+
() => V(c, D),
|
|
473
|
+
[c]
|
|
474
|
+
), [m, d] = P(null), {
|
|
475
|
+
getCellBounds: w,
|
|
476
|
+
getEstimatedHeight: g,
|
|
477
|
+
onScroll: v,
|
|
478
|
+
scrollToIndex: p,
|
|
479
|
+
startIndex: i,
|
|
480
|
+
stopIndex: x
|
|
481
|
+
} = R({
|
|
482
|
+
containerElement: m,
|
|
483
|
+
defaultContainerSize: r,
|
|
726
484
|
direction: "vertical",
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
})
|
|
732
|
-
|
|
485
|
+
itemCount: l,
|
|
486
|
+
itemProps: O,
|
|
487
|
+
itemSize: f,
|
|
488
|
+
overscanCount: e
|
|
489
|
+
});
|
|
490
|
+
U(
|
|
733
491
|
n,
|
|
734
492
|
() => ({
|
|
735
493
|
get element() {
|
|
736
|
-
return
|
|
494
|
+
return m;
|
|
737
495
|
},
|
|
738
496
|
scrollToRow({
|
|
739
497
|
align: I = "auto",
|
|
740
|
-
behavior:
|
|
741
|
-
index:
|
|
498
|
+
behavior: h = "auto",
|
|
499
|
+
index: M
|
|
742
500
|
}) {
|
|
743
|
-
|
|
501
|
+
p({
|
|
502
|
+
align: I,
|
|
503
|
+
behavior: h,
|
|
504
|
+
containerScrollOffset: m?.scrollTop ?? 0,
|
|
505
|
+
index: M
|
|
506
|
+
});
|
|
744
507
|
}
|
|
745
508
|
}),
|
|
746
|
-
[
|
|
747
|
-
),
|
|
748
|
-
|
|
749
|
-
startIndex:
|
|
750
|
-
stopIndex:
|
|
509
|
+
[m, p]
|
|
510
|
+
), W(() => {
|
|
511
|
+
i >= 0 && x >= 0 && s && s({
|
|
512
|
+
startIndex: i,
|
|
513
|
+
stopIndex: x
|
|
751
514
|
});
|
|
752
|
-
}, [
|
|
753
|
-
const
|
|
515
|
+
}, [s, i, x]);
|
|
516
|
+
const z = E(() => {
|
|
754
517
|
const I = [];
|
|
755
|
-
if (
|
|
756
|
-
for (let
|
|
757
|
-
const
|
|
518
|
+
if (l > 0)
|
|
519
|
+
for (let h = i; h <= x; h++) {
|
|
520
|
+
const M = w(h);
|
|
758
521
|
I.push(
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
|
|
522
|
+
/* @__PURE__ */ F(
|
|
523
|
+
b,
|
|
761
524
|
{
|
|
762
|
-
...
|
|
763
|
-
key:
|
|
764
|
-
index:
|
|
525
|
+
...O,
|
|
526
|
+
key: h,
|
|
527
|
+
index: h,
|
|
765
528
|
style: {
|
|
766
529
|
position: "absolute",
|
|
767
530
|
left: 0,
|
|
768
|
-
transform: `translateY(${
|
|
769
|
-
height:
|
|
531
|
+
transform: `translateY(${M.scrollOffset}px)`,
|
|
532
|
+
height: M.size,
|
|
770
533
|
width: "100%"
|
|
771
534
|
}
|
|
772
535
|
}
|
|
@@ -774,39 +537,40 @@ function ke({
|
|
|
774
537
|
);
|
|
775
538
|
}
|
|
776
539
|
return I;
|
|
777
|
-
}, [
|
|
778
|
-
return /* @__PURE__ */
|
|
540
|
+
}, [b, w, l, O, i, x]);
|
|
541
|
+
return /* @__PURE__ */ j(
|
|
779
542
|
"div",
|
|
780
543
|
{
|
|
781
544
|
role: "list",
|
|
782
|
-
...
|
|
783
|
-
className:
|
|
784
|
-
|
|
545
|
+
...a,
|
|
546
|
+
className: t,
|
|
547
|
+
onScroll: v,
|
|
548
|
+
ref: d,
|
|
785
549
|
style: {
|
|
786
|
-
...
|
|
550
|
+
...u,
|
|
787
551
|
maxHeight: "100%",
|
|
788
552
|
flexGrow: 1,
|
|
789
553
|
overflowY: "auto"
|
|
790
554
|
},
|
|
791
|
-
children: /* @__PURE__ */
|
|
555
|
+
children: /* @__PURE__ */ j(
|
|
792
556
|
"div",
|
|
793
557
|
{
|
|
794
|
-
className:
|
|
558
|
+
className: t,
|
|
795
559
|
style: {
|
|
796
|
-
height:
|
|
560
|
+
height: g(),
|
|
797
561
|
position: "relative",
|
|
798
562
|
width: "100%"
|
|
799
563
|
},
|
|
800
|
-
children:
|
|
564
|
+
children: z
|
|
801
565
|
}
|
|
802
566
|
)
|
|
803
567
|
}
|
|
804
568
|
);
|
|
805
569
|
}
|
|
806
|
-
const
|
|
570
|
+
const rt = Y;
|
|
807
571
|
export {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
572
|
+
et as Grid,
|
|
573
|
+
ot as List,
|
|
574
|
+
st as useGridRef,
|
|
575
|
+
rt as useListRef
|
|
812
576
|
};
|