@pnx-mixtape/mxds 0.0.28 → 0.0.29
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/build/accordion.css +1 -1
- package/dist/build/base.css +1 -1
- package/dist/build/breadcrumb.css +1 -1
- package/dist/build/button.css +1 -1
- package/dist/build/callout.css +1 -1
- package/dist/build/card.css +1 -1
- package/dist/build/carousel.css +1 -1
- package/dist/build/chunks/{DropMenu-LnJEp-sg.js → DropMenu-BckyZaZM.js} +1 -1
- package/dist/build/chunks/{Popover-C4gisyxr.js → Popover-hTv4lVea.js} +2 -2
- package/dist/build/chunks/polyfills-QW1VbwlO.js +562 -0
- package/dist/build/chunks/popover-Dk48Vm_U.js +407 -0
- package/dist/build/constants.css +1 -1
- package/dist/build/container-grid.css +1 -1
- package/dist/build/content-block.css +1 -1
- package/dist/build/dialog.css +1 -1
- package/dist/build/drop-menu.css +1 -1
- package/dist/build/drop-menu.entry.js +2 -2
- package/dist/build/drupal.css +1 -1
- package/dist/build/filters.css +1 -1
- package/dist/build/footer.css +1 -1
- package/dist/build/form.css +1 -1
- package/dist/build/global-alert.css +1 -1
- package/dist/build/grid.css +1 -1
- package/dist/build/header.css +1 -1
- package/dist/build/header.entry.js +524 -379
- package/dist/build/hero-banner.css +1 -1
- package/dist/build/icon.css +1 -1
- package/dist/build/in-page-alert.css +1 -1
- package/dist/build/in-page-navigation.css +1 -1
- package/dist/build/in-page-navigation.entry.js +23 -11
- package/dist/build/link-list.css +1 -1
- package/dist/build/list-item.css +1 -1
- package/dist/build/masthead.css +1 -1
- package/dist/build/navigation.css +1 -1
- package/dist/build/page.css +1 -1
- package/dist/build/pagination.css +1 -1
- package/dist/build/popover.css +1 -1
- package/dist/build/popover.entry.js +1 -1
- package/dist/build/results-bar.css +1 -1
- package/dist/build/section.css +1 -1
- package/dist/build/side-navigation.css +1 -1
- package/dist/build/sidebar.css +1 -1
- package/dist/build/social-links.css +1 -1
- package/dist/build/steps.css +1 -1
- package/dist/build/sticky.css +1 -1
- package/dist/build/tabs.css +1 -1
- package/dist/build/tabs.entry.js +2 -2
- package/dist/build/tag.css +1 -1
- package/dist/build/utilities.css +1 -1
- package/dist/build/utility-list.css +1 -1
- package/package.json +22 -21
- package/src/Atom/Background/_background.css +1 -0
- package/src/Atom/Image/_image.css +1 -0
- package/src/Atom/Media/_media.css +0 -6
- package/src/Atom/Spacing/_mixins.css +22 -0
- package/src/Atom/Spacing/_spacing.css +33 -0
- package/src/Atom/Table/Table.stories.ts +17 -7
- package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +16 -8
- package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +1 -1
- package/src/Atom/Table/_table.css +26 -1
- package/src/Atom/Table/table-responsive.twig +1 -1
- package/src/Atom/Table/table.twig +9 -1
- package/src/Atom/_flow.css +1 -5
- package/src/Component/Card/Card.stories.ts +19 -0
- package/src/Component/Card/__snapshots__/Card.stories.ts.snap +40 -9
- package/src/Component/Card/card.css +60 -12
- package/src/Component/Card/card.twig +5 -2
- package/src/Component/Carousel/Elements/Carousel.ts +8 -3
- package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +52 -52
- package/src/Component/Carousel/carousel.css +14 -35
- package/src/Component/Carousel/carousel.twig +0 -1
- package/src/Component/GlobalAlert/global-alert.css +8 -4
- package/src/Component/InPageAlert/in-page-alert.css +1 -0
- package/src/Component/InPageNavigation/Elements/InPageNavigation.ts +12 -7
- package/src/Component/InPageNavigation/InPageNavigation.stories.ts +28 -12
- package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +30 -49
- package/src/Component/InPageNavigation/in-page-navigation.css +8 -4
- package/src/Component/InPageNavigation/in-page-navigation.twig +9 -6
- package/src/Component/InPageNavigation/twig/content-example.twig +1 -1
- package/src/Component/InPageNavigation/twig/in-page-navigation-selector.twig +4 -0
- package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +9 -9
- package/src/Component/ListItem/list-item.css +14 -1
- package/src/Component/ListItem/list-item.twig +6 -2
- package/src/Component/Pagination/Pagination.stories.ts +1 -1
- package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +2 -2
- package/src/Component/ResultsBar/results-bar.css +4 -0
- package/src/Form/FormItem/FormItem.stories.ts +14 -0
- package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +19 -0
- package/src/Form/form.css +11 -3
- package/src/Layout/Grid/Grid.stories.ts +7 -7
- package/src/Layout/Grid/GridItem.stories.ts +1 -2
- package/src/Layout/Section/section.css +8 -0
- package/src/_custom-media.css +2 -0
- package/src/constants.css +16 -4
- package/src/enums.ts +1 -1
- package/src/tokens.js +1 -0
- package/dist/build/chunks/polyfills-Du4RTZDf.js +0 -511
- package/dist/build/chunks/popover-Bd5oQ1Ic.js +0 -407
|
@@ -15,49 +15,49 @@ var candidateSelectors = [
|
|
|
15
15
|
return e?.getRootNode?.call(e);
|
|
16
16
|
} : function(e) {
|
|
17
17
|
return e?.ownerDocument;
|
|
18
|
-
}, _isInert = function(e,
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
return
|
|
18
|
+
}, _isInert = function(e, t) {
|
|
19
|
+
t === void 0 && (t = !0);
|
|
20
|
+
var n = e?.getAttribute?.call(e, "inert");
|
|
21
|
+
return n === "" || n === "true" || t && e && (typeof e.closest == "function" ? e.closest("[inert]") : _isInert(e.parentNode));
|
|
22
22
|
}, isContentEditable = function(e) {
|
|
23
|
-
var
|
|
24
|
-
return
|
|
25
|
-
}, getCandidates = function(e,
|
|
23
|
+
var t = e?.getAttribute?.call(e, "contenteditable");
|
|
24
|
+
return t === "" || t === "true";
|
|
25
|
+
}, getCandidates = function(e, t, r) {
|
|
26
26
|
if (_isInert(e)) return [];
|
|
27
|
-
var
|
|
28
|
-
return
|
|
29
|
-
}, _getCandidatesIteratively = function(e,
|
|
30
|
-
for (var
|
|
31
|
-
var
|
|
32
|
-
if (!_isInert(
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
scopeParent:
|
|
36
|
-
candidates:
|
|
27
|
+
var a = Array.prototype.slice.apply(e.querySelectorAll(candidateSelector));
|
|
28
|
+
return t && matches.call(e, candidateSelector) && a.unshift(e), a = a.filter(r), a;
|
|
29
|
+
}, _getCandidatesIteratively = function(e, t, r) {
|
|
30
|
+
for (var a = [], s = Array.from(e); s.length;) {
|
|
31
|
+
var c = s.shift();
|
|
32
|
+
if (!_isInert(c, !1)) if (c.tagName === "SLOT") {
|
|
33
|
+
var u = c.assignedElements(), d = _getCandidatesIteratively(u.length ? u : c.children, !0, r);
|
|
34
|
+
r.flatten ? a.push.apply(a, d) : a.push({
|
|
35
|
+
scopeParent: c,
|
|
36
|
+
candidates: d
|
|
37
37
|
});
|
|
38
38
|
} else {
|
|
39
|
-
matches.call(
|
|
40
|
-
var
|
|
41
|
-
if (
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
scopeParent:
|
|
45
|
-
candidates:
|
|
39
|
+
matches.call(c, candidateSelector) && r.filter(c) && (t || !e.includes(c)) && a.push(c);
|
|
40
|
+
var f = c.shadowRoot || typeof r.getShadowRoot == "function" && r.getShadowRoot(c), p = !_isInert(f, !1) && (!r.shadowRootFilter || r.shadowRootFilter(c));
|
|
41
|
+
if (f && p) {
|
|
42
|
+
var m = _getCandidatesIteratively(f === !0 ? c.children : f.children, !0, r);
|
|
43
|
+
r.flatten ? a.push.apply(a, m) : a.push({
|
|
44
|
+
scopeParent: c,
|
|
45
|
+
candidates: m
|
|
46
46
|
});
|
|
47
|
-
} else
|
|
47
|
+
} else s.unshift.apply(s, c.children);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
return
|
|
50
|
+
return a;
|
|
51
51
|
}, hasTabIndex = function(e) {
|
|
52
52
|
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
53
53
|
}, getTabIndex = function(e) {
|
|
54
54
|
if (!e) throw Error("No node provided");
|
|
55
55
|
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || isContentEditable(e)) && !hasTabIndex(e) ? 0 : e.tabIndex;
|
|
56
|
-
}, getSortOrderTabIndex = function(e,
|
|
57
|
-
var
|
|
58
|
-
return
|
|
59
|
-
}, sortOrderedTabbables = function(e,
|
|
60
|
-
return e.tabIndex ===
|
|
56
|
+
}, getSortOrderTabIndex = function(e, t) {
|
|
57
|
+
var n = getTabIndex(e);
|
|
58
|
+
return n < 0 && t && !hasTabIndex(e) ? 0 : n;
|
|
59
|
+
}, sortOrderedTabbables = function(e, t) {
|
|
60
|
+
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
61
61
|
}, isInput = function(e) {
|
|
62
62
|
return e.tagName === "INPUT";
|
|
63
63
|
}, isHiddenInput = function(e) {
|
|
@@ -66,41 +66,41 @@ var candidateSelectors = [
|
|
|
66
66
|
return e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(e) {
|
|
67
67
|
return e.tagName === "SUMMARY";
|
|
68
68
|
});
|
|
69
|
-
}, getCheckedRadio = function(e,
|
|
70
|
-
for (var
|
|
69
|
+
}, getCheckedRadio = function(e, t) {
|
|
70
|
+
for (var n = 0; n < e.length; n++) if (e[n].checked && e[n].form === t) return e[n];
|
|
71
71
|
}, isTabbableRadio = function(e) {
|
|
72
72
|
if (!e.name) return !0;
|
|
73
|
-
var
|
|
74
|
-
return
|
|
75
|
-
},
|
|
76
|
-
if (typeof window < "u" && window.CSS !== void 0 && typeof window.CSS.escape == "function")
|
|
73
|
+
var t = e.form || getRootNode(e), n = function(e) {
|
|
74
|
+
return t.querySelectorAll("input[type=\"radio\"][name=\"" + e + "\"]");
|
|
75
|
+
}, r;
|
|
76
|
+
if (typeof window < "u" && window.CSS !== void 0 && typeof window.CSS.escape == "function") r = n(window.CSS.escape(e.name));
|
|
77
77
|
else try {
|
|
78
|
-
|
|
78
|
+
r = n(e.name);
|
|
79
79
|
} catch (e) {
|
|
80
80
|
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", e.message), !1;
|
|
81
81
|
}
|
|
82
|
-
var
|
|
83
|
-
return !
|
|
82
|
+
var i = getCheckedRadio(r, e.form);
|
|
83
|
+
return !i || i === e;
|
|
84
84
|
}, isRadio = function(e) {
|
|
85
85
|
return isInput(e) && e.type === "radio";
|
|
86
86
|
}, isNonTabbableRadio = function(e) {
|
|
87
87
|
return isRadio(e) && !isTabbableRadio(e);
|
|
88
88
|
}, isNodeAttached = function(e) {
|
|
89
|
-
var
|
|
90
|
-
if (
|
|
91
|
-
var
|
|
92
|
-
for (
|
|
93
|
-
var
|
|
94
|
-
|
|
89
|
+
var t = e && getRootNode(e), n = t?.host, r = !1;
|
|
90
|
+
if (t && t !== e) {
|
|
91
|
+
var i, o, s;
|
|
92
|
+
for (r = !!((i = n) != null && (o = i.ownerDocument) != null && o.contains(n) || e != null && (s = e.ownerDocument) != null && s.contains(e)); !r && n;) {
|
|
93
|
+
var c, l;
|
|
94
|
+
t = getRootNode(n), n = t?.host, r = !!((c = n) != null && (l = c.ownerDocument) != null && l.contains(n));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return r;
|
|
98
98
|
}, isZeroArea = function(e) {
|
|
99
|
-
var
|
|
100
|
-
return
|
|
101
|
-
}, isHidden = function(e,
|
|
102
|
-
var
|
|
103
|
-
if (
|
|
99
|
+
var t = e.getBoundingClientRect(), n = t.width, r = t.height;
|
|
100
|
+
return n === 0 && r === 0;
|
|
101
|
+
}, isHidden = function(e, t) {
|
|
102
|
+
var n = t.displayCheck, r = t.getShadowRoot;
|
|
103
|
+
if (n === "full-native" && "checkVisibility" in e) return !e.checkVisibility({
|
|
104
104
|
checkOpacity: !1,
|
|
105
105
|
opacityProperty: !1,
|
|
106
106
|
contentVisibilityAuto: !0,
|
|
@@ -108,132 +108,156 @@ var candidateSelectors = [
|
|
|
108
108
|
checkVisibilityCSS: !0
|
|
109
109
|
});
|
|
110
110
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
111
|
-
var
|
|
112
|
-
if (matches.call(
|
|
113
|
-
if (!
|
|
114
|
-
if (typeof
|
|
115
|
-
for (var
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
118
|
-
e = e.assignedSlot ? e.assignedSlot : !
|
|
111
|
+
var o = matches.call(e, "details>summary:first-of-type") ? e.parentElement : e;
|
|
112
|
+
if (matches.call(o, "details:not([open]) *")) return !0;
|
|
113
|
+
if (!n || n === "full" || n === "full-native" || n === "legacy-full") {
|
|
114
|
+
if (typeof r == "function") {
|
|
115
|
+
for (var s = e; e;) {
|
|
116
|
+
var c = e.parentElement, l = getRootNode(e);
|
|
117
|
+
if (c && !c.shadowRoot && r(c) === !0) return isZeroArea(e);
|
|
118
|
+
e = e.assignedSlot ? e.assignedSlot : !c && l !== e.ownerDocument ? l.host : c;
|
|
119
119
|
}
|
|
120
|
-
e =
|
|
120
|
+
e = s;
|
|
121
121
|
}
|
|
122
122
|
if (isNodeAttached(e)) return !e.getClientRects().length;
|
|
123
|
-
if (
|
|
124
|
-
} else if (
|
|
123
|
+
if (n !== "legacy-full") return !0;
|
|
124
|
+
} else if (n === "non-zero-area") return isZeroArea(e);
|
|
125
125
|
return !1;
|
|
126
126
|
}, isDisabledFromFieldset = function(e) {
|
|
127
|
-
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) for (var
|
|
128
|
-
if (
|
|
129
|
-
for (var
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
127
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)) for (var t = e.parentElement; t;) {
|
|
128
|
+
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
129
|
+
for (var n = 0; n < t.children.length; n++) {
|
|
130
|
+
var r = t.children.item(n);
|
|
131
|
+
if (r.tagName === "LEGEND") return matches.call(t, "fieldset[disabled] *") ? !0 : !r.contains(e);
|
|
132
132
|
}
|
|
133
133
|
return !0;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
t = t.parentElement;
|
|
136
136
|
}
|
|
137
137
|
return !1;
|
|
138
|
-
}, isNodeMatchingSelectorFocusable = function(e,
|
|
139
|
-
return !(
|
|
140
|
-
}, isNodeMatchingSelectorTabbable = function(e,
|
|
141
|
-
return !(isNonTabbableRadio(
|
|
138
|
+
}, isNodeMatchingSelectorFocusable = function(e, t) {
|
|
139
|
+
return !(t.disabled || isHiddenInput(t) || isHidden(t, e) || isDetailsWithSummary(t) || isDisabledFromFieldset(t));
|
|
140
|
+
}, isNodeMatchingSelectorTabbable = function(e, t) {
|
|
141
|
+
return !(isNonTabbableRadio(t) || getTabIndex(t) < 0 || !isNodeMatchingSelectorFocusable(e, t));
|
|
142
142
|
}, isShadowRootTabbable = function(e) {
|
|
143
|
-
var
|
|
144
|
-
return !!(isNaN(
|
|
143
|
+
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
144
|
+
return !!(isNaN(t) || t >= 0);
|
|
145
145
|
}, _sortByOrder = function(e) {
|
|
146
|
-
var
|
|
147
|
-
return e.forEach(function(e,
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
documentOrder:
|
|
151
|
-
tabIndex:
|
|
146
|
+
var t = [], n = [];
|
|
147
|
+
return e.forEach(function(e, r) {
|
|
148
|
+
var i = !!e.scopeParent, a = i ? e.scopeParent : e, o = getSortOrderTabIndex(a, i), s = i ? _sortByOrder(e.candidates) : a;
|
|
149
|
+
o === 0 ? i ? t.push.apply(t, s) : t.push(a) : n.push({
|
|
150
|
+
documentOrder: r,
|
|
151
|
+
tabIndex: o,
|
|
152
152
|
item: e,
|
|
153
|
-
isScope:
|
|
154
|
-
content:
|
|
153
|
+
isScope: i,
|
|
154
|
+
content: s
|
|
155
155
|
});
|
|
156
|
-
}),
|
|
157
|
-
return
|
|
158
|
-
}, []).concat(
|
|
159
|
-
}, tabbable = function(e,
|
|
160
|
-
return
|
|
161
|
-
filter: isNodeMatchingSelectorTabbable.bind(null,
|
|
156
|
+
}), n.sort(sortOrderedTabbables).reduce(function(e, t) {
|
|
157
|
+
return t.isScope ? e.push.apply(e, t.content) : e.push(t.content), e;
|
|
158
|
+
}, []).concat(t);
|
|
159
|
+
}, tabbable = function(e, t) {
|
|
160
|
+
return t ||= {}, _sortByOrder(t.getShadowRoot ? _getCandidatesIteratively([e], t.includeContainer, {
|
|
161
|
+
filter: isNodeMatchingSelectorTabbable.bind(null, t),
|
|
162
162
|
flatten: !1,
|
|
163
|
-
getShadowRoot:
|
|
163
|
+
getShadowRoot: t.getShadowRoot,
|
|
164
164
|
shadowRootFilter: isShadowRootTabbable
|
|
165
|
-
}) : getCandidates(e,
|
|
166
|
-
}, focusable = function(e,
|
|
167
|
-
return
|
|
168
|
-
filter: isNodeMatchingSelectorFocusable.bind(null,
|
|
165
|
+
}) : getCandidates(e, t.includeContainer, isNodeMatchingSelectorTabbable.bind(null, t)));
|
|
166
|
+
}, focusable = function(e, t) {
|
|
167
|
+
return t ||= {}, t.getShadowRoot ? _getCandidatesIteratively([e], t.includeContainer, {
|
|
168
|
+
filter: isNodeMatchingSelectorFocusable.bind(null, t),
|
|
169
169
|
flatten: !0,
|
|
170
|
-
getShadowRoot:
|
|
171
|
-
}) : getCandidates(e,
|
|
172
|
-
}, isTabbable = function(e,
|
|
173
|
-
if (
|
|
174
|
-
return matches.call(e, candidateSelector) === !1 ? !1 : isNodeMatchingSelectorTabbable(
|
|
175
|
-
}, focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(","), isFocusable = function(e,
|
|
176
|
-
if (
|
|
177
|
-
return matches.call(e, focusableCandidateSelector) === !1 ? !1 : isNodeMatchingSelectorFocusable(
|
|
170
|
+
getShadowRoot: t.getShadowRoot
|
|
171
|
+
}) : getCandidates(e, t.includeContainer, isNodeMatchingSelectorFocusable.bind(null, t));
|
|
172
|
+
}, isTabbable = function(e, t) {
|
|
173
|
+
if (t ||= {}, !e) throw Error("No node provided");
|
|
174
|
+
return matches.call(e, candidateSelector) === !1 ? !1 : isNodeMatchingSelectorTabbable(t, e);
|
|
175
|
+
}, focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(","), isFocusable = function(e, t) {
|
|
176
|
+
if (t ||= {}, !e) throw Error("No node provided");
|
|
177
|
+
return matches.call(e, focusableCandidateSelector) === !1 ? !1 : isNodeMatchingSelectorFocusable(t, e);
|
|
178
178
|
};
|
|
179
|
-
function _arrayLikeToArray(e,
|
|
180
|
-
(
|
|
181
|
-
for (var
|
|
182
|
-
return
|
|
179
|
+
function _arrayLikeToArray(e, t) {
|
|
180
|
+
(t == null || t > e.length) && (t = e.length);
|
|
181
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
182
|
+
return r;
|
|
183
183
|
}
|
|
184
184
|
function _arrayWithoutHoles(e) {
|
|
185
185
|
if (Array.isArray(e)) return _arrayLikeToArray(e);
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
function asyncGeneratorStep(e, t, n, r, i, a, o) {
|
|
188
|
+
try {
|
|
189
|
+
var s = e[a](o), c = s.value;
|
|
190
|
+
} catch (e) {
|
|
191
|
+
n(e);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
s.done ? t(c) : Promise.resolve(c).then(r, i);
|
|
195
|
+
}
|
|
196
|
+
function _asyncToGenerator(e) {
|
|
197
|
+
return function() {
|
|
198
|
+
var t = this, n = arguments;
|
|
199
|
+
return new Promise(function(r, i) {
|
|
200
|
+
var a = e.apply(t, n);
|
|
201
|
+
function o(e) {
|
|
202
|
+
asyncGeneratorStep(a, r, i, o, s, "next", e);
|
|
203
|
+
}
|
|
204
|
+
function s(e) {
|
|
205
|
+
asyncGeneratorStep(a, r, i, o, s, "throw", e);
|
|
206
|
+
}
|
|
207
|
+
o(void 0);
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
function _createForOfIteratorHelper(e, t) {
|
|
212
|
+
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
213
|
+
if (!n) {
|
|
214
|
+
if (Array.isArray(e) || (n = _unsupportedIterableToArray(e)) || t) {
|
|
215
|
+
n && (e = n);
|
|
216
|
+
var r = 0, i = function() {};
|
|
193
217
|
return {
|
|
194
|
-
s:
|
|
218
|
+
s: i,
|
|
195
219
|
n: function() {
|
|
196
|
-
return
|
|
220
|
+
return r >= e.length ? { done: !0 } : {
|
|
197
221
|
done: !1,
|
|
198
|
-
value: e[
|
|
222
|
+
value: e[r++]
|
|
199
223
|
};
|
|
200
224
|
},
|
|
201
225
|
e: function(e) {
|
|
202
226
|
throw e;
|
|
203
227
|
},
|
|
204
|
-
f:
|
|
228
|
+
f: i
|
|
205
229
|
};
|
|
206
230
|
}
|
|
207
231
|
throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
208
232
|
}
|
|
209
|
-
var
|
|
233
|
+
var a, o = !0, s = !1;
|
|
210
234
|
return {
|
|
211
235
|
s: function() {
|
|
212
|
-
|
|
236
|
+
n = n.call(e);
|
|
213
237
|
},
|
|
214
238
|
n: function() {
|
|
215
|
-
var e =
|
|
216
|
-
return
|
|
239
|
+
var e = n.next();
|
|
240
|
+
return o = e.done, e;
|
|
217
241
|
},
|
|
218
242
|
e: function(e) {
|
|
219
|
-
|
|
243
|
+
s = !0, a = e;
|
|
220
244
|
},
|
|
221
245
|
f: function() {
|
|
222
246
|
try {
|
|
223
|
-
|
|
247
|
+
o || n.return == null || n.return();
|
|
224
248
|
} finally {
|
|
225
|
-
if (
|
|
249
|
+
if (s) throw a;
|
|
226
250
|
}
|
|
227
251
|
}
|
|
228
252
|
};
|
|
229
253
|
}
|
|
230
|
-
function _defineProperty(e,
|
|
231
|
-
return (
|
|
232
|
-
value:
|
|
254
|
+
function _defineProperty(e, t, n) {
|
|
255
|
+
return (t = _toPropertyKey(t)) in e ? Object.defineProperty(e, t, {
|
|
256
|
+
value: n,
|
|
233
257
|
enumerable: !0,
|
|
234
258
|
configurable: !0,
|
|
235
259
|
writable: !0
|
|
236
|
-
}) : e[
|
|
260
|
+
}) : e[t] = n, e;
|
|
237
261
|
}
|
|
238
262
|
function _iterableToArray(e) {
|
|
239
263
|
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
|
|
@@ -241,70 +265,162 @@ function _iterableToArray(e) {
|
|
|
241
265
|
function _nonIterableSpread() {
|
|
242
266
|
throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
243
267
|
}
|
|
244
|
-
function ownKeys(e,
|
|
245
|
-
var
|
|
268
|
+
function ownKeys(e, t) {
|
|
269
|
+
var n = Object.keys(e);
|
|
246
270
|
if (Object.getOwnPropertySymbols) {
|
|
247
|
-
var
|
|
248
|
-
|
|
249
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
250
|
-
})),
|
|
271
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
272
|
+
t && (r = r.filter(function(t) {
|
|
273
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
274
|
+
})), n.push.apply(n, r);
|
|
251
275
|
}
|
|
252
|
-
return
|
|
276
|
+
return n;
|
|
253
277
|
}
|
|
254
278
|
function _objectSpread2(e) {
|
|
255
|
-
for (var
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
_defineProperty(e,
|
|
259
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
260
|
-
Object.defineProperty(e,
|
|
279
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
280
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
281
|
+
t % 2 ? ownKeys(Object(n), !0).forEach(function(t) {
|
|
282
|
+
_defineProperty(e, t, n[t]);
|
|
283
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ownKeys(Object(n)).forEach(function(t) {
|
|
284
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
261
285
|
});
|
|
262
286
|
}
|
|
263
287
|
return e;
|
|
264
288
|
}
|
|
289
|
+
function _regenerator() {
|
|
290
|
+
var e, t, n = typeof Symbol == "function" ? Symbol : {}, r = n.iterator || "@@iterator", i = n.toStringTag || "@@toStringTag";
|
|
291
|
+
function a(n, r, i, a) {
|
|
292
|
+
var c = r && r.prototype instanceof s ? r : s, l = Object.create(c.prototype);
|
|
293
|
+
return _regeneratorDefine(l, "_invoke", function(n, r, i) {
|
|
294
|
+
var a, s, c, l = 0, u = i || [], d = !1, f = {
|
|
295
|
+
p: 0,
|
|
296
|
+
n: 0,
|
|
297
|
+
v: e,
|
|
298
|
+
a: p,
|
|
299
|
+
f: p.bind(e, 4),
|
|
300
|
+
d: function(t, n) {
|
|
301
|
+
return a = t, s = 0, c = e, f.n = n, o;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
function p(n, r) {
|
|
305
|
+
for (s = n, c = r, t = 0; !d && l && !i && t < u.length; t++) {
|
|
306
|
+
var i, a = u[t], p = f.p, m = a[2];
|
|
307
|
+
n > 3 ? (i = m === r) && (c = a[(s = a[4]) ? 5 : (s = 3, 3)], a[4] = a[5] = e) : a[0] <= p && ((i = n < 2 && p < a[1]) ? (s = 0, f.v = r, f.n = a[1]) : p < m && (i = n < 3 || a[0] > r || r > m) && (a[4] = n, a[5] = r, f.n = m, s = 0));
|
|
308
|
+
}
|
|
309
|
+
if (i || n > 1) return o;
|
|
310
|
+
throw d = !0, r;
|
|
311
|
+
}
|
|
312
|
+
return function(i, u, m) {
|
|
313
|
+
if (l > 1) throw TypeError("Generator is already running");
|
|
314
|
+
for (d && u === 1 && p(u, m), s = u, c = m; (t = s < 2 ? e : c) || !d;) {
|
|
315
|
+
a || (s ? s < 3 ? (s > 1 && (f.n = -1), p(s, c)) : f.n = c : f.v = c);
|
|
316
|
+
try {
|
|
317
|
+
if (l = 2, a) {
|
|
318
|
+
if (s || (i = "next"), t = a[i]) {
|
|
319
|
+
if (!(t = t.call(a, c))) throw TypeError("iterator result is not an object");
|
|
320
|
+
if (!t.done) return t;
|
|
321
|
+
c = t.value, s < 2 && (s = 0);
|
|
322
|
+
} else s === 1 && (t = a.return) && t.call(a), s < 2 && (c = TypeError("The iterator does not provide a '" + i + "' method"), s = 1);
|
|
323
|
+
a = e;
|
|
324
|
+
} else if ((t = (d = f.n < 0) ? c : n.call(r, f)) !== o) break;
|
|
325
|
+
} catch (t) {
|
|
326
|
+
a = e, s = 1, c = t;
|
|
327
|
+
} finally {
|
|
328
|
+
l = 1;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
value: t,
|
|
333
|
+
done: d
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
}(n, i, a), !0), l;
|
|
337
|
+
}
|
|
338
|
+
var o = {};
|
|
339
|
+
function s() {}
|
|
340
|
+
function c() {}
|
|
341
|
+
function l() {}
|
|
342
|
+
t = Object.getPrototypeOf;
|
|
343
|
+
var u = [][r] ? t(t([][r]())) : (_regeneratorDefine(t = {}, r, function() {
|
|
344
|
+
return this;
|
|
345
|
+
}), t), d = l.prototype = s.prototype = Object.create(u);
|
|
346
|
+
function f(e) {
|
|
347
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, l) : (e.__proto__ = l, _regeneratorDefine(e, i, "GeneratorFunction")), e.prototype = Object.create(d), e;
|
|
348
|
+
}
|
|
349
|
+
return c.prototype = l, _regeneratorDefine(d, "constructor", l), _regeneratorDefine(l, "constructor", c), c.displayName = "GeneratorFunction", _regeneratorDefine(l, i, "GeneratorFunction"), _regeneratorDefine(d), _regeneratorDefine(d, i, "Generator"), _regeneratorDefine(d, r, function() {
|
|
350
|
+
return this;
|
|
351
|
+
}), _regeneratorDefine(d, "toString", function() {
|
|
352
|
+
return "[object Generator]";
|
|
353
|
+
}), (_regenerator = function() {
|
|
354
|
+
return {
|
|
355
|
+
w: a,
|
|
356
|
+
m: f
|
|
357
|
+
};
|
|
358
|
+
})();
|
|
359
|
+
}
|
|
360
|
+
function _regeneratorDefine(e, t, n, r) {
|
|
361
|
+
var i = Object.defineProperty;
|
|
362
|
+
try {
|
|
363
|
+
i({}, "", {});
|
|
364
|
+
} catch {
|
|
365
|
+
i = 0;
|
|
366
|
+
}
|
|
367
|
+
_regeneratorDefine = function(e, t, n, r) {
|
|
368
|
+
function a(t, n) {
|
|
369
|
+
_regeneratorDefine(e, t, function(e) {
|
|
370
|
+
return this._invoke(t, n, e);
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
t ? i ? i(e, t, {
|
|
374
|
+
value: n,
|
|
375
|
+
enumerable: !r,
|
|
376
|
+
configurable: !r,
|
|
377
|
+
writable: !r
|
|
378
|
+
}) : e[t] = n : (a("next", 0), a("throw", 1), a("return", 2));
|
|
379
|
+
}, _regeneratorDefine(e, t, n, r);
|
|
380
|
+
}
|
|
265
381
|
function _toConsumableArray(e) {
|
|
266
382
|
return _arrayWithoutHoles(e) || _iterableToArray(e) || _unsupportedIterableToArray(e) || _nonIterableSpread();
|
|
267
383
|
}
|
|
268
|
-
function _toPrimitive(e,
|
|
384
|
+
function _toPrimitive(e, t) {
|
|
269
385
|
if (typeof e != "object" || !e) return e;
|
|
270
|
-
var
|
|
271
|
-
if (
|
|
272
|
-
var
|
|
273
|
-
if (typeof
|
|
386
|
+
var n = e[Symbol.toPrimitive];
|
|
387
|
+
if (n !== void 0) {
|
|
388
|
+
var r = n.call(e, t);
|
|
389
|
+
if (typeof r != "object") return r;
|
|
274
390
|
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
275
391
|
}
|
|
276
|
-
return (
|
|
392
|
+
return (t === "string" ? String : Number)(e);
|
|
277
393
|
}
|
|
278
394
|
function _toPropertyKey(e) {
|
|
279
|
-
var
|
|
280
|
-
return typeof
|
|
395
|
+
var t = _toPrimitive(e, "string");
|
|
396
|
+
return typeof t == "symbol" ? t : t + "";
|
|
281
397
|
}
|
|
282
|
-
function _unsupportedIterableToArray(e,
|
|
398
|
+
function _unsupportedIterableToArray(e, t) {
|
|
283
399
|
if (e) {
|
|
284
|
-
if (typeof e == "string") return _arrayLikeToArray(e,
|
|
285
|
-
var
|
|
286
|
-
return
|
|
400
|
+
if (typeof e == "string") return _arrayLikeToArray(e, t);
|
|
401
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
402
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0;
|
|
287
403
|
}
|
|
288
404
|
}
|
|
289
405
|
var activeFocusTraps = {
|
|
290
406
|
getActiveTrap: function(e) {
|
|
291
407
|
return e?.length > 0 ? e[e.length - 1] : null;
|
|
292
408
|
},
|
|
293
|
-
activateTrap: function(e,
|
|
294
|
-
|
|
295
|
-
var
|
|
296
|
-
|
|
409
|
+
activateTrap: function(e, t) {
|
|
410
|
+
t !== activeFocusTraps.getActiveTrap(e) && activeFocusTraps.pauseTrap(e);
|
|
411
|
+
var n = e.indexOf(t);
|
|
412
|
+
n === -1 || e.splice(n, 1), e.push(t);
|
|
297
413
|
},
|
|
298
|
-
deactivateTrap: function(e,
|
|
299
|
-
var
|
|
300
|
-
|
|
414
|
+
deactivateTrap: function(e, t) {
|
|
415
|
+
var n = e.indexOf(t);
|
|
416
|
+
n !== -1 && e.splice(n, 1), activeFocusTraps.unpauseTrap(e);
|
|
301
417
|
},
|
|
302
418
|
pauseTrap: function(e) {
|
|
303
419
|
activeFocusTraps.getActiveTrap(e)?._setPausedState(!0);
|
|
304
420
|
},
|
|
305
421
|
unpauseTrap: function(e) {
|
|
306
|
-
var
|
|
307
|
-
|
|
422
|
+
var t = activeFocusTraps.getActiveTrap(e);
|
|
423
|
+
t && !t._isManuallyPaused() && t._setPausedState(!1);
|
|
308
424
|
}
|
|
309
425
|
}, isSelectableInput = function(e) {
|
|
310
426
|
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
@@ -319,19 +435,19 @@ var activeFocusTraps = {
|
|
|
319
435
|
}, delay = function(e) {
|
|
320
436
|
return setTimeout(e, 0);
|
|
321
437
|
}, valueOrHandler = function(e) {
|
|
322
|
-
var
|
|
323
|
-
return typeof e == "function" ? e.apply(void 0,
|
|
438
|
+
var t = [...arguments].slice(1);
|
|
439
|
+
return typeof e == "function" ? e.apply(void 0, t) : e;
|
|
324
440
|
}, getActualTarget = function(e) {
|
|
325
441
|
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
326
|
-
}, internalTrapStack = [], createFocusTrap = function(e,
|
|
327
|
-
var
|
|
442
|
+
}, internalTrapStack = [], createFocusTrap = function(e, t) {
|
|
443
|
+
var n = t?.document || document, r = t?.trapStack || internalTrapStack, i = _objectSpread2({
|
|
328
444
|
returnFocusOnDeactivate: !0,
|
|
329
445
|
escapeDeactivates: !0,
|
|
330
446
|
delayInitialFocus: !0,
|
|
331
447
|
isolateSubtrees: !1,
|
|
332
448
|
isKeyForward,
|
|
333
449
|
isKeyBackward
|
|
334
|
-
},
|
|
450
|
+
}, t), a = {
|
|
335
451
|
containers: [],
|
|
336
452
|
containerGroups: [],
|
|
337
453
|
tabbableGroups: [],
|
|
@@ -344,325 +460,354 @@ var activeFocusTraps = {
|
|
|
344
460
|
manuallyPaused: !1,
|
|
345
461
|
delayInitialFocusTimer: void 0,
|
|
346
462
|
recentNavEvent: void 0
|
|
347
|
-
},
|
|
348
|
-
return e && e[
|
|
349
|
-
},
|
|
350
|
-
var
|
|
351
|
-
return
|
|
352
|
-
var
|
|
353
|
-
return
|
|
354
|
-
return
|
|
463
|
+
}, o, s = function(e, t, n) {
|
|
464
|
+
return e && e[t] !== void 0 ? e[t] : i[n || t];
|
|
465
|
+
}, c = function(e, t) {
|
|
466
|
+
var n = typeof t?.composedPath == "function" ? t.composedPath() : void 0;
|
|
467
|
+
return a.containerGroups.findIndex(function(t) {
|
|
468
|
+
var r = t.container, i = t.tabbableNodes;
|
|
469
|
+
return r.contains(e) || n?.includes(r) || i.find(function(t) {
|
|
470
|
+
return t === e;
|
|
355
471
|
});
|
|
356
472
|
});
|
|
357
|
-
},
|
|
358
|
-
var
|
|
359
|
-
if (typeof
|
|
360
|
-
if (
|
|
473
|
+
}, l = function(e) {
|
|
474
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.hasFallback, a = r === void 0 ? !1 : r, o = t.params, s = o === void 0 ? [] : o, c = i[e];
|
|
475
|
+
if (typeof c == "function" && (c = c.apply(void 0, _toConsumableArray(s))), c === !0 && (c = void 0), !c) {
|
|
476
|
+
if (c === void 0 || c === !1) return c;
|
|
361
477
|
throw Error(`\`${e}\` was specified but was not a node, or did not return a node`);
|
|
362
478
|
}
|
|
363
|
-
var
|
|
364
|
-
if (typeof
|
|
479
|
+
var l = c;
|
|
480
|
+
if (typeof c == "string") {
|
|
365
481
|
try {
|
|
366
|
-
|
|
367
|
-
} catch (
|
|
368
|
-
throw Error(`\`${e}\` appears to be an invalid selector; error="${
|
|
482
|
+
l = n.querySelector(c);
|
|
483
|
+
} catch (t) {
|
|
484
|
+
throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`);
|
|
369
485
|
}
|
|
370
|
-
if (!
|
|
486
|
+
if (!l && !a) throw Error(`\`${e}\` as selector refers to no known node`);
|
|
371
487
|
}
|
|
372
|
-
return
|
|
373
|
-
},
|
|
374
|
-
var e =
|
|
488
|
+
return l;
|
|
489
|
+
}, u = function() {
|
|
490
|
+
var e = l("initialFocus", { hasFallback: !0 });
|
|
375
491
|
if (e === !1) return !1;
|
|
376
|
-
if (e === void 0 || e && !isFocusable(e,
|
|
492
|
+
if (e === void 0 || e && !isFocusable(e, i.tabbableOptions)) if (c(n.activeElement) >= 0) e = n.activeElement;
|
|
377
493
|
else {
|
|
378
|
-
var
|
|
379
|
-
e =
|
|
494
|
+
var t = a.tabbableGroups[0];
|
|
495
|
+
e = t && t.firstTabbableNode || l("fallbackFocus");
|
|
380
496
|
}
|
|
381
|
-
else e === null && (e =
|
|
497
|
+
else e === null && (e = l("fallbackFocus"));
|
|
382
498
|
if (!e) throw Error("Your focus-trap needs to have at least one focusable element");
|
|
383
499
|
return e;
|
|
384
|
-
},
|
|
385
|
-
if (
|
|
386
|
-
var
|
|
500
|
+
}, f = function() {
|
|
501
|
+
if (a.containerGroups = a.containers.map(function(e) {
|
|
502
|
+
var t = tabbable(e, i.tabbableOptions), n = focusable(e, i.tabbableOptions), r = t.length > 0 ? t[0] : void 0, a = t.length > 0 ? t[t.length - 1] : void 0, o = n.find(function(e) {
|
|
387
503
|
return isTabbable(e);
|
|
388
|
-
}),
|
|
504
|
+
}), s = n.slice().reverse().find(function(e) {
|
|
389
505
|
return isTabbable(e);
|
|
390
506
|
});
|
|
391
507
|
return {
|
|
392
508
|
container: e,
|
|
393
|
-
tabbableNodes:
|
|
394
|
-
focusableNodes:
|
|
395
|
-
posTabIndexesFound: !!
|
|
509
|
+
tabbableNodes: t,
|
|
510
|
+
focusableNodes: n,
|
|
511
|
+
posTabIndexesFound: !!t.find(function(e) {
|
|
396
512
|
return getTabIndex(e) > 0;
|
|
397
513
|
}),
|
|
398
|
-
firstTabbableNode:
|
|
399
|
-
lastTabbableNode:
|
|
400
|
-
firstDomTabbableNode:
|
|
401
|
-
lastDomTabbableNode:
|
|
514
|
+
firstTabbableNode: r,
|
|
515
|
+
lastTabbableNode: a,
|
|
516
|
+
firstDomTabbableNode: o,
|
|
517
|
+
lastDomTabbableNode: s,
|
|
402
518
|
nextTabbableNode: function(e) {
|
|
403
|
-
var
|
|
404
|
-
return
|
|
519
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, i = t.indexOf(e);
|
|
520
|
+
return i < 0 ? r ? n.slice(n.indexOf(e) + 1).find(function(e) {
|
|
405
521
|
return isTabbable(e);
|
|
406
|
-
}) :
|
|
522
|
+
}) : n.slice(0, n.indexOf(e)).reverse().find(function(e) {
|
|
407
523
|
return isTabbable(e);
|
|
408
|
-
}) :
|
|
524
|
+
}) : t[i + (r ? 1 : -1)];
|
|
409
525
|
}
|
|
410
526
|
};
|
|
411
|
-
}),
|
|
527
|
+
}), a.tabbableGroups = a.containerGroups.filter(function(e) {
|
|
412
528
|
return e.tabbableNodes.length > 0;
|
|
413
|
-
}),
|
|
414
|
-
if (
|
|
529
|
+
}), a.tabbableGroups.length <= 0 && !l("fallbackFocus")) throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
530
|
+
if (a.containerGroups.find(function(e) {
|
|
415
531
|
return e.posTabIndexesFound;
|
|
416
|
-
}) &&
|
|
417
|
-
},
|
|
418
|
-
var
|
|
419
|
-
if (
|
|
420
|
-
},
|
|
421
|
-
if (e !== !1 && e !==
|
|
532
|
+
}) && a.containerGroups.length > 1) throw 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.");
|
|
533
|
+
}, p = function(e) {
|
|
534
|
+
var t = e.activeElement;
|
|
535
|
+
if (t) return t.shadowRoot && t.shadowRoot.activeElement !== null ? p(t.shadowRoot) : t;
|
|
536
|
+
}, m = function(e) {
|
|
537
|
+
if (e !== !1 && e !== p(document)) {
|
|
422
538
|
if (!e || !e.focus) {
|
|
423
|
-
|
|
539
|
+
m(u());
|
|
424
540
|
return;
|
|
425
541
|
}
|
|
426
|
-
e.focus({ preventScroll: !!
|
|
542
|
+
e.focus({ preventScroll: !!i.preventScroll }), a.mostRecentlyFocusedNode = e, isSelectableInput(e) && e.select();
|
|
427
543
|
}
|
|
428
|
-
},
|
|
429
|
-
var
|
|
430
|
-
return
|
|
431
|
-
},
|
|
432
|
-
var
|
|
433
|
-
|
|
434
|
-
var
|
|
435
|
-
if (
|
|
436
|
-
var
|
|
437
|
-
if (
|
|
438
|
-
else if (
|
|
439
|
-
var
|
|
440
|
-
var
|
|
441
|
-
return
|
|
544
|
+
}, h = function(e) {
|
|
545
|
+
var t = l("setReturnFocus", { params: [e] });
|
|
546
|
+
return t || (t === !1 ? !1 : e);
|
|
547
|
+
}, g = function(e) {
|
|
548
|
+
var t = e.target, n = e.event, r = e.isBackward, o = r === void 0 ? !1 : r;
|
|
549
|
+
t ||= getActualTarget(n), f();
|
|
550
|
+
var s = null;
|
|
551
|
+
if (a.tabbableGroups.length > 0) {
|
|
552
|
+
var u = c(t, n), p = u >= 0 ? a.containerGroups[u] : void 0;
|
|
553
|
+
if (u < 0) s = o ? a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : a.tabbableGroups[0].firstTabbableNode;
|
|
554
|
+
else if (o) {
|
|
555
|
+
var m = a.tabbableGroups.findIndex(function(e) {
|
|
556
|
+
var n = e.firstTabbableNode;
|
|
557
|
+
return t === n;
|
|
442
558
|
});
|
|
443
|
-
if (
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
} else isTabEvent(
|
|
559
|
+
if (m < 0 && (p.container === t || isFocusable(t, i.tabbableOptions) && !isTabbable(t, i.tabbableOptions) && !p.nextTabbableNode(t, !1)) && (m = u), m >= 0) {
|
|
560
|
+
var h = m === 0 ? a.tabbableGroups.length - 1 : m - 1, g = a.tabbableGroups[h];
|
|
561
|
+
s = getTabIndex(t) >= 0 ? g.lastTabbableNode : g.lastDomTabbableNode;
|
|
562
|
+
} else isTabEvent(n) || (s = p.nextTabbableNode(t, !1));
|
|
447
563
|
} else {
|
|
448
|
-
var
|
|
449
|
-
var
|
|
450
|
-
return
|
|
564
|
+
var _ = a.tabbableGroups.findIndex(function(e) {
|
|
565
|
+
var n = e.lastTabbableNode;
|
|
566
|
+
return t === n;
|
|
451
567
|
});
|
|
452
|
-
if (
|
|
453
|
-
var
|
|
454
|
-
|
|
455
|
-
} else isTabEvent(
|
|
568
|
+
if (_ < 0 && (p.container === t || isFocusable(t, i.tabbableOptions) && !isTabbable(t, i.tabbableOptions) && !p.nextTabbableNode(t)) && (_ = u), _ >= 0) {
|
|
569
|
+
var v = _ === a.tabbableGroups.length - 1 ? 0 : _ + 1, y = a.tabbableGroups[v];
|
|
570
|
+
s = getTabIndex(t) >= 0 ? y.firstTabbableNode : y.firstDomTabbableNode;
|
|
571
|
+
} else isTabEvent(n) || (s = p.nextTabbableNode(t));
|
|
456
572
|
}
|
|
457
|
-
} else
|
|
458
|
-
return
|
|
459
|
-
},
|
|
460
|
-
if (!(
|
|
461
|
-
if (valueOrHandler(
|
|
462
|
-
|
|
573
|
+
} else s = l("fallbackFocus");
|
|
574
|
+
return s;
|
|
575
|
+
}, _ = function(e) {
|
|
576
|
+
if (!(c(getActualTarget(e), e) >= 0)) {
|
|
577
|
+
if (valueOrHandler(i.clickOutsideDeactivates, e)) {
|
|
578
|
+
o.deactivate({ returnFocus: i.returnFocusOnDeactivate });
|
|
463
579
|
return;
|
|
464
580
|
}
|
|
465
|
-
valueOrHandler(
|
|
581
|
+
valueOrHandler(i.allowOutsideClick, e) || e.preventDefault();
|
|
466
582
|
}
|
|
467
|
-
},
|
|
468
|
-
var
|
|
469
|
-
if (
|
|
583
|
+
}, v = function(e) {
|
|
584
|
+
var t = getActualTarget(e), n = c(t, e) >= 0;
|
|
585
|
+
if (n || t instanceof Document) n && (a.mostRecentlyFocusedNode = t);
|
|
470
586
|
else {
|
|
471
587
|
e.stopImmediatePropagation();
|
|
472
|
-
var
|
|
473
|
-
if (
|
|
474
|
-
var
|
|
475
|
-
if (
|
|
476
|
-
var
|
|
477
|
-
return e ===
|
|
588
|
+
var r, o = !0;
|
|
589
|
+
if (a.mostRecentlyFocusedNode) if (getTabIndex(a.mostRecentlyFocusedNode) > 0) {
|
|
590
|
+
var s = c(a.mostRecentlyFocusedNode), l = a.containerGroups[s].tabbableNodes;
|
|
591
|
+
if (l.length > 0) {
|
|
592
|
+
var f = l.findIndex(function(e) {
|
|
593
|
+
return e === a.mostRecentlyFocusedNode;
|
|
478
594
|
});
|
|
479
|
-
|
|
595
|
+
f >= 0 && (i.isKeyForward(a.recentNavEvent) ? f + 1 < l.length && (r = l[f + 1], o = !1) : f - 1 >= 0 && (r = l[f - 1], o = !1));
|
|
480
596
|
}
|
|
481
|
-
} else
|
|
597
|
+
} else a.containerGroups.some(function(e) {
|
|
482
598
|
return e.tabbableNodes.some(function(e) {
|
|
483
599
|
return getTabIndex(e) > 0;
|
|
484
600
|
});
|
|
485
|
-
}) || (
|
|
486
|
-
else
|
|
487
|
-
|
|
488
|
-
target:
|
|
489
|
-
isBackward:
|
|
490
|
-
})),
|
|
601
|
+
}) || (o = !1);
|
|
602
|
+
else o = !1;
|
|
603
|
+
o && (r = g({
|
|
604
|
+
target: a.mostRecentlyFocusedNode,
|
|
605
|
+
isBackward: i.isKeyBackward(a.recentNavEvent)
|
|
606
|
+
})), m(r || a.mostRecentlyFocusedNode || u());
|
|
491
607
|
}
|
|
492
|
-
|
|
493
|
-
},
|
|
494
|
-
var
|
|
495
|
-
|
|
496
|
-
var
|
|
608
|
+
a.recentNavEvent = void 0;
|
|
609
|
+
}, y = function(e) {
|
|
610
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
611
|
+
a.recentNavEvent = e;
|
|
612
|
+
var n = g({
|
|
497
613
|
event: e,
|
|
498
|
-
isBackward:
|
|
614
|
+
isBackward: t
|
|
499
615
|
});
|
|
500
|
-
|
|
501
|
-
},
|
|
502
|
-
(
|
|
503
|
-
},
|
|
504
|
-
isEscapeEvent(e) && valueOrHandler(
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
},
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
|
|
616
|
+
n && (isTabEvent(e) && e.preventDefault(), m(n));
|
|
617
|
+
}, b = function(e) {
|
|
618
|
+
(i.isKeyForward(e) || i.isKeyBackward(e)) && y(e, i.isKeyBackward(e));
|
|
619
|
+
}, x = function(e) {
|
|
620
|
+
isEscapeEvent(e) && valueOrHandler(i.escapeDeactivates, e) !== !1 && (e.preventDefault(), o.deactivate());
|
|
621
|
+
}, S = function(e) {
|
|
622
|
+
c(getActualTarget(e), e) >= 0 || valueOrHandler(i.clickOutsideDeactivates, e) || valueOrHandler(i.allowOutsideClick, e) || (e.preventDefault(), e.stopImmediatePropagation());
|
|
623
|
+
}, C = function() {
|
|
624
|
+
if (!a.active) return Promise.resolve();
|
|
625
|
+
activeFocusTraps.activateTrap(r, o);
|
|
626
|
+
var e;
|
|
627
|
+
return i.delayInitialFocus ? e = new Promise(function(e) {
|
|
628
|
+
a.delayInitialFocusTimer = delay(function() {
|
|
629
|
+
m(u()), e();
|
|
630
|
+
});
|
|
631
|
+
}) : (e = Promise.resolve(), m(u())), n.addEventListener("focusin", v, !0), n.addEventListener("mousedown", _, {
|
|
511
632
|
capture: !0,
|
|
512
633
|
passive: !1
|
|
513
|
-
}),
|
|
634
|
+
}), n.addEventListener("touchstart", _, {
|
|
514
635
|
capture: !0,
|
|
515
636
|
passive: !1
|
|
516
|
-
}),
|
|
637
|
+
}), n.addEventListener("click", S, {
|
|
517
638
|
capture: !0,
|
|
518
639
|
passive: !1
|
|
519
|
-
}),
|
|
640
|
+
}), n.addEventListener("keydown", b, {
|
|
520
641
|
capture: !0,
|
|
521
642
|
passive: !1
|
|
522
|
-
}),
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
var
|
|
643
|
+
}), n.addEventListener("keydown", x), e;
|
|
644
|
+
}, w = function(e) {
|
|
645
|
+
a.active && !a.paused && o._setSubtreeIsolation(!1), a.adjacentElements.clear(), a.alreadySilent.clear();
|
|
646
|
+
var t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = _createForOfIteratorHelper(e), i;
|
|
526
647
|
try {
|
|
527
|
-
for (
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
for (var
|
|
531
|
-
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
var
|
|
648
|
+
for (r.s(); !(i = r.n()).done;) {
|
|
649
|
+
var s = i.value;
|
|
650
|
+
t.add(s);
|
|
651
|
+
for (var c = typeof ShadowRoot < "u" && s.getRootNode() instanceof ShadowRoot, l = s; l;) {
|
|
652
|
+
t.add(l);
|
|
653
|
+
var u = l.parentElement, d = [];
|
|
654
|
+
u ? d = u.children : !u && c && (d = l.getRootNode().children, u = l.getRootNode().host, c = typeof ShadowRoot < "u" && u.getRootNode() instanceof ShadowRoot);
|
|
655
|
+
var f = _createForOfIteratorHelper(d), p;
|
|
535
656
|
try {
|
|
536
|
-
for (
|
|
537
|
-
var
|
|
538
|
-
|
|
657
|
+
for (f.s(); !(p = f.n()).done;) {
|
|
658
|
+
var m = p.value;
|
|
659
|
+
n.add(m);
|
|
539
660
|
}
|
|
540
661
|
} catch (e) {
|
|
541
|
-
|
|
662
|
+
f.e(e);
|
|
542
663
|
} finally {
|
|
543
|
-
|
|
664
|
+
f.f();
|
|
544
665
|
}
|
|
545
|
-
|
|
666
|
+
l = u;
|
|
546
667
|
}
|
|
547
668
|
}
|
|
548
669
|
} catch (e) {
|
|
549
|
-
|
|
670
|
+
r.e(e);
|
|
550
671
|
} finally {
|
|
551
|
-
|
|
672
|
+
r.f();
|
|
552
673
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
}),
|
|
556
|
-
},
|
|
557
|
-
if (
|
|
558
|
-
},
|
|
674
|
+
t.forEach(function(e) {
|
|
675
|
+
n.delete(e);
|
|
676
|
+
}), a.adjacentElements = n;
|
|
677
|
+
}, T = function() {
|
|
678
|
+
if (a.active) return n.removeEventListener("focusin", v, !0), n.removeEventListener("mousedown", _, !0), n.removeEventListener("touchstart", _, !0), n.removeEventListener("click", S, !0), n.removeEventListener("keydown", b, !0), n.removeEventListener("keydown", x), o;
|
|
679
|
+
}, E = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(function(e) {
|
|
559
680
|
e.some(function(e) {
|
|
560
681
|
return Array.from(e.removedNodes).some(function(e) {
|
|
561
|
-
return e ===
|
|
682
|
+
return e === a.mostRecentlyFocusedNode;
|
|
562
683
|
});
|
|
563
|
-
}) &&
|
|
564
|
-
}) : void 0,
|
|
565
|
-
|
|
566
|
-
|
|
684
|
+
}) && m(u());
|
|
685
|
+
}) : void 0, D = function() {
|
|
686
|
+
E && (E.disconnect(), a.active && !a.paused && a.containers.map(function(e) {
|
|
687
|
+
E.observe(e, {
|
|
567
688
|
subtree: !0,
|
|
568
689
|
childList: !0
|
|
569
690
|
});
|
|
570
691
|
}));
|
|
571
692
|
};
|
|
572
|
-
return
|
|
693
|
+
return o = {
|
|
573
694
|
get active() {
|
|
574
|
-
return
|
|
695
|
+
return a.active;
|
|
575
696
|
},
|
|
576
697
|
get paused() {
|
|
577
|
-
return
|
|
698
|
+
return a.paused;
|
|
578
699
|
},
|
|
579
700
|
activate: function(e) {
|
|
580
|
-
if (
|
|
581
|
-
var
|
|
582
|
-
if (
|
|
583
|
-
var
|
|
584
|
-
(
|
|
701
|
+
if (a.active) return this;
|
|
702
|
+
var t = s(e, "onActivate"), i = s(e, "onPostActivate"), c = s(e, "checkCanFocusTrap"), l = activeFocusTraps.getActiveTrap(r), u = !1;
|
|
703
|
+
if (l && !l.paused) {
|
|
704
|
+
var d;
|
|
705
|
+
(d = l._setSubtreeIsolation) == null || d.call(l, !1), u = !0;
|
|
585
706
|
}
|
|
586
707
|
try {
|
|
587
|
-
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
708
|
+
c || f(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = p(n), t?.();
|
|
709
|
+
var m = /* @__PURE__ */ function() {
|
|
710
|
+
var e = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function e() {
|
|
711
|
+
return _regenerator().w(function(e) {
|
|
712
|
+
for (;;) switch (e.n) {
|
|
713
|
+
case 0: return c && f(), e.n = 1, C();
|
|
714
|
+
case 1: o._setSubtreeIsolation(!0), D(), i?.();
|
|
715
|
+
case 2: return e.a(2);
|
|
716
|
+
}
|
|
717
|
+
}, e);
|
|
718
|
+
}));
|
|
719
|
+
return function() {
|
|
720
|
+
return e.apply(this, arguments);
|
|
721
|
+
};
|
|
722
|
+
}();
|
|
723
|
+
if (c) return c(a.containers.concat()).then(m, m), this;
|
|
724
|
+
m();
|
|
593
725
|
} catch (e) {
|
|
594
|
-
if (
|
|
595
|
-
var
|
|
596
|
-
(
|
|
726
|
+
if (l === activeFocusTraps.getActiveTrap(r) && u) {
|
|
727
|
+
var h;
|
|
728
|
+
(h = l._setSubtreeIsolation) == null || h.call(l, !0);
|
|
597
729
|
}
|
|
598
730
|
throw e;
|
|
599
731
|
}
|
|
600
732
|
return this;
|
|
601
733
|
},
|
|
602
734
|
deactivate: function(e) {
|
|
603
|
-
if (!
|
|
604
|
-
var
|
|
605
|
-
onDeactivate:
|
|
606
|
-
onPostDeactivate:
|
|
607
|
-
checkCanReturnFocus:
|
|
735
|
+
if (!a.active) return this;
|
|
736
|
+
var t = _objectSpread2({
|
|
737
|
+
onDeactivate: i.onDeactivate,
|
|
738
|
+
onPostDeactivate: i.onPostDeactivate,
|
|
739
|
+
checkCanReturnFocus: i.checkCanReturnFocus
|
|
608
740
|
}, e);
|
|
609
|
-
clearTimeout(
|
|
610
|
-
var
|
|
611
|
-
|
|
612
|
-
var
|
|
741
|
+
clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, a.paused || o._setSubtreeIsolation(!1), a.alreadySilent.clear(), T(), a.active = !1, a.paused = !1, D(), activeFocusTraps.deactivateTrap(r, o);
|
|
742
|
+
var n = s(t, "onDeactivate"), c = s(t, "onPostDeactivate"), l = s(t, "checkCanReturnFocus"), u = s(t, "returnFocus", "returnFocusOnDeactivate");
|
|
743
|
+
n?.();
|
|
744
|
+
var d = function() {
|
|
613
745
|
delay(function() {
|
|
614
|
-
|
|
746
|
+
u && m(h(a.nodeFocusedBeforeActivation)), c?.();
|
|
615
747
|
});
|
|
616
748
|
};
|
|
617
|
-
return
|
|
749
|
+
return u && l ? (l(h(a.nodeFocusedBeforeActivation)).then(d, d), this) : (d(), this);
|
|
618
750
|
},
|
|
619
751
|
pause: function(e) {
|
|
620
|
-
return
|
|
752
|
+
return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, e)) : this;
|
|
621
753
|
},
|
|
622
754
|
unpause: function(e) {
|
|
623
|
-
return !
|
|
755
|
+
return !a.active || (a.manuallyPaused = !1, r[r.length - 1] !== this) ? this : this._setPausedState(!1, e);
|
|
624
756
|
},
|
|
625
757
|
updateContainerElements: function(e) {
|
|
626
|
-
return
|
|
627
|
-
return typeof e == "string" ?
|
|
628
|
-
}),
|
|
758
|
+
return a.containers = [].concat(e).filter(Boolean).map(function(e) {
|
|
759
|
+
return typeof e == "string" ? n.querySelector(e) : e;
|
|
760
|
+
}), i.isolateSubtrees && w(a.containers), a.active && (f(), a.paused || o._setSubtreeIsolation(!0)), D(), this;
|
|
629
761
|
}
|
|
630
|
-
}, Object.defineProperties(
|
|
762
|
+
}, Object.defineProperties(o, {
|
|
631
763
|
_isManuallyPaused: { value: function() {
|
|
632
|
-
return
|
|
764
|
+
return a.manuallyPaused;
|
|
633
765
|
} },
|
|
634
|
-
_setPausedState: { value: function(e,
|
|
635
|
-
if (
|
|
636
|
-
if (
|
|
637
|
-
var
|
|
638
|
-
|
|
766
|
+
_setPausedState: { value: function(e, t) {
|
|
767
|
+
if (a.paused === e) return this;
|
|
768
|
+
if (a.paused = e, e) {
|
|
769
|
+
var n = s(t, "onPause"), r = s(t, "onPostPause");
|
|
770
|
+
n?.(), T(), o._setSubtreeIsolation(!1), D(), r?.();
|
|
639
771
|
} else {
|
|
640
|
-
var
|
|
641
|
-
|
|
772
|
+
var i = s(t, "onUnpause"), c = s(t, "onPostUnpause");
|
|
773
|
+
i?.(), (/* @__PURE__ */ (function() {
|
|
774
|
+
var e = _asyncToGenerator(/* @__PURE__ */ _regenerator().m(function e() {
|
|
775
|
+
return _regenerator().w(function(e) {
|
|
776
|
+
for (;;) switch (e.n) {
|
|
777
|
+
case 0: return f(), e.n = 1, C();
|
|
778
|
+
case 1: o._setSubtreeIsolation(!0), D(), c?.();
|
|
779
|
+
case 2: return e.a(2);
|
|
780
|
+
}
|
|
781
|
+
}, e);
|
|
782
|
+
}));
|
|
783
|
+
return function() {
|
|
784
|
+
return e.apply(this, arguments);
|
|
785
|
+
};
|
|
786
|
+
})())();
|
|
642
787
|
}
|
|
643
788
|
return this;
|
|
644
789
|
} },
|
|
645
790
|
_setSubtreeIsolation: { value: function(e) {
|
|
646
|
-
|
|
647
|
-
if (e) switch (
|
|
791
|
+
i.isolateSubtrees && a.adjacentElements.forEach(function(t) {
|
|
792
|
+
if (e) switch (i.isolateSubtrees) {
|
|
648
793
|
case "aria-hidden":
|
|
649
|
-
(
|
|
794
|
+
(t.ariaHidden === "true" || t.getAttribute("aria-hidden")?.toLowerCase() === "true") && a.alreadySilent.add(t), t.setAttribute("aria-hidden", "true");
|
|
650
795
|
break;
|
|
651
796
|
default:
|
|
652
|
-
(
|
|
797
|
+
(t.inert || t.hasAttribute("inert")) && a.alreadySilent.add(t), t.setAttribute("inert", !0);
|
|
653
798
|
break;
|
|
654
799
|
}
|
|
655
|
-
else if (!
|
|
800
|
+
else if (!a.alreadySilent.has(t)) switch (i.isolateSubtrees) {
|
|
656
801
|
case "aria-hidden":
|
|
657
|
-
|
|
802
|
+
t.removeAttribute("aria-hidden");
|
|
658
803
|
break;
|
|
659
804
|
default:
|
|
660
|
-
|
|
805
|
+
t.removeAttribute("inert");
|
|
661
806
|
break;
|
|
662
807
|
}
|
|
663
808
|
});
|
|
664
809
|
} }
|
|
665
|
-
}),
|
|
810
|
+
}), o.updateContainerElements(e), o;
|
|
666
811
|
}, GlobalToggle = class extends HTMLElement {
|
|
667
812
|
internals_;
|
|
668
813
|
controller;
|
|
@@ -691,34 +836,34 @@ var activeFocusTraps = {
|
|
|
691
836
|
allowOutsideClick: !0,
|
|
692
837
|
onActivate: () => document.body.classList.add(this.scrollLockClass),
|
|
693
838
|
onDeactivate: () => document.body.classList.remove(this.scrollLockClass),
|
|
694
|
-
checkCanFocusTrap: ([e]) => new Promise((
|
|
695
|
-
let
|
|
696
|
-
getComputedStyle(e).visibility !== "hidden" && (
|
|
839
|
+
checkCanFocusTrap: ([e]) => new Promise((t) => {
|
|
840
|
+
let n = setInterval(() => {
|
|
841
|
+
getComputedStyle(e).visibility !== "hidden" && (t(), clearInterval(n));
|
|
697
842
|
}, 5);
|
|
698
843
|
})
|
|
699
844
|
});
|
|
700
|
-
let { signal:
|
|
701
|
-
this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal:
|
|
845
|
+
let { signal: t } = this.controller;
|
|
846
|
+
this.handleBreakpoint(this.breakpoint), this.breakpoint.addEventListener("change", this.handleBreakpoint, { signal: t }), document.addEventListener("keydown", this.handleKeyDown, { signal: t });
|
|
702
847
|
}
|
|
703
848
|
disconnectedCallback() {
|
|
704
849
|
this.widget.detach(), this.controller.abort();
|
|
705
850
|
}
|
|
706
851
|
handleBreakpoint = ({ matches: e }) => {
|
|
707
852
|
if (!this.trigger) return;
|
|
708
|
-
let { signal:
|
|
709
|
-
e ? (this.widget.attach(), this.target.setAttribute("inert", ""), this.trigger.addEventListener("disclosure-toggle", this.handleDisclosure, { signal:
|
|
853
|
+
let { signal: t } = this.controller;
|
|
854
|
+
e ? (this.widget.attach(), this.target.setAttribute("inert", ""), this.trigger.addEventListener("disclosure-toggle", this.handleDisclosure, { signal: t })) : (this.widget.detach(), this.target.removeAttribute("inert"), this.target.classList.remove(this.scrollLockClass), this.trigger.removeEventListener("disclosure-toggle", this.handleDisclosure), this.focusTrap.deactivate());
|
|
710
855
|
};
|
|
711
856
|
handleDisclosure = ({ detail: e }) => {
|
|
712
|
-
let { isOpen:
|
|
713
|
-
this.trigger.textContent = this.triggerText.replace(
|
|
857
|
+
let { isOpen: t } = e, n = t ? "Open" : "Close", r = t ? "Close" : "Open";
|
|
858
|
+
this.trigger.textContent = this.triggerText.replace(n, r), t ? this.focusTrap.activate() : this.focusTrap.deactivate(), t && this.hideOther && this.otherTrigger && this.otherTrigger.getAttribute("aria-expanded") === "true" && this.otherTrigger.click(), this.trigger.classList.toggle(this.isSearch ? this.searchIconClass : this.menuIconClass), this.trigger.classList.toggle(this.closeIconClass), this.target.classList.toggle(this.backgroundClass), this.trigger.removeAttribute("no-focus"), this.isOpen = t;
|
|
714
859
|
};
|
|
715
860
|
handleKeyDown = (e) => {
|
|
716
861
|
this.isOpen && e.key === "Escape" && this.widget.handleToggle();
|
|
717
862
|
};
|
|
718
863
|
get trigger() {
|
|
719
|
-
let e = this.querySelector(":scope > button"),
|
|
720
|
-
if (!e || !
|
|
721
|
-
return e.removeAttribute("disabled"), this.controls =
|
|
864
|
+
let e = this.querySelector(":scope > button"), t = e.getAttribute("aria-controls");
|
|
865
|
+
if (!e || !t) throw Error(`${this.localName} must contain a <button aria-controls="element-to-trigger"> element.`);
|
|
866
|
+
return e.removeAttribute("disabled"), this.controls = t, this.triggerText = e.textContent, e;
|
|
722
867
|
}
|
|
723
868
|
get target() {
|
|
724
869
|
let e = document.querySelector(`div[id="${this.controls}"]`);
|