react-window 2.1.1 → 2.2.0-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/dist/react-window.cjs +1 -1
- package/dist/react-window.cjs.map +1 -1
- package/dist/react-window.d.ts +18 -2
- package/dist/react-window.js +538 -446
- package/dist/react-window.js.map +1 -1
- package/package.json +3 -4
- package/docs/assets/AriaRolesRoute-B8u4KZlN.js +0 -2
- package/docs/assets/AriaRolesRoute-B8u4KZlN.js.map +0 -1
- package/docs/assets/AriaRolesRoute-DrA2Z2g2.js +0 -2
- package/docs/assets/AriaRolesRoute-DrA2Z2g2.js.map +0 -1
- package/docs/assets/AriaRolesRoute-YProrOKU.js +0 -2
- package/docs/assets/AriaRolesRoute-YProrOKU.js.map +0 -1
- package/docs/assets/CellComponent.example-ChzwGLAD.js +0 -2
- package/docs/assets/CellComponent.example-ChzwGLAD.js.map +0 -1
- package/docs/assets/Code-BJ6U_DpT.js +0 -2
- package/docs/assets/Code-BJ6U_DpT.js.map +0 -1
- package/docs/assets/Code-nwWF-WcI.css +0 -1
- package/docs/assets/ComponentProps-0JkeHmLq.js +0 -2
- package/docs/assets/ComponentProps-0JkeHmLq.js.map +0 -1
- package/docs/assets/ContinueLink-Mq4XOwMu.js +0 -2
- package/docs/assets/ContinueLink-Mq4XOwMu.js.map +0 -1
- package/docs/assets/FixedRowHeightsRoute-DXFNDmnz.js +0 -2
- package/docs/assets/FixedRowHeightsRoute-DXFNDmnz.js.map +0 -1
- package/docs/assets/GettingStartedRoute-D-bI_IZb.js +0 -2
- package/docs/assets/GettingStartedRoute-D-bI_IZb.js.map +0 -1
- package/docs/assets/Grid-Cio8auWD.js +0 -2
- package/docs/assets/Grid-Cio8auWD.js.map +0 -1
- package/docs/assets/Header-DM8OHOd_.js +0 -2
- package/docs/assets/Header-DM8OHOd_.js.map +0 -1
- package/docs/assets/HorizontalListsRoute-Dk2qJcyq.js +0 -2
- package/docs/assets/HorizontalListsRoute-Dk2qJcyq.js.map +0 -1
- package/docs/assets/ImperativeApiRoute-BdK7xl-u.js +0 -2
- package/docs/assets/ImperativeApiRoute-BdK7xl-u.js.map +0 -1
- package/docs/assets/ImperativeApiRoute-DdlTcZ7C.js +0 -2
- package/docs/assets/ImperativeApiRoute-DdlTcZ7C.js.map +0 -1
- package/docs/assets/List-B9HC1vRM.js +0 -2
- package/docs/assets/List-B9HC1vRM.js.map +0 -1
- package/docs/assets/LoadingSpinner-CcA45RYo.js +0 -2
- package/docs/assets/LoadingSpinner-CcA45RYo.js.map +0 -1
- package/docs/assets/PageNotFound-BaiFbANH.js +0 -2
- package/docs/assets/PageNotFound-BaiFbANH.js.map +0 -1
- package/docs/assets/PlatformRequirementsRoute-BfE0JkzC.js +0 -2
- package/docs/assets/PlatformRequirementsRoute-BfE0JkzC.js.map +0 -1
- package/docs/assets/PropsRoute-B2tWvN5Y.js +0 -2
- package/docs/assets/PropsRoute-B2tWvN5Y.js.map +0 -1
- package/docs/assets/PropsRoute-E2EuXhKK.js +0 -2
- package/docs/assets/PropsRoute-E2EuXhKK.js.map +0 -1
- package/docs/assets/RTLGridsRoute-BiJ_ARQb.js +0 -2
- package/docs/assets/RTLGridsRoute-BiJ_ARQb.js.map +0 -1
- package/docs/assets/RenderingGridRoute-BvlK0VIG.js +0 -2
- package/docs/assets/RenderingGridRoute-BvlK0VIG.js.map +0 -1
- package/docs/assets/ScratchpadRoute-wzxynGR2.js +0 -2
- package/docs/assets/ScratchpadRoute-wzxynGR2.js.map +0 -1
- package/docs/assets/Select-BtAY4kA-.js +0 -2
- package/docs/assets/Select-BtAY4kA-.js.map +0 -1
- package/docs/assets/StickyRowsRoute-DUIWoMJJ.js +0 -2
- package/docs/assets/StickyRowsRoute-DUIWoMJJ.js.map +0 -1
- package/docs/assets/SupportRoute-DO1SyQwL.js +0 -2
- package/docs/assets/SupportRoute-DO1SyQwL.js.map +0 -1
- package/docs/assets/TabularDataRoute-DMwDahmo.js +0 -2
- package/docs/assets/TabularDataRoute-DMwDahmo.js.map +0 -1
- package/docs/assets/VariableRowHeightsRoute-B9mccfzh.js +0 -2
- package/docs/assets/VariableRowHeightsRoute-B9mccfzh.js.map +0 -1
- package/docs/assets/addresses-CDQyd4n9.js +0 -2
- package/docs/assets/addresses-CDQyd4n9.js.map +0 -1
- package/docs/assets/arePropsEqual-MBk0PiJi.js +0 -2
- package/docs/assets/arePropsEqual-MBk0PiJi.js.map +0 -1
- package/docs/assets/contacts-Bxrk2JS2.js +0 -2
- package/docs/assets/contacts-Bxrk2JS2.js.map +0 -1
- package/docs/assets/index-3R9tv3eW.js +0 -3
- package/docs/assets/index-3R9tv3eW.js.map +0 -1
- package/docs/assets/index-DbmHyJV-.css +0 -1
- package/docs/assets/useCitiesByState-DlHLfAIQ.js +0 -2
- package/docs/assets/useCitiesByState-DlHLfAIQ.js.map +0 -1
- package/docs/assets/useContacts-C-Fuwn4U.js +0 -2
- package/docs/assets/useContacts-C-Fuwn4U.js.map +0 -1
- package/docs/data/addresses.json +0 -23932
- package/docs/data/contacts.json +0 -4202
- package/docs/data/names.json +0 -1002
- package/docs/favicon.svg +0 -16
- package/docs/generated/README.md +0 -1
- package/docs/generated/code-snippets/CellComponent.json +0 -3
- package/docs/generated/code-snippets/CellComponentAriaRoles.json +0 -3
- package/docs/generated/code-snippets/FixedHeightList.json +0 -3
- package/docs/generated/code-snippets/FixedHeightRowComponent.json +0 -3
- package/docs/generated/code-snippets/FlexboxLayout.json +0 -3
- package/docs/generated/code-snippets/Grid.json +0 -3
- package/docs/generated/code-snippets/GridAriaRoles.json +0 -3
- package/docs/generated/code-snippets/HorizontalList.json +0 -3
- package/docs/generated/code-snippets/HorizontalListCellRenderer.json +0 -3
- package/docs/generated/code-snippets/ListAriaRoles.json +0 -3
- package/docs/generated/code-snippets/ListVariableRowHeights.json +0 -3
- package/docs/generated/code-snippets/ListWithStickyRows.json +0 -3
- package/docs/generated/code-snippets/RowComponentAriaRoles.json +0 -3
- package/docs/generated/code-snippets/RtlGrid.json +0 -3
- package/docs/generated/code-snippets/TableAriaAttributes.json +0 -3
- package/docs/generated/code-snippets/TableAriaOverrideProps.json +0 -3
- package/docs/generated/code-snippets/columnWidth.json +0 -3
- package/docs/generated/code-snippets/gridRefClickEventHandler.json +0 -3
- package/docs/generated/code-snippets/listRefClickEventHandler.json +0 -3
- package/docs/generated/code-snippets/rowHeight.json +0 -3
- package/docs/generated/code-snippets/useGridCallbackRef.json +0 -3
- package/docs/generated/code-snippets/useGridRef.json +0 -3
- package/docs/generated/code-snippets/useGridRefImport.json +0 -3
- package/docs/generated/code-snippets/useListCallbackRef.json +0 -3
- package/docs/generated/code-snippets/useListRef.json +0 -3
- package/docs/generated/code-snippets/useListRefImport.json +0 -3
- package/docs/generated/js-docs/Grid.json +0 -1030
- package/docs/generated/js-docs/List.json +0 -927
- package/docs/index.html +0 -39
- package/docs/og.html +0 -42
- package/docs/og.png +0 -0
- package/docs/robots.txt +0 -2
- package/docs/stats.html +0 -4949
- package/docs/svgs/checkbox-checked.svg +0 -1
- package/docs/svgs/checkbox-indeterminate.svg +0 -1
- package/docs/svgs/checkbox-unchecked.svg +0 -1
- package/docs/svgs/github.svg +0 -3
- package/docs/svgs/npm.svg +0 -1
- package/docs/svgs/radio-checked.svg +0 -1
- package/docs/svgs/radio-unchecked.svg +0 -1
package/dist/react-window.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
function
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useLayoutEffect as se, useEffect as J, useMemo as L, useRef as K, useCallback as U, memo as le, useImperativeHandle as ce, createElement as X } from "react";
|
|
3
|
+
function xe(e) {
|
|
4
4
|
let t = e;
|
|
5
5
|
for (; t; ) {
|
|
6
6
|
if (t.dir)
|
|
@@ -9,14 +9,14 @@ function pe(e) {
|
|
|
9
9
|
}
|
|
10
10
|
return !1;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const [s, r] =
|
|
14
|
-
return
|
|
15
|
-
e && (t || r(
|
|
12
|
+
function ve(e, t) {
|
|
13
|
+
const [s, r] = $(t === "rtl");
|
|
14
|
+
return se(() => {
|
|
15
|
+
e && (t || r(xe(e)));
|
|
16
16
|
}, [t, e]), s;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
18
|
+
const q = typeof window < "u" ? se : J;
|
|
19
|
+
function oe(e) {
|
|
20
20
|
if (e !== void 0)
|
|
21
21
|
switch (typeof e) {
|
|
22
22
|
case "number":
|
|
@@ -28,101 +28,101 @@ function ne(e) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function be({
|
|
32
32
|
box: e,
|
|
33
33
|
defaultHeight: t,
|
|
34
34
|
defaultWidth: s,
|
|
35
35
|
disabled: r,
|
|
36
|
-
element:
|
|
37
|
-
mode:
|
|
38
|
-
style:
|
|
36
|
+
element: n,
|
|
37
|
+
mode: o,
|
|
38
|
+
style: i
|
|
39
39
|
}) {
|
|
40
|
-
const { styleHeight:
|
|
40
|
+
const { styleHeight: a, styleWidth: l } = L(
|
|
41
41
|
() => ({
|
|
42
|
-
styleHeight:
|
|
43
|
-
styleWidth:
|
|
42
|
+
styleHeight: oe(i?.height),
|
|
43
|
+
styleWidth: oe(i?.width)
|
|
44
44
|
}),
|
|
45
|
-
[
|
|
46
|
-
), [
|
|
45
|
+
[i?.height, i?.width]
|
|
46
|
+
), [c, d] = $({
|
|
47
47
|
height: t,
|
|
48
48
|
width: s
|
|
49
|
-
}),
|
|
50
|
-
return
|
|
51
|
-
if (
|
|
49
|
+
}), f = r || o === "only-height" && a !== void 0 || o === "only-width" && l !== void 0 || a !== void 0 && l !== void 0;
|
|
50
|
+
return q(() => {
|
|
51
|
+
if (n === null || f)
|
|
52
52
|
return;
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
const { contentRect:
|
|
56
|
-
|
|
57
|
-
height:
|
|
58
|
-
width:
|
|
53
|
+
const p = new ResizeObserver((b) => {
|
|
54
|
+
for (const m of b) {
|
|
55
|
+
const { contentRect: I, target: g } = m;
|
|
56
|
+
n === g && d((w) => w.height === I.height && w.width === I.width ? w : {
|
|
57
|
+
height: I.height,
|
|
58
|
+
width: I.width
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
return
|
|
63
|
-
|
|
62
|
+
return p.observe(n, { box: e }), () => {
|
|
63
|
+
p?.unobserve(n);
|
|
64
64
|
};
|
|
65
|
-
}, [e,
|
|
65
|
+
}, [e, f, n, a, l]), L(
|
|
66
66
|
() => ({
|
|
67
|
-
height:
|
|
68
|
-
width:
|
|
67
|
+
height: a ?? c.height,
|
|
68
|
+
width: l ?? c.width
|
|
69
69
|
}),
|
|
70
|
-
[
|
|
70
|
+
[c, a, l]
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ae(e) {
|
|
74
74
|
const t = K(() => {
|
|
75
75
|
throw new Error("Cannot call an event handler while rendering.");
|
|
76
76
|
});
|
|
77
|
-
return
|
|
77
|
+
return q(() => {
|
|
78
78
|
t.current = e;
|
|
79
|
-
}, [e]),
|
|
79
|
+
}, [e]), U((s) => t.current?.(s), [t]);
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
81
|
+
let F = null;
|
|
82
|
+
function Ie(e = !1) {
|
|
83
|
+
if (F === null || e) {
|
|
84
84
|
const t = document.createElement("div"), s = t.style;
|
|
85
85
|
s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
|
|
86
|
-
const r = document.createElement("div"),
|
|
87
|
-
return
|
|
86
|
+
const r = document.createElement("div"), n = r.style;
|
|
87
|
+
return n.width = "100px", n.height = "100px", t.appendChild(r), document.body.appendChild(t), t.scrollLeft > 0 ? F = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? F = "negative" : F = "positive-ascending"), document.body.removeChild(t), F;
|
|
88
88
|
}
|
|
89
|
-
return
|
|
89
|
+
return F;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Z({
|
|
92
92
|
containerElement: e,
|
|
93
93
|
direction: t,
|
|
94
94
|
isRtl: s,
|
|
95
95
|
scrollOffset: r
|
|
96
96
|
}) {
|
|
97
97
|
if (t === "horizontal" && s)
|
|
98
|
-
switch (
|
|
98
|
+
switch (Ie()) {
|
|
99
99
|
case "negative":
|
|
100
100
|
return -r;
|
|
101
101
|
case "positive-descending": {
|
|
102
102
|
if (e) {
|
|
103
|
-
const { clientWidth:
|
|
104
|
-
return
|
|
103
|
+
const { clientWidth: n, scrollLeft: o, scrollWidth: i } = e;
|
|
104
|
+
return i - n - o;
|
|
105
105
|
}
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
return r;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function H(e, t = "Assertion error") {
|
|
112
112
|
if (!e)
|
|
113
113
|
throw console.error(t), Error(t);
|
|
114
114
|
}
|
|
115
115
|
function Y(e, t) {
|
|
116
116
|
if (e === t)
|
|
117
117
|
return !0;
|
|
118
|
-
if (!!e != !!t || (
|
|
118
|
+
if (!!e != !!t || (H(e !== void 0), H(t !== void 0), Object.keys(e).length !== Object.keys(t).length))
|
|
119
119
|
return !1;
|
|
120
120
|
for (const s in e)
|
|
121
121
|
if (!Object.is(t[s], e[s]))
|
|
122
122
|
return !1;
|
|
123
123
|
return !0;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function fe({
|
|
126
126
|
cachedBounds: e,
|
|
127
127
|
itemCount: t,
|
|
128
128
|
itemSize: s
|
|
@@ -135,69 +135,69 @@ function ce({
|
|
|
135
135
|
const r = e.get(
|
|
136
136
|
e.size === 0 ? 0 : e.size - 1
|
|
137
137
|
);
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
return t *
|
|
138
|
+
H(r !== void 0, "Unexpected bounds cache miss");
|
|
139
|
+
const n = (r.scrollOffset + r.size) / e.size;
|
|
140
|
+
return t * n;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function we({
|
|
144
144
|
align: e,
|
|
145
145
|
cachedBounds: t,
|
|
146
146
|
index: s,
|
|
147
147
|
itemCount: r,
|
|
148
|
-
itemSize:
|
|
149
|
-
containerScrollOffset:
|
|
150
|
-
containerSize:
|
|
148
|
+
itemSize: n,
|
|
149
|
+
containerScrollOffset: o,
|
|
150
|
+
containerSize: i
|
|
151
151
|
}) {
|
|
152
|
-
const
|
|
152
|
+
const a = fe({
|
|
153
153
|
cachedBounds: t,
|
|
154
154
|
itemCount: r,
|
|
155
|
-
itemSize:
|
|
156
|
-
}),
|
|
155
|
+
itemSize: n
|
|
156
|
+
}), l = t.get(s), c = Math.max(
|
|
157
157
|
0,
|
|
158
|
-
Math.min(
|
|
158
|
+
Math.min(a - i, l.scrollOffset)
|
|
159
159
|
), d = Math.max(
|
|
160
160
|
0,
|
|
161
|
-
|
|
161
|
+
l.scrollOffset - i + l.size
|
|
162
162
|
);
|
|
163
|
-
switch (e === "smart" && (
|
|
163
|
+
switch (e === "smart" && (o >= d && o <= c ? e = "auto" : e = "center"), e) {
|
|
164
164
|
case "start":
|
|
165
|
-
return
|
|
165
|
+
return c;
|
|
166
166
|
case "end":
|
|
167
167
|
return d;
|
|
168
168
|
case "center":
|
|
169
|
-
return
|
|
169
|
+
return l.scrollOffset <= i / 2 ? 0 : l.scrollOffset + l.size / 2 >= a - i / 2 ? a - i : l.scrollOffset + l.size / 2 - i / 2;
|
|
170
170
|
case "auto":
|
|
171
171
|
default:
|
|
172
|
-
return
|
|
172
|
+
return o >= d && o <= c ? o : o < d ? d : c;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ie({
|
|
176
176
|
cachedBounds: e,
|
|
177
177
|
containerScrollOffset: t,
|
|
178
178
|
containerSize: s,
|
|
179
179
|
itemCount: r,
|
|
180
|
-
overscanCount:
|
|
180
|
+
overscanCount: n
|
|
181
181
|
}) {
|
|
182
|
-
const
|
|
183
|
-
let
|
|
184
|
-
for (; d <
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
182
|
+
const o = r - 1;
|
|
183
|
+
let i = 0, a = -1, l = 0, c = -1, d = 0;
|
|
184
|
+
for (; d < o; ) {
|
|
185
|
+
const f = e.get(d);
|
|
186
|
+
if (f.scrollOffset + f.size > t)
|
|
187
187
|
break;
|
|
188
188
|
d++;
|
|
189
189
|
}
|
|
190
|
-
for (
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
190
|
+
for (i = d, l = Math.max(0, i - n); d < o; ) {
|
|
191
|
+
const f = e.get(d);
|
|
192
|
+
if (f.scrollOffset + f.size >= t + s)
|
|
193
193
|
break;
|
|
194
194
|
d++;
|
|
195
195
|
}
|
|
196
|
-
return
|
|
197
|
-
startIndexVisible:
|
|
198
|
-
stopIndexVisible:
|
|
199
|
-
startIndexOverscan:
|
|
200
|
-
stopIndexOverscan:
|
|
196
|
+
return a = Math.min(o, d), c = Math.min(r - 1, a + n), i < 0 && (i = 0, a = -1, l = 0, c = -1), {
|
|
197
|
+
startIndexVisible: i,
|
|
198
|
+
stopIndexVisible: a,
|
|
199
|
+
startIndexOverscan: l,
|
|
200
|
+
stopIndexOverscan: c
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
function me({
|
|
@@ -207,56 +207,56 @@ function me({
|
|
|
207
207
|
}) {
|
|
208
208
|
const r = /* @__PURE__ */ new Map();
|
|
209
209
|
return {
|
|
210
|
-
get(
|
|
211
|
-
for (
|
|
212
|
-
const
|
|
213
|
-
let
|
|
210
|
+
get(n) {
|
|
211
|
+
for (H(n < e, `Invalid index ${n}`); r.size - 1 < n; ) {
|
|
212
|
+
const i = r.size;
|
|
213
|
+
let a;
|
|
214
214
|
switch (typeof s) {
|
|
215
215
|
case "function": {
|
|
216
|
-
|
|
216
|
+
a = s(i, t);
|
|
217
217
|
break;
|
|
218
218
|
}
|
|
219
219
|
case "number": {
|
|
220
|
-
|
|
220
|
+
a = s;
|
|
221
221
|
break;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
if (
|
|
225
|
-
r.set(
|
|
226
|
-
size:
|
|
224
|
+
if (i === 0)
|
|
225
|
+
r.set(i, {
|
|
226
|
+
size: a,
|
|
227
227
|
scrollOffset: 0
|
|
228
228
|
});
|
|
229
229
|
else {
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
`Unexpected bounds cache miss for index ${
|
|
234
|
-
), r.set(
|
|
235
|
-
scrollOffset:
|
|
236
|
-
size:
|
|
230
|
+
const l = r.get(i - 1);
|
|
231
|
+
H(
|
|
232
|
+
l !== void 0,
|
|
233
|
+
`Unexpected bounds cache miss for index ${n}`
|
|
234
|
+
), r.set(i, {
|
|
235
|
+
scrollOffset: l.scrollOffset + l.size,
|
|
236
|
+
size: a
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
`Unexpected bounds cache miss for index ${
|
|
244
|
-
),
|
|
240
|
+
const o = r.get(n);
|
|
241
|
+
return H(
|
|
242
|
+
o !== void 0,
|
|
243
|
+
`Unexpected bounds cache miss for index ${n}`
|
|
244
|
+
), o;
|
|
245
245
|
},
|
|
246
|
-
set(
|
|
247
|
-
r.set(
|
|
246
|
+
set(n, o) {
|
|
247
|
+
r.set(n, o);
|
|
248
248
|
},
|
|
249
249
|
get size() {
|
|
250
250
|
return r.size;
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Oe({
|
|
255
255
|
itemCount: e,
|
|
256
256
|
itemProps: t,
|
|
257
257
|
itemSize: s
|
|
258
258
|
}) {
|
|
259
|
-
return
|
|
259
|
+
return L(
|
|
260
260
|
() => me({
|
|
261
261
|
itemCount: e,
|
|
262
262
|
itemProps: t,
|
|
@@ -265,17 +265,17 @@ function we({
|
|
|
265
265
|
[e, t, s]
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function ye({
|
|
269
269
|
containerSize: e,
|
|
270
270
|
itemSize: t
|
|
271
271
|
}) {
|
|
272
272
|
let s;
|
|
273
273
|
switch (typeof t) {
|
|
274
274
|
case "string": {
|
|
275
|
-
|
|
275
|
+
H(
|
|
276
276
|
t.endsWith("%"),
|
|
277
277
|
`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`
|
|
278
|
-
),
|
|
278
|
+
), H(
|
|
279
279
|
e !== void 0,
|
|
280
280
|
"Container size must be defined if a percentage item size is specified"
|
|
281
281
|
), s = e * parseInt(t) / 100;
|
|
@@ -288,391 +288,393 @@ function Oe({
|
|
|
288
288
|
}
|
|
289
289
|
return s;
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function ee({
|
|
292
292
|
containerElement: e,
|
|
293
293
|
containerStyle: t,
|
|
294
294
|
defaultContainerSize: s = 0,
|
|
295
295
|
direction: r,
|
|
296
|
-
isRtl:
|
|
297
|
-
itemCount:
|
|
298
|
-
itemProps:
|
|
299
|
-
itemSize:
|
|
300
|
-
onResize:
|
|
301
|
-
overscanCount:
|
|
296
|
+
isRtl: n = !1,
|
|
297
|
+
itemCount: o,
|
|
298
|
+
itemProps: i,
|
|
299
|
+
itemSize: a,
|
|
300
|
+
onResize: l,
|
|
301
|
+
overscanCount: c
|
|
302
302
|
}) {
|
|
303
|
-
const [d,
|
|
303
|
+
const [d, f] = $({
|
|
304
304
|
startIndexVisible: 0,
|
|
305
305
|
startIndexOverscan: 0,
|
|
306
306
|
stopIndexVisible: -1,
|
|
307
307
|
stopIndexOverscan: -1
|
|
308
308
|
}), {
|
|
309
|
-
startIndexVisible:
|
|
310
|
-
startIndexOverscan:
|
|
311
|
-
stopIndexVisible:
|
|
312
|
-
stopIndexOverscan:
|
|
309
|
+
startIndexVisible: p,
|
|
310
|
+
startIndexOverscan: b,
|
|
311
|
+
stopIndexVisible: m,
|
|
312
|
+
stopIndexOverscan: I
|
|
313
313
|
} = {
|
|
314
|
-
startIndexVisible: Math.min(
|
|
315
|
-
startIndexOverscan: Math.min(
|
|
316
|
-
stopIndexVisible: Math.min(
|
|
317
|
-
stopIndexOverscan: Math.min(
|
|
318
|
-
}, { height: g = s, width:
|
|
314
|
+
startIndexVisible: Math.min(o - 1, d.startIndexVisible),
|
|
315
|
+
startIndexOverscan: Math.min(o - 1, d.startIndexOverscan),
|
|
316
|
+
stopIndexVisible: Math.min(o - 1, d.stopIndexVisible),
|
|
317
|
+
stopIndexOverscan: Math.min(o - 1, d.stopIndexOverscan)
|
|
318
|
+
}, { height: g = s, width: w = s } = be({
|
|
319
319
|
defaultHeight: r === "vertical" ? s : void 0,
|
|
320
320
|
defaultWidth: r === "horizontal" ? s : void 0,
|
|
321
321
|
element: e,
|
|
322
322
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
323
323
|
style: t
|
|
324
|
-
}),
|
|
324
|
+
}), y = K({
|
|
325
325
|
height: 0,
|
|
326
326
|
width: 0
|
|
327
|
-
}),
|
|
328
|
-
|
|
329
|
-
if (typeof
|
|
330
|
-
const
|
|
331
|
-
(
|
|
327
|
+
}), V = r === "vertical" ? g : w, u = ye({ containerSize: V, itemSize: a });
|
|
328
|
+
se(() => {
|
|
329
|
+
if (typeof l == "function") {
|
|
330
|
+
const h = y.current;
|
|
331
|
+
(h.height !== g || h.width !== w) && (l({ height: g, width: w }, { ...h }), h.height = g, h.width = w);
|
|
332
332
|
}
|
|
333
|
-
}, [g,
|
|
334
|
-
const
|
|
335
|
-
itemCount:
|
|
336
|
-
itemProps:
|
|
337
|
-
itemSize:
|
|
338
|
-
}),
|
|
339
|
-
(
|
|
340
|
-
[
|
|
341
|
-
), S =
|
|
342
|
-
() =>
|
|
343
|
-
cachedBounds:
|
|
344
|
-
itemCount:
|
|
345
|
-
itemSize:
|
|
333
|
+
}, [g, l, w]);
|
|
334
|
+
const z = Oe({
|
|
335
|
+
itemCount: o,
|
|
336
|
+
itemProps: i,
|
|
337
|
+
itemSize: u
|
|
338
|
+
}), k = U(
|
|
339
|
+
(h) => z.get(h),
|
|
340
|
+
[z]
|
|
341
|
+
), S = U(
|
|
342
|
+
() => fe({
|
|
343
|
+
cachedBounds: z,
|
|
344
|
+
itemCount: o,
|
|
345
|
+
itemSize: u
|
|
346
346
|
}),
|
|
347
|
-
[
|
|
348
|
-
),
|
|
349
|
-
(
|
|
350
|
-
const
|
|
347
|
+
[z, o, u]
|
|
348
|
+
), W = U(
|
|
349
|
+
(h) => {
|
|
350
|
+
const T = Z({
|
|
351
351
|
containerElement: e,
|
|
352
352
|
direction: r,
|
|
353
|
-
isRtl:
|
|
354
|
-
scrollOffset:
|
|
353
|
+
isRtl: n,
|
|
354
|
+
scrollOffset: h
|
|
355
355
|
});
|
|
356
|
-
return
|
|
357
|
-
cachedBounds:
|
|
358
|
-
containerScrollOffset:
|
|
359
|
-
containerSize:
|
|
360
|
-
itemCount:
|
|
361
|
-
overscanCount:
|
|
356
|
+
return ie({
|
|
357
|
+
cachedBounds: z,
|
|
358
|
+
containerScrollOffset: T,
|
|
359
|
+
containerSize: V,
|
|
360
|
+
itemCount: o,
|
|
361
|
+
overscanCount: c
|
|
362
362
|
});
|
|
363
363
|
},
|
|
364
364
|
[
|
|
365
|
-
|
|
365
|
+
z,
|
|
366
366
|
e,
|
|
367
|
-
|
|
367
|
+
V,
|
|
368
368
|
r,
|
|
369
|
-
o,
|
|
370
369
|
n,
|
|
371
|
-
|
|
370
|
+
o,
|
|
371
|
+
c
|
|
372
372
|
]
|
|
373
373
|
);
|
|
374
|
-
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
}, [e, r,
|
|
374
|
+
q(() => {
|
|
375
|
+
const h = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
376
|
+
f(W(h));
|
|
377
|
+
}, [e, r, W]), q(() => {
|
|
378
378
|
if (!e)
|
|
379
379
|
return;
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
const { scrollLeft:
|
|
380
|
+
const h = () => {
|
|
381
|
+
f((T) => {
|
|
382
|
+
const { scrollLeft: E, scrollTop: v } = e, x = Z({
|
|
383
383
|
containerElement: e,
|
|
384
384
|
direction: r,
|
|
385
|
-
isRtl:
|
|
386
|
-
scrollOffset: r === "vertical" ? v :
|
|
387
|
-
}),
|
|
388
|
-
cachedBounds:
|
|
389
|
-
containerScrollOffset:
|
|
390
|
-
containerSize:
|
|
391
|
-
itemCount:
|
|
392
|
-
overscanCount:
|
|
385
|
+
isRtl: n,
|
|
386
|
+
scrollOffset: r === "vertical" ? v : E
|
|
387
|
+
}), A = ie({
|
|
388
|
+
cachedBounds: z,
|
|
389
|
+
containerScrollOffset: x,
|
|
390
|
+
containerSize: V,
|
|
391
|
+
itemCount: o,
|
|
392
|
+
overscanCount: c
|
|
393
393
|
});
|
|
394
|
-
return Y(
|
|
394
|
+
return Y(A, T) ? T : A;
|
|
395
395
|
});
|
|
396
396
|
};
|
|
397
|
-
return e.addEventListener("scroll",
|
|
398
|
-
e.removeEventListener("scroll",
|
|
397
|
+
return e.addEventListener("scroll", h), () => {
|
|
398
|
+
e.removeEventListener("scroll", h);
|
|
399
399
|
};
|
|
400
400
|
}, [
|
|
401
|
-
|
|
401
|
+
z,
|
|
402
402
|
e,
|
|
403
|
-
|
|
403
|
+
V,
|
|
404
404
|
r,
|
|
405
|
-
|
|
406
|
-
|
|
405
|
+
o,
|
|
406
|
+
c
|
|
407
407
|
]);
|
|
408
|
-
const
|
|
408
|
+
const O = ae(
|
|
409
409
|
({
|
|
410
|
-
align:
|
|
411
|
-
containerScrollOffset:
|
|
412
|
-
index:
|
|
410
|
+
align: h = "auto",
|
|
411
|
+
containerScrollOffset: T,
|
|
412
|
+
index: E
|
|
413
413
|
}) => {
|
|
414
|
-
let v =
|
|
415
|
-
align:
|
|
416
|
-
cachedBounds:
|
|
417
|
-
containerScrollOffset:
|
|
418
|
-
containerSize:
|
|
419
|
-
index:
|
|
420
|
-
itemCount:
|
|
421
|
-
itemSize:
|
|
414
|
+
let v = we({
|
|
415
|
+
align: h,
|
|
416
|
+
cachedBounds: z,
|
|
417
|
+
containerScrollOffset: T,
|
|
418
|
+
containerSize: V,
|
|
419
|
+
index: E,
|
|
420
|
+
itemCount: o,
|
|
421
|
+
itemSize: u
|
|
422
422
|
});
|
|
423
423
|
if (e) {
|
|
424
|
-
if (v =
|
|
424
|
+
if (v = Z({
|
|
425
425
|
containerElement: e,
|
|
426
426
|
direction: r,
|
|
427
|
-
isRtl:
|
|
427
|
+
isRtl: n,
|
|
428
428
|
scrollOffset: v
|
|
429
429
|
}), typeof e.scrollTo != "function") {
|
|
430
|
-
const
|
|
431
|
-
Y(d,
|
|
430
|
+
const x = W(v);
|
|
431
|
+
Y(d, x) || f(x);
|
|
432
432
|
}
|
|
433
433
|
return v;
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
437
|
return {
|
|
438
|
-
getCellBounds:
|
|
438
|
+
getCellBounds: k,
|
|
439
439
|
getEstimatedSize: S,
|
|
440
|
-
scrollToIndex:
|
|
441
|
-
startIndexOverscan:
|
|
442
|
-
startIndexVisible:
|
|
443
|
-
stopIndexOverscan:
|
|
444
|
-
stopIndexVisible:
|
|
440
|
+
scrollToIndex: O,
|
|
441
|
+
startIndexOverscan: b,
|
|
442
|
+
startIndexVisible: p,
|
|
443
|
+
stopIndexOverscan: I,
|
|
444
|
+
stopIndexVisible: m
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
447
|
function de(e) {
|
|
448
|
-
return
|
|
448
|
+
return L(() => e, Object.values(e));
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function ue(e, t) {
|
|
451
451
|
const {
|
|
452
452
|
ariaAttributes: s,
|
|
453
453
|
style: r,
|
|
454
|
-
...
|
|
454
|
+
...n
|
|
455
455
|
} = e, {
|
|
456
|
-
ariaAttributes:
|
|
457
|
-
style:
|
|
458
|
-
...
|
|
456
|
+
ariaAttributes: o,
|
|
457
|
+
style: i,
|
|
458
|
+
...a
|
|
459
459
|
} = t;
|
|
460
|
-
return Y(s,
|
|
460
|
+
return Y(s, o) && Y(r, i) && Y(n, a);
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Re({
|
|
463
463
|
cellComponent: e,
|
|
464
464
|
cellProps: t,
|
|
465
465
|
children: s,
|
|
466
466
|
className: r,
|
|
467
|
-
columnCount:
|
|
468
|
-
columnWidth:
|
|
469
|
-
defaultHeight:
|
|
470
|
-
defaultWidth:
|
|
471
|
-
dir:
|
|
472
|
-
gridRef:
|
|
467
|
+
columnCount: n,
|
|
468
|
+
columnWidth: o,
|
|
469
|
+
defaultHeight: i = 0,
|
|
470
|
+
defaultWidth: a = 0,
|
|
471
|
+
dir: l,
|
|
472
|
+
gridRef: c,
|
|
473
473
|
onCellsRendered: d,
|
|
474
|
-
onResize:
|
|
475
|
-
overscanCount:
|
|
476
|
-
rowCount:
|
|
477
|
-
rowHeight:
|
|
478
|
-
style:
|
|
474
|
+
onResize: f,
|
|
475
|
+
overscanCount: p = 3,
|
|
476
|
+
rowCount: b,
|
|
477
|
+
rowHeight: m,
|
|
478
|
+
style: I,
|
|
479
479
|
tagName: g = "div",
|
|
480
|
-
...
|
|
480
|
+
...w
|
|
481
481
|
}) {
|
|
482
|
-
const
|
|
483
|
-
() =>
|
|
482
|
+
const y = de(t), V = L(
|
|
483
|
+
() => le(e, ue),
|
|
484
484
|
[e]
|
|
485
|
-
), [
|
|
485
|
+
), [u, z] = $(null), k = ve(u, l), {
|
|
486
486
|
getCellBounds: S,
|
|
487
|
-
getEstimatedSize:
|
|
488
|
-
startIndexOverscan:
|
|
489
|
-
startIndexVisible:
|
|
490
|
-
scrollToIndex:
|
|
491
|
-
stopIndexOverscan:
|
|
487
|
+
getEstimatedSize: W,
|
|
488
|
+
startIndexOverscan: O,
|
|
489
|
+
startIndexVisible: h,
|
|
490
|
+
scrollToIndex: T,
|
|
491
|
+
stopIndexOverscan: E,
|
|
492
492
|
stopIndexVisible: v
|
|
493
|
-
} =
|
|
494
|
-
containerElement:
|
|
495
|
-
|
|
493
|
+
} = ee({
|
|
494
|
+
containerElement: u,
|
|
495
|
+
containerStyle: I,
|
|
496
|
+
defaultContainerSize: a,
|
|
496
497
|
direction: "horizontal",
|
|
497
|
-
isRtl:
|
|
498
|
-
itemCount:
|
|
499
|
-
itemProps:
|
|
500
|
-
itemSize:
|
|
501
|
-
onResize:
|
|
502
|
-
overscanCount:
|
|
498
|
+
isRtl: k,
|
|
499
|
+
itemCount: n,
|
|
500
|
+
itemProps: y,
|
|
501
|
+
itemSize: o,
|
|
502
|
+
onResize: f,
|
|
503
|
+
overscanCount: p
|
|
503
504
|
}), {
|
|
504
|
-
getCellBounds:
|
|
505
|
-
getEstimatedSize:
|
|
506
|
-
startIndexOverscan:
|
|
507
|
-
startIndexVisible:
|
|
505
|
+
getCellBounds: x,
|
|
506
|
+
getEstimatedSize: A,
|
|
507
|
+
startIndexOverscan: M,
|
|
508
|
+
startIndexVisible: re,
|
|
508
509
|
scrollToIndex: Q,
|
|
509
|
-
stopIndexOverscan:
|
|
510
|
-
stopIndexVisible:
|
|
511
|
-
} =
|
|
512
|
-
containerElement:
|
|
513
|
-
|
|
510
|
+
stopIndexOverscan: _,
|
|
511
|
+
stopIndexVisible: ne
|
|
512
|
+
} = ee({
|
|
513
|
+
containerElement: u,
|
|
514
|
+
containerStyle: I,
|
|
515
|
+
defaultContainerSize: i,
|
|
514
516
|
direction: "vertical",
|
|
515
|
-
itemCount:
|
|
516
|
-
itemProps:
|
|
517
|
-
itemSize:
|
|
518
|
-
onResize:
|
|
519
|
-
overscanCount:
|
|
517
|
+
itemCount: b,
|
|
518
|
+
itemProps: y,
|
|
519
|
+
itemSize: m,
|
|
520
|
+
onResize: f,
|
|
521
|
+
overscanCount: p
|
|
520
522
|
});
|
|
521
|
-
|
|
522
|
-
|
|
523
|
+
ce(
|
|
524
|
+
c,
|
|
523
525
|
() => ({
|
|
524
526
|
get element() {
|
|
525
|
-
return
|
|
527
|
+
return u;
|
|
526
528
|
},
|
|
527
529
|
scrollToCell({
|
|
528
|
-
behavior:
|
|
529
|
-
columnAlign:
|
|
530
|
-
columnIndex:
|
|
531
|
-
rowAlign:
|
|
532
|
-
rowIndex:
|
|
530
|
+
behavior: B = "auto",
|
|
531
|
+
columnAlign: R = "auto",
|
|
532
|
+
columnIndex: j,
|
|
533
|
+
rowAlign: D = "auto",
|
|
534
|
+
rowIndex: G
|
|
533
535
|
}) {
|
|
534
|
-
const
|
|
535
|
-
align:
|
|
536
|
-
containerScrollOffset:
|
|
537
|
-
index:
|
|
538
|
-
}),
|
|
539
|
-
align:
|
|
540
|
-
containerScrollOffset:
|
|
541
|
-
index:
|
|
536
|
+
const N = T({
|
|
537
|
+
align: R,
|
|
538
|
+
containerScrollOffset: u?.scrollLeft ?? 0,
|
|
539
|
+
index: j
|
|
540
|
+
}), ge = Q({
|
|
541
|
+
align: D,
|
|
542
|
+
containerScrollOffset: u?.scrollTop ?? 0,
|
|
543
|
+
index: G
|
|
542
544
|
});
|
|
543
|
-
typeof
|
|
544
|
-
behavior:
|
|
545
|
-
left:
|
|
546
|
-
top:
|
|
545
|
+
typeof u?.scrollTo == "function" && u.scrollTo({
|
|
546
|
+
behavior: B,
|
|
547
|
+
left: N,
|
|
548
|
+
top: ge
|
|
547
549
|
});
|
|
548
550
|
},
|
|
549
551
|
scrollToColumn({
|
|
550
|
-
align:
|
|
551
|
-
behavior:
|
|
552
|
-
index:
|
|
552
|
+
align: B = "auto",
|
|
553
|
+
behavior: R = "auto",
|
|
554
|
+
index: j
|
|
553
555
|
}) {
|
|
554
|
-
const
|
|
555
|
-
align:
|
|
556
|
-
containerScrollOffset:
|
|
557
|
-
index:
|
|
556
|
+
const D = T({
|
|
557
|
+
align: B,
|
|
558
|
+
containerScrollOffset: u?.scrollLeft ?? 0,
|
|
559
|
+
index: j
|
|
558
560
|
});
|
|
559
|
-
typeof
|
|
560
|
-
behavior:
|
|
561
|
-
left:
|
|
561
|
+
typeof u?.scrollTo == "function" && u.scrollTo({
|
|
562
|
+
behavior: R,
|
|
563
|
+
left: D
|
|
562
564
|
});
|
|
563
565
|
},
|
|
564
566
|
scrollToRow({
|
|
565
|
-
align:
|
|
566
|
-
behavior:
|
|
567
|
-
index:
|
|
567
|
+
align: B = "auto",
|
|
568
|
+
behavior: R = "auto",
|
|
569
|
+
index: j
|
|
568
570
|
}) {
|
|
569
|
-
const
|
|
570
|
-
align:
|
|
571
|
-
containerScrollOffset:
|
|
572
|
-
index:
|
|
571
|
+
const D = Q({
|
|
572
|
+
align: B,
|
|
573
|
+
containerScrollOffset: u?.scrollTop ?? 0,
|
|
574
|
+
index: j
|
|
573
575
|
});
|
|
574
|
-
typeof
|
|
575
|
-
behavior:
|
|
576
|
-
top:
|
|
576
|
+
typeof u?.scrollTo == "function" && u.scrollTo({
|
|
577
|
+
behavior: R,
|
|
578
|
+
top: D
|
|
577
579
|
});
|
|
578
580
|
}
|
|
579
581
|
}),
|
|
580
|
-
[
|
|
581
|
-
),
|
|
582
|
-
|
|
582
|
+
[u, T, Q]
|
|
583
|
+
), J(() => {
|
|
584
|
+
O >= 0 && E >= 0 && M >= 0 && _ >= 0 && d && d(
|
|
583
585
|
{
|
|
584
|
-
columnStartIndex:
|
|
586
|
+
columnStartIndex: h,
|
|
585
587
|
columnStopIndex: v,
|
|
586
|
-
rowStartIndex:
|
|
587
|
-
rowStopIndex:
|
|
588
|
+
rowStartIndex: re,
|
|
589
|
+
rowStopIndex: ne
|
|
588
590
|
},
|
|
589
591
|
{
|
|
590
|
-
columnStartIndex:
|
|
591
|
-
columnStopIndex:
|
|
592
|
-
rowStartIndex:
|
|
593
|
-
rowStopIndex:
|
|
592
|
+
columnStartIndex: O,
|
|
593
|
+
columnStopIndex: E,
|
|
594
|
+
rowStartIndex: M,
|
|
595
|
+
rowStopIndex: _
|
|
594
596
|
}
|
|
595
597
|
);
|
|
596
598
|
}, [
|
|
597
599
|
d,
|
|
598
|
-
|
|
599
|
-
u,
|
|
600
|
+
O,
|
|
600
601
|
h,
|
|
602
|
+
E,
|
|
601
603
|
v,
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
M,
|
|
605
|
+
re,
|
|
606
|
+
_,
|
|
607
|
+
ne
|
|
606
608
|
]);
|
|
607
|
-
const
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
for (let
|
|
611
|
-
const
|
|
612
|
-
for (let
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
|
|
609
|
+
const he = L(() => {
|
|
610
|
+
const B = [];
|
|
611
|
+
if (n > 0 && b > 0)
|
|
612
|
+
for (let R = M; R <= _; R++) {
|
|
613
|
+
const j = x(R), D = [];
|
|
614
|
+
for (let G = O; G <= E; G++) {
|
|
615
|
+
const N = S(G);
|
|
616
|
+
D.push(
|
|
617
|
+
/* @__PURE__ */ X(
|
|
618
|
+
V,
|
|
617
619
|
{
|
|
618
|
-
...
|
|
620
|
+
...y,
|
|
619
621
|
ariaAttributes: {
|
|
620
|
-
"aria-colindex":
|
|
622
|
+
"aria-colindex": G + 1,
|
|
621
623
|
role: "gridcell"
|
|
622
624
|
},
|
|
623
|
-
columnIndex:
|
|
624
|
-
key:
|
|
625
|
-
rowIndex:
|
|
625
|
+
columnIndex: G,
|
|
626
|
+
key: G,
|
|
627
|
+
rowIndex: R,
|
|
626
628
|
style: {
|
|
627
629
|
position: "absolute",
|
|
628
|
-
left:
|
|
629
|
-
right:
|
|
630
|
-
transform: `translate(${
|
|
631
|
-
height:
|
|
632
|
-
width:
|
|
630
|
+
left: k ? void 0 : 0,
|
|
631
|
+
right: k ? 0 : void 0,
|
|
632
|
+
transform: `translate(${k ? -N.scrollOffset : N.scrollOffset}px, ${j.scrollOffset}px)`,
|
|
633
|
+
height: j.size,
|
|
634
|
+
width: N.size
|
|
633
635
|
}
|
|
634
636
|
}
|
|
635
637
|
)
|
|
636
638
|
);
|
|
637
639
|
}
|
|
638
|
-
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
+
B.push(
|
|
641
|
+
/* @__PURE__ */ P("div", { role: "row", "aria-rowindex": R + 1, children: D }, R)
|
|
640
642
|
);
|
|
641
643
|
}
|
|
642
|
-
return
|
|
644
|
+
return B;
|
|
643
645
|
}, [
|
|
646
|
+
V,
|
|
647
|
+
y,
|
|
648
|
+
n,
|
|
644
649
|
O,
|
|
645
|
-
k,
|
|
646
|
-
o,
|
|
647
|
-
L,
|
|
648
|
-
h,
|
|
649
|
-
S,
|
|
650
650
|
E,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
651
|
+
S,
|
|
652
|
+
x,
|
|
653
|
+
k,
|
|
654
|
+
b,
|
|
655
|
+
M,
|
|
656
|
+
_
|
|
657
|
+
]), pe = /* @__PURE__ */ P(
|
|
656
658
|
"div",
|
|
657
659
|
{
|
|
658
660
|
"aria-hidden": !0,
|
|
659
661
|
style: {
|
|
660
|
-
height:
|
|
661
|
-
width:
|
|
662
|
+
height: A(),
|
|
663
|
+
width: W(),
|
|
662
664
|
zIndex: -1
|
|
663
665
|
}
|
|
664
666
|
}
|
|
665
667
|
);
|
|
666
|
-
return
|
|
668
|
+
return X(
|
|
667
669
|
g,
|
|
668
670
|
{
|
|
669
|
-
"aria-colcount":
|
|
670
|
-
"aria-rowcount":
|
|
671
|
+
"aria-colcount": n,
|
|
672
|
+
"aria-rowcount": b,
|
|
671
673
|
role: "grid",
|
|
672
|
-
...
|
|
674
|
+
...w,
|
|
673
675
|
className: r,
|
|
674
|
-
dir:
|
|
675
|
-
ref:
|
|
676
|
+
dir: l,
|
|
677
|
+
ref: z,
|
|
676
678
|
style: {
|
|
677
679
|
position: "relative",
|
|
678
680
|
width: "100%",
|
|
@@ -681,176 +683,266 @@ function Se({
|
|
|
681
683
|
maxWidth: "100%",
|
|
682
684
|
flexGrow: 1,
|
|
683
685
|
overflow: "auto",
|
|
684
|
-
...
|
|
686
|
+
...I
|
|
685
687
|
}
|
|
686
688
|
},
|
|
687
|
-
|
|
689
|
+
he,
|
|
688
690
|
s,
|
|
689
|
-
|
|
691
|
+
pe
|
|
690
692
|
);
|
|
691
693
|
}
|
|
692
|
-
const
|
|
693
|
-
function
|
|
694
|
+
const Ve = $, Ee = K;
|
|
695
|
+
function ze(e) {
|
|
696
|
+
return e != null && typeof e == "object" && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
697
|
+
}
|
|
698
|
+
const te = "data-react-window-index";
|
|
699
|
+
function Ae({
|
|
694
700
|
children: e,
|
|
695
701
|
className: t,
|
|
696
702
|
defaultHeight: s = 0,
|
|
697
703
|
listRef: r,
|
|
698
|
-
onResize:
|
|
699
|
-
onRowsRendered:
|
|
700
|
-
overscanCount:
|
|
701
|
-
rowComponent:
|
|
702
|
-
rowCount:
|
|
703
|
-
rowHeight:
|
|
704
|
+
onResize: n,
|
|
705
|
+
onRowsRendered: o,
|
|
706
|
+
overscanCount: i = 3,
|
|
707
|
+
rowComponent: a,
|
|
708
|
+
rowCount: l,
|
|
709
|
+
rowHeight: c,
|
|
704
710
|
rowProps: d,
|
|
705
|
-
tagName:
|
|
706
|
-
style:
|
|
707
|
-
...
|
|
711
|
+
tagName: f = "div",
|
|
712
|
+
style: p,
|
|
713
|
+
...b
|
|
708
714
|
}) {
|
|
709
|
-
const
|
|
710
|
-
() =>
|
|
711
|
-
[
|
|
712
|
-
), [g,
|
|
713
|
-
getCellBounds:
|
|
714
|
-
getEstimatedSize:
|
|
715
|
-
scrollToIndex:
|
|
716
|
-
startIndexOverscan:
|
|
717
|
-
startIndexVisible:
|
|
718
|
-
stopIndexOverscan:
|
|
719
|
-
stopIndexVisible:
|
|
720
|
-
} =
|
|
715
|
+
const m = de(d), I = L(
|
|
716
|
+
() => le(a, ue),
|
|
717
|
+
[a]
|
|
718
|
+
), [g, w] = $(null), y = ze(c), V = L(() => y ? (v) => c.getRowHeight(v) ?? c.getAverageRowHeight() : c, [y, c]), {
|
|
719
|
+
getCellBounds: u,
|
|
720
|
+
getEstimatedSize: z,
|
|
721
|
+
scrollToIndex: k,
|
|
722
|
+
startIndexOverscan: S,
|
|
723
|
+
startIndexVisible: W,
|
|
724
|
+
stopIndexOverscan: O,
|
|
725
|
+
stopIndexVisible: h
|
|
726
|
+
} = ee({
|
|
721
727
|
containerElement: g,
|
|
728
|
+
containerStyle: p,
|
|
722
729
|
defaultContainerSize: s,
|
|
723
730
|
direction: "vertical",
|
|
724
|
-
itemCount:
|
|
725
|
-
itemProps:
|
|
726
|
-
itemSize:
|
|
727
|
-
onResize:
|
|
728
|
-
overscanCount:
|
|
731
|
+
itemCount: l,
|
|
732
|
+
itemProps: m,
|
|
733
|
+
itemSize: V,
|
|
734
|
+
onResize: n,
|
|
735
|
+
overscanCount: i
|
|
729
736
|
});
|
|
730
|
-
|
|
737
|
+
ce(
|
|
731
738
|
r,
|
|
732
739
|
() => ({
|
|
733
740
|
get element() {
|
|
734
741
|
return g;
|
|
735
742
|
},
|
|
736
743
|
scrollToRow({
|
|
737
|
-
align:
|
|
738
|
-
behavior:
|
|
739
|
-
index:
|
|
744
|
+
align: v = "auto",
|
|
745
|
+
behavior: x = "auto",
|
|
746
|
+
index: A
|
|
740
747
|
}) {
|
|
741
|
-
const
|
|
742
|
-
align:
|
|
748
|
+
const M = k({
|
|
749
|
+
align: v,
|
|
743
750
|
containerScrollOffset: g?.scrollTop ?? 0,
|
|
744
|
-
index:
|
|
751
|
+
index: A
|
|
745
752
|
});
|
|
746
753
|
typeof g?.scrollTo == "function" && g.scrollTo({
|
|
747
|
-
behavior:
|
|
748
|
-
top:
|
|
754
|
+
behavior: x,
|
|
755
|
+
top: M
|
|
749
756
|
});
|
|
750
757
|
}
|
|
751
758
|
}),
|
|
752
|
-
[g,
|
|
753
|
-
),
|
|
754
|
-
|
|
759
|
+
[g, k]
|
|
760
|
+
), q(() => {
|
|
761
|
+
if (!g)
|
|
762
|
+
return;
|
|
763
|
+
const v = Array.from(g.children).filter((x, A) => {
|
|
764
|
+
if (x.hasAttribute("aria-hidden"))
|
|
765
|
+
return !1;
|
|
766
|
+
const M = `${S + A}`;
|
|
767
|
+
return x.setAttribute(te, M), !0;
|
|
768
|
+
});
|
|
769
|
+
if (y)
|
|
770
|
+
return c.observeRowElements(v);
|
|
771
|
+
}, [
|
|
772
|
+
g,
|
|
773
|
+
y,
|
|
774
|
+
c,
|
|
775
|
+
S,
|
|
776
|
+
O
|
|
777
|
+
]), J(() => {
|
|
778
|
+
S >= 0 && O >= 0 && o && o(
|
|
755
779
|
{
|
|
756
|
-
startIndex:
|
|
757
|
-
stopIndex:
|
|
780
|
+
startIndex: W,
|
|
781
|
+
stopIndex: h
|
|
758
782
|
},
|
|
759
783
|
{
|
|
760
|
-
startIndex:
|
|
761
|
-
stopIndex:
|
|
784
|
+
startIndex: S,
|
|
785
|
+
stopIndex: O
|
|
762
786
|
}
|
|
763
787
|
);
|
|
764
788
|
}, [
|
|
765
|
-
|
|
766
|
-
x,
|
|
767
|
-
z,
|
|
789
|
+
o,
|
|
768
790
|
S,
|
|
769
|
-
|
|
791
|
+
W,
|
|
792
|
+
O,
|
|
793
|
+
h
|
|
770
794
|
]);
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
for (let
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
|
|
795
|
+
const T = L(() => {
|
|
796
|
+
const v = [];
|
|
797
|
+
if (l > 0)
|
|
798
|
+
for (let x = S; x <= O; x++) {
|
|
799
|
+
const A = u(x);
|
|
800
|
+
v.push(
|
|
801
|
+
/* @__PURE__ */ X(
|
|
802
|
+
I,
|
|
779
803
|
{
|
|
780
|
-
...
|
|
804
|
+
...m,
|
|
781
805
|
ariaAttributes: {
|
|
782
|
-
"aria-posinset":
|
|
783
|
-
"aria-setsize":
|
|
806
|
+
"aria-posinset": x + 1,
|
|
807
|
+
"aria-setsize": l,
|
|
784
808
|
role: "listitem"
|
|
785
809
|
},
|
|
786
|
-
key:
|
|
787
|
-
index:
|
|
810
|
+
key: x,
|
|
811
|
+
index: x,
|
|
788
812
|
style: {
|
|
789
813
|
position: "absolute",
|
|
790
814
|
left: 0,
|
|
791
|
-
transform: `translateY(${
|
|
792
|
-
height
|
|
815
|
+
transform: `translateY(${A.scrollOffset}px)`,
|
|
816
|
+
// In case of dynamic row heights, don't specify a height style
|
|
817
|
+
// otherwise a default/estimated height would mask the actual height
|
|
818
|
+
height: y ? void 0 : A.size,
|
|
793
819
|
width: "100%"
|
|
794
820
|
}
|
|
795
821
|
}
|
|
796
822
|
)
|
|
797
823
|
);
|
|
798
824
|
}
|
|
799
|
-
return
|
|
825
|
+
return v;
|
|
800
826
|
}, [
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
S
|
|
807
|
-
|
|
827
|
+
I,
|
|
828
|
+
u,
|
|
829
|
+
y,
|
|
830
|
+
l,
|
|
831
|
+
m,
|
|
832
|
+
S,
|
|
833
|
+
O
|
|
834
|
+
]), E = /* @__PURE__ */ P(
|
|
808
835
|
"div",
|
|
809
836
|
{
|
|
810
837
|
"aria-hidden": !0,
|
|
811
838
|
style: {
|
|
812
|
-
height:
|
|
839
|
+
height: z(),
|
|
813
840
|
width: "100%",
|
|
814
841
|
zIndex: -1
|
|
815
842
|
}
|
|
816
843
|
}
|
|
817
844
|
);
|
|
818
|
-
return
|
|
819
|
-
|
|
845
|
+
return X(
|
|
846
|
+
f,
|
|
820
847
|
{
|
|
821
848
|
role: "list",
|
|
822
|
-
...
|
|
849
|
+
...b,
|
|
823
850
|
className: t,
|
|
824
|
-
ref:
|
|
851
|
+
ref: w,
|
|
825
852
|
style: {
|
|
826
853
|
position: "relative",
|
|
827
854
|
maxHeight: "100%",
|
|
828
855
|
flexGrow: 1,
|
|
829
856
|
overflowY: "auto",
|
|
830
|
-
...
|
|
857
|
+
...p
|
|
831
858
|
}
|
|
832
859
|
},
|
|
833
|
-
|
|
860
|
+
T,
|
|
834
861
|
e,
|
|
835
|
-
|
|
862
|
+
E
|
|
863
|
+
);
|
|
864
|
+
}
|
|
865
|
+
function ke({
|
|
866
|
+
defaultRowHeight: e,
|
|
867
|
+
key: t
|
|
868
|
+
}) {
|
|
869
|
+
const [s, r] = $({
|
|
870
|
+
key: t,
|
|
871
|
+
map: /* @__PURE__ */ new Map()
|
|
872
|
+
});
|
|
873
|
+
s.key !== t && r({
|
|
874
|
+
key: t,
|
|
875
|
+
map: /* @__PURE__ */ new Map()
|
|
876
|
+
});
|
|
877
|
+
const { map: n } = s, o = U(() => {
|
|
878
|
+
let f = 0;
|
|
879
|
+
return n.forEach((p) => {
|
|
880
|
+
f += p;
|
|
881
|
+
}), f === 0 ? e : f / n.size;
|
|
882
|
+
}, [e, n]), i = U(
|
|
883
|
+
(f) => n.get(f),
|
|
884
|
+
[n]
|
|
885
|
+
), a = U((f, p) => {
|
|
886
|
+
r((b) => {
|
|
887
|
+
if (b.map.get(f) === p)
|
|
888
|
+
return b;
|
|
889
|
+
const m = new Map(b.map);
|
|
890
|
+
return m.set(f, p), {
|
|
891
|
+
...b,
|
|
892
|
+
map: m
|
|
893
|
+
};
|
|
894
|
+
});
|
|
895
|
+
}, []), l = ae(
|
|
896
|
+
(f) => {
|
|
897
|
+
f.length !== 0 && f.forEach((p) => {
|
|
898
|
+
const { borderBoxSize: b, target: m } = p, I = m.getAttribute(te);
|
|
899
|
+
H(
|
|
900
|
+
I !== null,
|
|
901
|
+
`Invalid ${te} attribute value`
|
|
902
|
+
);
|
|
903
|
+
const g = parseInt(I), { blockSize: w } = b[0];
|
|
904
|
+
w && a(g, w);
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
), [c] = $(
|
|
908
|
+
() => new ResizeObserver(l)
|
|
909
|
+
);
|
|
910
|
+
J(() => () => {
|
|
911
|
+
c.disconnect();
|
|
912
|
+
}, [c]);
|
|
913
|
+
const d = U(
|
|
914
|
+
(f) => (f.forEach((p) => c.observe(p)), () => {
|
|
915
|
+
f.forEach((p) => c.unobserve(p));
|
|
916
|
+
}),
|
|
917
|
+
[c]
|
|
918
|
+
);
|
|
919
|
+
return L(
|
|
920
|
+
() => ({
|
|
921
|
+
getAverageRowHeight: o,
|
|
922
|
+
getRowHeight: i,
|
|
923
|
+
setRowHeight: a,
|
|
924
|
+
observeRowElements: d
|
|
925
|
+
}),
|
|
926
|
+
[o, i, a, d]
|
|
836
927
|
);
|
|
837
928
|
}
|
|
838
|
-
const Le =
|
|
839
|
-
let
|
|
840
|
-
function
|
|
841
|
-
if (
|
|
929
|
+
const Le = $, Me = K;
|
|
930
|
+
let C = -1;
|
|
931
|
+
function He(e = !1) {
|
|
932
|
+
if (C === -1 || e) {
|
|
842
933
|
const t = document.createElement("div"), s = t.style;
|
|
843
|
-
s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(t),
|
|
934
|
+
s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(t), C = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
844
935
|
}
|
|
845
|
-
return
|
|
936
|
+
return C;
|
|
846
937
|
}
|
|
847
938
|
export {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
Ve as
|
|
939
|
+
Re as Grid,
|
|
940
|
+
Ae as List,
|
|
941
|
+
He as getScrollbarSize,
|
|
942
|
+
ke as useDynamicRowHeight,
|
|
943
|
+
Ve as useGridCallbackRef,
|
|
944
|
+
Ee as useGridRef,
|
|
853
945
|
Le as useListCallbackRef,
|
|
854
|
-
|
|
946
|
+
Me as useListRef
|
|
855
947
|
};
|
|
856
948
|
//# sourceMappingURL=react-window.js.map
|