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