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