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