@okam/stack-ui 1.42.2 → 1.42.3
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 +10 -0
- package/index100.js +1 -1
- package/index100.mjs +1 -1
- package/index101.js +1 -1
- package/index101.mjs +1 -1
- package/index102.js +1 -1
- package/index102.mjs +1 -1
- package/index153.js +1 -1
- package/index153.mjs +3 -3
- package/index154.js +1 -1
- package/index154.mjs +1 -1
- package/index156.js +1 -1
- package/index156.mjs +1 -1
- package/index161.js +1 -1
- package/index161.mjs +1 -1
- package/index172.js +1 -1
- package/index172.mjs +1 -1
- package/index176.js +1 -1
- package/index176.mjs +3 -3
- package/index177.js +1 -1
- package/index177.mjs +1 -1
- package/index178.js +1 -1
- package/index178.mjs +1 -1
- package/index179.js +1 -1
- package/index179.mjs +3 -3
- package/index181.js +1 -1
- package/index181.mjs +1 -1
- package/index238.js +1 -1
- package/index238.mjs +3 -3
- package/index239.js +1 -1
- package/index239.mjs +2 -2
- package/index242.js +1 -1
- package/index242.mjs +1 -1
- package/index251.js +1 -1
- package/index251.mjs +68 -22
- package/index252.js +1 -1
- package/index252.mjs +370 -62
- package/index253.js +1 -1
- package/index253.mjs +44 -379
- package/index254.js +1 -1
- package/index254.mjs +23 -45
- package/index255.js +1 -1
- package/index255.mjs +24 -24
- package/index256.js +1 -1
- package/index256.mjs +11 -23
- package/index257.js +1 -1
- package/index257.mjs +4 -12
- package/index258.js +1 -1
- package/index258.mjs +14 -4
- package/index259.js +1 -1
- package/index259.mjs +41 -13
- package/index260.js +1 -1
- package/index260.mjs +52 -37
- package/index261.js +1 -1
- package/index261.mjs +26 -55
- package/index262.js +1 -1
- package/index262.mjs +30 -27
- package/index263.js +1 -1
- package/index263.mjs +10 -31
- package/index264.js +1 -1
- package/index264.mjs +8 -9
- package/index265.js +1 -1
- package/index265.mjs +5 -9
- package/index266.js +1 -1
- package/index266.mjs +7 -5
- package/index267.js +1 -1
- package/index267.mjs +29 -7
- package/index268.js +1 -1
- package/index268.mjs +16 -27
- package/index269.js +1 -1
- package/index269.mjs +12 -17
- package/index270.js +1 -1
- package/index270.mjs +43 -13
- package/index271.js +1 -1
- package/index271.mjs +7 -42
- package/index272.js +1 -1
- package/index272.mjs +17 -8
- package/index273.js +1 -1
- package/index273.mjs +3 -18
- package/index274.js +1 -1
- package/index274.mjs +5 -3
- package/index275.js +1 -1
- package/index275.mjs +19 -4
- package/index276.js +1 -1
- package/index276.mjs +27 -19
- package/index277.js +1 -1
- package/index277.mjs +31 -5
- package/index278.js +1 -1
- package/index278.mjs +5 -121
- package/index279.js +1 -1
- package/index279.mjs +121 -43
- package/index280.js +1 -1
- package/index280.mjs +43 -230
- package/index281.js +1 -1
- package/index281.mjs +226 -27
- package/index325.js +1 -1
- package/index325.mjs +2 -2
- package/index326.js +1 -1
- package/index326.mjs +4 -4
- package/index327.js +1 -1
- package/index327.mjs +2 -2
- package/index330.js +1 -1
- package/index330.mjs +2 -2
- package/index333.js +1 -1
- package/index333.mjs +5 -5
- package/index334.js +1 -1
- package/index334.mjs +1 -1
- package/index335.js +1 -1
- package/index335.mjs +4 -4
- package/index336.js +1 -1
- package/index336.mjs +65 -20
- package/index337.js +1 -1
- package/index337.mjs +53 -29
- package/index338.js +1 -1
- package/index338.mjs +51 -63
- package/index339.js +1 -1
- package/index339.mjs +271 -43
- package/index340.js +1 -1
- package/index340.mjs +18 -52
- package/index341.js +1 -1
- package/index341.mjs +21 -281
- package/index342.js +1 -1
- package/index342.mjs +29 -20
- package/index99.js +1 -1
- package/index99.mjs +1 -1
- package/package.json +1 -1
package/index281.mjs
CHANGED
|
@@ -1,34 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { getItemElement as V, useCollectionId as fe, isNonContiguousSelectionModifier as H } from "./index341.mjs";
|
|
2
|
+
import { useTypeSelect as ae } from "./index342.mjs";
|
|
3
|
+
import { mergeProps as G } from "./index154.mjs";
|
|
4
|
+
import { focusWithoutScrolling as j } from "./index259.mjs";
|
|
5
|
+
import { useRouter as de } from "./index260.mjs";
|
|
6
|
+
import { useUpdateLayoutEffect as q } from "./index263.mjs";
|
|
7
|
+
import { useEvent as S } from "./index268.mjs";
|
|
8
|
+
import { scrollIntoView as ve, scrollIntoViewport as J } from "./index270.mjs";
|
|
9
|
+
import { useEffectEvent as Q } from "./index269.mjs";
|
|
10
|
+
import { FOCUS_EVENT as pe, CLEAR_FOCUS_EVENT as ye } from "./index273.mjs";
|
|
11
|
+
import { isCtrlKeyPressed as m } from "./index274.mjs";
|
|
12
|
+
import { flushSync as be } from "react-dom";
|
|
13
|
+
import { useRef as $, useEffect as X } from "react";
|
|
14
|
+
import { getInteractionModality as Y } from "./index327.mjs";
|
|
15
|
+
import { focusSafely as Z } from "./index335.mjs";
|
|
16
|
+
import { moveVirtualFocus as Ke, getFocusableTreeWalker as me } from "@react-aria/focus";
|
|
17
|
+
import { useLocale as $e } from "@react-aria/i18n";
|
|
18
|
+
function Ce(g) {
|
|
19
|
+
let { selectionManager: e, keyboardDelegate: o, ref: i, autoFocus: h = !1, shouldFocusWrap: F = !1, disallowEmptySelection: _ = !1, disallowSelectAll: ee = !1, escapeKeyBehavior: le = "clearSelection", selectOnFocus: b = e.selectionBehavior === "replace", disallowTypeAhead: oe = !1, shouldUseVirtualFocus: y, allowsTabNavigation: te = !1, isVirtualized: B, scrollRef: f = i, linkBehavior: C = "action" } = g, { direction: x } = $e(), re = de(), ce = (l) => {
|
|
20
|
+
var r;
|
|
21
|
+
if (l.altKey && l.key === "Tab" && l.preventDefault(), !(!((r = i.current) === null || r === void 0) && r.contains(l.target))) return;
|
|
22
|
+
const c = (t, v) => {
|
|
23
|
+
if (t != null) {
|
|
24
|
+
if (e.isLink(t) && C === "selection" && b && !H(l)) {
|
|
25
|
+
be(() => {
|
|
26
|
+
e.setFocusedKey(t, v);
|
|
27
|
+
});
|
|
28
|
+
let p = V(i, t), W = e.getItemProps(t);
|
|
29
|
+
p && re.open(p, l, W.href, W.routerOptions);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (e.setFocusedKey(t, v), e.isLink(t) && C === "override") return;
|
|
33
|
+
l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && !H(l) && e.replaceSelection(t);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
switch (l.key) {
|
|
37
|
+
case "ArrowDown":
|
|
38
|
+
if (o.getKeyBelow) {
|
|
39
|
+
var n, s, u;
|
|
40
|
+
let t = e.focusedKey != null ? (n = o.getKeyBelow) === null || n === void 0 ? void 0 : n.call(o, e.focusedKey) : (s = o.getFirstKey) === null || s === void 0 ? void 0 : s.call(o);
|
|
41
|
+
t == null && F && (t = (u = o.getFirstKey) === null || u === void 0 ? void 0 : u.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
42
|
+
}
|
|
43
|
+
break;
|
|
44
|
+
case "ArrowUp":
|
|
45
|
+
if (o.getKeyAbove) {
|
|
46
|
+
var a, d, P;
|
|
47
|
+
let t = e.focusedKey != null ? (a = o.getKeyAbove) === null || a === void 0 ? void 0 : a.call(o, e.focusedKey) : (d = o.getLastKey) === null || d === void 0 ? void 0 : d.call(o);
|
|
48
|
+
t == null && F && (t = (P = o.getLastKey) === null || P === void 0 ? void 0 : P.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t));
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
case "ArrowLeft":
|
|
52
|
+
if (o.getKeyLeftOf) {
|
|
53
|
+
var k, A, I;
|
|
54
|
+
let t = e.focusedKey != null ? (k = o.getKeyLeftOf) === null || k === void 0 ? void 0 : k.call(o, e.focusedKey) : null;
|
|
55
|
+
t == null && F && (t = x === "rtl" ? (A = o.getFirstKey) === null || A === void 0 ? void 0 : A.call(o, e.focusedKey) : (I = o.getLastKey) === null || I === void 0 ? void 0 : I.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, x === "rtl" ? "first" : "last"));
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case "ArrowRight":
|
|
59
|
+
if (o.getKeyRightOf) {
|
|
60
|
+
var M, R, O;
|
|
61
|
+
let t = e.focusedKey != null ? (M = o.getKeyRightOf) === null || M === void 0 ? void 0 : M.call(o, e.focusedKey) : null;
|
|
62
|
+
t == null && F && (t = x === "rtl" ? (R = o.getLastKey) === null || R === void 0 ? void 0 : R.call(o, e.focusedKey) : (O = o.getFirstKey) === null || O === void 0 ? void 0 : O.call(o, e.focusedKey)), t != null && (l.preventDefault(), c(t, x === "rtl" ? "last" : "first"));
|
|
63
|
+
}
|
|
64
|
+
break;
|
|
65
|
+
case "Home":
|
|
66
|
+
if (o.getFirstKey) {
|
|
67
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
68
|
+
l.preventDefault();
|
|
69
|
+
let t = o.getFirstKey(e.focusedKey, m(l));
|
|
70
|
+
e.setFocusedKey(t), t != null && (m(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && e.replaceSelection(t));
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
case "End":
|
|
74
|
+
if (o.getLastKey) {
|
|
75
|
+
if (e.focusedKey === null && l.shiftKey) return;
|
|
76
|
+
l.preventDefault();
|
|
77
|
+
let t = o.getLastKey(e.focusedKey, m(l));
|
|
78
|
+
e.setFocusedKey(t), t != null && (m(l) && l.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(t) : b && e.replaceSelection(t));
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case "PageDown":
|
|
82
|
+
if (o.getKeyPageBelow && e.focusedKey != null) {
|
|
83
|
+
let t = o.getKeyPageBelow(e.focusedKey);
|
|
84
|
+
t != null && (l.preventDefault(), c(t));
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case "PageUp":
|
|
88
|
+
if (o.getKeyPageAbove && e.focusedKey != null) {
|
|
89
|
+
let t = o.getKeyPageAbove(e.focusedKey);
|
|
90
|
+
t != null && (l.preventDefault(), c(t));
|
|
91
|
+
}
|
|
92
|
+
break;
|
|
93
|
+
case "a":
|
|
94
|
+
m(l) && e.selectionMode === "multiple" && ee !== !0 && (l.preventDefault(), e.selectAll());
|
|
95
|
+
break;
|
|
96
|
+
case "Escape":
|
|
97
|
+
le === "clearSelection" && !_ && e.selectedKeys.size !== 0 && (l.stopPropagation(), l.preventDefault(), e.clearSelection());
|
|
98
|
+
break;
|
|
99
|
+
case "Tab":
|
|
100
|
+
if (!te) {
|
|
101
|
+
if (l.shiftKey) i.current.focus();
|
|
102
|
+
else {
|
|
103
|
+
let t = me(i.current, {
|
|
104
|
+
tabbable: !0
|
|
105
|
+
}), v, p;
|
|
106
|
+
do
|
|
107
|
+
p = t.lastChild(), p && (v = p);
|
|
108
|
+
while (p);
|
|
109
|
+
v && !v.contains(document.activeElement) && j(v);
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, w = $({
|
|
115
|
+
top: 0,
|
|
116
|
+
left: 0
|
|
117
|
+
});
|
|
118
|
+
S(f, "scroll", B ? void 0 : () => {
|
|
119
|
+
var l, r, c, n;
|
|
120
|
+
w.current = {
|
|
121
|
+
top: (c = (l = f.current) === null || l === void 0 ? void 0 : l.scrollTop) !== null && c !== void 0 ? c : 0,
|
|
122
|
+
left: (n = (r = f.current) === null || r === void 0 ? void 0 : r.scrollLeft) !== null && n !== void 0 ? n : 0
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
let ie = (l) => {
|
|
126
|
+
if (e.isFocused) {
|
|
127
|
+
l.currentTarget.contains(l.target) || e.setFocused(!1);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (l.currentTarget.contains(l.target)) {
|
|
131
|
+
if (e.setFocused(!0), e.focusedKey == null) {
|
|
132
|
+
var r, c;
|
|
133
|
+
let u = (d) => {
|
|
134
|
+
d != null && (e.setFocusedKey(d), b && !e.isSelected(d) && e.replaceSelection(d));
|
|
135
|
+
}, a = l.relatedTarget;
|
|
136
|
+
var n, s;
|
|
137
|
+
a && l.currentTarget.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_FOLLOWING ? u((n = e.lastSelectedKey) !== null && n !== void 0 ? n : (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) : u((s = e.firstSelectedKey) !== null && s !== void 0 ? s : (c = o.getFirstKey) === null || c === void 0 ? void 0 : c.call(o));
|
|
138
|
+
} else !B && f.current && (f.current.scrollTop = w.current.top, f.current.scrollLeft = w.current.left);
|
|
139
|
+
if (e.focusedKey != null && f.current) {
|
|
140
|
+
let u = V(i, e.focusedKey);
|
|
141
|
+
u instanceof HTMLElement && (!u.contains(document.activeElement) && !y && j(u), Y() === "keyboard" && J(u, {
|
|
142
|
+
containingElement: i.current
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, ne = (l) => {
|
|
147
|
+
l.currentTarget.contains(l.relatedTarget) || e.setFocused(!1);
|
|
148
|
+
}, K = $(!1);
|
|
149
|
+
S(i, pe, y ? (l) => {
|
|
150
|
+
let { detail: r } = l;
|
|
151
|
+
l.stopPropagation(), e.setFocused(!0), (r == null ? void 0 : r.focusStrategy) === "first" && (K.current = !0);
|
|
152
|
+
} : void 0);
|
|
153
|
+
let N = Q(() => {
|
|
154
|
+
var l, r;
|
|
155
|
+
let c = (r = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && r !== void 0 ? r : null;
|
|
156
|
+
c == null ? (Ke(i.current), e.collection.size > 0 && (K.current = !1)) : (e.setFocusedKey(c), K.current = !1);
|
|
157
|
+
});
|
|
158
|
+
q(() => {
|
|
159
|
+
K.current && N();
|
|
160
|
+
}, [
|
|
161
|
+
e.collection,
|
|
162
|
+
N
|
|
163
|
+
]);
|
|
164
|
+
let U = Q(() => {
|
|
165
|
+
e.collection.size > 0 && (K.current = !1);
|
|
166
|
+
});
|
|
167
|
+
q(() => {
|
|
168
|
+
U();
|
|
169
|
+
}, [
|
|
170
|
+
e.focusedKey,
|
|
171
|
+
U
|
|
172
|
+
]), S(i, ye, y ? (l) => {
|
|
173
|
+
var r;
|
|
174
|
+
l.stopPropagation(), e.setFocused(!1), !((r = l.detail) === null || r === void 0) && r.clearFocusKey && e.setFocusedKey(null);
|
|
175
|
+
} : void 0);
|
|
176
|
+
const z = $(h), T = $(!1);
|
|
177
|
+
X(() => {
|
|
178
|
+
if (z.current) {
|
|
179
|
+
var l, r;
|
|
180
|
+
let s = null;
|
|
181
|
+
var c;
|
|
182
|
+
h === "first" && (s = (c = (l = o.getFirstKey) === null || l === void 0 ? void 0 : l.call(o)) !== null && c !== void 0 ? c : null);
|
|
18
183
|
var n;
|
|
19
|
-
|
|
20
|
-
|
|
184
|
+
h === "last" && (s = (n = (r = o.getLastKey) === null || r === void 0 ? void 0 : r.call(o)) !== null && n !== void 0 ? n : null);
|
|
185
|
+
let u = e.selectedKeys;
|
|
186
|
+
if (u.size) {
|
|
187
|
+
for (let a of u) if (e.canSelectItem(a)) {
|
|
188
|
+
s = a;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
e.setFocused(!0), e.setFocusedKey(s), s == null && !y && i.current && Z(i.current), e.collection.size > 0 && (z.current = !1, T.current = !0);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
let D = $(e.focusedKey);
|
|
196
|
+
X(() => {
|
|
197
|
+
if (e.isFocused && e.focusedKey != null && (e.focusedKey !== D.current || T.current) && f.current && i.current) {
|
|
198
|
+
let l = Y(), r = V(i, e.focusedKey);
|
|
199
|
+
if (!(r instanceof HTMLElement))
|
|
200
|
+
return;
|
|
201
|
+
(l === "keyboard" || T.current) && (ve(f.current, r), l !== "virtual" && J(r, {
|
|
202
|
+
containingElement: i.current
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
!y && e.isFocused && e.focusedKey == null && D.current != null && i.current && Z(i.current), D.current = e.focusedKey, T.current = !1;
|
|
206
|
+
}), S(i, "react-aria-focus-scope-restore", (l) => {
|
|
207
|
+
l.preventDefault(), e.setFocused(!0);
|
|
208
|
+
});
|
|
209
|
+
let E = {
|
|
210
|
+
onKeyDown: ce,
|
|
211
|
+
onFocus: ie,
|
|
212
|
+
onBlur: ne,
|
|
213
|
+
onMouseDown(l) {
|
|
214
|
+
f.current === l.target && l.preventDefault();
|
|
21
215
|
}
|
|
22
|
-
}
|
|
216
|
+
}, { typeSelectProps: ue } = ae({
|
|
217
|
+
keyboardDelegate: o,
|
|
218
|
+
selectionManager: e
|
|
219
|
+
});
|
|
220
|
+
oe || (E = G(ue, E));
|
|
221
|
+
let L;
|
|
222
|
+
y || (L = e.focusedKey == null ? 0 : -1);
|
|
223
|
+
let se = fe(e.collection);
|
|
23
224
|
return {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setSelectedKey: c,
|
|
29
|
-
selectedItem: r
|
|
225
|
+
collectionProps: G(E, {
|
|
226
|
+
tabIndex: L,
|
|
227
|
+
"data-collection": se
|
|
228
|
+
})
|
|
30
229
|
};
|
|
31
230
|
}
|
|
32
231
|
export {
|
|
33
|
-
|
|
232
|
+
Ce as useSelectableCollection
|
|
34
233
|
};
|
package/index325.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index326.js"),a=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index326.js"),a=require("react"),r=require("./index255.js"),F=require("./index256.js");function v(l){let{isDisabled:u,onFocus:o,onBlur:n,onFocusChange:t}=l;const c=a.useCallback(e=>{if(e.target===e.currentTarget)return n&&n(e),t&&t(!1),!0},[n,t]),s=g.useSyntheticBlurEvent(c),d=a.useCallback(e=>{const i=F.getOwnerDocument(e.target),f=i?r.getActiveElement(i):r.getActiveElement();e.target===e.currentTarget&&f===r.getEventTarget(e.nativeEvent)&&(o&&o(e),t&&t(!0),s(e))},[t,o,s]);return{focusProps:{onFocus:!u&&(o||t||n)?d:void 0,onBlur:!u&&(n||t)?c:void 0}}}exports.useFocus=v;
|
package/index325.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSyntheticBlurEvent as l } from "./index326.mjs";
|
|
2
2
|
import { useCallback as u } from "react";
|
|
3
|
-
import { getActiveElement as a, getEventTarget as p } from "./
|
|
4
|
-
import { getOwnerDocument as m } from "./
|
|
3
|
+
import { getActiveElement as a, getEventTarget as p } from "./index255.mjs";
|
|
4
|
+
import { getOwnerDocument as m } from "./index256.mjs";
|
|
5
5
|
function x(d) {
|
|
6
6
|
let { isDisabled: r, onFocus: n, onBlur: o, onFocusChange: t } = d;
|
|
7
7
|
const c = u((e) => {
|
package/index326.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index256.js"),l=require("./index259.js"),E=require("./index235.js"),m=require("./index269.js"),p=require("./index275.js"),d=require("react");function f(r){let e=r;return e.nativeEvent=r,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function g(r,e){Object.defineProperty(r,"target",{value:e}),Object.defineProperty(r,"currentTarget",{value:e})}function F(r){let e=d.useRef({isFocused:!1,observer:null});E.useLayoutEffect(()=>{const t=e.current;return()=>{t.observer&&(t.observer.disconnect(),t.observer=null)}},[]);let u=m.useEffectEvent(t=>{r==null||r(t)});return d.useCallback(t=>{if(t.target instanceof HTMLButtonElement||t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement||t.target instanceof HTMLSelectElement){e.current.isFocused=!0;let o=t.target,s=c=>{if(e.current.isFocused=!1,o.disabled){let i=f(c);u(i)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&o.disabled){var c;(c=e.current.observer)===null||c===void 0||c.disconnect();let i=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:i})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:i}))}}),e.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[u])}exports.ignoreFocusEvent=!1;function L(r){for(;r&&!p.isFocusable(r);)r=r.parentElement;let e=b.getOwnerWindow(r),u=e.document.activeElement;if(!u||u===r)return;exports.ignoreFocusEvent=!0;let t=!1,o=n=>{(n.target===u||t)&&n.stopImmediatePropagation()},s=n=>{(n.target===u||t)&&(n.stopImmediatePropagation(),!r&&!t&&(t=!0,l.focusWithoutScrolling(u),a()))},c=n=>{(n.target===r||t)&&n.stopImmediatePropagation()},i=n=>{(n.target===r||t)&&(n.stopImmediatePropagation(),t||(t=!0,l.focusWithoutScrolling(u),a()))};e.addEventListener("blur",o,!0),e.addEventListener("focusout",s,!0),e.addEventListener("focusin",i,!0),e.addEventListener("focus",c,!0);let a=()=>{cancelAnimationFrame(v),e.removeEventListener("blur",o,!0),e.removeEventListener("focusout",s,!0),e.removeEventListener("focusin",i,!0),e.removeEventListener("focus",c,!0),exports.ignoreFocusEvent=!1,t=!1},v=requestAnimationFrame(a);return a}exports.createSyntheticEvent=f;exports.preventFocus=L;exports.setEventTarget=g;exports.useSyntheticBlurEvent=F;
|
package/index326.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getOwnerWindow as b } from "./
|
|
2
|
-
import { focusWithoutScrolling as l } from "./
|
|
1
|
+
import { getOwnerWindow as b } from "./index256.mjs";
|
|
2
|
+
import { focusWithoutScrolling as l } from "./index259.mjs";
|
|
3
3
|
import { useLayoutEffect as v } from "./index235.mjs";
|
|
4
|
-
import { useEffectEvent as m } from "./
|
|
5
|
-
import { isFocusable as p } from "./
|
|
4
|
+
import { useEffectEvent as m } from "./index269.mjs";
|
|
5
|
+
import { isFocusable as p } from "./index275.mjs";
|
|
6
6
|
import { useRef as E, useCallback as $ } from "react";
|
|
7
7
|
function g(r) {
|
|
8
8
|
let e = r;
|
package/index327.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index326.js"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index326.js"),u=require("./index256.js"),m=require("./index243.js"),L=require("./index271.js");require("react");let f=null,y=new Set,a=new Map,i=!1,c=!1;function d(e,n){for(let t of y)t(e,n)}function g(e){return!(e.metaKey||!m.isMac()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function s(e){i=!0,g(e)&&(f="keyboard",d("keyboard",e))}function o(e){f="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(i=!0,d("pointer",e))}function b(e){L.isVirtualClick(e)&&(i=!0,f="virtual")}function $(e){e.target===window||e.target===document||l.ignoreFocusEvent||!e.isTrusted||(!i&&!c&&(f="virtual",d("virtual",e)),i=!1,c=!1)}function E(){l.ignoreFocusEvent||(i=!1,c=!0)}function v(e){if(typeof window>"u"||a.get(u.getOwnerWindow(e)))return;const n=u.getOwnerWindow(e),t=u.getOwnerDocument(e);let r=n.HTMLElement.prototype.focus;n.HTMLElement.prototype.focus=function(){i=!0,r.apply(this,arguments)},t.addEventListener("keydown",s,!0),t.addEventListener("keyup",s,!0),t.addEventListener("click",b,!0),n.addEventListener("focus",$,!0),n.addEventListener("blur",E,!1),typeof PointerEvent<"u"?(t.addEventListener("pointerdown",o,!0),t.addEventListener("pointermove",o,!0),t.addEventListener("pointerup",o,!0)):process.env.NODE_ENV==="test"&&(t.addEventListener("mousedown",o,!0),t.addEventListener("mousemove",o,!0),t.addEventListener("mouseup",o,!0)),n.addEventListener("beforeunload",()=>{p(e)},{once:!0}),a.set(n,{focus:r})}const p=(e,n)=>{const t=u.getOwnerWindow(e),r=u.getOwnerDocument(e);n&&r.removeEventListener("DOMContentLoaded",n),a.has(t)&&(t.HTMLElement.prototype.focus=a.get(t).focus,r.removeEventListener("keydown",s,!0),r.removeEventListener("keyup",s,!0),r.removeEventListener("click",b,!0),t.removeEventListener("focus",$,!0),t.removeEventListener("blur",E,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",o,!0),r.removeEventListener("pointermove",o,!0),r.removeEventListener("pointerup",o,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",o,!0),r.removeEventListener("mousemove",o,!0),r.removeEventListener("mouseup",o,!0)),a.delete(t))};function w(e){const n=u.getOwnerDocument(e);let t;return n.readyState!=="loading"?v(e):(t=()=>{v(e)},n.addEventListener("DOMContentLoaded",t)),()=>p(e,t)}typeof document<"u"&&w();function O(){return f}function k(e){f=e,d(e,null)}exports.addWindowFocusTracking=w;exports.getInteractionModality=O;exports.hasSetupGlobalListeners=a;exports.setInteractionModality=k;
|
package/index327.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ignoreFocusEvent as b } from "./index326.mjs";
|
|
2
|
-
import { getOwnerDocument as v, getOwnerWindow as s } from "./
|
|
2
|
+
import { getOwnerDocument as v, getOwnerWindow as s } from "./index256.mjs";
|
|
3
3
|
import { isMac as L } from "./index243.mjs";
|
|
4
|
-
import { isVirtualClick as y } from "./
|
|
4
|
+
import { isVirtualClick as y } from "./index271.mjs";
|
|
5
5
|
import "react";
|
|
6
6
|
let f = null, w = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = !1, c = !1;
|
|
7
7
|
function u(e, n) {
|
package/index330.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index256.js"),r=require("./index261.js"),c=require("./index243.js");let n="default",s="",l=new WeakMap;function u(e){if(c.isIOS()){if(n==="default"){const t=o.getOwnerDocument(e);s=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}n="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";l.set(e,e.style[t]),e.style[t]="none"}}function d(e){if(c.isIOS()){if(n!=="disabled")return;n="restoring",setTimeout(()=>{r.runAfterTransition(()=>{if(n==="restoring"){const t=o.getOwnerDocument(e);t.documentElement.style.webkitUserSelect==="none"&&(t.documentElement.style.webkitUserSelect=s||""),s="",n="default"}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&l.has(e)){let t=l.get(e),i="userSelect"in e.style?"userSelect":"webkitUserSelect";e.style[i]==="none"&&(e.style[i]=t),e.getAttribute("style")===""&&e.removeAttribute("style"),l.delete(e)}}exports.disableTextSelection=u;exports.restoreTextSelection=d;
|
package/index330.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getOwnerDocument as i } from "./
|
|
2
|
-
import { runAfterTransition as f } from "./
|
|
1
|
+
import { getOwnerDocument as i } from "./index256.mjs";
|
|
2
|
+
import { runAfterTransition as f } from "./index261.mjs";
|
|
3
3
|
import { isIOS as o } from "./index243.mjs";
|
|
4
4
|
let l = "default", s = "", n = /* @__PURE__ */ new WeakMap();
|
|
5
5
|
function m(e) {
|
package/index333.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index252.js"),f=require("./index256.js"),m=require("./index154.js"),L=require("./index259.js"),y=require("./index262.js"),D=require("./index267.js"),T=require("react"),h=500;function v(c){let{isDisabled:s,onLongPressStart:n,onLongPressEnd:o,onLongPress:r,threshold:l=h,accessibilityDescription:p}=c;const t=T.useRef(void 0);let{addGlobalListener:i,removeGlobalListener:a}=y.useGlobalListeners(),{pressProps:d}=b.usePress({isDisabled:s,onPressStart(e){if(e.continuePropagation(),(e.pointerType==="mouse"||e.pointerType==="touch")&&(n&&n({...e,type:"longpressstart"}),t.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),f.getOwnerDocument(e.target).activeElement!==e.target&&L.focusWithoutScrolling(e.target),r&&r({...e,type:"longpress"}),t.current=void 0},l),e.pointerType==="touch")){let u=P=>{P.preventDefault()};i(e.target,"contextmenu",u,{once:!0}),i(window,"pointerup",()=>{setTimeout(()=>{a(e.target,"contextmenu",u)},30)},{once:!0})}},onPressEnd(e){t.current&&clearTimeout(t.current),o&&(e.pointerType==="mouse"||e.pointerType==="touch")&&o({...e,type:"longpressend"})}}),g=D.useDescription(r&&!s?p:void 0);return{longPressProps:m.mergeProps(d,g)}}exports.useLongPress=v;
|
package/index333.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { usePress as $ } from "./
|
|
2
|
-
import { getOwnerDocument as b } from "./
|
|
1
|
+
import { usePress as $ } from "./index252.mjs";
|
|
2
|
+
import { getOwnerDocument as b } from "./index256.mjs";
|
|
3
3
|
import { mergeProps as g } from "./index154.mjs";
|
|
4
|
-
import { focusWithoutScrolling as P } from "./
|
|
5
|
-
import { useGlobalListeners as L } from "./
|
|
6
|
-
import { useDescription as x } from "./
|
|
4
|
+
import { focusWithoutScrolling as P } from "./index259.mjs";
|
|
5
|
+
import { useGlobalListeners as L } from "./index262.mjs";
|
|
6
|
+
import { useDescription as x } from "./index267.mjs";
|
|
7
7
|
import { useRef as y } from "react";
|
|
8
8
|
const D = 500;
|
|
9
9
|
function R(p) {
|
package/index334.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index335.js"),d=require("./index325.js"),P=require("./index328.js"),n=require("./index154.js"),x=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index335.js"),d=require("./index325.js"),P=require("./index328.js"),n=require("./index154.js"),x=require("./index264.js"),r=require("react");let a=r.createContext(null);function y(e){let t=r.useContext(a)||{};x.useSyncRef(t,e);let{ref:u,...o}=t;return o}function $(e,t){let{focusProps:u}=d.useFocus(e),{keyboardProps:o}=P.useKeyboard(e),f=n.mergeProps(u,o),l=y(t),i=e.isDisabled?{}:l,s=r.useRef(e.autoFocus);r.useEffect(()=>{s.current&&t.current&&b.focusSafely(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:n.mergeProps({...f,tabIndex:c},i)}}exports.FocusableContext=a;exports.useFocusable=$;
|
package/index334.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { focusSafely as d } from "./index335.mjs";
|
|
|
2
2
|
import { useFocus as n } from "./index325.mjs";
|
|
3
3
|
import { useKeyboard as $ } from "./index328.mjs";
|
|
4
4
|
import { mergeProps as c } from "./index154.mjs";
|
|
5
|
-
import { useSyncRef as l } from "./
|
|
5
|
+
import { useSyncRef as l } from "./index264.mjs";
|
|
6
6
|
import i, { useRef as x, useEffect as p, useContext as m } from "react";
|
|
7
7
|
let P = /* @__PURE__ */ i.createContext(null);
|
|
8
8
|
function F(e) {
|
package/index335.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index327.js"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index327.js"),o=require("./index255.js"),u=require("./index256.js"),i=require("./index259.js"),s=require("./index261.js");function l(e){const t=u.getOwnerDocument(e),n=o.getActiveElement(t);if(r.getInteractionModality()==="virtual"){let c=n;s.runAfterTransition(()=>{o.getActiveElement(t)===c&&e.isConnected&&i.focusWithoutScrolling(e)})}else i.focusWithoutScrolling(e)}exports.focusSafely=l;
|
package/index335.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getInteractionModality as a } from "./index327.mjs";
|
|
2
|
-
import { getActiveElement as o } from "./
|
|
3
|
-
import { getOwnerDocument as i } from "./
|
|
4
|
-
import { focusWithoutScrolling as f } from "./
|
|
5
|
-
import { runAfterTransition as $ } from "./
|
|
2
|
+
import { getActiveElement as o } from "./index255.mjs";
|
|
3
|
+
import { getOwnerDocument as i } from "./index256.mjs";
|
|
4
|
+
import { focusWithoutScrolling as f } from "./index259.mjs";
|
|
5
|
+
import { runAfterTransition as $ } from "./index261.mjs";
|
|
6
6
|
function p(e) {
|
|
7
7
|
const t = i(e), c = o(t);
|
|
8
8
|
if (a() === "virtual") {
|
package/index336.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index337.js"),M=require("./index338.js"),$=require("./index339.js"),v=require("react"),m=require("./index340.js");function q(e){let{filter:t,layoutDelegate:n}=e,c=M.useMultipleSelectionState(e),f=v.useMemo(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),y=v.useCallback(a=>t?new C.ListCollection(t(a)):new C.ListCollection(a),[t]),S=v.useMemo(()=>({suppressTextValueWarning:e.suppressTextValueWarning}),[e.suppressTextValueWarning]),o=m.useCollection(e,y,S),r=v.useMemo(()=>new $.SelectionManager(o,c,{layoutDelegate:n}),[o,c,n]);return k(o,r),{collection:o,disabledKeys:f,selectionManager:r}}function k(e,t){const n=v.useRef(null);v.useEffect(()=>{if(t.focusedKey!=null&&!e.getItem(t.focusedKey)&&n.current){const l=n.current.getItem(t.focusedKey),g=[...n.current.getKeys()].map(s=>{const i=n.current.getItem(s);return(i==null?void 0:i.type)==="item"?i:null}).filter(s=>s!==null),u=[...e.getKeys()].map(s=>{const i=e.getItem(s);return(i==null?void 0:i.type)==="item"?i:null}).filter(s=>s!==null);var c,f;const b=((c=g==null?void 0:g.length)!==null&&c!==void 0?c:0)-((f=u==null?void 0:u.length)!==null&&f!==void 0?f:0);var y,S,o;let d=Math.min(b>1?Math.max(((y=l==null?void 0:l.index)!==null&&y!==void 0?y:0)-b+1,0):(S=l==null?void 0:l.index)!==null&&S!==void 0?S:0,((o=u==null?void 0:u.length)!==null&&o!==void 0?o:0)-1),K=null,w=!1;for(;d>=0;){if(!t.isDisabled(u[d].key)){K=u[d];break}if(d<u.length-1&&!w)d++;else{w=!0;var r,a;d>((r=l==null?void 0:l.index)!==null&&r!==void 0?r:0)&&(d=(a=l==null?void 0:l.index)!==null&&a!==void 0?a:0),d--}}t.setFocusedKey(K?K.key:null)}n.current=e},[e,t])}exports.useListState=q;
|
package/index336.mjs
CHANGED
|
@@ -1,24 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ListCollection as p } from "./index337.mjs";
|
|
2
|
+
import { useMultipleSelectionState as x } from "./index338.mjs";
|
|
3
|
+
import { SelectionManager as S } from "./index339.mjs";
|
|
4
|
+
import { useMemo as m, useCallback as w, useRef as k, useEffect as C } from "react";
|
|
5
|
+
import { useCollection as D } from "./index340.mjs";
|
|
6
|
+
function L(e) {
|
|
7
|
+
let { filter: t, layoutDelegate: o } = e, r = x(e), f = m(() => e.disabledKeys ? new Set(e.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
8
|
+
e.disabledKeys
|
|
9
|
+
]), v = w((c) => t ? new p(t(c)) : new p(c), [
|
|
10
|
+
t
|
|
11
|
+
]), y = m(() => ({
|
|
12
|
+
suppressTextValueWarning: e.suppressTextValueWarning
|
|
13
|
+
}), [
|
|
14
|
+
e.suppressTextValueWarning
|
|
15
|
+
]), n = D(e, v, y), s = m(() => new S(n, r, {
|
|
16
|
+
layoutDelegate: o
|
|
17
|
+
}), [
|
|
18
|
+
n,
|
|
19
|
+
r,
|
|
20
|
+
o
|
|
21
|
+
]);
|
|
22
|
+
return R(n, s), {
|
|
23
|
+
collection: n,
|
|
24
|
+
disabledKeys: f,
|
|
25
|
+
selectionManager: s
|
|
26
|
+
};
|
|
5
27
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
function R(e, t) {
|
|
29
|
+
const o = k(null);
|
|
30
|
+
C(() => {
|
|
31
|
+
if (t.focusedKey != null && !e.getItem(t.focusedKey) && o.current) {
|
|
32
|
+
const l = o.current.getItem(t.focusedKey), $ = [
|
|
33
|
+
...o.current.getKeys()
|
|
34
|
+
].map((a) => {
|
|
35
|
+
const i = o.current.getItem(a);
|
|
36
|
+
return (i == null ? void 0 : i.type) === "item" ? i : null;
|
|
37
|
+
}).filter((a) => a !== null), u = [
|
|
38
|
+
...e.getKeys()
|
|
39
|
+
].map((a) => {
|
|
40
|
+
const i = e.getItem(a);
|
|
41
|
+
return (i == null ? void 0 : i.type) === "item" ? i : null;
|
|
42
|
+
}).filter((a) => a !== null);
|
|
43
|
+
var r, f;
|
|
44
|
+
const K = ((r = $ == null ? void 0 : $.length) !== null && r !== void 0 ? r : 0) - ((f = u == null ? void 0 : u.length) !== null && f !== void 0 ? f : 0);
|
|
45
|
+
var v, y, n;
|
|
46
|
+
let d = Math.min(K > 1 ? Math.max(((v = l == null ? void 0 : l.index) !== null && v !== void 0 ? v : 0) - K + 1, 0) : (y = l == null ? void 0 : l.index) !== null && y !== void 0 ? y : 0, ((n = u == null ? void 0 : u.length) !== null && n !== void 0 ? n : 0) - 1), b = null, g = !1;
|
|
47
|
+
for (; d >= 0; ) {
|
|
48
|
+
if (!t.isDisabled(u[d].key)) {
|
|
49
|
+
b = u[d];
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
if (d < u.length - 1 && !g) d++;
|
|
53
|
+
else {
|
|
54
|
+
g = !0;
|
|
55
|
+
var s, c;
|
|
56
|
+
d > ((s = l == null ? void 0 : l.index) !== null && s !== void 0 ? s : 0) && (d = (c = l == null ? void 0 : l.index) !== null && c !== void 0 ? c : 0), d--;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
t.setFocusedKey(b ? b.key : null);
|
|
60
|
+
}
|
|
61
|
+
o.current = e;
|
|
62
|
+
}, [
|
|
63
|
+
e,
|
|
64
|
+
t
|
|
65
|
+
]);
|
|
18
66
|
}
|
|
19
67
|
export {
|
|
20
|
-
|
|
21
|
-
u as getItemElement,
|
|
22
|
-
d as isNonContiguousSelectionModifier,
|
|
23
|
-
b as useCollectionId
|
|
68
|
+
L as useListState
|
|
24
69
|
};
|
package/index337.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class y{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(l){let e=this.keyMap.get(l);var t;return e&&(t=e.prevKey)!==null&&t!==void 0?t:null}getKeyAfter(l){let e=this.keyMap.get(l);var t;return e&&(t=e.nextKey)!==null&&t!==void 0?t:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(l){var e;return(e=this.keyMap.get(l))!==null&&e!==void 0?e:null}at(l){const e=[...this.getKeys()];return this.getItem(e[l])}getChildren(l){let e=this.keyMap.get(l);return(e==null?void 0:e.childNodes)||[]}constructor(l){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=l;let e=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let s of i.childNodes)e(s)};for(let i of l)e(i);let t=null,n=0;for(let[i,s]of this.keyMap)t?(t.nextKey=i,s.prevKey=t.key):(this.firstKey=i,s.prevKey=void 0),s.type==="item"&&(s.index=n++),t=s,t.nextKey=void 0;var r;this.lastKey=(r=t==null?void 0:t.key)!==null&&r!==void 0?r:null}}exports.ListCollection=y;
|
package/index337.mjs
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
class o {
|
|
2
|
+
*[Symbol.iterator]() {
|
|
3
|
+
yield* this.iterable;
|
|
4
|
+
}
|
|
5
|
+
get size() {
|
|
6
|
+
return this.keyMap.size;
|
|
7
|
+
}
|
|
8
|
+
getKeys() {
|
|
9
|
+
return this.keyMap.keys();
|
|
10
|
+
}
|
|
11
|
+
getKeyBefore(l) {
|
|
12
|
+
let e = this.keyMap.get(l);
|
|
13
|
+
var t;
|
|
14
|
+
return e && (t = e.prevKey) !== null && t !== void 0 ? t : null;
|
|
15
|
+
}
|
|
16
|
+
getKeyAfter(l) {
|
|
17
|
+
let e = this.keyMap.get(l);
|
|
18
|
+
var t;
|
|
19
|
+
return e && (t = e.nextKey) !== null && t !== void 0 ? t : null;
|
|
20
|
+
}
|
|
21
|
+
getFirstKey() {
|
|
22
|
+
return this.firstKey;
|
|
23
|
+
}
|
|
24
|
+
getLastKey() {
|
|
25
|
+
return this.lastKey;
|
|
26
|
+
}
|
|
27
|
+
getItem(l) {
|
|
28
|
+
var e;
|
|
29
|
+
return (e = this.keyMap.get(l)) !== null && e !== void 0 ? e : null;
|
|
30
|
+
}
|
|
31
|
+
at(l) {
|
|
32
|
+
const e = [
|
|
33
|
+
...this.getKeys()
|
|
34
|
+
];
|
|
35
|
+
return this.getItem(e[l]);
|
|
36
|
+
}
|
|
37
|
+
getChildren(l) {
|
|
38
|
+
let e = this.keyMap.get(l);
|
|
39
|
+
return (e == null ? void 0 : e.childNodes) || [];
|
|
40
|
+
}
|
|
41
|
+
constructor(l) {
|
|
42
|
+
this.keyMap = /* @__PURE__ */ new Map(), this.firstKey = null, this.lastKey = null, this.iterable = l;
|
|
43
|
+
let e = (i) => {
|
|
44
|
+
if (this.keyMap.set(i.key, i), i.childNodes && i.type === "section") for (let s of i.childNodes) e(s);
|
|
45
|
+
};
|
|
46
|
+
for (let i of l) e(i);
|
|
47
|
+
let t = null, n = 0;
|
|
48
|
+
for (let [i, s] of this.keyMap)
|
|
49
|
+
t ? (t.nextKey = i, s.prevKey = t.key) : (this.firstKey = i, s.prevKey = void 0), s.type === "item" && (s.index = n++), t = s, t.nextKey = void 0;
|
|
50
|
+
var r;
|
|
51
|
+
this.lastKey = (r = t == null ? void 0 : t.key) !== null && r !== void 0 ? r : null;
|
|
52
|
+
}
|
|
29
53
|
}
|
|
30
54
|
export {
|
|
31
|
-
|
|
55
|
+
o as ListCollection
|
|
32
56
|
};
|