@midas-ds/components 1.0.3 → 1.1.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/{Button-B4vMZbC6.js → Button-DL6nqUco.js} +22 -22
- package/CHANGELOG.md +6 -1
- package/{Checkbox-DnKWanep.js → Checkbox-q0dugR2t.js} +8 -8
- package/{Collection-COLWgm24.js → Collection-KMFfVuzU.js} +2 -2
- package/{Dialog-Cb6toyXO.js → Dialog-D6Bqrpn-.js} +170 -169
- package/Disclosure-dAZYXyTH.js +225 -0
- package/Disclosure.css +1 -0
- package/{FocusScope-C8i7CH6y.js → FocusScope-B7CkxXNC.js} +1 -1
- package/{Form-BQQs3jUk.js → Form-BWBjJC6v.js} +42 -42
- package/{Group-CdwXhx8Q.js → Group-D7_8007y.js} +10 -10
- package/Heading-RCRHv6hd.js +15 -0
- package/{Hidden-DngIphiL.js → Hidden-CVlUgUJM.js} +1 -1
- package/{Link-iAZLB3RI.js → Link-BnQvB-hH.js} +8 -8
- package/{ListBox-BKWkIIm6.js → ListBox-DBBiqvcR.js} +72 -72
- package/{ListKeyboardDelegate-BH-K5hyq.js → ListKeyboardDelegate-gCXy-Xnn.js} +2 -2
- package/{PressResponder-Cz-TRBHO.js → PressResponder-B4g56kDz.js} +5 -5
- package/{RSPContexts-EOiWkKOf.js → RSPContexts-BW2SEIqe.js} +2 -2
- package/{SelectionManager-8o40f7mx.js → SelectionManager-BfXUE1qg.js} +113 -129
- package/{Separator-BlvmQjwz.js → Separator-BBX9m2O2.js} +2 -2
- package/{Tag--W5TgxmK.js → Tag-DWt0koFj.js} +74 -74
- package/Text-BCF0xvqL.js +15 -0
- package/{TextField-DeK_yiK-.js → TextField-CX4eOQf6.js} +33 -33
- package/{TextField.module-0-u4LVPp.js → TextField.module-DdICj682.js} +7 -7
- package/{VisuallyHidden-CFx06Bae.js → VisuallyHidden-Dhr5caPC.js} +1 -1
- package/accordion/Accordion.d.ts +8 -8
- package/accordion/AccordionItem.d.ts +11 -3
- package/accordion/index.d.ts +0 -3
- package/{context-Bnqknrce.js → context-BpJLnOuu.js} +11 -11
- package/global.css +1 -0
- package/index.d.ts +1 -0
- package/index.js +105 -110
- package/index10.js +1 -1
- package/index11.js +1 -1
- package/index12.js +1 -1
- package/index13.js +1 -1
- package/index14.js +1 -1
- package/index15.js +2 -2
- package/index16.js +2 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +2 -2
- package/index2.js +1 -1
- package/index20.js +2 -2
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +2 -2
- package/index26.js +2 -2
- package/index27.js +2 -2
- package/index28.js +1 -1
- package/index29.js +2 -8
- package/index3.js +1 -1
- package/index30.js +17 -16
- package/index31.js +1 -1
- package/index32.js +1 -1
- package/index33.js +1 -1
- package/index34.js +2 -2
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/index38.js +1 -1
- package/index39.js +1 -1
- package/index4.js +1 -1
- package/index40.js +19 -12
- package/index41.js +61 -14
- package/index42.js +44 -22
- package/index43.js +13 -11
- package/index44.js +25 -4
- package/index45.js +16 -51
- package/index46.js +19 -16
- package/index47.js +49 -27
- package/index48.js +5 -18
- package/index49.js +25 -21
- package/index5.js +1 -1
- package/index50.js +16 -47
- package/index51.js +7 -3
- package/index52.js +18 -18
- package/index53.js +16 -16
- package/index54.js +5 -3
- package/index55.js +7 -20
- package/index56.js +13 -16
- package/index57.js +6 -8
- package/index58.js +5 -8
- package/index59.js +17 -13
- package/index6.js +1 -1
- package/index60.js +20 -7
- package/index61.js +59 -7
- package/index62.js +13 -17
- package/index63.js +9 -20
- package/index64.js +38 -46
- package/index65.js +85 -15
- package/index66.js +74 -11
- package/index67.js +23 -62
- package/index68.js +64 -80
- package/index69.js +68 -62
- package/index7.js +1 -1
- package/index70.js +138 -22
- package/index71.js +66 -65
- package/index72.js +40 -78
- package/index73.js +75 -133
- package/index74.js +69 -68
- package/index75.js +96 -34
- package/index76.js +258 -65
- package/index77.js +715 -63
- package/index78.js +478 -93
- package/index79.js +303 -263
- package/index8.js +1 -1
- package/index80.js +343 -677
- package/index81.js +242 -479
- package/index82.js +1332 -282
- package/index83.js +966 -346
- package/index84.js +344 -210
- package/index85.js +2024 -1286
- package/index86.js +2314 -955
- package/index87.js +6785 -340
- package/index88.js +15 -2099
- package/index89.js +12 -2367
- package/index9.js +1 -1
- package/index90.js +4 -6834
- package/index91.js +7 -15
- package/package.json +1 -1
- package/useControlledState-Kv9K2AYu.js +30 -0
- package/{useDescription-BPs7eRff.js → useDescription-B7stiK3j.js} +1 -1
- package/useEvent-Xk5kn5Ns.js +21 -0
- package/{useField-Dz62UHCP.js → useField-DMzJIIN4.js} +5 -5
- package/{useFilter-ViwzkzZe.js → useFilter-Bt9dbV1U.js} +1 -1
- package/{useFocusRing-BKGhL91C.js → useFocusRing-9PXyKy2A.js} +26 -26
- package/{useFocusable-CRSmYEQc.js → useFocusable-CcEBZe40.js} +1 -1
- package/{useGridSelectionCheckbox-CVEvUCJL.js → useGridSelectionCheckbox-DYgEnElE.js} +3 -3
- package/{useHasTabbableChild-C8y4fwiY.js → useHasTabbableChild-D6DwR81L.js} +5 -5
- package/{useHighlightSelectionDescription-CD74uzLh.js → useHighlightSelectionDescription-WYAbP4No.js} +4 -4
- package/useLabels-9zaZ9oa0.js +17 -0
- package/{useListState-DKnP5TB5.js → useListState-BfTeKTk5.js} +1 -1
- package/{useLocalizedStringFormatter-DsZ-ZWSk.js → useLocalizedStringFormatter-BlCbn-hX.js} +1 -1
- package/{useSingleSelectListState-BHTLh8Ob.js → useSingleSelectListState-DPkaL0la.js} +2 -2
- package/Text-CQPW6xs7.js +0 -15
- package/accordion/AccordionContent.d.ts +0 -3
- package/accordion/AccordionTagContext.d.ts +0 -3
- package/accordion/AccordionTrigger.d.ts +0 -3
- package/index-DK9ZACEc.js +0 -642
- package/index.css +0 -1
- package/index92.js +0 -14
- package/index93.js +0 -6
- package/index94.js +0 -9
- package/useControlledState-DrAoodI6.js +0 -45
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import U, { useRef as A, useEffect as
|
|
2
|
-
import {
|
|
1
|
+
import U, { useRef as A, useEffect as Y, useMemo as j, useState as ee } from "react";
|
|
2
|
+
import { l as ue, G as we, L as xe, n as me, e as se, M as Fe, p as Se, m as ce, u as ne, x as de, N as fe, k as Te, O as ke } from "./useFocusRing-9PXyKy2A.js";
|
|
3
|
+
import { $ as q } from "./useEvent-Xk5kn5Ns.js";
|
|
3
4
|
import { flushSync as De } from "react-dom";
|
|
4
|
-
import { $ as Ie } from "./FocusScope-
|
|
5
|
-
import { $ as Ae } from "./context-
|
|
6
|
-
import { $ as Ce } from "./useDescription-
|
|
7
|
-
import { $ as
|
|
5
|
+
import { $ as Ie } from "./FocusScope-B7CkxXNC.js";
|
|
6
|
+
import { $ as Ae } from "./context-BpJLnOuu.js";
|
|
7
|
+
import { $ as Ce } from "./useDescription-B7stiK3j.js";
|
|
8
|
+
import { $ as Me } from "./useControlledState-Kv9K2AYu.js";
|
|
8
9
|
function ae(n, e) {
|
|
9
10
|
const t = A(!0), l = A(null);
|
|
10
|
-
|
|
11
|
+
ue(() => (t.current = !0, () => {
|
|
11
12
|
t.current = !1;
|
|
12
|
-
}), []),
|
|
13
|
+
}), []), ue(() => {
|
|
13
14
|
t.current ? t.current = !1 : (!l.current || e.some((i, u) => !Object.is(i, l[u]))) && n(), l.current = e;
|
|
14
15
|
}, e);
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function Ee(n, e) {
|
|
17
18
|
if (!n) return !1;
|
|
18
19
|
let t = window.getComputedStyle(n), l = /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
|
19
20
|
return l && e && (l = n.scrollHeight !== n.clientHeight || n.scrollWidth !== n.clientWidth), l;
|
|
@@ -21,28 +22,12 @@ function Me(n, e) {
|
|
|
21
22
|
function Be(n, e) {
|
|
22
23
|
const t = [];
|
|
23
24
|
for (; n && n !== document.documentElement; )
|
|
24
|
-
|
|
25
|
+
Ee(n, e) && t.push(n), n = n.parentElement;
|
|
25
26
|
return t;
|
|
26
27
|
}
|
|
27
|
-
function Y(n, e, t, l) {
|
|
28
|
-
let i = ne(t), u = t == null;
|
|
29
|
-
G(() => {
|
|
30
|
-
if (u || !n.current) return;
|
|
31
|
-
let s = n.current;
|
|
32
|
-
return s.addEventListener(e, i, l), () => {
|
|
33
|
-
s.removeEventListener(e, i, l);
|
|
34
|
-
};
|
|
35
|
-
}, [
|
|
36
|
-
n,
|
|
37
|
-
e,
|
|
38
|
-
l,
|
|
39
|
-
u,
|
|
40
|
-
i
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
28
|
function ve(n, e) {
|
|
44
|
-
let t = he(n, e, "left"), l = he(n, e, "top"), i = e.offsetWidth, u = e.offsetHeight, s = n.scrollLeft, f = n.scrollTop, { borderTopWidth: d, borderLeftWidth:
|
|
45
|
-
t <= s + F ? s = t - parseInt(
|
|
29
|
+
let t = he(n, e, "left"), l = he(n, e, "top"), i = e.offsetWidth, u = e.offsetHeight, s = n.scrollLeft, f = n.scrollTop, { borderTopWidth: d, borderLeftWidth: m, scrollPaddingTop: w, scrollPaddingRight: v, scrollPaddingBottom: $, scrollPaddingLeft: a } = getComputedStyle(n), T = s + parseInt(m, 10), k = f + parseInt(d, 10), b = T + n.clientWidth, h = k + n.clientHeight, g = parseInt(w, 10) || 0, p = parseInt($, 10) || 0, x = parseInt(v, 10) || 0, F = parseInt(a, 10) || 0;
|
|
30
|
+
t <= s + F ? s = t - parseInt(m, 10) - F : t + i > b - x && (s += t + i - b + x), l <= k + g ? f = l - parseInt(d, 10) - g : l + u > h - p && (f += l + u - h + p), n.scrollLeft = s, n.scrollTop = f;
|
|
46
31
|
}
|
|
47
32
|
function he(n, e, t) {
|
|
48
33
|
const l = t === "left" ? "offsetLeft" : "offsetTop";
|
|
@@ -61,15 +46,15 @@ function ye(n, e) {
|
|
|
61
46
|
let s = document.scrollingElement || document.documentElement;
|
|
62
47
|
if (window.getComputedStyle(s).overflow === "hidden") {
|
|
63
48
|
let d = Be(n);
|
|
64
|
-
for (let
|
|
49
|
+
for (let m of d) ve(m, n);
|
|
65
50
|
} else {
|
|
66
51
|
var t;
|
|
67
|
-
let { left: d, top:
|
|
52
|
+
let { left: d, top: m } = n.getBoundingClientRect();
|
|
68
53
|
n == null || (t = n.scrollIntoView) === null || t === void 0 || t.call(n, {
|
|
69
54
|
block: "nearest"
|
|
70
55
|
});
|
|
71
56
|
let { left: w, top: v } = n.getBoundingClientRect();
|
|
72
|
-
if (Math.abs(d - w) > 1 || Math.abs(
|
|
57
|
+
if (Math.abs(d - w) > 1 || Math.abs(m - v) > 1) {
|
|
73
58
|
var l, i, u;
|
|
74
59
|
e == null || (i = e.containingElement) === null || i === void 0 || (l = i.scrollIntoView) === null || l === void 0 || l.call(i, {
|
|
75
60
|
block: "center",
|
|
@@ -89,7 +74,7 @@ const Oe = 500;
|
|
|
89
74
|
function ze(n) {
|
|
90
75
|
let { isDisabled: e, onLongPressStart: t, onLongPressEnd: l, onLongPress: i, threshold: u = Oe, accessibilityDescription: s } = n;
|
|
91
76
|
const f = A(void 0);
|
|
92
|
-
let { addGlobalListener: d, removeGlobalListener:
|
|
77
|
+
let { addGlobalListener: d, removeGlobalListener: m } = xe(), { pressProps: w } = me({
|
|
93
78
|
isDisabled: e,
|
|
94
79
|
onPressStart($) {
|
|
95
80
|
if ($.continuePropagation(), ($.pointerType === "mouse" || $.pointerType === "touch") && (t && t({
|
|
@@ -110,7 +95,7 @@ function ze(n) {
|
|
|
110
95
|
once: !0
|
|
111
96
|
}), d(window, "pointerup", () => {
|
|
112
97
|
setTimeout(() => {
|
|
113
|
-
|
|
98
|
+
m($.target, "contextmenu", a);
|
|
114
99
|
}, 30);
|
|
115
100
|
}, {
|
|
116
101
|
once: !0
|
|
@@ -125,10 +110,10 @@ function ze(n) {
|
|
|
125
110
|
}
|
|
126
111
|
}), v = Ce(i && !e ? s : void 0);
|
|
127
112
|
return {
|
|
128
|
-
longPressProps:
|
|
113
|
+
longPressProps: se(w, v)
|
|
129
114
|
};
|
|
130
115
|
}
|
|
131
|
-
function
|
|
116
|
+
function ie(n) {
|
|
132
117
|
return Fe() ? n.altKey : n.ctrlKey;
|
|
133
118
|
}
|
|
134
119
|
const Ue = 1e3;
|
|
@@ -159,23 +144,23 @@ function We(n) {
|
|
|
159
144
|
function He(n) {
|
|
160
145
|
return n.length === 1 || !/^[A-Z]/i.test(n) ? n : "";
|
|
161
146
|
}
|
|
162
|
-
function
|
|
163
|
-
let { selectionManager: e, keyboardDelegate: t, ref: l, autoFocus: i = !1, shouldFocusWrap: u = !1, disallowEmptySelection: s = !1, disallowSelectAll: f = !1, selectOnFocus: d = e.selectionBehavior === "replace", disallowTypeAhead:
|
|
147
|
+
function nt(n) {
|
|
148
|
+
let { selectionManager: e, keyboardDelegate: t, ref: l, autoFocus: i = !1, shouldFocusWrap: u = !1, disallowEmptySelection: s = !1, disallowSelectAll: f = !1, selectOnFocus: d = e.selectionBehavior === "replace", disallowTypeAhead: m = !1, shouldUseVirtualFocus: w, allowsTabNavigation: v = !1, isVirtualized: $, scrollRef: a = l, linkBehavior: T = "action" } = n, { direction: k } = Ae(), b = Se(), h = (o) => {
|
|
164
149
|
var y;
|
|
165
150
|
if (o.altKey && o.key === "Tab" && o.preventDefault(), !(!((y = l.current) === null || y === void 0) && y.contains(o.target))) return;
|
|
166
|
-
const
|
|
151
|
+
const K = (c, z) => {
|
|
167
152
|
if (c != null) {
|
|
168
|
-
if (e.isLink(c) && T === "selection" && d && !
|
|
153
|
+
if (e.isLink(c) && T === "selection" && d && !ie(o)) {
|
|
169
154
|
var O;
|
|
170
155
|
De(() => {
|
|
171
156
|
e.setFocusedKey(c, z);
|
|
172
157
|
});
|
|
173
|
-
let
|
|
174
|
-
|
|
158
|
+
let re = (O = a.current) === null || O === void 0 ? void 0 : O.querySelector(`[data-key="${CSS.escape(c.toString())}"]`), oe = e.getItemProps(c);
|
|
159
|
+
re && b.open(re, o, oe.href, oe.routerOptions);
|
|
175
160
|
return;
|
|
176
161
|
}
|
|
177
162
|
if (e.setFocusedKey(c, z), e.isLink(c) && T === "override") return;
|
|
178
|
-
o.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(c) : d && !
|
|
163
|
+
o.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(c) : d && !ie(o) && e.replaceSelection(c);
|
|
179
164
|
}
|
|
180
165
|
};
|
|
181
166
|
switch (o.key) {
|
|
@@ -183,28 +168,28 @@ function lt(n) {
|
|
|
183
168
|
if (t.getKeyBelow) {
|
|
184
169
|
var S, I, r;
|
|
185
170
|
let c = e.focusedKey != null ? (S = t.getKeyBelow) === null || S === void 0 ? void 0 : S.call(t, e.focusedKey) : (I = t.getFirstKey) === null || I === void 0 ? void 0 : I.call(t);
|
|
186
|
-
c == null && u && (c = (r = t.getFirstKey) === null || r === void 0 ? void 0 : r.call(t, e.focusedKey)), c != null && (o.preventDefault(),
|
|
171
|
+
c == null && u && (c = (r = t.getFirstKey) === null || r === void 0 ? void 0 : r.call(t, e.focusedKey)), c != null && (o.preventDefault(), K(c));
|
|
187
172
|
}
|
|
188
173
|
break;
|
|
189
174
|
case "ArrowUp":
|
|
190
175
|
if (t.getKeyAbove) {
|
|
191
176
|
var P, B, X;
|
|
192
177
|
let c = e.focusedKey != null ? (P = t.getKeyAbove) === null || P === void 0 ? void 0 : P.call(t, e.focusedKey) : (B = t.getLastKey) === null || B === void 0 ? void 0 : B.call(t);
|
|
193
|
-
c == null && u && (c = (X = t.getLastKey) === null || X === void 0 ? void 0 : X.call(t, e.focusedKey)), c != null && (o.preventDefault(),
|
|
178
|
+
c == null && u && (c = (X = t.getLastKey) === null || X === void 0 ? void 0 : X.call(t, e.focusedKey)), c != null && (o.preventDefault(), K(c));
|
|
194
179
|
}
|
|
195
180
|
break;
|
|
196
181
|
case "ArrowLeft":
|
|
197
182
|
if (t.getKeyLeftOf) {
|
|
198
|
-
var V,
|
|
183
|
+
var V, Z, J;
|
|
199
184
|
let c = e.focusedKey != null ? (V = t.getKeyLeftOf) === null || V === void 0 ? void 0 : V.call(t, e.focusedKey) : null;
|
|
200
|
-
c == null && u && (c = k === "rtl" ? (
|
|
185
|
+
c == null && u && (c = k === "rtl" ? (Z = t.getFirstKey) === null || Z === void 0 ? void 0 : Z.call(t, e.focusedKey) : (J = t.getLastKey) === null || J === void 0 ? void 0 : J.call(t, e.focusedKey)), c != null && (o.preventDefault(), K(c, k === "rtl" ? "first" : "last"));
|
|
201
186
|
}
|
|
202
187
|
break;
|
|
203
188
|
case "ArrowRight":
|
|
204
189
|
if (t.getKeyRightOf) {
|
|
205
190
|
var Q, N, _;
|
|
206
191
|
let c = e.focusedKey != null ? (Q = t.getKeyRightOf) === null || Q === void 0 ? void 0 : Q.call(t, e.focusedKey) : null;
|
|
207
|
-
c == null && u && (c = k === "rtl" ? (N = t.getLastKey) === null || N === void 0 ? void 0 : N.call(t, e.focusedKey) : (_ = t.getFirstKey) === null || _ === void 0 ? void 0 : _.call(t, e.focusedKey)), c != null && (o.preventDefault(),
|
|
192
|
+
c == null && u && (c = k === "rtl" ? (N = t.getLastKey) === null || N === void 0 ? void 0 : N.call(t, e.focusedKey) : (_ = t.getFirstKey) === null || _ === void 0 ? void 0 : _.call(t, e.focusedKey)), c != null && (o.preventDefault(), K(c, k === "rtl" ? "last" : "first"));
|
|
208
193
|
}
|
|
209
194
|
break;
|
|
210
195
|
case "Home":
|
|
@@ -226,13 +211,13 @@ function lt(n) {
|
|
|
226
211
|
case "PageDown":
|
|
227
212
|
if (t.getKeyPageBelow && e.focusedKey != null) {
|
|
228
213
|
let c = t.getKeyPageBelow(e.focusedKey);
|
|
229
|
-
c != null && (o.preventDefault(),
|
|
214
|
+
c != null && (o.preventDefault(), K(c));
|
|
230
215
|
}
|
|
231
216
|
break;
|
|
232
217
|
case "PageUp":
|
|
233
218
|
if (t.getKeyPageAbove && e.focusedKey != null) {
|
|
234
219
|
let c = t.getKeyPageAbove(e.focusedKey);
|
|
235
|
-
c != null && (o.preventDefault(),
|
|
220
|
+
c != null && (o.preventDefault(), K(c));
|
|
236
221
|
}
|
|
237
222
|
break;
|
|
238
223
|
case "a":
|
|
@@ -260,10 +245,10 @@ function lt(n) {
|
|
|
260
245
|
top: 0,
|
|
261
246
|
left: 0
|
|
262
247
|
});
|
|
263
|
-
|
|
264
|
-
var o, y,
|
|
248
|
+
q(a, "scroll", $ ? void 0 : () => {
|
|
249
|
+
var o, y, K, S;
|
|
265
250
|
g.current = {
|
|
266
|
-
top: (
|
|
251
|
+
top: (K = (o = a.current) === null || o === void 0 ? void 0 : o.scrollTop) !== null && K !== void 0 ? K : 0,
|
|
267
252
|
left: (S = (y = a.current) === null || y === void 0 ? void 0 : y.scrollLeft) !== null && S !== void 0 ? S : 0
|
|
268
253
|
};
|
|
269
254
|
});
|
|
@@ -274,12 +259,12 @@ function lt(n) {
|
|
|
274
259
|
}
|
|
275
260
|
if (o.currentTarget.contains(o.target)) {
|
|
276
261
|
if (e.setFocused(!0), e.focusedKey == null) {
|
|
277
|
-
var y,
|
|
262
|
+
var y, K;
|
|
278
263
|
let r = (B) => {
|
|
279
264
|
B != null && (e.setFocusedKey(B), d && e.replaceSelection(B));
|
|
280
265
|
}, P = o.relatedTarget;
|
|
281
266
|
var S, I;
|
|
282
|
-
P && o.currentTarget.compareDocumentPosition(P) & Node.DOCUMENT_POSITION_FOLLOWING ? r((S = e.lastSelectedKey) !== null && S !== void 0 ? S : (y = t.getLastKey) === null || y === void 0 ? void 0 : y.call(t)) : r((I = e.firstSelectedKey) !== null && I !== void 0 ? I : (
|
|
267
|
+
P && o.currentTarget.compareDocumentPosition(P) & Node.DOCUMENT_POSITION_FOLLOWING ? r((S = e.lastSelectedKey) !== null && S !== void 0 ? S : (y = t.getLastKey) === null || y === void 0 ? void 0 : y.call(t)) : r((I = e.firstSelectedKey) !== null && I !== void 0 ? I : (K = t.getFirstKey) === null || K === void 0 ? void 0 : K.call(t));
|
|
283
268
|
} else !$ && a.current && (a.current.scrollTop = g.current.top, a.current.scrollLeft = g.current.left);
|
|
284
269
|
if (e.focusedKey != null && a.current) {
|
|
285
270
|
let r = a.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);
|
|
@@ -291,21 +276,21 @@ function lt(n) {
|
|
|
291
276
|
}, x = (o) => {
|
|
292
277
|
o.currentTarget.contains(o.relatedTarget) || e.setFocused(!1);
|
|
293
278
|
}, F = A(!1);
|
|
294
|
-
|
|
279
|
+
q(l, Re, w ? (o) => {
|
|
295
280
|
let { detail: y } = o;
|
|
296
281
|
o.stopPropagation(), e.setFocused(!0), (y == null ? void 0 : y.focusStrategy) === "first" && (F.current = !0);
|
|
297
282
|
} : void 0);
|
|
298
|
-
let L =
|
|
283
|
+
let L = ce(() => {
|
|
299
284
|
var o, y;
|
|
300
|
-
let
|
|
301
|
-
if (
|
|
285
|
+
let K = (y = (o = t.getFirstKey) === null || o === void 0 ? void 0 : o.call(t)) !== null && y !== void 0 ? y : null;
|
|
286
|
+
if (K == null) {
|
|
302
287
|
var S;
|
|
303
288
|
(S = l.current) === null || S === void 0 || S.dispatchEvent(new CustomEvent(Pe, {
|
|
304
289
|
cancelable: !0,
|
|
305
290
|
bubbles: !0
|
|
306
291
|
})), e.collection.size > 0 && (F.current = !1);
|
|
307
292
|
} else
|
|
308
|
-
e.setFocusedKey(
|
|
293
|
+
e.setFocusedKey(K), F.current = !1;
|
|
309
294
|
});
|
|
310
295
|
ae(() => {
|
|
311
296
|
F.current && L();
|
|
@@ -313,24 +298,24 @@ function lt(n) {
|
|
|
313
298
|
e.collection,
|
|
314
299
|
L
|
|
315
300
|
]);
|
|
316
|
-
let
|
|
301
|
+
let M = ce(() => {
|
|
317
302
|
e.collection.size > 0 && (F.current = !1);
|
|
318
303
|
});
|
|
319
304
|
ae(() => {
|
|
320
|
-
|
|
305
|
+
M();
|
|
321
306
|
}, [
|
|
322
307
|
e.focusedKey,
|
|
323
|
-
|
|
324
|
-
]),
|
|
308
|
+
M
|
|
309
|
+
]), q(l, Le, w ? (o) => {
|
|
325
310
|
o.stopPropagation(), e.setFocused(!1), e.setFocusedKey(null);
|
|
326
311
|
} : void 0);
|
|
327
312
|
const D = A(i);
|
|
328
|
-
|
|
313
|
+
Y(() => {
|
|
329
314
|
if (D.current) {
|
|
330
315
|
var o, y;
|
|
331
316
|
let I = null;
|
|
332
|
-
var
|
|
333
|
-
i === "first" && (I = (
|
|
317
|
+
var K;
|
|
318
|
+
i === "first" && (I = (K = (o = t.getFirstKey) === null || o === void 0 ? void 0 : o.call(t)) !== null && K !== void 0 ? K : null);
|
|
334
319
|
var S;
|
|
335
320
|
i === "last" && (I = (S = (y = t.getLastKey) === null || y === void 0 ? void 0 : y.call(t)) !== null && S !== void 0 ? S : null);
|
|
336
321
|
let r = e.selectedKeys;
|
|
@@ -340,11 +325,11 @@ function lt(n) {
|
|
|
340
325
|
break;
|
|
341
326
|
}
|
|
342
327
|
}
|
|
343
|
-
e.setFocused(!0), e.setFocusedKey(I), I == null && !w && l.current &&
|
|
328
|
+
e.setFocused(!0), e.setFocusedKey(I), I == null && !w && l.current && ne(l.current);
|
|
344
329
|
}
|
|
345
330
|
}, []);
|
|
346
331
|
let W = A(e.focusedKey);
|
|
347
|
-
|
|
332
|
+
Y(() => {
|
|
348
333
|
if (e.isFocused && e.focusedKey != null && (e.focusedKey !== W.current || D.current) && a.current && l.current) {
|
|
349
334
|
let o = de(), y = l.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);
|
|
350
335
|
if (!y)
|
|
@@ -353,8 +338,8 @@ function lt(n) {
|
|
|
353
338
|
containingElement: l.current
|
|
354
339
|
}));
|
|
355
340
|
}
|
|
356
|
-
!w && e.isFocused && e.focusedKey == null && W.current != null && l.current &&
|
|
357
|
-
}),
|
|
341
|
+
!w && e.isFocused && e.focusedKey == null && W.current != null && l.current && ne(l.current), W.current = e.focusedKey, D.current = !1;
|
|
342
|
+
}), q(l, "react-aria-focus-scope-restore", (o) => {
|
|
358
343
|
o.preventDefault(), e.setFocused(!0);
|
|
359
344
|
});
|
|
360
345
|
let R = {
|
|
@@ -364,24 +349,24 @@ function lt(n) {
|
|
|
364
349
|
onMouseDown(o) {
|
|
365
350
|
a.current === o.target && o.preventDefault();
|
|
366
351
|
}
|
|
367
|
-
}, { typeSelectProps:
|
|
352
|
+
}, { typeSelectProps: E } = We({
|
|
368
353
|
keyboardDelegate: t,
|
|
369
354
|
selectionManager: e
|
|
370
355
|
});
|
|
371
|
-
|
|
372
|
-
let
|
|
373
|
-
return w ?
|
|
356
|
+
m || (R = se(E, R));
|
|
357
|
+
let G;
|
|
358
|
+
return w ? G = -1 : G = e.focusedKey == null ? 0 : -1, {
|
|
374
359
|
collectionProps: {
|
|
375
360
|
...R,
|
|
376
|
-
tabIndex:
|
|
361
|
+
tabIndex: G
|
|
377
362
|
}
|
|
378
363
|
};
|
|
379
364
|
}
|
|
380
|
-
function
|
|
381
|
-
let { id: e, selectionManager: t, key: l, ref: i, shouldSelectOnPressUp: u, shouldUseVirtualFocus: s, focus: f, isDisabled: d, onAction:
|
|
365
|
+
function it(n) {
|
|
366
|
+
let { id: e, selectionManager: t, key: l, ref: i, shouldSelectOnPressUp: u, shouldUseVirtualFocus: s, focus: f, isDisabled: d, onAction: m, allowsDifferentPressOrigin: w, linkBehavior: v = "action" } = n, $ = Se();
|
|
382
367
|
e = Te(e);
|
|
383
368
|
let a = (r) => {
|
|
384
|
-
if (r.pointerType === "keyboard" &&
|
|
369
|
+
if (r.pointerType === "keyboard" && ie(r)) t.toggleSelection(l);
|
|
385
370
|
else {
|
|
386
371
|
if (t.selectionMode === "none") return;
|
|
387
372
|
if (t.isLink(l)) {
|
|
@@ -394,10 +379,10 @@ function nt(n) {
|
|
|
394
379
|
t.selectionMode === "single" ? t.isSelected(l) && !t.disallowEmptySelection ? t.toggleSelection(l) : t.replaceSelection(l) : r && r.shiftKey ? t.extendSelection(l) : t.selectionBehavior === "toggle" || r && (H(r) || r.pointerType === "touch" || r.pointerType === "virtual") ? t.toggleSelection(l) : t.replaceSelection(l);
|
|
395
380
|
}
|
|
396
381
|
};
|
|
397
|
-
|
|
382
|
+
Y(() => {
|
|
398
383
|
if (l === t.focusedKey && t.isFocused)
|
|
399
384
|
if (!s)
|
|
400
|
-
f ? f() : document.activeElement !== i.current && i.current &&
|
|
385
|
+
f ? f() : document.activeElement !== i.current && i.current && ne(i.current);
|
|
401
386
|
else {
|
|
402
387
|
var P;
|
|
403
388
|
let B = new CustomEvent(Pe, {
|
|
@@ -423,32 +408,32 @@ function nt(n) {
|
|
|
423
408
|
} : d && (T.onMouseDown = (r) => {
|
|
424
409
|
r.preventDefault();
|
|
425
410
|
});
|
|
426
|
-
let k = t.isLink(l) && v === "override", b = t.isLink(l) && v !== "selection" && v !== "none", h = !d && t.canSelectItem(l) && !k, g = (
|
|
427
|
-
if (
|
|
411
|
+
let k = t.isLink(l) && v === "override", b = t.isLink(l) && v !== "selection" && v !== "none", h = !d && t.canSelectItem(l) && !k, g = (m || b) && !d, p = g && (t.selectionBehavior === "replace" ? !h : !h || t.isEmpty), x = g && h && t.selectionBehavior === "replace", F = p || x, L = A(null), M = F && h, D = A(!1), W = A(!1), R = (r) => {
|
|
412
|
+
if (m && m(), b && i.current) {
|
|
428
413
|
let P = t.getItemProps(l);
|
|
429
414
|
$.open(i.current, r, P.href, P.routerOptions);
|
|
430
415
|
}
|
|
431
|
-
},
|
|
432
|
-
u ? (
|
|
433
|
-
L.current = r.pointerType, D.current =
|
|
434
|
-
}, w ? (
|
|
416
|
+
}, E = {};
|
|
417
|
+
u ? (E.onPressStart = (r) => {
|
|
418
|
+
L.current = r.pointerType, D.current = M, r.pointerType === "keyboard" && (!F || be()) && a(r);
|
|
419
|
+
}, w ? (E.onPressUp = p ? void 0 : (r) => {
|
|
435
420
|
r.pointerType === "mouse" && h && a(r);
|
|
436
|
-
},
|
|
421
|
+
}, E.onPress = p ? R : (r) => {
|
|
437
422
|
r.pointerType !== "keyboard" && r.pointerType !== "mouse" && h && a(r);
|
|
438
|
-
}) :
|
|
423
|
+
}) : E.onPress = (r) => {
|
|
439
424
|
if (p || x && r.pointerType !== "mouse") {
|
|
440
425
|
if (r.pointerType === "keyboard" && !pe()) return;
|
|
441
426
|
R(r);
|
|
442
427
|
} else r.pointerType !== "keyboard" && h && a(r);
|
|
443
|
-
}) : (
|
|
444
|
-
L.current = r.pointerType, D.current =
|
|
445
|
-
},
|
|
428
|
+
}) : (E.onPressStart = (r) => {
|
|
429
|
+
L.current = r.pointerType, D.current = M, W.current = p, h && (r.pointerType === "mouse" && !p || r.pointerType === "keyboard" && (!g || be())) && a(r);
|
|
430
|
+
}, E.onPress = (r) => {
|
|
446
431
|
(r.pointerType === "touch" || r.pointerType === "pen" || r.pointerType === "virtual" || r.pointerType === "keyboard" && F && pe() || r.pointerType === "mouse" && W.current) && (F ? R(r) : h && a(r));
|
|
447
|
-
}), T["data-key"] = l,
|
|
448
|
-
let { pressProps:
|
|
432
|
+
}), T["data-key"] = l, E.preventFocusOnPress = s;
|
|
433
|
+
let { pressProps: G, isPressed: o } = me(E), y = x ? (r) => {
|
|
449
434
|
L.current === "mouse" && (r.stopPropagation(), r.preventDefault(), R(r));
|
|
450
|
-
} : void 0, { longPressProps:
|
|
451
|
-
isDisabled: !
|
|
435
|
+
} : void 0, { longPressProps: K } = ze({
|
|
436
|
+
isDisabled: !M,
|
|
452
437
|
onLongPress(r) {
|
|
453
438
|
r.pointerType === "touch" && (a(r), t.setSelectionBehavior("toggle"));
|
|
454
439
|
}
|
|
@@ -458,7 +443,7 @@ function nt(n) {
|
|
|
458
443
|
ke.isOpening || r.preventDefault();
|
|
459
444
|
} : void 0;
|
|
460
445
|
return {
|
|
461
|
-
itemProps:
|
|
446
|
+
itemProps: se(T, h || p ? G : {}, M ? K : {}, {
|
|
462
447
|
onDoubleClick: y,
|
|
463
448
|
onDragStartCapture: S,
|
|
464
449
|
onClick: I,
|
|
@@ -480,7 +465,7 @@ function be() {
|
|
|
480
465
|
let n = window.event;
|
|
481
466
|
return (n == null ? void 0 : n.key) === " " || (n == null ? void 0 : n.code) === "Space";
|
|
482
467
|
}
|
|
483
|
-
class
|
|
468
|
+
class Ge {
|
|
484
469
|
build(e, t) {
|
|
485
470
|
return this.context = t, $e(() => this.iterateCollection(e));
|
|
486
471
|
}
|
|
@@ -571,22 +556,22 @@ class je {
|
|
|
571
556
|
var d;
|
|
572
557
|
let F = (d = x.key) !== null && d !== void 0 ? d : null;
|
|
573
558
|
F == null && (F = x.element ? null : this.getKey(s, e, t, l));
|
|
574
|
-
let
|
|
559
|
+
let M = [
|
|
575
560
|
...this.getFullNode({
|
|
576
561
|
...x,
|
|
577
562
|
key: F,
|
|
578
563
|
index: g,
|
|
579
|
-
wrapper:
|
|
564
|
+
wrapper: je(e.wrapper, x.wrapper)
|
|
580
565
|
}, this.getChildState(t, x), l ? `${l}${s.key}` : s.key, i)
|
|
581
566
|
];
|
|
582
|
-
for (let D of
|
|
583
|
-
var
|
|
584
|
-
D.value = (w = (
|
|
567
|
+
for (let D of M) {
|
|
568
|
+
var m, w;
|
|
569
|
+
D.value = (w = (m = x.value) !== null && m !== void 0 ? m : e.value) !== null && w !== void 0 ? w : null, D.value && this.cache.set(D.value, D);
|
|
585
570
|
var v;
|
|
586
571
|
if (e.type && D.type !== e.type) throw new Error(`Unsupported type <${te(D.type)}> in <${te((v = i == null ? void 0 : i.type) !== null && v !== void 0 ? v : "unknown parent type")}>. Only <${te(e.type)}> is supported.`);
|
|
587
572
|
g++, yield D;
|
|
588
573
|
}
|
|
589
|
-
p = h.next(
|
|
574
|
+
p = h.next(M);
|
|
590
575
|
}
|
|
591
576
|
return;
|
|
592
577
|
}
|
|
@@ -638,7 +623,7 @@ function $e(n) {
|
|
|
638
623
|
}
|
|
639
624
|
};
|
|
640
625
|
}
|
|
641
|
-
function
|
|
626
|
+
function je(n, e) {
|
|
642
627
|
if (n && e) return (t) => n(e(t));
|
|
643
628
|
if (n) return n;
|
|
644
629
|
if (e) return e;
|
|
@@ -646,9 +631,9 @@ function qe(n, e) {
|
|
|
646
631
|
function te(n) {
|
|
647
632
|
return n[0].toUpperCase() + n.slice(1);
|
|
648
633
|
}
|
|
649
|
-
function
|
|
650
|
-
let l =
|
|
651
|
-
return
|
|
634
|
+
function st(n, e, t) {
|
|
635
|
+
let l = j(() => new Ge(), []), { children: i, items: u, collection: s } = n;
|
|
636
|
+
return j(() => {
|
|
652
637
|
if (s) return s;
|
|
653
638
|
let d = l.build({
|
|
654
639
|
children: i,
|
|
@@ -664,7 +649,7 @@ function it(n, e, t) {
|
|
|
664
649
|
e
|
|
665
650
|
]);
|
|
666
651
|
}
|
|
667
|
-
function
|
|
652
|
+
function qe(n, e) {
|
|
668
653
|
return typeof e.getChildren == "function" ? e.getChildren(n.key) : n.childNodes;
|
|
669
654
|
}
|
|
670
655
|
function Ye(n) {
|
|
@@ -678,7 +663,7 @@ function Xe(n, e) {
|
|
|
678
663
|
t++;
|
|
679
664
|
}
|
|
680
665
|
}
|
|
681
|
-
function
|
|
666
|
+
function rt(n) {
|
|
682
667
|
let e;
|
|
683
668
|
for (let t of n) e = t;
|
|
684
669
|
return e;
|
|
@@ -711,17 +696,17 @@ function Ve(n, e) {
|
|
|
711
696
|
if (!e.has(t)) return !1;
|
|
712
697
|
return !0;
|
|
713
698
|
}
|
|
714
|
-
function
|
|
715
|
-
let { selectionMode: e = "none", disallowEmptySelection: t = !1, allowDuplicateSelectionEvents: l, selectionBehavior: i = "toggle", disabledBehavior: u = "all" } = n, s = A(!1), [, f] = ee(!1), d = A(null),
|
|
699
|
+
function ot(n) {
|
|
700
|
+
let { selectionMode: e = "none", disallowEmptySelection: t = !1, allowDuplicateSelectionEvents: l, selectionBehavior: i = "toggle", disabledBehavior: u = "all" } = n, s = A(!1), [, f] = ee(!1), d = A(null), m = A(null), [, w] = ee(null), v = j(() => Ke(n.selectedKeys), [
|
|
716
701
|
n.selectedKeys
|
|
717
|
-
]), $ =
|
|
702
|
+
]), $ = j(() => Ke(n.defaultSelectedKeys, new C()), [
|
|
718
703
|
n.defaultSelectedKeys
|
|
719
|
-
]), [a, T] =
|
|
704
|
+
]), [a, T] = Me(v, $, n.onSelectionChange), k = j(() => n.disabledKeys ? new Set(n.disabledKeys) : /* @__PURE__ */ new Set(), [
|
|
720
705
|
n.disabledKeys
|
|
721
706
|
]), [b, h] = ee(i);
|
|
722
707
|
i === "replace" && b === "toggle" && typeof a == "object" && a.size === 0 && h("replace");
|
|
723
708
|
let g = A(i);
|
|
724
|
-
return
|
|
709
|
+
return Y(() => {
|
|
725
710
|
i !== g.current && (h(i), g.current = i);
|
|
726
711
|
}, [
|
|
727
712
|
i
|
|
@@ -740,10 +725,10 @@ function rt(n) {
|
|
|
740
725
|
return d.current;
|
|
741
726
|
},
|
|
742
727
|
get childFocusStrategy() {
|
|
743
|
-
return
|
|
728
|
+
return m.current;
|
|
744
729
|
},
|
|
745
730
|
setFocusedKey(p, x = "first") {
|
|
746
|
-
d.current = p,
|
|
731
|
+
d.current = p, m.current = x, w(p);
|
|
747
732
|
},
|
|
748
733
|
selectedKeys: a,
|
|
749
734
|
setSelectedKeys(p) {
|
|
@@ -753,10 +738,10 @@ function rt(n) {
|
|
|
753
738
|
disabledBehavior: u
|
|
754
739
|
};
|
|
755
740
|
}
|
|
756
|
-
function
|
|
741
|
+
function Ke(n, e) {
|
|
757
742
|
return n ? n === "all" ? "all" : new C(n) : e;
|
|
758
743
|
}
|
|
759
|
-
class
|
|
744
|
+
class ut {
|
|
760
745
|
/**
|
|
761
746
|
* The type of selection that is allowed in the collection.
|
|
762
747
|
*/
|
|
@@ -964,7 +949,7 @@ class ot {
|
|
|
964
949
|
let s = this.collection.getItem(l);
|
|
965
950
|
(s == null ? void 0 : s.type) === "item" && e.push(l);
|
|
966
951
|
var u;
|
|
967
|
-
s != null && s.hasChildNodes && (this.allowsCellSelection || s.type !== "item") && t((u = (i = Ye(
|
|
952
|
+
s != null && s.hasChildNodes && (this.allowsCellSelection || s.type !== "item") && t((u = (i = Ye(qe(s, this.collection))) === null || i === void 0 ? void 0 : i.key) !== null && u !== void 0 ? u : null);
|
|
968
953
|
}
|
|
969
954
|
l = this.collection.getKeyAfter(l);
|
|
970
955
|
}
|
|
@@ -1030,18 +1015,17 @@ class ot {
|
|
|
1030
1015
|
}
|
|
1031
1016
|
}
|
|
1032
1017
|
export {
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1018
|
+
ot as $,
|
|
1019
|
+
st as a,
|
|
1020
|
+
ut as b,
|
|
1021
|
+
Ee as c,
|
|
1022
|
+
it as d,
|
|
1023
|
+
nt as e,
|
|
1024
|
+
qe as f,
|
|
1040
1025
|
We as g,
|
|
1041
|
-
|
|
1026
|
+
rt as h,
|
|
1042
1027
|
ye as i,
|
|
1043
1028
|
Xe as j,
|
|
1044
1029
|
Ye as k,
|
|
1045
|
-
ze as l
|
|
1046
|
-
Y as m
|
|
1030
|
+
ze as l
|
|
1047
1031
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as i, f as p } from "./SelectionManager-
|
|
2
|
-
import { $ as u, a as g } from "./ListKeyboardDelegate-
|
|
1
|
+
import { e as i, f as p } from "./SelectionManager-BfXUE1qg.js";
|
|
2
|
+
import { $ as u, a as g } from "./ListKeyboardDelegate-gCXy-Xnn.js";
|
|
3
3
|
import { useMemo as x, createContext as l } from "react";
|
|
4
4
|
function h(e) {
|
|
5
5
|
let { selectionManager: t, collection: a, disabledKeys: o, ref: c, keyboardDelegate: r, layoutDelegate: d } = e, s = u({
|