@midas-ds/components 11.1.0 → 11.2.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/CHANGELOG.md +25 -0
- package/{CheckboxGroup-oosHSGAt.js → CheckboxGroup-DvrN1oyw.js} +1 -1
- package/{ColorSchemeSwitch-Cnyb9EKC.js → ColorSchemeSwitch-PiEHptw1.js} +1 -1
- package/{ComboBox-CQ49PhNd.cjs → ComboBox-D_jh7TKo.cjs} +1 -1
- package/{ComboBox-D4MsSPBu.js → ComboBox-DfJ_aJrf.js} +10 -10
- package/{DateField-COs1-CkQ.js → DateField-DKCbEonm.js} +2 -2
- package/{DateInputDivider-B3oE1_tB.js → DateInputDivider-BmvqW1Hk.js} +2 -2
- package/{DateRangePicker-CvEycxmX.js → DateRangePicker-B5vx9onl.js} +183 -196
- package/DateRangePicker-DkIAEIIj.cjs +6 -0
- package/Dialog-CxHiZorC.cjs +1 -0
- package/{Dialog-DKHo0W9B.js → Dialog-D5c_dUnB.js} +3 -3
- package/Dialog-DuGcBeNN.js +212 -0
- package/{Dropdown-D6WCi_Ll.js → Dropdown-Cpc2EszJ.js} +1 -1
- package/{FocusScope-BCsrRPqD.js → FocusScope-DMsfA3bj.js} +1 -1
- package/{Label-DA6FZwy0.js → Label-endv1fkJ.js} +2 -2
- package/Layout-D0E1fOgZ.cjs +16 -0
- package/Layout-DtyhUz-G.js +498 -0
- package/{ListBox-CsxDGpCA.js → ListBox-Djy7244v.js} +5 -5
- package/{ListBoxButton-BsuHFd_O.cjs → ListBoxButton-CIqNRR3y.cjs} +1 -1
- package/{ListBoxButton-DawRfuny.js → ListBoxButton-sqirI6I4.js} +1 -1
- package/{ListBoxSection-C-Rz358T.cjs → ListBoxSection-BYJccE4T.cjs} +1 -1
- package/{ListBoxSection-Cc2cx0_S.js → ListBoxSection-Cicbu8pS.js} +375 -375
- package/{ListKeyboardDelegate-C-sPNj0f.js → ListKeyboardDelegate-CHki611g.js} +1 -1
- package/{Popover-DHoXfBp2.js → Popover-Tniqbaes.js} +1 -1
- package/{ProgressBar-C0IBfi5I.js → ProgressBar-DTn23Zkr.js} +1 -1
- package/{Radio-B6N9dCtB.js → Radio-CCN3o3s-.js} +2 -2
- package/{Select-DMVj2lrG.js → Select-MwvnbChP.js} +8 -8
- package/{Select-DiCEyap1.cjs → Select-lhIwwJL7.cjs} +1 -1
- package/{SelectionManager-BubxiIKu.js → SelectionManager-BKrZ_mMO.js} +1 -1
- package/{Separator-CEZ5y7tZ.js → Separator-DvvVAypT.js} +2 -2
- package/{TabList-BkSWzbDG.cjs → TabList-CWMlbijV.cjs} +1 -1
- package/{TabList-QApx8qRC.js → TabList-VpTv_Xff.js} +4 -4
- package/{Table-B5Aine4F.js → Table-DGTwyh7U.js} +4 -4
- package/{Tag-Byva_Xuy.js → Tag-rI-NhuT0.js} +7 -7
- package/{TextArea-eK7Jx3qs.js → TextArea-CrEALC58.js} +1 -1
- package/{ToggleButtonGroup-HjvaTYD4.js → ToggleButtonGroup-98z8Dw8-.js} +1 -1
- package/assets/Layout.css +1 -1
- package/assets/ListBoxSection.css +1 -1
- package/checkbox/index.js +1 -1
- package/color-scheme-switch/index.js +1 -1
- package/combobox/index.cjs +1 -1
- package/combobox/index.js +1 -1
- package/date-field/index.js +2 -2
- package/date-picker/DatePickerPopover.d.ts +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/dropdown/index.js +1 -1
- package/grid/index.d.ts +1 -1
- package/index.cjs +1 -1
- package/index.js +20 -20
- package/label/index.js +1 -1
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/list-box/index.cjs +1 -1
- package/list-box/index.js +2 -2
- package/modal/index.cjs +1 -1
- package/modal/index.js +2 -2
- package/package.json +1 -1
- package/popover/index.js +1 -1
- package/progress-bar/index.js +1 -1
- package/radio/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/table/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.js +1 -1
- package/textfield/index.js +1 -1
- package/theme/index.cjs +1 -1
- package/theme/index.d.ts +1 -0
- package/theme/index.js +2 -2
- package/theme/tokens.d.ts +1 -0
- package/toggle-button/index.js +1 -1
- package/{tokens-BF-dPard.cjs → tokens-5PzK5zK7.cjs} +1 -1
- package/{tokens-r1r3wC04.js → tokens-CqvelUoA.js} +13 -12
- package/{useFilter-DginflOU.js → useFilter-DsOxD9JB.js} +1 -1
- package/{useHasTabbableChild-DP62kzkG.js → useHasTabbableChild-BgEe5J35.js} +1 -1
- package/{useListState-DNB7JWoj.js → useListState-B3c3xcNW.js} +1 -1
- package/{useSingleSelectListState-B0OMoHd_.js → useSingleSelectListState-DdBsBWKG.js} +1 -1
- package/DateRangePicker-Bfibl08v.cjs +0 -6
- package/Dialog-B3R3WtL5.cjs +0 -1
- package/Dialog-BkUw6PlA.js +0 -221
- package/Layout-BwLxIwtY.cjs +0 -16
- package/Layout-CcADAhds.js +0 -498
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { $ as
|
|
3
|
-
import { d as
|
|
4
|
-
import w, { useState as S, useRef as C, useMemo as
|
|
5
|
-
import { $ as E, d as
|
|
1
|
+
import { jsx as k, jsxs as lt } from "react/jsx-runtime";
|
|
2
|
+
import { $ as ot, a as nt, b as st } from "./ListBox-Djy7244v.js";
|
|
3
|
+
import { d as rt, h as at } from "./Collection-D2jVTmDW.js";
|
|
4
|
+
import w, { useState as S, useRef as C, useMemo as _, useCallback as L, useEffect as ht, createContext as X, useContext as A } from "react";
|
|
5
|
+
import { $ as E, d as dt } from "./mergeProps-C1U1OIeJ.js";
|
|
6
6
|
import { $ as F } from "./context-CGNJ3grH.js";
|
|
7
7
|
import { flushSync as P } from "react-dom";
|
|
8
|
-
import { g as
|
|
9
|
-
import { $ as
|
|
8
|
+
import { g as ct } from "./OverlayArrow-DB_aVTVM.js";
|
|
9
|
+
import { $ as ut } from "./useEvent-CigwyJOw.js";
|
|
10
10
|
import { c as K } from "./clsx-OuTLNxxd.js";
|
|
11
|
-
import { f as Y } from "./SelectionManager-
|
|
12
|
-
import { a as
|
|
13
|
-
import { e as
|
|
14
|
-
import './assets/ListBoxSection.css';class
|
|
11
|
+
import { f as Y } from "./SelectionManager-BKrZ_mMO.js";
|
|
12
|
+
import { a as ft } from "./Dialog-D5c_dUnB.js";
|
|
13
|
+
import { e as gt } from "./Separator-DvvVAypT.js";
|
|
14
|
+
import './assets/ListBoxSection.css';class yt {
|
|
15
15
|
/**
|
|
16
16
|
* Returns whether the layout should invalidate in response to
|
|
17
17
|
* visible rectangle changes. By default, it only invalidates
|
|
18
18
|
* when the virtualizer's size changes. Return true always
|
|
19
19
|
* to make the layout invalidate while scrolling (e.g. sticky headers).
|
|
20
20
|
*/
|
|
21
|
-
shouldInvalidate(
|
|
22
|
-
return
|
|
21
|
+
shouldInvalidate(t, e) {
|
|
22
|
+
return t.width !== e.width || t.height !== e.height;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Returns whether the layout should invalidate when the layout options change.
|
|
26
26
|
* By default it invalidates when the object identity changes. Override this
|
|
27
27
|
* method to optimize layout updates based on specific option changes.
|
|
28
28
|
*/
|
|
29
|
-
shouldInvalidateLayoutOptions(
|
|
30
|
-
return
|
|
29
|
+
shouldInvalidateLayoutOptions(t, e) {
|
|
30
|
+
return t !== e;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* This method allows the layout to perform any pre-computation
|
|
@@ -35,12 +35,12 @@ import './assets/ListBoxSection.css';class ye {
|
|
|
35
35
|
* Called by the virtualizer before `getVisibleLayoutInfos`
|
|
36
36
|
* or `getLayoutInfo` are called.
|
|
37
37
|
*/
|
|
38
|
-
update(
|
|
38
|
+
update(t) {
|
|
39
39
|
}
|
|
40
40
|
/** @private */
|
|
41
|
-
getItemRect(
|
|
42
|
-
var
|
|
43
|
-
return (i = (
|
|
41
|
+
getItemRect(t) {
|
|
42
|
+
var e, i;
|
|
43
|
+
return (i = (e = this.getLayoutInfo(t)) === null || e === void 0 ? void 0 : e.rect) !== null && i !== void 0 ? i : null;
|
|
44
44
|
}
|
|
45
45
|
/** @private */
|
|
46
46
|
getVisibleRect() {
|
|
@@ -55,16 +55,16 @@ class b {
|
|
|
55
55
|
* Returns a copy of the LayoutInfo.
|
|
56
56
|
*/
|
|
57
57
|
copy() {
|
|
58
|
-
let
|
|
59
|
-
return
|
|
58
|
+
let t = new b(this.type, this.key, this.rect.copy());
|
|
59
|
+
return t.estimatedSize = this.estimatedSize, t.opacity = this.opacity, t.transform = this.transform, t.parentKey = this.parentKey, t.content = this.content, t.isSticky = this.isSticky, t.zIndex = this.zIndex, t.allowOverflow = this.allowOverflow, t;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @param type The type of element represented by this LayoutInfo. Should match the `type` of the corresponding collection node.
|
|
63
63
|
* @param key A unique key for this LayoutInfo. Should match the `key` of the corresponding collection node.
|
|
64
64
|
* @param rect The rectangle describing the size and position of this element.
|
|
65
65
|
*/
|
|
66
|
-
constructor(
|
|
67
|
-
this.type =
|
|
66
|
+
constructor(t, e, i) {
|
|
67
|
+
this.type = t, this.key = e, this.parentKey = null, this.content = null, this.rect = i, this.estimatedSize = !1, this.isSticky = !1, this.opacity = 1, this.transform = null, this.zIndex = 0, this.allowOverflow = !1;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
class x {
|
|
@@ -77,8 +77,8 @@ class x {
|
|
|
77
77
|
/**
|
|
78
78
|
* Checks if two points are equal.
|
|
79
79
|
*/
|
|
80
|
-
equals(
|
|
81
|
-
return this.x ===
|
|
80
|
+
equals(t) {
|
|
81
|
+
return this.x === t.x && this.y === t.y;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Returns true if this point is the origin.
|
|
@@ -86,8 +86,8 @@ class x {
|
|
|
86
86
|
isOrigin() {
|
|
87
87
|
return this.x === 0 && this.y === 0;
|
|
88
88
|
}
|
|
89
|
-
constructor(
|
|
90
|
-
this.x =
|
|
89
|
+
constructor(t = 0, e = 0) {
|
|
90
|
+
this.x = t, this.y = e;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
class u {
|
|
@@ -137,62 +137,62 @@ class u {
|
|
|
137
137
|
* Returns whether this rectangle intersects another rectangle.
|
|
138
138
|
* @param rect - The rectangle to check.
|
|
139
139
|
*/
|
|
140
|
-
intersects(
|
|
141
|
-
return this.area > 0 &&
|
|
140
|
+
intersects(t) {
|
|
141
|
+
return this.area > 0 && t.area > 0 && this.x <= t.x + t.width && t.x <= this.x + this.width && this.y <= t.y + t.height && t.y <= this.y + this.height;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* Returns whether this rectangle fully contains another rectangle.
|
|
145
145
|
* @param rect - The rectangle to check.
|
|
146
146
|
*/
|
|
147
|
-
containsRect(
|
|
148
|
-
return this.x <=
|
|
147
|
+
containsRect(t) {
|
|
148
|
+
return this.x <= t.x && this.y <= t.y && this.maxX >= t.maxX && this.maxY >= t.maxY;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
151
|
* Returns whether the rectangle contains the given point.
|
|
152
152
|
* @param point - The point to check.
|
|
153
153
|
*/
|
|
154
|
-
containsPoint(
|
|
155
|
-
return this.x <=
|
|
154
|
+
containsPoint(t) {
|
|
155
|
+
return this.x <= t.x && this.y <= t.y && this.maxX >= t.x && this.maxY >= t.y;
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Returns the first corner of this rectangle (from top to bottom, left to right)
|
|
159
159
|
* that is contained in the given rectangle, or null of the rectangles do not intersect.
|
|
160
160
|
* @param rect - The rectangle to check.
|
|
161
161
|
*/
|
|
162
|
-
getCornerInRect(
|
|
163
|
-
for (let
|
|
162
|
+
getCornerInRect(t) {
|
|
163
|
+
for (let e of [
|
|
164
164
|
"topLeft",
|
|
165
165
|
"topRight",
|
|
166
166
|
"bottomLeft",
|
|
167
167
|
"bottomRight"
|
|
168
168
|
])
|
|
169
|
-
if (
|
|
169
|
+
if (t.containsPoint(this[e])) return e;
|
|
170
170
|
return null;
|
|
171
171
|
}
|
|
172
|
-
equals(
|
|
173
|
-
return
|
|
172
|
+
equals(t) {
|
|
173
|
+
return t.x === this.x && t.y === this.y && t.width === this.width && t.height === this.height;
|
|
174
174
|
}
|
|
175
|
-
pointEquals(
|
|
176
|
-
return this.x ===
|
|
175
|
+
pointEquals(t) {
|
|
176
|
+
return this.x === t.x && this.y === t.y;
|
|
177
177
|
}
|
|
178
|
-
sizeEquals(
|
|
179
|
-
return this.width ===
|
|
178
|
+
sizeEquals(t) {
|
|
179
|
+
return this.width === t.width && this.height === t.height;
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* Returns the union of this Rect and another.
|
|
183
183
|
*/
|
|
184
|
-
union(
|
|
185
|
-
let
|
|
186
|
-
return new u(
|
|
184
|
+
union(t) {
|
|
185
|
+
let e = Math.min(this.x, t.x), i = Math.min(this.y, t.y), l = Math.max(this.maxX, t.maxX) - e, o = Math.max(this.maxY, t.maxY) - i;
|
|
186
|
+
return new u(e, i, l, o);
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Returns the intersection of this Rect with another.
|
|
190
190
|
* If the rectangles do not intersect, an all zero Rect is returned.
|
|
191
191
|
*/
|
|
192
|
-
intersection(
|
|
193
|
-
if (!this.intersects(
|
|
194
|
-
let
|
|
195
|
-
return new u(
|
|
192
|
+
intersection(t) {
|
|
193
|
+
if (!this.intersects(t)) return new u(0, 0, 0, 0);
|
|
194
|
+
let e = Math.max(this.x, t.x), i = Math.max(this.y, t.y);
|
|
195
|
+
return new u(e, i, Math.min(this.maxX, t.maxX) - e, Math.min(this.maxY, t.maxY) - i);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Returns a copy of this rectangle.
|
|
@@ -200,8 +200,8 @@ class u {
|
|
|
200
200
|
copy() {
|
|
201
201
|
return new u(this.x, this.y, this.width, this.height);
|
|
202
202
|
}
|
|
203
|
-
constructor(
|
|
204
|
-
this.x =
|
|
203
|
+
constructor(t = 0, e = 0, i = 0, l = 0) {
|
|
204
|
+
this.x = t, this.y = e, this.width = i, this.height = l;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
class z {
|
|
@@ -214,8 +214,8 @@ class z {
|
|
|
214
214
|
/**
|
|
215
215
|
* Returns whether this size is equal to another one.
|
|
216
216
|
*/
|
|
217
|
-
equals(
|
|
218
|
-
return this.width ===
|
|
217
|
+
equals(t) {
|
|
218
|
+
return this.width === t.width && this.height === t.height;
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* The total area of the Size.
|
|
@@ -223,11 +223,11 @@ class z {
|
|
|
223
223
|
get area() {
|
|
224
224
|
return this.width * this.height;
|
|
225
225
|
}
|
|
226
|
-
constructor(
|
|
227
|
-
this.width = Math.max(
|
|
226
|
+
constructor(t = 0, e = 0) {
|
|
227
|
+
this.width = Math.max(t, 0), this.height = Math.max(e, 0);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
let
|
|
230
|
+
let vt = 0;
|
|
231
231
|
class j {
|
|
232
232
|
/**
|
|
233
233
|
* Prepares the view for reuse. Called just before the view is removed from the DOM.
|
|
@@ -235,135 +235,135 @@ class j {
|
|
|
235
235
|
prepareForReuse() {
|
|
236
236
|
this.content = null, this.rendered = null, this.layoutInfo = null;
|
|
237
237
|
}
|
|
238
|
-
getReusableView(
|
|
239
|
-
let
|
|
240
|
-
return
|
|
238
|
+
getReusableView(t) {
|
|
239
|
+
let e = this.reusableViews.get(t);
|
|
240
|
+
return e && e.length > 0 ? e.shift() : new mt(this.virtualizer, this, t);
|
|
241
241
|
}
|
|
242
|
-
reuseChild(
|
|
243
|
-
|
|
244
|
-
let
|
|
245
|
-
|
|
242
|
+
reuseChild(t) {
|
|
243
|
+
t.prepareForReuse();
|
|
244
|
+
let e = this.reusableViews.get(t.viewType);
|
|
245
|
+
e || (e = [], this.reusableViews.set(t.viewType, e)), e.push(t);
|
|
246
246
|
}
|
|
247
|
-
constructor(
|
|
248
|
-
this.virtualizer =
|
|
247
|
+
constructor(t, e) {
|
|
248
|
+
this.virtualizer = t, this.key = ++vt, this.viewType = e, this.children = /* @__PURE__ */ new Set(), this.reusableViews = /* @__PURE__ */ new Map(), this.layoutInfo = null, this.content = null, this.rendered = null;
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
class
|
|
252
|
-
constructor(
|
|
253
|
-
super(
|
|
251
|
+
class pt extends j {
|
|
252
|
+
constructor(t) {
|
|
253
|
+
super(t, "root");
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
class
|
|
257
|
-
constructor(
|
|
258
|
-
super(
|
|
256
|
+
class mt extends j {
|
|
257
|
+
constructor(t, e, i) {
|
|
258
|
+
super(t, i), this.parent = e;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
if (n ===
|
|
263
|
-
if (n.size !==
|
|
264
|
-
for (let
|
|
265
|
-
if (!
|
|
261
|
+
function wt(n, t) {
|
|
262
|
+
if (n === t) return !0;
|
|
263
|
+
if (n.size !== t.size) return !1;
|
|
264
|
+
for (let e of n)
|
|
265
|
+
if (!t.has(e)) return !1;
|
|
266
266
|
return !0;
|
|
267
267
|
}
|
|
268
|
-
class
|
|
269
|
-
setVisibleRect(
|
|
270
|
-
let
|
|
271
|
-
|
|
268
|
+
class bt {
|
|
269
|
+
setVisibleRect(t) {
|
|
270
|
+
let e = performance.now() - this.startTime;
|
|
271
|
+
e < 500 && (t.x !== this.visibleRect.x && e > 0 && (this.velocity.x = (t.x - this.visibleRect.x) / e), t.y !== this.visibleRect.y && e > 0 && (this.velocity.y = (t.y - this.visibleRect.y) / e)), this.startTime = performance.now(), this.visibleRect = t;
|
|
272
272
|
}
|
|
273
273
|
getOverscannedRect() {
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
274
|
+
let t = this.visibleRect.copy(), e = this.visibleRect.height / 3;
|
|
275
|
+
if (t.height += e, this.velocity.y < 0 && (t.y -= e), this.velocity.x !== 0) {
|
|
276
276
|
let i = this.visibleRect.width / 3;
|
|
277
|
-
|
|
277
|
+
t.width += i, this.velocity.x < 0 && (t.x -= i);
|
|
278
278
|
}
|
|
279
|
-
return
|
|
279
|
+
return t;
|
|
280
280
|
}
|
|
281
281
|
constructor() {
|
|
282
282
|
this.startTime = 0, this.velocity = new x(0, 0), this.visibleRect = new u();
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
class
|
|
285
|
+
class xt {
|
|
286
286
|
/** Returns whether the given key, or an ancestor, is persisted. */
|
|
287
|
-
isPersistedKey(
|
|
288
|
-
if (this.persistedKeys.has(
|
|
289
|
-
for (let
|
|
290
|
-
let i = this.layout.getLayoutInfo(
|
|
287
|
+
isPersistedKey(t) {
|
|
288
|
+
if (this.persistedKeys.has(t)) return !0;
|
|
289
|
+
for (let e of this.persistedKeys) for (; e != null; ) {
|
|
290
|
+
let i = this.layout.getLayoutInfo(e);
|
|
291
291
|
if (!i || i.parentKey == null) break;
|
|
292
|
-
if (
|
|
292
|
+
if (e = i.parentKey, e === t) return !0;
|
|
293
293
|
}
|
|
294
294
|
return !1;
|
|
295
295
|
}
|
|
296
|
-
getParentView(
|
|
297
|
-
return
|
|
296
|
+
getParentView(t) {
|
|
297
|
+
return t.parentKey != null ? this._visibleViews.get(t.parentKey) : this._rootView;
|
|
298
298
|
}
|
|
299
|
-
getReusableView(
|
|
300
|
-
let i = this.getParentView(
|
|
301
|
-
return i.layoutInfo =
|
|
299
|
+
getReusableView(t) {
|
|
300
|
+
let i = this.getParentView(t).getReusableView(t.type);
|
|
301
|
+
return i.layoutInfo = t, this._renderView(i), i;
|
|
302
302
|
}
|
|
303
|
-
_renderView(
|
|
304
|
-
if (
|
|
305
|
-
let { type:
|
|
306
|
-
|
|
303
|
+
_renderView(t) {
|
|
304
|
+
if (t.layoutInfo) {
|
|
305
|
+
let { type: e, key: i, content: l } = t.layoutInfo;
|
|
306
|
+
t.content = l || this.collection.getItem(i), t.rendered = this._renderContent(e, t.content);
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
_renderContent(
|
|
310
|
-
let i =
|
|
309
|
+
_renderContent(t, e) {
|
|
310
|
+
let i = e != null ? this._renderedContent.get(e) : null;
|
|
311
311
|
if (i != null) return i;
|
|
312
|
-
let l = this.delegate.renderView(
|
|
313
|
-
return
|
|
312
|
+
let l = this.delegate.renderView(t, e);
|
|
313
|
+
return e && this._renderedContent.set(e, l), l;
|
|
314
314
|
}
|
|
315
315
|
/**
|
|
316
316
|
* Returns the key for the item view currently at the given point.
|
|
317
317
|
*/
|
|
318
|
-
keyAtPoint(
|
|
319
|
-
let
|
|
318
|
+
keyAtPoint(t) {
|
|
319
|
+
let e = new u(t.x, t.y, 1, 1), i = e.area === 0 ? [] : this.layout.getVisibleLayoutInfos(e);
|
|
320
320
|
for (let l of i)
|
|
321
|
-
if (l.rect.intersects(
|
|
321
|
+
if (l.rect.intersects(e)) return l.key;
|
|
322
322
|
return null;
|
|
323
323
|
}
|
|
324
|
-
relayout(
|
|
325
|
-
this.layout.update(
|
|
326
|
-
let
|
|
327
|
-
if (i = Math.max(0, Math.min(this.contentSize.width -
|
|
328
|
-
let o = new u(i, l,
|
|
324
|
+
relayout(t = {}) {
|
|
325
|
+
this.layout.update(t), this.contentSize = this.layout.getContentSize();
|
|
326
|
+
let e = this.visibleRect, i = t.contentChanged ? 0 : e.x, l = t.contentChanged ? 0 : e.y;
|
|
327
|
+
if (i = Math.max(0, Math.min(this.contentSize.width - e.width, i)), l = Math.max(0, Math.min(this.contentSize.height - e.height, l)), i !== e.x || l !== e.y) {
|
|
328
|
+
let o = new u(i, l, e.width, e.height);
|
|
329
329
|
this.delegate.setVisibleRect(o);
|
|
330
330
|
} else this.updateSubviews();
|
|
331
331
|
}
|
|
332
332
|
getVisibleLayoutInfos() {
|
|
333
|
-
let
|
|
334
|
-
|
|
333
|
+
let t = process.env.NODE_ENV === "test" && !process.env.VIRT_ON, e = t && typeof HTMLElement < "u" && Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientWidth"), i = t && typeof HTMLElement < "u" && Object.getOwnPropertyNames(HTMLElement.prototype).includes("clientHeight"), l;
|
|
334
|
+
t && !(e && i) ? l = new u(0, 0, this.contentSize.width, this.contentSize.height) : l = this._overscanManager.getOverscannedRect();
|
|
335
335
|
let o = this.layout.getVisibleLayoutInfos(l), s = /* @__PURE__ */ new Map();
|
|
336
336
|
for (let a of o) s.set(a.key, a);
|
|
337
337
|
return s;
|
|
338
338
|
}
|
|
339
339
|
updateSubviews() {
|
|
340
|
-
let
|
|
340
|
+
let t = this.getVisibleLayoutInfos(), e = /* @__PURE__ */ new Set();
|
|
341
341
|
for (let [i, l] of this._visibleViews) {
|
|
342
|
-
let o =
|
|
343
|
-
(!o || l.parent !== this.getParentView(o)) && (this._visibleViews.delete(i), l.parent.reuseChild(l),
|
|
342
|
+
let o = t.get(i);
|
|
343
|
+
(!o || l.parent !== this.getParentView(o)) && (this._visibleViews.delete(i), l.parent.reuseChild(l), e.add(l));
|
|
344
344
|
}
|
|
345
|
-
for (let [i, l] of
|
|
345
|
+
for (let [i, l] of t) {
|
|
346
346
|
let o = this._visibleViews.get(i);
|
|
347
347
|
if (!o)
|
|
348
|
-
o = this.getReusableView(l), o.parent.children.add(o), this._visibleViews.set(i, o),
|
|
348
|
+
o = this.getReusableView(l), o.parent.children.add(o), this._visibleViews.set(i, o), e.delete(o);
|
|
349
349
|
else {
|
|
350
350
|
o.layoutInfo = l;
|
|
351
351
|
let s = this.collection.getItem(l.key);
|
|
352
352
|
o.content !== s && (o.content != null && this._renderedContent.delete(o.content), this._renderView(o));
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
for (let i of
|
|
355
|
+
for (let i of e)
|
|
356
356
|
i.parent.children.delete(i), i.parent.reusableViews.clear();
|
|
357
357
|
if (!this._isScrolling)
|
|
358
|
-
for (let i of
|
|
358
|
+
for (let i of t.keys()) {
|
|
359
359
|
let l = this._visibleViews.get(i);
|
|
360
360
|
l.parent.children.delete(l), l.parent.children.add(l);
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
/** Performs layout and updates visible views as needed. */
|
|
364
|
-
render(
|
|
365
|
-
let
|
|
366
|
-
return
|
|
364
|
+
render(t) {
|
|
365
|
+
let e = this, i = !1, l = !1, o = !1, s = !1, a = !1, h = !1;
|
|
366
|
+
return t.collection !== this.collection && (e.collection = t.collection, i = !0), (t.layout !== this.layout || this.layout.virtualizer !== this) && (this.layout && (this.layout.virtualizer = null), t.layout.virtualizer = this, e.layout = t.layout, i = !0), t.persistedKeys && !wt(t.persistedKeys, this.persistedKeys) && (e.persistedKeys = t.persistedKeys, h = !0), this.visibleRect.equals(t.visibleRect) || (this._overscanManager.setVisibleRect(t.visibleRect), this.layout.shouldInvalidate(t.visibleRect, this.visibleRect) ? (l = !t.visibleRect.pointEquals(this.visibleRect), o = !t.visibleRect.sizeEquals(this.visibleRect), i = !0) : h = !0, e.visibleRect = t.visibleRect), t.invalidationContext !== this._invalidationContext && (t.invalidationContext && (o || (o = t.invalidationContext.sizeChanged || !1), l || (l = t.invalidationContext.offsetChanged || !1), s || (s = t.invalidationContext.itemSizeChanged || !1), a || (a = t.invalidationContext.layoutOptions != null && this._invalidationContext.layoutOptions != null && t.invalidationContext.layoutOptions !== this._invalidationContext.layoutOptions && this.layout.shouldInvalidateLayoutOptions(t.invalidationContext.layoutOptions, this._invalidationContext.layoutOptions)), i || (i = s || o || l || a)), this._invalidationContext = t.invalidationContext), t.isScrolling !== this._isScrolling && (this._isScrolling = t.isScrolling, t.isScrolling || (h = !0)), i ? this.relayout({
|
|
367
367
|
offsetChanged: l,
|
|
368
368
|
sizeChanged: o,
|
|
369
369
|
itemSizeChanged: s,
|
|
@@ -371,29 +371,29 @@ class xe {
|
|
|
371
371
|
layoutOptions: this._invalidationContext.layoutOptions
|
|
372
372
|
}) : h && this.updateSubviews(), Array.from(this._rootView.children);
|
|
373
373
|
}
|
|
374
|
-
getVisibleView(
|
|
375
|
-
return this._visibleViews.get(
|
|
374
|
+
getVisibleView(t) {
|
|
375
|
+
return this._visibleViews.get(t);
|
|
376
376
|
}
|
|
377
|
-
invalidate(
|
|
378
|
-
this.delegate.invalidate(
|
|
377
|
+
invalidate(t) {
|
|
378
|
+
this.delegate.invalidate(t);
|
|
379
379
|
}
|
|
380
|
-
updateItemSize(
|
|
380
|
+
updateItemSize(t, e) {
|
|
381
381
|
if (!this.layout.updateItemSize) return;
|
|
382
|
-
this.layout.updateItemSize(
|
|
382
|
+
this.layout.updateItemSize(t, e) && this.invalidate({
|
|
383
383
|
itemSizeChanged: !0
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
|
-
constructor(
|
|
387
|
-
this.delegate =
|
|
386
|
+
constructor(t) {
|
|
387
|
+
this.delegate = t.delegate, this.collection = t.collection, this.layout = t.layout, this.contentSize = new z(), this.visibleRect = new u(), this.persistedKeys = /* @__PURE__ */ new Set(), this._visibleViews = /* @__PURE__ */ new Map(), this._renderedContent = /* @__PURE__ */ new WeakMap(), this._rootView = new pt(this), this._isScrolling = !1, this._invalidationContext = {}, this._overscanManager = new bt();
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
let [
|
|
390
|
+
function It(n) {
|
|
391
|
+
let [t, e] = S(new u(0, 0, 0, 0)), [i, l] = S(!1), [o, s] = S({}), a = C(!1), [h] = S(() => new xt({
|
|
392
392
|
collection: n.collection,
|
|
393
393
|
layout: n.layout,
|
|
394
394
|
delegate: {
|
|
395
395
|
setVisibleRect(p) {
|
|
396
|
-
|
|
396
|
+
e(p), a.current = !0;
|
|
397
397
|
},
|
|
398
398
|
// TODO: should changing these invalidate the entire cache?
|
|
399
399
|
renderView: n.renderView,
|
|
@@ -401,9 +401,9 @@ function Ie(n) {
|
|
|
401
401
|
}
|
|
402
402
|
}));
|
|
403
403
|
E(() => {
|
|
404
|
-
a.current && (a.current = !1, n.onVisibleRectChange(
|
|
404
|
+
a.current && (a.current = !1, n.onVisibleRectChange(t));
|
|
405
405
|
});
|
|
406
|
-
let r =
|
|
406
|
+
let r = _(() => n.layoutOptions != null ? {
|
|
407
407
|
...o,
|
|
408
408
|
layoutOptions: n.layoutOptions
|
|
409
409
|
} : o, [
|
|
@@ -414,7 +414,7 @@ function Ie(n) {
|
|
|
414
414
|
collection: n.collection,
|
|
415
415
|
persistedKeys: n.persistedKeys,
|
|
416
416
|
layoutOptions: n.layoutOptions,
|
|
417
|
-
visibleRect:
|
|
417
|
+
visibleRect: t,
|
|
418
418
|
invalidationContext: r,
|
|
419
419
|
isScrolling: i
|
|
420
420
|
}), c = h.contentSize, f = L(() => {
|
|
@@ -422,10 +422,10 @@ function Ie(n) {
|
|
|
422
422
|
}, []), g = L(() => {
|
|
423
423
|
l(!1);
|
|
424
424
|
}, []);
|
|
425
|
-
return
|
|
425
|
+
return _(() => ({
|
|
426
426
|
virtualizer: h,
|
|
427
427
|
visibleViews: d,
|
|
428
|
-
setVisibleRect:
|
|
428
|
+
setVisibleRect: e,
|
|
429
429
|
contentSize: c,
|
|
430
430
|
isScrolling: i,
|
|
431
431
|
startScrolling: f,
|
|
@@ -433,7 +433,7 @@ function Ie(n) {
|
|
|
433
433
|
}), [
|
|
434
434
|
h,
|
|
435
435
|
d,
|
|
436
|
-
|
|
436
|
+
e,
|
|
437
437
|
c,
|
|
438
438
|
i,
|
|
439
439
|
f,
|
|
@@ -441,52 +441,52 @@ function Ie(n) {
|
|
|
441
441
|
]);
|
|
442
442
|
}
|
|
443
443
|
const R = 48;
|
|
444
|
-
class
|
|
444
|
+
class Rt extends yt {
|
|
445
445
|
// Backward compatibility for subclassing.
|
|
446
446
|
get collection() {
|
|
447
447
|
return this.virtualizer.collection;
|
|
448
448
|
}
|
|
449
|
-
getLayoutInfo(
|
|
450
|
-
var
|
|
451
|
-
return this.ensureLayoutInfo(
|
|
449
|
+
getLayoutInfo(t) {
|
|
450
|
+
var e;
|
|
451
|
+
return this.ensureLayoutInfo(t), ((e = this.layoutNodes.get(t)) === null || e === void 0 ? void 0 : e.layoutInfo) || null;
|
|
452
452
|
}
|
|
453
|
-
getVisibleLayoutInfos(
|
|
454
|
-
if (
|
|
455
|
-
var
|
|
456
|
-
let s = ((i = (
|
|
457
|
-
|
|
453
|
+
getVisibleLayoutInfos(t) {
|
|
454
|
+
if (t.height > 1) {
|
|
455
|
+
var e, i;
|
|
456
|
+
let s = ((i = (e = this.rowHeight) !== null && e !== void 0 ? e : this.estimatedRowHeight) !== null && i !== void 0 ? i : R) + this.gap;
|
|
457
|
+
t.y = Math.floor(t.y / s) * s, t.height = Math.ceil(t.height / s) * s;
|
|
458
458
|
}
|
|
459
|
-
this.layoutIfNeeded(
|
|
459
|
+
this.layoutIfNeeded(t);
|
|
460
460
|
let l = [], o = (s) => {
|
|
461
|
-
for (let a of s) this.isVisible(a,
|
|
461
|
+
for (let a of s) this.isVisible(a, t) && (l.push(a.layoutInfo), a.children && o(a.children));
|
|
462
462
|
};
|
|
463
463
|
return o(this.rootNodes), l;
|
|
464
464
|
}
|
|
465
|
-
layoutIfNeeded(
|
|
465
|
+
layoutIfNeeded(t) {
|
|
466
466
|
if (this.lastCollection) {
|
|
467
|
-
this.requestedRect.containsRect(
|
|
468
|
-
for (let
|
|
469
|
-
if (this.ensureLayoutInfo(
|
|
467
|
+
this.requestedRect.containsRect(t) || (this.requestedRect = this.requestedRect.union(t), this.rootNodes = this.buildCollection());
|
|
468
|
+
for (let e of this.virtualizer.persistedKeys)
|
|
469
|
+
if (this.ensureLayoutInfo(e)) return;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
ensureLayoutInfo(
|
|
473
|
-
return !this.layoutNodes.has(
|
|
472
|
+
ensureLayoutInfo(t) {
|
|
473
|
+
return !this.layoutNodes.has(t) && this.requestedRect.area < this.contentSize.area && this.lastCollection ? (this.requestedRect = new u(0, 0, 1 / 0, 1 / 0), this.rootNodes = this.buildCollection(), this.requestedRect = new u(0, 0, this.contentSize.width, this.contentSize.height), !0) : !1;
|
|
474
474
|
}
|
|
475
|
-
isVisible(
|
|
476
|
-
return
|
|
475
|
+
isVisible(t, e) {
|
|
476
|
+
return t.layoutInfo.rect.intersects(e) || t.layoutInfo.isSticky || t.layoutInfo.type === "header" || t.layoutInfo.type === "loader" || this.virtualizer.isPersistedKey(t.layoutInfo.key);
|
|
477
477
|
}
|
|
478
|
-
shouldInvalidateEverything(
|
|
479
|
-
let
|
|
478
|
+
shouldInvalidateEverything(t) {
|
|
479
|
+
let e = t.layoutOptions;
|
|
480
480
|
var i, l, o, s, a;
|
|
481
|
-
return
|
|
481
|
+
return t.sizeChanged || this.rowHeight !== ((i = e == null ? void 0 : e.rowHeight) !== null && i !== void 0 ? i : this.rowHeight) || this.headingHeight !== ((l = e == null ? void 0 : e.headingHeight) !== null && l !== void 0 ? l : this.headingHeight) || this.loaderHeight !== ((o = e == null ? void 0 : e.loaderHeight) !== null && o !== void 0 ? o : this.loaderHeight) || this.gap !== ((s = e == null ? void 0 : e.gap) !== null && s !== void 0 ? s : this.gap) || this.padding !== ((a = e == null ? void 0 : e.padding) !== null && a !== void 0 ? a : this.padding);
|
|
482
482
|
}
|
|
483
|
-
shouldInvalidateLayoutOptions(
|
|
484
|
-
return
|
|
483
|
+
shouldInvalidateLayoutOptions(t, e) {
|
|
484
|
+
return t.rowHeight !== e.rowHeight || t.estimatedRowHeight !== e.estimatedRowHeight || t.headingHeight !== e.headingHeight || t.estimatedHeadingHeight !== e.estimatedHeadingHeight || t.loaderHeight !== e.loaderHeight || t.dropIndicatorThickness !== e.dropIndicatorThickness || t.gap !== e.gap || t.padding !== e.padding;
|
|
485
485
|
}
|
|
486
|
-
update(
|
|
487
|
-
let
|
|
488
|
-
this.invalidateEverything = this.shouldInvalidateEverything(
|
|
489
|
-
let i =
|
|
486
|
+
update(t) {
|
|
487
|
+
let e = this.virtualizer.collection;
|
|
488
|
+
this.invalidateEverything = this.shouldInvalidateEverything(t), this.invalidateEverything && (this.requestedRect = this.virtualizer.visibleRect.copy(), this.layoutNodes.clear());
|
|
489
|
+
let i = t.layoutOptions;
|
|
490
490
|
var l;
|
|
491
491
|
this.rowHeight = (l = i == null ? void 0 : i.rowHeight) !== null && l !== void 0 ? l : this.rowHeight;
|
|
492
492
|
var o;
|
|
@@ -502,80 +502,80 @@ class Re extends ye {
|
|
|
502
502
|
var d;
|
|
503
503
|
this.gap = (d = i == null ? void 0 : i.gap) !== null && d !== void 0 ? d : this.gap;
|
|
504
504
|
var c;
|
|
505
|
-
if (this.padding = (c = i == null ? void 0 : i.padding) !== null && c !== void 0 ? c : this.padding, this.rootNodes = this.buildCollection(), this.lastCollection &&
|
|
506
|
-
for (let f of this.lastCollection.getKeys())
|
|
507
|
-
this.lastCollection =
|
|
508
|
-
}
|
|
509
|
-
buildCollection(
|
|
510
|
-
let
|
|
511
|
-
o && (
|
|
512
|
-
for (let r of
|
|
505
|
+
if (this.padding = (c = i == null ? void 0 : i.padding) !== null && c !== void 0 ? c : this.padding, this.rootNodes = this.buildCollection(), this.lastCollection && e !== this.lastCollection)
|
|
506
|
+
for (let f of this.lastCollection.getKeys()) e.getItem(f) || this.layoutNodes.get(f) && this.layoutNodes.delete(f);
|
|
507
|
+
this.lastCollection = e, this.invalidateEverything = !1, this.validRect = this.requestedRect.copy();
|
|
508
|
+
}
|
|
509
|
+
buildCollection(t = this.padding) {
|
|
510
|
+
let e = this.virtualizer.collection, i = 0, l = [], o = (e == null ? void 0 : e.size) === 0 || e.size === 1 && e.getItem(e.getFirstKey()).type === "loader";
|
|
511
|
+
o && (t = 0);
|
|
512
|
+
for (let r of e) {
|
|
513
513
|
var s, a;
|
|
514
514
|
let d = ((a = (s = this.rowHeight) !== null && s !== void 0 ? s : this.estimatedRowHeight) !== null && a !== void 0 ? a : R) + this.gap;
|
|
515
|
-
if (r.type === "item" &&
|
|
516
|
-
|
|
515
|
+
if (r.type === "item" && t + d < this.requestedRect.y && !this.isValid(r, t)) {
|
|
516
|
+
t += d, i++;
|
|
517
517
|
continue;
|
|
518
518
|
}
|
|
519
|
-
let c = this.buildChild(r, this.padding,
|
|
520
|
-
if (
|
|
519
|
+
let c = this.buildChild(r, this.padding, t, null);
|
|
520
|
+
if (t = c.layoutInfo.rect.maxY + this.gap, l.push(c), r.type === "item" && t > this.requestedRect.maxY) {
|
|
521
521
|
var h;
|
|
522
|
-
let f =
|
|
523
|
-
if ((g == null ? void 0 : g.type) === "loader" && f--,
|
|
524
|
-
let y = this.buildChild(g, this.padding,
|
|
525
|
-
l.push(y),
|
|
522
|
+
let f = e.size - (l.length + i), g = e.getItem(e.getLastKey());
|
|
523
|
+
if ((g == null ? void 0 : g.type) === "loader" && f--, t += f * d, (g == null ? void 0 : g.type) === "loader" && ((h = l.at(-1)) === null || h === void 0 ? void 0 : h.layoutInfo.type) !== "loader") {
|
|
524
|
+
let y = this.buildChild(g, this.padding, t, null);
|
|
525
|
+
l.push(y), t = y.layoutInfo.rect.maxY;
|
|
526
526
|
}
|
|
527
527
|
break;
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
|
-
return
|
|
530
|
+
return t -= this.gap, t += o ? 0 : this.padding, this.contentSize = new z(this.virtualizer.visibleRect.width, t), l;
|
|
531
531
|
}
|
|
532
|
-
isValid(
|
|
533
|
-
let i = this.layoutNodes.get(
|
|
534
|
-
return !this.invalidateEverything && !!i && i.node ===
|
|
532
|
+
isValid(t, e) {
|
|
533
|
+
let i = this.layoutNodes.get(t.key);
|
|
534
|
+
return !this.invalidateEverything && !!i && i.node === t && e === i.layoutInfo.rect.y && i.layoutInfo.rect.intersects(this.validRect) && i.validRect.containsRect(i.layoutInfo.rect.intersection(this.requestedRect));
|
|
535
535
|
}
|
|
536
|
-
buildChild(
|
|
537
|
-
if (this.isValid(
|
|
538
|
-
let o = this.buildNode(
|
|
539
|
-
return o.layoutInfo.parentKey = l ?? null, o.layoutInfo.allowOverflow = !0, this.layoutNodes.set(
|
|
536
|
+
buildChild(t, e, i, l) {
|
|
537
|
+
if (this.isValid(t, i)) return this.layoutNodes.get(t.key);
|
|
538
|
+
let o = this.buildNode(t, e, i);
|
|
539
|
+
return o.layoutInfo.parentKey = l ?? null, o.layoutInfo.allowOverflow = !0, this.layoutNodes.set(t.key, o), o;
|
|
540
540
|
}
|
|
541
|
-
buildNode(
|
|
542
|
-
switch (
|
|
541
|
+
buildNode(t, e, i) {
|
|
542
|
+
switch (t.type) {
|
|
543
543
|
case "section":
|
|
544
|
-
return this.buildSection(
|
|
544
|
+
return this.buildSection(t, e, i);
|
|
545
545
|
case "item":
|
|
546
|
-
return this.buildItem(
|
|
546
|
+
return this.buildItem(t, e, i);
|
|
547
547
|
case "header":
|
|
548
|
-
return this.buildSectionHeader(
|
|
548
|
+
return this.buildSectionHeader(t, e, i);
|
|
549
549
|
case "loader":
|
|
550
|
-
return this.buildLoader(
|
|
550
|
+
return this.buildLoader(t, e, i);
|
|
551
551
|
case "separator":
|
|
552
|
-
return this.buildItem(
|
|
552
|
+
return this.buildItem(t, e, i);
|
|
553
553
|
default:
|
|
554
|
-
throw new Error("Unsupported node type: " +
|
|
554
|
+
throw new Error("Unsupported node type: " + t.type);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
buildLoader(
|
|
558
|
-
let l = new u(
|
|
559
|
-
l.width = this.virtualizer.contentSize.width - this.padding -
|
|
557
|
+
buildLoader(t, e, i) {
|
|
558
|
+
let l = new u(e, i, this.padding, 0), o = new b("loader", t.key, l);
|
|
559
|
+
l.width = this.virtualizer.contentSize.width - this.padding - e;
|
|
560
560
|
var s, a, h;
|
|
561
|
-
return l.height =
|
|
561
|
+
return l.height = t.props.isLoading ? (h = (a = (s = this.loaderHeight) !== null && s !== void 0 ? s : this.rowHeight) !== null && a !== void 0 ? a : this.estimatedRowHeight) !== null && h !== void 0 ? h : R : 0, {
|
|
562
562
|
layoutInfo: o,
|
|
563
563
|
validRect: l.intersection(this.requestedRect)
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
-
buildSection(
|
|
567
|
-
let l = this.virtualizer.collection, o = this.virtualizer.visibleRect.width - this.padding, s = new u(
|
|
568
|
-
for (let g of Y(
|
|
566
|
+
buildSection(t, e, i) {
|
|
567
|
+
let l = this.virtualizer.collection, o = this.virtualizer.visibleRect.width - this.padding, s = new u(e, i, o - e, 0), a = new b(t.type, t.key, s), h = i, r = 0, d = [];
|
|
568
|
+
for (let g of Y(t, l)) {
|
|
569
569
|
var c, f;
|
|
570
570
|
let y = ((f = (c = this.rowHeight) !== null && c !== void 0 ? c : this.estimatedRowHeight) !== null && f !== void 0 ? f : R) + this.gap;
|
|
571
|
-
if (i + y < this.requestedRect.y && !this.isValid(
|
|
571
|
+
if (i + y < this.requestedRect.y && !this.isValid(t, i)) {
|
|
572
572
|
i += y, r++;
|
|
573
573
|
continue;
|
|
574
574
|
}
|
|
575
|
-
let p = this.buildChild(g,
|
|
575
|
+
let p = this.buildChild(g, e, i, a.key);
|
|
576
576
|
if (i = p.layoutInfo.rect.maxY + this.gap, d.push(p), i > this.requestedRect.maxY) {
|
|
577
577
|
i += ([
|
|
578
|
-
...Y(
|
|
578
|
+
...Y(t, l)
|
|
579
579
|
].length - (d.length + r)) * y;
|
|
580
580
|
break;
|
|
581
581
|
}
|
|
@@ -584,50 +584,50 @@ class Re extends ye {
|
|
|
584
584
|
layoutInfo: a,
|
|
585
585
|
children: d,
|
|
586
586
|
validRect: a.rect.intersection(this.requestedRect),
|
|
587
|
-
node:
|
|
587
|
+
node: t
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
|
-
buildSectionHeader(
|
|
590
|
+
buildSectionHeader(t, e, i) {
|
|
591
591
|
let l = this.virtualizer.visibleRect.width - this.padding, o = this.headingHeight, s = !1;
|
|
592
592
|
if (o == null) {
|
|
593
|
-
let r = this.layoutNodes.get(
|
|
593
|
+
let r = this.layoutNodes.get(t.key), d = r == null ? void 0 : r.layoutInfo;
|
|
594
594
|
if (d) {
|
|
595
|
-
let c = this.virtualizer.collection.getItem(
|
|
595
|
+
let c = this.virtualizer.collection.getItem(t.key), f = this.lastCollection ? this.lastCollection.getItem(t.key) : null;
|
|
596
596
|
o = d.rect.height, s = l !== d.rect.width || c !== f || d.estimatedSize;
|
|
597
597
|
} else
|
|
598
|
-
o =
|
|
598
|
+
o = t.rendered ? this.estimatedHeadingHeight : 0, s = !0;
|
|
599
599
|
}
|
|
600
600
|
o == null && (o = R);
|
|
601
|
-
let a = new u(
|
|
601
|
+
let a = new u(e, i, l - e, o), h = new b("header", t.key, a);
|
|
602
602
|
return h.estimatedSize = s, {
|
|
603
603
|
layoutInfo: h,
|
|
604
604
|
children: [],
|
|
605
605
|
validRect: h.rect.intersection(this.requestedRect),
|
|
606
|
-
node:
|
|
606
|
+
node: t
|
|
607
607
|
};
|
|
608
608
|
}
|
|
609
|
-
buildItem(
|
|
610
|
-
let l = this.virtualizer.visibleRect.width - this.padding -
|
|
609
|
+
buildItem(t, e, i) {
|
|
610
|
+
let l = this.virtualizer.visibleRect.width - this.padding - e, o = this.rowHeight, s = !1;
|
|
611
611
|
if (o == null) {
|
|
612
|
-
let r = this.layoutNodes.get(
|
|
613
|
-
r ? (o = r.layoutInfo.rect.height, s = l !== r.layoutInfo.rect.width ||
|
|
612
|
+
let r = this.layoutNodes.get(t.key);
|
|
613
|
+
r ? (o = r.layoutInfo.rect.height, s = l !== r.layoutInfo.rect.width || t !== r.node || r.layoutInfo.estimatedSize) : (o = this.estimatedRowHeight, s = !0);
|
|
614
614
|
}
|
|
615
615
|
o == null && (o = R);
|
|
616
|
-
let a = new u(
|
|
616
|
+
let a = new u(e, i, l, o), h = new b(t.type, t.key, a);
|
|
617
617
|
return h.estimatedSize = s, {
|
|
618
618
|
layoutInfo: h,
|
|
619
619
|
children: [],
|
|
620
620
|
validRect: h.rect,
|
|
621
|
-
node:
|
|
621
|
+
node: t
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
updateItemSize(
|
|
625
|
-
let i = this.layoutNodes.get(
|
|
624
|
+
updateItemSize(t, e) {
|
|
625
|
+
let i = this.layoutNodes.get(t);
|
|
626
626
|
if (!i) return !1;
|
|
627
627
|
let l = this.virtualizer.collection, o = i.layoutInfo;
|
|
628
|
-
if (o.estimatedSize = !1, o.rect.height !==
|
|
628
|
+
if (o.estimatedSize = !1, o.rect.height !== e.height) {
|
|
629
629
|
let s = o.copy();
|
|
630
|
-
s.rect.height =
|
|
630
|
+
s.rect.height = e.height, i.layoutInfo = s, this.validRect.height = Math.min(this.validRect.height, o.rect.y - this.validRect.y), this.requestedRect.height += s.rect.height - o.rect.height, this.updateLayoutNode(t, o, s);
|
|
631
631
|
let a = o.parentKey != null ? l.getItem(o.parentKey) : null;
|
|
632
632
|
for (; a; )
|
|
633
633
|
this.updateLayoutNode(a.key, o, s), a = a.parentKey != null ? l.getItem(a.parentKey) : null;
|
|
@@ -635,19 +635,19 @@ class Re extends ye {
|
|
|
635
635
|
}
|
|
636
636
|
return !1;
|
|
637
637
|
}
|
|
638
|
-
updateLayoutNode(
|
|
639
|
-
let l = this.layoutNodes.get(
|
|
640
|
-
l && (l.validRect = l.validRect.intersection(this.validRect), l.layoutInfo ===
|
|
638
|
+
updateLayoutNode(t, e, i) {
|
|
639
|
+
let l = this.layoutNodes.get(t);
|
|
640
|
+
l && (l.validRect = l.validRect.intersection(this.validRect), l.layoutInfo === e && (l.layoutInfo = i));
|
|
641
641
|
}
|
|
642
642
|
getContentSize() {
|
|
643
643
|
return this.contentSize;
|
|
644
644
|
}
|
|
645
|
-
getDropTargetFromPoint(
|
|
646
|
-
|
|
647
|
-
let l = new u(
|
|
645
|
+
getDropTargetFromPoint(t, e, i) {
|
|
646
|
+
t += this.virtualizer.visibleRect.x, e += this.virtualizer.visibleRect.y;
|
|
647
|
+
let l = new u(t, Math.max(0, e - this.gap), 1, Math.max(1, this.gap * 2)), o = this.getVisibleLayoutInfos(l), s = null, a = 1 / 0;
|
|
648
648
|
for (let c of o) {
|
|
649
649
|
if (!c.rect.intersects(l)) continue;
|
|
650
|
-
let f = Math.abs(c.rect.y -
|
|
650
|
+
let f = Math.abs(c.rect.y - e), g = Math.abs(c.rect.maxY - e), y = Math.min(f, g);
|
|
651
651
|
y < a && (a = y, s = c.key);
|
|
652
652
|
}
|
|
653
653
|
if (s == null || this.virtualizer.collection.size === 0) return {
|
|
@@ -660,13 +660,13 @@ class Re extends ye {
|
|
|
660
660
|
key: h.key,
|
|
661
661
|
dropPosition: "on"
|
|
662
662
|
};
|
|
663
|
-
return i(d) ?
|
|
663
|
+
return i(d) ? e <= r.y + 10 && i({
|
|
664
664
|
...d,
|
|
665
665
|
dropPosition: "before"
|
|
666
|
-
}) ? d.dropPosition = "before" :
|
|
666
|
+
}) ? d.dropPosition = "before" : e >= r.maxY - 10 && i({
|
|
667
667
|
...d,
|
|
668
668
|
dropPosition: "after"
|
|
669
|
-
}) && (d.dropPosition = "after") :
|
|
669
|
+
}) && (d.dropPosition = "after") : e <= r.y + r.height / 2 && i({
|
|
670
670
|
...d,
|
|
671
671
|
dropPosition: "before"
|
|
672
672
|
}) ? d.dropPosition = "before" : i({
|
|
@@ -674,55 +674,55 @@ class Re extends ye {
|
|
|
674
674
|
dropPosition: "after"
|
|
675
675
|
}) && (d.dropPosition = "after"), d;
|
|
676
676
|
}
|
|
677
|
-
getDropTargetLayoutInfo(
|
|
678
|
-
let
|
|
679
|
-
return
|
|
677
|
+
getDropTargetLayoutInfo(t) {
|
|
678
|
+
let e = this.getLayoutInfo(t.key), i;
|
|
679
|
+
return t.dropPosition === "before" ? i = new u(e.rect.x, e.rect.y - this.dropIndicatorThickness / 2, e.rect.width, this.dropIndicatorThickness) : t.dropPosition === "after" ? i = new u(e.rect.x, e.rect.maxY - this.dropIndicatorThickness / 2, e.rect.width, this.dropIndicatorThickness) : i = e.rect, new b("dropIndicator", t.key + ":" + t.dropPosition, i);
|
|
680
680
|
}
|
|
681
681
|
/**
|
|
682
682
|
* Creates a new ListLayout with options. See the list of properties below for a description
|
|
683
683
|
* of the options that can be provided.
|
|
684
684
|
*/
|
|
685
|
-
constructor(
|
|
685
|
+
constructor(t = {}) {
|
|
686
686
|
super();
|
|
687
|
-
var
|
|
688
|
-
this.rowHeight = (
|
|
687
|
+
var e;
|
|
688
|
+
this.rowHeight = (e = t.rowHeight) !== null && e !== void 0 ? e : null;
|
|
689
689
|
var i;
|
|
690
|
-
this.estimatedRowHeight = (i =
|
|
690
|
+
this.estimatedRowHeight = (i = t.estimatedRowHeight) !== null && i !== void 0 ? i : null;
|
|
691
691
|
var l;
|
|
692
|
-
this.headingHeight = (l =
|
|
692
|
+
this.headingHeight = (l = t.headingHeight) !== null && l !== void 0 ? l : null;
|
|
693
693
|
var o;
|
|
694
|
-
this.estimatedHeadingHeight = (o =
|
|
694
|
+
this.estimatedHeadingHeight = (o = t.estimatedHeadingHeight) !== null && o !== void 0 ? o : null;
|
|
695
695
|
var s;
|
|
696
|
-
this.loaderHeight = (s =
|
|
696
|
+
this.loaderHeight = (s = t.loaderHeight) !== null && s !== void 0 ? s : null, this.dropIndicatorThickness = t.dropIndicatorThickness || 2, this.gap = t.gap || 0, this.padding = t.padding || 0, this.layoutNodes = /* @__PURE__ */ new Map(), this.rootNodes = [], this.lastCollection = null, this.invalidateEverything = !1, this.validRect = new u(), this.requestedRect = new u(), this.contentSize = new z();
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
699
|
let $ = null;
|
|
700
|
-
function $
|
|
700
|
+
function $t(n = !1) {
|
|
701
701
|
if ($ === null || n) {
|
|
702
|
-
const
|
|
703
|
-
|
|
702
|
+
const t = document.createElement("div"), e = t.style;
|
|
703
|
+
e.width = "50px", e.height = "50px", e.overflow = "scroll", e.direction = "rtl";
|
|
704
704
|
const i = document.createElement("div"), l = i.style;
|
|
705
|
-
return l.width = "100px", l.height = "100px",
|
|
705
|
+
return l.width = "100px", l.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ? $ = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? $ = "negative" : $ = "positive-ascending"), document.body.removeChild(t), $;
|
|
706
706
|
}
|
|
707
707
|
return $;
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
let { scrollLeft:
|
|
711
|
-
if (
|
|
709
|
+
function St(n, t) {
|
|
710
|
+
let { scrollLeft: e } = n;
|
|
711
|
+
if (t === "rtl") {
|
|
712
712
|
let { scrollWidth: i, clientWidth: l } = n;
|
|
713
|
-
switch ($
|
|
713
|
+
switch ($t()) {
|
|
714
714
|
case "negative":
|
|
715
|
-
|
|
715
|
+
e = -e;
|
|
716
716
|
break;
|
|
717
717
|
case "positive-descending":
|
|
718
|
-
|
|
718
|
+
e = i - l - e;
|
|
719
719
|
break;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
return
|
|
722
|
+
return e;
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
let { contentSize:
|
|
724
|
+
function zt(n, t) {
|
|
725
|
+
let { contentSize: e, onVisibleRectChange: i, innerStyle: l, onScrollStart: o, onScrollEnd: s, scrollDirection: a = "both", ...h } = n, r = C({
|
|
726
726
|
scrollTop: 0,
|
|
727
727
|
scrollLeft: 0,
|
|
728
728
|
scrollEndTime: 0,
|
|
@@ -732,8 +732,8 @@ function ze(n, e) {
|
|
|
732
732
|
isScrolling: !1
|
|
733
733
|
}).current, { direction: d } = F(), [c, f] = S(!1), g = L((v) => {
|
|
734
734
|
v.target === v.currentTarget && (n.onScroll && n.onScroll(v), P(() => {
|
|
735
|
-
let m = v.currentTarget.scrollTop, H =
|
|
736
|
-
r.scrollTop = Math.max(0, Math.min(m,
|
|
735
|
+
let m = v.currentTarget.scrollTop, H = St(v.currentTarget, d);
|
|
736
|
+
r.scrollTop = Math.max(0, Math.min(m, e.height - r.height)), r.scrollLeft = Math.max(0, Math.min(H, e.width - r.width)), i(new u(r.scrollLeft, r.scrollTop, r.width, r.height)), r.isScrolling || (r.isScrolling = !0, f(!0), window.dispatchEvent(new Event("tk.disconnect-observer")), o && o());
|
|
737
737
|
let T = Date.now();
|
|
738
738
|
r.scrollEndTime <= T + 50 && (r.scrollEndTime = T + 300, r.scrollTimeout != null && clearTimeout(r.scrollTimeout), r.scrollTimeout = setTimeout(() => {
|
|
739
739
|
r.isScrolling = !1, f(!1), r.scrollTimeout = null, window.dispatchEvent(new Event("tk.connect-observer")), s && s();
|
|
@@ -743,55 +743,55 @@ function ze(n, e) {
|
|
|
743
743
|
n,
|
|
744
744
|
d,
|
|
745
745
|
r,
|
|
746
|
-
|
|
746
|
+
e,
|
|
747
747
|
i,
|
|
748
748
|
o,
|
|
749
749
|
s
|
|
750
750
|
]);
|
|
751
|
-
|
|
751
|
+
ut(t, "scroll", g), ht(() => () => {
|
|
752
752
|
r.scrollTimeout != null && clearTimeout(r.scrollTimeout), r.isScrolling && window.dispatchEvent(new Event("tk.connect-observer"));
|
|
753
753
|
}, []);
|
|
754
|
-
let y = C(!1), p =
|
|
755
|
-
let m =
|
|
754
|
+
let y = C(!1), p = dt((v) => {
|
|
755
|
+
let m = t.current;
|
|
756
756
|
if (!m || y.current) return;
|
|
757
757
|
y.current = !0;
|
|
758
|
-
let H = process.env.NODE_ENV === "test" && !process.env.VIRT_ON, T = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientWidth"),
|
|
758
|
+
let H = process.env.NODE_ENV === "test" && !process.env.VIRT_ON, T = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientWidth"), it = Object.getOwnPropertyNames(window.HTMLElement.prototype).includes("clientHeight"), q = m.clientWidth, B = m.clientHeight, M = H && !T ? 1 / 0 : q, O = H && !it ? 1 / 0 : B;
|
|
759
759
|
(r.width !== M || r.height !== O) && (r.width = M, r.height = O, v(() => {
|
|
760
760
|
i(new u(r.scrollLeft, r.scrollTop, M, O));
|
|
761
761
|
}), (!H && q !== m.clientWidth || B !== m.clientHeight) && (r.width = m.clientWidth, r.height = m.clientHeight, v(() => {
|
|
762
762
|
i(new u(r.scrollLeft, r.scrollTop, r.width, r.height));
|
|
763
763
|
}))), y.current = !1;
|
|
764
|
-
}), N = C(null), [Z,
|
|
764
|
+
}), N = C(null), [Z, tt] = S({});
|
|
765
765
|
E(() => {
|
|
766
|
-
if (!y.current && (N.current == null || !
|
|
766
|
+
if (!y.current && (N.current == null || !e.equals(N.current)))
|
|
767
767
|
if (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest < "u") {
|
|
768
|
-
|
|
768
|
+
tt({}), N.current = e;
|
|
769
769
|
return;
|
|
770
770
|
} else queueMicrotask(() => p(P));
|
|
771
|
-
N.current =
|
|
771
|
+
N.current = e;
|
|
772
772
|
}), E(() => {
|
|
773
773
|
p((v) => v());
|
|
774
774
|
}, [
|
|
775
775
|
Z
|
|
776
776
|
]);
|
|
777
|
-
let
|
|
777
|
+
let et = L(() => {
|
|
778
778
|
p(P);
|
|
779
779
|
}, [
|
|
780
780
|
p
|
|
781
781
|
]);
|
|
782
|
-
|
|
783
|
-
ref:
|
|
782
|
+
ct({
|
|
783
|
+
ref: t,
|
|
784
784
|
box: "border-box",
|
|
785
|
-
onResize:
|
|
785
|
+
onResize: et
|
|
786
786
|
});
|
|
787
787
|
let I = {
|
|
788
788
|
// Reset padding so that relative positioning works correctly. Padding will be done in JS layout.
|
|
789
789
|
padding: 0,
|
|
790
790
|
...h.style
|
|
791
791
|
};
|
|
792
|
-
return a === "horizontal" ? (I.overflowX = "auto", I.overflowY = "hidden") : a === "vertical" ||
|
|
793
|
-
width: Number.isFinite(
|
|
794
|
-
height: Number.isFinite(
|
|
792
|
+
return a === "horizontal" ? (I.overflowX = "auto", I.overflowY = "hidden") : a === "vertical" || e.width === r.width ? (I.overflowY = "auto", I.overflowX = "hidden") : I.overflow = "auto", l = {
|
|
793
|
+
width: Number.isFinite(e.width) ? e.width : void 0,
|
|
794
|
+
height: Number.isFinite(e.height) ? e.height : void 0,
|
|
795
795
|
pointerEvents: c ? "none" : "auto",
|
|
796
796
|
position: "relative",
|
|
797
797
|
...l
|
|
@@ -806,51 +806,51 @@ function ze(n, e) {
|
|
|
806
806
|
}
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
|
-
function
|
|
810
|
-
let { layoutInfo:
|
|
809
|
+
function Ht(n) {
|
|
810
|
+
let { layoutInfo: t, virtualizer: e, ref: i } = n, l = t == null ? void 0 : t.key, o = L(() => {
|
|
811
811
|
if (l != null && i.current) {
|
|
812
|
-
let s =
|
|
813
|
-
|
|
812
|
+
let s = Ct(i.current);
|
|
813
|
+
e.updateItemSize(l, s);
|
|
814
814
|
}
|
|
815
815
|
}, [
|
|
816
|
-
|
|
816
|
+
e,
|
|
817
817
|
l,
|
|
818
818
|
i
|
|
819
819
|
]);
|
|
820
820
|
return E(() => {
|
|
821
|
-
|
|
821
|
+
t != null && t.estimatedSize && o();
|
|
822
822
|
}), {
|
|
823
823
|
updateSize: o
|
|
824
824
|
};
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
let
|
|
826
|
+
function Ct(n) {
|
|
827
|
+
let t = n.style.height;
|
|
828
828
|
n.style.height = "";
|
|
829
|
-
let
|
|
830
|
-
return n.style.height =
|
|
829
|
+
let e = new z(n.scrollWidth, n.scrollHeight);
|
|
830
|
+
return n.style.height = t, e;
|
|
831
831
|
}
|
|
832
832
|
function U(n) {
|
|
833
|
-
let { style:
|
|
834
|
-
return
|
|
833
|
+
let { style: t, className: e, layoutInfo: i, virtualizer: l, parent: o, children: s } = n, { direction: a } = F(), h = C(null);
|
|
834
|
+
return Ht({
|
|
835
835
|
layoutInfo: i,
|
|
836
836
|
virtualizer: l,
|
|
837
837
|
ref: h
|
|
838
838
|
}), /* @__PURE__ */ w.createElement("div", {
|
|
839
839
|
role: "presentation",
|
|
840
840
|
ref: h,
|
|
841
|
-
className:
|
|
841
|
+
className: e,
|
|
842
842
|
style: {
|
|
843
|
-
...
|
|
844
|
-
...
|
|
843
|
+
...kt(i, a, o),
|
|
844
|
+
...t
|
|
845
845
|
}
|
|
846
846
|
}, s);
|
|
847
847
|
}
|
|
848
848
|
let W = /* @__PURE__ */ new WeakMap();
|
|
849
|
-
function
|
|
850
|
-
let i =
|
|
849
|
+
function kt(n, t, e) {
|
|
850
|
+
let i = t === "rtl" ? "right" : "left", l = W.get(n);
|
|
851
851
|
if (l && l[i] != null) {
|
|
852
|
-
if (!
|
|
853
|
-
let h = n.rect.y -
|
|
852
|
+
if (!e) return l;
|
|
853
|
+
let h = n.rect.y - e.rect.y, r = n.rect.x - e.rect.x;
|
|
854
854
|
if (l.top === h && l[i] === r) return l;
|
|
855
855
|
}
|
|
856
856
|
let o = {
|
|
@@ -858,8 +858,8 @@ function _e(n, e, t) {
|
|
|
858
858
|
// which WON'T be the parent since the parent has overflow visible. This means we shouldn't offset the height by the parent's position
|
|
859
859
|
// Not 100% about this change here since it is quite ambigious what the scrolling container maybe and how its top is positioned with respect to the
|
|
860
860
|
// calculated layoutInfo.y here
|
|
861
|
-
top: n.rect.y - (
|
|
862
|
-
[i]: n.rect.x - (
|
|
861
|
+
top: n.rect.y - (e && !(e.allowOverflow && n.isSticky) ? e.rect.y : 0),
|
|
862
|
+
[i]: n.rect.x - (e && !(e.allowOverflow && n.isSticky) ? e.rect.x : 0),
|
|
863
863
|
width: n.rect.width,
|
|
864
864
|
height: n.rect.height
|
|
865
865
|
};
|
|
@@ -881,30 +881,30 @@ function _e(n, e, t) {
|
|
|
881
881
|
return W.set(n, a), a;
|
|
882
882
|
}
|
|
883
883
|
const G = /* @__PURE__ */ X(null), J = /* @__PURE__ */ X(null);
|
|
884
|
-
function
|
|
885
|
-
let { children:
|
|
886
|
-
|
|
887
|
-
]), o =
|
|
884
|
+
function _t(n) {
|
|
885
|
+
let { children: t, layout: e, layoutOptions: i } = n, l = _(() => typeof e == "function" ? new e() : e, [
|
|
886
|
+
e
|
|
887
|
+
]), o = _(() => ({
|
|
888
888
|
isVirtualized: !0,
|
|
889
889
|
layoutDelegate: l,
|
|
890
890
|
dropTargetDelegate: l.getDropTargetFromPoint ? l : void 0,
|
|
891
|
-
CollectionRoot:
|
|
892
|
-
CollectionBranch:
|
|
891
|
+
CollectionRoot: Lt,
|
|
892
|
+
CollectionBranch: Nt
|
|
893
893
|
}), [
|
|
894
894
|
l
|
|
895
895
|
]);
|
|
896
|
-
return /* @__PURE__ */ w.createElement(
|
|
896
|
+
return /* @__PURE__ */ w.createElement(rt.Provider, {
|
|
897
897
|
value: o
|
|
898
898
|
}, /* @__PURE__ */ w.createElement(J.Provider, {
|
|
899
899
|
value: {
|
|
900
900
|
layout: l,
|
|
901
901
|
layoutOptions: i
|
|
902
902
|
}
|
|
903
|
-
},
|
|
903
|
+
}, t));
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function Lt({ collection: n, persistedKeys: t, scrollRef: e, renderDropIndicator: i }) {
|
|
906
906
|
var l;
|
|
907
|
-
let { layout: o, layoutOptions: s } = A(J), a = (l = o.useLayoutOptions) === null || l === void 0 ? void 0 : l.call(o), h =
|
|
907
|
+
let { layout: o, layoutOptions: s } = A(J), a = (l = o.useLayoutOptions) === null || l === void 0 ? void 0 : l.call(o), h = It({
|
|
908
908
|
layout: o,
|
|
909
909
|
collection: n,
|
|
910
910
|
renderView: (d, c) => {
|
|
@@ -912,62 +912,62 @@ function Le({ collection: n, persistedKeys: e, scrollRef: t, renderDropIndicator
|
|
|
912
912
|
return c == null || (f = c.render) === null || f === void 0 ? void 0 : f.call(c, c);
|
|
913
913
|
},
|
|
914
914
|
onVisibleRectChange(d) {
|
|
915
|
-
let c =
|
|
915
|
+
let c = e == null ? void 0 : e.current;
|
|
916
916
|
c && (c.scrollLeft = d.x, c.scrollTop = d.y);
|
|
917
917
|
},
|
|
918
|
-
persistedKeys:
|
|
919
|
-
layoutOptions:
|
|
918
|
+
persistedKeys: t,
|
|
919
|
+
layoutOptions: _(() => s && a ? {
|
|
920
920
|
...s,
|
|
921
921
|
...a
|
|
922
922
|
} : s || a, [
|
|
923
923
|
s,
|
|
924
924
|
a
|
|
925
925
|
])
|
|
926
|
-
}), { contentProps: r } =
|
|
926
|
+
}), { contentProps: r } = zt({
|
|
927
927
|
onVisibleRectChange: h.setVisibleRect,
|
|
928
928
|
contentSize: h.contentSize,
|
|
929
929
|
onScrollStart: h.startScrolling,
|
|
930
930
|
onScrollEnd: h.endScrolling
|
|
931
|
-
},
|
|
931
|
+
}, e);
|
|
932
932
|
return /* @__PURE__ */ w.createElement("div", r, /* @__PURE__ */ w.createElement(G.Provider, {
|
|
933
933
|
value: h
|
|
934
934
|
}, Q(null, h.visibleViews, i)));
|
|
935
935
|
}
|
|
936
|
-
function
|
|
936
|
+
function Nt({ parent: n, renderDropIndicator: t }) {
|
|
937
937
|
let i = A(G).virtualizer.getVisibleView(n.key);
|
|
938
|
-
return Q(i, Array.from(i.children),
|
|
938
|
+
return Q(i, Array.from(i.children), t);
|
|
939
939
|
}
|
|
940
|
-
function Q(n,
|
|
941
|
-
return
|
|
940
|
+
function Q(n, t, e) {
|
|
941
|
+
return t.map((i) => Tt(n, i, e));
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function Tt(n, t, e) {
|
|
944
944
|
let i = /* @__PURE__ */ w.createElement(U, {
|
|
945
|
-
key:
|
|
946
|
-
layoutInfo:
|
|
947
|
-
virtualizer:
|
|
945
|
+
key: t.key,
|
|
946
|
+
layoutInfo: t.layoutInfo,
|
|
947
|
+
virtualizer: t.virtualizer,
|
|
948
948
|
parent: n == null ? void 0 : n.layoutInfo
|
|
949
|
-
},
|
|
950
|
-
return (s == null ? void 0 : s.type) === "item" &&
|
|
951
|
-
key:
|
|
952
|
-
}, D(n,
|
|
949
|
+
}, t.rendered), { collection: l, layout: o } = t.virtualizer, s = t.content;
|
|
950
|
+
return (s == null ? void 0 : s.type) === "item" && e && o.getDropTargetLayoutInfo && (i = /* @__PURE__ */ w.createElement(w.Fragment, {
|
|
951
|
+
key: t.key
|
|
952
|
+
}, D(n, t, {
|
|
953
953
|
type: "item",
|
|
954
|
-
key:
|
|
954
|
+
key: t.content.key,
|
|
955
955
|
dropPosition: "before"
|
|
956
|
-
},
|
|
956
|
+
}, e), i, at(l, s, (a) => D(n, t, a, e)))), i;
|
|
957
957
|
}
|
|
958
|
-
function D(n,
|
|
959
|
-
let l = i(
|
|
958
|
+
function D(n, t, e, i) {
|
|
959
|
+
let l = i(e);
|
|
960
960
|
if (l) {
|
|
961
|
-
let o =
|
|
961
|
+
let o = t.virtualizer.layout.getDropTargetLayoutInfo(e);
|
|
962
962
|
l = /* @__PURE__ */ w.createElement(U, {
|
|
963
963
|
layoutInfo: o,
|
|
964
|
-
virtualizer:
|
|
964
|
+
virtualizer: t.virtualizer,
|
|
965
965
|
parent: n == null ? void 0 : n.layoutInfo
|
|
966
966
|
}, l);
|
|
967
967
|
}
|
|
968
968
|
return l;
|
|
969
969
|
}
|
|
970
|
-
class
|
|
970
|
+
class Et extends Rt {
|
|
971
971
|
/**
|
|
972
972
|
* When using the ListLayout our scroll container height is not calculated properly when the content is partially sectioned.
|
|
973
973
|
* ```ts
|
|
@@ -985,74 +985,74 @@ class Ee extends Re {
|
|
|
985
985
|
* This might not be optional for performance, FYI
|
|
986
986
|
*/
|
|
987
987
|
getContentSize() {
|
|
988
|
-
var
|
|
989
|
-
const
|
|
990
|
-
return Array.from(
|
|
988
|
+
var e;
|
|
989
|
+
const t = (e = this == null ? void 0 : this.virtualizer) == null ? void 0 : e.collection.getKeys();
|
|
990
|
+
return Array.from(t || []).forEach((i) => {
|
|
991
991
|
this.getLayoutInfo(i);
|
|
992
992
|
}), this.contentSize;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
const
|
|
996
|
-
listBox:
|
|
997
|
-
listBoxPopover:
|
|
998
|
-
listBoxSectionHeading:
|
|
999
|
-
listBoxButton:
|
|
1000
|
-
listBoxItem:
|
|
1001
|
-
},
|
|
995
|
+
const Vt = "_listBox_1f4kp_7", Mt = "_listBoxPopover_1f4kp_19", Ot = "_listBoxSectionHeading_1f4kp_31", Pt = "_listBoxButton_1f4kp_40", Kt = "_listBoxItem_1f4kp_52", V = {
|
|
996
|
+
listBox: Vt,
|
|
997
|
+
listBoxPopover: Mt,
|
|
998
|
+
listBoxSectionHeading: Ot,
|
|
999
|
+
listBoxButton: Pt,
|
|
1000
|
+
listBoxItem: Kt
|
|
1001
|
+
}, Zt = ({
|
|
1002
1002
|
className: n,
|
|
1003
|
-
children:
|
|
1004
|
-
...
|
|
1005
|
-
}) => /* @__PURE__ */
|
|
1006
|
-
|
|
1003
|
+
children: t,
|
|
1004
|
+
...e
|
|
1005
|
+
}) => /* @__PURE__ */ k(
|
|
1006
|
+
_t,
|
|
1007
1007
|
{
|
|
1008
|
-
layout:
|
|
1008
|
+
layout: Et,
|
|
1009
1009
|
layoutOptions: {
|
|
1010
1010
|
headingHeight: 44
|
|
1011
1011
|
},
|
|
1012
|
-
children: /* @__PURE__ */
|
|
1013
|
-
|
|
1012
|
+
children: /* @__PURE__ */ k(
|
|
1013
|
+
ot,
|
|
1014
1014
|
{
|
|
1015
1015
|
className: K(V.listBox, n),
|
|
1016
|
-
...
|
|
1017
|
-
children:
|
|
1016
|
+
...e,
|
|
1017
|
+
children: t
|
|
1018
1018
|
}
|
|
1019
1019
|
)
|
|
1020
1020
|
}
|
|
1021
|
-
),
|
|
1021
|
+
), te = ({
|
|
1022
1022
|
children: n,
|
|
1023
|
-
className:
|
|
1024
|
-
...
|
|
1025
|
-
}) => /* @__PURE__ */
|
|
1026
|
-
|
|
1023
|
+
className: t,
|
|
1024
|
+
...e
|
|
1025
|
+
}) => /* @__PURE__ */ k(
|
|
1026
|
+
nt,
|
|
1027
1027
|
{
|
|
1028
|
-
className: K(V.listBoxItem,
|
|
1029
|
-
...
|
|
1028
|
+
className: K(V.listBoxItem, t),
|
|
1029
|
+
...e,
|
|
1030
1030
|
children: n
|
|
1031
1031
|
}
|
|
1032
|
-
),
|
|
1032
|
+
), ee = ({
|
|
1033
1033
|
className: n,
|
|
1034
|
-
children:
|
|
1035
|
-
...
|
|
1036
|
-
}) => /* @__PURE__ */
|
|
1037
|
-
|
|
1034
|
+
children: t,
|
|
1035
|
+
...e
|
|
1036
|
+
}) => /* @__PURE__ */ k(
|
|
1037
|
+
ft,
|
|
1038
1038
|
{
|
|
1039
1039
|
className: K(n, V.listBoxPopover),
|
|
1040
1040
|
offset: 0,
|
|
1041
|
-
...
|
|
1042
|
-
children:
|
|
1041
|
+
...e,
|
|
1042
|
+
children: t
|
|
1043
1043
|
}
|
|
1044
|
-
),
|
|
1044
|
+
), ie = ({
|
|
1045
1045
|
children: n,
|
|
1046
|
-
name:
|
|
1047
|
-
...
|
|
1048
|
-
}) => /* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1046
|
+
name: t,
|
|
1047
|
+
...e
|
|
1048
|
+
}) => /* @__PURE__ */ lt(st, { ...e, children: [
|
|
1049
|
+
/* @__PURE__ */ k(gt, { className: V.listBoxSectionHeading, children: t }),
|
|
1050
1050
|
n
|
|
1051
1051
|
] });
|
|
1052
1052
|
export {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1053
|
+
Zt as L,
|
|
1054
|
+
te as a,
|
|
1055
|
+
ee as b,
|
|
1056
|
+
ie as c,
|
|
1057
1057
|
V as s
|
|
1058
1058
|
};
|