@kakadu/components 1.7.6 → 1.7.7
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.d.ts +3 -2
- package/build/components/modal.js +5 -5
- package/build/components/modal.mjs +418 -417
- package/build/components.css +1 -1
- package/package.json +1 -1
- package/readme.md +5 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as N } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import
|
|
2
|
+
import Ie, { createContext as Ae, useRef as te, useState as re, useCallback as J, useMemo as ne, useEffect as H, useContext as xe } from "react";
|
|
3
3
|
import { cx as pe } from "@kuma-ui/core";
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { a as
|
|
6
|
-
import
|
|
7
|
-
function
|
|
4
|
+
import { createPortal as _e } from "react-dom";
|
|
5
|
+
import { a as Le } from "../icon-C6X3pQX0.mjs";
|
|
6
|
+
import Be from "./text-button.mjs";
|
|
7
|
+
function ke(r) {
|
|
8
8
|
if (Object.prototype.hasOwnProperty.call(r, "__esModule")) return r;
|
|
9
9
|
var e = r.default;
|
|
10
10
|
if (typeof e == "function") {
|
|
@@ -14,8 +14,8 @@ function we(r) {
|
|
|
14
14
|
t.prototype = e.prototype;
|
|
15
15
|
} else t = {};
|
|
16
16
|
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(r).forEach(function(a) {
|
|
17
|
-
var
|
|
18
|
-
Object.defineProperty(t, a,
|
|
17
|
+
var s = Object.getOwnPropertyDescriptor(r, a);
|
|
18
|
+
Object.defineProperty(t, a, s.get ? s : {
|
|
19
19
|
enumerable: !0,
|
|
20
20
|
get: function() {
|
|
21
21
|
return r[a];
|
|
@@ -28,8 +28,8 @@ var Q = { exports: {} };
|
|
|
28
28
|
* tabbable 6.4.0
|
|
29
29
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
30
30
|
*/
|
|
31
|
-
var
|
|
32
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, oe = !
|
|
31
|
+
var Ee = ["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] *)"], ie = /* @__PURE__ */ Ee.join(","), Fe = typeof Element > "u", z = Fe ? function() {
|
|
32
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, oe = !Fe && Element.prototype.getRootNode ? function(r) {
|
|
33
33
|
var e;
|
|
34
34
|
return r == null || (e = r.getRootNode) === null || e === void 0 ? void 0 : e.call(r);
|
|
35
35
|
} : function(r) {
|
|
@@ -37,103 +37,103 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
37
37
|
}, ue = function(e, t) {
|
|
38
38
|
var a;
|
|
39
39
|
t === void 0 && (t = !0);
|
|
40
|
-
var
|
|
40
|
+
var s = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), c = s === "" || s === "true", n = c || t && e && // closest does not exist on shadow roots, so we fall back to a manual
|
|
41
41
|
// lookup upward, in case it is not defined.
|
|
42
42
|
(typeof e.closest == "function" ? e.closest("[inert]") : ue(e.parentNode));
|
|
43
43
|
return n;
|
|
44
|
-
},
|
|
44
|
+
}, Me = function(e) {
|
|
45
45
|
var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
46
46
|
return a === "" || a === "true";
|
|
47
|
-
},
|
|
47
|
+
}, Se = function(e, t, a) {
|
|
48
48
|
if (ue(e))
|
|
49
49
|
return [];
|
|
50
|
-
var
|
|
51
|
-
return t && z.call(e, ie) &&
|
|
50
|
+
var s = Array.prototype.slice.apply(e.querySelectorAll(ie));
|
|
51
|
+
return t && z.call(e, ie) && s.unshift(e), s = s.filter(a), s;
|
|
52
52
|
}, se = function(e, t, a) {
|
|
53
|
-
for (var
|
|
53
|
+
for (var s = [], c = Array.from(e); c.length; ) {
|
|
54
54
|
var n = c.shift();
|
|
55
55
|
if (!ue(n, !1))
|
|
56
56
|
if (n.tagName === "SLOT") {
|
|
57
|
-
var
|
|
58
|
-
a.flatten ?
|
|
57
|
+
var p = n.assignedElements(), y = p.length ? p : n.children, k = se(y, !0, a);
|
|
58
|
+
a.flatten ? s.push.apply(s, k) : s.push({
|
|
59
59
|
scopeParent: n,
|
|
60
60
|
candidates: k
|
|
61
61
|
});
|
|
62
62
|
} else {
|
|
63
63
|
var S = z.call(n, ie);
|
|
64
|
-
S && a.filter(n) && (t || !e.includes(n)) &&
|
|
64
|
+
S && a.filter(n) && (t || !e.includes(n)) && s.push(n);
|
|
65
65
|
var D = n.shadowRoot || // check for an undisclosed shadow
|
|
66
66
|
typeof a.getShadowRoot == "function" && a.getShadowRoot(n), R = !ue(D, !1) && (!a.shadowRootFilter || a.shadowRootFilter(n));
|
|
67
67
|
if (D && R) {
|
|
68
|
-
var
|
|
69
|
-
a.flatten ?
|
|
68
|
+
var A = se(D === !0 ? n.children : D.children, !0, a);
|
|
69
|
+
a.flatten ? s.push.apply(s, A) : s.push({
|
|
70
70
|
scopeParent: n,
|
|
71
|
-
candidates:
|
|
71
|
+
candidates: A
|
|
72
72
|
});
|
|
73
73
|
} else
|
|
74
74
|
c.unshift.apply(c, n.children);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
return
|
|
78
|
-
},
|
|
77
|
+
return s;
|
|
78
|
+
}, Oe = function(e) {
|
|
79
79
|
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
80
|
-
},
|
|
80
|
+
}, K = function(e) {
|
|
81
81
|
if (!e)
|
|
82
82
|
throw new Error("No node provided");
|
|
83
|
-
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) ||
|
|
84
|
-
}, Me = function(e, t) {
|
|
85
|
-
var a = V(e);
|
|
86
|
-
return a < 0 && t && !Se(e) ? 0 : a;
|
|
83
|
+
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Me(e)) && !Oe(e) ? 0 : e.tabIndex;
|
|
87
84
|
}, Ke = function(e, t) {
|
|
85
|
+
var a = K(e);
|
|
86
|
+
return a < 0 && t && !Oe(e) ? 0 : a;
|
|
87
|
+
}, qe = function(e, t) {
|
|
88
88
|
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
89
|
-
},
|
|
89
|
+
}, De = function(e) {
|
|
90
90
|
return e.tagName === "INPUT";
|
|
91
|
-
}, qe = function(e) {
|
|
92
|
-
return Oe(e) && e.type === "hidden";
|
|
93
91
|
}, Ve = function(e) {
|
|
92
|
+
return De(e) && e.type === "hidden";
|
|
93
|
+
}, $e = function(e) {
|
|
94
94
|
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
|
|
95
95
|
return a.tagName === "SUMMARY";
|
|
96
96
|
});
|
|
97
97
|
return t;
|
|
98
|
-
},
|
|
98
|
+
}, Ge = function(e, t) {
|
|
99
99
|
for (var a = 0; a < e.length; a++)
|
|
100
100
|
if (e[a].checked && e[a].form === t)
|
|
101
101
|
return e[a];
|
|
102
|
-
},
|
|
102
|
+
}, Ue = function(e) {
|
|
103
103
|
if (!e.name)
|
|
104
104
|
return !0;
|
|
105
|
-
var t = e.form || oe(e), a = function(
|
|
106
|
-
return t.querySelectorAll('input[type="radio"][name="' +
|
|
107
|
-
},
|
|
105
|
+
var t = e.form || oe(e), a = function(p) {
|
|
106
|
+
return t.querySelectorAll('input[type="radio"][name="' + p + '"]');
|
|
107
|
+
}, s;
|
|
108
108
|
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
109
|
-
|
|
109
|
+
s = a(window.CSS.escape(e.name));
|
|
110
110
|
else
|
|
111
111
|
try {
|
|
112
|
-
|
|
112
|
+
s = a(e.name);
|
|
113
113
|
} catch (n) {
|
|
114
114
|
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", n.message), !1;
|
|
115
115
|
}
|
|
116
|
-
var c =
|
|
116
|
+
var c = Ge(s, e.form);
|
|
117
117
|
return !c || c === e;
|
|
118
|
-
}, Ue = function(e) {
|
|
119
|
-
return Oe(e) && e.type === "radio";
|
|
120
118
|
}, We = function(e) {
|
|
121
|
-
return
|
|
119
|
+
return De(e) && e.type === "radio";
|
|
122
120
|
}, ze = function(e) {
|
|
123
|
-
|
|
121
|
+
return We(e) && !Ue(e);
|
|
122
|
+
}, Ye = function(e) {
|
|
123
|
+
var t, a = e && oe(e), s = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
|
|
124
124
|
if (a && a !== e) {
|
|
125
|
-
var n,
|
|
126
|
-
for (c = !!((n =
|
|
125
|
+
var n, p, y;
|
|
126
|
+
for (c = !!((n = s) !== null && n !== void 0 && (p = n.ownerDocument) !== null && p !== void 0 && p.contains(s) || e != null && (y = e.ownerDocument) !== null && y !== void 0 && y.contains(e)); !c && s; ) {
|
|
127
127
|
var k, S, D;
|
|
128
|
-
a = oe(
|
|
128
|
+
a = oe(s), s = (k = a) === null || k === void 0 ? void 0 : k.host, c = !!((S = s) !== null && S !== void 0 && (D = S.ownerDocument) !== null && D !== void 0 && D.contains(s));
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
return c;
|
|
132
132
|
}, be = function(e) {
|
|
133
|
-
var t = e.getBoundingClientRect(), a = t.width,
|
|
134
|
-
return a === 0 &&
|
|
135
|
-
},
|
|
136
|
-
var a = t.displayCheck,
|
|
133
|
+
var t = e.getBoundingClientRect(), a = t.width, s = t.height;
|
|
134
|
+
return a === 0 && s === 0;
|
|
135
|
+
}, He = function(e, t) {
|
|
136
|
+
var a = t.displayCheck, s = t.getShadowRoot;
|
|
137
137
|
if (a === "full-native" && "checkVisibility" in e) {
|
|
138
138
|
var c = e.checkVisibility({
|
|
139
139
|
// Checking opacity might be desirable for some use cases, but natively,
|
|
@@ -152,36 +152,36 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
152
152
|
}
|
|
153
153
|
if (getComputedStyle(e).visibility === "hidden")
|
|
154
154
|
return !0;
|
|
155
|
-
var n = z.call(e, "details>summary:first-of-type"),
|
|
156
|
-
if (z.call(
|
|
155
|
+
var n = z.call(e, "details>summary:first-of-type"), p = n ? e.parentElement : e;
|
|
156
|
+
if (z.call(p, "details:not([open]) *"))
|
|
157
157
|
return !0;
|
|
158
158
|
if (!a || a === "full" || // full-native can run this branch when it falls through in case
|
|
159
159
|
// Element#checkVisibility is unsupported
|
|
160
160
|
a === "full-native" || a === "legacy-full") {
|
|
161
|
-
if (typeof
|
|
162
|
-
for (var
|
|
161
|
+
if (typeof s == "function") {
|
|
162
|
+
for (var y = e; e; ) {
|
|
163
163
|
var k = e.parentElement, S = oe(e);
|
|
164
|
-
if (k && !k.shadowRoot &&
|
|
164
|
+
if (k && !k.shadowRoot && s(k) === !0)
|
|
165
165
|
return be(e);
|
|
166
166
|
e.assignedSlot ? e = e.assignedSlot : !k && S !== e.ownerDocument ? e = S.host : e = k;
|
|
167
167
|
}
|
|
168
|
-
e =
|
|
168
|
+
e = y;
|
|
169
169
|
}
|
|
170
|
-
if (
|
|
170
|
+
if (Ye(e))
|
|
171
171
|
return !e.getClientRects().length;
|
|
172
172
|
if (a !== "legacy-full")
|
|
173
173
|
return !0;
|
|
174
174
|
} else if (a === "non-zero-area")
|
|
175
175
|
return be(e);
|
|
176
176
|
return !1;
|
|
177
|
-
},
|
|
177
|
+
}, Ze = function(e) {
|
|
178
178
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
|
|
179
179
|
for (var t = e.parentElement; t; ) {
|
|
180
180
|
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
181
181
|
for (var a = 0; a < t.children.length; a++) {
|
|
182
|
-
var
|
|
183
|
-
if (
|
|
184
|
-
return z.call(t, "fieldset[disabled] *") ? !0 : !
|
|
182
|
+
var s = t.children.item(a);
|
|
183
|
+
if (s.tagName === "LEGEND")
|
|
184
|
+
return z.call(t, "fieldset[disabled] *") ? !0 : !s.contains(e);
|
|
185
185
|
}
|
|
186
186
|
return !0;
|
|
187
187
|
}
|
|
@@ -189,60 +189,60 @@ var ke = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
|
|
|
189
189
|
}
|
|
190
190
|
return !1;
|
|
191
191
|
}, ce = function(e, t) {
|
|
192
|
-
return !(t.disabled ||
|
|
193
|
-
|
|
192
|
+
return !(t.disabled || Ve(t) || He(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
193
|
+
$e(t) || Ze(t));
|
|
194
194
|
}, de = function(e, t) {
|
|
195
|
-
return !(
|
|
196
|
-
},
|
|
195
|
+
return !(ze(t) || K(t) < 0 || !ce(e, t));
|
|
196
|
+
}, Xe = function(e) {
|
|
197
197
|
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
198
198
|
return !!(isNaN(t) || t >= 0);
|
|
199
|
-
},
|
|
199
|
+
}, Ne = function(e) {
|
|
200
200
|
var t = [], a = [];
|
|
201
|
-
return e.forEach(function(
|
|
202
|
-
var n = !!
|
|
203
|
-
|
|
201
|
+
return e.forEach(function(s, c) {
|
|
202
|
+
var n = !!s.scopeParent, p = n ? s.scopeParent : s, y = Ke(p, n), k = n ? Ne(s.candidates) : p;
|
|
203
|
+
y === 0 ? n ? t.push.apply(t, k) : t.push(p) : a.push({
|
|
204
204
|
documentOrder: c,
|
|
205
|
-
tabIndex:
|
|
206
|
-
item:
|
|
205
|
+
tabIndex: y,
|
|
206
|
+
item: s,
|
|
207
207
|
isScope: n,
|
|
208
208
|
content: k
|
|
209
209
|
});
|
|
210
|
-
}), a.sort(
|
|
211
|
-
return c.isScope ?
|
|
210
|
+
}), a.sort(qe).reduce(function(s, c) {
|
|
211
|
+
return c.isScope ? s.push.apply(s, c.content) : s.push(c.content), s;
|
|
212
212
|
}, []).concat(t);
|
|
213
|
-
},
|
|
213
|
+
}, Re = function(e, t) {
|
|
214
214
|
t = t || {};
|
|
215
215
|
var a;
|
|
216
216
|
return t.getShadowRoot ? a = se([e], t.includeContainer, {
|
|
217
217
|
filter: de.bind(null, t),
|
|
218
218
|
flatten: !1,
|
|
219
219
|
getShadowRoot: t.getShadowRoot,
|
|
220
|
-
shadowRootFilter:
|
|
221
|
-
}) : a =
|
|
222
|
-
},
|
|
220
|
+
shadowRootFilter: Xe
|
|
221
|
+
}) : a = Se(e, t.includeContainer, de.bind(null, t)), Ne(a);
|
|
222
|
+
}, Pe = function(e, t) {
|
|
223
223
|
t = t || {};
|
|
224
224
|
var a;
|
|
225
225
|
return t.getShadowRoot ? a = se([e], t.includeContainer, {
|
|
226
226
|
filter: ce.bind(null, t),
|
|
227
227
|
flatten: !0,
|
|
228
228
|
getShadowRoot: t.getShadowRoot
|
|
229
|
-
}) : a =
|
|
229
|
+
}) : a = Se(e, t.includeContainer, ce.bind(null, t)), a;
|
|
230
230
|
}, W = function(e, t) {
|
|
231
231
|
if (t = t || {}, !e)
|
|
232
232
|
throw new Error("No node provided");
|
|
233
233
|
return z.call(e, ie) === !1 ? !1 : de(t, e);
|
|
234
|
-
},
|
|
234
|
+
}, Je = /* @__PURE__ */ Ee.concat("iframe:not([inert]):not([inert] *)").join(","), ae = function(e, t) {
|
|
235
235
|
if (t = t || {}, !e)
|
|
236
236
|
throw new Error("No node provided");
|
|
237
|
-
return z.call(e,
|
|
237
|
+
return z.call(e, Je) === !1 ? !1 : ce(t, e);
|
|
238
238
|
};
|
|
239
|
-
const
|
|
239
|
+
const Qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
240
240
|
__proto__: null,
|
|
241
|
-
focusable:
|
|
242
|
-
getTabIndex:
|
|
241
|
+
focusable: Pe,
|
|
242
|
+
getTabIndex: K,
|
|
243
243
|
isFocusable: ae,
|
|
244
244
|
isTabbable: W,
|
|
245
|
-
tabbable:
|
|
245
|
+
tabbable: Re
|
|
246
246
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
247
247
|
/*!
|
|
248
248
|
* focus-trap 7.8.0
|
|
@@ -253,18 +253,18 @@ function ve(r, e) {
|
|
|
253
253
|
for (var t = 0, a = Array(e); t < e; t++) a[t] = r[t];
|
|
254
254
|
return a;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function et(r) {
|
|
257
257
|
if (Array.isArray(r)) return ve(r);
|
|
258
258
|
}
|
|
259
259
|
function he(r, e) {
|
|
260
260
|
var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
261
261
|
if (!t) {
|
|
262
|
-
if (Array.isArray(r) || (t =
|
|
262
|
+
if (Array.isArray(r) || (t = Ce(r)) || e) {
|
|
263
263
|
t && (r = t);
|
|
264
|
-
var a = 0,
|
|
264
|
+
var a = 0, s = function() {
|
|
265
265
|
};
|
|
266
266
|
return {
|
|
267
|
-
s
|
|
267
|
+
s,
|
|
268
268
|
n: function() {
|
|
269
269
|
return a >= r.length ? {
|
|
270
270
|
done: !0
|
|
@@ -273,48 +273,48 @@ function he(r, e) {
|
|
|
273
273
|
value: r[a++]
|
|
274
274
|
};
|
|
275
275
|
},
|
|
276
|
-
e: function(
|
|
277
|
-
throw
|
|
276
|
+
e: function(y) {
|
|
277
|
+
throw y;
|
|
278
278
|
},
|
|
279
|
-
f:
|
|
279
|
+
f: s
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
283
283
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
284
284
|
}
|
|
285
|
-
var c, n = !0,
|
|
285
|
+
var c, n = !0, p = !1;
|
|
286
286
|
return {
|
|
287
287
|
s: function() {
|
|
288
288
|
t = t.call(r);
|
|
289
289
|
},
|
|
290
290
|
n: function() {
|
|
291
|
-
var
|
|
292
|
-
return n =
|
|
291
|
+
var y = t.next();
|
|
292
|
+
return n = y.done, y;
|
|
293
293
|
},
|
|
294
|
-
e: function(
|
|
295
|
-
|
|
294
|
+
e: function(y) {
|
|
295
|
+
p = !0, c = y;
|
|
296
296
|
},
|
|
297
297
|
f: function() {
|
|
298
298
|
try {
|
|
299
299
|
n || t.return == null || t.return();
|
|
300
300
|
} finally {
|
|
301
|
-
if (
|
|
301
|
+
if (p) throw c;
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
return (e =
|
|
306
|
+
function tt(r, e, t) {
|
|
307
|
+
return (e = ot(e)) in r ? Object.defineProperty(r, e, {
|
|
308
308
|
value: t,
|
|
309
309
|
enumerable: !0,
|
|
310
310
|
configurable: !0,
|
|
311
311
|
writable: !0
|
|
312
312
|
}) : r[e] = t, r;
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function rt(r) {
|
|
315
315
|
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function at() {
|
|
318
318
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
319
319
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
320
320
|
}
|
|
@@ -322,8 +322,8 @@ function ye(r, e) {
|
|
|
322
322
|
var t = Object.keys(r);
|
|
323
323
|
if (Object.getOwnPropertySymbols) {
|
|
324
324
|
var a = Object.getOwnPropertySymbols(r);
|
|
325
|
-
e && (a = a.filter(function(
|
|
326
|
-
return Object.getOwnPropertyDescriptor(r,
|
|
325
|
+
e && (a = a.filter(function(s) {
|
|
326
|
+
return Object.getOwnPropertyDescriptor(r, s).enumerable;
|
|
327
327
|
})), t.push.apply(t, a);
|
|
328
328
|
}
|
|
329
329
|
return t;
|
|
@@ -332,17 +332,17 @@ function me(r) {
|
|
|
332
332
|
for (var e = 1; e < arguments.length; e++) {
|
|
333
333
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
334
334
|
e % 2 ? ye(Object(t), !0).forEach(function(a) {
|
|
335
|
-
|
|
335
|
+
tt(r, a, t[a]);
|
|
336
336
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ye(Object(t)).forEach(function(a) {
|
|
337
337
|
Object.defineProperty(r, a, Object.getOwnPropertyDescriptor(t, a));
|
|
338
338
|
});
|
|
339
339
|
}
|
|
340
340
|
return r;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
return
|
|
342
|
+
function nt(r) {
|
|
343
|
+
return et(r) || rt(r) || Ce(r) || at();
|
|
344
344
|
}
|
|
345
|
-
function
|
|
345
|
+
function it(r, e) {
|
|
346
346
|
if (typeof r != "object" || !r) return r;
|
|
347
347
|
var t = r[Symbol.toPrimitive];
|
|
348
348
|
if (t !== void 0) {
|
|
@@ -352,11 +352,11 @@ function nt(r, e) {
|
|
|
352
352
|
}
|
|
353
353
|
return (e === "string" ? String : Number)(r);
|
|
354
354
|
}
|
|
355
|
-
function
|
|
356
|
-
var e =
|
|
355
|
+
function ot(r) {
|
|
356
|
+
var e = it(r, "string");
|
|
357
357
|
return typeof e == "symbol" ? e : e + "";
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ce(r, e) {
|
|
360
360
|
if (r) {
|
|
361
361
|
if (typeof r == "string") return ve(r, e);
|
|
362
362
|
var t = {}.toString.call(r).slice(8, -1);
|
|
@@ -372,8 +372,8 @@ var B = {
|
|
|
372
372
|
activateTrap: function(e, t) {
|
|
373
373
|
var a = B.getActiveTrap(e);
|
|
374
374
|
t !== a && B.pauseTrap(e);
|
|
375
|
-
var
|
|
376
|
-
|
|
375
|
+
var s = e.indexOf(t);
|
|
376
|
+
s === -1 || e.splice(s, 1), e.push(t);
|
|
377
377
|
},
|
|
378
378
|
// Removes the trap from the top of the stack, then unpauses the next trap down.
|
|
379
379
|
deactivateTrap: function(e, t) {
|
|
@@ -390,32 +390,32 @@ var B = {
|
|
|
390
390
|
var t = B.getActiveTrap(e);
|
|
391
391
|
t && !t._isManuallyPaused() && t._setPausedState(!1);
|
|
392
392
|
}
|
|
393
|
-
}, ot = function(e) {
|
|
394
|
-
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
395
393
|
}, ut = function(e) {
|
|
394
|
+
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
395
|
+
}, st = function(e) {
|
|
396
396
|
return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
|
|
397
397
|
}, X = function(e) {
|
|
398
398
|
return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
|
|
399
|
-
}, st = function(e) {
|
|
400
|
-
return X(e) && !e.shiftKey;
|
|
401
399
|
}, ct = function(e) {
|
|
400
|
+
return X(e) && !e.shiftKey;
|
|
401
|
+
}, lt = function(e) {
|
|
402
402
|
return X(e) && e.shiftKey;
|
|
403
403
|
}, ge = function(e) {
|
|
404
404
|
return setTimeout(e, 0);
|
|
405
405
|
}, Z = function(e) {
|
|
406
|
-
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0),
|
|
407
|
-
a[
|
|
406
|
+
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
407
|
+
a[s - 1] = arguments[s];
|
|
408
408
|
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
409
409
|
}, ee = function(e) {
|
|
410
410
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
411
|
-
},
|
|
412
|
-
var a = (t == null ? void 0 : t.document) || document,
|
|
411
|
+
}, ft = [], dt = function(e, t) {
|
|
412
|
+
var a = (t == null ? void 0 : t.document) || document, s = (t == null ? void 0 : t.trapStack) || ft, c = me({
|
|
413
413
|
returnFocusOnDeactivate: !0,
|
|
414
414
|
escapeDeactivates: !0,
|
|
415
415
|
delayInitialFocus: !0,
|
|
416
416
|
isolateSubtrees: !1,
|
|
417
|
-
isKeyForward:
|
|
418
|
-
isKeyBackward:
|
|
417
|
+
isKeyForward: ct,
|
|
418
|
+
isKeyBackward: lt
|
|
419
419
|
}, t), n = {
|
|
420
420
|
// containers given to createFocusTrap()
|
|
421
421
|
/** @type {Array<HTMLElement>} */
|
|
@@ -460,35 +460,35 @@ var B = {
|
|
|
460
460
|
delayInitialFocusTimer: void 0,
|
|
461
461
|
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
462
462
|
recentNavEvent: void 0
|
|
463
|
-
},
|
|
463
|
+
}, p, y = function(o, i, l) {
|
|
464
464
|
return o && o[i] !== void 0 ? o[i] : c[l || i];
|
|
465
465
|
}, k = function(o, i) {
|
|
466
466
|
var l = typeof (i == null ? void 0 : i.composedPath) == "function" ? i.composedPath() : void 0;
|
|
467
|
-
return n.containerGroups.findIndex(function(
|
|
468
|
-
var
|
|
469
|
-
return
|
|
467
|
+
return n.containerGroups.findIndex(function(g) {
|
|
468
|
+
var h = g.container, w = g.tabbableNodes;
|
|
469
|
+
return h.contains(o) || // fall back to explicit tabbable search which will take into consideration any
|
|
470
470
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
471
471
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
472
472
|
// look inside web components even if open)
|
|
473
|
-
(l == null ? void 0 : l.includes(
|
|
474
|
-
return
|
|
473
|
+
(l == null ? void 0 : l.includes(h)) || w.find(function(v) {
|
|
474
|
+
return v === o;
|
|
475
475
|
});
|
|
476
476
|
});
|
|
477
477
|
}, S = function(o) {
|
|
478
|
-
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = i.hasFallback,
|
|
479
|
-
if (typeof
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
478
|
+
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = i.hasFallback, g = l === void 0 ? !1 : l, h = i.params, w = h === void 0 ? [] : h, v = c[o];
|
|
479
|
+
if (typeof v == "function" && (v = v.apply(void 0, nt(w))), v === !0 && (v = void 0), !v) {
|
|
480
|
+
if (v === void 0 || v === !1)
|
|
481
|
+
return v;
|
|
482
482
|
throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
|
|
483
483
|
}
|
|
484
|
-
var E =
|
|
485
|
-
if (typeof
|
|
484
|
+
var E = v;
|
|
485
|
+
if (typeof v == "string") {
|
|
486
486
|
try {
|
|
487
|
-
E = a.querySelector(
|
|
487
|
+
E = a.querySelector(v);
|
|
488
488
|
} catch (F) {
|
|
489
489
|
throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(F.message, '"'));
|
|
490
490
|
}
|
|
491
|
-
if (!E && !
|
|
491
|
+
if (!E && !g)
|
|
492
492
|
throw new Error("`".concat(o, "` as selector refers to no known node"));
|
|
493
493
|
}
|
|
494
494
|
return E;
|
|
@@ -511,12 +511,12 @@ var B = {
|
|
|
511
511
|
return o;
|
|
512
512
|
}, R = function() {
|
|
513
513
|
if (n.containerGroups = n.containers.map(function(o) {
|
|
514
|
-
var i =
|
|
514
|
+
var i = Re(o, c.tabbableOptions), l = Pe(o, c.tabbableOptions), g = i.length > 0 ? i[0] : void 0, h = i.length > 0 ? i[i.length - 1] : void 0, w = l.find(function(F) {
|
|
515
515
|
return W(F);
|
|
516
|
-
}),
|
|
516
|
+
}), v = l.slice().reverse().find(function(F) {
|
|
517
517
|
return W(F);
|
|
518
518
|
}), E = !!i.find(function(F) {
|
|
519
|
-
return
|
|
519
|
+
return K(F) > 0;
|
|
520
520
|
});
|
|
521
521
|
return {
|
|
522
522
|
container: o,
|
|
@@ -525,9 +525,9 @@ var B = {
|
|
|
525
525
|
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
526
526
|
posTabIndexesFound: E,
|
|
527
527
|
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
528
|
-
firstTabbableNode:
|
|
528
|
+
firstTabbableNode: g,
|
|
529
529
|
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
530
|
-
lastTabbableNode:
|
|
530
|
+
lastTabbableNode: h,
|
|
531
531
|
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
532
532
|
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
533
533
|
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
@@ -538,7 +538,7 @@ var B = {
|
|
|
538
538
|
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
539
539
|
firstDomTabbableNode: w,
|
|
540
540
|
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
541
|
-
lastDomTabbableNode:
|
|
541
|
+
lastDomTabbableNode: v,
|
|
542
542
|
/**
|
|
543
543
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
544
544
|
* in this container, if any.
|
|
@@ -547,13 +547,13 @@ var B = {
|
|
|
547
547
|
* in reverse.
|
|
548
548
|
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
549
549
|
*/
|
|
550
|
-
nextTabbableNode: function(
|
|
551
|
-
var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0,
|
|
552
|
-
return
|
|
550
|
+
nextTabbableNode: function(j) {
|
|
551
|
+
var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, x = i.indexOf(j);
|
|
552
|
+
return x < 0 ? _ ? l.slice(l.indexOf(j) + 1).find(function(U) {
|
|
553
553
|
return W(U);
|
|
554
|
-
}) : l.slice(0, l.indexOf(
|
|
554
|
+
}) : l.slice(0, l.indexOf(j)).reverse().find(function(U) {
|
|
555
555
|
return W(U);
|
|
556
|
-
}) : i[
|
|
556
|
+
}) : i[x + (_ ? 1 : -1)];
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
559
|
}), n.tabbableGroups = n.containerGroups.filter(function(o) {
|
|
@@ -564,60 +564,60 @@ var B = {
|
|
|
564
564
|
return o.posTabIndexesFound;
|
|
565
565
|
}) && n.containerGroups.length > 1)
|
|
566
566
|
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.");
|
|
567
|
-
},
|
|
567
|
+
}, A = function(o) {
|
|
568
568
|
var i = o.activeElement;
|
|
569
569
|
if (i)
|
|
570
|
-
return i.shadowRoot && i.shadowRoot.activeElement !== null ?
|
|
571
|
-
},
|
|
572
|
-
if (o !== !1 && o !==
|
|
570
|
+
return i.shadowRoot && i.shadowRoot.activeElement !== null ? A(i.shadowRoot) : i;
|
|
571
|
+
}, P = function(o) {
|
|
572
|
+
if (o !== !1 && o !== A(document)) {
|
|
573
573
|
if (!o || !o.focus) {
|
|
574
|
-
|
|
574
|
+
P(D());
|
|
575
575
|
return;
|
|
576
576
|
}
|
|
577
577
|
o.focus({
|
|
578
578
|
preventScroll: !!c.preventScroll
|
|
579
|
-
}), n.mostRecentlyFocusedNode = o,
|
|
579
|
+
}), n.mostRecentlyFocusedNode = o, ut(o) && o.select();
|
|
580
580
|
}
|
|
581
|
-
},
|
|
581
|
+
}, Y = function(o) {
|
|
582
582
|
var i = S("setReturnFocus", {
|
|
583
583
|
params: [o]
|
|
584
584
|
});
|
|
585
585
|
return i || (i === !1 ? !1 : o);
|
|
586
|
-
},
|
|
587
|
-
var i = o.target, l = o.event,
|
|
586
|
+
}, C = function(o) {
|
|
587
|
+
var i = o.target, l = o.event, g = o.isBackward, h = g === void 0 ? !1 : g;
|
|
588
588
|
i = i || ee(l), R();
|
|
589
589
|
var w = null;
|
|
590
590
|
if (n.tabbableGroups.length > 0) {
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
593
|
-
|
|
594
|
-
else if (
|
|
591
|
+
var v = k(i, l), E = v >= 0 ? n.containerGroups[v] : void 0;
|
|
592
|
+
if (v < 0)
|
|
593
|
+
h ? w = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : w = n.tabbableGroups[0].firstTabbableNode;
|
|
594
|
+
else if (h) {
|
|
595
595
|
var F = n.tabbableGroups.findIndex(function(le) {
|
|
596
596
|
var fe = le.firstTabbableNode;
|
|
597
597
|
return i === fe;
|
|
598
598
|
});
|
|
599
|
-
if (F < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i, !1)) && (F =
|
|
600
|
-
var
|
|
601
|
-
w =
|
|
599
|
+
if (F < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i, !1)) && (F = v), F >= 0) {
|
|
600
|
+
var j = F === 0 ? n.tabbableGroups.length - 1 : F - 1, _ = n.tabbableGroups[j];
|
|
601
|
+
w = K(i) >= 0 ? _.lastTabbableNode : _.lastDomTabbableNode;
|
|
602
602
|
} else X(l) || (w = E.nextTabbableNode(i, !1));
|
|
603
603
|
} else {
|
|
604
|
-
var
|
|
604
|
+
var x = n.tabbableGroups.findIndex(function(le) {
|
|
605
605
|
var fe = le.lastTabbableNode;
|
|
606
606
|
return i === fe;
|
|
607
607
|
});
|
|
608
|
-
if (
|
|
609
|
-
var U =
|
|
610
|
-
w =
|
|
608
|
+
if (x < 0 && (E.container === i || ae(i, c.tabbableOptions) && !W(i, c.tabbableOptions) && !E.nextTabbableNode(i)) && (x = v), x >= 0) {
|
|
609
|
+
var U = x === n.tabbableGroups.length - 1 ? 0 : x + 1, M = n.tabbableGroups[U];
|
|
610
|
+
w = K(i) >= 0 ? M.firstTabbableNode : M.firstDomTabbableNode;
|
|
611
611
|
} else X(l) || (w = E.nextTabbableNode(i));
|
|
612
612
|
}
|
|
613
613
|
} else
|
|
614
614
|
w = S("fallbackFocus");
|
|
615
615
|
return w;
|
|
616
|
-
},
|
|
616
|
+
}, I = function(o) {
|
|
617
617
|
var i = ee(o);
|
|
618
618
|
if (!(k(i, o) >= 0)) {
|
|
619
619
|
if (Z(c.clickOutsideDeactivates, o)) {
|
|
620
|
-
|
|
620
|
+
p.deactivate({
|
|
621
621
|
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
622
622
|
// which will result in the outside click setting focus to the node
|
|
623
623
|
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
@@ -630,115 +630,115 @@ var B = {
|
|
|
630
630
|
}
|
|
631
631
|
Z(c.allowOutsideClick, o) || o.preventDefault();
|
|
632
632
|
}
|
|
633
|
-
},
|
|
633
|
+
}, q = function(o) {
|
|
634
634
|
var i = ee(o), l = k(i, o) >= 0;
|
|
635
635
|
if (l || i instanceof Document)
|
|
636
636
|
l && (n.mostRecentlyFocusedNode = i);
|
|
637
637
|
else {
|
|
638
638
|
o.stopImmediatePropagation();
|
|
639
|
-
var
|
|
639
|
+
var g, h = !0;
|
|
640
640
|
if (n.mostRecentlyFocusedNode)
|
|
641
|
-
if (
|
|
642
|
-
var w = k(n.mostRecentlyFocusedNode),
|
|
643
|
-
if (
|
|
644
|
-
var E =
|
|
641
|
+
if (K(n.mostRecentlyFocusedNode) > 0) {
|
|
642
|
+
var w = k(n.mostRecentlyFocusedNode), v = n.containerGroups[w].tabbableNodes;
|
|
643
|
+
if (v.length > 0) {
|
|
644
|
+
var E = v.findIndex(function(F) {
|
|
645
645
|
return F === n.mostRecentlyFocusedNode;
|
|
646
646
|
});
|
|
647
|
-
E >= 0 && (c.isKeyForward(n.recentNavEvent) ? E + 1 <
|
|
647
|
+
E >= 0 && (c.isKeyForward(n.recentNavEvent) ? E + 1 < v.length && (g = v[E + 1], h = !1) : E - 1 >= 0 && (g = v[E - 1], h = !1));
|
|
648
648
|
}
|
|
649
649
|
} else
|
|
650
650
|
n.containerGroups.some(function(F) {
|
|
651
|
-
return F.tabbableNodes.some(function(
|
|
652
|
-
return
|
|
651
|
+
return F.tabbableNodes.some(function(j) {
|
|
652
|
+
return K(j) > 0;
|
|
653
653
|
});
|
|
654
|
-
}) || (
|
|
654
|
+
}) || (h = !1);
|
|
655
655
|
else
|
|
656
|
-
|
|
657
|
-
|
|
656
|
+
h = !1;
|
|
657
|
+
h && (g = C({
|
|
658
658
|
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
659
659
|
// outside the trap causing the focus escape we're trying to fix)
|
|
660
660
|
target: n.mostRecentlyFocusedNode,
|
|
661
661
|
isBackward: c.isKeyBackward(n.recentNavEvent)
|
|
662
|
-
})),
|
|
662
|
+
})), P(g || n.mostRecentlyFocusedNode || D());
|
|
663
663
|
}
|
|
664
664
|
n.recentNavEvent = void 0;
|
|
665
|
-
},
|
|
665
|
+
}, V = function(o) {
|
|
666
666
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
667
667
|
n.recentNavEvent = o;
|
|
668
|
-
var l =
|
|
668
|
+
var l = C({
|
|
669
669
|
event: o,
|
|
670
670
|
isBackward: i
|
|
671
671
|
});
|
|
672
|
-
l && (X(o) && o.preventDefault(),
|
|
672
|
+
l && (X(o) && o.preventDefault(), P(l));
|
|
673
673
|
}, $ = function(o) {
|
|
674
|
-
(c.isKeyForward(o) || c.isKeyBackward(o)) &&
|
|
674
|
+
(c.isKeyForward(o) || c.isKeyBackward(o)) && V(o, c.isKeyBackward(o));
|
|
675
675
|
}, G = function(o) {
|
|
676
|
-
|
|
677
|
-
},
|
|
676
|
+
st(o) && Z(c.escapeDeactivates, o) !== !1 && (o.preventDefault(), p.deactivate());
|
|
677
|
+
}, L = function(o) {
|
|
678
678
|
var i = ee(o);
|
|
679
679
|
k(i, o) >= 0 || Z(c.clickOutsideDeactivates, o) || Z(c.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
|
|
680
|
-
},
|
|
680
|
+
}, d = function() {
|
|
681
681
|
if (n.active)
|
|
682
|
-
return B.activateTrap(
|
|
683
|
-
|
|
684
|
-
}) :
|
|
682
|
+
return B.activateTrap(s, p), n.delayInitialFocusTimer = c.delayInitialFocus ? ge(function() {
|
|
683
|
+
P(D());
|
|
684
|
+
}) : P(D()), a.addEventListener("focusin", q, !0), a.addEventListener("mousedown", I, {
|
|
685
685
|
capture: !0,
|
|
686
686
|
passive: !1
|
|
687
|
-
}), a.addEventListener("touchstart",
|
|
687
|
+
}), a.addEventListener("touchstart", I, {
|
|
688
688
|
capture: !0,
|
|
689
689
|
passive: !1
|
|
690
|
-
}), a.addEventListener("click",
|
|
690
|
+
}), a.addEventListener("click", L, {
|
|
691
691
|
capture: !0,
|
|
692
692
|
passive: !1
|
|
693
693
|
}), a.addEventListener("keydown", $, {
|
|
694
694
|
capture: !0,
|
|
695
695
|
passive: !1
|
|
696
|
-
}), a.addEventListener("keydown", G),
|
|
696
|
+
}), a.addEventListener("keydown", G), p;
|
|
697
697
|
}, f = function(o) {
|
|
698
|
-
n.active && !n.paused &&
|
|
699
|
-
var i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(),
|
|
698
|
+
n.active && !n.paused && p._setSubtreeIsolation(!1), n.adjacentElements.clear(), n.alreadySilent.clear();
|
|
699
|
+
var i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), g = he(o), h;
|
|
700
700
|
try {
|
|
701
|
-
for (
|
|
702
|
-
var w =
|
|
701
|
+
for (g.s(); !(h = g.n()).done; ) {
|
|
702
|
+
var w = h.value;
|
|
703
703
|
i.add(w);
|
|
704
|
-
for (var
|
|
704
|
+
for (var v = typeof ShadowRoot < "u" && w.getRootNode() instanceof ShadowRoot, E = w; E; ) {
|
|
705
705
|
i.add(E);
|
|
706
|
-
var F = E.parentElement,
|
|
707
|
-
F ?
|
|
708
|
-
var _ = he(
|
|
706
|
+
var F = E.parentElement, j = [];
|
|
707
|
+
F ? j = F.children : !F && v && (j = E.getRootNode().children, F = E.getRootNode().host, v = typeof ShadowRoot < "u" && F.getRootNode() instanceof ShadowRoot);
|
|
708
|
+
var _ = he(j), x;
|
|
709
709
|
try {
|
|
710
|
-
for (_.s(); !(
|
|
711
|
-
var U =
|
|
710
|
+
for (_.s(); !(x = _.n()).done; ) {
|
|
711
|
+
var U = x.value;
|
|
712
712
|
l.add(U);
|
|
713
713
|
}
|
|
714
|
-
} catch (
|
|
715
|
-
_.e(
|
|
714
|
+
} catch (M) {
|
|
715
|
+
_.e(M);
|
|
716
716
|
} finally {
|
|
717
717
|
_.f();
|
|
718
718
|
}
|
|
719
719
|
E = F;
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
|
-
} catch (
|
|
723
|
-
|
|
722
|
+
} catch (M) {
|
|
723
|
+
g.e(M);
|
|
724
724
|
} finally {
|
|
725
|
-
|
|
725
|
+
g.f();
|
|
726
726
|
}
|
|
727
|
-
i.forEach(function(
|
|
728
|
-
l.delete(
|
|
727
|
+
i.forEach(function(M) {
|
|
728
|
+
l.delete(M);
|
|
729
729
|
}), n.adjacentElements = l;
|
|
730
|
-
},
|
|
730
|
+
}, m = function() {
|
|
731
731
|
if (n.active)
|
|
732
|
-
return a.removeEventListener("focusin",
|
|
733
|
-
},
|
|
732
|
+
return a.removeEventListener("focusin", q, !0), a.removeEventListener("mousedown", I, !0), a.removeEventListener("touchstart", I, !0), a.removeEventListener("click", L, !0), a.removeEventListener("keydown", $, !0), a.removeEventListener("keydown", G), p;
|
|
733
|
+
}, u = function(o) {
|
|
734
734
|
var i = o.some(function(l) {
|
|
735
|
-
var
|
|
736
|
-
return
|
|
737
|
-
return
|
|
735
|
+
var g = Array.from(l.removedNodes);
|
|
736
|
+
return g.some(function(h) {
|
|
737
|
+
return h === n.mostRecentlyFocusedNode;
|
|
738
738
|
});
|
|
739
739
|
});
|
|
740
|
-
i &&
|
|
741
|
-
}, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(
|
|
740
|
+
i && P(D());
|
|
741
|
+
}, T = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(u) : void 0, O = function() {
|
|
742
742
|
T && (T.disconnect(), n.active && !n.paused && n.containers.map(function(o) {
|
|
743
743
|
T.observe(o, {
|
|
744
744
|
subtree: !0,
|
|
@@ -746,7 +746,7 @@ var B = {
|
|
|
746
746
|
});
|
|
747
747
|
}));
|
|
748
748
|
};
|
|
749
|
-
return
|
|
749
|
+
return p = {
|
|
750
750
|
get active() {
|
|
751
751
|
return n.active;
|
|
752
752
|
},
|
|
@@ -756,25 +756,25 @@ var B = {
|
|
|
756
756
|
activate: function(o) {
|
|
757
757
|
if (n.active)
|
|
758
758
|
return this;
|
|
759
|
-
var i =
|
|
760
|
-
if (
|
|
761
|
-
var
|
|
762
|
-
(
|
|
759
|
+
var i = y(o, "onActivate"), l = y(o, "onPostActivate"), g = y(o, "checkCanFocusTrap"), h = B.getActiveTrap(s), w = !1;
|
|
760
|
+
if (h && !h.paused) {
|
|
761
|
+
var v;
|
|
762
|
+
(v = h._setSubtreeIsolation) === null || v === void 0 || v.call(h, !1), w = !0;
|
|
763
763
|
}
|
|
764
764
|
try {
|
|
765
|
-
|
|
765
|
+
g || R(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = A(a), i == null || i();
|
|
766
766
|
var E = function() {
|
|
767
|
-
|
|
767
|
+
g && R(), d(), O(), c.isolateSubtrees && p._setSubtreeIsolation(!0), l == null || l();
|
|
768
768
|
};
|
|
769
|
-
if (
|
|
770
|
-
return
|
|
769
|
+
if (g)
|
|
770
|
+
return g(n.containers.concat()).then(E, E), this;
|
|
771
771
|
E();
|
|
772
|
-
} catch (
|
|
773
|
-
if (
|
|
772
|
+
} catch (j) {
|
|
773
|
+
if (h === B.getActiveTrap(s) && w) {
|
|
774
774
|
var F;
|
|
775
|
-
(F =
|
|
775
|
+
(F = h._setSubtreeIsolation) === null || F === void 0 || F.call(h, !0);
|
|
776
776
|
}
|
|
777
|
-
throw
|
|
777
|
+
throw j;
|
|
778
778
|
}
|
|
779
779
|
return this;
|
|
780
780
|
},
|
|
@@ -786,29 +786,29 @@ var B = {
|
|
|
786
786
|
onPostDeactivate: c.onPostDeactivate,
|
|
787
787
|
checkCanReturnFocus: c.checkCanReturnFocus
|
|
788
788
|
}, o);
|
|
789
|
-
clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused ||
|
|
790
|
-
var l =
|
|
789
|
+
clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, n.paused || p._setSubtreeIsolation(!1), n.alreadySilent.clear(), m(), n.active = !1, n.paused = !1, O(), B.deactivateTrap(s, p);
|
|
790
|
+
var l = y(i, "onDeactivate"), g = y(i, "onPostDeactivate"), h = y(i, "checkCanReturnFocus"), w = y(i, "returnFocus", "returnFocusOnDeactivate");
|
|
791
791
|
l == null || l();
|
|
792
|
-
var
|
|
792
|
+
var v = function() {
|
|
793
793
|
ge(function() {
|
|
794
|
-
w &&
|
|
794
|
+
w && P(Y(n.nodeFocusedBeforeActivation)), g == null || g();
|
|
795
795
|
});
|
|
796
796
|
};
|
|
797
|
-
return w &&
|
|
797
|
+
return w && h ? (h(Y(n.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this);
|
|
798
798
|
},
|
|
799
799
|
pause: function(o) {
|
|
800
800
|
return n.active ? (n.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
|
|
801
801
|
},
|
|
802
802
|
unpause: function(o) {
|
|
803
|
-
return n.active ? (n.manuallyPaused = !1,
|
|
803
|
+
return n.active ? (n.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
|
|
804
804
|
},
|
|
805
805
|
updateContainerElements: function(o) {
|
|
806
806
|
var i = [].concat(o).filter(Boolean);
|
|
807
807
|
return n.containers = i.map(function(l) {
|
|
808
808
|
return typeof l == "string" ? a.querySelector(l) : l;
|
|
809
|
-
}), c.isolateSubtrees && f(n.containers), n.active && (R(), c.isolateSubtrees && !n.paused &&
|
|
809
|
+
}), c.isolateSubtrees && f(n.containers), n.active && (R(), c.isolateSubtrees && !n.paused && p._setSubtreeIsolation(!0)), O(), this;
|
|
810
810
|
}
|
|
811
|
-
}, Object.defineProperties(
|
|
811
|
+
}, Object.defineProperties(p, {
|
|
812
812
|
_isManuallyPaused: {
|
|
813
813
|
value: function() {
|
|
814
814
|
return n.manuallyPaused;
|
|
@@ -819,11 +819,11 @@ var B = {
|
|
|
819
819
|
if (n.paused === o)
|
|
820
820
|
return this;
|
|
821
821
|
if (n.paused = o, o) {
|
|
822
|
-
var l =
|
|
823
|
-
l == null || l(),
|
|
822
|
+
var l = y(i, "onPause"), g = y(i, "onPostPause");
|
|
823
|
+
l == null || l(), m(), O(), p._setSubtreeIsolation(!1), g == null || g();
|
|
824
824
|
} else {
|
|
825
|
-
var
|
|
826
|
-
|
|
825
|
+
var h = y(i, "onUnpause"), w = y(i, "onPostUnpause");
|
|
826
|
+
h == null || h(), p._setSubtreeIsolation(!0), R(), d(), O(), w == null || w();
|
|
827
827
|
}
|
|
828
828
|
return this;
|
|
829
829
|
}
|
|
@@ -852,113 +852,113 @@ var B = {
|
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
|
-
}),
|
|
855
|
+
}), p.updateContainerElements(e), p;
|
|
856
856
|
};
|
|
857
|
-
const
|
|
857
|
+
const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
858
858
|
__proto__: null,
|
|
859
|
-
createFocusTrap:
|
|
860
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
859
|
+
createFocusTrap: dt
|
|
860
|
+
}, Symbol.toStringTag, { value: "Module" })), pt = /* @__PURE__ */ ke(vt), bt = /* @__PURE__ */ ke(Qe);
|
|
861
861
|
var Te;
|
|
862
|
-
function
|
|
862
|
+
function ht() {
|
|
863
863
|
if (Te) return Q.exports;
|
|
864
864
|
Te = 1;
|
|
865
|
-
function r(
|
|
865
|
+
function r(d) {
|
|
866
866
|
"@babel/helpers - typeof";
|
|
867
867
|
return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(f) {
|
|
868
868
|
return typeof f;
|
|
869
869
|
} : function(f) {
|
|
870
870
|
return f && typeof Symbol == "function" && f.constructor === Symbol && f !== Symbol.prototype ? "symbol" : typeof f;
|
|
871
|
-
}, r(
|
|
871
|
+
}, r(d);
|
|
872
872
|
}
|
|
873
873
|
var e, t;
|
|
874
|
-
function a(
|
|
875
|
-
if (!(
|
|
874
|
+
function a(d, f) {
|
|
875
|
+
if (!(d instanceof f)) throw new TypeError("Cannot call a class as a function");
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
for (var
|
|
879
|
-
var
|
|
880
|
-
|
|
877
|
+
function s(d, f) {
|
|
878
|
+
for (var m = 0; m < f.length; m++) {
|
|
879
|
+
var u = f[m];
|
|
880
|
+
u.enumerable = u.enumerable || !1, u.configurable = !0, "value" in u && (u.writable = !0), Object.defineProperty(d, P(u.key), u);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
function c(
|
|
884
|
-
return f &&
|
|
883
|
+
function c(d, f, m) {
|
|
884
|
+
return f && s(d.prototype, f), Object.defineProperty(d, "prototype", { writable: !1 }), d;
|
|
885
885
|
}
|
|
886
|
-
function n(
|
|
887
|
-
return f = S(f),
|
|
886
|
+
function n(d, f, m) {
|
|
887
|
+
return f = S(f), p(d, k() ? Reflect.construct(f, m || [], S(d).constructor) : f.apply(d, m));
|
|
888
888
|
}
|
|
889
|
-
function
|
|
889
|
+
function p(d, f) {
|
|
890
890
|
if (f && (r(f) == "object" || typeof f == "function")) return f;
|
|
891
891
|
if (f !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
892
|
-
return
|
|
892
|
+
return y(d);
|
|
893
893
|
}
|
|
894
|
-
function
|
|
895
|
-
if (
|
|
896
|
-
return
|
|
894
|
+
function y(d) {
|
|
895
|
+
if (d === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
896
|
+
return d;
|
|
897
897
|
}
|
|
898
898
|
function k() {
|
|
899
899
|
try {
|
|
900
|
-
var
|
|
900
|
+
var d = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
901
901
|
}));
|
|
902
902
|
} catch {
|
|
903
903
|
}
|
|
904
904
|
return (k = function() {
|
|
905
|
-
return !!
|
|
905
|
+
return !!d;
|
|
906
906
|
})();
|
|
907
907
|
}
|
|
908
|
-
function S(
|
|
908
|
+
function S(d) {
|
|
909
909
|
return S = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(f) {
|
|
910
910
|
return f.__proto__ || Object.getPrototypeOf(f);
|
|
911
|
-
}, S(
|
|
911
|
+
}, S(d);
|
|
912
912
|
}
|
|
913
|
-
function D(
|
|
913
|
+
function D(d, f) {
|
|
914
914
|
if (typeof f != "function" && f !== null) throw new TypeError("Super expression must either be null or a function");
|
|
915
|
-
|
|
915
|
+
d.prototype = Object.create(f && f.prototype, { constructor: { value: d, writable: !0, configurable: !0 } }), Object.defineProperty(d, "prototype", { writable: !1 }), f && R(d, f);
|
|
916
916
|
}
|
|
917
|
-
function R(
|
|
918
|
-
return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(
|
|
919
|
-
return
|
|
920
|
-
}, R(
|
|
917
|
+
function R(d, f) {
|
|
918
|
+
return R = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(m, u) {
|
|
919
|
+
return m.__proto__ = u, m;
|
|
920
|
+
}, R(d, f);
|
|
921
921
|
}
|
|
922
|
-
function
|
|
923
|
-
return (f =
|
|
922
|
+
function A(d, f, m) {
|
|
923
|
+
return (f = P(f)) in d ? Object.defineProperty(d, f, { value: m, enumerable: !0, configurable: !0, writable: !0 }) : d[f] = m, d;
|
|
924
924
|
}
|
|
925
|
-
function
|
|
926
|
-
var f =
|
|
925
|
+
function P(d) {
|
|
926
|
+
var f = Y(d, "string");
|
|
927
927
|
return r(f) == "symbol" ? f : f + "";
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
if (r(
|
|
931
|
-
var
|
|
932
|
-
if (
|
|
933
|
-
var
|
|
934
|
-
if (r(
|
|
929
|
+
function Y(d, f) {
|
|
930
|
+
if (r(d) != "object" || !d) return d;
|
|
931
|
+
var m = d[Symbol.toPrimitive];
|
|
932
|
+
if (m !== void 0) {
|
|
933
|
+
var u = m.call(d, f);
|
|
934
|
+
if (r(u) != "object") return u;
|
|
935
935
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
936
936
|
}
|
|
937
|
-
return (f === "string" ? String : Number)(
|
|
937
|
+
return (f === "string" ? String : Number)(d);
|
|
938
938
|
}
|
|
939
|
-
var
|
|
940
|
-
function f(
|
|
941
|
-
var
|
|
942
|
-
a(this, f),
|
|
943
|
-
var o, i = (o = this.internalOptions[
|
|
939
|
+
var C = Ie, I = pt, q = I.createFocusTrap, V = bt, $ = V.isFocusable, G = parseInt((e = (t = /^(\d+)\./.exec(C.version)) === null || t === void 0 ? void 0 : t[1]) !== null && e !== void 0 ? e : 0, 10), L = /* @__PURE__ */ (function(d) {
|
|
940
|
+
function f(m) {
|
|
941
|
+
var u;
|
|
942
|
+
a(this, f), u = n(this, f, [m]), A(u, "getNodeForOption", function(b) {
|
|
943
|
+
var o, i = (o = this.internalOptions[b]) !== null && o !== void 0 ? o : this.originalOptions[b];
|
|
944
944
|
if (typeof i == "function") {
|
|
945
|
-
for (var l = arguments.length,
|
|
946
|
-
|
|
947
|
-
i = i.apply(void 0,
|
|
945
|
+
for (var l = arguments.length, g = new Array(l > 1 ? l - 1 : 0), h = 1; h < l; h++)
|
|
946
|
+
g[h - 1] = arguments[h];
|
|
947
|
+
i = i.apply(void 0, g);
|
|
948
948
|
}
|
|
949
949
|
if (i === !0 && (i = void 0), !i) {
|
|
950
950
|
if (i === void 0 || i === !1)
|
|
951
951
|
return i;
|
|
952
|
-
throw new Error("`".concat(
|
|
952
|
+
throw new Error("`".concat(b, "` was specified but was not a node, or did not return a node"));
|
|
953
953
|
}
|
|
954
954
|
var w = i;
|
|
955
955
|
if (typeof i == "string") {
|
|
956
|
-
var
|
|
957
|
-
if (w = (
|
|
958
|
-
throw new Error("`".concat(
|
|
956
|
+
var v;
|
|
957
|
+
if (w = (v = this.getDocument()) === null || v === void 0 ? void 0 : v.querySelector(i), !w)
|
|
958
|
+
throw new Error("`".concat(b, "` as selector refers to no known node"));
|
|
959
959
|
}
|
|
960
960
|
return w;
|
|
961
|
-
}),
|
|
961
|
+
}), u.handleDeactivate = u.handleDeactivate.bind(u), u.handlePostDeactivate = u.handlePostDeactivate.bind(u), u.handleClickOutsideDeactivates = u.handleClickOutsideDeactivates.bind(u), u.internalOptions = {
|
|
962
962
|
// We need to hijack the returnFocusOnDeactivate option,
|
|
963
963
|
// because React can move focus into the element before we arrived at
|
|
964
964
|
// this lifecycle hook (e.g. with autoFocus inputs). So the component
|
|
@@ -968,14 +968,14 @@ function bt() {
|
|
|
968
968
|
// the rest of these are also related to deactivation of the trap, and we
|
|
969
969
|
// need to use them and control them as well
|
|
970
970
|
checkCanReturnFocus: null,
|
|
971
|
-
onDeactivate:
|
|
972
|
-
onPostDeactivate:
|
|
971
|
+
onDeactivate: u.handleDeactivate,
|
|
972
|
+
onPostDeactivate: u.handlePostDeactivate,
|
|
973
973
|
// we need to special-case this setting as well so that we can know if we should
|
|
974
974
|
// NOT return focus if the trap gets auto-deactivated as the result of an
|
|
975
975
|
// outside click (otherwise, we'll always think we should return focus because
|
|
976
976
|
// of how we manage that flag internally here)
|
|
977
|
-
clickOutsideDeactivates:
|
|
978
|
-
},
|
|
977
|
+
clickOutsideDeactivates: u.handleClickOutsideDeactivates
|
|
978
|
+
}, u.originalOptions = {
|
|
979
979
|
// because of the above `internalOptions`, we maintain our own flag for
|
|
980
980
|
// this option, and default it to `true` because that's focus-trap's default
|
|
981
981
|
returnFocusOnDeactivate: !0,
|
|
@@ -988,18 +988,18 @@ function bt() {
|
|
|
988
988
|
// the user's setting, defaulted to false since focus-trap defaults this to false
|
|
989
989
|
clickOutsideDeactivates: !1
|
|
990
990
|
};
|
|
991
|
-
var T =
|
|
991
|
+
var T = m.focusTrapOptions;
|
|
992
992
|
for (var O in T)
|
|
993
993
|
if (Object.prototype.hasOwnProperty.call(T, O)) {
|
|
994
994
|
if (O === "returnFocusOnDeactivate" || O === "onDeactivate" || O === "onPostDeactivate" || O === "checkCanReturnFocus" || O === "clickOutsideDeactivates") {
|
|
995
|
-
|
|
995
|
+
u.originalOptions[O] = T[O];
|
|
996
996
|
continue;
|
|
997
997
|
}
|
|
998
|
-
|
|
998
|
+
u.internalOptions[O] = T[O];
|
|
999
999
|
}
|
|
1000
|
-
return
|
|
1000
|
+
return u.outsideClick = null, u.focusTrapElements = m.containerElements || [], u.updatePreviousElement(), u;
|
|
1001
1001
|
}
|
|
1002
|
-
return D(f,
|
|
1002
|
+
return D(f, d), c(f, [{
|
|
1003
1003
|
key: "getDocument",
|
|
1004
1004
|
value: function() {
|
|
1005
1005
|
return this.props.focusTrapOptions.document || (typeof document < "u" ? document : void 0);
|
|
@@ -1007,15 +1007,15 @@ function bt() {
|
|
|
1007
1007
|
}, {
|
|
1008
1008
|
key: "getReturnFocusNode",
|
|
1009
1009
|
value: function() {
|
|
1010
|
-
var
|
|
1011
|
-
return
|
|
1010
|
+
var u = this.getNodeForOption("setReturnFocus", this.previouslyFocusedElement);
|
|
1011
|
+
return u || (u === !1 ? !1 : this.previouslyFocusedElement);
|
|
1012
1012
|
}
|
|
1013
1013
|
/** Update the previously focused element with the currently focused element. */
|
|
1014
1014
|
}, {
|
|
1015
1015
|
key: "updatePreviousElement",
|
|
1016
1016
|
value: function() {
|
|
1017
|
-
var
|
|
1018
|
-
|
|
1017
|
+
var u = this.getDocument();
|
|
1018
|
+
u && (this.previouslyFocusedElement = u.activeElement);
|
|
1019
1019
|
}
|
|
1020
1020
|
}, {
|
|
1021
1021
|
key: "deactivateTrap",
|
|
@@ -1039,10 +1039,10 @@ function bt() {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
}, {
|
|
1041
1041
|
key: "handleClickOutsideDeactivates",
|
|
1042
|
-
value: function(
|
|
1043
|
-
var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null,
|
|
1042
|
+
value: function(u) {
|
|
1043
|
+
var T = typeof this.originalOptions.clickOutsideDeactivates == "function" ? this.originalOptions.clickOutsideDeactivates.call(null, u) : this.originalOptions.clickOutsideDeactivates;
|
|
1044
1044
|
return T && (this.outsideClick = {
|
|
1045
|
-
target:
|
|
1045
|
+
target: u.target,
|
|
1046
1046
|
allowDeactivation: T
|
|
1047
1047
|
}), T;
|
|
1048
1048
|
}
|
|
@@ -1054,18 +1054,18 @@ function bt() {
|
|
|
1054
1054
|
}, {
|
|
1055
1055
|
key: "handlePostDeactivate",
|
|
1056
1056
|
value: function() {
|
|
1057
|
-
var
|
|
1058
|
-
var
|
|
1059
|
-
(
|
|
1060
|
-
|
|
1061
|
-
(!
|
|
1062
|
-
|
|
1057
|
+
var u = this, T = function() {
|
|
1058
|
+
var b = u.getReturnFocusNode(), o = !!// did the consumer allow it?
|
|
1059
|
+
(u.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?
|
|
1060
|
+
b !== null && b !== void 0 && b.focus && // was there an outside click that allowed deactivation?
|
|
1061
|
+
(!u.outsideClick || // did the consumer allow deactivation when the outside node was clicked?
|
|
1062
|
+
u.outsideClick.allowDeactivation && // is the outside node NOT focusable (implying that it did NOT receive focus
|
|
1063
1063
|
// as a result of the click-through) -- in which case do NOT restore focus
|
|
1064
1064
|
// to `returnFocusNode` because focus should remain on the outside node
|
|
1065
|
-
!$(
|
|
1066
|
-
o &&
|
|
1065
|
+
!$(u.outsideClick.target, u.internalOptions.tabbableOptions))), i = u.internalOptions.preventScroll, l = i === void 0 ? !1 : i;
|
|
1066
|
+
o && b.focus({
|
|
1067
1067
|
preventScroll: l
|
|
1068
|
-
}),
|
|
1068
|
+
}), u.originalOptions.onPostDeactivate && u.originalOptions.onPostDeactivate.call(null), u.outsideClick = null;
|
|
1069
1069
|
};
|
|
1070
1070
|
this.originalOptions.checkCanReturnFocus ? this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()).then(T, T) : T();
|
|
1071
1071
|
}
|
|
@@ -1075,8 +1075,8 @@ function bt() {
|
|
|
1075
1075
|
if (this.focusTrap)
|
|
1076
1076
|
this.props.active && !this.focusTrap.active && (this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
|
|
1077
1077
|
else {
|
|
1078
|
-
var
|
|
1079
|
-
|
|
1078
|
+
var u = this.focusTrapElements.some(Boolean);
|
|
1079
|
+
u && (this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions), this.props.active && this.focusTrap.activate(), this.props.paused && this.focusTrap.pause());
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
1082
|
}, {
|
|
@@ -1086,17 +1086,17 @@ function bt() {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
}, {
|
|
1088
1088
|
key: "componentDidUpdate",
|
|
1089
|
-
value: function(
|
|
1089
|
+
value: function(u) {
|
|
1090
1090
|
if (this.focusTrap) {
|
|
1091
|
-
|
|
1092
|
-
var T = !
|
|
1091
|
+
u.containerElements !== this.props.containerElements && this.focusTrap.updateContainerElements(this.props.containerElements);
|
|
1092
|
+
var T = !u.active && this.props.active, O = u.active && !this.props.active, b = !u.paused && this.props.paused, o = u.paused && !this.props.paused;
|
|
1093
1093
|
if (T && (this.updatePreviousElement(), this.focusTrap.activate()), O) {
|
|
1094
1094
|
this.deactivateTrap();
|
|
1095
1095
|
return;
|
|
1096
1096
|
}
|
|
1097
|
-
|
|
1097
|
+
b && this.focusTrap.pause(), o && this.focusTrap.unpause();
|
|
1098
1098
|
} else
|
|
1099
|
-
|
|
1099
|
+
u.containerElements !== this.props.containerElements && (this.focusTrapElements = this.props.containerElements), this.props.active && (this.updatePreviousElement(), this.setupFocusTrap());
|
|
1100
1100
|
}
|
|
1101
1101
|
}, {
|
|
1102
1102
|
key: "componentWillUnmount",
|
|
@@ -1106,50 +1106,50 @@ function bt() {
|
|
|
1106
1106
|
}, {
|
|
1107
1107
|
key: "render",
|
|
1108
1108
|
value: function() {
|
|
1109
|
-
var
|
|
1109
|
+
var u = this, T = this.props.children ? C.Children.only(this.props.children) : void 0;
|
|
1110
1110
|
if (T) {
|
|
1111
|
-
if (T.type && T.type ===
|
|
1111
|
+
if (T.type && T.type === C.Fragment)
|
|
1112
1112
|
throw new Error("A focus-trap cannot use a Fragment as its child container. Try replacing it with a <div> element.");
|
|
1113
1113
|
var O = function(i) {
|
|
1114
|
-
var l =
|
|
1115
|
-
T && (G >= 19 ? typeof T.props.ref == "function" ? T.props.ref(i) : T.props.ref && (T.props.ref.current = i) : typeof T.ref == "function" ? T.ref(i) : T.ref && (T.ref.current = i)),
|
|
1116
|
-
},
|
|
1114
|
+
var l = u.props.containerElements;
|
|
1115
|
+
T && (G >= 19 ? typeof T.props.ref == "function" ? T.props.ref(i) : T.props.ref && (T.props.ref.current = i) : typeof T.ref == "function" ? T.ref(i) : T.ref && (T.ref.current = i)), u.focusTrapElements = l || [i];
|
|
1116
|
+
}, b = C.cloneElement(T, {
|
|
1117
1117
|
ref: O
|
|
1118
1118
|
});
|
|
1119
|
-
return
|
|
1119
|
+
return b;
|
|
1120
1120
|
}
|
|
1121
1121
|
return null;
|
|
1122
1122
|
}
|
|
1123
1123
|
}]);
|
|
1124
|
-
})(
|
|
1125
|
-
return
|
|
1124
|
+
})(C.Component);
|
|
1125
|
+
return L.defaultProps = {
|
|
1126
1126
|
active: !0,
|
|
1127
1127
|
paused: !1,
|
|
1128
1128
|
focusTrapOptions: {},
|
|
1129
|
-
_createFocusTrap:
|
|
1130
|
-
}, Q.exports =
|
|
1129
|
+
_createFocusTrap: q
|
|
1130
|
+
}, Q.exports = L, Q.exports.FocusTrap = L, Q.exports;
|
|
1131
1131
|
}
|
|
1132
|
-
var
|
|
1133
|
-
const
|
|
1132
|
+
var yt = ht();
|
|
1133
|
+
const je = Ae({
|
|
1134
1134
|
isVisible: !1
|
|
1135
1135
|
}), {
|
|
1136
|
-
Provider:
|
|
1137
|
-
} =
|
|
1138
|
-
function mt() {
|
|
1139
|
-
return Ae(Ce);
|
|
1140
|
-
}
|
|
1136
|
+
Provider: mt
|
|
1137
|
+
} = je;
|
|
1141
1138
|
function gt() {
|
|
1139
|
+
return xe(je);
|
|
1140
|
+
}
|
|
1141
|
+
function Tt() {
|
|
1142
1142
|
const {
|
|
1143
1143
|
close: r
|
|
1144
|
-
} =
|
|
1144
|
+
} = gt(), e = J(() => {
|
|
1145
1145
|
r == null || r();
|
|
1146
1146
|
}, [r]);
|
|
1147
1147
|
return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
|
|
1148
1148
|
/* @__PURE__ */ N.jsx("div", { className: "kakadu-components-2543813221" }),
|
|
1149
|
-
/* @__PURE__ */ N.jsx("div", { className: "kakadu-components-840864829", children: /* @__PURE__ */ N.jsx(
|
|
1149
|
+
/* @__PURE__ */ N.jsx("div", { className: "kakadu-components-840864829", children: /* @__PURE__ */ N.jsx(Be, { iconLeft: Le.times, label: "Close", className: "kakadu-components-3855719072", onClick: e }) })
|
|
1150
1150
|
] });
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function we({
|
|
1153
1153
|
decorators: r,
|
|
1154
1154
|
children: e
|
|
1155
1155
|
}) {
|
|
@@ -1157,96 +1157,97 @@ function Tt({
|
|
|
1157
1157
|
}
|
|
1158
1158
|
function Dt({
|
|
1159
1159
|
root: r,
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1160
|
+
outerDecorators: e = [],
|
|
1161
|
+
innerDecorators: t = [],
|
|
1162
|
+
maxWidth: a,
|
|
1163
|
+
className: s,
|
|
1164
|
+
isVisible: c,
|
|
1165
|
+
isFullWidth: n = !1,
|
|
1166
|
+
shouldCloseOnOutsideClick: p = !0,
|
|
1167
|
+
shouldCloseOnEscapePress: y = !0,
|
|
1168
|
+
showCloseButton: k = !0,
|
|
1169
|
+
onClose: S,
|
|
1170
|
+
children: D
|
|
1170
1171
|
}) {
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
}, []),
|
|
1174
|
-
|
|
1175
|
-
}, []), [
|
|
1176
|
-
isVisible:
|
|
1177
|
-
setInitialFocus:
|
|
1178
|
-
close:
|
|
1179
|
-
}), [$,
|
|
1172
|
+
const R = te(null), A = te(null), [P, Y] = re(!1), [C, I] = re(!1), q = J((u) => {
|
|
1173
|
+
R.current = u, I(!1);
|
|
1174
|
+
}, []), V = te(null), $ = J((u) => {
|
|
1175
|
+
u && (V.current = u);
|
|
1176
|
+
}, []), [G, L] = re(c ?? !1), d = ne(() => ({
|
|
1177
|
+
isVisible: G,
|
|
1178
|
+
setInitialFocus: $,
|
|
1179
|
+
close: q
|
|
1180
|
+
}), [G, $, q]);
|
|
1180
1181
|
H(() => {
|
|
1181
|
-
|
|
1182
|
-
}, [
|
|
1183
|
-
if (
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1182
|
+
c && (Y(!0), L(!0));
|
|
1183
|
+
}, [c]), H(() => {
|
|
1184
|
+
if (c) {
|
|
1185
|
+
const u = setTimeout(() => {
|
|
1186
|
+
I(!0);
|
|
1186
1187
|
}, 100);
|
|
1187
1188
|
return () => {
|
|
1188
|
-
clearTimeout(
|
|
1189
|
+
clearTimeout(u);
|
|
1189
1190
|
};
|
|
1190
1191
|
}
|
|
1191
|
-
|
|
1192
|
-
}, [
|
|
1193
|
-
if (
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1192
|
+
I(!1);
|
|
1193
|
+
}, [c]), H(() => {
|
|
1194
|
+
if (P && !C) {
|
|
1195
|
+
const u = setTimeout(() => {
|
|
1196
|
+
S == null || S(R.current ?? void 0), L(!1);
|
|
1196
1197
|
}, 370);
|
|
1197
1198
|
return () => {
|
|
1198
|
-
clearTimeout(
|
|
1199
|
+
clearTimeout(u);
|
|
1199
1200
|
};
|
|
1200
1201
|
}
|
|
1201
|
-
}, [
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1202
|
+
}, [P, C, S]), H(() => {
|
|
1203
|
+
const u = A.current;
|
|
1204
|
+
if (c && p && u) {
|
|
1205
|
+
const T = (O) => {
|
|
1206
|
+
u === O.target && I(!1);
|
|
1206
1207
|
};
|
|
1207
|
-
return
|
|
1208
|
-
|
|
1208
|
+
return u.addEventListener("click", T), () => {
|
|
1209
|
+
u.removeEventListener("click", T);
|
|
1209
1210
|
};
|
|
1210
1211
|
}
|
|
1211
|
-
}, [
|
|
1212
|
-
if (!
|
|
1212
|
+
}, [c, p]), H(() => {
|
|
1213
|
+
if (!c || !y)
|
|
1213
1214
|
return;
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1215
|
+
const u = (T) => {
|
|
1216
|
+
T.key === "Escape" && I(!1);
|
|
1216
1217
|
};
|
|
1217
|
-
return window.addEventListener("keydown",
|
|
1218
|
-
window.removeEventListener("keydown",
|
|
1218
|
+
return window.addEventListener("keydown", u), () => {
|
|
1219
|
+
window.removeEventListener("keydown", u);
|
|
1219
1220
|
};
|
|
1220
|
-
}, [
|
|
1221
|
-
const
|
|
1222
|
-
initialFocus: () =>
|
|
1221
|
+
}, [c, y]);
|
|
1222
|
+
const f = ne(() => ({
|
|
1223
|
+
initialFocus: () => V.current ?? void 0,
|
|
1223
1224
|
onActivate: () => {
|
|
1224
|
-
var
|
|
1225
|
-
return (
|
|
1225
|
+
var u;
|
|
1226
|
+
return (u = V.current) == null ? void 0 : u.focus();
|
|
1226
1227
|
}
|
|
1227
|
-
}), []),
|
|
1228
|
-
"--max-width":
|
|
1229
|
-
}, className: pe("kakadu-components-4119461136",
|
|
1230
|
-
|
|
1231
|
-
/* @__PURE__ */ N.jsx("div", { className: "kakadu-components-
|
|
1232
|
-
] }) }) }) }) }) });
|
|
1233
|
-
return r ?
|
|
1228
|
+
}), []), m = /* @__PURE__ */ N.jsx(we, { decorators: e, children: /* @__PURE__ */ N.jsx("div", { style: {
|
|
1229
|
+
"--max-width": a ? `${a}px` : void 0
|
|
1230
|
+
}, className: pe("kakadu-components-4119461136", C && "kakadu-components-2522346797", s), children: /* @__PURE__ */ N.jsx(we, { decorators: t, children: /* @__PURE__ */ N.jsx(yt.FocusTrap, { active: C, focusTrapOptions: f, children: /* @__PURE__ */ N.jsx("div", { ref: A, className: "kakadu-components-4011815997", children: /* @__PURE__ */ N.jsx("div", { className: pe("kakadu-components-3324483532", n && "kakadu-components-3799971070", C && "kakadu-components-968755580"), children: /* @__PURE__ */ N.jsxs(mt, { value: d, children: [
|
|
1231
|
+
k ? /* @__PURE__ */ N.jsx(Tt, {}) : null,
|
|
1232
|
+
/* @__PURE__ */ N.jsx("div", { className: "kakadu-components-177997624", children: D })
|
|
1233
|
+
] }) }) }) }) }) }) });
|
|
1234
|
+
return r ? _e(m, r) : m;
|
|
1234
1235
|
}
|
|
1235
1236
|
function Nt(r, e) {
|
|
1236
|
-
const [t, a] = re(!1),
|
|
1237
|
-
|
|
1238
|
-
})), []), n = J((
|
|
1237
|
+
const [t, a] = re(!1), s = te(void 0), c = J(async () => (a(!0), new Promise((y) => {
|
|
1238
|
+
s.current = y;
|
|
1239
|
+
})), []), n = J((y) => {
|
|
1239
1240
|
var k;
|
|
1240
|
-
a(!1), (k =
|
|
1241
|
-
}, []),
|
|
1241
|
+
a(!1), (k = s.current) == null || k.call(s, y), s.current = void 0;
|
|
1242
|
+
}, []), p = ne(() => /* @__PURE__ */ N.jsx(r, { ...e, isVisible: t, onClose: n }), [r, e, t, n]);
|
|
1242
1243
|
return ne(() => ({
|
|
1243
1244
|
isVisible: t,
|
|
1244
1245
|
show: c,
|
|
1245
|
-
modal:
|
|
1246
|
-
}), [t, c,
|
|
1246
|
+
modal: p
|
|
1247
|
+
}), [t, c, p]);
|
|
1247
1248
|
}
|
|
1248
1249
|
export {
|
|
1249
1250
|
Dt as default,
|
|
1250
1251
|
Nt as useModal,
|
|
1251
|
-
|
|
1252
|
+
gt as useModalContext
|
|
1252
1253
|
};
|