react-window 2.0.0 → 2.0.2-alpha.0
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/README.md +29 -3
- package/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +10 -1
- package/dist/react-window.js +406 -373
- package/dist/react-window.js.map +1 -1
- package/docs/assets/AriaRolesRoute-BQ4l2o71.js +2 -0
- package/docs/assets/AriaRolesRoute-BQ4l2o71.js.map +1 -0
- package/docs/assets/AriaRolesRoute-BXnUEUK2.js +2 -0
- package/docs/assets/AriaRolesRoute-BXnUEUK2.js.map +1 -0
- package/docs/assets/AriaRolesRoute-ahe1aw6k.js +2 -0
- package/docs/assets/AriaRolesRoute-ahe1aw6k.js.map +1 -0
- package/docs/assets/CellComponent.example-dKVH8ZYc.js +2 -0
- package/docs/assets/CellComponent.example-dKVH8ZYc.js.map +1 -0
- package/docs/assets/ComponentProps-BA6jJCAT.js +2 -0
- package/docs/assets/ComponentProps-BA6jJCAT.js.map +1 -0
- package/docs/assets/ContinueLink-DN1_wnU9.js +2 -0
- package/docs/assets/ContinueLink-DN1_wnU9.js.map +1 -0
- package/docs/assets/FixedHeightList-HNBwl6P8.js +2 -0
- package/docs/assets/FixedHeightList-HNBwl6P8.js.map +1 -0
- package/docs/assets/FixedRowHeightsRoute-iwoWadtD.js +2 -0
- package/docs/assets/FixedRowHeightsRoute-iwoWadtD.js.map +1 -0
- package/docs/assets/FormattedCode-CDzGfhdX.js +2 -0
- package/docs/assets/FormattedCode-CDzGfhdX.js.map +1 -0
- package/docs/assets/FormattedCode-nwWF-WcI.css +1 -0
- package/docs/assets/GettingStartedRoute-6onVm0dP.js +2 -0
- package/docs/assets/GettingStartedRoute-6onVm0dP.js.map +1 -0
- package/docs/assets/Grid-BnGy9pmI.js +2 -0
- package/docs/assets/Grid-BnGy9pmI.js.map +1 -0
- package/docs/assets/Header-DyQVANF3.js +2 -0
- package/docs/assets/Header-DyQVANF3.js.map +1 -0
- package/docs/assets/HorizontalListsRoute-BQxNRT_F.js +2 -0
- package/docs/assets/HorizontalListsRoute-BQxNRT_F.js.map +1 -0
- package/docs/assets/ImperativeApiRoute-DN4crA5x.js +2 -0
- package/docs/assets/ImperativeApiRoute-DN4crA5x.js.map +1 -0
- package/docs/assets/ImperativeApiRoute-ZdLgDzyA.js +2 -0
- package/docs/assets/ImperativeApiRoute-ZdLgDzyA.js.map +1 -0
- package/docs/assets/List-CsalXuo6.js +2 -0
- package/docs/assets/List-CsalXuo6.js.map +1 -0
- package/docs/assets/LoadingSpinner-DXcA8wXA.js +2 -0
- package/docs/assets/LoadingSpinner-DXcA8wXA.js.map +1 -0
- package/docs/assets/PageNotFound-I9Ugq07H.js +2 -0
- package/docs/assets/PageNotFound-I9Ugq07H.js.map +1 -0
- package/docs/assets/PlatformRequirementsRoute-Mn45V_j9.js +2 -0
- package/docs/assets/PlatformRequirementsRoute-Mn45V_j9.js.map +1 -0
- package/docs/assets/PropsRoute-BzcsHp2c.js +2 -0
- package/docs/assets/PropsRoute-BzcsHp2c.js.map +1 -0
- package/docs/assets/PropsRoute-CHeNkGKQ.js +2 -0
- package/docs/assets/PropsRoute-CHeNkGKQ.js.map +1 -0
- package/docs/assets/RTLGridsRoute-RdjRBOG7.js +2 -0
- package/docs/assets/RTLGridsRoute-RdjRBOG7.js.map +1 -0
- package/docs/assets/RenderingGridRoute-bkYAfFEg.js +2 -0
- package/docs/assets/RenderingGridRoute-bkYAfFEg.js.map +1 -0
- package/docs/assets/ScratchpadRoute-B8OO7yyx.js +2 -0
- package/docs/assets/ScratchpadRoute-B8OO7yyx.js.map +1 -0
- package/docs/assets/Select-Dtoy3zH8.js +2 -0
- package/docs/assets/Select-Dtoy3zH8.js.map +1 -0
- package/docs/assets/SupportRoute-Cy6JXaox.js +2 -0
- package/docs/assets/SupportRoute-Cy6JXaox.js.map +1 -0
- package/docs/assets/TabularDataRoute-EbsuxYEq.js +2 -0
- package/docs/assets/TabularDataRoute-EbsuxYEq.js.map +1 -0
- package/docs/assets/VariableRowHeightsRoute-Bmh2fNYt.js +2 -0
- package/docs/assets/VariableRowHeightsRoute-Bmh2fNYt.js.map +1 -0
- package/docs/assets/addresses-CDQyd4n9.js +2 -0
- package/docs/assets/addresses-CDQyd4n9.js.map +1 -0
- package/docs/assets/arePropsEqual-Bhv0L31F.js +2 -0
- package/docs/assets/arePropsEqual-Bhv0L31F.js.map +1 -0
- package/docs/assets/contacts-Bxrk2JS2.js +2 -0
- package/docs/assets/contacts-Bxrk2JS2.js.map +1 -0
- package/docs/assets/index-DEYagqsv.css +1 -0
- package/docs/assets/index-Dfhz9Ad4.js +3 -0
- package/docs/assets/index-Dfhz9Ad4.js.map +1 -0
- package/docs/assets/useCitiesByState-_PN38xmv.js +2 -0
- package/docs/assets/useCitiesByState-_PN38xmv.js.map +1 -0
- package/docs/assets/useContacts-CDDyJV-g.js +2 -0
- package/docs/assets/useContacts-CDDyJV-g.js.map +1 -0
- package/docs/generated/code-snippets/CellComponentAriaRoles.json +4 -0
- package/docs/generated/code-snippets/GridAriaRoles.json +3 -0
- package/docs/generated/code-snippets/ListAriaRoles.json +3 -0
- package/docs/generated/code-snippets/RowComponentAriaRoles.json +4 -0
- package/docs/generated/code-snippets/TableAriaAttributes.json +3 -0
- package/docs/generated/code-snippets/TableAriaOverrideProps.json +4 -0
- package/docs/generated/js-docs/Grid.json +1 -1
- package/docs/generated/js-docs/List.json +1 -1
- package/docs/index.html +9 -3
- package/docs/robots.txt +2 -0
- package/docs/stats.html +1 -1
- package/package.json +4 -1
- package/docs/assets/index-AW1og9rz.css +0 -1
- package/docs/assets/index-LE94V_KA.js +0 -68
package/dist/react-window.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as J, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useLayoutEffect as Q, useEffect as X, useMemo as A, useRef as Y, useCallback as V, memo as ee, useImperativeHandle as te, createElement as se } from "react";
|
|
3
|
+
function ce(e) {
|
|
4
4
|
let t = e;
|
|
5
5
|
for (; t; ) {
|
|
6
6
|
if (t.dir)
|
|
@@ -9,14 +9,14 @@ function ie(e) {
|
|
|
9
9
|
}
|
|
10
10
|
return !1;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const [
|
|
14
|
-
return
|
|
15
|
-
e && (t ||
|
|
16
|
-
}, [t, e]),
|
|
12
|
+
function fe(e, t) {
|
|
13
|
+
const [r, s] = j(t === "rtl");
|
|
14
|
+
return Q(() => {
|
|
15
|
+
e && (t || s(ce(e)));
|
|
16
|
+
}, [t, e]), r;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
18
|
+
const D = typeof window < "u" ? Q : X;
|
|
19
|
+
function Z(e) {
|
|
20
20
|
if (e !== void 0)
|
|
21
21
|
switch (typeof e) {
|
|
22
22
|
case "number":
|
|
@@ -28,686 +28,716 @@ function Q(e) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ue({
|
|
32
32
|
box: e,
|
|
33
33
|
defaultHeight: t,
|
|
34
|
-
defaultWidth:
|
|
35
|
-
disabled:
|
|
34
|
+
defaultWidth: r,
|
|
35
|
+
disabled: s,
|
|
36
36
|
element: o,
|
|
37
37
|
mode: i,
|
|
38
|
-
style:
|
|
38
|
+
style: l
|
|
39
39
|
}) {
|
|
40
|
-
const { styleHeight: c, styleWidth:
|
|
40
|
+
const { styleHeight: c, styleWidth: n } = A(
|
|
41
41
|
() => ({
|
|
42
|
-
styleHeight:
|
|
43
|
-
styleWidth:
|
|
42
|
+
styleHeight: Z(l?.height),
|
|
43
|
+
styleWidth: Z(l?.width)
|
|
44
44
|
}),
|
|
45
|
-
[
|
|
46
|
-
), [f,
|
|
45
|
+
[l?.height, l?.width]
|
|
46
|
+
), [f, g] = j({
|
|
47
47
|
height: t,
|
|
48
|
-
width:
|
|
49
|
-
}), I =
|
|
50
|
-
return
|
|
48
|
+
width: r
|
|
49
|
+
}), I = s || i === "only-height" && c !== void 0 || i === "only-width" && n !== void 0 || c !== void 0 && n !== void 0;
|
|
50
|
+
return D(() => {
|
|
51
51
|
if (o === null || I)
|
|
52
52
|
return;
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
const { contentRect: w, target: z } =
|
|
56
|
-
o === z &&
|
|
53
|
+
const x = new ResizeObserver((S) => {
|
|
54
|
+
for (const h of S) {
|
|
55
|
+
const { contentRect: w, target: z } = h;
|
|
56
|
+
o === z && g((v) => v.height === w.height && v.width === w.width ? v : {
|
|
57
57
|
height: w.height,
|
|
58
58
|
width: w.width
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
return
|
|
63
|
-
|
|
62
|
+
return x.observe(o, { box: e }), () => {
|
|
63
|
+
x?.unobserve(o);
|
|
64
64
|
};
|
|
65
|
-
}, [e, I, o, c,
|
|
65
|
+
}, [e, I, o, c, n]), A(
|
|
66
66
|
() => ({
|
|
67
67
|
height: c ?? f.height,
|
|
68
|
-
width:
|
|
68
|
+
width: n ?? f.width
|
|
69
69
|
}),
|
|
70
|
-
[f, c,
|
|
70
|
+
[f, c, n]
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const t =
|
|
73
|
+
function de(e) {
|
|
74
|
+
const t = Y(() => {
|
|
75
75
|
throw new Error("Cannot call an event handler while rendering.");
|
|
76
76
|
});
|
|
77
|
-
return
|
|
77
|
+
return D(() => {
|
|
78
78
|
t.current = e;
|
|
79
|
-
}, [e]), V((
|
|
79
|
+
}, [e]), V((r) => t.current?.(r), [t]);
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
84
|
-
const t = document.createElement("div"),
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
return o.width = "100px", o.height = "100px", t.appendChild(
|
|
81
|
+
let G = null;
|
|
82
|
+
function ae(e = !1) {
|
|
83
|
+
if (G === null || e) {
|
|
84
|
+
const t = document.createElement("div"), r = t.style;
|
|
85
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
86
|
+
const s = document.createElement("div"), o = s.style;
|
|
87
|
+
return o.width = "100px", o.height = "100px", t.appendChild(s), document.body.appendChild(t), t.scrollLeft > 0 ? G = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? G = "negative" : G = "positive-ascending"), document.body.removeChild(t), G;
|
|
88
88
|
}
|
|
89
|
-
return
|
|
89
|
+
return G;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function q({
|
|
92
92
|
containerElement: e,
|
|
93
93
|
direction: t,
|
|
94
|
-
isRtl:
|
|
95
|
-
scrollOffset:
|
|
94
|
+
isRtl: r,
|
|
95
|
+
scrollOffset: s
|
|
96
96
|
}) {
|
|
97
|
-
if (t === "horizontal" &&
|
|
98
|
-
switch (
|
|
97
|
+
if (t === "horizontal" && r)
|
|
98
|
+
switch (ae()) {
|
|
99
99
|
case "negative":
|
|
100
|
-
return -
|
|
100
|
+
return -s;
|
|
101
101
|
case "positive-descending": {
|
|
102
102
|
if (e) {
|
|
103
|
-
const { clientWidth: o, scrollLeft: i, scrollWidth:
|
|
104
|
-
return
|
|
103
|
+
const { clientWidth: o, scrollLeft: i, scrollWidth: l } = e;
|
|
104
|
+
return l - o - i;
|
|
105
105
|
}
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
return
|
|
109
|
+
return s;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function W(e, t = "Assertion error") {
|
|
112
112
|
if (!e)
|
|
113
113
|
throw console.error(t), Error(t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function re({
|
|
116
116
|
cachedBounds: e,
|
|
117
117
|
itemCount: t,
|
|
118
|
-
itemSize:
|
|
118
|
+
itemSize: r
|
|
119
119
|
}) {
|
|
120
120
|
if (t === 0)
|
|
121
121
|
return 0;
|
|
122
|
-
if (typeof
|
|
123
|
-
return t *
|
|
122
|
+
if (typeof r == "number")
|
|
123
|
+
return t * r;
|
|
124
124
|
{
|
|
125
|
-
const
|
|
125
|
+
const s = e.get(
|
|
126
126
|
e.size === 0 ? 0 : e.size - 1
|
|
127
127
|
);
|
|
128
|
-
|
|
129
|
-
const o = (
|
|
128
|
+
W(s !== void 0, "Unexpected bounds cache miss");
|
|
129
|
+
const o = (s.scrollOffset + s.size) / e.size;
|
|
130
130
|
return t * o;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function he({
|
|
134
134
|
align: e,
|
|
135
135
|
cachedBounds: t,
|
|
136
|
-
index:
|
|
137
|
-
itemCount:
|
|
136
|
+
index: r,
|
|
137
|
+
itemCount: s,
|
|
138
138
|
itemSize: o,
|
|
139
139
|
containerScrollOffset: i,
|
|
140
|
-
containerSize:
|
|
140
|
+
containerSize: l
|
|
141
141
|
}) {
|
|
142
|
-
const c =
|
|
142
|
+
const c = re({
|
|
143
143
|
cachedBounds: t,
|
|
144
|
-
itemCount:
|
|
144
|
+
itemCount: s,
|
|
145
145
|
itemSize: o
|
|
146
|
-
}),
|
|
146
|
+
}), n = t.get(r), f = Math.max(
|
|
147
147
|
0,
|
|
148
|
-
Math.min(c -
|
|
149
|
-
),
|
|
148
|
+
Math.min(c - l, n.scrollOffset)
|
|
149
|
+
), g = Math.max(
|
|
150
150
|
0,
|
|
151
|
-
|
|
151
|
+
n.scrollOffset - l + n.size
|
|
152
152
|
);
|
|
153
|
-
switch (e === "smart" && (i >=
|
|
153
|
+
switch (e === "smart" && (i >= g && i <= f ? e = "auto" : e = "center"), e) {
|
|
154
154
|
case "start":
|
|
155
155
|
return f;
|
|
156
156
|
case "end":
|
|
157
|
-
return
|
|
157
|
+
return g;
|
|
158
158
|
case "center":
|
|
159
|
-
return
|
|
159
|
+
return n.scrollOffset <= l / 2 ? 0 : n.scrollOffset + n.size / 2 >= c - l / 2 ? c - l : n.scrollOffset + n.size / 2 - l / 2;
|
|
160
160
|
case "auto":
|
|
161
161
|
default:
|
|
162
|
-
return i >=
|
|
162
|
+
return i >= g && i <= f ? i : i < g ? g : f;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function _({
|
|
166
166
|
cachedBounds: e,
|
|
167
167
|
containerScrollOffset: t,
|
|
168
|
-
containerSize:
|
|
169
|
-
itemCount:
|
|
168
|
+
containerSize: r,
|
|
169
|
+
itemCount: s,
|
|
170
170
|
overscanCount: o
|
|
171
171
|
}) {
|
|
172
|
-
const i =
|
|
173
|
-
let
|
|
174
|
-
for (;
|
|
175
|
-
const f = e.get(
|
|
172
|
+
const i = s - 1;
|
|
173
|
+
let l = 0, c = -1, n = 0;
|
|
174
|
+
for (; n < i; ) {
|
|
175
|
+
const f = e.get(n);
|
|
176
176
|
if (f.scrollOffset + f.size > t)
|
|
177
177
|
break;
|
|
178
|
-
|
|
178
|
+
n++;
|
|
179
179
|
}
|
|
180
|
-
for (
|
|
181
|
-
const f = e.get(
|
|
182
|
-
if (f.scrollOffset + f.size >= t +
|
|
180
|
+
for (l = n, l = Math.max(0, l - o); n < i; ) {
|
|
181
|
+
const f = e.get(n);
|
|
182
|
+
if (f.scrollOffset + f.size >= t + r)
|
|
183
183
|
break;
|
|
184
|
-
|
|
184
|
+
n++;
|
|
185
185
|
}
|
|
186
|
-
return c = Math.min(i,
|
|
186
|
+
return c = Math.min(i, n), c = Math.min(s - 1, c + o), l < 0 ? [0, -1] : [l, c];
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function pe({
|
|
189
189
|
itemCount: e,
|
|
190
190
|
itemProps: t,
|
|
191
|
-
itemSize:
|
|
191
|
+
itemSize: r
|
|
192
192
|
}) {
|
|
193
|
-
const
|
|
193
|
+
const s = /* @__PURE__ */ new Map();
|
|
194
194
|
return {
|
|
195
195
|
get(o) {
|
|
196
|
-
for (
|
|
197
|
-
const
|
|
196
|
+
for (W(o < e, `Invalid index ${o}`); s.size - 1 < o; ) {
|
|
197
|
+
const l = s.size;
|
|
198
198
|
let c;
|
|
199
|
-
switch (typeof
|
|
199
|
+
switch (typeof r) {
|
|
200
200
|
case "function": {
|
|
201
|
-
c =
|
|
201
|
+
c = r(l, t);
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
case "number": {
|
|
205
|
-
c =
|
|
205
|
+
c = r;
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
if (
|
|
210
|
-
|
|
209
|
+
if (l === 0)
|
|
210
|
+
s.set(l, {
|
|
211
211
|
size: c,
|
|
212
212
|
scrollOffset: 0
|
|
213
213
|
});
|
|
214
214
|
else {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
const n = s.get(l - 1);
|
|
216
|
+
W(
|
|
217
|
+
n !== void 0,
|
|
218
218
|
`Unexpected bounds cache miss for index ${o}`
|
|
219
|
-
),
|
|
220
|
-
scrollOffset:
|
|
219
|
+
), s.set(l, {
|
|
220
|
+
scrollOffset: n.scrollOffset + n.size,
|
|
221
221
|
size: c
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
const i =
|
|
226
|
-
return
|
|
225
|
+
const i = s.get(o);
|
|
226
|
+
return W(
|
|
227
227
|
i !== void 0,
|
|
228
228
|
`Unexpected bounds cache miss for index ${o}`
|
|
229
229
|
), i;
|
|
230
230
|
},
|
|
231
231
|
set(o, i) {
|
|
232
|
-
|
|
232
|
+
s.set(o, i);
|
|
233
233
|
},
|
|
234
234
|
get size() {
|
|
235
|
-
return
|
|
235
|
+
return s.size;
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function ge({
|
|
240
240
|
itemCount: e,
|
|
241
241
|
itemProps: t,
|
|
242
|
-
itemSize:
|
|
242
|
+
itemSize: r
|
|
243
243
|
}) {
|
|
244
|
-
return
|
|
245
|
-
() =>
|
|
244
|
+
return A(
|
|
245
|
+
() => pe({
|
|
246
246
|
itemCount: e,
|
|
247
247
|
itemProps: t,
|
|
248
|
-
itemSize:
|
|
248
|
+
itemSize: r
|
|
249
249
|
}),
|
|
250
|
-
[e, t,
|
|
250
|
+
[e, t, r]
|
|
251
251
|
);
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function xe({
|
|
254
254
|
containerSize: e,
|
|
255
255
|
itemSize: t
|
|
256
256
|
}) {
|
|
257
|
-
let
|
|
257
|
+
let r;
|
|
258
258
|
switch (typeof t) {
|
|
259
259
|
case "string": {
|
|
260
|
-
|
|
260
|
+
W(
|
|
261
261
|
t.endsWith("%"),
|
|
262
262
|
`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
|
|
263
|
-
),
|
|
263
|
+
), W(
|
|
264
264
|
e !== void 0,
|
|
265
265
|
"Container size must be defined if a percentage item size is specified"
|
|
266
|
-
),
|
|
266
|
+
), r = e * parseInt(t) / 100;
|
|
267
267
|
break;
|
|
268
268
|
}
|
|
269
269
|
default: {
|
|
270
|
-
|
|
270
|
+
r = t;
|
|
271
271
|
break;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
return
|
|
274
|
+
return r;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function K({
|
|
277
277
|
containerElement: e,
|
|
278
278
|
containerStyle: t,
|
|
279
|
-
defaultContainerSize:
|
|
280
|
-
direction:
|
|
279
|
+
defaultContainerSize: r = 0,
|
|
280
|
+
direction: s,
|
|
281
281
|
isRtl: o = !1,
|
|
282
282
|
itemCount: i,
|
|
283
|
-
itemProps:
|
|
283
|
+
itemProps: l,
|
|
284
284
|
itemSize: c,
|
|
285
|
-
onResize:
|
|
285
|
+
onResize: n,
|
|
286
286
|
overscanCount: f
|
|
287
287
|
}) {
|
|
288
|
-
const [
|
|
289
|
-
Math.min(i - 1,
|
|
290
|
-
Math.min(i - 1,
|
|
291
|
-
], { height:
|
|
292
|
-
defaultHeight:
|
|
293
|
-
defaultWidth:
|
|
288
|
+
const [g, I] = j([0, -1]), [x, S] = [
|
|
289
|
+
Math.min(i - 1, g[0]),
|
|
290
|
+
Math.min(i - 1, g[1])
|
|
291
|
+
], { height: h = r, width: w = r } = ue({
|
|
292
|
+
defaultHeight: s === "vertical" ? r : void 0,
|
|
293
|
+
defaultWidth: s === "horizontal" ? r : void 0,
|
|
294
294
|
element: e,
|
|
295
|
-
mode:
|
|
295
|
+
mode: s === "vertical" ? "only-height" : "only-width",
|
|
296
296
|
style: t
|
|
297
|
-
}), z =
|
|
297
|
+
}), z = Y({
|
|
298
298
|
height: 0,
|
|
299
299
|
width: 0
|
|
300
|
-
}),
|
|
301
|
-
|
|
302
|
-
if (typeof
|
|
303
|
-
const
|
|
304
|
-
(
|
|
300
|
+
}), v = s === "vertical" ? h : w, d = xe({ containerSize: v, itemSize: c });
|
|
301
|
+
Q(() => {
|
|
302
|
+
if (typeof n == "function") {
|
|
303
|
+
const u = z.current;
|
|
304
|
+
(u.height !== h || u.width !== w) && (n({ height: h, width: w }, { ...u }), u.height = h, u.width = w);
|
|
305
305
|
}
|
|
306
|
-
}, [
|
|
307
|
-
const
|
|
306
|
+
}, [h, n, w]);
|
|
307
|
+
const a = ge({
|
|
308
308
|
itemCount: i,
|
|
309
|
-
itemProps:
|
|
310
|
-
itemSize:
|
|
309
|
+
itemProps: l,
|
|
310
|
+
itemSize: d
|
|
311
311
|
}), y = V(
|
|
312
|
-
(
|
|
313
|
-
[
|
|
312
|
+
(u) => a.get(u),
|
|
313
|
+
[a]
|
|
314
314
|
), B = V(
|
|
315
|
-
() =>
|
|
316
|
-
cachedBounds:
|
|
315
|
+
() => re({
|
|
316
|
+
cachedBounds: a,
|
|
317
317
|
itemCount: i,
|
|
318
|
-
itemSize:
|
|
318
|
+
itemSize: d
|
|
319
319
|
}),
|
|
320
|
-
[
|
|
320
|
+
[a, i, d]
|
|
321
321
|
), T = V(
|
|
322
|
-
(
|
|
323
|
-
const m =
|
|
322
|
+
(u) => {
|
|
323
|
+
const m = q({
|
|
324
324
|
containerElement: e,
|
|
325
|
-
direction:
|
|
325
|
+
direction: s,
|
|
326
326
|
isRtl: o,
|
|
327
|
-
scrollOffset:
|
|
327
|
+
scrollOffset: u
|
|
328
328
|
});
|
|
329
|
-
return
|
|
330
|
-
cachedBounds:
|
|
329
|
+
return _({
|
|
330
|
+
cachedBounds: a,
|
|
331
331
|
containerScrollOffset: m,
|
|
332
|
-
containerSize:
|
|
332
|
+
containerSize: v,
|
|
333
333
|
itemCount: i,
|
|
334
334
|
overscanCount: f
|
|
335
335
|
});
|
|
336
336
|
},
|
|
337
337
|
[
|
|
338
|
-
|
|
338
|
+
a,
|
|
339
339
|
e,
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
v,
|
|
341
|
+
s,
|
|
342
342
|
o,
|
|
343
343
|
i,
|
|
344
344
|
f
|
|
345
345
|
]
|
|
346
346
|
);
|
|
347
|
-
|
|
348
|
-
const
|
|
349
|
-
I(T(
|
|
350
|
-
}, [e,
|
|
347
|
+
D(() => {
|
|
348
|
+
const u = (s === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
349
|
+
I(T(u));
|
|
350
|
+
}, [e, s, T]), D(() => {
|
|
351
351
|
if (!e)
|
|
352
352
|
return;
|
|
353
|
-
const
|
|
353
|
+
const u = () => {
|
|
354
354
|
I((m) => {
|
|
355
|
-
const { scrollLeft: H, scrollTop:
|
|
355
|
+
const { scrollLeft: H, scrollTop: k } = e, O = q({
|
|
356
356
|
containerElement: e,
|
|
357
|
-
direction:
|
|
357
|
+
direction: s,
|
|
358
358
|
isRtl: o,
|
|
359
|
-
scrollOffset:
|
|
360
|
-
}),
|
|
361
|
-
cachedBounds:
|
|
362
|
-
containerScrollOffset:
|
|
363
|
-
containerSize:
|
|
359
|
+
scrollOffset: s === "vertical" ? k : H
|
|
360
|
+
}), $ = _({
|
|
361
|
+
cachedBounds: a,
|
|
362
|
+
containerScrollOffset: O,
|
|
363
|
+
containerSize: v,
|
|
364
364
|
itemCount: i,
|
|
365
365
|
overscanCount: f
|
|
366
366
|
});
|
|
367
|
-
return
|
|
367
|
+
return $[0] === m[0] && $[1] === m[1] ? m : $;
|
|
368
368
|
});
|
|
369
369
|
};
|
|
370
|
-
return e.addEventListener("scroll",
|
|
371
|
-
e.removeEventListener("scroll",
|
|
370
|
+
return e.addEventListener("scroll", u), () => {
|
|
371
|
+
e.removeEventListener("scroll", u);
|
|
372
372
|
};
|
|
373
373
|
}, [
|
|
374
|
-
|
|
374
|
+
a,
|
|
375
375
|
e,
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
v,
|
|
377
|
+
s,
|
|
378
378
|
i,
|
|
379
379
|
f
|
|
380
380
|
]);
|
|
381
|
-
const p =
|
|
381
|
+
const p = de(
|
|
382
382
|
({
|
|
383
|
-
align:
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
index: G
|
|
383
|
+
align: u = "auto",
|
|
384
|
+
containerScrollOffset: m,
|
|
385
|
+
index: H
|
|
387
386
|
}) => {
|
|
388
|
-
let
|
|
389
|
-
align:
|
|
390
|
-
cachedBounds:
|
|
391
|
-
containerScrollOffset:
|
|
392
|
-
containerSize:
|
|
393
|
-
index:
|
|
387
|
+
let k = he({
|
|
388
|
+
align: u,
|
|
389
|
+
cachedBounds: a,
|
|
390
|
+
containerScrollOffset: m,
|
|
391
|
+
containerSize: v,
|
|
392
|
+
index: H,
|
|
394
393
|
itemCount: i,
|
|
395
|
-
itemSize:
|
|
394
|
+
itemSize: d
|
|
396
395
|
});
|
|
397
|
-
if (e)
|
|
398
|
-
if (
|
|
396
|
+
if (e) {
|
|
397
|
+
if (k = q({
|
|
399
398
|
containerElement: e,
|
|
400
|
-
direction:
|
|
399
|
+
direction: s,
|
|
401
400
|
isRtl: o,
|
|
402
|
-
scrollOffset:
|
|
403
|
-
}), typeof e.scrollTo
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
behavior: m || void 0
|
|
407
|
-
}) : e.scrollTo({
|
|
408
|
-
behavior: m || void 0,
|
|
409
|
-
top: b
|
|
410
|
-
});
|
|
411
|
-
else {
|
|
412
|
-
const O = T(b);
|
|
413
|
-
(O[0] !== v || O[1] !== k) && I(O);
|
|
401
|
+
scrollOffset: k
|
|
402
|
+
}), typeof e.scrollTo != "function") {
|
|
403
|
+
const O = T(k);
|
|
404
|
+
(O[0] !== x || O[1] !== S) && I(O);
|
|
414
405
|
}
|
|
406
|
+
return k;
|
|
407
|
+
}
|
|
415
408
|
}
|
|
416
409
|
);
|
|
417
410
|
return {
|
|
418
411
|
getCellBounds: y,
|
|
419
412
|
getEstimatedSize: B,
|
|
420
413
|
scrollToIndex: p,
|
|
421
|
-
startIndex:
|
|
422
|
-
stopIndex:
|
|
414
|
+
startIndex: x,
|
|
415
|
+
stopIndex: S
|
|
423
416
|
};
|
|
424
417
|
}
|
|
425
|
-
function
|
|
426
|
-
return
|
|
418
|
+
function oe(e) {
|
|
419
|
+
return A(() => e, Object.values(e));
|
|
427
420
|
}
|
|
428
|
-
function
|
|
421
|
+
function N(e, t) {
|
|
429
422
|
if (e === t)
|
|
430
423
|
return !0;
|
|
431
|
-
if (!!e != !!t || (
|
|
424
|
+
if (!!e != !!t || (W(e !== void 0), W(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
|
|
432
425
|
return !1;
|
|
433
|
-
for (const
|
|
434
|
-
if (!Object.is(t[
|
|
426
|
+
for (const r in e)
|
|
427
|
+
if (!Object.is(t[r], e[r]))
|
|
435
428
|
return !1;
|
|
436
429
|
return !0;
|
|
437
430
|
}
|
|
438
|
-
function
|
|
439
|
-
const {
|
|
440
|
-
|
|
431
|
+
function ie(e, t) {
|
|
432
|
+
const {
|
|
433
|
+
ariaAttributes: r,
|
|
434
|
+
style: s,
|
|
435
|
+
...o
|
|
436
|
+
} = e, {
|
|
437
|
+
ariaAttributes: i,
|
|
438
|
+
style: l,
|
|
439
|
+
...c
|
|
440
|
+
} = t;
|
|
441
|
+
return N(r, i) && N(s, l) && N(o, c);
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
+
function we({
|
|
443
444
|
cellComponent: e,
|
|
444
445
|
cellProps: t,
|
|
445
|
-
className:
|
|
446
|
-
columnCount:
|
|
446
|
+
className: r,
|
|
447
|
+
columnCount: s,
|
|
447
448
|
columnWidth: o,
|
|
448
449
|
defaultHeight: i = 0,
|
|
449
|
-
defaultWidth:
|
|
450
|
+
defaultWidth: l = 0,
|
|
450
451
|
dir: c,
|
|
451
|
-
gridRef:
|
|
452
|
+
gridRef: n,
|
|
452
453
|
onCellsRendered: f,
|
|
453
|
-
onResize:
|
|
454
|
+
onResize: g,
|
|
454
455
|
overscanCount: I = 3,
|
|
455
|
-
rowCount:
|
|
456
|
-
rowHeight:
|
|
457
|
-
style:
|
|
456
|
+
rowCount: x,
|
|
457
|
+
rowHeight: S,
|
|
458
|
+
style: h,
|
|
458
459
|
...w
|
|
459
460
|
}) {
|
|
460
|
-
const z =
|
|
461
|
-
() =>
|
|
461
|
+
const z = oe(t), v = A(
|
|
462
|
+
() => ee(e, ie),
|
|
462
463
|
[e]
|
|
463
|
-
), [
|
|
464
|
+
), [d, a] = j(null), y = fe(d, c), {
|
|
464
465
|
getCellBounds: B,
|
|
465
466
|
getEstimatedSize: T,
|
|
466
467
|
startIndex: p,
|
|
467
|
-
scrollToIndex:
|
|
468
|
+
scrollToIndex: u,
|
|
468
469
|
stopIndex: m
|
|
469
|
-
} =
|
|
470
|
-
containerElement:
|
|
471
|
-
defaultContainerSize:
|
|
470
|
+
} = K({
|
|
471
|
+
containerElement: d,
|
|
472
|
+
defaultContainerSize: l,
|
|
472
473
|
direction: "horizontal",
|
|
473
474
|
isRtl: y,
|
|
474
|
-
itemCount:
|
|
475
|
+
itemCount: s,
|
|
475
476
|
itemProps: z,
|
|
476
477
|
itemSize: o,
|
|
477
|
-
onResize:
|
|
478
|
+
onResize: g,
|
|
478
479
|
overscanCount: I
|
|
479
480
|
}), {
|
|
480
481
|
getCellBounds: H,
|
|
481
|
-
getEstimatedSize:
|
|
482
|
-
startIndex:
|
|
483
|
-
scrollToIndex:
|
|
482
|
+
getEstimatedSize: k,
|
|
483
|
+
startIndex: O,
|
|
484
|
+
scrollToIndex: $,
|
|
484
485
|
stopIndex: F
|
|
485
|
-
} =
|
|
486
|
-
containerElement:
|
|
486
|
+
} = K({
|
|
487
|
+
containerElement: d,
|
|
487
488
|
defaultContainerSize: i,
|
|
488
489
|
direction: "vertical",
|
|
489
|
-
itemCount:
|
|
490
|
+
itemCount: x,
|
|
490
491
|
itemProps: z,
|
|
491
|
-
itemSize:
|
|
492
|
-
onResize:
|
|
492
|
+
itemSize: S,
|
|
493
|
+
onResize: g,
|
|
493
494
|
overscanCount: I
|
|
494
495
|
});
|
|
495
|
-
|
|
496
|
-
|
|
496
|
+
te(
|
|
497
|
+
n,
|
|
497
498
|
() => ({
|
|
498
499
|
get element() {
|
|
499
|
-
return
|
|
500
|
+
return d;
|
|
500
501
|
},
|
|
501
502
|
scrollToCell({
|
|
502
503
|
behavior: L = "auto",
|
|
503
|
-
columnAlign:
|
|
504
|
-
columnIndex:
|
|
505
|
-
rowAlign:
|
|
506
|
-
rowIndex:
|
|
504
|
+
columnAlign: b = "auto",
|
|
505
|
+
columnIndex: E,
|
|
506
|
+
rowAlign: M = "auto",
|
|
507
|
+
rowIndex: R
|
|
507
508
|
}) {
|
|
508
|
-
|
|
509
|
-
align:
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
509
|
+
const U = u({
|
|
510
|
+
align: b,
|
|
511
|
+
containerScrollOffset: d?.scrollLeft ?? 0,
|
|
512
|
+
index: E
|
|
513
|
+
}), le = $({
|
|
514
|
+
align: M,
|
|
515
|
+
containerScrollOffset: d?.scrollTop ?? 0,
|
|
516
|
+
index: R
|
|
517
|
+
});
|
|
518
|
+
typeof d?.scrollTo == "function" && d.scrollTo({
|
|
515
519
|
behavior: L,
|
|
516
|
-
|
|
517
|
-
|
|
520
|
+
left: U,
|
|
521
|
+
top: le
|
|
518
522
|
});
|
|
519
523
|
},
|
|
520
524
|
scrollToColumn({
|
|
521
525
|
align: L = "auto",
|
|
522
|
-
behavior:
|
|
523
|
-
index:
|
|
526
|
+
behavior: b = "auto",
|
|
527
|
+
index: E
|
|
524
528
|
}) {
|
|
525
|
-
|
|
529
|
+
const M = u({
|
|
526
530
|
align: L,
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
531
|
+
containerScrollOffset: d?.scrollLeft ?? 0,
|
|
532
|
+
index: E
|
|
533
|
+
});
|
|
534
|
+
typeof d?.scrollTo == "function" && d.scrollTo({
|
|
535
|
+
behavior: b,
|
|
536
|
+
left: M
|
|
530
537
|
});
|
|
531
538
|
},
|
|
532
539
|
scrollToRow({
|
|
533
540
|
align: L = "auto",
|
|
534
|
-
behavior:
|
|
535
|
-
index:
|
|
541
|
+
behavior: b = "auto",
|
|
542
|
+
index: E
|
|
536
543
|
}) {
|
|
537
|
-
|
|
544
|
+
const M = $({
|
|
538
545
|
align: L,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
546
|
+
containerScrollOffset: d?.scrollTop ?? 0,
|
|
547
|
+
index: E
|
|
548
|
+
});
|
|
549
|
+
typeof d?.scrollTo == "function" && d.scrollTo({
|
|
550
|
+
behavior: b,
|
|
551
|
+
top: M
|
|
542
552
|
});
|
|
543
553
|
}
|
|
544
554
|
}),
|
|
545
|
-
[
|
|
546
|
-
),
|
|
547
|
-
p >= 0 && m >= 0 &&
|
|
555
|
+
[d, u, $]
|
|
556
|
+
), X(() => {
|
|
557
|
+
p >= 0 && m >= 0 && O >= 0 && F >= 0 && f && f({
|
|
548
558
|
columnStartIndex: p,
|
|
549
559
|
columnStopIndex: m,
|
|
550
|
-
rowStartIndex:
|
|
560
|
+
rowStartIndex: O,
|
|
551
561
|
rowStopIndex: F
|
|
552
562
|
});
|
|
553
563
|
}, [
|
|
554
564
|
f,
|
|
555
565
|
p,
|
|
556
566
|
m,
|
|
557
|
-
|
|
567
|
+
O,
|
|
558
568
|
F
|
|
559
569
|
]);
|
|
560
|
-
const
|
|
570
|
+
const ne = A(() => {
|
|
561
571
|
const L = [];
|
|
562
|
-
if (
|
|
563
|
-
for (let
|
|
564
|
-
const
|
|
565
|
-
for (let
|
|
566
|
-
const U = B(
|
|
567
|
-
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
572
|
+
if (s > 0 && x > 0)
|
|
573
|
+
for (let b = O; b <= F; b++) {
|
|
574
|
+
const E = H(b), M = [];
|
|
575
|
+
for (let R = p; R <= m; R++) {
|
|
576
|
+
const U = B(R);
|
|
577
|
+
M.push(
|
|
578
|
+
/* @__PURE__ */ se(
|
|
579
|
+
v,
|
|
570
580
|
{
|
|
571
581
|
...z,
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
582
|
+
ariaAttributes: {
|
|
583
|
+
"aria-colindex": R + 1,
|
|
584
|
+
role: "gridcell"
|
|
585
|
+
},
|
|
586
|
+
columnIndex: R,
|
|
587
|
+
key: R,
|
|
588
|
+
rowIndex: b,
|
|
575
589
|
style: {
|
|
576
590
|
position: "absolute",
|
|
577
591
|
left: y ? void 0 : 0,
|
|
578
592
|
right: y ? 0 : void 0,
|
|
579
|
-
transform: `translate(${y ? -U.scrollOffset : U.scrollOffset}px, ${
|
|
580
|
-
height:
|
|
593
|
+
transform: `translate(${y ? -U.scrollOffset : U.scrollOffset}px, ${E.scrollOffset}px)`,
|
|
594
|
+
height: x > 1 ? E.size : "100%",
|
|
581
595
|
width: U.size
|
|
582
596
|
}
|
|
583
597
|
}
|
|
584
598
|
)
|
|
585
599
|
);
|
|
586
600
|
}
|
|
601
|
+
L.push(
|
|
602
|
+
/* @__PURE__ */ J("div", { role: "row", "aria-rowindex": b + 1, children: M }, b)
|
|
603
|
+
);
|
|
587
604
|
}
|
|
588
605
|
return L;
|
|
589
606
|
}, [
|
|
590
|
-
|
|
607
|
+
v,
|
|
591
608
|
z,
|
|
592
|
-
|
|
609
|
+
s,
|
|
593
610
|
p,
|
|
594
611
|
m,
|
|
595
612
|
B,
|
|
596
613
|
H,
|
|
597
614
|
y,
|
|
598
|
-
|
|
599
|
-
|
|
615
|
+
x,
|
|
616
|
+
O,
|
|
600
617
|
F
|
|
601
618
|
]);
|
|
602
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ C(
|
|
603
620
|
"div",
|
|
604
621
|
{
|
|
622
|
+
"aria-colcount": s,
|
|
623
|
+
"aria-rowcount": x,
|
|
605
624
|
role: "grid",
|
|
606
625
|
...w,
|
|
607
|
-
className:
|
|
626
|
+
className: r,
|
|
608
627
|
dir: c,
|
|
609
|
-
ref:
|
|
628
|
+
ref: a,
|
|
610
629
|
style: {
|
|
630
|
+
position: "relative",
|
|
611
631
|
width: "100%",
|
|
612
632
|
height: "100%",
|
|
613
|
-
...x,
|
|
614
633
|
maxHeight: "100%",
|
|
615
634
|
maxWidth: "100%",
|
|
616
635
|
flexGrow: 1,
|
|
617
|
-
overflow: "auto"
|
|
636
|
+
overflow: "auto",
|
|
637
|
+
...h
|
|
618
638
|
},
|
|
619
|
-
children:
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
639
|
+
children: [
|
|
640
|
+
ne,
|
|
641
|
+
/* @__PURE__ */ J(
|
|
642
|
+
"div",
|
|
643
|
+
{
|
|
644
|
+
"aria-hidden": !0,
|
|
645
|
+
style: {
|
|
646
|
+
height: k(),
|
|
647
|
+
width: T(),
|
|
648
|
+
zIndex: -1
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
)
|
|
652
|
+
]
|
|
631
653
|
}
|
|
632
654
|
);
|
|
633
655
|
}
|
|
634
|
-
const
|
|
635
|
-
function
|
|
656
|
+
const ye = j, be = Y;
|
|
657
|
+
function Ie({
|
|
636
658
|
className: e,
|
|
637
659
|
defaultHeight: t = 0,
|
|
638
|
-
listRef:
|
|
639
|
-
onResize:
|
|
660
|
+
listRef: r,
|
|
661
|
+
onResize: s,
|
|
640
662
|
onRowsRendered: o,
|
|
641
663
|
overscanCount: i = 3,
|
|
642
|
-
rowComponent:
|
|
664
|
+
rowComponent: l,
|
|
643
665
|
rowCount: c,
|
|
644
|
-
rowHeight:
|
|
666
|
+
rowHeight: n,
|
|
645
667
|
rowProps: f,
|
|
646
|
-
style:
|
|
668
|
+
style: g,
|
|
647
669
|
...I
|
|
648
670
|
}) {
|
|
649
|
-
const
|
|
650
|
-
() =>
|
|
651
|
-
[
|
|
652
|
-
), [
|
|
671
|
+
const x = oe(f), S = A(
|
|
672
|
+
() => ee(l, ie),
|
|
673
|
+
[l]
|
|
674
|
+
), [h, w] = j(null), {
|
|
653
675
|
getCellBounds: z,
|
|
654
|
-
getEstimatedSize:
|
|
655
|
-
scrollToIndex:
|
|
656
|
-
startIndex:
|
|
676
|
+
getEstimatedSize: v,
|
|
677
|
+
scrollToIndex: d,
|
|
678
|
+
startIndex: a,
|
|
657
679
|
stopIndex: y
|
|
658
|
-
} =
|
|
659
|
-
containerElement:
|
|
680
|
+
} = K({
|
|
681
|
+
containerElement: h,
|
|
660
682
|
defaultContainerSize: t,
|
|
661
683
|
direction: "vertical",
|
|
662
684
|
itemCount: c,
|
|
663
|
-
itemProps:
|
|
664
|
-
itemSize:
|
|
665
|
-
onResize:
|
|
685
|
+
itemProps: x,
|
|
686
|
+
itemSize: n,
|
|
687
|
+
onResize: s,
|
|
666
688
|
overscanCount: i
|
|
667
689
|
});
|
|
668
|
-
|
|
669
|
-
|
|
690
|
+
te(
|
|
691
|
+
r,
|
|
670
692
|
() => ({
|
|
671
693
|
get element() {
|
|
672
|
-
return
|
|
694
|
+
return h;
|
|
673
695
|
},
|
|
674
696
|
scrollToRow({
|
|
675
697
|
align: T = "auto",
|
|
676
698
|
behavior: p = "auto",
|
|
677
|
-
index:
|
|
699
|
+
index: u
|
|
678
700
|
}) {
|
|
679
|
-
|
|
701
|
+
const m = d({
|
|
680
702
|
align: T,
|
|
703
|
+
containerScrollOffset: h?.scrollTop ?? 0,
|
|
704
|
+
index: u
|
|
705
|
+
});
|
|
706
|
+
typeof h?.scrollTo == "function" && h.scrollTo({
|
|
681
707
|
behavior: p,
|
|
682
|
-
|
|
683
|
-
index: d
|
|
708
|
+
top: m
|
|
684
709
|
});
|
|
685
710
|
}
|
|
686
711
|
}),
|
|
687
|
-
[
|
|
688
|
-
),
|
|
689
|
-
|
|
690
|
-
startIndex:
|
|
712
|
+
[h, d]
|
|
713
|
+
), X(() => {
|
|
714
|
+
a >= 0 && y >= 0 && o && o({
|
|
715
|
+
startIndex: a,
|
|
691
716
|
stopIndex: y
|
|
692
717
|
});
|
|
693
|
-
}, [o,
|
|
694
|
-
const B =
|
|
718
|
+
}, [o, a, y]);
|
|
719
|
+
const B = A(() => {
|
|
695
720
|
const T = [];
|
|
696
721
|
if (c > 0)
|
|
697
|
-
for (let p =
|
|
698
|
-
const
|
|
722
|
+
for (let p = a; p <= y; p++) {
|
|
723
|
+
const u = z(p);
|
|
699
724
|
T.push(
|
|
700
|
-
/* @__PURE__ */
|
|
701
|
-
|
|
725
|
+
/* @__PURE__ */ se(
|
|
726
|
+
S,
|
|
702
727
|
{
|
|
703
|
-
...
|
|
728
|
+
...x,
|
|
729
|
+
ariaAttributes: {
|
|
730
|
+
"aria-posinset": p + 1,
|
|
731
|
+
"aria-setsize": c,
|
|
732
|
+
role: "listitem"
|
|
733
|
+
},
|
|
704
734
|
key: p,
|
|
705
735
|
index: p,
|
|
706
736
|
style: {
|
|
707
737
|
position: "absolute",
|
|
708
738
|
left: 0,
|
|
709
|
-
transform: `translateY(${
|
|
710
|
-
height:
|
|
739
|
+
transform: `translateY(${u.scrollOffset}px)`,
|
|
740
|
+
height: u.size,
|
|
711
741
|
width: "100%"
|
|
712
742
|
}
|
|
713
743
|
}
|
|
@@ -715,8 +745,8 @@ function me({
|
|
|
715
745
|
);
|
|
716
746
|
}
|
|
717
747
|
return T;
|
|
718
|
-
}, [
|
|
719
|
-
return /* @__PURE__ */
|
|
748
|
+
}, [S, z, c, x, a, y]);
|
|
749
|
+
return /* @__PURE__ */ C(
|
|
720
750
|
"div",
|
|
721
751
|
{
|
|
722
752
|
role: "list",
|
|
@@ -724,42 +754,45 @@ function me({
|
|
|
724
754
|
className: e,
|
|
725
755
|
ref: w,
|
|
726
756
|
style: {
|
|
727
|
-
|
|
757
|
+
position: "relative",
|
|
728
758
|
maxHeight: "100%",
|
|
729
759
|
flexGrow: 1,
|
|
730
|
-
overflowY: "auto"
|
|
760
|
+
overflowY: "auto",
|
|
761
|
+
...g
|
|
731
762
|
},
|
|
732
|
-
children:
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
763
|
+
children: [
|
|
764
|
+
B,
|
|
765
|
+
/* @__PURE__ */ J(
|
|
766
|
+
"div",
|
|
767
|
+
{
|
|
768
|
+
"aria-hidden": !0,
|
|
769
|
+
style: {
|
|
770
|
+
height: v(),
|
|
771
|
+
width: "100%",
|
|
772
|
+
zIndex: -1
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
)
|
|
776
|
+
]
|
|
744
777
|
}
|
|
745
778
|
);
|
|
746
779
|
}
|
|
747
|
-
const
|
|
780
|
+
const ze = j, Oe = Y;
|
|
748
781
|
let P = -1;
|
|
749
|
-
function
|
|
782
|
+
function Te(e = !1) {
|
|
750
783
|
if (P === -1 || e) {
|
|
751
|
-
const t = document.createElement("div"),
|
|
752
|
-
|
|
784
|
+
const t = document.createElement("div"), r = t.style;
|
|
785
|
+
r.width = "50px", r.height = "50px", r.overflow = "scroll", document.body.appendChild(t), P = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
753
786
|
}
|
|
754
787
|
return P;
|
|
755
788
|
}
|
|
756
789
|
export {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
790
|
+
we as Grid,
|
|
791
|
+
Ie as List,
|
|
792
|
+
Te as getScrollbarSize,
|
|
793
|
+
ye as useGridCallbackRef,
|
|
794
|
+
be as useGridRef,
|
|
795
|
+
ze as useListCallbackRef,
|
|
796
|
+
Oe as useListRef
|
|
764
797
|
};
|
|
765
798
|
//# sourceMappingURL=react-window.js.map
|