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