@protonradio/proton-ui 0.11.18-beta.7 → 0.11.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Modal/Modal.cjs.js +1 -1
- package/dist/components/Modal/Modal.cjs.js.map +1 -1
- package/dist/components/Modal/Modal.es.js +59 -79
- package/dist/components/Modal/Modal.es.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js.map +1 -1
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js +50 -399
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js +0 -2
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js +0 -55
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js.map +0 -1
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js +0 -2
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js +0 -51
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js +0 -70
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js +0 -32
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js +0 -53
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js +0 -2
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js.map +0 -1
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js +0 -100
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js.map +0 -1
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js +0 -2
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js.map +0 -1
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js +0 -30
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js.map +0 -1
|
@@ -1,437 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let { children: t, contain: r, restoreFocus: i, autoFocus: n } = e, l = x(null), u = x(null), o = x([]), { parentNode: b } = Q(D) || {}, a = _(() => new A({
|
|
9
|
-
scopeRef: o
|
|
10
|
-
}), [
|
|
11
|
-
o
|
|
12
|
-
]);
|
|
13
|
-
m(() => {
|
|
14
|
-
let c = b || N.root;
|
|
15
|
-
if (N.getTreeNode(c.scopeRef) && s && !R(s, c.scopeRef)) {
|
|
16
|
-
let f = N.getTreeNode(s);
|
|
17
|
-
f && (c = f);
|
|
18
|
-
}
|
|
19
|
-
c.addChild(a), N.addNode(a);
|
|
20
|
-
}, [
|
|
21
|
-
a,
|
|
22
|
-
b
|
|
23
|
-
]), m(() => {
|
|
24
|
-
let c = N.getTreeNode(o);
|
|
25
|
-
c && (c.contain = !!r);
|
|
26
|
-
}, [
|
|
27
|
-
r
|
|
28
|
-
]), m(() => {
|
|
29
|
-
var c;
|
|
30
|
-
let f = (c = l.current) === null || c === void 0 ? void 0 : c.nextSibling, p = [], S = (k) => k.stopPropagation();
|
|
31
|
-
for (; f && f !== u.current; )
|
|
32
|
-
p.push(f), f.addEventListener(M, S), f = f.nextSibling;
|
|
33
|
-
return o.current = p, () => {
|
|
34
|
-
for (let k of p) k.removeEventListener(M, S);
|
|
35
|
-
};
|
|
36
|
-
}, [
|
|
37
|
-
t
|
|
38
|
-
]), te(o, i, r), Z(o, r), re(o, i, r), ee(o, n), z(() => {
|
|
39
|
-
const c = T(E(o.current ? o.current[0] : void 0));
|
|
40
|
-
let f = null;
|
|
41
|
-
if ($(c, o.current)) {
|
|
42
|
-
for (let p of N.traverse()) p.scopeRef && $(c, p.scopeRef.current) && (f = p);
|
|
43
|
-
f === N.getTreeNode(o) && (s = f.scopeRef);
|
|
44
|
-
}
|
|
45
|
-
}, [
|
|
46
|
-
o
|
|
47
|
-
]), m(() => () => {
|
|
48
|
-
var c, f, p;
|
|
49
|
-
let S = (p = (f = N.getTreeNode(o)) === null || f === void 0 || (c = f.parent) === null || c === void 0 ? void 0 : c.scopeRef) !== null && p !== void 0 ? p : null;
|
|
50
|
-
(o === s || R(o, s)) && (!S || N.getTreeNode(S)) && (s = S), N.removeTreeNode(o);
|
|
51
|
-
}, [
|
|
52
|
-
o
|
|
53
|
-
]);
|
|
54
|
-
let v = _(() => X(o), []), d = _(() => ({
|
|
55
|
-
focusManager: v,
|
|
56
|
-
parentNode: a
|
|
57
|
-
}), [
|
|
58
|
-
a,
|
|
59
|
-
v
|
|
60
|
-
]);
|
|
61
|
-
return /* @__PURE__ */ C.createElement(D.Provider, {
|
|
62
|
-
value: d
|
|
63
|
-
}, /* @__PURE__ */ C.createElement("span", {
|
|
64
|
-
"data-focus-scope-start": !0,
|
|
65
|
-
hidden: !0,
|
|
66
|
-
ref: l
|
|
67
|
-
}), t, /* @__PURE__ */ C.createElement("span", {
|
|
68
|
-
"data-focus-scope-end": !0,
|
|
69
|
-
hidden: !0,
|
|
70
|
-
ref: u
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
function X(e) {
|
|
74
|
-
return {
|
|
75
|
-
focusNext(t = {}) {
|
|
76
|
-
let r = e.current, { from: i, tabbable: n, wrap: l, accept: u } = t;
|
|
77
|
-
var o;
|
|
78
|
-
let b = i || T(E((o = r[0]) !== null && o !== void 0 ? o : void 0)), a = r[0].previousElementSibling, v = y(r), d = w(v, {
|
|
79
|
-
tabbable: n,
|
|
80
|
-
accept: u
|
|
81
|
-
}, r);
|
|
82
|
-
d.currentNode = $(b, r) ? b : a;
|
|
83
|
-
let c = d.nextNode();
|
|
84
|
-
return !c && l && (d.currentNode = a, c = d.nextNode()), c && h(c, !0), c;
|
|
85
|
-
},
|
|
86
|
-
focusPrevious(t = {}) {
|
|
87
|
-
let r = e.current, { from: i, tabbable: n, wrap: l, accept: u } = t;
|
|
88
|
-
var o;
|
|
89
|
-
let b = i || T(E((o = r[0]) !== null && o !== void 0 ? o : void 0)), a = r[r.length - 1].nextElementSibling, v = y(r), d = w(v, {
|
|
90
|
-
tabbable: n,
|
|
91
|
-
accept: u
|
|
92
|
-
}, r);
|
|
93
|
-
d.currentNode = $(b, r) ? b : a;
|
|
94
|
-
let c = d.previousNode();
|
|
95
|
-
return !c && l && (d.currentNode = a, c = d.previousNode()), c && h(c, !0), c;
|
|
96
|
-
},
|
|
97
|
-
focusFirst(t = {}) {
|
|
98
|
-
let r = e.current, { tabbable: i, accept: n } = t, l = y(r), u = w(l, {
|
|
99
|
-
tabbable: i,
|
|
100
|
-
accept: n
|
|
101
|
-
}, r);
|
|
102
|
-
u.currentNode = r[0].previousElementSibling;
|
|
103
|
-
let o = u.nextNode();
|
|
104
|
-
return o && h(o, !0), o;
|
|
105
|
-
},
|
|
106
|
-
focusLast(t = {}) {
|
|
107
|
-
let r = e.current, { tabbable: i, accept: n } = t, l = y(r), u = w(l, {
|
|
108
|
-
tabbable: i,
|
|
109
|
-
accept: n
|
|
110
|
-
}, r);
|
|
111
|
-
u.currentNode = r[r.length - 1].nextElementSibling;
|
|
112
|
-
let o = u.previousNode();
|
|
113
|
-
return o && h(o, !0), o;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function y(e) {
|
|
118
|
-
return e[0].parentElement;
|
|
119
|
-
}
|
|
120
|
-
function L(e) {
|
|
121
|
-
let t = N.getTreeNode(s);
|
|
122
|
-
for (; t && t.scopeRef !== e; ) {
|
|
123
|
-
if (t.contain) return !1;
|
|
124
|
-
t = t.parent;
|
|
125
|
-
}
|
|
126
|
-
return !0;
|
|
127
|
-
}
|
|
128
|
-
function Y(e) {
|
|
129
|
-
if (e.checked) return !0;
|
|
130
|
-
let t = [];
|
|
131
|
-
if (!e.form) t = [
|
|
132
|
-
...E(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)
|
|
133
|
-
].filter((l) => !l.form);
|
|
1
|
+
import { getOwnerDocument as c, createShadowTreeWalker as h, isTabbable as v, isFocusable as T } from "@react-aria/utils";
|
|
2
|
+
function N(a) {
|
|
3
|
+
if (a.checked) return !0;
|
|
4
|
+
let e = [];
|
|
5
|
+
if (!a.form) e = [
|
|
6
|
+
...c(a).querySelectorAll(`input[type="radio"][name="${CSS.escape(a.name)}"]`)
|
|
7
|
+
].filter((t) => !t.form);
|
|
134
8
|
else {
|
|
135
9
|
var r, i;
|
|
136
|
-
let
|
|
137
|
-
|
|
138
|
-
...
|
|
10
|
+
let t = (i = a.form) === null || i === void 0 || (r = i.elements) === null || r === void 0 ? void 0 : r.namedItem(a.name);
|
|
11
|
+
e = [
|
|
12
|
+
...t ?? []
|
|
139
13
|
];
|
|
140
14
|
}
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
function Z(e, t) {
|
|
144
|
-
let r = x(void 0), i = x(void 0);
|
|
145
|
-
m(() => {
|
|
146
|
-
let n = e.current;
|
|
147
|
-
if (!t) {
|
|
148
|
-
i.current && (cancelAnimationFrame(i.current), i.current = void 0);
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const l = E(n ? n[0] : void 0);
|
|
152
|
-
let u = (a) => {
|
|
153
|
-
if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey || !L(e) || a.isComposing) return;
|
|
154
|
-
let v = T(l), d = e.current;
|
|
155
|
-
if (!d || !$(v, d)) return;
|
|
156
|
-
let c = y(d), f = w(c, {
|
|
157
|
-
tabbable: !0
|
|
158
|
-
}, d);
|
|
159
|
-
if (!v) return;
|
|
160
|
-
f.currentNode = v;
|
|
161
|
-
let p = a.shiftKey ? f.previousNode() : f.nextNode();
|
|
162
|
-
p || (f.currentNode = a.shiftKey ? d[d.length - 1].nextElementSibling : d[0].previousElementSibling, p = a.shiftKey ? f.previousNode() : f.nextNode()), a.preventDefault(), p && h(p, !0);
|
|
163
|
-
}, o = (a) => {
|
|
164
|
-
(!s || R(s, e)) && $(F(a), e.current) ? (s = e, r.current = F(a)) : L(e) && !g(F(a), e) ? r.current ? r.current.focus() : s && s.current && I(s.current) : L(e) && (r.current = F(a));
|
|
165
|
-
}, b = (a) => {
|
|
166
|
-
i.current && cancelAnimationFrame(i.current), i.current = requestAnimationFrame(() => {
|
|
167
|
-
let v = j(), d = (v === "virtual" || v === null) && W() && B(), c = T(l);
|
|
168
|
-
if (!d && c && L(e) && !g(c, e)) {
|
|
169
|
-
s = e;
|
|
170
|
-
let p = F(a);
|
|
171
|
-
if (p && p.isConnected) {
|
|
172
|
-
var f;
|
|
173
|
-
r.current = p, (f = r.current) === null || f === void 0 || f.focus();
|
|
174
|
-
} else s.current && I(s.current);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
};
|
|
178
|
-
return l.addEventListener("keydown", u, !1), l.addEventListener("focusin", o, !1), n == null || n.forEach((a) => a.addEventListener("focusin", o, !1)), n == null || n.forEach((a) => a.addEventListener("focusout", b, !1)), () => {
|
|
179
|
-
l.removeEventListener("keydown", u, !1), l.removeEventListener("focusin", o, !1), n == null || n.forEach((a) => a.removeEventListener("focusin", o, !1)), n == null || n.forEach((a) => a.removeEventListener("focusout", b, !1));
|
|
180
|
-
};
|
|
181
|
-
}, [
|
|
182
|
-
e,
|
|
183
|
-
t
|
|
184
|
-
]), m(() => () => {
|
|
185
|
-
i.current && cancelAnimationFrame(i.current);
|
|
186
|
-
}, [
|
|
187
|
-
i
|
|
188
|
-
]);
|
|
189
|
-
}
|
|
190
|
-
function q(e) {
|
|
191
|
-
return g(e);
|
|
192
|
-
}
|
|
193
|
-
function $(e, t) {
|
|
194
|
-
return !e || !t ? !1 : t.some((r) => r.contains(e));
|
|
195
|
-
}
|
|
196
|
-
function g(e, t = null) {
|
|
197
|
-
if (e instanceof Element && e.closest("[data-react-aria-top-layer]")) return !0;
|
|
198
|
-
for (let { scopeRef: r } of N.traverse(N.getTreeNode(t)))
|
|
199
|
-
if (r && $(e, r.current)) return !0;
|
|
200
|
-
return !1;
|
|
201
|
-
}
|
|
202
|
-
function ue(e) {
|
|
203
|
-
return g(e, s);
|
|
204
|
-
}
|
|
205
|
-
function R(e, t) {
|
|
206
|
-
var r;
|
|
207
|
-
let i = (r = N.getTreeNode(t)) === null || r === void 0 ? void 0 : r.parent;
|
|
208
|
-
for (; i; ) {
|
|
209
|
-
if (i.scopeRef === e) return !0;
|
|
210
|
-
i = i.parent;
|
|
211
|
-
}
|
|
212
|
-
return !1;
|
|
213
|
-
}
|
|
214
|
-
function h(e, t = !1) {
|
|
215
|
-
if (e != null && !t) try {
|
|
216
|
-
G(e);
|
|
217
|
-
} catch {
|
|
218
|
-
}
|
|
219
|
-
else if (e != null) try {
|
|
220
|
-
e.focus();
|
|
221
|
-
} catch {
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
function J(e, t = !0) {
|
|
225
|
-
let r = e[0].previousElementSibling, i = y(e), n = w(i, {
|
|
226
|
-
tabbable: t
|
|
227
|
-
}, e);
|
|
228
|
-
n.currentNode = r;
|
|
229
|
-
let l = n.nextNode();
|
|
230
|
-
return t && !l && (i = y(e), n = w(i, {
|
|
231
|
-
tabbable: !1
|
|
232
|
-
}, e), n.currentNode = r, l = n.nextNode()), l;
|
|
233
|
-
}
|
|
234
|
-
function I(e, t = !0) {
|
|
235
|
-
h(J(e, t));
|
|
236
|
-
}
|
|
237
|
-
function ee(e, t) {
|
|
238
|
-
const r = C.useRef(t);
|
|
239
|
-
z(() => {
|
|
240
|
-
if (r.current) {
|
|
241
|
-
s = e;
|
|
242
|
-
const i = E(e.current ? e.current[0] : void 0);
|
|
243
|
-
!$(T(i), s.current) && e.current && I(e.current);
|
|
244
|
-
}
|
|
245
|
-
r.current = !1;
|
|
246
|
-
}, [
|
|
247
|
-
e
|
|
248
|
-
]);
|
|
249
|
-
}
|
|
250
|
-
function te(e, t, r) {
|
|
251
|
-
m(() => {
|
|
252
|
-
if (t || r) return;
|
|
253
|
-
let i = e.current;
|
|
254
|
-
const n = E(i ? i[0] : void 0);
|
|
255
|
-
let l = (u) => {
|
|
256
|
-
let o = F(u);
|
|
257
|
-
$(o, e.current) ? s = e : q(o) || (s = null);
|
|
258
|
-
};
|
|
259
|
-
return n.addEventListener("focusin", l, !1), i == null || i.forEach((u) => u.addEventListener("focusin", l, !1)), () => {
|
|
260
|
-
n.removeEventListener("focusin", l, !1), i == null || i.forEach((u) => u.removeEventListener("focusin", l, !1));
|
|
261
|
-
};
|
|
262
|
-
}, [
|
|
263
|
-
e,
|
|
264
|
-
t,
|
|
265
|
-
r
|
|
266
|
-
]);
|
|
267
|
-
}
|
|
268
|
-
function P(e) {
|
|
269
|
-
let t = N.getTreeNode(s);
|
|
270
|
-
for (; t && t.scopeRef !== e; ) {
|
|
271
|
-
if (t.nodeToRestore) return !1;
|
|
272
|
-
t = t.parent;
|
|
273
|
-
}
|
|
274
|
-
return (t == null ? void 0 : t.scopeRef) === e;
|
|
275
|
-
}
|
|
276
|
-
function re(e, t, r) {
|
|
277
|
-
const i = x(typeof document < "u" ? T(E(e.current ? e.current[0] : void 0)) : null);
|
|
278
|
-
m(() => {
|
|
279
|
-
let n = e.current;
|
|
280
|
-
const l = E(n ? n[0] : void 0);
|
|
281
|
-
if (!t || r) return;
|
|
282
|
-
let u = () => {
|
|
283
|
-
(!s || R(s, e)) && $(T(l), e.current) && (s = e);
|
|
284
|
-
};
|
|
285
|
-
return l.addEventListener("focusin", u, !1), n == null || n.forEach((o) => o.addEventListener("focusin", u, !1)), () => {
|
|
286
|
-
l.removeEventListener("focusin", u, !1), n == null || n.forEach((o) => o.removeEventListener("focusin", u, !1));
|
|
287
|
-
};
|
|
288
|
-
}, [
|
|
289
|
-
e,
|
|
290
|
-
r
|
|
291
|
-
]), m(() => {
|
|
292
|
-
const n = E(e.current ? e.current[0] : void 0);
|
|
293
|
-
if (!t) return;
|
|
294
|
-
let l = (u) => {
|
|
295
|
-
if (u.key !== "Tab" || u.altKey || u.ctrlKey || u.metaKey || !L(e) || u.isComposing) return;
|
|
296
|
-
let o = n.activeElement;
|
|
297
|
-
if (!g(o, e) || !P(e)) return;
|
|
298
|
-
let b = N.getTreeNode(e);
|
|
299
|
-
if (!b) return;
|
|
300
|
-
let a = b.nodeToRestore, v = w(n.body, {
|
|
301
|
-
tabbable: !0
|
|
302
|
-
});
|
|
303
|
-
v.currentNode = o;
|
|
304
|
-
let d = u.shiftKey ? v.previousNode() : v.nextNode();
|
|
305
|
-
if ((!a || !a.isConnected || a === n.body) && (a = void 0, b.nodeToRestore = void 0), (!d || !g(d, e)) && a) {
|
|
306
|
-
v.currentNode = a;
|
|
307
|
-
do
|
|
308
|
-
d = u.shiftKey ? v.previousNode() : v.nextNode();
|
|
309
|
-
while (g(d, e));
|
|
310
|
-
u.preventDefault(), u.stopPropagation(), d ? h(d, !0) : q(a) ? h(a, !0) : o.blur();
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
return r || n.addEventListener("keydown", l, !0), () => {
|
|
314
|
-
r || n.removeEventListener("keydown", l, !0);
|
|
315
|
-
};
|
|
316
|
-
}, [
|
|
317
|
-
e,
|
|
318
|
-
t,
|
|
319
|
-
r
|
|
320
|
-
]), m(() => {
|
|
321
|
-
const n = E(e.current ? e.current[0] : void 0);
|
|
322
|
-
if (!t) return;
|
|
323
|
-
let l = N.getTreeNode(e);
|
|
324
|
-
if (l) {
|
|
325
|
-
var u;
|
|
326
|
-
return l.nodeToRestore = (u = i.current) !== null && u !== void 0 ? u : void 0, () => {
|
|
327
|
-
let o = N.getTreeNode(e);
|
|
328
|
-
if (!o) return;
|
|
329
|
-
let b = o.nodeToRestore, a = T(n);
|
|
330
|
-
if (t && b && (a && g(a, e) || a === n.body && P(e))) {
|
|
331
|
-
let v = N.clone();
|
|
332
|
-
requestAnimationFrame(() => {
|
|
333
|
-
if (n.activeElement === n.body) {
|
|
334
|
-
let d = v.getTreeNode(e);
|
|
335
|
-
for (; d; ) {
|
|
336
|
-
if (d.nodeToRestore && d.nodeToRestore.isConnected) {
|
|
337
|
-
O(d.nodeToRestore);
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
d = d.parent;
|
|
341
|
-
}
|
|
342
|
-
for (d = v.getTreeNode(e); d; ) {
|
|
343
|
-
if (d.scopeRef && d.scopeRef.current && N.getTreeNode(d.scopeRef)) {
|
|
344
|
-
let c = J(d.scopeRef.current, !0);
|
|
345
|
-
O(c);
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
d = d.parent;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
}, [
|
|
356
|
-
e,
|
|
357
|
-
t
|
|
358
|
-
]);
|
|
15
|
+
return e ? !e.some((t) => t.checked) : !1;
|
|
359
16
|
}
|
|
360
|
-
function
|
|
361
|
-
e.
|
|
362
|
-
bubbles: !0,
|
|
363
|
-
cancelable: !0
|
|
364
|
-
})) && h(e);
|
|
17
|
+
function u(a, e) {
|
|
18
|
+
return !a || !e ? !1 : e.some((r) => r.contains(a));
|
|
365
19
|
}
|
|
366
|
-
function
|
|
367
|
-
let i =
|
|
20
|
+
function p(a, e, r) {
|
|
21
|
+
let i = e != null && e.tabbable ? v : T, l = (a == null ? void 0 : a.nodeType) === Node.ELEMENT_NODE ? a : null, t = c(l), d = h(t, a || t, NodeFilter.SHOW_ELEMENT, {
|
|
368
22
|
acceptNode(o) {
|
|
369
|
-
var
|
|
370
|
-
return !(
|
|
23
|
+
var n;
|
|
24
|
+
return !(e == null || (n = e.from) === null || n === void 0) && n.contains(o) || e != null && e.tabbable && o.tagName === "INPUT" && o.getAttribute("type") === "radio" && (!N(o) || d.currentNode.tagName === "INPUT" && d.currentNode.type === "radio" && d.currentNode.name === o.name) ? NodeFilter.FILTER_REJECT : i(o) && (!r || u(o, r)) && (!(e != null && e.accept) || e.accept(o)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
371
25
|
}
|
|
372
26
|
});
|
|
373
|
-
return
|
|
27
|
+
return e != null && e.from && (d.currentNode = e.from), d;
|
|
374
28
|
}
|
|
375
|
-
class
|
|
29
|
+
class f {
|
|
376
30
|
get size() {
|
|
377
31
|
return this.fastMap.size;
|
|
378
32
|
}
|
|
379
|
-
getTreeNode(
|
|
380
|
-
return this.fastMap.get(
|
|
33
|
+
getTreeNode(e) {
|
|
34
|
+
return this.fastMap.get(e);
|
|
381
35
|
}
|
|
382
|
-
addTreeNode(
|
|
383
|
-
let
|
|
384
|
-
if (!
|
|
385
|
-
let
|
|
386
|
-
scopeRef:
|
|
36
|
+
addTreeNode(e, r, i) {
|
|
37
|
+
let l = this.fastMap.get(r ?? null);
|
|
38
|
+
if (!l) return;
|
|
39
|
+
let t = new s({
|
|
40
|
+
scopeRef: e
|
|
387
41
|
});
|
|
388
|
-
|
|
42
|
+
l.addChild(t), t.parent = l, this.fastMap.set(e, t), i && (t.nodeToRestore = i);
|
|
389
43
|
}
|
|
390
|
-
addNode(
|
|
391
|
-
this.fastMap.set(
|
|
44
|
+
addNode(e) {
|
|
45
|
+
this.fastMap.set(e.scopeRef, e);
|
|
392
46
|
}
|
|
393
|
-
removeTreeNode(
|
|
394
|
-
if (
|
|
395
|
-
let r = this.fastMap.get(
|
|
47
|
+
removeTreeNode(e) {
|
|
48
|
+
if (e === null) return;
|
|
49
|
+
let r = this.fastMap.get(e);
|
|
396
50
|
if (!r) return;
|
|
397
51
|
let i = r.parent;
|
|
398
|
-
for (let
|
|
399
|
-
let
|
|
400
|
-
i && (i.removeChild(r),
|
|
52
|
+
for (let t of this.traverse()) t !== r && r.nodeToRestore && t.nodeToRestore && r.scopeRef && r.scopeRef.current && u(t.nodeToRestore, r.scopeRef.current) && (t.nodeToRestore = r.nodeToRestore);
|
|
53
|
+
let l = r.children;
|
|
54
|
+
i && (i.removeChild(r), l.size > 0 && l.forEach((t) => i && i.addChild(t))), this.fastMap.delete(r.scopeRef);
|
|
401
55
|
}
|
|
402
56
|
// Pre Order Depth First
|
|
403
|
-
*traverse(
|
|
404
|
-
if (
|
|
57
|
+
*traverse(e = this.root) {
|
|
58
|
+
if (e.scopeRef != null && (yield e), e.children.size > 0) for (let r of e.children) yield* this.traverse(r);
|
|
405
59
|
}
|
|
406
60
|
clone() {
|
|
407
|
-
var
|
|
408
|
-
let r = new
|
|
61
|
+
var e;
|
|
62
|
+
let r = new f();
|
|
409
63
|
var i;
|
|
410
|
-
for (let
|
|
64
|
+
for (let l of this.traverse()) r.addTreeNode(l.scopeRef, (i = (e = l.parent) === null || e === void 0 ? void 0 : e.scopeRef) !== null && i !== void 0 ? i : null, l.nodeToRestore);
|
|
411
65
|
return r;
|
|
412
66
|
}
|
|
413
67
|
constructor() {
|
|
414
|
-
this.fastMap = /* @__PURE__ */ new Map(), this.root = new
|
|
68
|
+
this.fastMap = /* @__PURE__ */ new Map(), this.root = new s({
|
|
415
69
|
scopeRef: null
|
|
416
70
|
}), this.fastMap.set(null, this.root);
|
|
417
71
|
}
|
|
418
72
|
}
|
|
419
|
-
class
|
|
420
|
-
addChild(
|
|
421
|
-
this.children.add(
|
|
73
|
+
class s {
|
|
74
|
+
addChild(e) {
|
|
75
|
+
this.children.add(e), e.parent = this;
|
|
422
76
|
}
|
|
423
|
-
removeChild(
|
|
424
|
-
this.children.delete(
|
|
77
|
+
removeChild(e) {
|
|
78
|
+
this.children.delete(e), e.parent = void 0;
|
|
425
79
|
}
|
|
426
|
-
constructor(
|
|
427
|
-
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef =
|
|
80
|
+
constructor(e) {
|
|
81
|
+
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = e.scopeRef;
|
|
428
82
|
}
|
|
429
83
|
}
|
|
430
|
-
|
|
84
|
+
new f();
|
|
431
85
|
export {
|
|
432
|
-
|
|
433
|
-
N as focusScopeTree,
|
|
434
|
-
w as getFocusableTreeWalker,
|
|
435
|
-
ue as isElementInChildOfActiveScope
|
|
86
|
+
p as getFocusableTreeWalker
|
|
436
87
|
};
|
|
437
88
|
//# sourceMappingURL=FocusScope.es.js.map
|