agnosticui-core 2.0.0-alpha.21 → 2.0.0-alpha.23
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/components/Checkbox/core/_Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/core/_Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/core/_Checkbox.js +44 -36
- package/dist/components/Combobox/core/_Combobox.d.ts +19 -0
- package/dist/components/Combobox/core/_Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/core/_Combobox.js +154 -122
- package/dist/components/Combobox/vue/VueCombobox.vue.d.ts +1 -1
- package/dist/components/Dialog/core/_dialog.d.ts.map +1 -1
- package/dist/components/Dialog/core/_dialog.js +176 -166
- package/dist/components/Dialog/react/ReactDialog.d.ts +27 -8
- package/dist/components/Dialog/react/ReactDialog.d.ts.map +1 -1
- package/dist/components/Dialog/react/ReactDialog.js +32 -10
- package/dist/components/Drawer/react/ReactDrawer.d.ts +27 -8
- package/dist/components/Drawer/react/ReactDrawer.d.ts.map +1 -1
- package/dist/components/Drawer/react/ReactDrawer.js +31 -9
- package/dist/components/Input/core/_Input.d.ts +19 -0
- package/dist/components/Input/core/_Input.d.ts.map +1 -1
- package/dist/components/Input/core/_Input.js +34 -9
- package/dist/components/Radio/core/_Radio.d.ts +5 -0
- package/dist/components/Radio/core/_Radio.d.ts.map +1 -1
- package/dist/components/Radio/core/_Radio.js +38 -31
- package/dist/components/Rating/core/_Rating.d.ts +18 -0
- package/dist/components/Rating/core/_Rating.d.ts.map +1 -1
- package/dist/components/Rating/core/_Rating.js +90 -68
- package/dist/components/Select/core/_Select.d.ts +19 -0
- package/dist/components/Select/core/_Select.d.ts.map +1 -1
- package/dist/components/Select/core/_Select.js +102 -65
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts +18 -0
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.d.ts.map +1 -1
- package/dist/components/SelectionButtonGroup/core/_SelectionButtonGroup.js +54 -32
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts +18 -0
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.d.ts.map +1 -1
- package/dist/components/SelectionCardGroup/core/_SelectionCardGroup.js +61 -39
- package/dist/components/Slider/core/_Slider.d.ts +20 -0
- package/dist/components/Slider/core/_Slider.d.ts.map +1 -1
- package/dist/components/Slider/core/_Slider.js +132 -104
- package/dist/components/Toggle/core/_Toggle.d.ts +6 -0
- package/dist/components/Toggle/core/_Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/core/_Toggle.js +94 -86
- package/dist/shared/face-mixin.d.ts +5 -0
- package/dist/shared/face-mixin.d.ts.map +1 -1
- package/dist/shared/face-mixin.js +39 -25
- package/package.json +1 -1
- package/src/components/Checkbox/core/_Checkbox.ts +16 -0
- package/src/components/Combobox/core/_Combobox.ts +53 -0
- package/src/components/Dialog/core/_dialog.ts +19 -2
- package/src/components/Dialog/react/ReactDialog.tsx +60 -3
- package/src/components/Drawer/react/ReactDrawer.tsx +60 -3
- package/src/components/Input/core/_Input.ts +47 -0
- package/src/components/Radio/core/_Radio.ts +14 -0
- package/src/components/Rating/core/_Rating.ts +42 -0
- package/src/components/Select/core/_Select.ts +57 -0
- package/src/components/SelectionButtonGroup/core/_SelectionButtonGroup.ts +48 -0
- package/src/components/SelectionCardGroup/core/_SelectionCardGroup.ts +48 -0
- package/src/components/Slider/core/_Slider.ts +53 -0
- package/src/components/Toggle/core/_Toggle.ts +15 -0
- package/src/shared/face-mixin.ts +48 -6
|
@@ -7,13 +7,13 @@ import "../../shared/CloseButton/CloseButton.js";
|
|
|
7
7
|
* tabbable 6.2.0
|
|
8
8
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
9
9
|
*/
|
|
10
|
-
var ve = ["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])"],
|
|
11
|
-
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector,
|
|
10
|
+
var ve = ["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])"], z = /* @__PURE__ */ ve.join(","), be = typeof Element > "u", O = be ? function() {
|
|
11
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, M = !be && Element.prototype.getRootNode ? function(i) {
|
|
12
12
|
var e;
|
|
13
13
|
return i == null || (e = i.getRootNode) === null || e === void 0 ? void 0 : e.call(i);
|
|
14
14
|
} : function(i) {
|
|
15
15
|
return i?.ownerDocument;
|
|
16
|
-
},
|
|
16
|
+
}, $ = function i(e, t) {
|
|
17
17
|
var a;
|
|
18
18
|
t === void 0 && (t = !0);
|
|
19
19
|
var s = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), l = s === "" || s === "true", r = l || t && e && i(e.parentNode);
|
|
@@ -22,14 +22,14 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
22
22
|
var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
23
23
|
return a === "" || a === "true";
|
|
24
24
|
}, pe = function(e, t, a) {
|
|
25
|
-
if (
|
|
25
|
+
if ($(e))
|
|
26
26
|
return [];
|
|
27
|
-
var s = Array.prototype.slice.apply(e.querySelectorAll(
|
|
28
|
-
return t && O.call(e,
|
|
27
|
+
var s = Array.prototype.slice.apply(e.querySelectorAll(z));
|
|
28
|
+
return t && O.call(e, z) && s.unshift(e), s = s.filter(a), s;
|
|
29
29
|
}, he = function i(e, t, a) {
|
|
30
30
|
for (var s = [], l = Array.from(e); l.length; ) {
|
|
31
31
|
var r = l.shift();
|
|
32
|
-
if (
|
|
32
|
+
if (!$(r, !1))
|
|
33
33
|
if (r.tagName === "SLOT") {
|
|
34
34
|
var b = r.assignedElements(), v = b.length ? b : r.children, g = i(v, !0, a);
|
|
35
35
|
a.flatten ? s.push.apply(s, g) : s.push({
|
|
@@ -37,11 +37,11 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
37
37
|
candidates: g
|
|
38
38
|
});
|
|
39
39
|
} else {
|
|
40
|
-
var k = O.call(r,
|
|
40
|
+
var k = O.call(r, z);
|
|
41
41
|
k && a.filter(r) && (t || !e.includes(r)) && s.push(r);
|
|
42
42
|
var w = r.shadowRoot || // check for an undisclosed shadow
|
|
43
|
-
typeof a.getShadowRoot == "function" && a.getShadowRoot(r),
|
|
44
|
-
if (w &&
|
|
43
|
+
typeof a.getShadowRoot == "function" && a.getShadowRoot(r), F = !$(w, !1) && (!a.shadowRootFilter || a.shadowRootFilter(r));
|
|
44
|
+
if (w && F) {
|
|
45
45
|
var R = i(w === !0 ? r.children : w.children, !0, a);
|
|
46
46
|
a.flatten ? s.push.apply(s, R) : s.push({
|
|
47
47
|
scopeParent: r,
|
|
@@ -54,20 +54,20 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
54
54
|
return s;
|
|
55
55
|
}, ge = function(e) {
|
|
56
56
|
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
57
|
-
},
|
|
57
|
+
}, D = function(e) {
|
|
58
58
|
if (!e)
|
|
59
59
|
throw new Error("No node provided");
|
|
60
60
|
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Ce(e)) && !ge(e) ? 0 : e.tabIndex;
|
|
61
|
-
}, Fe = function(e, t) {
|
|
62
|
-
var a = A(e);
|
|
63
|
-
return a < 0 && t && !ge(e) ? 0 : a;
|
|
64
61
|
}, Se = function(e, t) {
|
|
62
|
+
var a = D(e);
|
|
63
|
+
return a < 0 && t && !ge(e) ? 0 : a;
|
|
64
|
+
}, Fe = function(e, t) {
|
|
65
65
|
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
66
66
|
}, me = function(e) {
|
|
67
67
|
return e.tagName === "INPUT";
|
|
68
|
-
}, De = function(e) {
|
|
69
|
-
return me(e) && e.type === "hidden";
|
|
70
68
|
}, Ae = function(e) {
|
|
69
|
+
return me(e) && e.type === "hidden";
|
|
70
|
+
}, De = function(e) {
|
|
71
71
|
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
|
|
72
72
|
return a.tagName === "SUMMARY";
|
|
73
73
|
});
|
|
@@ -79,7 +79,7 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
79
79
|
}, Re = function(e) {
|
|
80
80
|
if (!e.name)
|
|
81
81
|
return !0;
|
|
82
|
-
var t = e.form ||
|
|
82
|
+
var t = e.form || M(e), a = function(b) {
|
|
83
83
|
return t.querySelectorAll('input[type="radio"][name="' + b + '"]');
|
|
84
84
|
}, s;
|
|
85
85
|
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
@@ -97,12 +97,12 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
97
97
|
}, Ie = function(e) {
|
|
98
98
|
return Pe(e) && !Re(e);
|
|
99
99
|
}, xe = function(e) {
|
|
100
|
-
var t, a = e &&
|
|
100
|
+
var t, a = e && M(e), s = (t = a) === null || t === void 0 ? void 0 : t.host, l = !1;
|
|
101
101
|
if (a && a !== e) {
|
|
102
102
|
var r, b, v;
|
|
103
103
|
for (l = !!((r = s) !== null && r !== void 0 && (b = r.ownerDocument) !== null && b !== void 0 && b.contains(s) || e != null && (v = e.ownerDocument) !== null && v !== void 0 && v.contains(e)); !l && s; ) {
|
|
104
104
|
var g, k, w;
|
|
105
|
-
a =
|
|
105
|
+
a = M(s), s = (g = a) === null || g === void 0 ? void 0 : g.host, l = !!((k = s) !== null && k !== void 0 && (w = k.ownerDocument) !== null && w !== void 0 && w.contains(s));
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
return l;
|
|
@@ -119,7 +119,7 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
119
119
|
if (!a || a === "full" || a === "legacy-full") {
|
|
120
120
|
if (typeof s == "function") {
|
|
121
121
|
for (var b = e; e; ) {
|
|
122
|
-
var v = e.parentElement, g =
|
|
122
|
+
var v = e.parentElement, g = M(e);
|
|
123
123
|
if (v && !v.shadowRoot && s(v) === !0)
|
|
124
124
|
return le(e);
|
|
125
125
|
e.assignedSlot ? e = e.assignedSlot : !v && g !== e.ownerDocument ? e = g.host : e = v;
|
|
@@ -151,17 +151,17 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
151
151
|
return !(t.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
152
152
|
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
153
153
|
// note related to `candidateSelectors`)
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
return !(Ie(t) ||
|
|
154
|
+
$(t) || Ae(t) || Be(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
155
|
+
De(t) || Le(t));
|
|
156
|
+
}, W = function(e, t) {
|
|
157
|
+
return !(Ie(t) || D(t) < 0 || !q(e, t));
|
|
158
158
|
}, _e = function(e) {
|
|
159
159
|
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
160
160
|
return !!(isNaN(t) || t >= 0);
|
|
161
161
|
}, Ke = function i(e) {
|
|
162
162
|
var t = [], a = [];
|
|
163
163
|
return e.forEach(function(s, l) {
|
|
164
|
-
var r = !!s.scopeParent, b = r ? s.scopeParent : s, v =
|
|
164
|
+
var r = !!s.scopeParent, b = r ? s.scopeParent : s, v = Se(b, r), g = r ? i(s.candidates) : b;
|
|
165
165
|
v === 0 ? r ? t.push.apply(t, g) : t.push(b) : a.push({
|
|
166
166
|
documentOrder: l,
|
|
167
167
|
tabIndex: v,
|
|
@@ -169,19 +169,19 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
169
169
|
isScope: r,
|
|
170
170
|
content: g
|
|
171
171
|
});
|
|
172
|
-
}), a.sort(
|
|
172
|
+
}), a.sort(Fe).reduce(function(s, l) {
|
|
173
173
|
return l.isScope ? s.push.apply(s, l.content) : s.push(l.content), s;
|
|
174
174
|
}, []).concat(t);
|
|
175
175
|
}, je = function(e, t) {
|
|
176
176
|
t = t || {};
|
|
177
177
|
var a;
|
|
178
178
|
return t.getShadowRoot ? a = he([e], t.includeContainer, {
|
|
179
|
-
filter:
|
|
179
|
+
filter: W.bind(null, t),
|
|
180
180
|
flatten: !1,
|
|
181
181
|
getShadowRoot: t.getShadowRoot,
|
|
182
182
|
shadowRootFilter: _e
|
|
183
|
-
}) : a = pe(e, t.includeContainer,
|
|
184
|
-
},
|
|
183
|
+
}) : a = pe(e, t.includeContainer, W.bind(null, t)), Ke(a);
|
|
184
|
+
}, Ge = function(e, t) {
|
|
185
185
|
t = t || {};
|
|
186
186
|
var a;
|
|
187
187
|
return t.getShadowRoot ? a = he([e], t.includeContainer, {
|
|
@@ -192,11 +192,11 @@ var ve = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
|
|
|
192
192
|
}, P = function(e, t) {
|
|
193
193
|
if (t = t || {}, !e)
|
|
194
194
|
throw new Error("No node provided");
|
|
195
|
-
return O.call(e,
|
|
196
|
-
},
|
|
195
|
+
return O.call(e, z) === !1 ? !1 : W(t, e);
|
|
196
|
+
}, ze = /* @__PURE__ */ ve.concat("iframe").join(","), H = function(e, t) {
|
|
197
197
|
if (t = t || {}, !e)
|
|
198
198
|
throw new Error("No node provided");
|
|
199
|
-
return O.call(e,
|
|
199
|
+
return O.call(e, ze) === !1 ? !1 : q(t, e);
|
|
200
200
|
};
|
|
201
201
|
/*!
|
|
202
202
|
* focus-trap 7.6.5
|
|
@@ -207,10 +207,10 @@ function Z(i, e) {
|
|
|
207
207
|
for (var t = 0, a = Array(e); t < e; t++) a[t] = i[t];
|
|
208
208
|
return a;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Me(i) {
|
|
211
211
|
if (Array.isArray(i)) return Z(i);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function $e(i, e, t) {
|
|
214
214
|
return (e = Xe(e)) in i ? Object.defineProperty(i, e, {
|
|
215
215
|
value: t,
|
|
216
216
|
enumerable: !0,
|
|
@@ -239,7 +239,7 @@ function ue(i) {
|
|
|
239
239
|
for (var e = 1; e < arguments.length; e++) {
|
|
240
240
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
241
241
|
e % 2 ? ce(Object(t), !0).forEach(function(a) {
|
|
242
|
-
|
|
242
|
+
$e(i, a, t[a]);
|
|
243
243
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(t)) : ce(Object(t)).forEach(function(a) {
|
|
244
244
|
Object.defineProperty(i, a, Object.getOwnPropertyDescriptor(t, a));
|
|
245
245
|
});
|
|
@@ -247,7 +247,7 @@ function ue(i) {
|
|
|
247
247
|
return i;
|
|
248
248
|
}
|
|
249
249
|
function Ue(i) {
|
|
250
|
-
return
|
|
250
|
+
return Me(i) || qe(i) || He(i) || Ye();
|
|
251
251
|
}
|
|
252
252
|
function Ve(i, e) {
|
|
253
253
|
if (typeof i != "object" || !i) return i;
|
|
@@ -263,7 +263,7 @@ function Xe(i) {
|
|
|
263
263
|
var e = Ve(i, "string");
|
|
264
264
|
return typeof e == "symbol" ? e : e + "";
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function He(i, e) {
|
|
267
267
|
if (i) {
|
|
268
268
|
if (typeof i == "string") return Z(i, e);
|
|
269
269
|
var t = {}.toString.call(i).slice(8, -1);
|
|
@@ -283,7 +283,7 @@ var de = {
|
|
|
283
283
|
var a = e.indexOf(t);
|
|
284
284
|
a !== -1 && e.splice(a, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
|
|
285
285
|
}
|
|
286
|
-
},
|
|
286
|
+
}, We = function(e) {
|
|
287
287
|
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
288
288
|
}, Ze = function(e) {
|
|
289
289
|
return e?.key === "Escape" || e?.key === "Esc" || e?.keyCode === 27;
|
|
@@ -299,7 +299,7 @@ var de = {
|
|
|
299
299
|
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
|
|
300
300
|
a[s - 1] = arguments[s];
|
|
301
301
|
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
302
|
-
},
|
|
302
|
+
}, G = function(e) {
|
|
303
303
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
304
304
|
}, et = [], tt = function(e, t) {
|
|
305
305
|
var a = t?.document || document, s = t?.trapStack || et, l = ue({
|
|
@@ -345,63 +345,63 @@ var de = {
|
|
|
345
345
|
delayInitialFocusTimer: void 0,
|
|
346
346
|
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
347
347
|
recentNavEvent: void 0
|
|
348
|
-
}, b, v = function(
|
|
349
|
-
return
|
|
350
|
-
}, g = function(
|
|
351
|
-
var c = typeof
|
|
348
|
+
}, b, v = function(o, n, c) {
|
|
349
|
+
return o && o[n] !== void 0 ? o[n] : l[c || n];
|
|
350
|
+
}, g = function(o, n) {
|
|
351
|
+
var c = typeof n?.composedPath == "function" ? n.composedPath() : void 0;
|
|
352
352
|
return r.containerGroups.findIndex(function(d) {
|
|
353
353
|
var f = d.container, h = d.tabbableNodes;
|
|
354
|
-
return f.contains(
|
|
355
|
-
return u ===
|
|
354
|
+
return f.contains(o) || c?.includes(f) || h.find(function(u) {
|
|
355
|
+
return u === o;
|
|
356
356
|
});
|
|
357
357
|
});
|
|
358
|
-
}, k = function(
|
|
359
|
-
var
|
|
358
|
+
}, k = function(o) {
|
|
359
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = n.hasFallback, d = c === void 0 ? !1 : c, f = n.params, h = f === void 0 ? [] : f, u = l[o];
|
|
360
360
|
if (typeof u == "function" && (u = u.apply(void 0, Ue(h))), u === !0 && (u = void 0), !u) {
|
|
361
361
|
if (u === void 0 || u === !1)
|
|
362
362
|
return u;
|
|
363
|
-
throw new Error("`".concat(
|
|
363
|
+
throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
|
|
364
364
|
}
|
|
365
365
|
var m = u;
|
|
366
366
|
if (typeof u == "string") {
|
|
367
367
|
try {
|
|
368
368
|
m = a.querySelector(u);
|
|
369
369
|
} catch (y) {
|
|
370
|
-
throw new Error("`".concat(
|
|
370
|
+
throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(y.message, '"'));
|
|
371
371
|
}
|
|
372
372
|
if (!m && !d)
|
|
373
|
-
throw new Error("`".concat(
|
|
373
|
+
throw new Error("`".concat(o, "` as selector refers to no known node"));
|
|
374
374
|
}
|
|
375
375
|
return m;
|
|
376
376
|
}, w = function() {
|
|
377
|
-
var
|
|
377
|
+
var o = k("initialFocus", {
|
|
378
378
|
hasFallback: !0
|
|
379
379
|
});
|
|
380
|
-
if (
|
|
380
|
+
if (o === !1)
|
|
381
381
|
return !1;
|
|
382
|
-
if (
|
|
382
|
+
if (o === void 0 || o && !H(o, l.tabbableOptions))
|
|
383
383
|
if (g(a.activeElement) >= 0)
|
|
384
|
-
|
|
384
|
+
o = a.activeElement;
|
|
385
385
|
else {
|
|
386
|
-
var
|
|
387
|
-
|
|
386
|
+
var n = r.tabbableGroups[0], c = n && n.firstTabbableNode;
|
|
387
|
+
o = c || k("fallbackFocus");
|
|
388
388
|
}
|
|
389
|
-
else
|
|
390
|
-
if (!
|
|
389
|
+
else o === null && (o = k("fallbackFocus"));
|
|
390
|
+
if (!o)
|
|
391
391
|
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
392
|
-
return
|
|
393
|
-
},
|
|
394
|
-
if (r.containerGroups = r.containers.map(function(
|
|
395
|
-
var
|
|
392
|
+
return o;
|
|
393
|
+
}, F = function() {
|
|
394
|
+
if (r.containerGroups = r.containers.map(function(o) {
|
|
395
|
+
var n = je(o, l.tabbableOptions), c = Ge(o, l.tabbableOptions), d = n.length > 0 ? n[0] : void 0, f = n.length > 0 ? n[n.length - 1] : void 0, h = c.find(function(y) {
|
|
396
396
|
return P(y);
|
|
397
397
|
}), u = c.slice().reverse().find(function(y) {
|
|
398
398
|
return P(y);
|
|
399
|
-
}), m = !!
|
|
400
|
-
return
|
|
399
|
+
}), m = !!n.find(function(y) {
|
|
400
|
+
return D(y) > 0;
|
|
401
401
|
});
|
|
402
402
|
return {
|
|
403
|
-
container:
|
|
404
|
-
tabbableNodes:
|
|
403
|
+
container: o,
|
|
404
|
+
tabbableNodes: n,
|
|
405
405
|
focusableNodes: c,
|
|
406
406
|
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
407
407
|
posTabIndexesFound: m,
|
|
@@ -428,76 +428,76 @@ var de = {
|
|
|
428
428
|
* in reverse.
|
|
429
429
|
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
430
430
|
*/
|
|
431
|
-
nextTabbableNode: function(
|
|
432
|
-
var x = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0,
|
|
433
|
-
return
|
|
431
|
+
nextTabbableNode: function(A) {
|
|
432
|
+
var x = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, S = n.indexOf(A);
|
|
433
|
+
return S < 0 ? x ? c.slice(c.indexOf(A) + 1).find(function(B) {
|
|
434
434
|
return P(B);
|
|
435
|
-
}) : c.slice(0, c.indexOf(
|
|
435
|
+
}) : c.slice(0, c.indexOf(A)).reverse().find(function(B) {
|
|
436
436
|
return P(B);
|
|
437
|
-
}) :
|
|
437
|
+
}) : n[S + (x ? 1 : -1)];
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
}), r.tabbableGroups = r.containerGroups.filter(function(
|
|
441
|
-
return
|
|
440
|
+
}), r.tabbableGroups = r.containerGroups.filter(function(o) {
|
|
441
|
+
return o.tabbableNodes.length > 0;
|
|
442
442
|
}), r.tabbableGroups.length <= 0 && !k("fallbackFocus"))
|
|
443
443
|
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
444
|
-
if (r.containerGroups.find(function(
|
|
445
|
-
return
|
|
444
|
+
if (r.containerGroups.find(function(o) {
|
|
445
|
+
return o.posTabIndexesFound;
|
|
446
446
|
}) && r.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
|
-
}, R = function(
|
|
449
|
-
var
|
|
450
|
-
if (
|
|
451
|
-
return
|
|
452
|
-
}, C = function(
|
|
453
|
-
if (
|
|
454
|
-
if (!
|
|
448
|
+
}, R = function(o) {
|
|
449
|
+
var n = o.activeElement;
|
|
450
|
+
if (n)
|
|
451
|
+
return n.shadowRoot && n.shadowRoot.activeElement !== null ? R(n.shadowRoot) : n;
|
|
452
|
+
}, C = function(o) {
|
|
453
|
+
if (o !== !1 && o !== R(document)) {
|
|
454
|
+
if (!o || !o.focus) {
|
|
455
455
|
C(w());
|
|
456
456
|
return;
|
|
457
457
|
}
|
|
458
|
-
|
|
458
|
+
o.focus({
|
|
459
459
|
preventScroll: !!l.preventScroll
|
|
460
|
-
}), r.mostRecentlyFocusedNode =
|
|
460
|
+
}), r.mostRecentlyFocusedNode = o, We(o) && o.select();
|
|
461
461
|
}
|
|
462
|
-
}, Q = function(
|
|
463
|
-
var
|
|
464
|
-
params: [
|
|
462
|
+
}, Q = function(o) {
|
|
463
|
+
var n = k("setReturnFocus", {
|
|
464
|
+
params: [o]
|
|
465
465
|
});
|
|
466
|
-
return
|
|
467
|
-
}, ee = function(
|
|
468
|
-
var
|
|
469
|
-
|
|
466
|
+
return n || (n === !1 ? !1 : o);
|
|
467
|
+
}, ee = function(o) {
|
|
468
|
+
var n = o.target, c = o.event, d = o.isBackward, f = d === void 0 ? !1 : d;
|
|
469
|
+
n = n || G(c), F();
|
|
470
470
|
var h = null;
|
|
471
471
|
if (r.tabbableGroups.length > 0) {
|
|
472
|
-
var u = g(
|
|
472
|
+
var u = g(n, c), m = u >= 0 ? r.containerGroups[u] : void 0;
|
|
473
473
|
if (u < 0)
|
|
474
474
|
f ? h = r.tabbableGroups[r.tabbableGroups.length - 1].lastTabbableNode : h = r.tabbableGroups[0].firstTabbableNode;
|
|
475
475
|
else if (f) {
|
|
476
476
|
var y = r.tabbableGroups.findIndex(function(U) {
|
|
477
477
|
var V = U.firstTabbableNode;
|
|
478
|
-
return
|
|
478
|
+
return n === V;
|
|
479
479
|
});
|
|
480
|
-
if (y < 0 && (m.container ===
|
|
481
|
-
var
|
|
482
|
-
h =
|
|
483
|
-
} else _(c) || (h = m.nextTabbableNode(
|
|
480
|
+
if (y < 0 && (m.container === n || H(n, l.tabbableOptions) && !P(n, l.tabbableOptions) && !m.nextTabbableNode(n, !1)) && (y = u), y >= 0) {
|
|
481
|
+
var A = y === 0 ? r.tabbableGroups.length - 1 : y - 1, x = r.tabbableGroups[A];
|
|
482
|
+
h = D(n) >= 0 ? x.lastTabbableNode : x.lastDomTabbableNode;
|
|
483
|
+
} else _(c) || (h = m.nextTabbableNode(n, !1));
|
|
484
484
|
} else {
|
|
485
|
-
var
|
|
485
|
+
var S = r.tabbableGroups.findIndex(function(U) {
|
|
486
486
|
var V = U.lastTabbableNode;
|
|
487
|
-
return
|
|
487
|
+
return n === V;
|
|
488
488
|
});
|
|
489
|
-
if (
|
|
490
|
-
var B =
|
|
491
|
-
h =
|
|
492
|
-
} else _(c) || (h = m.nextTabbableNode(
|
|
489
|
+
if (S < 0 && (m.container === n || H(n, l.tabbableOptions) && !P(n, l.tabbableOptions) && !m.nextTabbableNode(n)) && (S = u), S >= 0) {
|
|
490
|
+
var B = S === r.tabbableGroups.length - 1 ? 0 : S + 1, se = r.tabbableGroups[B];
|
|
491
|
+
h = D(n) >= 0 ? se.firstTabbableNode : se.firstDomTabbableNode;
|
|
492
|
+
} else _(c) || (h = m.nextTabbableNode(n));
|
|
493
493
|
}
|
|
494
494
|
} else
|
|
495
495
|
h = k("fallbackFocus");
|
|
496
496
|
return h;
|
|
497
|
-
}, K = function(
|
|
498
|
-
var
|
|
499
|
-
if (!(g(
|
|
500
|
-
if (L(l.clickOutsideDeactivates,
|
|
497
|
+
}, K = function(o) {
|
|
498
|
+
var n = G(o);
|
|
499
|
+
if (!(g(n, o) >= 0)) {
|
|
500
|
+
if (L(l.clickOutsideDeactivates, o)) {
|
|
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
|
|
@@ -509,17 +509,17 @@ var de = {
|
|
|
509
509
|
});
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
L(l.allowOutsideClick,
|
|
512
|
+
L(l.allowOutsideClick, o) || o.preventDefault();
|
|
513
513
|
}
|
|
514
|
-
}, te = function(
|
|
515
|
-
var
|
|
516
|
-
if (c ||
|
|
517
|
-
c && (r.mostRecentlyFocusedNode =
|
|
514
|
+
}, te = function(o) {
|
|
515
|
+
var n = G(o), c = g(n, o) >= 0;
|
|
516
|
+
if (c || n instanceof Document)
|
|
517
|
+
c && (r.mostRecentlyFocusedNode = n);
|
|
518
518
|
else {
|
|
519
|
-
|
|
519
|
+
o.stopImmediatePropagation();
|
|
520
520
|
var d, f = !0;
|
|
521
521
|
if (r.mostRecentlyFocusedNode)
|
|
522
|
-
if (
|
|
522
|
+
if (D(r.mostRecentlyFocusedNode) > 0) {
|
|
523
523
|
var h = g(r.mostRecentlyFocusedNode), u = r.containerGroups[h].tabbableNodes;
|
|
524
524
|
if (u.length > 0) {
|
|
525
525
|
var m = u.findIndex(function(y) {
|
|
@@ -529,8 +529,8 @@ var de = {
|
|
|
529
529
|
}
|
|
530
530
|
} else
|
|
531
531
|
r.containerGroups.some(function(y) {
|
|
532
|
-
return y.tabbableNodes.some(function(
|
|
533
|
-
return A
|
|
532
|
+
return y.tabbableNodes.some(function(A) {
|
|
533
|
+
return D(A) > 0;
|
|
534
534
|
});
|
|
535
535
|
}) || (f = !1);
|
|
536
536
|
else
|
|
@@ -543,22 +543,22 @@ var de = {
|
|
|
543
543
|
})), C(d || r.mostRecentlyFocusedNode || w());
|
|
544
544
|
}
|
|
545
545
|
r.recentNavEvent = void 0;
|
|
546
|
-
}, ye = function(
|
|
547
|
-
var
|
|
548
|
-
r.recentNavEvent =
|
|
546
|
+
}, ye = function(o) {
|
|
547
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
548
|
+
r.recentNavEvent = o;
|
|
549
549
|
var c = ee({
|
|
550
|
-
event:
|
|
551
|
-
isBackward:
|
|
550
|
+
event: o,
|
|
551
|
+
isBackward: n
|
|
552
552
|
});
|
|
553
|
-
c && (_(
|
|
554
|
-
}, ae = function(
|
|
555
|
-
(l.isKeyForward(
|
|
556
|
-
}, re = function(
|
|
557
|
-
Ze(
|
|
558
|
-
}, ie = function(
|
|
559
|
-
var
|
|
560
|
-
g(
|
|
561
|
-
},
|
|
553
|
+
c && (_(o) && o.preventDefault(), C(c));
|
|
554
|
+
}, ae = function(o) {
|
|
555
|
+
(l.isKeyForward(o) || l.isKeyBackward(o)) && ye(o, l.isKeyBackward(o));
|
|
556
|
+
}, re = function(o) {
|
|
557
|
+
Ze(o) && L(l.escapeDeactivates, o) !== !1 && (o.preventDefault(), b.deactivate());
|
|
558
|
+
}, ie = function(o) {
|
|
559
|
+
var n = G(o);
|
|
560
|
+
g(n, o) >= 0 || L(l.clickOutsideDeactivates, o) || L(l.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
|
|
561
|
+
}, oe = function() {
|
|
562
562
|
if (r.active)
|
|
563
563
|
return de.activateTrap(s, b), r.delayInitialFocusTimer = l.delayInitialFocus ? fe(function() {
|
|
564
564
|
C(w());
|
|
@@ -575,20 +575,20 @@ var de = {
|
|
|
575
575
|
capture: !0,
|
|
576
576
|
passive: !1
|
|
577
577
|
}), a.addEventListener("keydown", re), b;
|
|
578
|
-
},
|
|
578
|
+
}, ne = function() {
|
|
579
579
|
if (r.active)
|
|
580
580
|
return a.removeEventListener("focusin", te, !0), a.removeEventListener("mousedown", K, !0), a.removeEventListener("touchstart", K, !0), a.removeEventListener("click", ie, !0), a.removeEventListener("keydown", ae, !0), a.removeEventListener("keydown", re), b;
|
|
581
|
-
}, we = function(
|
|
582
|
-
var
|
|
581
|
+
}, we = function(o) {
|
|
582
|
+
var n = o.some(function(c) {
|
|
583
583
|
var d = Array.from(c.removedNodes);
|
|
584
584
|
return d.some(function(f) {
|
|
585
585
|
return f === r.mostRecentlyFocusedNode;
|
|
586
586
|
});
|
|
587
587
|
});
|
|
588
|
-
|
|
588
|
+
n && C(w());
|
|
589
589
|
}, Y = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(we) : void 0, I = function() {
|
|
590
|
-
Y && (Y.disconnect(), r.active && !r.paused && r.containers.map(function(
|
|
591
|
-
Y.observe(
|
|
590
|
+
Y && (Y.disconnect(), r.active && !r.paused && r.containers.map(function(o) {
|
|
591
|
+
Y.observe(o, {
|
|
592
592
|
subtree: !0,
|
|
593
593
|
childList: !0
|
|
594
594
|
});
|
|
@@ -601,26 +601,26 @@ var de = {
|
|
|
601
601
|
get paused() {
|
|
602
602
|
return r.paused;
|
|
603
603
|
},
|
|
604
|
-
activate: function(
|
|
604
|
+
activate: function(o) {
|
|
605
605
|
if (r.active)
|
|
606
606
|
return this;
|
|
607
|
-
var
|
|
608
|
-
d ||
|
|
607
|
+
var n = v(o, "onActivate"), c = v(o, "onPostActivate"), d = v(o, "checkCanFocusTrap");
|
|
608
|
+
d || F(), r.active = !0, r.paused = !1, r.nodeFocusedBeforeActivation = R(a), n?.();
|
|
609
609
|
var f = function() {
|
|
610
|
-
d &&
|
|
610
|
+
d && F(), oe(), I(), c?.();
|
|
611
611
|
};
|
|
612
612
|
return d ? (d(r.containers.concat()).then(f, f), this) : (f(), this);
|
|
613
613
|
},
|
|
614
|
-
deactivate: function(
|
|
614
|
+
deactivate: function(o) {
|
|
615
615
|
if (!r.active)
|
|
616
616
|
return this;
|
|
617
|
-
var
|
|
617
|
+
var n = ue({
|
|
618
618
|
onDeactivate: l.onDeactivate,
|
|
619
619
|
onPostDeactivate: l.onPostDeactivate,
|
|
620
620
|
checkCanReturnFocus: l.checkCanReturnFocus
|
|
621
|
-
},
|
|
622
|
-
clearTimeout(r.delayInitialFocusTimer), r.delayInitialFocusTimer = void 0,
|
|
623
|
-
var c = v(
|
|
621
|
+
}, o);
|
|
622
|
+
clearTimeout(r.delayInitialFocusTimer), r.delayInitialFocusTimer = void 0, ne(), r.active = !1, r.paused = !1, I(), de.deactivateTrap(s, b);
|
|
623
|
+
var c = v(n, "onDeactivate"), d = v(n, "onPostDeactivate"), f = v(n, "checkCanReturnFocus"), h = v(n, "returnFocus", "returnFocusOnDeactivate");
|
|
624
624
|
c?.();
|
|
625
625
|
var u = function() {
|
|
626
626
|
fe(function() {
|
|
@@ -629,17 +629,17 @@ var de = {
|
|
|
629
629
|
};
|
|
630
630
|
return h && f ? (f(Q(r.nodeFocusedBeforeActivation)).then(u, u), this) : (u(), this);
|
|
631
631
|
},
|
|
632
|
-
pause: function(
|
|
633
|
-
return r.active ? (r.manuallyPaused = !0, this._setPausedState(!0,
|
|
632
|
+
pause: function(o) {
|
|
633
|
+
return r.active ? (r.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
|
|
634
634
|
},
|
|
635
|
-
unpause: function(
|
|
636
|
-
return r.active ? (r.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1,
|
|
635
|
+
unpause: function(o) {
|
|
636
|
+
return r.active ? (r.manuallyPaused = !1, s[s.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
|
|
637
637
|
},
|
|
638
|
-
updateContainerElements: function(
|
|
639
|
-
var
|
|
640
|
-
return r.containers =
|
|
638
|
+
updateContainerElements: function(o) {
|
|
639
|
+
var n = [].concat(o).filter(Boolean);
|
|
640
|
+
return r.containers = n.map(function(c) {
|
|
641
641
|
return typeof c == "string" ? a.querySelector(c) : c;
|
|
642
|
-
}), r.active &&
|
|
642
|
+
}), r.active && F(), I(), this;
|
|
643
643
|
}
|
|
644
644
|
}, Object.defineProperties(b, {
|
|
645
645
|
_isManuallyPaused: {
|
|
@@ -648,15 +648,15 @@ var de = {
|
|
|
648
648
|
}
|
|
649
649
|
},
|
|
650
650
|
_setPausedState: {
|
|
651
|
-
value: function(
|
|
652
|
-
if (r.paused ===
|
|
651
|
+
value: function(o, n) {
|
|
652
|
+
if (r.paused === o)
|
|
653
653
|
return this;
|
|
654
|
-
if (r.paused =
|
|
655
|
-
var c = v(
|
|
656
|
-
c?.(),
|
|
654
|
+
if (r.paused = o, o) {
|
|
655
|
+
var c = v(n, "onPause"), d = v(n, "onPostPause");
|
|
656
|
+
c?.(), ne(), I(), d?.();
|
|
657
657
|
} else {
|
|
658
|
-
var f = v(
|
|
659
|
-
f?.(),
|
|
658
|
+
var f = v(n, "onUnpause"), h = v(n, "onPostUnpause");
|
|
659
|
+
f?.(), F(), oe(), I(), h?.();
|
|
660
660
|
}
|
|
661
661
|
return this;
|
|
662
662
|
}
|
|
@@ -717,16 +717,26 @@ const J = class J extends ke {
|
|
|
717
717
|
}
|
|
718
718
|
_preventBackgroundScroll() {
|
|
719
719
|
const e = parseInt(document.body.getAttribute("data-dialog-count") || "0", 10);
|
|
720
|
-
e === 0
|
|
721
|
-
|
|
722
|
-
document.body.
|
|
723
|
-
|
|
720
|
+
if (e === 0) {
|
|
721
|
+
const t = document.documentElement;
|
|
722
|
+
document.body.setAttribute(
|
|
723
|
+
"data-dialog-original-overflow",
|
|
724
|
+
document.body.style.overflow || ""
|
|
725
|
+
), document.body.setAttribute(
|
|
726
|
+
"data-dialog-original-scrollbar-gutter",
|
|
727
|
+
document.body.style.scrollbarGutter || ""
|
|
728
|
+
), document.body.setAttribute(
|
|
729
|
+
"data-dialog-original-html-scrollbar-gutter",
|
|
730
|
+
t.style.scrollbarGutter || ""
|
|
731
|
+
), document.body.style.overflow = "hidden", document.body.style.scrollbarGutter = "stable", t.style.scrollbarGutter = "stable", document.body.setAttribute("data-dialog-scroll-locked", "");
|
|
732
|
+
}
|
|
733
|
+
document.body.setAttribute("data-dialog-count", (e + 1).toString());
|
|
724
734
|
}
|
|
725
735
|
_restoreBackgroundScroll() {
|
|
726
736
|
const e = parseInt(document.body.getAttribute("data-dialog-count") || "0", 10), t = Math.max(0, e - 1);
|
|
727
737
|
if (document.body.setAttribute("data-dialog-count", t.toString()), t === 0) {
|
|
728
|
-
const a = document.body.getAttribute("data-dialog-original-overflow");
|
|
729
|
-
document.body.style.overflow = a || "", document.body.removeAttribute("data-dialog-original-overflow"), document.body.removeAttribute("data-dialog-scroll-locked"), document.body.removeAttribute("data-dialog-count");
|
|
738
|
+
const a = document.documentElement, s = document.body.getAttribute("data-dialog-original-overflow"), l = document.body.getAttribute("data-dialog-original-scrollbar-gutter"), r = document.body.getAttribute("data-dialog-original-html-scrollbar-gutter");
|
|
739
|
+
document.body.style.overflow = s || "", document.body.style.scrollbarGutter = l || "", a.style.scrollbarGutter = r || "", document.body.removeAttribute("data-dialog-original-overflow"), document.body.removeAttribute("data-dialog-original-scrollbar-gutter"), document.body.removeAttribute("data-dialog-original-html-scrollbar-gutter"), document.body.removeAttribute("data-dialog-scroll-locked"), document.body.removeAttribute("data-dialog-count");
|
|
730
740
|
}
|
|
731
741
|
}
|
|
732
742
|
updated(e) {
|