@kakadu/components 4.0.5 → 4.0.6
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/_commonjsHelpers-DGT2Y9Xa.js +1 -0
- package/build/_commonjsHelpers-MdHo5S7N.mjs +26 -0
- package/build/components/combobox.js +1 -1
- package/build/components/combobox.mjs +134 -140
- 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/focus-trap-react-B7f3iC5h.js +9 -0
- package/build/{focus-trap-react-DATIi_Ob.mjs → focus-trap-react-Dr3BYLw6.mjs} +430 -453
- package/package.json +1 -1
- package/build/focus-trap-react-CkKg4ubd.js +0 -9
|
@@ -1,138 +1,117 @@
|
|
|
1
1
|
import Ee from "react";
|
|
2
|
-
|
|
3
|
-
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
4
|
-
}
|
|
5
|
-
function pe(r) {
|
|
6
|
-
if (Object.prototype.hasOwnProperty.call(r, "__esModule")) return r;
|
|
7
|
-
var e = r.default;
|
|
8
|
-
if (typeof e == "function") {
|
|
9
|
-
var t = function n() {
|
|
10
|
-
return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
t.prototype = e.prototype;
|
|
13
|
-
} else t = {};
|
|
14
|
-
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(n) {
|
|
15
|
-
var u = Object.getOwnPropertyDescriptor(r, n);
|
|
16
|
-
Object.defineProperty(t, n, u.get ? u : {
|
|
17
|
-
enumerable: !0,
|
|
18
|
-
get: function() {
|
|
19
|
-
return r[n];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}), t;
|
|
23
|
-
}
|
|
2
|
+
import { g as be } from "./_commonjsHelpers-MdHo5S7N.mjs";
|
|
24
3
|
var H = { exports: {} };
|
|
25
4
|
/*!
|
|
26
5
|
* tabbable 6.4.0
|
|
27
6
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
28
7
|
*/
|
|
29
|
-
var
|
|
30
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Q = !he && Element.prototype.getRootNode ? function(
|
|
8
|
+
var pe = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[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(n) {
|
|
31
10
|
var e;
|
|
32
|
-
return
|
|
33
|
-
} : function(
|
|
34
|
-
return
|
|
11
|
+
return n == null || (e = n.getRootNode) === null || e === void 0 ? void 0 : e.call(n);
|
|
12
|
+
} : function(n) {
|
|
13
|
+
return n == null ? void 0 : n.ownerDocument;
|
|
35
14
|
}, ee = function(e, t) {
|
|
36
|
-
var
|
|
15
|
+
var o;
|
|
37
16
|
t === void 0 && (t = !0);
|
|
38
|
-
var
|
|
17
|
+
var s = e == null || (o = e.getAttribute) === null || o === void 0 ? void 0 : o.call(e, "inert"), l = s === "" || s === "true", a = l || t && e && // closest does not exist on shadow roots, so we fall back to a manual
|
|
39
18
|
// lookup upward, in case it is not defined.
|
|
40
19
|
(typeof e.closest == "function" ? e.closest("[inert]") : ee(e.parentNode));
|
|
41
|
-
return
|
|
42
|
-
},
|
|
43
|
-
var t,
|
|
44
|
-
return
|
|
45
|
-
}, ye = function(e, t,
|
|
20
|
+
return a;
|
|
21
|
+
}, Oe = function(e) {
|
|
22
|
+
var t, o = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
23
|
+
return o === "" || o === "true";
|
|
24
|
+
}, ye = function(e, t, o) {
|
|
46
25
|
if (ee(e))
|
|
47
26
|
return [];
|
|
48
|
-
var
|
|
49
|
-
return t && M.call(e, J) &&
|
|
50
|
-
}, te = function(e, t,
|
|
51
|
-
for (var
|
|
52
|
-
var
|
|
53
|
-
if (!ee(
|
|
54
|
-
if (
|
|
55
|
-
var y =
|
|
56
|
-
|
|
57
|
-
scopeParent:
|
|
27
|
+
var s = Array.prototype.slice.apply(e.querySelectorAll(J));
|
|
28
|
+
return t && M.call(e, J) && s.unshift(e), s = s.filter(o), s;
|
|
29
|
+
}, te = function(e, t, o) {
|
|
30
|
+
for (var s = [], l = Array.from(e); l.length; ) {
|
|
31
|
+
var a = l.shift();
|
|
32
|
+
if (!ee(a, !1))
|
|
33
|
+
if (a.tagName === "SLOT") {
|
|
34
|
+
var y = a.assignedElements(), w = y.length ? y : a.children, E = te(w, !0, o);
|
|
35
|
+
o.flatten ? s.push.apply(s, E) : s.push({
|
|
36
|
+
scopeParent: a,
|
|
58
37
|
candidates: E
|
|
59
38
|
});
|
|
60
39
|
} else {
|
|
61
|
-
var k = M.call(
|
|
62
|
-
k &&
|
|
63
|
-
var D =
|
|
64
|
-
typeof
|
|
65
|
-
if (D &&
|
|
66
|
-
var j = te(D === !0 ?
|
|
67
|
-
|
|
68
|
-
scopeParent:
|
|
40
|
+
var k = M.call(a, J);
|
|
41
|
+
k && o.filter(a) && (t || !e.includes(a)) && s.push(a);
|
|
42
|
+
var D = a.shadowRoot || // check for an undisclosed shadow
|
|
43
|
+
typeof o.getShadowRoot == "function" && o.getShadowRoot(a), R = !ee(D, !1) && (!o.shadowRootFilter || o.shadowRootFilter(a));
|
|
44
|
+
if (D && R) {
|
|
45
|
+
var j = te(D === !0 ? a.children : D.children, !0, o);
|
|
46
|
+
o.flatten ? s.push.apply(s, j) : s.push({
|
|
47
|
+
scopeParent: a,
|
|
69
48
|
candidates: j
|
|
70
49
|
});
|
|
71
50
|
} else
|
|
72
|
-
l.unshift.apply(l,
|
|
51
|
+
l.unshift.apply(l, a.children);
|
|
73
52
|
}
|
|
74
53
|
}
|
|
75
|
-
return
|
|
54
|
+
return s;
|
|
76
55
|
}, me = function(e) {
|
|
77
56
|
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
78
57
|
}, L = function(e) {
|
|
79
58
|
if (!e)
|
|
80
59
|
throw new Error("No node provided");
|
|
81
|
-
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) ||
|
|
60
|
+
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Oe(e)) && !me(e) ? 0 : e.tabIndex;
|
|
82
61
|
}, ke = function(e, t) {
|
|
83
|
-
var
|
|
84
|
-
return
|
|
62
|
+
var o = L(e);
|
|
63
|
+
return o < 0 && t && !me(e) ? 0 : o;
|
|
85
64
|
}, De = function(e, t) {
|
|
86
65
|
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
87
66
|
}, ge = function(e) {
|
|
88
67
|
return e.tagName === "INPUT";
|
|
89
68
|
}, Ne = function(e) {
|
|
90
69
|
return ge(e) && e.type === "hidden";
|
|
91
|
-
},
|
|
92
|
-
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(
|
|
93
|
-
return
|
|
70
|
+
}, Re = function(e) {
|
|
71
|
+
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(o) {
|
|
72
|
+
return o.tagName === "SUMMARY";
|
|
94
73
|
});
|
|
95
74
|
return t;
|
|
96
|
-
},
|
|
97
|
-
for (var
|
|
98
|
-
if (e[
|
|
99
|
-
return e[
|
|
75
|
+
}, Pe = function(e, t) {
|
|
76
|
+
for (var o = 0; o < e.length; o++)
|
|
77
|
+
if (e[o].checked && e[o].form === t)
|
|
78
|
+
return e[o];
|
|
100
79
|
}, Ce = function(e) {
|
|
101
80
|
if (!e.name)
|
|
102
81
|
return !0;
|
|
103
|
-
var t = e.form || Q(e),
|
|
82
|
+
var t = e.form || Q(e), o = function(y) {
|
|
104
83
|
return t.querySelectorAll('input[type="radio"][name="' + y + '"]');
|
|
105
|
-
},
|
|
84
|
+
}, s;
|
|
106
85
|
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
107
|
-
|
|
86
|
+
s = o(window.CSS.escape(e.name));
|
|
108
87
|
else
|
|
109
88
|
try {
|
|
110
|
-
|
|
111
|
-
} catch (
|
|
112
|
-
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",
|
|
89
|
+
s = o(e.name);
|
|
90
|
+
} catch (a) {
|
|
91
|
+
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", a.message), !1;
|
|
113
92
|
}
|
|
114
|
-
var l =
|
|
93
|
+
var l = Pe(s, e.form);
|
|
115
94
|
return !l || l === e;
|
|
116
95
|
}, Ae = function(e) {
|
|
117
96
|
return ge(e) && e.type === "radio";
|
|
118
97
|
}, Ie = function(e) {
|
|
119
98
|
return Ae(e) && !Ce(e);
|
|
120
99
|
}, je = function(e) {
|
|
121
|
-
var t,
|
|
122
|
-
if (
|
|
123
|
-
var
|
|
124
|
-
for (l = !!((
|
|
100
|
+
var t, o = e && Q(e), s = (t = o) === null || t === void 0 ? void 0 : t.host, l = !1;
|
|
101
|
+
if (o && o !== e) {
|
|
102
|
+
var a, y, w;
|
|
103
|
+
for (l = !!((a = s) !== null && a !== void 0 && (y = a.ownerDocument) !== null && y !== void 0 && y.contains(s) || e != null && (w = e.ownerDocument) !== null && w !== void 0 && w.contains(e)); !l && s; ) {
|
|
125
104
|
var E, k, D;
|
|
126
|
-
|
|
105
|
+
o = Q(s), s = (E = o) === null || E === void 0 ? void 0 : E.host, l = !!((k = s) !== null && k !== void 0 && (D = k.ownerDocument) !== null && D !== void 0 && D.contains(s));
|
|
127
106
|
}
|
|
128
107
|
}
|
|
129
108
|
return l;
|
|
130
109
|
}, se = function(e) {
|
|
131
|
-
var t = e.getBoundingClientRect(),
|
|
132
|
-
return
|
|
110
|
+
var t = e.getBoundingClientRect(), o = t.width, s = t.height;
|
|
111
|
+
return o === 0 && s === 0;
|
|
133
112
|
}, _e = function(e, t) {
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
113
|
+
var o = t.displayCheck, s = t.getShadowRoot;
|
|
114
|
+
if (o === "full-native" && "checkVisibility" in e) {
|
|
136
115
|
var l = e.checkVisibility({
|
|
137
116
|
// Checking opacity might be desirable for some use cases, but natively,
|
|
138
117
|
// opacity zero elements _are_ focusable and tabbable.
|
|
@@ -150,16 +129,16 @@ var be = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
150
129
|
}
|
|
151
130
|
if (getComputedStyle(e).visibility === "hidden")
|
|
152
131
|
return !0;
|
|
153
|
-
var
|
|
132
|
+
var a = M.call(e, "details>summary:first-of-type"), y = a ? e.parentElement : e;
|
|
154
133
|
if (M.call(y, "details:not([open]) *"))
|
|
155
134
|
return !0;
|
|
156
|
-
if (!
|
|
135
|
+
if (!o || o === "full" || // full-native can run this branch when it falls through in case
|
|
157
136
|
// Element#checkVisibility is unsupported
|
|
158
|
-
|
|
159
|
-
if (typeof
|
|
137
|
+
o === "full-native" || o === "legacy-full") {
|
|
138
|
+
if (typeof s == "function") {
|
|
160
139
|
for (var w = e; e; ) {
|
|
161
140
|
var E = e.parentElement, k = Q(e);
|
|
162
|
-
if (E && !E.shadowRoot &&
|
|
141
|
+
if (E && !E.shadowRoot && s(E) === !0)
|
|
163
142
|
return se(e);
|
|
164
143
|
e.assignedSlot ? e = e.assignedSlot : !E && k !== e.ownerDocument ? e = k.host : e = E;
|
|
165
144
|
}
|
|
@@ -167,19 +146,19 @@ var be = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
167
146
|
}
|
|
168
147
|
if (je(e))
|
|
169
148
|
return !e.getClientRects().length;
|
|
170
|
-
if (
|
|
149
|
+
if (o !== "legacy-full")
|
|
171
150
|
return !0;
|
|
172
|
-
} else if (
|
|
151
|
+
} else if (o === "non-zero-area")
|
|
173
152
|
return se(e);
|
|
174
153
|
return !1;
|
|
175
154
|
}, xe = function(e) {
|
|
176
155
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
|
|
177
156
|
for (var t = e.parentElement; t; ) {
|
|
178
157
|
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
179
|
-
for (var
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
182
|
-
return M.call(t, "fieldset[disabled] *") ? !0 : !
|
|
158
|
+
for (var o = 0; o < t.children.length; o++) {
|
|
159
|
+
var s = t.children.item(o);
|
|
160
|
+
if (s.tagName === "LEGEND")
|
|
161
|
+
return M.call(t, "fieldset[disabled] *") ? !0 : !s.contains(e);
|
|
183
162
|
}
|
|
184
163
|
return !0;
|
|
185
164
|
}
|
|
@@ -188,55 +167,55 @@ var be = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
188
167
|
return !1;
|
|
189
168
|
}, re = function(e, t) {
|
|
190
169
|
return !(t.disabled || Ne(t) || _e(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
191
|
-
|
|
170
|
+
Re(t) || xe(t));
|
|
192
171
|
}, oe = function(e, t) {
|
|
193
172
|
return !(Ie(t) || L(t) < 0 || !re(e, t));
|
|
194
173
|
}, Le = function(e) {
|
|
195
174
|
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
196
175
|
return !!(isNaN(t) || t >= 0);
|
|
197
176
|
}, Te = function(e) {
|
|
198
|
-
var t = [],
|
|
199
|
-
return e.forEach(function(
|
|
200
|
-
var
|
|
201
|
-
w === 0 ?
|
|
177
|
+
var t = [], o = [];
|
|
178
|
+
return e.forEach(function(s, l) {
|
|
179
|
+
var a = !!s.scopeParent, y = a ? s.scopeParent : s, w = ke(y, a), E = a ? Te(s.candidates) : y;
|
|
180
|
+
w === 0 ? a ? t.push.apply(t, E) : t.push(y) : o.push({
|
|
202
181
|
documentOrder: l,
|
|
203
182
|
tabIndex: w,
|
|
204
|
-
item:
|
|
205
|
-
isScope:
|
|
183
|
+
item: s,
|
|
184
|
+
isScope: a,
|
|
206
185
|
content: E
|
|
207
186
|
});
|
|
208
|
-
}),
|
|
209
|
-
return l.isScope ?
|
|
187
|
+
}), o.sort(De).reduce(function(s, l) {
|
|
188
|
+
return l.isScope ? s.push.apply(s, l.content) : s.push(l.content), s;
|
|
210
189
|
}, []).concat(t);
|
|
211
190
|
}, we = function(e, t) {
|
|
212
191
|
t = t || {};
|
|
213
|
-
var
|
|
214
|
-
return t.getShadowRoot ?
|
|
192
|
+
var o;
|
|
193
|
+
return t.getShadowRoot ? o = te([e], t.includeContainer, {
|
|
215
194
|
filter: oe.bind(null, t),
|
|
216
195
|
flatten: !1,
|
|
217
196
|
getShadowRoot: t.getShadowRoot,
|
|
218
197
|
shadowRootFilter: Le
|
|
219
|
-
}) :
|
|
220
|
-
},
|
|
198
|
+
}) : o = ye(e, t.includeContainer, oe.bind(null, t)), Te(o);
|
|
199
|
+
}, Se = function(e, t) {
|
|
221
200
|
t = t || {};
|
|
222
|
-
var
|
|
223
|
-
return t.getShadowRoot ?
|
|
201
|
+
var o;
|
|
202
|
+
return t.getShadowRoot ? o = te([e], t.includeContainer, {
|
|
224
203
|
filter: re.bind(null, t),
|
|
225
204
|
flatten: !0,
|
|
226
205
|
getShadowRoot: t.getShadowRoot
|
|
227
|
-
}) :
|
|
206
|
+
}) : o = ye(e, t.includeContainer, re.bind(null, t)), o;
|
|
228
207
|
}, K = function(e, t) {
|
|
229
208
|
if (t = t || {}, !e)
|
|
230
209
|
throw new Error("No node provided");
|
|
231
210
|
return M.call(e, J) === !1 ? !1 : oe(t, e);
|
|
232
|
-
}, Be = /* @__PURE__ */
|
|
211
|
+
}, Be = /* @__PURE__ */ pe.concat("iframe:not([inert]):not([inert] *)").join(","), X = function(e, t) {
|
|
233
212
|
if (t = t || {}, !e)
|
|
234
213
|
throw new Error("No node provided");
|
|
235
214
|
return M.call(e, Be) === !1 ? !1 : re(t, e);
|
|
236
215
|
};
|
|
237
216
|
const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
238
217
|
__proto__: null,
|
|
239
|
-
focusable:
|
|
218
|
+
focusable: Se,
|
|
240
219
|
getTabIndex: L,
|
|
241
220
|
isFocusable: X,
|
|
242
221
|
isTabbable: K,
|
|
@@ -246,119 +225,119 @@ const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
246
225
|
* focus-trap 7.8.0
|
|
247
226
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
248
227
|
*/
|
|
249
|
-
function ue(
|
|
250
|
-
(e == null || e >
|
|
251
|
-
for (var t = 0,
|
|
252
|
-
return
|
|
228
|
+
function ue(n, e) {
|
|
229
|
+
(e == null || e > n.length) && (e = n.length);
|
|
230
|
+
for (var t = 0, o = Array(e); t < e; t++) o[t] = n[t];
|
|
231
|
+
return o;
|
|
253
232
|
}
|
|
254
|
-
function Me(
|
|
255
|
-
if (Array.isArray(
|
|
233
|
+
function Me(n) {
|
|
234
|
+
if (Array.isArray(n)) return ue(n);
|
|
256
235
|
}
|
|
257
|
-
function ce(
|
|
258
|
-
var t = typeof Symbol < "u" &&
|
|
236
|
+
function ce(n, e) {
|
|
237
|
+
var t = typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
|
|
259
238
|
if (!t) {
|
|
260
|
-
if (Array.isArray(
|
|
261
|
-
t && (
|
|
262
|
-
var
|
|
239
|
+
if (Array.isArray(n) || (t = Fe(n)) || e) {
|
|
240
|
+
t && (n = t);
|
|
241
|
+
var o = 0, s = function() {
|
|
263
242
|
};
|
|
264
243
|
return {
|
|
265
|
-
s
|
|
244
|
+
s,
|
|
266
245
|
n: function() {
|
|
267
|
-
return
|
|
246
|
+
return o >= n.length ? {
|
|
268
247
|
done: !0
|
|
269
248
|
} : {
|
|
270
249
|
done: !1,
|
|
271
|
-
value:
|
|
250
|
+
value: n[o++]
|
|
272
251
|
};
|
|
273
252
|
},
|
|
274
253
|
e: function(w) {
|
|
275
254
|
throw w;
|
|
276
255
|
},
|
|
277
|
-
f:
|
|
256
|
+
f: s
|
|
278
257
|
};
|
|
279
258
|
}
|
|
280
259
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
281
260
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
282
261
|
}
|
|
283
|
-
var l,
|
|
262
|
+
var l, a = !0, y = !1;
|
|
284
263
|
return {
|
|
285
264
|
s: function() {
|
|
286
|
-
t = t.call(
|
|
265
|
+
t = t.call(n);
|
|
287
266
|
},
|
|
288
267
|
n: function() {
|
|
289
268
|
var w = t.next();
|
|
290
|
-
return
|
|
269
|
+
return a = w.done, w;
|
|
291
270
|
},
|
|
292
271
|
e: function(w) {
|
|
293
272
|
y = !0, l = w;
|
|
294
273
|
},
|
|
295
274
|
f: function() {
|
|
296
275
|
try {
|
|
297
|
-
|
|
276
|
+
a || t.return == null || t.return();
|
|
298
277
|
} finally {
|
|
299
278
|
if (y) throw l;
|
|
300
279
|
}
|
|
301
280
|
}
|
|
302
281
|
};
|
|
303
282
|
}
|
|
304
|
-
function qe(
|
|
305
|
-
return (e = We(e)) in
|
|
283
|
+
function qe(n, e, t) {
|
|
284
|
+
return (e = We(e)) in n ? Object.defineProperty(n, e, {
|
|
306
285
|
value: t,
|
|
307
286
|
enumerable: !0,
|
|
308
287
|
configurable: !0,
|
|
309
288
|
writable: !0
|
|
310
|
-
}) :
|
|
289
|
+
}) : n[e] = t, n;
|
|
311
290
|
}
|
|
312
|
-
function Ve(
|
|
313
|
-
if (typeof Symbol < "u" &&
|
|
291
|
+
function Ve(n) {
|
|
292
|
+
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n);
|
|
314
293
|
}
|
|
315
294
|
function Ge() {
|
|
316
295
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
317
296
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
318
297
|
}
|
|
319
|
-
function le(
|
|
320
|
-
var t = Object.keys(
|
|
298
|
+
function le(n, e) {
|
|
299
|
+
var t = Object.keys(n);
|
|
321
300
|
if (Object.getOwnPropertySymbols) {
|
|
322
|
-
var
|
|
323
|
-
e && (
|
|
324
|
-
return Object.getOwnPropertyDescriptor(
|
|
325
|
-
})), t.push.apply(t,
|
|
301
|
+
var o = Object.getOwnPropertySymbols(n);
|
|
302
|
+
e && (o = o.filter(function(s) {
|
|
303
|
+
return Object.getOwnPropertyDescriptor(n, s).enumerable;
|
|
304
|
+
})), t.push.apply(t, o);
|
|
326
305
|
}
|
|
327
306
|
return t;
|
|
328
307
|
}
|
|
329
|
-
function fe(
|
|
308
|
+
function fe(n) {
|
|
330
309
|
for (var e = 1; e < arguments.length; e++) {
|
|
331
310
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
332
|
-
e % 2 ? le(Object(t), !0).forEach(function(
|
|
333
|
-
qe(
|
|
334
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
335
|
-
Object.defineProperty(
|
|
311
|
+
e % 2 ? le(Object(t), !0).forEach(function(o) {
|
|
312
|
+
qe(n, o, t[o]);
|
|
313
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : le(Object(t)).forEach(function(o) {
|
|
314
|
+
Object.defineProperty(n, o, Object.getOwnPropertyDescriptor(t, o));
|
|
336
315
|
});
|
|
337
316
|
}
|
|
338
|
-
return
|
|
317
|
+
return n;
|
|
339
318
|
}
|
|
340
|
-
function $e(
|
|
341
|
-
return Me(
|
|
319
|
+
function $e(n) {
|
|
320
|
+
return Me(n) || Ve(n) || Fe(n) || Ge();
|
|
342
321
|
}
|
|
343
|
-
function Ue(
|
|
344
|
-
if (typeof
|
|
345
|
-
var t =
|
|
322
|
+
function Ue(n, e) {
|
|
323
|
+
if (typeof n != "object" || !n) return n;
|
|
324
|
+
var t = n[Symbol.toPrimitive];
|
|
346
325
|
if (t !== void 0) {
|
|
347
|
-
var
|
|
348
|
-
if (typeof
|
|
326
|
+
var o = t.call(n, e);
|
|
327
|
+
if (typeof o != "object") return o;
|
|
349
328
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
350
329
|
}
|
|
351
|
-
return (e === "string" ? String : Number)(
|
|
330
|
+
return (e === "string" ? String : Number)(n);
|
|
352
331
|
}
|
|
353
|
-
function We(
|
|
354
|
-
var e = Ue(
|
|
332
|
+
function We(n) {
|
|
333
|
+
var e = Ue(n, "string");
|
|
355
334
|
return typeof e == "symbol" ? e : e + "";
|
|
356
335
|
}
|
|
357
|
-
function
|
|
358
|
-
if (
|
|
359
|
-
if (typeof
|
|
360
|
-
var t = {}.toString.call(
|
|
361
|
-
return t === "Object" &&
|
|
336
|
+
function Fe(n, e) {
|
|
337
|
+
if (n) {
|
|
338
|
+
if (typeof n == "string") return ue(n, e);
|
|
339
|
+
var t = {}.toString.call(n).slice(8, -1);
|
|
340
|
+
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ue(n, e) : void 0;
|
|
362
341
|
}
|
|
363
342
|
}
|
|
364
343
|
var I = {
|
|
@@ -368,15 +347,15 @@ var I = {
|
|
|
368
347
|
},
|
|
369
348
|
// Pauses the currently active trap, then adds a new trap to the stack.
|
|
370
349
|
activateTrap: function(e, t) {
|
|
371
|
-
var
|
|
372
|
-
t !==
|
|
373
|
-
var
|
|
374
|
-
|
|
350
|
+
var o = I.getActiveTrap(e);
|
|
351
|
+
t !== o && I.pauseTrap(e);
|
|
352
|
+
var s = e.indexOf(t);
|
|
353
|
+
s === -1 || e.splice(s, 1), e.push(t);
|
|
375
354
|
},
|
|
376
355
|
// Removes the trap from the top of the stack, then unpauses the next trap down.
|
|
377
356
|
deactivateTrap: function(e, t) {
|
|
378
|
-
var
|
|
379
|
-
|
|
357
|
+
var o = e.indexOf(t);
|
|
358
|
+
o !== -1 && e.splice(o, 1), I.unpauseTrap(e);
|
|
380
359
|
},
|
|
381
360
|
// Pauses the trap at the top of the stack.
|
|
382
361
|
pauseTrap: function(e) {
|
|
@@ -401,20 +380,20 @@ var I = {
|
|
|
401
380
|
}, de = function(e) {
|
|
402
381
|
return setTimeout(e, 0);
|
|
403
382
|
}, G = function(e) {
|
|
404
|
-
for (var t = arguments.length,
|
|
405
|
-
|
|
406
|
-
return typeof e == "function" ? e.apply(void 0,
|
|
383
|
+
for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
384
|
+
o[s - 1] = arguments[s];
|
|
385
|
+
return typeof e == "function" ? e.apply(void 0, o) : e;
|
|
407
386
|
}, Z = function(e) {
|
|
408
387
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
409
388
|
}, Xe = [], Je = function(e, t) {
|
|
410
|
-
var
|
|
389
|
+
var o = (t == null ? void 0 : t.document) || document, s = (t == null ? void 0 : t.trapStack) || Xe, l = fe({
|
|
411
390
|
returnFocusOnDeactivate: !0,
|
|
412
391
|
escapeDeactivates: !0,
|
|
413
392
|
delayInitialFocus: !0,
|
|
414
393
|
isolateSubtrees: !1,
|
|
415
394
|
isKeyForward: He,
|
|
416
395
|
isKeyBackward: Ze
|
|
417
|
-
}, t),
|
|
396
|
+
}, t), a = {
|
|
418
397
|
// containers given to createFocusTrap()
|
|
419
398
|
/** @type {Array<HTMLElement>} */
|
|
420
399
|
containers: [],
|
|
@@ -458,74 +437,74 @@ var I = {
|
|
|
458
437
|
delayInitialFocusTimer: void 0,
|
|
459
438
|
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
460
439
|
recentNavEvent: void 0
|
|
461
|
-
}, y, w = function(
|
|
462
|
-
return
|
|
463
|
-
}, E = function(
|
|
464
|
-
var c = typeof (
|
|
465
|
-
return
|
|
466
|
-
var
|
|
467
|
-
return
|
|
440
|
+
}, y, w = function(i, r, c) {
|
|
441
|
+
return i && i[r] !== void 0 ? i[r] : l[c || r];
|
|
442
|
+
}, E = function(i, r) {
|
|
443
|
+
var c = typeof (r == null ? void 0 : r.composedPath) == "function" ? r.composedPath() : void 0;
|
|
444
|
+
return a.containerGroups.findIndex(function(h) {
|
|
445
|
+
var p = h.container, g = h.tabbableNodes;
|
|
446
|
+
return p.contains(i) || // fall back to explicit tabbable search which will take into consideration any
|
|
468
447
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
469
448
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
470
449
|
// look inside web components even if open)
|
|
471
|
-
(c == null ? void 0 : c.includes(
|
|
472
|
-
return v ===
|
|
450
|
+
(c == null ? void 0 : c.includes(p)) || g.find(function(v) {
|
|
451
|
+
return v === i;
|
|
473
452
|
});
|
|
474
453
|
});
|
|
475
|
-
}, k = function(
|
|
476
|
-
var
|
|
454
|
+
}, k = function(i) {
|
|
455
|
+
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[i];
|
|
477
456
|
if (typeof v == "function" && (v = v.apply(void 0, $e(g))), v === !0 && (v = void 0), !v) {
|
|
478
457
|
if (v === void 0 || v === !1)
|
|
479
458
|
return v;
|
|
480
|
-
throw new Error("`".concat(
|
|
459
|
+
throw new Error("`".concat(i, "` was specified but was not a node, or did not return a node"));
|
|
481
460
|
}
|
|
482
|
-
var
|
|
461
|
+
var S = v;
|
|
483
462
|
if (typeof v == "string") {
|
|
484
463
|
try {
|
|
485
|
-
|
|
486
|
-
} catch (
|
|
487
|
-
throw new Error("`".concat(
|
|
464
|
+
S = o.querySelector(v);
|
|
465
|
+
} catch (F) {
|
|
466
|
+
throw new Error("`".concat(i, '` appears to be an invalid selector; error="').concat(F.message, '"'));
|
|
488
467
|
}
|
|
489
|
-
if (!
|
|
490
|
-
throw new Error("`".concat(
|
|
468
|
+
if (!S && !h)
|
|
469
|
+
throw new Error("`".concat(i, "` as selector refers to no known node"));
|
|
491
470
|
}
|
|
492
|
-
return
|
|
471
|
+
return S;
|
|
493
472
|
}, D = function() {
|
|
494
|
-
var
|
|
473
|
+
var i = k("initialFocus", {
|
|
495
474
|
hasFallback: !0
|
|
496
475
|
});
|
|
497
|
-
if (
|
|
476
|
+
if (i === !1)
|
|
498
477
|
return !1;
|
|
499
|
-
if (
|
|
500
|
-
if (E(
|
|
501
|
-
|
|
478
|
+
if (i === void 0 || i && !X(i, l.tabbableOptions))
|
|
479
|
+
if (E(o.activeElement) >= 0)
|
|
480
|
+
i = o.activeElement;
|
|
502
481
|
else {
|
|
503
|
-
var
|
|
504
|
-
|
|
482
|
+
var r = a.tabbableGroups[0], c = r && r.firstTabbableNode;
|
|
483
|
+
i = c || k("fallbackFocus");
|
|
505
484
|
}
|
|
506
|
-
else
|
|
507
|
-
if (!
|
|
485
|
+
else i === null && (i = k("fallbackFocus"));
|
|
486
|
+
if (!i)
|
|
508
487
|
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
509
|
-
return
|
|
510
|
-
},
|
|
511
|
-
if (
|
|
512
|
-
var
|
|
513
|
-
return K(
|
|
514
|
-
}), v = c.slice().reverse().find(function(
|
|
515
|
-
return K(
|
|
516
|
-
}),
|
|
517
|
-
return L(
|
|
488
|
+
return i;
|
|
489
|
+
}, R = function() {
|
|
490
|
+
if (a.containerGroups = a.containers.map(function(i) {
|
|
491
|
+
var r = we(i, l.tabbableOptions), c = Se(i, 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) {
|
|
492
|
+
return K(F);
|
|
493
|
+
}), v = c.slice().reverse().find(function(F) {
|
|
494
|
+
return K(F);
|
|
495
|
+
}), S = !!r.find(function(F) {
|
|
496
|
+
return L(F) > 0;
|
|
518
497
|
});
|
|
519
498
|
return {
|
|
520
|
-
container:
|
|
521
|
-
tabbableNodes:
|
|
499
|
+
container: i,
|
|
500
|
+
tabbableNodes: r,
|
|
522
501
|
focusableNodes: c,
|
|
523
502
|
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
524
|
-
posTabIndexesFound:
|
|
503
|
+
posTabIndexesFound: S,
|
|
525
504
|
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
526
505
|
firstTabbableNode: h,
|
|
527
506
|
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
528
|
-
lastTabbableNode:
|
|
507
|
+
lastTabbableNode: p,
|
|
529
508
|
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
530
509
|
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
531
510
|
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
@@ -546,75 +525,75 @@ var I = {
|
|
|
546
525
|
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
547
526
|
*/
|
|
548
527
|
nextTabbableNode: function(N) {
|
|
549
|
-
var A = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, C =
|
|
528
|
+
var A = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, C = r.indexOf(N);
|
|
550
529
|
return C < 0 ? A ? c.slice(c.indexOf(N) + 1).find(function(B) {
|
|
551
530
|
return K(B);
|
|
552
531
|
}) : c.slice(0, c.indexOf(N)).reverse().find(function(B) {
|
|
553
532
|
return K(B);
|
|
554
|
-
}) :
|
|
533
|
+
}) : r[C + (A ? 1 : -1)];
|
|
555
534
|
}
|
|
556
535
|
};
|
|
557
|
-
}),
|
|
558
|
-
return
|
|
559
|
-
}),
|
|
536
|
+
}), a.tabbableGroups = a.containerGroups.filter(function(i) {
|
|
537
|
+
return i.tabbableNodes.length > 0;
|
|
538
|
+
}), a.tabbableGroups.length <= 0 && !k("fallbackFocus"))
|
|
560
539
|
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
561
|
-
if (
|
|
562
|
-
return
|
|
563
|
-
}) &&
|
|
540
|
+
if (a.containerGroups.find(function(i) {
|
|
541
|
+
return i.posTabIndexesFound;
|
|
542
|
+
}) && a.containerGroups.length > 1)
|
|
564
543
|
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.");
|
|
565
|
-
}, j = function(
|
|
566
|
-
var
|
|
567
|
-
if (
|
|
568
|
-
return
|
|
569
|
-
},
|
|
570
|
-
if (
|
|
571
|
-
if (!
|
|
572
|
-
|
|
544
|
+
}, j = function(i) {
|
|
545
|
+
var r = i.activeElement;
|
|
546
|
+
if (r)
|
|
547
|
+
return r.shadowRoot && r.shadowRoot.activeElement !== null ? j(r.shadowRoot) : r;
|
|
548
|
+
}, P = function(i) {
|
|
549
|
+
if (i !== !1 && i !== j(document)) {
|
|
550
|
+
if (!i || !i.focus) {
|
|
551
|
+
P(D());
|
|
573
552
|
return;
|
|
574
553
|
}
|
|
575
|
-
|
|
554
|
+
i.focus({
|
|
576
555
|
preventScroll: !!l.preventScroll
|
|
577
|
-
}),
|
|
556
|
+
}), a.mostRecentlyFocusedNode = i, ze(i) && i.select();
|
|
578
557
|
}
|
|
579
|
-
}, U = function(
|
|
580
|
-
var
|
|
581
|
-
params: [
|
|
558
|
+
}, U = function(i) {
|
|
559
|
+
var r = k("setReturnFocus", {
|
|
560
|
+
params: [i]
|
|
582
561
|
});
|
|
583
|
-
return
|
|
584
|
-
}, _ = function(
|
|
585
|
-
var
|
|
586
|
-
|
|
562
|
+
return r || (r === !1 ? !1 : i);
|
|
563
|
+
}, _ = function(i) {
|
|
564
|
+
var r = i.target, c = i.event, h = i.isBackward, p = h === void 0 ? !1 : h;
|
|
565
|
+
r = r || Z(c), R();
|
|
587
566
|
var g = null;
|
|
588
|
-
if (
|
|
589
|
-
var v = E(
|
|
567
|
+
if (a.tabbableGroups.length > 0) {
|
|
568
|
+
var v = E(r, c), S = v >= 0 ? a.containerGroups[v] : void 0;
|
|
590
569
|
if (v < 0)
|
|
591
|
-
|
|
592
|
-
else if (
|
|
593
|
-
var
|
|
570
|
+
p ? g = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : g = a.tabbableGroups[0].firstTabbableNode;
|
|
571
|
+
else if (p) {
|
|
572
|
+
var F = a.tabbableGroups.findIndex(function(ne) {
|
|
594
573
|
var ie = ne.firstTabbableNode;
|
|
595
|
-
return
|
|
574
|
+
return r === ie;
|
|
596
575
|
});
|
|
597
|
-
if (
|
|
598
|
-
var N =
|
|
599
|
-
g = L(
|
|
600
|
-
} else $(c) || (g =
|
|
576
|
+
if (F < 0 && (S.container === r || X(r, l.tabbableOptions) && !K(r, l.tabbableOptions) && !S.nextTabbableNode(r, !1)) && (F = v), F >= 0) {
|
|
577
|
+
var N = F === 0 ? a.tabbableGroups.length - 1 : F - 1, A = a.tabbableGroups[N];
|
|
578
|
+
g = L(r) >= 0 ? A.lastTabbableNode : A.lastDomTabbableNode;
|
|
579
|
+
} else $(c) || (g = S.nextTabbableNode(r, !1));
|
|
601
580
|
} else {
|
|
602
|
-
var C =
|
|
581
|
+
var C = a.tabbableGroups.findIndex(function(ne) {
|
|
603
582
|
var ie = ne.lastTabbableNode;
|
|
604
|
-
return
|
|
583
|
+
return r === ie;
|
|
605
584
|
});
|
|
606
|
-
if (C < 0 && (
|
|
607
|
-
var B = C ===
|
|
608
|
-
g = L(
|
|
609
|
-
} else $(c) || (g =
|
|
585
|
+
if (C < 0 && (S.container === r || X(r, l.tabbableOptions) && !K(r, l.tabbableOptions) && !S.nextTabbableNode(r)) && (C = v), C >= 0) {
|
|
586
|
+
var B = C === a.tabbableGroups.length - 1 ? 0 : C + 1, x = a.tabbableGroups[B];
|
|
587
|
+
g = L(r) >= 0 ? x.firstTabbableNode : x.firstDomTabbableNode;
|
|
588
|
+
} else $(c) || (g = S.nextTabbableNode(r));
|
|
610
589
|
}
|
|
611
590
|
} else
|
|
612
591
|
g = k("fallbackFocus");
|
|
613
592
|
return g;
|
|
614
|
-
}, q = function(
|
|
615
|
-
var
|
|
616
|
-
if (!(E(
|
|
617
|
-
if (G(l.clickOutsideDeactivates,
|
|
593
|
+
}, q = function(i) {
|
|
594
|
+
var r = Z(i);
|
|
595
|
+
if (!(E(r, i) >= 0)) {
|
|
596
|
+
if (G(l.clickOutsideDeactivates, i)) {
|
|
618
597
|
y.deactivate({
|
|
619
598
|
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
620
599
|
// which will result in the outside click setting focus to the node
|
|
@@ -626,83 +605,83 @@ var I = {
|
|
|
626
605
|
});
|
|
627
606
|
return;
|
|
628
607
|
}
|
|
629
|
-
G(l.allowOutsideClick,
|
|
608
|
+
G(l.allowOutsideClick, i) || i.preventDefault();
|
|
630
609
|
}
|
|
631
|
-
}, W = function(
|
|
632
|
-
var
|
|
633
|
-
if (c ||
|
|
634
|
-
c && (
|
|
610
|
+
}, W = function(i) {
|
|
611
|
+
var r = Z(i), c = E(r, i) >= 0;
|
|
612
|
+
if (c || r instanceof Document)
|
|
613
|
+
c && (a.mostRecentlyFocusedNode = r);
|
|
635
614
|
else {
|
|
636
|
-
|
|
637
|
-
var h,
|
|
638
|
-
if (
|
|
639
|
-
if (L(
|
|
640
|
-
var g = E(
|
|
615
|
+
i.stopImmediatePropagation();
|
|
616
|
+
var h, p = !0;
|
|
617
|
+
if (a.mostRecentlyFocusedNode)
|
|
618
|
+
if (L(a.mostRecentlyFocusedNode) > 0) {
|
|
619
|
+
var g = E(a.mostRecentlyFocusedNode), v = a.containerGroups[g].tabbableNodes;
|
|
641
620
|
if (v.length > 0) {
|
|
642
|
-
var
|
|
643
|
-
return
|
|
621
|
+
var S = v.findIndex(function(F) {
|
|
622
|
+
return F === a.mostRecentlyFocusedNode;
|
|
644
623
|
});
|
|
645
|
-
|
|
624
|
+
S >= 0 && (l.isKeyForward(a.recentNavEvent) ? S + 1 < v.length && (h = v[S + 1], p = !1) : S - 1 >= 0 && (h = v[S - 1], p = !1));
|
|
646
625
|
}
|
|
647
626
|
} else
|
|
648
|
-
|
|
649
|
-
return
|
|
627
|
+
a.containerGroups.some(function(F) {
|
|
628
|
+
return F.tabbableNodes.some(function(N) {
|
|
650
629
|
return L(N) > 0;
|
|
651
630
|
});
|
|
652
|
-
}) || (
|
|
631
|
+
}) || (p = !1);
|
|
653
632
|
else
|
|
654
|
-
|
|
655
|
-
|
|
633
|
+
p = !1;
|
|
634
|
+
p && (h = _({
|
|
656
635
|
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
657
636
|
// outside the trap causing the focus escape we're trying to fix)
|
|
658
|
-
target:
|
|
659
|
-
isBackward: l.isKeyBackward(
|
|
660
|
-
})),
|
|
637
|
+
target: a.mostRecentlyFocusedNode,
|
|
638
|
+
isBackward: l.isKeyBackward(a.recentNavEvent)
|
|
639
|
+
})), P(h || a.mostRecentlyFocusedNode || D());
|
|
661
640
|
}
|
|
662
|
-
|
|
663
|
-
}, ae = function(
|
|
664
|
-
var
|
|
665
|
-
|
|
641
|
+
a.recentNavEvent = void 0;
|
|
642
|
+
}, ae = function(i) {
|
|
643
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
644
|
+
a.recentNavEvent = i;
|
|
666
645
|
var c = _({
|
|
667
|
-
event:
|
|
668
|
-
isBackward:
|
|
646
|
+
event: i,
|
|
647
|
+
isBackward: r
|
|
669
648
|
});
|
|
670
|
-
c && ($(
|
|
671
|
-
}, z = function(
|
|
672
|
-
(l.isKeyForward(
|
|
673
|
-
}, Y = function(
|
|
674
|
-
Ye(
|
|
675
|
-
}, V = function(
|
|
676
|
-
var
|
|
677
|
-
E(
|
|
649
|
+
c && ($(i) && i.preventDefault(), P(c));
|
|
650
|
+
}, z = function(i) {
|
|
651
|
+
(l.isKeyForward(i) || l.isKeyBackward(i)) && ae(i, l.isKeyBackward(i));
|
|
652
|
+
}, Y = function(i) {
|
|
653
|
+
Ye(i) && G(l.escapeDeactivates, i) !== !1 && (i.preventDefault(), y.deactivate());
|
|
654
|
+
}, V = function(i) {
|
|
655
|
+
var r = Z(i);
|
|
656
|
+
E(r, i) >= 0 || G(l.clickOutsideDeactivates, i) || G(l.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
678
657
|
}, d = function() {
|
|
679
|
-
if (
|
|
680
|
-
return I.activateTrap(
|
|
681
|
-
|
|
682
|
-
}) :
|
|
658
|
+
if (a.active)
|
|
659
|
+
return I.activateTrap(s, y), a.delayInitialFocusTimer = l.delayInitialFocus ? de(function() {
|
|
660
|
+
P(D());
|
|
661
|
+
}) : P(D()), o.addEventListener("focusin", W, !0), o.addEventListener("mousedown", q, {
|
|
683
662
|
capture: !0,
|
|
684
663
|
passive: !1
|
|
685
|
-
}),
|
|
664
|
+
}), o.addEventListener("touchstart", q, {
|
|
686
665
|
capture: !0,
|
|
687
666
|
passive: !1
|
|
688
|
-
}),
|
|
667
|
+
}), o.addEventListener("click", V, {
|
|
689
668
|
capture: !0,
|
|
690
669
|
passive: !1
|
|
691
|
-
}),
|
|
670
|
+
}), o.addEventListener("keydown", z, {
|
|
692
671
|
capture: !0,
|
|
693
672
|
passive: !1
|
|
694
|
-
}),
|
|
695
|
-
}, f = function(
|
|
696
|
-
|
|
697
|
-
var
|
|
673
|
+
}), o.addEventListener("keydown", Y), y;
|
|
674
|
+
}, f = function(i) {
|
|
675
|
+
a.active && !a.paused && y._setSubtreeIsolation(!1), a.adjacentElements.clear(), a.alreadySilent.clear();
|
|
676
|
+
var r = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), h = ce(i), p;
|
|
698
677
|
try {
|
|
699
|
-
for (h.s(); !(
|
|
700
|
-
var g =
|
|
701
|
-
|
|
702
|
-
for (var v = typeof ShadowRoot < "u" && g.getRootNode() instanceof ShadowRoot,
|
|
703
|
-
|
|
704
|
-
var
|
|
705
|
-
|
|
678
|
+
for (h.s(); !(p = h.n()).done; ) {
|
|
679
|
+
var g = p.value;
|
|
680
|
+
r.add(g);
|
|
681
|
+
for (var v = typeof ShadowRoot < "u" && g.getRootNode() instanceof ShadowRoot, S = g; S; ) {
|
|
682
|
+
r.add(S);
|
|
683
|
+
var F = S.parentElement, N = [];
|
|
684
|
+
F ? N = F.children : !F && v && (N = S.getRootNode().children, F = S.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
|
|
706
685
|
var A = ce(N), C;
|
|
707
686
|
try {
|
|
708
687
|
for (A.s(); !(C = A.n()).done; ) {
|
|
@@ -714,7 +693,7 @@ var I = {
|
|
|
714
693
|
} finally {
|
|
715
694
|
A.f();
|
|
716
695
|
}
|
|
717
|
-
|
|
696
|
+
S = F;
|
|
718
697
|
}
|
|
719
698
|
}
|
|
720
699
|
} catch (x) {
|
|
@@ -722,23 +701,23 @@ var I = {
|
|
|
722
701
|
} finally {
|
|
723
702
|
h.f();
|
|
724
703
|
}
|
|
725
|
-
|
|
704
|
+
r.forEach(function(x) {
|
|
726
705
|
c.delete(x);
|
|
727
|
-
}),
|
|
706
|
+
}), a.adjacentElements = c;
|
|
728
707
|
}, m = function() {
|
|
729
|
-
if (
|
|
730
|
-
return
|
|
731
|
-
},
|
|
732
|
-
var
|
|
708
|
+
if (a.active)
|
|
709
|
+
return o.removeEventListener("focusin", W, !0), o.removeEventListener("mousedown", q, !0), o.removeEventListener("touchstart", q, !0), o.removeEventListener("click", V, !0), o.removeEventListener("keydown", z, !0), o.removeEventListener("keydown", Y), y;
|
|
710
|
+
}, u = function(i) {
|
|
711
|
+
var r = i.some(function(c) {
|
|
733
712
|
var h = Array.from(c.removedNodes);
|
|
734
|
-
return h.some(function(
|
|
735
|
-
return
|
|
713
|
+
return h.some(function(p) {
|
|
714
|
+
return p === a.mostRecentlyFocusedNode;
|
|
736
715
|
});
|
|
737
716
|
});
|
|
738
|
-
|
|
739
|
-
}, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(
|
|
740
|
-
T && (T.disconnect(),
|
|
741
|
-
T.observe(
|
|
717
|
+
r && P(D());
|
|
718
|
+
}, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, O = function() {
|
|
719
|
+
T && (T.disconnect(), a.active && !a.paused && a.containers.map(function(i) {
|
|
720
|
+
T.observe(i, {
|
|
742
721
|
subtree: !0,
|
|
743
722
|
childList: !0
|
|
744
723
|
});
|
|
@@ -746,105 +725,105 @@ var I = {
|
|
|
746
725
|
};
|
|
747
726
|
return y = {
|
|
748
727
|
get active() {
|
|
749
|
-
return
|
|
728
|
+
return a.active;
|
|
750
729
|
},
|
|
751
730
|
get paused() {
|
|
752
|
-
return
|
|
731
|
+
return a.paused;
|
|
753
732
|
},
|
|
754
|
-
activate: function(
|
|
755
|
-
if (
|
|
733
|
+
activate: function(i) {
|
|
734
|
+
if (a.active)
|
|
756
735
|
return this;
|
|
757
|
-
var
|
|
758
|
-
if (
|
|
736
|
+
var r = w(i, "onActivate"), c = w(i, "onPostActivate"), h = w(i, "checkCanFocusTrap"), p = I.getActiveTrap(s), g = !1;
|
|
737
|
+
if (p && !p.paused) {
|
|
759
738
|
var v;
|
|
760
|
-
(v =
|
|
739
|
+
(v = p._setSubtreeIsolation) === null || v === void 0 || v.call(p, !1), g = !0;
|
|
761
740
|
}
|
|
762
741
|
try {
|
|
763
|
-
h ||
|
|
764
|
-
var
|
|
765
|
-
h &&
|
|
742
|
+
h || R(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = j(o), r == null || r();
|
|
743
|
+
var S = function() {
|
|
744
|
+
h && R(), d(), O(), l.isolateSubtrees && y._setSubtreeIsolation(!0), c == null || c();
|
|
766
745
|
};
|
|
767
746
|
if (h)
|
|
768
|
-
return h(
|
|
769
|
-
|
|
747
|
+
return h(a.containers.concat()).then(S, S), this;
|
|
748
|
+
S();
|
|
770
749
|
} catch (N) {
|
|
771
|
-
if (
|
|
772
|
-
var
|
|
773
|
-
(
|
|
750
|
+
if (p === I.getActiveTrap(s) && g) {
|
|
751
|
+
var F;
|
|
752
|
+
(F = p._setSubtreeIsolation) === null || F === void 0 || F.call(p, !0);
|
|
774
753
|
}
|
|
775
754
|
throw N;
|
|
776
755
|
}
|
|
777
756
|
return this;
|
|
778
757
|
},
|
|
779
|
-
deactivate: function(
|
|
780
|
-
if (!
|
|
758
|
+
deactivate: function(i) {
|
|
759
|
+
if (!a.active)
|
|
781
760
|
return this;
|
|
782
|
-
var
|
|
761
|
+
var r = fe({
|
|
783
762
|
onDeactivate: l.onDeactivate,
|
|
784
763
|
onPostDeactivate: l.onPostDeactivate,
|
|
785
764
|
checkCanReturnFocus: l.checkCanReturnFocus
|
|
786
|
-
},
|
|
787
|
-
clearTimeout(
|
|
788
|
-
var c = w(
|
|
765
|
+
}, i);
|
|
766
|
+
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);
|
|
767
|
+
var c = w(r, "onDeactivate"), h = w(r, "onPostDeactivate"), p = w(r, "checkCanReturnFocus"), g = w(r, "returnFocus", "returnFocusOnDeactivate");
|
|
789
768
|
c == null || c();
|
|
790
769
|
var v = function() {
|
|
791
770
|
de(function() {
|
|
792
|
-
g &&
|
|
771
|
+
g && P(U(a.nodeFocusedBeforeActivation)), h == null || h();
|
|
793
772
|
});
|
|
794
773
|
};
|
|
795
|
-
return g &&
|
|
774
|
+
return g && p ? (p(U(a.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this);
|
|
796
775
|
},
|
|
797
|
-
pause: function(
|
|
798
|
-
return
|
|
776
|
+
pause: function(i) {
|
|
777
|
+
return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, i)) : this;
|
|
799
778
|
},
|
|
800
|
-
unpause: function(
|
|
801
|
-
return
|
|
779
|
+
unpause: function(i) {
|
|
780
|
+
return a.active ? (a.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, i)) : this;
|
|
802
781
|
},
|
|
803
|
-
updateContainerElements: function(
|
|
804
|
-
var
|
|
805
|
-
return
|
|
806
|
-
return typeof c == "string" ?
|
|
807
|
-
}), l.isolateSubtrees && f(
|
|
782
|
+
updateContainerElements: function(i) {
|
|
783
|
+
var r = [].concat(i).filter(Boolean);
|
|
784
|
+
return a.containers = r.map(function(c) {
|
|
785
|
+
return typeof c == "string" ? o.querySelector(c) : c;
|
|
786
|
+
}), l.isolateSubtrees && f(a.containers), a.active && (R(), l.isolateSubtrees && !a.paused && y._setSubtreeIsolation(!0)), O(), this;
|
|
808
787
|
}
|
|
809
788
|
}, Object.defineProperties(y, {
|
|
810
789
|
_isManuallyPaused: {
|
|
811
790
|
value: function() {
|
|
812
|
-
return
|
|
791
|
+
return a.manuallyPaused;
|
|
813
792
|
}
|
|
814
793
|
},
|
|
815
794
|
_setPausedState: {
|
|
816
|
-
value: function(
|
|
817
|
-
if (
|
|
795
|
+
value: function(i, r) {
|
|
796
|
+
if (a.paused === i)
|
|
818
797
|
return this;
|
|
819
|
-
if (
|
|
820
|
-
var c = w(
|
|
821
|
-
c == null || c(), m(),
|
|
798
|
+
if (a.paused = i, i) {
|
|
799
|
+
var c = w(r, "onPause"), h = w(r, "onPostPause");
|
|
800
|
+
c == null || c(), m(), O(), y._setSubtreeIsolation(!1), h == null || h();
|
|
822
801
|
} else {
|
|
823
|
-
var
|
|
824
|
-
|
|
802
|
+
var p = w(r, "onUnpause"), g = w(r, "onPostUnpause");
|
|
803
|
+
p == null || p(), y._setSubtreeIsolation(!0), R(), d(), O(), g == null || g();
|
|
825
804
|
}
|
|
826
805
|
return this;
|
|
827
806
|
}
|
|
828
807
|
},
|
|
829
808
|
_setSubtreeIsolation: {
|
|
830
|
-
value: function(
|
|
831
|
-
l.isolateSubtrees &&
|
|
809
|
+
value: function(i) {
|
|
810
|
+
l.isolateSubtrees && a.adjacentElements.forEach(function(r) {
|
|
832
811
|
var c;
|
|
833
|
-
if (
|
|
812
|
+
if (i)
|
|
834
813
|
switch (l.isolateSubtrees) {
|
|
835
814
|
case "aria-hidden":
|
|
836
|
-
(
|
|
815
|
+
(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");
|
|
837
816
|
break;
|
|
838
817
|
default:
|
|
839
|
-
(
|
|
818
|
+
(r.inert || r.hasAttribute("inert")) && a.alreadySilent.add(r), r.setAttribute("inert", !0);
|
|
840
819
|
break;
|
|
841
820
|
}
|
|
842
|
-
else if (!
|
|
821
|
+
else if (!a.alreadySilent.has(r)) switch (l.isolateSubtrees) {
|
|
843
822
|
case "aria-hidden":
|
|
844
|
-
|
|
823
|
+
r.removeAttribute("aria-hidden");
|
|
845
824
|
break;
|
|
846
825
|
default:
|
|
847
|
-
|
|
826
|
+
r.removeAttribute("inert");
|
|
848
827
|
break;
|
|
849
828
|
}
|
|
850
829
|
});
|
|
@@ -855,37 +834,37 @@ var I = {
|
|
|
855
834
|
const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
856
835
|
__proto__: null,
|
|
857
836
|
createFocusTrap: Je
|
|
858
|
-
}, Symbol.toStringTag, { value: "Module" })), et = /* @__PURE__ */
|
|
837
|
+
}, Symbol.toStringTag, { value: "Module" })), et = /* @__PURE__ */ be(Qe), tt = /* @__PURE__ */ be(Ke);
|
|
859
838
|
var ve;
|
|
860
839
|
function rt() {
|
|
861
840
|
if (ve) return H.exports;
|
|
862
841
|
ve = 1;
|
|
863
|
-
function
|
|
842
|
+
function n(d) {
|
|
864
843
|
"@babel/helpers - typeof";
|
|
865
|
-
return
|
|
844
|
+
return n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
|
|
866
845
|
return typeof f;
|
|
867
846
|
} : function(f) {
|
|
868
847
|
return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
|
|
869
|
-
},
|
|
848
|
+
}, n(d);
|
|
870
849
|
}
|
|
871
850
|
var e, t;
|
|
872
|
-
function
|
|
851
|
+
function o(d, f) {
|
|
873
852
|
if (!(d instanceof f)) throw new TypeError("Cannot call a class as a function");
|
|
874
853
|
}
|
|
875
|
-
function
|
|
854
|
+
function s(d, f) {
|
|
876
855
|
for (var m = 0; m < f.length; m++) {
|
|
877
|
-
var
|
|
878
|
-
|
|
856
|
+
var u = f[m];
|
|
857
|
+
u.enumerable = u.enumerable || !1, u.configurable = !0, "value" in u && (u.writable = !0), Object.defineProperty(d, P(u.key), u);
|
|
879
858
|
}
|
|
880
859
|
}
|
|
881
860
|
function l(d, f, m) {
|
|
882
|
-
return f &&
|
|
861
|
+
return f && s(d.prototype, f), Object.defineProperty(d, "prototype", { writable: !1 }), d;
|
|
883
862
|
}
|
|
884
|
-
function
|
|
863
|
+
function a(d, f, m) {
|
|
885
864
|
return f = k(f), y(d, E() ? Reflect.construct(f, m || [], k(d).constructor) : f.apply(d, m));
|
|
886
865
|
}
|
|
887
866
|
function y(d, f) {
|
|
888
|
-
if (f && (
|
|
867
|
+
if (f && (n(f) == "object" || typeof f == "function")) return f;
|
|
889
868
|
if (f !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
890
869
|
return w(d);
|
|
891
870
|
}
|
|
@@ -910,53 +889,53 @@ function rt() {
|
|
|
910
889
|
}
|
|
911
890
|
function D(d, f) {
|
|
912
891
|
if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
|
|
913
|
-
d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f &&
|
|
892
|
+
d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && R(d, f);
|
|
914
893
|
}
|
|
915
|
-
function
|
|
916
|
-
return
|
|
917
|
-
return m.__proto__ =
|
|
918
|
-
},
|
|
894
|
+
function R(d, f) {
|
|
895
|
+
return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, u) {
|
|
896
|
+
return m.__proto__ = u, m;
|
|
897
|
+
}, R(d, f);
|
|
919
898
|
}
|
|
920
899
|
function j(d, f, m) {
|
|
921
|
-
return (f =
|
|
900
|
+
return (f = P(f)) in d ? Object.defineProperty(d, f, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : d[f] = m, d;
|
|
922
901
|
}
|
|
923
|
-
function
|
|
902
|
+
function P(d) {
|
|
924
903
|
var f = U(d, "string");
|
|
925
|
-
return
|
|
904
|
+
return n(f) == "symbol" ? f : f + "";
|
|
926
905
|
}
|
|
927
906
|
function U(d, f) {
|
|
928
|
-
if (
|
|
907
|
+
if (n(d) != "object" || !d) return d;
|
|
929
908
|
var m = d[Symbol.toPrimitive];
|
|
930
909
|
if (m !== void 0) {
|
|
931
|
-
var
|
|
932
|
-
if (
|
|
910
|
+
var u = m.call(d, f);
|
|
911
|
+
if (n(u) != "object") return u;
|
|
933
912
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
934
913
|
}
|
|
935
914
|
return (f === "string" ? String : Number)(d);
|
|
936
915
|
}
|
|
937
916
|
var _ = Ee, q = et, W = q.createFocusTrap, ae = tt, z = ae.isFocusable, Y = parseInt((e = (t = /^(\d+)\./.exec(_.version)) === null || t === void 0 ? void 0 : t[1]) !== null && e !== void 0 ? e : 0, 10), V = /* @__PURE__ */ (function(d) {
|
|
938
917
|
function f(m) {
|
|
939
|
-
var
|
|
940
|
-
|
|
941
|
-
var
|
|
942
|
-
if (typeof
|
|
943
|
-
for (var c = arguments.length, h = new Array(c > 1 ? c - 1 : 0),
|
|
944
|
-
h[
|
|
945
|
-
|
|
918
|
+
var u;
|
|
919
|
+
o(this, f), u = a(this, f, [m]), j(u, "getNodeForOption", function(b) {
|
|
920
|
+
var i, r = (i = this.internalOptions[b]) !== null && i !== void 0 ? i : this.originalOptions[b];
|
|
921
|
+
if (typeof r == "function") {
|
|
922
|
+
for (var c = arguments.length, h = new Array(c > 1 ? c - 1 : 0), p = 1; p < c; p++)
|
|
923
|
+
h[p - 1] = arguments[p];
|
|
924
|
+
r = r.apply(void 0, h);
|
|
946
925
|
}
|
|
947
|
-
if (
|
|
948
|
-
if (
|
|
949
|
-
return
|
|
950
|
-
throw new Error("`".concat(
|
|
926
|
+
if (r === !0 && (r = void 0), !r) {
|
|
927
|
+
if (r === void 0 || r === !1)
|
|
928
|
+
return r;
|
|
929
|
+
throw new Error("`".concat(b, "` was specified but was not a node, or did not return a node"));
|
|
951
930
|
}
|
|
952
|
-
var g =
|
|
953
|
-
if (typeof
|
|
931
|
+
var g = r;
|
|
932
|
+
if (typeof r == "string") {
|
|
954
933
|
var v;
|
|
955
|
-
if (g = (v = this.getDocument()) === null || v === void 0 ? void 0 : v.querySelector(
|
|
956
|
-
throw new Error("`".concat(
|
|
934
|
+
if (g = (v = this.getDocument()) === null || v === void 0 ? void 0 : v.querySelector(r), !g)
|
|
935
|
+
throw new Error("`".concat(b, "` as selector refers to no known node"));
|
|
957
936
|
}
|
|
958
937
|
return g;
|
|
959
|
-
}),
|
|
938
|
+
}), u.handleDeactivate = u.handleDeactivate.bind(u), u.handlePostDeactivate = u.handlePostDeactivate.bind(u), u.handleClickOutsideDeactivates = u.handleClickOutsideDeactivates.bind(u), u.internalOptions = {
|
|
960
939
|
// We need to hijack the returnFocusOnDeactivate option,
|
|
961
940
|
// because React can move focus into the element before we arrived at
|
|
962
941
|
// this lifecycle hook (e.g. with autoFocus inputs). So the component
|
|
@@ -966,14 +945,14 @@ function rt() {
|
|
|
966
945
|
// the rest of these are also related to deactivation of the trap, and we
|
|
967
946
|
// need to use them and control them as well
|
|
968
947
|
checkCanReturnFocus: null,
|
|
969
|
-
onDeactivate:
|
|
970
|
-
onPostDeactivate:
|
|
948
|
+
onDeactivate: u.handleDeactivate,
|
|
949
|
+
onPostDeactivate: u.handlePostDeactivate,
|
|
971
950
|
// we need to special-case this setting as well so that we can know if we should
|
|
972
951
|
// NOT return focus if the trap gets auto-deactivated as the result of an
|
|
973
952
|
// outside click (otherwise, we'll always think we should return focus because
|
|
974
953
|
// of how we manage that flag internally here)
|
|
975
|
-
clickOutsideDeactivates:
|
|
976
|
-
},
|
|
954
|
+
clickOutsideDeactivates: u.handleClickOutsideDeactivates
|
|
955
|
+
}, u.originalOptions = {
|
|
977
956
|
// because of the above `internalOptions`, we maintain our own flag for
|
|
978
957
|
// this option, and default it to `true` because that's focus-trap's default
|
|
979
958
|
returnFocusOnDeactivate: !0,
|
|
@@ -987,15 +966,15 @@ function rt() {
|
|
|
987
966
|
clickOutsideDeactivates: !1
|
|
988
967
|
};
|
|
989
968
|
var T = m.focusTrapOptions;
|
|
990
|
-
for (var
|
|
991
|
-
if (Object.prototype.hasOwnProperty.call(T,
|
|
992
|
-
if (
|
|
993
|
-
|
|
969
|
+
for (var O in T)
|
|
970
|
+
if (Object.prototype.hasOwnProperty.call(T, O)) {
|
|
971
|
+
if (O === "returnFocusOnDeactivate" || O === "onDeactivate" || O === "onPostDeactivate" || O === "checkCanReturnFocus" || O === "clickOutsideDeactivates") {
|
|
972
|
+
u.originalOptions[O] = T[O];
|
|
994
973
|
continue;
|
|
995
974
|
}
|
|
996
|
-
|
|
975
|
+
u.internalOptions[O] = T[O];
|
|
997
976
|
}
|
|
998
|
-
return
|
|
977
|
+
return u.outsideClick = null, u.focusTrapElements = m.containerElements || [], u.updatePreviousElement(), u;
|
|
999
978
|
}
|
|
1000
979
|
return D(f, d), l(f, [{
|
|
1001
980
|
key: "getDocument",
|
|
@@ -1005,15 +984,15 @@ function rt() {
|
|
|
1005
984
|
}, {
|
|
1006
985
|
key: "getReturnFocusNode",
|
|
1007
986
|
value: function() {
|
|
1008
|
-
var
|
|
1009
|
-
return
|
|
987
|
+
var u = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
|
|
988
|
+
return u || (u === !1 ? !1 : this.previouslyFocusedElement);
|
|
1010
989
|
}
|
|
1011
990
|
/** Update the previously focused element with the currently focused element. */
|
|
1012
991
|
}, {
|
|
1013
992
|
key: "updatePreviousElement",
|
|
1014
993
|
value: function() {
|
|
1015
|
-
var
|
|
1016
|
-
|
|
994
|
+
var u = this.getDocument();
|
|
995
|
+
u && (this.previouslyFocusedElement = u.activeElement);
|
|
1017
996
|
}
|
|
1018
997
|
}, {
|
|
1019
998
|
key: "deactivateTrap",
|
|
@@ -1037,10 +1016,10 @@ function rt() {
|
|
|
1037
1016
|
}
|
|
1038
1017
|
}, {
|
|
1039
1018
|
key: "handleClickOutsideDeactivates",
|
|
1040
|
-
value: function(
|
|
1041
|
-
var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null,
|
|
1019
|
+
value: function(u) {
|
|
1020
|
+
var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, u) : this.originalOptions.clickOutsideDeactivates;
|
|
1042
1021
|
return T && (this.outsideClick = {
|
|
1043
|
-
target:
|
|
1022
|
+
target: u.target,
|
|
1044
1023
|
allowDeactivation: T
|
|
1045
1024
|
}), T;
|
|
1046
1025
|
}
|
|
@@ -1052,18 +1031,18 @@ function rt() {
|
|
|
1052
1031
|
}, {
|
|
1053
1032
|
key: "handlePostDeactivate",
|
|
1054
1033
|
value: function() {
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
1057
|
-
(
|
|
1058
|
-
|
|
1059
|
-
(!
|
|
1060
|
-
|
|
1034
|
+
var u = this, T = function() {
|
|
1035
|
+
var b = u.getReturnFocusNode(), i = !!// did the consumer allow it?
|
|
1036
|
+
(u.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
|
|
1037
|
+
b !== null && b !== void 0 && b.focus && // was there an outside click that allowed deactivation?
|
|
1038
|
+
(!u.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
|
|
1039
|
+
u.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
|
|
1061
1040
|
// as a result of the click-through) -- in which case do NOT restore focus
|
|
1062
1041
|
// to `returnFocusNode` because focus should remain on the outside node
|
|
1063
|
-
!z(
|
|
1064
|
-
|
|
1042
|
+
!z(u.outsideClick.target, u.internalOptions.tabbableOptions))), r = u.internalOptions.preventScroll, c = r === void 0 ? !1 : r;
|
|
1043
|
+
i && b.focus({
|
|
1065
1044
|
preventScroll: c
|
|
1066
|
-
}),
|
|
1045
|
+
}), u.originalOptions.onPostDeactivate && u.originalOptions.onPostDeactivate.call(null), u.outsideClick = null;
|
|
1067
1046
|
};
|
|
1068
1047
|
this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(T, T) : T();
|
|
1069
1048
|
}
|
|
@@ -1073,8 +1052,8 @@ function rt() {
|
|
|
1073
1052
|
if (this.focusTrap)
|
|
1074
1053
|
this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
|
|
1075
1054
|
else {
|
|
1076
|
-
var
|
|
1077
|
-
|
|
1055
|
+
var u = this.focusTrapElements.some(Boolean);
|
|
1056
|
+
u && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
|
|
1078
1057
|
}
|
|
1079
1058
|
}
|
|
1080
1059
|
}, {
|
|
@@ -1084,17 +1063,17 @@ function rt() {
|
|
|
1084
1063
|
}
|
|
1085
1064
|
}, {
|
|
1086
1065
|
key: "componentDidUpdate",
|
|
1087
|
-
value: function(
|
|
1066
|
+
value: function(u) {
|
|
1088
1067
|
if (this.focusTrap) {
|
|
1089
|
-
|
|
1090
|
-
var T = !
|
|
1091
|
-
if (T && (this.updatePreviousElement(), this.focusTrap.activate()),
|
|
1068
|
+
u.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
|
|
1069
|
+
var T = !u.active && this.props.active, O = u.active && !this.props.active, b = !u.paused && this.props.paused, i = u.paused && !this.props.paused;
|
|
1070
|
+
if (T && (this.updatePreviousElement(), this.focusTrap.activate()), O) {
|
|
1092
1071
|
this.deactivateTrap();
|
|
1093
1072
|
return;
|
|
1094
1073
|
}
|
|
1095
|
-
|
|
1074
|
+
b && this.focusTrap.pause(), i && this.focusTrap.unpause();
|
|
1096
1075
|
} else
|
|
1097
|
-
|
|
1076
|
+
u.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
|
|
1098
1077
|
}
|
|
1099
1078
|
}, {
|
|
1100
1079
|
key: "componentWillUnmount",
|
|
@@ -1104,17 +1083,17 @@ function rt() {
|
|
|
1104
1083
|
}, {
|
|
1105
1084
|
key: "render",
|
|
1106
1085
|
value: function() {
|
|
1107
|
-
var
|
|
1086
|
+
var u = this, T = this.props.children ? _.Children.only(this.props.children) : void 0;
|
|
1108
1087
|
if (T) {
|
|
1109
1088
|
if (T.type && T.type === _.Fragment)
|
|
1110
1089
|
throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
|
|
1111
|
-
var
|
|
1112
|
-
var c =
|
|
1113
|
-
T && (Y >= 19 ? typeof T.props.ref == "function" ? T.props.ref(
|
|
1114
|
-
},
|
|
1115
|
-
ref:
|
|
1090
|
+
var O = function(r) {
|
|
1091
|
+
var c = u.props.containerElements;
|
|
1092
|
+
T && (Y >= 19 ? typeof T.props.ref == "function" ? T.props.ref(r) : T.props.ref && (T.props.ref.current = r) : typeof T.ref == "function" ? T.ref(r) : T.ref && (T.ref.current = r)), u.focusTrapElements = c || [r];
|
|
1093
|
+
}, b = _.cloneElement(T, {
|
|
1094
|
+
ref: O
|
|
1116
1095
|
});
|
|
1117
|
-
return
|
|
1096
|
+
return b;
|
|
1118
1097
|
}
|
|
1119
1098
|
return null;
|
|
1120
1099
|
}
|
|
@@ -1129,7 +1108,5 @@ function rt() {
|
|
|
1129
1108
|
}
|
|
1130
1109
|
var it = rt();
|
|
1131
1110
|
export {
|
|
1132
|
-
|
|
1133
|
-
it as f,
|
|
1134
|
-
pe as g
|
|
1111
|
+
it as f
|
|
1135
1112
|
};
|