@kakadu/components 6.15.0 → 6.16.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/build/components/avatar.d.ts +13 -0
- package/build/components/avatar.js +1 -0
- package/build/components/avatar.mjs +47 -0
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +6 -6
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +1 -1
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +1 -1
- package/build/components/theme-setter.d.ts +1 -1
- package/build/components.css +1 -1
- package/build/focus-trap-react-4An60CdH.js +9 -0
- package/build/{focus-trap-react-D4ushEjf.mjs → focus-trap-react-Df_V17Wb.mjs} +259 -261
- package/build/index.d.ts +4 -0
- package/build/index.js +1 -1
- package/build/index.mjs +271 -267
- package/build/utilities/string-to-hex-color.d.ts +3 -0
- package/build/utilities/string-to-hex-color.js +1 -0
- package/build/utilities/string-to-hex-color.mjs +24 -0
- package/package.json +10 -10
- package/build/focus-trap-react-D0ZxGVUk.js +0 -9
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import Ee from "react";
|
|
2
2
|
import { g as be } from "./_commonjsHelpers-MdHo5S7N.mjs";
|
|
3
|
-
var
|
|
3
|
+
var Y = { exports: {} };
|
|
4
4
|
/*!
|
|
5
|
-
* tabbable 6.5.
|
|
5
|
+
* tabbable 6.5.1
|
|
6
6
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
7
7
|
*/
|
|
8
8
|
var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "area[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], J = /* @__PURE__ */ pe.join(","), he = typeof Element > "u", M = he ? function() {
|
|
9
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Q = !he && Element.prototype.getRootNode ? function(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return n == null ? void 0 : n.ownerDocument;
|
|
9
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Q = !he && Element.prototype.getRootNode ? function(i) {
|
|
10
|
+
return i == null || i.getRootNode == null ? void 0 : i.getRootNode();
|
|
11
|
+
} : function(i) {
|
|
12
|
+
return i == null ? void 0 : i.ownerDocument;
|
|
14
13
|
}, ee = function(e, t) {
|
|
15
|
-
var o;
|
|
16
14
|
t === void 0 && (t = !0);
|
|
17
|
-
var
|
|
15
|
+
var o = e == null || e.getAttribute == null ? void 0 : e.getAttribute("inert"), s = o === "" || o === "true", l = s || t && e && // closest does not exist on shadow roots, so we fall back to a manual
|
|
18
16
|
// lookup upward, in case it is not defined.
|
|
19
17
|
(typeof e.closest == "function" ? e.closest("[inert]") : ee(e.parentNode));
|
|
20
|
-
return
|
|
18
|
+
return l;
|
|
21
19
|
}, Oe = function(e) {
|
|
22
|
-
var t, o = e == null ||
|
|
23
|
-
return o === "" || o === "true";
|
|
20
|
+
var t, o = e == null || e.getAttribute == null || (t = e.getAttribute("contenteditable")) == null ? void 0 : t.toLowerCase();
|
|
21
|
+
return o === "" || o === "true" || o === "plaintext-only";
|
|
24
22
|
}, ye = function(e, t, o) {
|
|
25
23
|
if (ee(e))
|
|
26
24
|
return [];
|
|
@@ -31,21 +29,21 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
31
29
|
var a = l.shift();
|
|
32
30
|
if (!ee(a, !1))
|
|
33
31
|
if (a.tagName === "SLOT") {
|
|
34
|
-
var y = a.assignedElements(),
|
|
35
|
-
o.flatten ? s.push.apply(s,
|
|
32
|
+
var y = a.assignedElements(), T = y.length ? y : a.children, E = te(T, !0, o);
|
|
33
|
+
o.flatten ? s.push.apply(s, E) : s.push({
|
|
36
34
|
scopeParent: a,
|
|
37
|
-
candidates:
|
|
35
|
+
candidates: E
|
|
38
36
|
});
|
|
39
37
|
} else {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
typeof o.getShadowRoot == "function" && o.getShadowRoot(a), N = !ee(
|
|
44
|
-
if (
|
|
45
|
-
var
|
|
46
|
-
o.flatten ? s.push.apply(s,
|
|
38
|
+
var k = M.call(a, J);
|
|
39
|
+
k && o.filter(a) && (t || !e.includes(a)) && s.push(a);
|
|
40
|
+
var D = a.shadowRoot || // check for an undisclosed shadow
|
|
41
|
+
typeof o.getShadowRoot == "function" && o.getShadowRoot(a), N = !ee(D, !1) && (!o.shadowRootFilter || o.shadowRootFilter(a));
|
|
42
|
+
if (D && N) {
|
|
43
|
+
var _ = te(D === !0 ? a.children : D.children, !0, o);
|
|
44
|
+
o.flatten ? s.push.apply(s, _) : s.push({
|
|
47
45
|
scopeParent: a,
|
|
48
|
-
candidates:
|
|
46
|
+
candidates: _
|
|
49
47
|
});
|
|
50
48
|
} else
|
|
51
49
|
l.unshift.apply(l, a.children);
|
|
@@ -58,10 +56,10 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
58
56
|
if (!e)
|
|
59
57
|
throw new Error("No node provided");
|
|
60
58
|
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Oe(e)) && !me(e) ? 0 : e.tabIndex;
|
|
61
|
-
},
|
|
59
|
+
}, De = function(e, t) {
|
|
62
60
|
var o = L(e);
|
|
63
61
|
return o < 0 && t && !me(e) ? 0 : o;
|
|
64
|
-
},
|
|
62
|
+
}, ke = function(e, t) {
|
|
65
63
|
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
66
64
|
}, ge = function(e) {
|
|
67
65
|
return e.tagName === "INPUT";
|
|
@@ -96,20 +94,20 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
96
94
|
return ge(e) && e.type === "radio";
|
|
97
95
|
}, Ie = function(e) {
|
|
98
96
|
return Ae(e) && !Ce(e);
|
|
99
|
-
},
|
|
100
|
-
var t, o = e && Q(e), s = (t = o)
|
|
97
|
+
}, _e = function(e) {
|
|
98
|
+
var t, o = e && Q(e), s = (t = o) == null ? void 0 : t.host, l = !1;
|
|
101
99
|
if (o && o !== e) {
|
|
102
|
-
var a, y
|
|
103
|
-
for (l = !!((a = s)
|
|
104
|
-
var
|
|
105
|
-
o = Q(s), s = (
|
|
100
|
+
var a, y;
|
|
101
|
+
for (l = !!((a = s) != null && (a = a.ownerDocument) != null && a.contains(s) || e != null && (y = e.ownerDocument) != null && y.contains(e)); !l && s; ) {
|
|
102
|
+
var T, E;
|
|
103
|
+
o = Q(s), s = (T = o) == null ? void 0 : T.host, l = !!((E = s) != null && (E = E.ownerDocument) != null && E.contains(s));
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
return l;
|
|
109
107
|
}, se = function(e) {
|
|
110
108
|
var t = e.getBoundingClientRect(), o = t.width, s = t.height;
|
|
111
109
|
return o === 0 && s === 0;
|
|
112
|
-
},
|
|
110
|
+
}, je = function(e, t) {
|
|
113
111
|
var o = t.displayCheck, s = t.getShadowRoot;
|
|
114
112
|
if (o === "full-native" && "checkVisibility" in e) {
|
|
115
113
|
var l = e.checkVisibility({
|
|
@@ -130,22 +128,22 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
130
128
|
var a = getComputedStyle(e), y = a.visibility;
|
|
131
129
|
if (y === "hidden" || y === "collapse")
|
|
132
130
|
return !0;
|
|
133
|
-
var
|
|
134
|
-
if (M.call(
|
|
131
|
+
var T = M.call(e, "details>summary:first-of-type"), E = T ? e.parentElement : e;
|
|
132
|
+
if (M.call(E, "details:not([open]) *"))
|
|
135
133
|
return !0;
|
|
136
134
|
if (!o || o === "full" || // full-native can run this branch when it falls through in case
|
|
137
135
|
// Element#checkVisibility is unsupported
|
|
138
136
|
o === "full-native" || o === "legacy-full") {
|
|
139
137
|
if (typeof s == "function") {
|
|
140
|
-
for (var
|
|
141
|
-
var
|
|
142
|
-
if (
|
|
138
|
+
for (var k = e; e; ) {
|
|
139
|
+
var D = e.parentElement, N = Q(e);
|
|
140
|
+
if (D && !D.shadowRoot && s(D) === !0)
|
|
143
141
|
return se(e);
|
|
144
|
-
e.assignedSlot ? e = e.assignedSlot : !
|
|
142
|
+
e.assignedSlot ? e = e.assignedSlot : !D && N !== e.ownerDocument ? e = N.host : e = D;
|
|
145
143
|
}
|
|
146
|
-
e =
|
|
144
|
+
e = k;
|
|
147
145
|
}
|
|
148
|
-
if (
|
|
146
|
+
if (_e(e))
|
|
149
147
|
return !e.getClientRects().length;
|
|
150
148
|
if (o !== "legacy-full")
|
|
151
149
|
return !0;
|
|
@@ -167,28 +165,28 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
167
165
|
}
|
|
168
166
|
return !1;
|
|
169
167
|
}, re = function(e, t) {
|
|
170
|
-
return !(t.disabled || Ne(t) ||
|
|
168
|
+
return !(t.disabled || Ne(t) || je(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
171
169
|
Re(t) || xe(t));
|
|
172
170
|
}, oe = function(e, t) {
|
|
173
171
|
return !(Ie(t) || L(t) < 0 || !re(e, t));
|
|
174
172
|
}, Le = function(e) {
|
|
175
173
|
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
176
174
|
return !!(isNaN(t) || t >= 0);
|
|
177
|
-
},
|
|
175
|
+
}, we = function(e) {
|
|
178
176
|
var t = [], o = [];
|
|
179
177
|
return e.forEach(function(s, l) {
|
|
180
|
-
var a = !!s.scopeParent, y = a ? s.scopeParent : s,
|
|
181
|
-
|
|
178
|
+
var a = !!s.scopeParent, y = a ? s.scopeParent : s, T = De(y, a), E = a ? we(s.candidates) : y;
|
|
179
|
+
T === 0 ? a ? t.push.apply(t, E) : t.push(y) : o.push({
|
|
182
180
|
documentOrder: l,
|
|
183
|
-
tabIndex:
|
|
181
|
+
tabIndex: T,
|
|
184
182
|
item: s,
|
|
185
183
|
isScope: a,
|
|
186
|
-
content:
|
|
184
|
+
content: E
|
|
187
185
|
});
|
|
188
|
-
}), o.sort(
|
|
186
|
+
}), o.sort(ke).reduce(function(s, l) {
|
|
189
187
|
return l.isScope ? s.push.apply(s, l.content) : s.push(l.content), s;
|
|
190
188
|
}, []).concat(t);
|
|
191
|
-
},
|
|
189
|
+
}, Te = function(e, t) {
|
|
192
190
|
t = t || {};
|
|
193
191
|
var o;
|
|
194
192
|
return t.getShadowRoot ? o = te([e], t.includeContainer, {
|
|
@@ -196,7 +194,7 @@ var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
196
194
|
flatten: !1,
|
|
197
195
|
getShadowRoot: t.getShadowRoot,
|
|
198
196
|
shadowRootFilter: Le
|
|
199
|
-
}) : o = ye(e, t.includeContainer, oe.bind(null, t)),
|
|
197
|
+
}) : o = ye(e, t.includeContainer, oe.bind(null, t)), we(o);
|
|
200
198
|
}, Se = function(e, t) {
|
|
201
199
|
t = t || {};
|
|
202
200
|
var o;
|
|
@@ -220,39 +218,39 @@ const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
220
218
|
getTabIndex: L,
|
|
221
219
|
isFocusable: X,
|
|
222
220
|
isTabbable: K,
|
|
223
|
-
tabbable:
|
|
221
|
+
tabbable: Te
|
|
224
222
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
225
223
|
/*!
|
|
226
224
|
* focus-trap 7.8.0
|
|
227
225
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
228
226
|
*/
|
|
229
|
-
function ue(
|
|
230
|
-
(e == null || e >
|
|
231
|
-
for (var t = 0, o = Array(e); t < e; t++) o[t] =
|
|
227
|
+
function ue(i, e) {
|
|
228
|
+
(e == null || e > i.length) && (e = i.length);
|
|
229
|
+
for (var t = 0, o = Array(e); t < e; t++) o[t] = i[t];
|
|
232
230
|
return o;
|
|
233
231
|
}
|
|
234
|
-
function Me(
|
|
235
|
-
if (Array.isArray(
|
|
232
|
+
function Me(i) {
|
|
233
|
+
if (Array.isArray(i)) return ue(i);
|
|
236
234
|
}
|
|
237
|
-
function ce(
|
|
238
|
-
var t = typeof Symbol < "u" &&
|
|
235
|
+
function ce(i, e) {
|
|
236
|
+
var t = typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
|
|
239
237
|
if (!t) {
|
|
240
|
-
if (Array.isArray(
|
|
241
|
-
t && (
|
|
238
|
+
if (Array.isArray(i) || (t = Fe(i)) || e) {
|
|
239
|
+
t && (i = t);
|
|
242
240
|
var o = 0, s = function() {
|
|
243
241
|
};
|
|
244
242
|
return {
|
|
245
243
|
s,
|
|
246
244
|
n: function() {
|
|
247
|
-
return o >=
|
|
245
|
+
return o >= i.length ? {
|
|
248
246
|
done: !0
|
|
249
247
|
} : {
|
|
250
248
|
done: !1,
|
|
251
|
-
value:
|
|
249
|
+
value: i[o++]
|
|
252
250
|
};
|
|
253
251
|
},
|
|
254
|
-
e: function(
|
|
255
|
-
throw
|
|
252
|
+
e: function(T) {
|
|
253
|
+
throw T;
|
|
256
254
|
},
|
|
257
255
|
f: s
|
|
258
256
|
};
|
|
@@ -263,14 +261,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
263
261
|
var l, a = !0, y = !1;
|
|
264
262
|
return {
|
|
265
263
|
s: function() {
|
|
266
|
-
t = t.call(
|
|
264
|
+
t = t.call(i);
|
|
267
265
|
},
|
|
268
266
|
n: function() {
|
|
269
|
-
var
|
|
270
|
-
return a =
|
|
267
|
+
var T = t.next();
|
|
268
|
+
return a = T.done, T;
|
|
271
269
|
},
|
|
272
|
-
e: function(
|
|
273
|
-
y = !0, l =
|
|
270
|
+
e: function(T) {
|
|
271
|
+
y = !0, l = T;
|
|
274
272
|
},
|
|
275
273
|
f: function() {
|
|
276
274
|
try {
|
|
@@ -281,64 +279,64 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
281
279
|
}
|
|
282
280
|
};
|
|
283
281
|
}
|
|
284
|
-
function qe(
|
|
285
|
-
return (e = We(e)) in
|
|
282
|
+
function qe(i, e, t) {
|
|
283
|
+
return (e = We(e)) in i ? Object.defineProperty(i, e, {
|
|
286
284
|
value: t,
|
|
287
285
|
enumerable: !0,
|
|
288
286
|
configurable: !0,
|
|
289
287
|
writable: !0
|
|
290
|
-
}) :
|
|
288
|
+
}) : i[e] = t, i;
|
|
291
289
|
}
|
|
292
|
-
function
|
|
293
|
-
if (typeof Symbol < "u" &&
|
|
290
|
+
function $e(i) {
|
|
291
|
+
if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null) return Array.from(i);
|
|
294
292
|
}
|
|
295
|
-
function
|
|
293
|
+
function Ve() {
|
|
296
294
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
297
295
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
298
296
|
}
|
|
299
|
-
function le(
|
|
300
|
-
var t = Object.keys(
|
|
297
|
+
function le(i, e) {
|
|
298
|
+
var t = Object.keys(i);
|
|
301
299
|
if (Object.getOwnPropertySymbols) {
|
|
302
|
-
var o = Object.getOwnPropertySymbols(
|
|
300
|
+
var o = Object.getOwnPropertySymbols(i);
|
|
303
301
|
e && (o = o.filter(function(s) {
|
|
304
|
-
return Object.getOwnPropertyDescriptor(
|
|
302
|
+
return Object.getOwnPropertyDescriptor(i, s).enumerable;
|
|
305
303
|
})), t.push.apply(t, o);
|
|
306
304
|
}
|
|
307
305
|
return t;
|
|
308
306
|
}
|
|
309
|
-
function fe(
|
|
307
|
+
function fe(i) {
|
|
310
308
|
for (var e = 1; e < arguments.length; e++) {
|
|
311
309
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
312
310
|
e % 2 ? le(Object(t), !0).forEach(function(o) {
|
|
313
|
-
qe(
|
|
314
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
315
|
-
Object.defineProperty(
|
|
311
|
+
qe(i, o, t[o]);
|
|
312
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : le(Object(t)).forEach(function(o) {
|
|
313
|
+
Object.defineProperty(i, o, Object.getOwnPropertyDescriptor(t, o));
|
|
316
314
|
});
|
|
317
315
|
}
|
|
318
|
-
return
|
|
316
|
+
return i;
|
|
319
317
|
}
|
|
320
|
-
function
|
|
321
|
-
return Me(
|
|
318
|
+
function Ge(i) {
|
|
319
|
+
return Me(i) || $e(i) || Fe(i) || Ve();
|
|
322
320
|
}
|
|
323
|
-
function Ue(
|
|
324
|
-
if (typeof
|
|
325
|
-
var t =
|
|
321
|
+
function Ue(i, e) {
|
|
322
|
+
if (typeof i != "object" || !i) return i;
|
|
323
|
+
var t = i[Symbol.toPrimitive];
|
|
326
324
|
if (t !== void 0) {
|
|
327
|
-
var o = t.call(
|
|
325
|
+
var o = t.call(i, e);
|
|
328
326
|
if (typeof o != "object") return o;
|
|
329
327
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
330
328
|
}
|
|
331
|
-
return (e === "string" ? String : Number)(
|
|
329
|
+
return (e === "string" ? String : Number)(i);
|
|
332
330
|
}
|
|
333
|
-
function We(
|
|
334
|
-
var e = Ue(
|
|
331
|
+
function We(i) {
|
|
332
|
+
var e = Ue(i, "string");
|
|
335
333
|
return typeof e == "symbol" ? e : e + "";
|
|
336
334
|
}
|
|
337
|
-
function Fe(
|
|
338
|
-
if (
|
|
339
|
-
if (typeof
|
|
340
|
-
var t = {}.toString.call(
|
|
341
|
-
return t === "Object" &&
|
|
335
|
+
function Fe(i, e) {
|
|
336
|
+
if (i) {
|
|
337
|
+
if (typeof i == "string") return ue(i, e);
|
|
338
|
+
var t = {}.toString.call(i).slice(8, -1);
|
|
339
|
+
return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ue(i, e) : void 0;
|
|
342
340
|
}
|
|
343
341
|
}
|
|
344
342
|
var I = {
|
|
@@ -370,17 +368,17 @@ var I = {
|
|
|
370
368
|
}
|
|
371
369
|
}, ze = function(e) {
|
|
372
370
|
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
373
|
-
},
|
|
371
|
+
}, He = function(e) {
|
|
374
372
|
return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
|
|
375
|
-
},
|
|
373
|
+
}, G = function(e) {
|
|
376
374
|
return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
|
|
377
|
-
},
|
|
378
|
-
return
|
|
375
|
+
}, Ye = function(e) {
|
|
376
|
+
return G(e) && !e.shiftKey;
|
|
379
377
|
}, Ze = function(e) {
|
|
380
|
-
return
|
|
378
|
+
return G(e) && e.shiftKey;
|
|
381
379
|
}, de = function(e) {
|
|
382
380
|
return setTimeout(e, 0);
|
|
383
|
-
},
|
|
381
|
+
}, V = function(e) {
|
|
384
382
|
for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
385
383
|
o[s - 1] = arguments[s];
|
|
386
384
|
return typeof e == "function" ? e.apply(void 0, o) : e;
|
|
@@ -392,7 +390,7 @@ var I = {
|
|
|
392
390
|
escapeDeactivates: !0,
|
|
393
391
|
delayInitialFocus: !0,
|
|
394
392
|
isolateSubtrees: !1,
|
|
395
|
-
isKeyForward:
|
|
393
|
+
isKeyForward: Ye,
|
|
396
394
|
isKeyBackward: Ze
|
|
397
395
|
}, t), a = {
|
|
398
396
|
// containers given to createFocusTrap()
|
|
@@ -438,58 +436,58 @@ var I = {
|
|
|
438
436
|
delayInitialFocusTimer: void 0,
|
|
439
437
|
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
440
438
|
recentNavEvent: void 0
|
|
441
|
-
}, y,
|
|
442
|
-
return
|
|
443
|
-
},
|
|
439
|
+
}, y, T = function(n, r, c) {
|
|
440
|
+
return n && n[r] !== void 0 ? n[r] : l[c || r];
|
|
441
|
+
}, E = function(n, r) {
|
|
444
442
|
var c = typeof (r == null ? void 0 : r.composedPath) == "function" ? r.composedPath() : void 0;
|
|
445
443
|
return a.containerGroups.findIndex(function(h) {
|
|
446
444
|
var p = h.container, g = h.tabbableNodes;
|
|
447
|
-
return p.contains(
|
|
445
|
+
return p.contains(n) || // fall back to explicit tabbable search which will take into consideration any
|
|
448
446
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
449
447
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
450
448
|
// look inside web components even if open)
|
|
451
449
|
(c == null ? void 0 : c.includes(p)) || g.find(function(v) {
|
|
452
|
-
return v ===
|
|
450
|
+
return v === n;
|
|
453
451
|
});
|
|
454
452
|
});
|
|
455
|
-
},
|
|
456
|
-
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = r.hasFallback, h = c === void 0 ? !1 : c, p = r.params, g = p === void 0 ? [] : p, v = l[
|
|
457
|
-
if (typeof v == "function" && (v = v.apply(void 0,
|
|
453
|
+
}, k = function(n) {
|
|
454
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = r.hasFallback, h = c === void 0 ? !1 : c, p = r.params, g = p === void 0 ? [] : p, v = l[n];
|
|
455
|
+
if (typeof v == "function" && (v = v.apply(void 0, Ge(g))), v === !0 && (v = void 0), !v) {
|
|
458
456
|
if (v === void 0 || v === !1)
|
|
459
457
|
return v;
|
|
460
|
-
throw new Error("`".concat(
|
|
458
|
+
throw new Error("`".concat(n, "` was specified but was not a node, or did not return a node"));
|
|
461
459
|
}
|
|
462
460
|
var S = v;
|
|
463
461
|
if (typeof v == "string") {
|
|
464
462
|
try {
|
|
465
463
|
S = o.querySelector(v);
|
|
466
464
|
} catch (F) {
|
|
467
|
-
throw new Error("`".concat(
|
|
465
|
+
throw new Error("`".concat(n, '` appears to be an invalid selector; error="').concat(F.message, '"'));
|
|
468
466
|
}
|
|
469
467
|
if (!S && !h)
|
|
470
|
-
throw new Error("`".concat(
|
|
468
|
+
throw new Error("`".concat(n, "` as selector refers to no known node"));
|
|
471
469
|
}
|
|
472
470
|
return S;
|
|
473
|
-
},
|
|
474
|
-
var
|
|
471
|
+
}, D = function() {
|
|
472
|
+
var n = k("initialFocus", {
|
|
475
473
|
hasFallback: !0
|
|
476
474
|
});
|
|
477
|
-
if (
|
|
475
|
+
if (n === !1)
|
|
478
476
|
return !1;
|
|
479
|
-
if (
|
|
480
|
-
if (
|
|
481
|
-
|
|
477
|
+
if (n === void 0 || n && !X(n, l.tabbableOptions))
|
|
478
|
+
if (E(o.activeElement) >= 0)
|
|
479
|
+
n = o.activeElement;
|
|
482
480
|
else {
|
|
483
481
|
var r = a.tabbableGroups[0], c = r && r.firstTabbableNode;
|
|
484
|
-
|
|
482
|
+
n = c || k("fallbackFocus");
|
|
485
483
|
}
|
|
486
|
-
else
|
|
487
|
-
if (!
|
|
484
|
+
else n === null && (n = k("fallbackFocus"));
|
|
485
|
+
if (!n)
|
|
488
486
|
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
489
|
-
return
|
|
487
|
+
return n;
|
|
490
488
|
}, N = function() {
|
|
491
|
-
if (a.containerGroups = a.containers.map(function(
|
|
492
|
-
var r =
|
|
489
|
+
if (a.containerGroups = a.containers.map(function(n) {
|
|
490
|
+
var r = Te(n, l.tabbableOptions), c = Se(n, l.tabbableOptions), h = r.length > 0 ? r[0] : void 0, p = r.length > 0 ? r[r.length - 1] : void 0, g = c.find(function(F) {
|
|
493
491
|
return K(F);
|
|
494
492
|
}), v = c.slice().reverse().find(function(F) {
|
|
495
493
|
return K(F);
|
|
@@ -497,7 +495,7 @@ var I = {
|
|
|
497
495
|
return L(F) > 0;
|
|
498
496
|
});
|
|
499
497
|
return {
|
|
500
|
-
container:
|
|
498
|
+
container: n,
|
|
501
499
|
tabbableNodes: r,
|
|
502
500
|
focusableNodes: c,
|
|
503
501
|
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
@@ -534,39 +532,39 @@ var I = {
|
|
|
534
532
|
}) : r[C + (A ? 1 : -1)];
|
|
535
533
|
}
|
|
536
534
|
};
|
|
537
|
-
}), a.tabbableGroups = a.containerGroups.filter(function(
|
|
538
|
-
return
|
|
539
|
-
}), a.tabbableGroups.length <= 0 && !
|
|
535
|
+
}), a.tabbableGroups = a.containerGroups.filter(function(n) {
|
|
536
|
+
return n.tabbableNodes.length > 0;
|
|
537
|
+
}), a.tabbableGroups.length <= 0 && !k("fallbackFocus"))
|
|
540
538
|
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
541
|
-
if (a.containerGroups.find(function(
|
|
542
|
-
return
|
|
539
|
+
if (a.containerGroups.find(function(n) {
|
|
540
|
+
return n.posTabIndexesFound;
|
|
543
541
|
}) && a.containerGroups.length > 1)
|
|
544
542
|
throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
545
|
-
},
|
|
546
|
-
var r =
|
|
543
|
+
}, _ = function(n) {
|
|
544
|
+
var r = n.activeElement;
|
|
547
545
|
if (r)
|
|
548
|
-
return r.shadowRoot && r.shadowRoot.activeElement !== null ?
|
|
549
|
-
}, P = function(
|
|
550
|
-
if (
|
|
551
|
-
if (!
|
|
552
|
-
P(
|
|
546
|
+
return r.shadowRoot && r.shadowRoot.activeElement !== null ? _(r.shadowRoot) : r;
|
|
547
|
+
}, P = function(n) {
|
|
548
|
+
if (n !== !1 && n !== _(document)) {
|
|
549
|
+
if (!n || !n.focus) {
|
|
550
|
+
P(D());
|
|
553
551
|
return;
|
|
554
552
|
}
|
|
555
|
-
|
|
553
|
+
n.focus({
|
|
556
554
|
preventScroll: !!l.preventScroll
|
|
557
|
-
}), a.mostRecentlyFocusedNode =
|
|
555
|
+
}), a.mostRecentlyFocusedNode = n, ze(n) && n.select();
|
|
558
556
|
}
|
|
559
|
-
}, U = function(
|
|
560
|
-
var r =
|
|
561
|
-
params: [
|
|
557
|
+
}, U = function(n) {
|
|
558
|
+
var r = k("setReturnFocus", {
|
|
559
|
+
params: [n]
|
|
562
560
|
});
|
|
563
|
-
return r || (r === !1 ? !1 :
|
|
564
|
-
},
|
|
565
|
-
var r =
|
|
561
|
+
return r || (r === !1 ? !1 : n);
|
|
562
|
+
}, j = function(n) {
|
|
563
|
+
var r = n.target, c = n.event, h = n.isBackward, p = h === void 0 ? !1 : h;
|
|
566
564
|
r = r || Z(c), N();
|
|
567
565
|
var g = null;
|
|
568
566
|
if (a.tabbableGroups.length > 0) {
|
|
569
|
-
var v =
|
|
567
|
+
var v = E(r, c), S = v >= 0 ? a.containerGroups[v] : void 0;
|
|
570
568
|
if (v < 0)
|
|
571
569
|
p ? g = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : g = a.tabbableGroups[0].firstTabbableNode;
|
|
572
570
|
else if (p) {
|
|
@@ -577,7 +575,7 @@ var I = {
|
|
|
577
575
|
if (F < 0 && (S.container === r || X(r, l.tabbableOptions) && !K(r, l.tabbableOptions) && !S.nextTabbableNode(r, !1)) && (F = v), F >= 0) {
|
|
578
576
|
var R = F === 0 ? a.tabbableGroups.length - 1 : F - 1, A = a.tabbableGroups[R];
|
|
579
577
|
g = L(r) >= 0 ? A.lastTabbableNode : A.lastDomTabbableNode;
|
|
580
|
-
} else
|
|
578
|
+
} else G(c) || (g = S.nextTabbableNode(r, !1));
|
|
581
579
|
} else {
|
|
582
580
|
var C = a.tabbableGroups.findIndex(function(ne) {
|
|
583
581
|
var ie = ne.lastTabbableNode;
|
|
@@ -586,15 +584,15 @@ var I = {
|
|
|
586
584
|
if (C < 0 && (S.container === r || X(r, l.tabbableOptions) && !K(r, l.tabbableOptions) && !S.nextTabbableNode(r)) && (C = v), C >= 0) {
|
|
587
585
|
var B = C === a.tabbableGroups.length - 1 ? 0 : C + 1, x = a.tabbableGroups[B];
|
|
588
586
|
g = L(r) >= 0 ? x.firstTabbableNode : x.firstDomTabbableNode;
|
|
589
|
-
} else
|
|
587
|
+
} else G(c) || (g = S.nextTabbableNode(r));
|
|
590
588
|
}
|
|
591
589
|
} else
|
|
592
|
-
g =
|
|
590
|
+
g = k("fallbackFocus");
|
|
593
591
|
return g;
|
|
594
|
-
}, q = function(
|
|
595
|
-
var r = Z(
|
|
596
|
-
if (!(
|
|
597
|
-
if (
|
|
592
|
+
}, q = function(n) {
|
|
593
|
+
var r = Z(n);
|
|
594
|
+
if (!(E(r, n) >= 0)) {
|
|
595
|
+
if (V(l.clickOutsideDeactivates, n)) {
|
|
598
596
|
y.deactivate({
|
|
599
597
|
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
600
598
|
// which will result in the outside click setting focus to the node
|
|
@@ -606,18 +604,18 @@ var I = {
|
|
|
606
604
|
});
|
|
607
605
|
return;
|
|
608
606
|
}
|
|
609
|
-
|
|
607
|
+
V(l.allowOutsideClick, n) || n.preventDefault();
|
|
610
608
|
}
|
|
611
|
-
}, W = function(
|
|
612
|
-
var r = Z(
|
|
609
|
+
}, W = function(n) {
|
|
610
|
+
var r = Z(n), c = E(r, n) >= 0;
|
|
613
611
|
if (c || r instanceof Document)
|
|
614
612
|
c && (a.mostRecentlyFocusedNode = r);
|
|
615
613
|
else {
|
|
616
|
-
|
|
614
|
+
n.stopImmediatePropagation();
|
|
617
615
|
var h, p = !0;
|
|
618
616
|
if (a.mostRecentlyFocusedNode)
|
|
619
617
|
if (L(a.mostRecentlyFocusedNode) > 0) {
|
|
620
|
-
var g =
|
|
618
|
+
var g = E(a.mostRecentlyFocusedNode), v = a.containerGroups[g].tabbableNodes;
|
|
621
619
|
if (v.length > 0) {
|
|
622
620
|
var S = v.findIndex(function(F) {
|
|
623
621
|
return F === a.mostRecentlyFocusedNode;
|
|
@@ -632,49 +630,49 @@ var I = {
|
|
|
632
630
|
}) || (p = !1);
|
|
633
631
|
else
|
|
634
632
|
p = !1;
|
|
635
|
-
p && (h =
|
|
633
|
+
p && (h = j({
|
|
636
634
|
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
637
635
|
// outside the trap causing the focus escape we're trying to fix)
|
|
638
636
|
target: a.mostRecentlyFocusedNode,
|
|
639
637
|
isBackward: l.isKeyBackward(a.recentNavEvent)
|
|
640
|
-
})), P(h || a.mostRecentlyFocusedNode ||
|
|
638
|
+
})), P(h || a.mostRecentlyFocusedNode || D());
|
|
641
639
|
}
|
|
642
640
|
a.recentNavEvent = void 0;
|
|
643
|
-
}, ae = function(
|
|
641
|
+
}, ae = function(n) {
|
|
644
642
|
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
645
|
-
a.recentNavEvent =
|
|
646
|
-
var c =
|
|
647
|
-
event:
|
|
643
|
+
a.recentNavEvent = n;
|
|
644
|
+
var c = j({
|
|
645
|
+
event: n,
|
|
648
646
|
isBackward: r
|
|
649
647
|
});
|
|
650
|
-
c && (
|
|
651
|
-
}, z = function(
|
|
652
|
-
(l.isKeyForward(
|
|
653
|
-
},
|
|
654
|
-
|
|
655
|
-
},
|
|
656
|
-
var r = Z(
|
|
657
|
-
|
|
648
|
+
c && (G(n) && n.preventDefault(), P(c));
|
|
649
|
+
}, z = function(n) {
|
|
650
|
+
(l.isKeyForward(n) || l.isKeyBackward(n)) && ae(n, l.isKeyBackward(n));
|
|
651
|
+
}, H = function(n) {
|
|
652
|
+
He(n) && V(l.escapeDeactivates, n) !== !1 && (n.preventDefault(), y.deactivate());
|
|
653
|
+
}, $ = function(n) {
|
|
654
|
+
var r = Z(n);
|
|
655
|
+
E(r, n) >= 0 || V(l.clickOutsideDeactivates, n) || V(l.allowOutsideClick, n) || (n.preventDefault(), n.stopImmediatePropagation());
|
|
658
656
|
}, d = function() {
|
|
659
657
|
if (a.active)
|
|
660
658
|
return I.activateTrap(s, y), a.delayInitialFocusTimer = l.delayInitialFocus ? de(function() {
|
|
661
|
-
P(
|
|
662
|
-
}) : P(
|
|
659
|
+
P(D());
|
|
660
|
+
}) : P(D()), o.addEventListener("focusin", W, !0), o.addEventListener("mousedown", q, {
|
|
663
661
|
capture: !0,
|
|
664
662
|
passive: !1
|
|
665
663
|
}), o.addEventListener("touchstart", q, {
|
|
666
664
|
capture: !0,
|
|
667
665
|
passive: !1
|
|
668
|
-
}), o.addEventListener("click",
|
|
666
|
+
}), o.addEventListener("click", $, {
|
|
669
667
|
capture: !0,
|
|
670
668
|
passive: !1
|
|
671
669
|
}), o.addEventListener("keydown", z, {
|
|
672
670
|
capture: !0,
|
|
673
671
|
passive: !1
|
|
674
|
-
}), o.addEventListener("keydown",
|
|
675
|
-
}, f = function(
|
|
672
|
+
}), o.addEventListener("keydown", H), y;
|
|
673
|
+
}, f = function(n) {
|
|
676
674
|
a.active && !a.paused && y._setSubtreeIsolation(!1), a.adjacentElements.clear(), a.alreadySilent.clear();
|
|
677
|
-
var r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), h = ce(
|
|
675
|
+
var r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), h = ce(n), p;
|
|
678
676
|
try {
|
|
679
677
|
for (h.s(); !(p = h.n()).done; ) {
|
|
680
678
|
var g = p.value;
|
|
@@ -707,18 +705,18 @@ var I = {
|
|
|
707
705
|
}), a.adjacentElements = c;
|
|
708
706
|
}, m = function() {
|
|
709
707
|
if (a.active)
|
|
710
|
-
return o.removeEventListener("focusin", W, !0), o.removeEventListener("mousedown", q, !0), o.removeEventListener("touchstart", q, !0), o.removeEventListener("click",
|
|
711
|
-
}, u = function(
|
|
712
|
-
var r =
|
|
708
|
+
return o.removeEventListener("focusin", W, !0), o.removeEventListener("mousedown", q, !0), o.removeEventListener("touchstart", q, !0), o.removeEventListener("click", $, !0), o.removeEventListener("keydown", z, !0), o.removeEventListener("keydown", H), y;
|
|
709
|
+
}, u = function(n) {
|
|
710
|
+
var r = n.some(function(c) {
|
|
713
711
|
var h = Array.from(c.removedNodes);
|
|
714
712
|
return h.some(function(p) {
|
|
715
713
|
return p === a.mostRecentlyFocusedNode;
|
|
716
714
|
});
|
|
717
715
|
});
|
|
718
|
-
r && P(
|
|
719
|
-
},
|
|
720
|
-
|
|
721
|
-
|
|
716
|
+
r && P(D());
|
|
717
|
+
}, w = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, O = function() {
|
|
718
|
+
w && (w.disconnect(), a.active && !a.paused && a.containers.map(function(n) {
|
|
719
|
+
w.observe(n, {
|
|
722
720
|
subtree: !0,
|
|
723
721
|
childList: !0
|
|
724
722
|
});
|
|
@@ -731,18 +729,18 @@ var I = {
|
|
|
731
729
|
get paused() {
|
|
732
730
|
return a.paused;
|
|
733
731
|
},
|
|
734
|
-
activate: function(
|
|
732
|
+
activate: function(n) {
|
|
735
733
|
if (a.active)
|
|
736
734
|
return this;
|
|
737
|
-
var r =
|
|
735
|
+
var r = T(n, "onActivate"), c = T(n, "onPostActivate"), h = T(n, "checkCanFocusTrap"), p = I.getActiveTrap(s), g = !1;
|
|
738
736
|
if (p && !p.paused) {
|
|
739
737
|
var v;
|
|
740
738
|
(v = p._setSubtreeIsolation) === null || v === void 0 || v.call(p, !1), g = !0;
|
|
741
739
|
}
|
|
742
740
|
try {
|
|
743
|
-
h || N(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation =
|
|
741
|
+
h || N(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = _(o), r == null || r();
|
|
744
742
|
var S = function() {
|
|
745
|
-
h && N(), d(),
|
|
743
|
+
h && N(), d(), O(), l.isolateSubtrees && y._setSubtreeIsolation(!0), c == null || c();
|
|
746
744
|
};
|
|
747
745
|
if (h)
|
|
748
746
|
return h(a.containers.concat()).then(S, S), this;
|
|
@@ -756,16 +754,16 @@ var I = {
|
|
|
756
754
|
}
|
|
757
755
|
return this;
|
|
758
756
|
},
|
|
759
|
-
deactivate: function(
|
|
757
|
+
deactivate: function(n) {
|
|
760
758
|
if (!a.active)
|
|
761
759
|
return this;
|
|
762
760
|
var r = fe({
|
|
763
761
|
onDeactivate: l.onDeactivate,
|
|
764
762
|
onPostDeactivate: l.onPostDeactivate,
|
|
765
763
|
checkCanReturnFocus: l.checkCanReturnFocus
|
|
766
|
-
},
|
|
767
|
-
clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || y._setSubtreeIsolation(!1), a.alreadySilent.clear(), m(), a.active = !1, a.paused = !1,
|
|
768
|
-
var c =
|
|
764
|
+
}, n);
|
|
765
|
+
clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || y._setSubtreeIsolation(!1), a.alreadySilent.clear(), m(), a.active = !1, a.paused = !1, O(), I.deactivateTrap(s, y);
|
|
766
|
+
var c = T(r, "onDeactivate"), h = T(r, "onPostDeactivate"), p = T(r, "checkCanReturnFocus"), g = T(r, "returnFocus", "returnFocusOnDeactivate");
|
|
769
767
|
c == null || c();
|
|
770
768
|
var v = function() {
|
|
771
769
|
de(function() {
|
|
@@ -774,17 +772,17 @@ var I = {
|
|
|
774
772
|
};
|
|
775
773
|
return g && p ? (p(U(a.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this);
|
|
776
774
|
},
|
|
777
|
-
pause: function(
|
|
778
|
-
return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0,
|
|
775
|
+
pause: function(n) {
|
|
776
|
+
return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, n)) : this;
|
|
779
777
|
},
|
|
780
|
-
unpause: function(
|
|
781
|
-
return a.active ? (a.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1,
|
|
778
|
+
unpause: function(n) {
|
|
779
|
+
return a.active ? (a.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, n)) : this;
|
|
782
780
|
},
|
|
783
|
-
updateContainerElements: function(
|
|
784
|
-
var r = [].concat(
|
|
781
|
+
updateContainerElements: function(n) {
|
|
782
|
+
var r = [].concat(n).filter(Boolean);
|
|
785
783
|
return a.containers = r.map(function(c) {
|
|
786
784
|
return typeof c == "string" ? o.querySelector(c) : c;
|
|
787
|
-
}), l.isolateSubtrees && f(a.containers), a.active && (N(), l.isolateSubtrees && !a.paused && y._setSubtreeIsolation(!0)),
|
|
785
|
+
}), l.isolateSubtrees && f(a.containers), a.active && (N(), l.isolateSubtrees && !a.paused && y._setSubtreeIsolation(!0)), O(), this;
|
|
788
786
|
}
|
|
789
787
|
}, Object.defineProperties(y, {
|
|
790
788
|
_isManuallyPaused: {
|
|
@@ -793,24 +791,24 @@ var I = {
|
|
|
793
791
|
}
|
|
794
792
|
},
|
|
795
793
|
_setPausedState: {
|
|
796
|
-
value: function(
|
|
797
|
-
if (a.paused ===
|
|
794
|
+
value: function(n, r) {
|
|
795
|
+
if (a.paused === n)
|
|
798
796
|
return this;
|
|
799
|
-
if (a.paused =
|
|
800
|
-
var c =
|
|
801
|
-
c == null || c(), m(),
|
|
797
|
+
if (a.paused = n, n) {
|
|
798
|
+
var c = T(r, "onPause"), h = T(r, "onPostPause");
|
|
799
|
+
c == null || c(), m(), O(), y._setSubtreeIsolation(!1), h == null || h();
|
|
802
800
|
} else {
|
|
803
|
-
var p =
|
|
804
|
-
p == null || p(), y._setSubtreeIsolation(!0), N(), d(),
|
|
801
|
+
var p = T(r, "onUnpause"), g = T(r, "onPostUnpause");
|
|
802
|
+
p == null || p(), y._setSubtreeIsolation(!0), N(), d(), O(), g == null || g();
|
|
805
803
|
}
|
|
806
804
|
return this;
|
|
807
805
|
}
|
|
808
806
|
},
|
|
809
807
|
_setSubtreeIsolation: {
|
|
810
|
-
value: function(
|
|
808
|
+
value: function(n) {
|
|
811
809
|
l.isolateSubtrees && a.adjacentElements.forEach(function(r) {
|
|
812
810
|
var c;
|
|
813
|
-
if (
|
|
811
|
+
if (n)
|
|
814
812
|
switch (l.isolateSubtrees) {
|
|
815
813
|
case "aria-hidden":
|
|
816
814
|
(r.ariaHidden === "true" || ((c = r.getAttribute("aria-hidden")) === null || c === void 0 ? void 0 : c.toLowerCase()) === "true") && a.alreadySilent.add(r), r.setAttribute("aria-hidden", "true");
|
|
@@ -838,15 +836,15 @@ const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
838
836
|
}, Symbol.toStringTag, { value: "Module" })), et = /* @__PURE__ */ be(Qe), tt = /* @__PURE__ */ be(Ke);
|
|
839
837
|
var ve;
|
|
840
838
|
function rt() {
|
|
841
|
-
if (ve) return
|
|
839
|
+
if (ve) return Y.exports;
|
|
842
840
|
ve = 1;
|
|
843
|
-
function
|
|
841
|
+
function i(d) {
|
|
844
842
|
"@babel/helpers - typeof";
|
|
845
|
-
return
|
|
843
|
+
return i = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
|
|
846
844
|
return typeof f;
|
|
847
845
|
} : function(f) {
|
|
848
846
|
return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
|
|
849
|
-
},
|
|
847
|
+
}, i(d);
|
|
850
848
|
}
|
|
851
849
|
var e, t;
|
|
852
850
|
function o(d, f) {
|
|
@@ -862,33 +860,33 @@ function rt() {
|
|
|
862
860
|
return f && s(d.prototype, f), Object.defineProperty(d, "prototype", { writable: !1 }), d;
|
|
863
861
|
}
|
|
864
862
|
function a(d, f, m) {
|
|
865
|
-
return f =
|
|
863
|
+
return f = k(f), y(d, E() ? Reflect.construct(f, m || [], k(d).constructor) : f.apply(d, m));
|
|
866
864
|
}
|
|
867
865
|
function y(d, f) {
|
|
868
|
-
if (f && (
|
|
866
|
+
if (f && (i(f) == "object" || typeof f == "function")) return f;
|
|
869
867
|
if (f !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
870
|
-
return
|
|
868
|
+
return T(d);
|
|
871
869
|
}
|
|
872
|
-
function
|
|
870
|
+
function T(d) {
|
|
873
871
|
if (d === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
874
872
|
return d;
|
|
875
873
|
}
|
|
876
|
-
function
|
|
874
|
+
function E() {
|
|
877
875
|
try {
|
|
878
876
|
var d = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
879
877
|
}));
|
|
880
878
|
} catch {
|
|
881
879
|
}
|
|
882
|
-
return (
|
|
880
|
+
return (E = function() {
|
|
883
881
|
return !!d;
|
|
884
882
|
})();
|
|
885
883
|
}
|
|
886
|
-
function
|
|
887
|
-
return
|
|
884
|
+
function k(d) {
|
|
885
|
+
return k = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(f) {
|
|
888
886
|
return f.__proto__ || Object.getPrototypeOf(f);
|
|
889
|
-
},
|
|
887
|
+
}, k(d);
|
|
890
888
|
}
|
|
891
|
-
function
|
|
889
|
+
function D(d, f) {
|
|
892
890
|
if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
|
|
893
891
|
d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && N(d, f);
|
|
894
892
|
}
|
|
@@ -897,28 +895,28 @@ function rt() {
|
|
|
897
895
|
return m.__proto__ = u, m;
|
|
898
896
|
}, N(d, f);
|
|
899
897
|
}
|
|
900
|
-
function
|
|
898
|
+
function _(d, f, m) {
|
|
901
899
|
return (f = P(f)) in d ? Object.defineProperty(d, f, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : d[f] = m, d;
|
|
902
900
|
}
|
|
903
901
|
function P(d) {
|
|
904
902
|
var f = U(d, "string");
|
|
905
|
-
return
|
|
903
|
+
return i(f) == "symbol" ? f : f + "";
|
|
906
904
|
}
|
|
907
905
|
function U(d, f) {
|
|
908
|
-
if (
|
|
906
|
+
if (i(d) != "object" || !d) return d;
|
|
909
907
|
var m = d[Symbol.toPrimitive];
|
|
910
908
|
if (m !== void 0) {
|
|
911
909
|
var u = m.call(d, f);
|
|
912
|
-
if (
|
|
910
|
+
if (i(u) != "object") return u;
|
|
913
911
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
914
912
|
}
|
|
915
913
|
return (f === "string" ? String : Number)(d);
|
|
916
914
|
}
|
|
917
|
-
var
|
|
915
|
+
var j = Ee, q = et, W = q.createFocusTrap, ae = tt, z = ae.isFocusable, H = parseInt((e = (t = /^(\d+)\./.exec(j.version)) === null || t === void 0 ? void 0 : t[1]) !== null && e !== void 0 ? e : 0, 10), $ = /* @__PURE__ */ (function(d) {
|
|
918
916
|
function f(m) {
|
|
919
917
|
var u;
|
|
920
|
-
o(this, f), u = a(this, f, [m]),
|
|
921
|
-
var
|
|
918
|
+
o(this, f), u = a(this, f, [m]), _(u, "getNodeForOption", function(b) {
|
|
919
|
+
var n, r = (n = this.internalOptions[b]) !== null && n !== void 0 ? n : this.originalOptions[b];
|
|
922
920
|
if (typeof r == "function") {
|
|
923
921
|
for (var c = arguments.length, h = new Array(c > 1 ? c - 1 : 0), p = 1; p < c; p++)
|
|
924
922
|
h[p - 1] = arguments[p];
|
|
@@ -966,18 +964,18 @@ function rt() {
|
|
|
966
964
|
// the user's setting, defaulted to false since focus-trap defaults this to false
|
|
967
965
|
clickOutsideDeactivates: !1
|
|
968
966
|
};
|
|
969
|
-
var
|
|
970
|
-
for (var
|
|
971
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
972
|
-
if (
|
|
973
|
-
u.originalOptions[
|
|
967
|
+
var w = m.focusTrapOptions;
|
|
968
|
+
for (var O in w)
|
|
969
|
+
if (Object.prototype.hasOwnProperty.call(w, O)) {
|
|
970
|
+
if (O === "returnFocusOnDeactivate" || O === "onDeactivate" || O === "onPostDeactivate" || O === "checkCanReturnFocus" || O === "clickOutsideDeactivates") {
|
|
971
|
+
u.originalOptions[O] = w[O];
|
|
974
972
|
continue;
|
|
975
973
|
}
|
|
976
|
-
u.internalOptions[
|
|
974
|
+
u.internalOptions[O] = w[O];
|
|
977
975
|
}
|
|
978
976
|
return u.outsideClick = null, u.focusTrapElements = m.containerElements || [], u.updatePreviousElement(), u;
|
|
979
977
|
}
|
|
980
|
-
return
|
|
978
|
+
return D(f, d), l(f, [{
|
|
981
979
|
key: "getDocument",
|
|
982
980
|
value: function() {
|
|
983
981
|
return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
|
|
@@ -1018,11 +1016,11 @@ function rt() {
|
|
|
1018
1016
|
}, {
|
|
1019
1017
|
key: "handleClickOutsideDeactivates",
|
|
1020
1018
|
value: function(u) {
|
|
1021
|
-
var
|
|
1022
|
-
return
|
|
1019
|
+
var w = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, u) : this.originalOptions.clickOutsideDeactivates;
|
|
1020
|
+
return w && (this.outsideClick = {
|
|
1023
1021
|
target: u.target,
|
|
1024
|
-
allowDeactivation:
|
|
1025
|
-
}),
|
|
1022
|
+
allowDeactivation: w
|
|
1023
|
+
}), w;
|
|
1026
1024
|
}
|
|
1027
1025
|
}, {
|
|
1028
1026
|
key: "handleDeactivate",
|
|
@@ -1032,8 +1030,8 @@ function rt() {
|
|
|
1032
1030
|
}, {
|
|
1033
1031
|
key: "handlePostDeactivate",
|
|
1034
1032
|
value: function() {
|
|
1035
|
-
var u = this,
|
|
1036
|
-
var b = u.getReturnFocusNode(),
|
|
1033
|
+
var u = this, w = function() {
|
|
1034
|
+
var b = u.getReturnFocusNode(), n = !!// did the consumer allow it?
|
|
1037
1035
|
(u.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
|
|
1038
1036
|
b !== null && b !== void 0 && b.focus && // was there an outside click that allowed deactivation?
|
|
1039
1037
|
(!u.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
|
|
@@ -1041,11 +1039,11 @@ function rt() {
|
|
|
1041
1039
|
// as a result of the click-through) -- in which case do NOT restore focus
|
|
1042
1040
|
// to `returnFocusNode` because focus should remain on the outside node
|
|
1043
1041
|
!z(u.outsideClick.target, u.internalOptions.tabbableOptions))), r = u.internalOptions.preventScroll, c = r === void 0 ? !1 : r;
|
|
1044
|
-
|
|
1042
|
+
n && b.focus({
|
|
1045
1043
|
preventScroll: c
|
|
1046
1044
|
}), u.originalOptions.onPostDeactivate && u.originalOptions.onPostDeactivate.call(null), u.outsideClick = null;
|
|
1047
1045
|
};
|
|
1048
|
-
this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(
|
|
1046
|
+
this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(w, w) : w();
|
|
1049
1047
|
}
|
|
1050
1048
|
}, {
|
|
1051
1049
|
key: "setupFocusTrap",
|
|
@@ -1067,12 +1065,12 @@ function rt() {
|
|
|
1067
1065
|
value: function(u) {
|
|
1068
1066
|
if (this.focusTrap) {
|
|
1069
1067
|
u.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
|
|
1070
|
-
var
|
|
1071
|
-
if (
|
|
1068
|
+
var w = !u.active && this.props.active, O = u.active && !this.props.active, b = !u.paused && this.props.paused, n = u.paused && !this.props.paused;
|
|
1069
|
+
if (w && (this.updatePreviousElement(), this.focusTrap.activate()), O) {
|
|
1072
1070
|
this.deactivateTrap();
|
|
1073
1071
|
return;
|
|
1074
1072
|
}
|
|
1075
|
-
b && this.focusTrap.pause(),
|
|
1073
|
+
b && this.focusTrap.pause(), n && this.focusTrap.unpause();
|
|
1076
1074
|
} else
|
|
1077
1075
|
u.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
|
|
1078
1076
|
}
|
|
@@ -1084,28 +1082,28 @@ function rt() {
|
|
|
1084
1082
|
}, {
|
|
1085
1083
|
key: "render",
|
|
1086
1084
|
value: function() {
|
|
1087
|
-
var u = this,
|
|
1088
|
-
if (
|
|
1089
|
-
if (
|
|
1085
|
+
var u = this, w = this.props.children ? j.Children.only(this.props.children) : void 0;
|
|
1086
|
+
if (w) {
|
|
1087
|
+
if (w.type && w.type === j.Fragment)
|
|
1090
1088
|
throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
|
|
1091
|
-
var
|
|
1089
|
+
var O = function(r) {
|
|
1092
1090
|
var c = u.props.containerElements;
|
|
1093
|
-
|
|
1094
|
-
}, b =
|
|
1095
|
-
ref:
|
|
1091
|
+
w && (H >= 19 ? typeof w.props.ref == "function" ? w.props.ref(r) : w.props.ref && (w.props.ref.current = r) : typeof w.ref == "function" ? w.ref(r) : w.ref && (w.ref.current = r)), u.focusTrapElements = c || [r];
|
|
1092
|
+
}, b = j.cloneElement(w, {
|
|
1093
|
+
ref: O
|
|
1096
1094
|
});
|
|
1097
1095
|
return b;
|
|
1098
1096
|
}
|
|
1099
1097
|
return null;
|
|
1100
1098
|
}
|
|
1101
1099
|
}]);
|
|
1102
|
-
})(
|
|
1103
|
-
return
|
|
1100
|
+
})(j.Component);
|
|
1101
|
+
return $.defaultProps = {
|
|
1104
1102
|
active: !0,
|
|
1105
1103
|
paused: !1,
|
|
1106
1104
|
focusTrapOptions: {},
|
|
1107
1105
|
_createFocusTrap: W
|
|
1108
|
-
},
|
|
1106
|
+
}, Y.exports = $, Y.exports.FocusTrap = $, Y.exports;
|
|
1109
1107
|
}
|
|
1110
1108
|
var it = rt();
|
|
1111
1109
|
export {
|