react-window 2.1.1 → 2.2.0-alpha.0

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