@ogcio/design-system-react 1.15.0 → 1.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/autocomplete/autocomplete.d.ts +5 -4
- package/dist/autocomplete/autocomplete.js +174 -138
- package/dist/autocomplete/types.d.ts +1 -0
- package/dist/autocomplete/use-autocomplete-controller.d.ts +3 -2
- package/dist/autocomplete/use-autocomplete-controller.js +90 -88
- package/dist/header/header.d.ts +1 -1
- package/dist/header/header.js +53 -56
- package/dist/header/types.d.ts +1 -0
- package/dist/hooks/use-aria-hider.js +1 -1
- package/dist/hooks/use-focus-trap.js +247 -242
- package/dist/input-text/input-text.d.ts +4 -4
- package/dist/input-text/input-text.js +68 -61
- package/dist/input-text/type.d.ts +4 -2
- package/dist/modal/modal.js +76 -75
- package/dist/progress-stepper/progress-stepper.d.ts +4 -2
- package/dist/progress-stepper/progress-stepper.js +103 -100
- package/dist/progress-stepper/types.d.ts +5 -0
- package/dist/select/select-menu.js +16 -14
- package/dist/select/select-next.js +187 -153
- package/dist/select/select-search.d.ts +12 -3
- package/dist/select/select-search.js +29 -21
- package/dist/styles.css +1 -1
- package/dist/text-input/text-input.d.ts +2 -2
- package/package.json +3 -3
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLayoutEffect as he } from "react";
|
|
2
2
|
/*!
|
|
3
3
|
* tabbable 6.2.0
|
|
4
4
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
5
|
*/
|
|
6
|
-
var
|
|
7
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, j = !
|
|
6
|
+
var oe = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], K = /* @__PURE__ */ oe.join(","), ce = typeof Element > "u", R = ce ? function() {
|
|
7
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, j = !ce && Element.prototype.getRootNode ? function(r) {
|
|
8
8
|
var e;
|
|
9
|
-
return
|
|
10
|
-
} : function(
|
|
11
|
-
return
|
|
12
|
-
}, M = function
|
|
13
|
-
var
|
|
9
|
+
return r == null || (e = r.getRootNode) === null || e === void 0 ? void 0 : e.call(r);
|
|
10
|
+
} : function(r) {
|
|
11
|
+
return r == null ? void 0 : r.ownerDocument;
|
|
12
|
+
}, M = function r(e, t) {
|
|
13
|
+
var a;
|
|
14
14
|
t === void 0 && (t = !0);
|
|
15
|
-
var
|
|
15
|
+
var o = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), c = o === "" || o === "true", i = c || t && e && r(e.parentNode);
|
|
16
16
|
return i;
|
|
17
|
-
},
|
|
18
|
-
var t,
|
|
19
|
-
return
|
|
20
|
-
}, le = function(e, t,
|
|
17
|
+
}, ye = function(e) {
|
|
18
|
+
var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
19
|
+
return a === "" || a === "true";
|
|
20
|
+
}, le = function(e, t, a) {
|
|
21
21
|
if (M(e))
|
|
22
22
|
return [];
|
|
23
|
-
var
|
|
24
|
-
return t && R.call(e, K) &&
|
|
25
|
-
},
|
|
26
|
-
for (var
|
|
27
|
-
var i =
|
|
23
|
+
var o = Array.prototype.slice.apply(e.querySelectorAll(K));
|
|
24
|
+
return t && R.call(e, K) && o.unshift(e), o = o.filter(a), o;
|
|
25
|
+
}, se = function r(e, t, a) {
|
|
26
|
+
for (var o = [], c = Array.from(e); c.length; ) {
|
|
27
|
+
var i = c.shift();
|
|
28
28
|
if (!M(i, !1))
|
|
29
29
|
if (i.tagName === "SLOT") {
|
|
30
|
-
var b = i.assignedElements(), v = b.length ? b : i.children,
|
|
31
|
-
|
|
30
|
+
var b = i.assignedElements(), v = b.length ? b : i.children, p = r(v, !0, a);
|
|
31
|
+
a.flatten ? o.push.apply(o, p) : o.push({
|
|
32
32
|
scopeParent: i,
|
|
33
|
-
candidates:
|
|
33
|
+
candidates: p
|
|
34
34
|
});
|
|
35
35
|
} else {
|
|
36
36
|
var T = R.call(i, K);
|
|
37
|
-
T &&
|
|
37
|
+
T && a.filter(i) && (t || !e.includes(i)) && o.push(i);
|
|
38
38
|
var w = i.shadowRoot || // check for an undisclosed shadow
|
|
39
|
-
typeof
|
|
39
|
+
typeof a.getShadowRoot == "function" && a.getShadowRoot(i), E = !M(w, !1) && (!a.shadowRootFilter || a.shadowRootFilter(i));
|
|
40
40
|
if (w && E) {
|
|
41
|
-
var D =
|
|
42
|
-
|
|
41
|
+
var D = r(w === !0 ? i.children : w.children, !0, a);
|
|
42
|
+
a.flatten ? o.push.apply(o, D) : o.push({
|
|
43
43
|
scopeParent: i,
|
|
44
44
|
candidates: D
|
|
45
45
|
});
|
|
46
46
|
} else
|
|
47
|
-
|
|
47
|
+
c.unshift.apply(c, i.children);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
return
|
|
50
|
+
return o;
|
|
51
51
|
}, fe = function(e) {
|
|
52
52
|
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
53
53
|
}, k = function(e) {
|
|
54
54
|
if (!e)
|
|
55
55
|
throw new Error("No node provided");
|
|
56
|
-
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) ||
|
|
57
|
-
},
|
|
58
|
-
var
|
|
59
|
-
return
|
|
56
|
+
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || ye(e)) && !fe(e) ? 0 : e.tabIndex;
|
|
57
|
+
}, pe = function(e, t) {
|
|
58
|
+
var a = k(e);
|
|
59
|
+
return a < 0 && t && !fe(e) ? 0 : a;
|
|
60
60
|
}, ge = function(e, t) {
|
|
61
61
|
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
62
62
|
}, de = function(e) {
|
|
@@ -64,79 +64,79 @@ var ue = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
64
64
|
}, me = function(e) {
|
|
65
65
|
return de(e) && e.type === "hidden";
|
|
66
66
|
}, we = function(e) {
|
|
67
|
-
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(
|
|
68
|
-
return
|
|
67
|
+
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
|
|
68
|
+
return a.tagName === "SUMMARY";
|
|
69
69
|
});
|
|
70
70
|
return t;
|
|
71
71
|
}, Te = function(e, t) {
|
|
72
|
-
for (var
|
|
73
|
-
if (e[
|
|
74
|
-
return e[
|
|
72
|
+
for (var a = 0; a < e.length; a++)
|
|
73
|
+
if (e[a].checked && e[a].form === t)
|
|
74
|
+
return e[a];
|
|
75
75
|
}, Ne = function(e) {
|
|
76
76
|
if (!e.name)
|
|
77
77
|
return !0;
|
|
78
|
-
var t = e.form || j(e),
|
|
78
|
+
var t = e.form || j(e), a = function(b) {
|
|
79
79
|
return t.querySelectorAll('input[type="radio"][name="' + b + '"]');
|
|
80
|
-
},
|
|
80
|
+
}, o;
|
|
81
81
|
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
82
|
-
|
|
82
|
+
o = a(window.CSS.escape(e.name));
|
|
83
83
|
else
|
|
84
84
|
try {
|
|
85
|
-
|
|
85
|
+
o = a(e.name);
|
|
86
86
|
} catch (i) {
|
|
87
87
|
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;
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
return !
|
|
89
|
+
var c = Te(o, e.form);
|
|
90
|
+
return !c || c === e;
|
|
91
91
|
}, Fe = function(e) {
|
|
92
92
|
return de(e) && e.type === "radio";
|
|
93
93
|
}, Ee = function(e) {
|
|
94
94
|
return Fe(e) && !Ne(e);
|
|
95
95
|
}, Se = function(e) {
|
|
96
|
-
var t,
|
|
97
|
-
if (
|
|
96
|
+
var t, a = e && j(e), o = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
|
|
97
|
+
if (a && a !== e) {
|
|
98
98
|
var i, b, v;
|
|
99
|
-
for (
|
|
100
|
-
var
|
|
101
|
-
|
|
99
|
+
for (c = !!((i = o) !== null && i !== void 0 && (b = i.ownerDocument) !== null && b !== void 0 && b.contains(o) || e != null && (v = e.ownerDocument) !== null && v !== void 0 && v.contains(e)); !c && o; ) {
|
|
100
|
+
var p, T, w;
|
|
101
|
+
a = j(o), o = (p = a) === null || p === void 0 ? void 0 : p.host, c = !!((T = o) !== null && T !== void 0 && (w = T.ownerDocument) !== null && w !== void 0 && w.contains(o));
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
return
|
|
105
|
-
},
|
|
106
|
-
var t = e.getBoundingClientRect(),
|
|
107
|
-
return
|
|
104
|
+
return c;
|
|
105
|
+
}, ae = function(e) {
|
|
106
|
+
var t = e.getBoundingClientRect(), a = t.width, o = t.height;
|
|
107
|
+
return a === 0 && o === 0;
|
|
108
108
|
}, ke = function(e, t) {
|
|
109
|
-
var
|
|
109
|
+
var a = t.displayCheck, o = t.getShadowRoot;
|
|
110
110
|
if (getComputedStyle(e).visibility === "hidden")
|
|
111
111
|
return !0;
|
|
112
|
-
var
|
|
112
|
+
var c = R.call(e, "details>summary:first-of-type"), i = c ? e.parentElement : e;
|
|
113
113
|
if (R.call(i, "details:not([open]) *"))
|
|
114
114
|
return !0;
|
|
115
|
-
if (!
|
|
116
|
-
if (typeof
|
|
115
|
+
if (!a || a === "full" || a === "legacy-full") {
|
|
116
|
+
if (typeof o == "function") {
|
|
117
117
|
for (var b = e; e; ) {
|
|
118
|
-
var v = e.parentElement,
|
|
119
|
-
if (v && !v.shadowRoot &&
|
|
120
|
-
return
|
|
121
|
-
e.assignedSlot ? e = e.assignedSlot : !v &&
|
|
118
|
+
var v = e.parentElement, p = j(e);
|
|
119
|
+
if (v && !v.shadowRoot && o(v) === !0)
|
|
120
|
+
return ae(e);
|
|
121
|
+
e.assignedSlot ? e = e.assignedSlot : !v && p !== e.ownerDocument ? e = p.host : e = v;
|
|
122
122
|
}
|
|
123
123
|
e = b;
|
|
124
124
|
}
|
|
125
125
|
if (Se(e))
|
|
126
126
|
return !e.getClientRects().length;
|
|
127
|
-
if (
|
|
127
|
+
if (a !== "legacy-full")
|
|
128
128
|
return !0;
|
|
129
|
-
} else if (
|
|
130
|
-
return
|
|
129
|
+
} else if (a === "non-zero-area")
|
|
130
|
+
return ae(e);
|
|
131
131
|
return !1;
|
|
132
132
|
}, Re = function(e) {
|
|
133
133
|
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
|
|
134
134
|
for (var t = e.parentElement; t; ) {
|
|
135
135
|
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
136
|
-
for (var
|
|
137
|
-
var
|
|
138
|
-
if (
|
|
139
|
-
return R.call(t, "fieldset[disabled] *") ? !0 : !
|
|
136
|
+
for (var a = 0; a < t.children.length; a++) {
|
|
137
|
+
var o = t.children.item(a);
|
|
138
|
+
if (o.tagName === "LEGEND")
|
|
139
|
+
return R.call(t, "fieldset[disabled] *") ? !0 : !o.contains(e);
|
|
140
140
|
}
|
|
141
141
|
return !0;
|
|
142
142
|
}
|
|
@@ -154,130 +154,130 @@ var ue = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
154
154
|
}, De = function(e) {
|
|
155
155
|
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
156
156
|
return !!(isNaN(t) || t >= 0);
|
|
157
|
-
}, Ie = function
|
|
158
|
-
var t = [],
|
|
159
|
-
return e.forEach(function(
|
|
160
|
-
var i = !!
|
|
161
|
-
v === 0 ? i ? t.push.apply(t,
|
|
162
|
-
documentOrder:
|
|
157
|
+
}, Ie = function r(e) {
|
|
158
|
+
var t = [], a = [];
|
|
159
|
+
return e.forEach(function(o, c) {
|
|
160
|
+
var i = !!o.scopeParent, b = i ? o.scopeParent : o, v = pe(b, i), p = i ? r(o.candidates) : b;
|
|
161
|
+
v === 0 ? i ? t.push.apply(t, p) : t.push(b) : a.push({
|
|
162
|
+
documentOrder: c,
|
|
163
163
|
tabIndex: v,
|
|
164
|
-
item:
|
|
164
|
+
item: o,
|
|
165
165
|
isScope: i,
|
|
166
|
-
content:
|
|
166
|
+
content: p
|
|
167
167
|
});
|
|
168
|
-
}),
|
|
169
|
-
return
|
|
168
|
+
}), a.sort(ge).reduce(function(o, c) {
|
|
169
|
+
return c.isScope ? o.push.apply(o, c.content) : o.push(c.content), o;
|
|
170
170
|
}, []).concat(t);
|
|
171
171
|
}, Ae = function(e, t) {
|
|
172
172
|
t = t || {};
|
|
173
|
-
var
|
|
174
|
-
return t.getShadowRoot ?
|
|
173
|
+
var a;
|
|
174
|
+
return t.getShadowRoot ? a = se([e], t.includeContainer, {
|
|
175
175
|
filter: U.bind(null, t),
|
|
176
176
|
flatten: !1,
|
|
177
177
|
getShadowRoot: t.getShadowRoot,
|
|
178
178
|
shadowRootFilter: De
|
|
179
|
-
}) :
|
|
180
|
-
},
|
|
179
|
+
}) : a = le(e, t.includeContainer, U.bind(null, t)), Ie(a);
|
|
180
|
+
}, Oe = function(e, t) {
|
|
181
181
|
t = t || {};
|
|
182
|
-
var
|
|
183
|
-
return t.getShadowRoot ?
|
|
182
|
+
var a;
|
|
183
|
+
return t.getShadowRoot ? a = se([e], t.includeContainer, {
|
|
184
184
|
filter: G.bind(null, t),
|
|
185
185
|
flatten: !0,
|
|
186
186
|
getShadowRoot: t.getShadowRoot
|
|
187
|
-
}) :
|
|
187
|
+
}) : a = le(e, t.includeContainer, G.bind(null, t)), a;
|
|
188
188
|
}, I = function(e, t) {
|
|
189
189
|
if (t = t || {}, !e)
|
|
190
190
|
throw new Error("No node provided");
|
|
191
191
|
return R.call(e, K) === !1 ? !1 : U(t, e);
|
|
192
|
-
},
|
|
192
|
+
}, Pe = /* @__PURE__ */ oe.concat("iframe").join(","), $ = function(e, t) {
|
|
193
193
|
if (t = t || {}, !e)
|
|
194
194
|
throw new Error("No node provided");
|
|
195
|
-
return R.call(e,
|
|
195
|
+
return R.call(e, Pe) === !1 ? !1 : G(t, e);
|
|
196
196
|
};
|
|
197
197
|
/*!
|
|
198
198
|
* focus-trap 7.6.5
|
|
199
199
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
200
200
|
*/
|
|
201
|
-
function W(
|
|
202
|
-
(e == null || e >
|
|
203
|
-
for (var t = 0,
|
|
204
|
-
return
|
|
201
|
+
function W(r, e) {
|
|
202
|
+
(e == null || e > r.length) && (e = r.length);
|
|
203
|
+
for (var t = 0, a = Array(e); t < e; t++) a[t] = r[t];
|
|
204
|
+
return a;
|
|
205
205
|
}
|
|
206
|
-
function Ce(
|
|
207
|
-
if (Array.isArray(
|
|
206
|
+
function Ce(r) {
|
|
207
|
+
if (Array.isArray(r)) return W(r);
|
|
208
208
|
}
|
|
209
|
-
function xe(
|
|
210
|
-
return (e = Me(e)) in
|
|
209
|
+
function xe(r, e, t) {
|
|
210
|
+
return (e = Me(e)) in r ? Object.defineProperty(r, e, {
|
|
211
211
|
value: t,
|
|
212
212
|
enumerable: !0,
|
|
213
213
|
configurable: !0,
|
|
214
214
|
writable: !0
|
|
215
|
-
}) :
|
|
215
|
+
}) : r[e] = t, r;
|
|
216
216
|
}
|
|
217
|
-
function Le(
|
|
218
|
-
if (typeof Symbol < "u" &&
|
|
217
|
+
function Le(r) {
|
|
218
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
219
219
|
}
|
|
220
220
|
function Be() {
|
|
221
221
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
222
222
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
var t = Object.keys(
|
|
224
|
+
function re(r, e) {
|
|
225
|
+
var t = Object.keys(r);
|
|
226
226
|
if (Object.getOwnPropertySymbols) {
|
|
227
|
-
var
|
|
228
|
-
e && (
|
|
229
|
-
return Object.getOwnPropertyDescriptor(
|
|
230
|
-
})), t.push.apply(t,
|
|
227
|
+
var a = Object.getOwnPropertySymbols(r);
|
|
228
|
+
e && (a = a.filter(function(o) {
|
|
229
|
+
return Object.getOwnPropertyDescriptor(r, o).enumerable;
|
|
230
|
+
})), t.push.apply(t, a);
|
|
231
231
|
}
|
|
232
232
|
return t;
|
|
233
233
|
}
|
|
234
|
-
function ne(
|
|
234
|
+
function ne(r) {
|
|
235
235
|
for (var e = 1; e < arguments.length; e++) {
|
|
236
236
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
237
|
-
e % 2 ?
|
|
238
|
-
xe(
|
|
239
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
240
|
-
Object.defineProperty(
|
|
237
|
+
e % 2 ? re(Object(t), !0).forEach(function(a) {
|
|
238
|
+
xe(r, a, t[a]);
|
|
239
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : re(Object(t)).forEach(function(a) {
|
|
240
|
+
Object.defineProperty(r, a, Object.getOwnPropertyDescriptor(t, a));
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
return
|
|
243
|
+
return r;
|
|
244
244
|
}
|
|
245
|
-
function Ke(
|
|
246
|
-
return Ce(
|
|
245
|
+
function Ke(r) {
|
|
246
|
+
return Ce(r) || Le(r) || Ge(r) || Be();
|
|
247
247
|
}
|
|
248
|
-
function je(
|
|
249
|
-
if (typeof
|
|
250
|
-
var t =
|
|
248
|
+
function je(r, e) {
|
|
249
|
+
if (typeof r != "object" || !r) return r;
|
|
250
|
+
var t = r[Symbol.toPrimitive];
|
|
251
251
|
if (t !== void 0) {
|
|
252
|
-
var
|
|
253
|
-
if (typeof
|
|
252
|
+
var a = t.call(r, e);
|
|
253
|
+
if (typeof a != "object") return a;
|
|
254
254
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
255
255
|
}
|
|
256
|
-
return (e === "string" ? String : Number)(
|
|
256
|
+
return (e === "string" ? String : Number)(r);
|
|
257
257
|
}
|
|
258
|
-
function Me(
|
|
259
|
-
var e = je(
|
|
258
|
+
function Me(r) {
|
|
259
|
+
var e = je(r, "string");
|
|
260
260
|
return typeof e == "symbol" ? e : e + "";
|
|
261
261
|
}
|
|
262
|
-
function Ge(
|
|
263
|
-
if (
|
|
264
|
-
if (typeof
|
|
265
|
-
var t = {}.toString.call(
|
|
266
|
-
return t === "Object" &&
|
|
262
|
+
function Ge(r, e) {
|
|
263
|
+
if (r) {
|
|
264
|
+
if (typeof r == "string") return W(r, e);
|
|
265
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
266
|
+
return t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set" ? Array.from(r) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? W(r, e) : void 0;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
var ie = {
|
|
270
270
|
activateTrap: function(e, t) {
|
|
271
271
|
if (e.length > 0) {
|
|
272
|
-
var
|
|
273
|
-
|
|
272
|
+
var a = e[e.length - 1];
|
|
273
|
+
a !== t && a._setPausedState(!0);
|
|
274
274
|
}
|
|
275
|
-
var
|
|
276
|
-
|
|
275
|
+
var o = e.indexOf(t);
|
|
276
|
+
o === -1 || e.splice(o, 1), e.push(t);
|
|
277
277
|
},
|
|
278
278
|
deactivateTrap: function(e, t) {
|
|
279
|
-
var
|
|
280
|
-
|
|
279
|
+
var a = e.indexOf(t);
|
|
280
|
+
a !== -1 && e.splice(a, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
|
|
281
281
|
}
|
|
282
282
|
}, qe = function(e) {
|
|
283
283
|
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
@@ -289,16 +289,16 @@ var ie = {
|
|
|
289
289
|
return x(e) && !e.shiftKey;
|
|
290
290
|
}, $e = function(e) {
|
|
291
291
|
return x(e) && e.shiftKey;
|
|
292
|
-
},
|
|
292
|
+
}, ue = function(e) {
|
|
293
293
|
return setTimeout(e, 0);
|
|
294
294
|
}, C = function(e) {
|
|
295
|
-
for (var t = arguments.length,
|
|
296
|
-
|
|
297
|
-
return typeof e == "function" ? e.apply(void 0,
|
|
295
|
+
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++)
|
|
296
|
+
a[o - 1] = arguments[o];
|
|
297
|
+
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
298
298
|
}, B = function(e) {
|
|
299
299
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
300
300
|
}, Ue = [], We = function(e, t) {
|
|
301
|
-
var
|
|
301
|
+
var a = (t == null ? void 0 : t.document) || document, o = (t == null ? void 0 : t.trapStack) || Ue, c = ne({
|
|
302
302
|
returnFocusOnDeactivate: !0,
|
|
303
303
|
escapeDeactivates: !0,
|
|
304
304
|
delayInitialFocus: !0,
|
|
@@ -341,31 +341,31 @@ var ie = {
|
|
|
341
341
|
delayInitialFocusTimer: void 0,
|
|
342
342
|
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
343
343
|
recentNavEvent: void 0
|
|
344
|
-
}, b, v = function(n,
|
|
345
|
-
return n && n[
|
|
346
|
-
},
|
|
347
|
-
var l = typeof (
|
|
344
|
+
}, b, v = function(n, u, l) {
|
|
345
|
+
return n && n[u] !== void 0 ? n[u] : c[l || u];
|
|
346
|
+
}, p = function(n, u) {
|
|
347
|
+
var l = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
|
|
348
348
|
return i.containerGroups.findIndex(function(f) {
|
|
349
|
-
var d = f.container,
|
|
349
|
+
var d = f.container, y = f.tabbableNodes;
|
|
350
350
|
return d.contains(n) || // fall back to explicit tabbable search which will take into consideration any
|
|
351
351
|
// web components if the `tabbableOptions.getShadowRoot` option was used for
|
|
352
352
|
// the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
|
|
353
353
|
// look inside web components even if open)
|
|
354
|
-
(l == null ? void 0 : l.includes(d)) ||
|
|
355
|
-
return
|
|
354
|
+
(l == null ? void 0 : l.includes(d)) || y.find(function(s) {
|
|
355
|
+
return s === n;
|
|
356
356
|
});
|
|
357
357
|
});
|
|
358
358
|
}, T = function(n) {
|
|
359
|
-
var
|
|
360
|
-
if (typeof
|
|
361
|
-
if (
|
|
362
|
-
return
|
|
359
|
+
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = u.hasFallback, f = l === void 0 ? !1 : l, d = u.params, y = d === void 0 ? [] : d, s = c[n];
|
|
360
|
+
if (typeof s == "function" && (s = s.apply(void 0, Ke(y))), s === !0 && (s = void 0), !s) {
|
|
361
|
+
if (s === void 0 || s === !1)
|
|
362
|
+
return s;
|
|
363
363
|
throw new Error("`".concat(n, "` was specified but was not a node, or did not return a node"));
|
|
364
364
|
}
|
|
365
|
-
var g =
|
|
366
|
-
if (typeof
|
|
365
|
+
var g = s;
|
|
366
|
+
if (typeof s == "string") {
|
|
367
367
|
try {
|
|
368
|
-
g =
|
|
368
|
+
g = a.querySelector(s);
|
|
369
369
|
} catch (m) {
|
|
370
370
|
throw new Error("`".concat(n, '` appears to be an invalid selector; error="').concat(m.message, '"'));
|
|
371
371
|
}
|
|
@@ -379,11 +379,11 @@ var ie = {
|
|
|
379
379
|
});
|
|
380
380
|
if (n === !1)
|
|
381
381
|
return !1;
|
|
382
|
-
if (n === void 0 || n && !$(n,
|
|
383
|
-
if (
|
|
384
|
-
n =
|
|
382
|
+
if (n === void 0 || n && !$(n, c.tabbableOptions))
|
|
383
|
+
if (p(a.activeElement) >= 0)
|
|
384
|
+
n = a.activeElement;
|
|
385
385
|
else {
|
|
386
|
-
var
|
|
386
|
+
var u = i.tabbableGroups[0], l = u && u.firstTabbableNode;
|
|
387
387
|
n = l || T("fallbackFocus");
|
|
388
388
|
}
|
|
389
389
|
else n === null && (n = T("fallbackFocus"));
|
|
@@ -392,16 +392,16 @@ var ie = {
|
|
|
392
392
|
return n;
|
|
393
393
|
}, E = function() {
|
|
394
394
|
if (i.containerGroups = i.containers.map(function(n) {
|
|
395
|
-
var
|
|
395
|
+
var u = Ae(n, c.tabbableOptions), l = Oe(n, c.tabbableOptions), f = u.length > 0 ? u[0] : void 0, d = u.length > 0 ? u[u.length - 1] : void 0, y = l.find(function(m) {
|
|
396
396
|
return I(m);
|
|
397
|
-
}),
|
|
397
|
+
}), s = l.slice().reverse().find(function(m) {
|
|
398
398
|
return I(m);
|
|
399
|
-
}), g = !!
|
|
399
|
+
}), g = !!u.find(function(m) {
|
|
400
400
|
return k(m) > 0;
|
|
401
401
|
});
|
|
402
402
|
return {
|
|
403
403
|
container: n,
|
|
404
|
-
tabbableNodes:
|
|
404
|
+
tabbableNodes: u,
|
|
405
405
|
focusableNodes: l,
|
|
406
406
|
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
407
407
|
posTabIndexesFound: g,
|
|
@@ -417,9 +417,9 @@ var ie = {
|
|
|
417
417
|
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
418
418
|
// be avoided anyway...
|
|
419
419
|
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
420
|
-
firstDomTabbableNode:
|
|
420
|
+
firstDomTabbableNode: y,
|
|
421
421
|
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
422
|
-
lastDomTabbableNode:
|
|
422
|
+
lastDomTabbableNode: s,
|
|
423
423
|
/**
|
|
424
424
|
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
425
425
|
* in this container, if any.
|
|
@@ -429,12 +429,12 @@ var ie = {
|
|
|
429
429
|
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
430
430
|
*/
|
|
431
431
|
nextTabbableNode: function(S) {
|
|
432
|
-
var
|
|
433
|
-
return F < 0 ?
|
|
434
|
-
return I(
|
|
435
|
-
}) : l.slice(0, l.indexOf(S)).reverse().find(function(
|
|
436
|
-
return I(
|
|
437
|
-
}) :
|
|
432
|
+
var O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, F = u.indexOf(S);
|
|
433
|
+
return F < 0 ? O ? l.slice(l.indexOf(S) + 1).find(function(P) {
|
|
434
|
+
return I(P);
|
|
435
|
+
}) : l.slice(0, l.indexOf(S)).reverse().find(function(P) {
|
|
436
|
+
return I(P);
|
|
437
|
+
}) : u[F + (O ? 1 : -1)];
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
440
|
}), i.tabbableGroups = i.containerGroups.filter(function(n) {
|
|
@@ -446,9 +446,9 @@ var ie = {
|
|
|
446
446
|
}) && i.containerGroups.length > 1)
|
|
447
447
|
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.");
|
|
448
448
|
}, D = function(n) {
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
451
|
-
return
|
|
449
|
+
var u = n.activeElement;
|
|
450
|
+
if (u)
|
|
451
|
+
return u.shadowRoot && u.shadowRoot.activeElement !== null ? D(u.shadowRoot) : u;
|
|
452
452
|
}, N = function(n) {
|
|
453
453
|
if (n !== !1 && n !== D(document)) {
|
|
454
454
|
if (!n || !n.focus) {
|
|
@@ -456,48 +456,48 @@ var ie = {
|
|
|
456
456
|
return;
|
|
457
457
|
}
|
|
458
458
|
n.focus({
|
|
459
|
-
preventScroll: !!
|
|
459
|
+
preventScroll: !!c.preventScroll
|
|
460
460
|
}), i.mostRecentlyFocusedNode = n, qe(n) && n.select();
|
|
461
461
|
}
|
|
462
462
|
}, Y = function(n) {
|
|
463
|
-
var
|
|
463
|
+
var u = T("setReturnFocus", {
|
|
464
464
|
params: [n]
|
|
465
465
|
});
|
|
466
|
-
return
|
|
466
|
+
return u || (u === !1 ? !1 : n);
|
|
467
467
|
}, Z = function(n) {
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
var
|
|
468
|
+
var u = n.target, l = n.event, f = n.isBackward, d = f === void 0 ? !1 : f;
|
|
469
|
+
u = u || B(l), E();
|
|
470
|
+
var y = null;
|
|
471
471
|
if (i.tabbableGroups.length > 0) {
|
|
472
|
-
var
|
|
473
|
-
if (
|
|
474
|
-
d ?
|
|
472
|
+
var s = p(u, l), g = s >= 0 ? i.containerGroups[s] : void 0;
|
|
473
|
+
if (s < 0)
|
|
474
|
+
d ? y = i.tabbableGroups[i.tabbableGroups.length - 1].lastTabbableNode : y = i.tabbableGroups[0].firstTabbableNode;
|
|
475
475
|
else if (d) {
|
|
476
476
|
var m = i.tabbableGroups.findIndex(function(V) {
|
|
477
477
|
var _ = V.firstTabbableNode;
|
|
478
|
-
return
|
|
478
|
+
return u === _;
|
|
479
479
|
});
|
|
480
|
-
if (m < 0 && (g.container ===
|
|
481
|
-
var S = m === 0 ? i.tabbableGroups.length - 1 : m - 1,
|
|
482
|
-
|
|
483
|
-
} else x(l) || (
|
|
480
|
+
if (m < 0 && (g.container === u || $(u, c.tabbableOptions) && !I(u, c.tabbableOptions) && !g.nextTabbableNode(u, !1)) && (m = s), m >= 0) {
|
|
481
|
+
var S = m === 0 ? i.tabbableGroups.length - 1 : m - 1, O = i.tabbableGroups[S];
|
|
482
|
+
y = k(u) >= 0 ? O.lastTabbableNode : O.lastDomTabbableNode;
|
|
483
|
+
} else x(l) || (y = g.nextTabbableNode(u, !1));
|
|
484
484
|
} else {
|
|
485
485
|
var F = i.tabbableGroups.findIndex(function(V) {
|
|
486
486
|
var _ = V.lastTabbableNode;
|
|
487
|
-
return
|
|
487
|
+
return u === _;
|
|
488
488
|
});
|
|
489
|
-
if (F < 0 && (g.container ===
|
|
490
|
-
var
|
|
491
|
-
|
|
492
|
-
} else x(l) || (
|
|
489
|
+
if (F < 0 && (g.container === u || $(u, c.tabbableOptions) && !I(u, c.tabbableOptions) && !g.nextTabbableNode(u)) && (F = s), F >= 0) {
|
|
490
|
+
var P = F === i.tabbableGroups.length - 1 ? 0 : F + 1, te = i.tabbableGroups[P];
|
|
491
|
+
y = k(u) >= 0 ? te.firstTabbableNode : te.firstDomTabbableNode;
|
|
492
|
+
} else x(l) || (y = g.nextTabbableNode(u));
|
|
493
493
|
}
|
|
494
494
|
} else
|
|
495
|
-
|
|
496
|
-
return
|
|
495
|
+
y = T("fallbackFocus");
|
|
496
|
+
return y;
|
|
497
497
|
}, L = function(n) {
|
|
498
|
-
var
|
|
499
|
-
if (!(
|
|
500
|
-
if (C(
|
|
498
|
+
var u = B(n);
|
|
499
|
+
if (!(p(u, n) >= 0)) {
|
|
500
|
+
if (C(c.clickOutsideDeactivates, n)) {
|
|
501
501
|
b.deactivate({
|
|
502
502
|
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
503
503
|
// which will result in the outside click setting focus to the node
|
|
@@ -505,27 +505,27 @@ var ie = {
|
|
|
505
505
|
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
506
506
|
// on activation (or the configured `setReturnFocus` node), whether the
|
|
507
507
|
// outside click was on a focusable node or not
|
|
508
|
-
returnFocus:
|
|
508
|
+
returnFocus: c.returnFocusOnDeactivate
|
|
509
509
|
});
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
C(
|
|
512
|
+
C(c.allowOutsideClick, n) || n.preventDefault();
|
|
513
513
|
}
|
|
514
514
|
}, z = function(n) {
|
|
515
|
-
var
|
|
516
|
-
if (l ||
|
|
517
|
-
l && (i.mostRecentlyFocusedNode =
|
|
515
|
+
var u = B(n), l = p(u, n) >= 0;
|
|
516
|
+
if (l || u instanceof Document)
|
|
517
|
+
l && (i.mostRecentlyFocusedNode = u);
|
|
518
518
|
else {
|
|
519
519
|
n.stopImmediatePropagation();
|
|
520
520
|
var f, d = !0;
|
|
521
521
|
if (i.mostRecentlyFocusedNode)
|
|
522
522
|
if (k(i.mostRecentlyFocusedNode) > 0) {
|
|
523
|
-
var
|
|
524
|
-
if (
|
|
525
|
-
var g =
|
|
523
|
+
var y = p(i.mostRecentlyFocusedNode), s = i.containerGroups[y].tabbableNodes;
|
|
524
|
+
if (s.length > 0) {
|
|
525
|
+
var g = s.findIndex(function(m) {
|
|
526
526
|
return m === i.mostRecentlyFocusedNode;
|
|
527
527
|
});
|
|
528
|
-
g >= 0 && (
|
|
528
|
+
g >= 0 && (c.isKeyForward(i.recentNavEvent) ? g + 1 < s.length && (f = s[g + 1], d = !1) : g - 1 >= 0 && (f = s[g - 1], d = !1));
|
|
529
529
|
}
|
|
530
530
|
} else
|
|
531
531
|
i.containerGroups.some(function(m) {
|
|
@@ -539,53 +539,53 @@ var ie = {
|
|
|
539
539
|
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
540
540
|
// outside the trap causing the focus escape we're trying to fix)
|
|
541
541
|
target: i.mostRecentlyFocusedNode,
|
|
542
|
-
isBackward:
|
|
542
|
+
isBackward: c.isKeyBackward(i.recentNavEvent)
|
|
543
543
|
})), N(f || i.mostRecentlyFocusedNode || w());
|
|
544
544
|
}
|
|
545
545
|
i.recentNavEvent = void 0;
|
|
546
546
|
}, ve = function(n) {
|
|
547
|
-
var
|
|
547
|
+
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
548
548
|
i.recentNavEvent = n;
|
|
549
549
|
var l = Z({
|
|
550
550
|
event: n,
|
|
551
|
-
isBackward:
|
|
551
|
+
isBackward: u
|
|
552
552
|
});
|
|
553
553
|
l && (x(n) && n.preventDefault(), N(l));
|
|
554
554
|
}, X = function(n) {
|
|
555
|
-
(
|
|
555
|
+
(c.isKeyForward(n) || c.isKeyBackward(n)) && ve(n, c.isKeyBackward(n));
|
|
556
556
|
}, H = function(n) {
|
|
557
|
-
Ve(n) && C(
|
|
557
|
+
Ve(n) && C(c.escapeDeactivates, n) !== !1 && (n.preventDefault(), b.deactivate());
|
|
558
558
|
}, J = function(n) {
|
|
559
|
-
var
|
|
560
|
-
|
|
559
|
+
var u = B(n);
|
|
560
|
+
p(u, n) >= 0 || C(c.clickOutsideDeactivates, n) || C(c.allowOutsideClick, n) || (n.preventDefault(), n.stopImmediatePropagation());
|
|
561
561
|
}, Q = function() {
|
|
562
562
|
if (i.active)
|
|
563
|
-
return ie.activateTrap(
|
|
563
|
+
return ie.activateTrap(o, b), i.delayInitialFocusTimer = c.delayInitialFocus ? ue(function() {
|
|
564
564
|
N(w());
|
|
565
|
-
}) : N(w()),
|
|
565
|
+
}) : N(w()), a.addEventListener("focusin", z, !0), a.addEventListener("mousedown", L, {
|
|
566
566
|
capture: !0,
|
|
567
567
|
passive: !1
|
|
568
|
-
}),
|
|
568
|
+
}), a.addEventListener("touchstart", L, {
|
|
569
569
|
capture: !0,
|
|
570
570
|
passive: !1
|
|
571
|
-
}),
|
|
571
|
+
}), a.addEventListener("click", J, {
|
|
572
572
|
capture: !0,
|
|
573
573
|
passive: !1
|
|
574
|
-
}),
|
|
574
|
+
}), a.addEventListener("keydown", X, {
|
|
575
575
|
capture: !0,
|
|
576
576
|
passive: !1
|
|
577
|
-
}),
|
|
577
|
+
}), a.addEventListener("keydown", H), b;
|
|
578
578
|
}, ee = function() {
|
|
579
579
|
if (i.active)
|
|
580
|
-
return
|
|
580
|
+
return a.removeEventListener("focusin", z, !0), a.removeEventListener("mousedown", L, !0), a.removeEventListener("touchstart", L, !0), a.removeEventListener("click", J, !0), a.removeEventListener("keydown", X, !0), a.removeEventListener("keydown", H), b;
|
|
581
581
|
}, be = function(n) {
|
|
582
|
-
var
|
|
582
|
+
var u = n.some(function(l) {
|
|
583
583
|
var f = Array.from(l.removedNodes);
|
|
584
584
|
return f.some(function(d) {
|
|
585
585
|
return d === i.mostRecentlyFocusedNode;
|
|
586
586
|
});
|
|
587
587
|
});
|
|
588
|
-
|
|
588
|
+
u && N(w());
|
|
589
589
|
}, q = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(be) : void 0, A = function() {
|
|
590
590
|
q && (q.disconnect(), i.active && !i.paused && i.containers.map(function(n) {
|
|
591
591
|
q.observe(n, {
|
|
@@ -604,8 +604,8 @@ var ie = {
|
|
|
604
604
|
activate: function(n) {
|
|
605
605
|
if (i.active)
|
|
606
606
|
return this;
|
|
607
|
-
var
|
|
608
|
-
f || E(), i.active = !0, i.paused = !1, i.nodeFocusedBeforeActivation = D(
|
|
607
|
+
var u = v(n, "onActivate"), l = v(n, "onPostActivate"), f = v(n, "checkCanFocusTrap");
|
|
608
|
+
f || E(), i.active = !0, i.paused = !1, i.nodeFocusedBeforeActivation = D(a), u == null || u();
|
|
609
609
|
var d = function() {
|
|
610
610
|
f && E(), Q(), A(), l == null || l();
|
|
611
611
|
};
|
|
@@ -614,31 +614,31 @@ var ie = {
|
|
|
614
614
|
deactivate: function(n) {
|
|
615
615
|
if (!i.active)
|
|
616
616
|
return this;
|
|
617
|
-
var
|
|
618
|
-
onDeactivate:
|
|
619
|
-
onPostDeactivate:
|
|
620
|
-
checkCanReturnFocus:
|
|
617
|
+
var u = ne({
|
|
618
|
+
onDeactivate: c.onDeactivate,
|
|
619
|
+
onPostDeactivate: c.onPostDeactivate,
|
|
620
|
+
checkCanReturnFocus: c.checkCanReturnFocus
|
|
621
621
|
}, n);
|
|
622
|
-
clearTimeout(i.delayInitialFocusTimer), i.delayInitialFocusTimer = void 0, ee(), i.active = !1, i.paused = !1, A(), ie.deactivateTrap(
|
|
623
|
-
var l = v(
|
|
622
|
+
clearTimeout(i.delayInitialFocusTimer), i.delayInitialFocusTimer = void 0, ee(), i.active = !1, i.paused = !1, A(), ie.deactivateTrap(o, b);
|
|
623
|
+
var l = v(u, "onDeactivate"), f = v(u, "onPostDeactivate"), d = v(u, "checkCanReturnFocus"), y = v(u, "returnFocus", "returnFocusOnDeactivate");
|
|
624
624
|
l == null || l();
|
|
625
|
-
var
|
|
626
|
-
|
|
627
|
-
|
|
625
|
+
var s = function() {
|
|
626
|
+
ue(function() {
|
|
627
|
+
y && N(Y(i.nodeFocusedBeforeActivation)), f == null || f();
|
|
628
628
|
});
|
|
629
629
|
};
|
|
630
|
-
return
|
|
630
|
+
return y && d ? (d(Y(i.nodeFocusedBeforeActivation)).then(s, s), this) : (s(), this);
|
|
631
631
|
},
|
|
632
632
|
pause: function(n) {
|
|
633
633
|
return i.active ? (i.manuallyPaused = !0, this._setPausedState(!0, n)) : this;
|
|
634
634
|
},
|
|
635
635
|
unpause: function(n) {
|
|
636
|
-
return i.active ? (i.manuallyPaused = !1,
|
|
636
|
+
return i.active ? (i.manuallyPaused = !1, o[o.length - 1] !== this ? this : this._setPausedState(!1, n)) : this;
|
|
637
637
|
},
|
|
638
638
|
updateContainerElements: function(n) {
|
|
639
|
-
var
|
|
640
|
-
return i.containers =
|
|
641
|
-
return typeof l == "string" ?
|
|
639
|
+
var u = [].concat(n).filter(Boolean);
|
|
640
|
+
return i.containers = u.map(function(l) {
|
|
641
|
+
return typeof l == "string" ? a.querySelector(l) : l;
|
|
642
642
|
}), i.active && E(), A(), this;
|
|
643
643
|
}
|
|
644
644
|
}, Object.defineProperties(b, {
|
|
@@ -648,30 +648,35 @@ var ie = {
|
|
|
648
648
|
}
|
|
649
649
|
},
|
|
650
650
|
_setPausedState: {
|
|
651
|
-
value: function(n,
|
|
651
|
+
value: function(n, u) {
|
|
652
652
|
if (i.paused === n)
|
|
653
653
|
return this;
|
|
654
654
|
if (i.paused = n, n) {
|
|
655
|
-
var l = v(
|
|
655
|
+
var l = v(u, "onPause"), f = v(u, "onPostPause");
|
|
656
656
|
l == null || l(), ee(), A(), f == null || f();
|
|
657
657
|
} else {
|
|
658
|
-
var d = v(
|
|
659
|
-
d == null || d(), E(), Q(), A(),
|
|
658
|
+
var d = v(u, "onUnpause"), y = v(u, "onPostUnpause");
|
|
659
|
+
d == null || d(), E(), Q(), A(), y == null || y();
|
|
660
660
|
}
|
|
661
661
|
return this;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
664
|
}), b.updateContainerElements(e), b;
|
|
665
665
|
};
|
|
666
|
-
const Ze = (
|
|
666
|
+
const Ze = (r, e, t) => {
|
|
667
667
|
he(() => {
|
|
668
|
-
if (!
|
|
668
|
+
if (!r || !e)
|
|
669
669
|
return;
|
|
670
|
-
const
|
|
671
|
-
|
|
672
|
-
|
|
670
|
+
const a = We(r, {
|
|
671
|
+
...t,
|
|
672
|
+
initialFocus: (t == null ? void 0 : t.initialFocus) ?? r,
|
|
673
|
+
fallbackFocus: (t == null ? void 0 : t.fallbackFocus) ?? r,
|
|
674
|
+
returnFocusOnDeactivate: !1
|
|
675
|
+
});
|
|
676
|
+
return a.activate(), () => {
|
|
677
|
+
a.deactivate();
|
|
673
678
|
};
|
|
674
|
-
}, [
|
|
679
|
+
}, [r, e]);
|
|
675
680
|
};
|
|
676
681
|
export {
|
|
677
682
|
Ze as useFocusTrap
|