@knime/jsonforms 1.21.2 → 1.21.3
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/CHANGELOG.md +6 -0
- package/dist/{AnyOfTwinlist-BaKgX8A7.js → AnyOfTwinlist-By12blUM.js} +1 -1
- package/dist/{CheckboxControl-5w7zlrdd.js → CheckboxControl--qMC4yqR.js} +1 -1
- package/dist/{CheckboxesControl-0al-vEKC.js → CheckboxesControl-BsOG-QR8.js} +2 -2
- package/dist/{ColorControl-Dzp0Qztx.js → ColorControl-BX93RNbV.js} +1 -1
- package/dist/{ColorPreviewControl-DD9oq2kB.js → ColorPreviewControl-CFVeFXBp.js} +1 -1
- package/dist/ComboBoxControl-M5HOJcy2.js +37 -0
- package/dist/{DateControl-BqYwfkTb.js → DateControl-PYVPxPvC.js} +1 -1
- package/dist/{DateTimeControl-CNkPjqie.js → DateTimeControl-_8d8iizh.js} +1 -1
- package/dist/{DateTimeFormatPickerControl-BawKiO92.js → DateTimeFormatPickerControl-xRNNTLIl.js} +1 -1
- package/dist/{DateTimeFormatPickerWithTypeControl-BZhGNGGy.js → DateTimeFormatPickerWithTypeControl-CZZBe3PC.js} +4 -4
- package/dist/{DropdownControl-C5dZUtMO.js → DropdownControl-sGxFWX33.js} +2 -2
- package/dist/{ExecutorCoresControl-D_f2Ii7P.js → ExecutorCoresControl-6DB4hS8_.js} +2 -2
- package/dist/{ExecutorMemoryControl-Bi5ddlwR.js → ExecutorMemoryControl-xKHl7IXW.js} +2 -2
- package/dist/{FileUploadControl-Bpc7-Tjx.js → FileUploadControl-Bjgh9vSl.js} +2 -2
- package/dist/{GridSelectionControl-DS8kT_Nx.js → GridSelectionControl-DslOwaNV.js} +1 -1
- package/dist/{HorizontalLayout-CIcEcUaB.js → HorizontalLayout-Dl9cC50s.js} +1 -1
- package/dist/{IntegerControl-CNd2Zml6.js → IntegerControl-DSzPJs4Z.js} +1 -1
- package/dist/{IntervalControl-BPiRezHq.js → IntervalControl-DoWDLPMP.js} +4 -4
- package/dist/{LinkControl-Bp2h1jSd.js → LinkControl-BuYI03b_.js} +1 -1
- package/dist/{LoadingDropdown.vue_vue_type_script_setup_true_lang-BRmvlIKr.js → LoadingDropdown.vue_vue_type_script_setup_true_lang-DZ90-rk8.js} +1 -1
- package/dist/{ManualTwinlistControl-Dtx1Qiz7.js → ManualTwinlistControl-mN3zJTMK.js} +3 -3
- package/dist/{MultiSelectListBoxControl-DXLGhCNi.js → MultiSelectListBoxControl-CnSublPM.js} +3 -3
- package/dist/{MultimodeTwinlistControl-CKRsC015.js → MultimodeTwinlistControl-CyZQ54SO.js} +1 -1
- package/dist/{MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-CV2htSnA.js → MultimodeTwinlistControl.vue_vue_type_script_setup_true_lang-C9JUTbz1.js} +3 -3
- package/dist/{NameFilter-BGJOxdjr.js → NameFilter-C1u8qsYQ.js} +1 -1
- package/dist/{NumberControl-B05C6ECd.js → NumberControl-qiTgXs6x.js} +1 -1
- package/dist/{NumberControlBase.vue_vue_type_script_setup_true_lang-B64ImWmo.js → NumberControlBase.vue_vue_type_script_setup_true_lang-Bs-H6e08.js} +2 -2
- package/dist/{OneOfDropdown-DFr8wkfK.js → OneOfDropdown-Dn6QM81-.js} +1 -1
- package/dist/{RadioButtonsWithDescriptionControl-FxnrFURa.js → RadioButtonsWithDescriptionControl-1X9F9obn.js} +6 -6
- package/dist/{RadioControl-B3Wse8Ra.js → RadioControl-BdHtNPFC.js} +2 -2
- package/dist/{RadioControlBase.vue_vue_type_script_setup_true_lang-B6fvhFpH.js → RadioControlBase.vue_vue_type_script_setup_true_lang-Cp22r9KZ.js} +2 -2
- package/dist/{ResourceControlBase-CS-UW4Kt.js → ResourceControlBase-CDpi3J6s.js} +2 -2
- package/dist/{RichTextControl-BYuWpXlC.js → RichTextControl-5o904Fvx.js} +2185 -2186
- package/dist/{SectionHeading-DH9g1jBv.js → SectionHeading-CrGc61FB.js} +1 -1
- package/dist/{SectionLayout-DrSBiXd-.js → SectionLayout-B9X7fzQ9.js} +3 -3
- package/dist/{SettingsSubPanel-CZu70rLw.js → SettingsSubPanel-WzFrc-mQ.js} +1 -1
- package/dist/{SettingsSubPanelLayout-CR7zIFEo.js → SettingsSubPanelLayout-D8j0-HKD.js} +4 -4
- package/dist/{SimpleButtonControl-B2fHLn6i.js → SimpleButtonControl-BS6opqJW.js} +1 -1
- package/dist/{SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-CwE6CdU-.js → SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-BuKsDBUW.js} +78 -77
- package/dist/{SimpleTwinlistControl-BeebhKhJ.js → SimpleTwinlistControl-RlnzOp0j.js} +2 -2
- package/dist/{SingleSelectControl-W6KYjtSP.js → SingleSelectControl-DPPwJUq3.js} +2 -2
- package/dist/{SingleSelectListBoxControl-Cp_vbfKc.js → SingleSelectListBoxControl-EMc8u2ik.js} +3 -3
- package/dist/{SortListControl-b3lDXyoN.js → SortListControl-Bw3K37ru.js} +1 -1
- package/dist/{StyledListItem-B97G9CDY.js → StyledListItem-Bli2itH-.js} +1 -1
- package/dist/{TeamAndSpacesControl-BaOQSDum.js → TeamAndSpacesControl-BlvUuAAA.js} +1 -1
- package/dist/{TeamResourceControl-DdB1fE3C.js → TeamResourceControl-DuLmQ7gc.js} +2 -2
- package/dist/{TextAreaControl-CVRPcJt8.js → TextAreaControl-DtfB44mR.js} +1 -1
- package/dist/{TextControl-BqJncTor.js → TextControl-BlUQLMGo.js} +1 -1
- package/dist/{TextControl.vue_vue_type_script_setup_true_lang-C-5QWuaO.js → TextControl.vue_vue_type_script_setup_true_lang-CBke-957.js} +2 -2
- package/dist/{TimeControl-DvCOb5wo.js → TimeControl-DWzlpLX-.js} +1 -1
- package/dist/{TimePartInput-DGfV6WeZ.js → TimePartInput-CRP2YYM0.js} +1 -1
- package/dist/{TimeframesControl-7oW8Nb-d.js → TimeframesControl-O_hzJcX5.js} +2 -2
- package/dist/{Tooltip-ZO6iIct2.js → Tooltip-C9vAa0Wb.js} +1 -1
- package/dist/{TwinlistControlBase.vue_vue_type_script_setup_true_lang-Ck66siqL.js → TwinlistControlBase.vue_vue_type_script_setup_true_lang-DtphbKhB.js} +2 -2
- package/dist/{TypedStringFilter-cQS5GH50.js → TypedStringFilter-ByeMPxR6.js} +1 -1
- package/dist/{ValueSwitch-BXc_PE8P.js → ValueSwitch-BV9qUd5x.js} +1 -1
- package/dist/{ValueSwitchControl-CZStDbmJ.js → ValueSwitchControl-nW7WtSSM.js} +1 -1
- package/dist/{VerticalLayout-BsGmnjxN.js → VerticalLayout-C7_-yu_D.js} +2 -2
- package/dist/{VerticalLayoutBase-CEM6gzmm.js → VerticalLayoutBase-eODyPAoq.js} +1 -1
- package/dist/{ZonedDateTimeControl-BrhYGJwr.js → ZonedDateTimeControl-DlrvZKe4.js} +2 -2
- package/dist/{_Uint8Array-DDNG27um.js → _Uint8Array-BESS0YjU.js} +1 -1
- package/dist/{_baseIteratee-CpLcQZ3B.js → _baseIteratee-BLvJX4uT.js} +3 -3
- package/dist/floating-ui.vue-Fx4CxKut.js +1057 -0
- package/dist/knime-jsonforms.css +1 -1
- package/dist/knime-jsonforms.js +7 -7
- package/dist/{localTimeUtils-DA3ktTUE.js → localTimeUtils-Bl9xa5Jk.js} +26 -27
- package/dist/{popper-70nckCW_.js → popper-iehk3xNV.js} +225 -211
- package/dist/src/uiComponents/ComboBoxControl.vue.d.ts +2 -2
- package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +3 -1
- package/dist/testing.js +2589 -2602
- package/dist/{toString-N4qKgUAY.js → toString-DXFebvWA.js} +1 -1
- package/dist/{useBuiltinValidations-C3nXdk7R.js → useBuiltinValidations-ChnQzGRe.js} +1 -1
- package/dist/useDropdownNavigation-2Yhk7zes.js +821 -0
- package/dist/{usePossibleValues-CdZtv_zD.js → usePossibleValues-B8es3DCW.js} +1 -1
- package/dist/{useUnknownValuesInTwinlist-BANpCttu.js → useUnknownValuesInTwinlist-qv0kKHaD.js} +1 -1
- package/package.json +3 -3
- package/dist/Checkbox-BnKpZFTE.js +0 -75
- package/dist/ComboBoxControl-BOoPDajP.js +0 -615
- package/dist/close-CwP2mh9x.js +0 -17
- package/dist/floating-ui.vue-Bk6u3tWN.js +0 -1060
- package/dist/useDropdownNavigation-EOwf_fL0.js +0 -946
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
import { defineComponent as me, ref as le, computed as ge, onMounted as we, watch as Fe, onUnmounted as Te, Comment as Ne, cloneVNode as ke, readonly as Ee } from "vue";
|
|
2
|
+
var se = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], _ = /* @__PURE__ */ se.join(","), de = typeof Element > "u", O = de ? function() {
|
|
3
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, G = !de && Element.prototype.getRootNode ? function(r) {
|
|
4
|
+
var e;
|
|
5
|
+
return r == null || (e = r.getRootNode) === null || e === void 0 ? void 0 : e.call(r);
|
|
6
|
+
} : function(r) {
|
|
7
|
+
return r?.ownerDocument;
|
|
8
|
+
}, V = function(e, t) {
|
|
9
|
+
var a;
|
|
10
|
+
t === void 0 && (t = !0);
|
|
11
|
+
var u = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), c = u === "" || u === "true", n = c || t && e && // closest does not exist on shadow roots, so we fall back to a manual
|
|
12
|
+
// lookup upward, in case it is not defined.
|
|
13
|
+
(typeof e.closest == "function" ? e.closest("[inert]") : V(e.parentNode));
|
|
14
|
+
return n;
|
|
15
|
+
}, Se = function(e) {
|
|
16
|
+
var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
|
|
17
|
+
return a === "" || a === "true";
|
|
18
|
+
}, fe = function(e, t, a) {
|
|
19
|
+
if (V(e))
|
|
20
|
+
return [];
|
|
21
|
+
var u = Array.prototype.slice.apply(e.querySelectorAll(_));
|
|
22
|
+
return t && O.call(e, _) && u.unshift(e), u = u.filter(a), u;
|
|
23
|
+
}, q = function(e, t, a) {
|
|
24
|
+
for (var u = [], c = Array.from(e); c.length; ) {
|
|
25
|
+
var n = c.shift();
|
|
26
|
+
if (!V(n, !1))
|
|
27
|
+
if (n.tagName === "SLOT") {
|
|
28
|
+
var s = n.assignedElements(), b = s.length ? s : n.children, p = q(b, !0, a);
|
|
29
|
+
a.flatten ? u.push.apply(u, p) : u.push({
|
|
30
|
+
scopeParent: n,
|
|
31
|
+
candidates: p
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
var g = O.call(n, _);
|
|
35
|
+
g && a.filter(n) && (t || !e.includes(n)) && u.push(n);
|
|
36
|
+
var T = n.shadowRoot || // check for an undisclosed shadow
|
|
37
|
+
typeof a.getShadowRoot == "function" && a.getShadowRoot(n), N = !V(T, !1) && (!a.shadowRootFilter || a.shadowRootFilter(n));
|
|
38
|
+
if (T && N) {
|
|
39
|
+
var E = q(T === !0 ? n.children : T.children, !0, a);
|
|
40
|
+
a.flatten ? u.push.apply(u, E) : u.push({
|
|
41
|
+
scopeParent: n,
|
|
42
|
+
candidates: E
|
|
43
|
+
});
|
|
44
|
+
} else
|
|
45
|
+
c.unshift.apply(c, n.children);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return u;
|
|
49
|
+
}, ve = function(e) {
|
|
50
|
+
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
51
|
+
}, D = function(e) {
|
|
52
|
+
if (!e)
|
|
53
|
+
throw new Error("No node provided");
|
|
54
|
+
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Se(e)) && !ve(e) ? 0 : e.tabIndex;
|
|
55
|
+
}, De = function(e, t) {
|
|
56
|
+
var a = D(e);
|
|
57
|
+
return a < 0 && t && !ve(e) ? 0 : a;
|
|
58
|
+
}, Oe = function(e, t) {
|
|
59
|
+
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
60
|
+
}, be = function(e) {
|
|
61
|
+
return e.tagName === "INPUT";
|
|
62
|
+
}, Ce = function(e) {
|
|
63
|
+
return be(e) && e.type === "hidden";
|
|
64
|
+
}, Ie = function(e) {
|
|
65
|
+
var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
|
|
66
|
+
return a.tagName === "SUMMARY";
|
|
67
|
+
});
|
|
68
|
+
return t;
|
|
69
|
+
}, Ae = function(e, t) {
|
|
70
|
+
for (var a = 0; a < e.length; a++)
|
|
71
|
+
if (e[a].checked && e[a].form === t)
|
|
72
|
+
return e[a];
|
|
73
|
+
}, Pe = function(e) {
|
|
74
|
+
if (!e.name)
|
|
75
|
+
return !0;
|
|
76
|
+
var t = e.form || G(e), a = function(s) {
|
|
77
|
+
return t.querySelectorAll('input[type="radio"][name="' + s + '"]');
|
|
78
|
+
}, u;
|
|
79
|
+
if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
|
|
80
|
+
u = a(window.CSS.escape(e.name));
|
|
81
|
+
else
|
|
82
|
+
try {
|
|
83
|
+
u = a(e.name);
|
|
84
|
+
} catch (n) {
|
|
85
|
+
return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", n.message), !1;
|
|
86
|
+
}
|
|
87
|
+
var c = Ae(u, e.form);
|
|
88
|
+
return !c || c === e;
|
|
89
|
+
}, Re = function(e) {
|
|
90
|
+
return be(e) && e.type === "radio";
|
|
91
|
+
}, xe = function(e) {
|
|
92
|
+
return Re(e) && !Pe(e);
|
|
93
|
+
}, Be = function(e) {
|
|
94
|
+
var t, a = e && G(e), u = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
|
|
95
|
+
if (a && a !== e) {
|
|
96
|
+
var n, s, b;
|
|
97
|
+
for (c = !!((n = u) !== null && n !== void 0 && (s = n.ownerDocument) !== null && s !== void 0 && s.contains(u) || e != null && (b = e.ownerDocument) !== null && b !== void 0 && b.contains(e)); !c && u; ) {
|
|
98
|
+
var p, g, T;
|
|
99
|
+
a = G(u), u = (p = a) === null || p === void 0 ? void 0 : p.host, c = !!((g = u) !== null && g !== void 0 && (T = g.ownerDocument) !== null && T !== void 0 && T.contains(u));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return c;
|
|
103
|
+
}, ne = function(e) {
|
|
104
|
+
var t = e.getBoundingClientRect(), a = t.width, u = t.height;
|
|
105
|
+
return a === 0 && u === 0;
|
|
106
|
+
}, Le = function(e, t) {
|
|
107
|
+
var a = t.displayCheck, u = t.getShadowRoot;
|
|
108
|
+
if (a === "full-native" && "checkVisibility" in e) {
|
|
109
|
+
var c = e.checkVisibility({
|
|
110
|
+
// Checking opacity might be desirable for some use cases, but natively,
|
|
111
|
+
// opacity zero elements _are_ focusable and tabbable.
|
|
112
|
+
checkOpacity: !1,
|
|
113
|
+
opacityProperty: !1,
|
|
114
|
+
contentVisibilityAuto: !0,
|
|
115
|
+
visibilityProperty: !0,
|
|
116
|
+
// This is an alias for `visibilityProperty`. Contemporary browsers
|
|
117
|
+
// support both. However, this alias has wider browser support (Chrome
|
|
118
|
+
// >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
|
|
119
|
+
// we include it anyway.
|
|
120
|
+
checkVisibilityCSS: !0
|
|
121
|
+
});
|
|
122
|
+
return !c;
|
|
123
|
+
}
|
|
124
|
+
if (getComputedStyle(e).visibility === "hidden")
|
|
125
|
+
return !0;
|
|
126
|
+
var n = O.call(e, "details>summary:first-of-type"), s = n ? e.parentElement : e;
|
|
127
|
+
if (O.call(s, "details:not([open]) *"))
|
|
128
|
+
return !0;
|
|
129
|
+
if (!a || a === "full" || // full-native can run this branch when it falls through in case
|
|
130
|
+
// Element#checkVisibility is unsupported
|
|
131
|
+
a === "full-native" || a === "legacy-full") {
|
|
132
|
+
if (typeof u == "function") {
|
|
133
|
+
for (var b = e; e; ) {
|
|
134
|
+
var p = e.parentElement, g = G(e);
|
|
135
|
+
if (p && !p.shadowRoot && u(p) === !0)
|
|
136
|
+
return ne(e);
|
|
137
|
+
e.assignedSlot ? e = e.assignedSlot : !p && g !== e.ownerDocument ? e = g.host : e = p;
|
|
138
|
+
}
|
|
139
|
+
e = b;
|
|
140
|
+
}
|
|
141
|
+
if (Be(e))
|
|
142
|
+
return !e.getClientRects().length;
|
|
143
|
+
if (a !== "legacy-full")
|
|
144
|
+
return !0;
|
|
145
|
+
} else if (a === "non-zero-area")
|
|
146
|
+
return ne(e);
|
|
147
|
+
return !1;
|
|
148
|
+
}, je = function(e) {
|
|
149
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
|
|
150
|
+
for (var t = e.parentElement; t; ) {
|
|
151
|
+
if (t.tagName === "FIELDSET" && t.disabled) {
|
|
152
|
+
for (var a = 0; a < t.children.length; a++) {
|
|
153
|
+
var u = t.children.item(a);
|
|
154
|
+
if (u.tagName === "LEGEND")
|
|
155
|
+
return O.call(t, "fieldset[disabled] *") ? !0 : !u.contains(e);
|
|
156
|
+
}
|
|
157
|
+
return !0;
|
|
158
|
+
}
|
|
159
|
+
t = t.parentElement;
|
|
160
|
+
}
|
|
161
|
+
return !1;
|
|
162
|
+
}, U = function(e, t) {
|
|
163
|
+
return !(t.disabled || Ce(t) || Le(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
164
|
+
Ie(t) || je(t));
|
|
165
|
+
}, z = function(e, t) {
|
|
166
|
+
return !(xe(t) || D(t) < 0 || !U(e, t));
|
|
167
|
+
}, Ke = function(e) {
|
|
168
|
+
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
169
|
+
return !!(isNaN(t) || t >= 0);
|
|
170
|
+
}, pe = function(e) {
|
|
171
|
+
var t = [], a = [];
|
|
172
|
+
return e.forEach(function(u, c) {
|
|
173
|
+
var n = !!u.scopeParent, s = n ? u.scopeParent : u, b = De(s, n), p = n ? pe(u.candidates) : s;
|
|
174
|
+
b === 0 ? n ? t.push.apply(t, p) : t.push(s) : a.push({
|
|
175
|
+
documentOrder: c,
|
|
176
|
+
tabIndex: b,
|
|
177
|
+
item: u,
|
|
178
|
+
isScope: n,
|
|
179
|
+
content: p
|
|
180
|
+
});
|
|
181
|
+
}), a.sort(Oe).reduce(function(u, c) {
|
|
182
|
+
return c.isScope ? u.push.apply(u, c.content) : u.push(c.content), u;
|
|
183
|
+
}, []).concat(t);
|
|
184
|
+
}, Me = function(e, t) {
|
|
185
|
+
t = t || {};
|
|
186
|
+
var a;
|
|
187
|
+
return t.getShadowRoot ? a = q([e], t.includeContainer, {
|
|
188
|
+
filter: z.bind(null, t),
|
|
189
|
+
flatten: !1,
|
|
190
|
+
getShadowRoot: t.getShadowRoot,
|
|
191
|
+
shadowRootFilter: Ke
|
|
192
|
+
}) : a = fe(e, t.includeContainer, z.bind(null, t)), pe(a);
|
|
193
|
+
}, _e = function(e, t) {
|
|
194
|
+
t = t || {};
|
|
195
|
+
var a;
|
|
196
|
+
return t.getShadowRoot ? a = q([e], t.includeContainer, {
|
|
197
|
+
filter: U.bind(null, t),
|
|
198
|
+
flatten: !0,
|
|
199
|
+
getShadowRoot: t.getShadowRoot
|
|
200
|
+
}) : a = fe(e, t.includeContainer, U.bind(null, t)), a;
|
|
201
|
+
}, C = function(e, t) {
|
|
202
|
+
if (t = t || {}, !e)
|
|
203
|
+
throw new Error("No node provided");
|
|
204
|
+
return O.call(e, _) === !1 ? !1 : z(t, e);
|
|
205
|
+
}, Ge = /* @__PURE__ */ se.concat("iframe:not([inert]):not([inert] *)").join(","), Z = function(e, t) {
|
|
206
|
+
if (t = t || {}, !e)
|
|
207
|
+
throw new Error("No node provided");
|
|
208
|
+
return O.call(e, Ge) === !1 ? !1 : U(t, e);
|
|
209
|
+
};
|
|
210
|
+
function X(r, e) {
|
|
211
|
+
(e == null || e > r.length) && (e = r.length);
|
|
212
|
+
for (var t = 0, a = Array(e); t < e; t++) a[t] = r[t];
|
|
213
|
+
return a;
|
|
214
|
+
}
|
|
215
|
+
function Ve(r) {
|
|
216
|
+
if (Array.isArray(r)) return X(r);
|
|
217
|
+
}
|
|
218
|
+
function qe(r, e, t) {
|
|
219
|
+
return (e = Ye(e)) in r ? Object.defineProperty(r, e, {
|
|
220
|
+
value: t,
|
|
221
|
+
enumerable: !0,
|
|
222
|
+
configurable: !0,
|
|
223
|
+
writable: !0
|
|
224
|
+
}) : r[e] = t, r;
|
|
225
|
+
}
|
|
226
|
+
function Ue(r) {
|
|
227
|
+
if (typeof Symbol < "u" && r[Symbol.iterator] != null || r["@@iterator"] != null) return Array.from(r);
|
|
228
|
+
}
|
|
229
|
+
function $e() {
|
|
230
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
231
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
232
|
+
}
|
|
233
|
+
function ie(r, e) {
|
|
234
|
+
var t = Object.keys(r);
|
|
235
|
+
if (Object.getOwnPropertySymbols) {
|
|
236
|
+
var a = Object.getOwnPropertySymbols(r);
|
|
237
|
+
e && (a = a.filter(function(u) {
|
|
238
|
+
return Object.getOwnPropertyDescriptor(r, u).enumerable;
|
|
239
|
+
})), t.push.apply(t, a);
|
|
240
|
+
}
|
|
241
|
+
return t;
|
|
242
|
+
}
|
|
243
|
+
function oe(r) {
|
|
244
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
245
|
+
var t = arguments[e] != null ? arguments[e] : {};
|
|
246
|
+
e % 2 ? ie(Object(t), !0).forEach(function(a) {
|
|
247
|
+
qe(r, a, t[a]);
|
|
248
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ie(Object(t)).forEach(function(a) {
|
|
249
|
+
Object.defineProperty(r, a, Object.getOwnPropertyDescriptor(t, a));
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
return r;
|
|
253
|
+
}
|
|
254
|
+
function He(r) {
|
|
255
|
+
return Ve(r) || Ue(r) || Ze(r) || $e();
|
|
256
|
+
}
|
|
257
|
+
function We(r, e) {
|
|
258
|
+
if (typeof r != "object" || !r) return r;
|
|
259
|
+
var t = r[Symbol.toPrimitive];
|
|
260
|
+
if (t !== void 0) {
|
|
261
|
+
var a = t.call(r, e);
|
|
262
|
+
if (typeof a != "object") return a;
|
|
263
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
264
|
+
}
|
|
265
|
+
return (e === "string" ? String : Number)(r);
|
|
266
|
+
}
|
|
267
|
+
function Ye(r) {
|
|
268
|
+
var e = We(r, "string");
|
|
269
|
+
return typeof e == "symbol" ? e : e + "";
|
|
270
|
+
}
|
|
271
|
+
function Ze(r, e) {
|
|
272
|
+
if (r) {
|
|
273
|
+
if (typeof r == "string") return X(r, e);
|
|
274
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
275
|
+
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) ? X(r, e) : void 0;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
var ue = {
|
|
279
|
+
activateTrap: function(e, t) {
|
|
280
|
+
if (e.length > 0) {
|
|
281
|
+
var a = e[e.length - 1];
|
|
282
|
+
a !== t && a._setPausedState(!0);
|
|
283
|
+
}
|
|
284
|
+
var u = e.indexOf(t);
|
|
285
|
+
u === -1 || e.splice(u, 1), e.push(t);
|
|
286
|
+
},
|
|
287
|
+
deactivateTrap: function(e, t) {
|
|
288
|
+
var a = e.indexOf(t);
|
|
289
|
+
a !== -1 && e.splice(a, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
|
|
290
|
+
}
|
|
291
|
+
}, ze = function(e) {
|
|
292
|
+
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
293
|
+
}, Xe = function(e) {
|
|
294
|
+
return e?.key === "Escape" || e?.key === "Esc" || e?.keyCode === 27;
|
|
295
|
+
}, B = function(e) {
|
|
296
|
+
return e?.key === "Tab" || e?.keyCode === 9;
|
|
297
|
+
}, Je = function(e) {
|
|
298
|
+
return B(e) && !e.shiftKey;
|
|
299
|
+
}, Qe = function(e) {
|
|
300
|
+
return B(e) && e.shiftKey;
|
|
301
|
+
}, ce = function(e) {
|
|
302
|
+
return setTimeout(e, 0);
|
|
303
|
+
}, x = function(e) {
|
|
304
|
+
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), u = 1; u < t; u++)
|
|
305
|
+
a[u - 1] = arguments[u];
|
|
306
|
+
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
307
|
+
}, K = function(e) {
|
|
308
|
+
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
309
|
+
}, et = [], tt = function(e, t) {
|
|
310
|
+
var a = t?.document || document, u = t?.trapStack || et, c = oe({
|
|
311
|
+
returnFocusOnDeactivate: !0,
|
|
312
|
+
escapeDeactivates: !0,
|
|
313
|
+
delayInitialFocus: !0,
|
|
314
|
+
isKeyForward: Je,
|
|
315
|
+
isKeyBackward: Qe
|
|
316
|
+
}, t), n = {
|
|
317
|
+
// containers given to createFocusTrap()
|
|
318
|
+
// @type {Array<HTMLElement>}
|
|
319
|
+
containers: [],
|
|
320
|
+
// list of objects identifying tabbable nodes in `containers` in the trap
|
|
321
|
+
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
322
|
+
// is active, but the trap should never get to a state where there isn't at least one group
|
|
323
|
+
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
324
|
+
// result in an error being thrown)
|
|
325
|
+
// @type {Array<{
|
|
326
|
+
// container: HTMLElement,
|
|
327
|
+
// tabbableNodes: Array<HTMLElement>, // empty if none
|
|
328
|
+
// focusableNodes: Array<HTMLElement>, // empty if none
|
|
329
|
+
// posTabIndexesFound: boolean,
|
|
330
|
+
// firstTabbableNode: HTMLElement|undefined,
|
|
331
|
+
// lastTabbableNode: HTMLElement|undefined,
|
|
332
|
+
// firstDomTabbableNode: HTMLElement|undefined,
|
|
333
|
+
// lastDomTabbableNode: HTMLElement|undefined,
|
|
334
|
+
// nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
335
|
+
// }>}
|
|
336
|
+
containerGroups: [],
|
|
337
|
+
// same order/length as `containers` list
|
|
338
|
+
// references to objects in `containerGroups`, but only those that actually have
|
|
339
|
+
// tabbable nodes in them
|
|
340
|
+
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
341
|
+
// the same length
|
|
342
|
+
tabbableGroups: [],
|
|
343
|
+
nodeFocusedBeforeActivation: null,
|
|
344
|
+
mostRecentlyFocusedNode: null,
|
|
345
|
+
active: !1,
|
|
346
|
+
paused: !1,
|
|
347
|
+
manuallyPaused: !1,
|
|
348
|
+
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
349
|
+
// has been delayed during activation
|
|
350
|
+
delayInitialFocusTimer: void 0,
|
|
351
|
+
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
352
|
+
recentNavEvent: void 0
|
|
353
|
+
}, s, b = function(i, o, l) {
|
|
354
|
+
return i && i[o] !== void 0 ? i[o] : c[l || o];
|
|
355
|
+
}, p = function(i, o) {
|
|
356
|
+
var l = typeof o?.composedPath == "function" ? o.composedPath() : void 0;
|
|
357
|
+
return n.containerGroups.findIndex(function(f) {
|
|
358
|
+
var v = f.container, y = f.tabbableNodes;
|
|
359
|
+
return v.contains(i) || l?.includes(v) || y.find(function(d) {
|
|
360
|
+
return d === i;
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
}, g = function(i) {
|
|
364
|
+
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = o.hasFallback, f = l === void 0 ? !1 : l, v = o.params, y = v === void 0 ? [] : v, d = c[i];
|
|
365
|
+
if (typeof d == "function" && (d = d.apply(void 0, He(y))), d === !0 && (d = void 0), !d) {
|
|
366
|
+
if (d === void 0 || d === !1)
|
|
367
|
+
return d;
|
|
368
|
+
throw new Error("`".concat(i, "` was specified but was not a node, or did not return a node"));
|
|
369
|
+
}
|
|
370
|
+
var w = d;
|
|
371
|
+
if (typeof d == "string") {
|
|
372
|
+
try {
|
|
373
|
+
w = a.querySelector(d);
|
|
374
|
+
} catch (F) {
|
|
375
|
+
throw new Error("`".concat(i, '` appears to be an invalid selector; error="').concat(F.message, '"'));
|
|
376
|
+
}
|
|
377
|
+
if (!w && !f)
|
|
378
|
+
throw new Error("`".concat(i, "` as selector refers to no known node"));
|
|
379
|
+
}
|
|
380
|
+
return w;
|
|
381
|
+
}, T = function() {
|
|
382
|
+
var i = g("initialFocus", {
|
|
383
|
+
hasFallback: !0
|
|
384
|
+
});
|
|
385
|
+
if (i === !1)
|
|
386
|
+
return !1;
|
|
387
|
+
if (i === void 0 || i && !Z(i, c.tabbableOptions))
|
|
388
|
+
if (p(a.activeElement) >= 0)
|
|
389
|
+
i = a.activeElement;
|
|
390
|
+
else {
|
|
391
|
+
var o = n.tabbableGroups[0], l = o && o.firstTabbableNode;
|
|
392
|
+
i = l || g("fallbackFocus");
|
|
393
|
+
}
|
|
394
|
+
else i === null && (i = g("fallbackFocus"));
|
|
395
|
+
if (!i)
|
|
396
|
+
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
397
|
+
return i;
|
|
398
|
+
}, N = function() {
|
|
399
|
+
if (n.containerGroups = n.containers.map(function(i) {
|
|
400
|
+
var o = Me(i, c.tabbableOptions), l = _e(i, c.tabbableOptions), f = o.length > 0 ? o[0] : void 0, v = o.length > 0 ? o[o.length - 1] : void 0, y = l.find(function(F) {
|
|
401
|
+
return C(F);
|
|
402
|
+
}), d = l.slice().reverse().find(function(F) {
|
|
403
|
+
return C(F);
|
|
404
|
+
}), w = !!o.find(function(F) {
|
|
405
|
+
return D(F) > 0;
|
|
406
|
+
});
|
|
407
|
+
return {
|
|
408
|
+
container: i,
|
|
409
|
+
tabbableNodes: o,
|
|
410
|
+
focusableNodes: l,
|
|
411
|
+
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
412
|
+
posTabIndexesFound: w,
|
|
413
|
+
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
414
|
+
firstTabbableNode: f,
|
|
415
|
+
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
416
|
+
lastTabbableNode: v,
|
|
417
|
+
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
418
|
+
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
419
|
+
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
420
|
+
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
|
|
421
|
+
// to address an edge case related to positive tabindex support, this seems like a much easier,
|
|
422
|
+
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
423
|
+
// be avoided anyway...
|
|
424
|
+
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
425
|
+
firstDomTabbableNode: y,
|
|
426
|
+
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
427
|
+
lastDomTabbableNode: d,
|
|
428
|
+
/**
|
|
429
|
+
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
430
|
+
* in this container, if any.
|
|
431
|
+
* @param {HTMLElement} node
|
|
432
|
+
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
433
|
+
* in reverse.
|
|
434
|
+
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
435
|
+
*/
|
|
436
|
+
nextTabbableNode: function(S) {
|
|
437
|
+
var P = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, k = o.indexOf(S);
|
|
438
|
+
return k < 0 ? P ? l.slice(l.indexOf(S) + 1).find(function(R) {
|
|
439
|
+
return C(R);
|
|
440
|
+
}) : l.slice(0, l.indexOf(S)).reverse().find(function(R) {
|
|
441
|
+
return C(R);
|
|
442
|
+
}) : o[k + (P ? 1 : -1)];
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
}), n.tabbableGroups = n.containerGroups.filter(function(i) {
|
|
446
|
+
return i.tabbableNodes.length > 0;
|
|
447
|
+
}), n.tabbableGroups.length <= 0 && !g("fallbackFocus"))
|
|
448
|
+
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
449
|
+
if (n.containerGroups.find(function(i) {
|
|
450
|
+
return i.posTabIndexesFound;
|
|
451
|
+
}) && n.containerGroups.length > 1)
|
|
452
|
+
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.");
|
|
453
|
+
}, E = function(i) {
|
|
454
|
+
var o = i.activeElement;
|
|
455
|
+
if (o)
|
|
456
|
+
return o.shadowRoot && o.shadowRoot.activeElement !== null ? E(o.shadowRoot) : o;
|
|
457
|
+
}, m = function(i) {
|
|
458
|
+
if (i !== !1 && i !== E(document)) {
|
|
459
|
+
if (!i || !i.focus) {
|
|
460
|
+
m(T());
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
i.focus({
|
|
464
|
+
preventScroll: !!c.preventScroll
|
|
465
|
+
}), n.mostRecentlyFocusedNode = i, ze(i) && i.select();
|
|
466
|
+
}
|
|
467
|
+
}, L = function(i) {
|
|
468
|
+
var o = g("setReturnFocus", {
|
|
469
|
+
params: [i]
|
|
470
|
+
});
|
|
471
|
+
return o || (o === !1 ? !1 : i);
|
|
472
|
+
}, j = function(i) {
|
|
473
|
+
var o = i.target, l = i.event, f = i.isBackward, v = f === void 0 ? !1 : f;
|
|
474
|
+
o = o || K(l), N();
|
|
475
|
+
var y = null;
|
|
476
|
+
if (n.tabbableGroups.length > 0) {
|
|
477
|
+
var d = p(o, l), w = d >= 0 ? n.containerGroups[d] : void 0;
|
|
478
|
+
if (d < 0)
|
|
479
|
+
v ? y = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : y = n.tabbableGroups[0].firstTabbableNode;
|
|
480
|
+
else if (v) {
|
|
481
|
+
var F = n.tabbableGroups.findIndex(function(W) {
|
|
482
|
+
var Y = W.firstTabbableNode;
|
|
483
|
+
return o === Y;
|
|
484
|
+
});
|
|
485
|
+
if (F < 0 && (w.container === o || Z(o, c.tabbableOptions) && !C(o, c.tabbableOptions) && !w.nextTabbableNode(o, !1)) && (F = d), F >= 0) {
|
|
486
|
+
var S = F === 0 ? n.tabbableGroups.length - 1 : F - 1, P = n.tabbableGroups[S];
|
|
487
|
+
y = D(o) >= 0 ? P.lastTabbableNode : P.lastDomTabbableNode;
|
|
488
|
+
} else B(l) || (y = w.nextTabbableNode(o, !1));
|
|
489
|
+
} else {
|
|
490
|
+
var k = n.tabbableGroups.findIndex(function(W) {
|
|
491
|
+
var Y = W.lastTabbableNode;
|
|
492
|
+
return o === Y;
|
|
493
|
+
});
|
|
494
|
+
if (k < 0 && (w.container === o || Z(o, c.tabbableOptions) && !C(o, c.tabbableOptions) && !w.nextTabbableNode(o)) && (k = d), k >= 0) {
|
|
495
|
+
var R = k === n.tabbableGroups.length - 1 ? 0 : k + 1, re = n.tabbableGroups[R];
|
|
496
|
+
y = D(o) >= 0 ? re.firstTabbableNode : re.firstDomTabbableNode;
|
|
497
|
+
} else B(l) || (y = w.nextTabbableNode(o));
|
|
498
|
+
}
|
|
499
|
+
} else
|
|
500
|
+
y = g("fallbackFocus");
|
|
501
|
+
return y;
|
|
502
|
+
}, I = function(i) {
|
|
503
|
+
var o = K(i);
|
|
504
|
+
if (!(p(o, i) >= 0)) {
|
|
505
|
+
if (x(c.clickOutsideDeactivates, i)) {
|
|
506
|
+
s.deactivate({
|
|
507
|
+
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
508
|
+
// which will result in the outside click setting focus to the node
|
|
509
|
+
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
510
|
+
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
511
|
+
// on activation (or the configured `setReturnFocus` node), whether the
|
|
512
|
+
// outside click was on a focusable node or not
|
|
513
|
+
returnFocus: c.returnFocusOnDeactivate
|
|
514
|
+
});
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
x(c.allowOutsideClick, i) || i.preventDefault();
|
|
518
|
+
}
|
|
519
|
+
}, $ = function(i) {
|
|
520
|
+
var o = K(i), l = p(o, i) >= 0;
|
|
521
|
+
if (l || o instanceof Document)
|
|
522
|
+
l && (n.mostRecentlyFocusedNode = o);
|
|
523
|
+
else {
|
|
524
|
+
i.stopImmediatePropagation();
|
|
525
|
+
var f, v = !0;
|
|
526
|
+
if (n.mostRecentlyFocusedNode)
|
|
527
|
+
if (D(n.mostRecentlyFocusedNode) > 0) {
|
|
528
|
+
var y = p(n.mostRecentlyFocusedNode), d = n.containerGroups[y].tabbableNodes;
|
|
529
|
+
if (d.length > 0) {
|
|
530
|
+
var w = d.findIndex(function(F) {
|
|
531
|
+
return F === n.mostRecentlyFocusedNode;
|
|
532
|
+
});
|
|
533
|
+
w >= 0 && (c.isKeyForward(n.recentNavEvent) ? w + 1 < d.length && (f = d[w + 1], v = !1) : w - 1 >= 0 && (f = d[w - 1], v = !1));
|
|
534
|
+
}
|
|
535
|
+
} else
|
|
536
|
+
n.containerGroups.some(function(F) {
|
|
537
|
+
return F.tabbableNodes.some(function(S) {
|
|
538
|
+
return D(S) > 0;
|
|
539
|
+
});
|
|
540
|
+
}) || (v = !1);
|
|
541
|
+
else
|
|
542
|
+
v = !1;
|
|
543
|
+
v && (f = j({
|
|
544
|
+
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
545
|
+
// outside the trap causing the focus escape we're trying to fix)
|
|
546
|
+
target: n.mostRecentlyFocusedNode,
|
|
547
|
+
isBackward: c.isKeyBackward(n.recentNavEvent)
|
|
548
|
+
})), m(f || n.mostRecentlyFocusedNode || T());
|
|
549
|
+
}
|
|
550
|
+
n.recentNavEvent = void 0;
|
|
551
|
+
}, he = function(i) {
|
|
552
|
+
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
553
|
+
n.recentNavEvent = i;
|
|
554
|
+
var l = j({
|
|
555
|
+
event: i,
|
|
556
|
+
isBackward: o
|
|
557
|
+
});
|
|
558
|
+
l && (B(i) && i.preventDefault(), m(l));
|
|
559
|
+
}, J = function(i) {
|
|
560
|
+
(c.isKeyForward(i) || c.isKeyBackward(i)) && he(i, c.isKeyBackward(i));
|
|
561
|
+
}, Q = function(i) {
|
|
562
|
+
Xe(i) && x(c.escapeDeactivates, i) !== !1 && (i.preventDefault(), s.deactivate());
|
|
563
|
+
}, ee = function(i) {
|
|
564
|
+
var o = K(i);
|
|
565
|
+
p(o, i) >= 0 || x(c.clickOutsideDeactivates, i) || x(c.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
566
|
+
}, te = function() {
|
|
567
|
+
if (n.active)
|
|
568
|
+
return ue.activateTrap(u, s), n.delayInitialFocusTimer = c.delayInitialFocus ? ce(function() {
|
|
569
|
+
m(T());
|
|
570
|
+
}) : m(T()), a.addEventListener("focusin", $, !0), a.addEventListener("mousedown", I, {
|
|
571
|
+
capture: !0,
|
|
572
|
+
passive: !1
|
|
573
|
+
}), a.addEventListener("touchstart", I, {
|
|
574
|
+
capture: !0,
|
|
575
|
+
passive: !1
|
|
576
|
+
}), a.addEventListener("click", ee, {
|
|
577
|
+
capture: !0,
|
|
578
|
+
passive: !1
|
|
579
|
+
}), a.addEventListener("keydown", J, {
|
|
580
|
+
capture: !0,
|
|
581
|
+
passive: !1
|
|
582
|
+
}), a.addEventListener("keydown", Q), s;
|
|
583
|
+
}, ae = function() {
|
|
584
|
+
if (n.active)
|
|
585
|
+
return a.removeEventListener("focusin", $, !0), a.removeEventListener("mousedown", I, !0), a.removeEventListener("touchstart", I, !0), a.removeEventListener("click", ee, !0), a.removeEventListener("keydown", J, !0), a.removeEventListener("keydown", Q), s;
|
|
586
|
+
}, ye = function(i) {
|
|
587
|
+
var o = i.some(function(l) {
|
|
588
|
+
var f = Array.from(l.removedNodes);
|
|
589
|
+
return f.some(function(v) {
|
|
590
|
+
return v === n.mostRecentlyFocusedNode;
|
|
591
|
+
});
|
|
592
|
+
});
|
|
593
|
+
o && m(T());
|
|
594
|
+
}, H = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(ye) : void 0, A = function() {
|
|
595
|
+
H && (H.disconnect(), n.active && !n.paused && n.containers.map(function(i) {
|
|
596
|
+
H.observe(i, {
|
|
597
|
+
subtree: !0,
|
|
598
|
+
childList: !0
|
|
599
|
+
});
|
|
600
|
+
}));
|
|
601
|
+
};
|
|
602
|
+
return s = {
|
|
603
|
+
get active() {
|
|
604
|
+
return n.active;
|
|
605
|
+
},
|
|
606
|
+
get paused() {
|
|
607
|
+
return n.paused;
|
|
608
|
+
},
|
|
609
|
+
activate: function(i) {
|
|
610
|
+
if (n.active)
|
|
611
|
+
return this;
|
|
612
|
+
var o = b(i, "onActivate"), l = b(i, "onPostActivate"), f = b(i, "checkCanFocusTrap");
|
|
613
|
+
f || N(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = E(a), o?.();
|
|
614
|
+
var v = function() {
|
|
615
|
+
f && N(), te(), A(), l?.();
|
|
616
|
+
};
|
|
617
|
+
return f ? (f(n.containers.concat()).then(v, v), this) : (v(), this);
|
|
618
|
+
},
|
|
619
|
+
deactivate: function(i) {
|
|
620
|
+
if (!n.active)
|
|
621
|
+
return this;
|
|
622
|
+
var o = oe({
|
|
623
|
+
onDeactivate: c.onDeactivate,
|
|
624
|
+
onPostDeactivate: c.onPostDeactivate,
|
|
625
|
+
checkCanReturnFocus: c.checkCanReturnFocus
|
|
626
|
+
}, i);
|
|
627
|
+
clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, ae(), n.active = !1, n.paused = !1, A(), ue.deactivateTrap(u, s);
|
|
628
|
+
var l = b(o, "onDeactivate"), f = b(o, "onPostDeactivate"), v = b(o, "checkCanReturnFocus"), y = b(o, "returnFocus", "returnFocusOnDeactivate");
|
|
629
|
+
l?.();
|
|
630
|
+
var d = function() {
|
|
631
|
+
ce(function() {
|
|
632
|
+
y && m(L(n.nodeFocusedBeforeActivation)), f?.();
|
|
633
|
+
});
|
|
634
|
+
};
|
|
635
|
+
return y && v ? (v(L(n.nodeFocusedBeforeActivation)).then(d, d), this) : (d(), this);
|
|
636
|
+
},
|
|
637
|
+
pause: function(i) {
|
|
638
|
+
return n.active ? (n.manuallyPaused = !0, this._setPausedState(!0, i)) : this;
|
|
639
|
+
},
|
|
640
|
+
unpause: function(i) {
|
|
641
|
+
return n.active ? (n.manuallyPaused = !1, u[u.length - 1] !== this ? this : this._setPausedState(!1, i)) : this;
|
|
642
|
+
},
|
|
643
|
+
updateContainerElements: function(i) {
|
|
644
|
+
var o = [].concat(i).filter(Boolean);
|
|
645
|
+
return n.containers = o.map(function(l) {
|
|
646
|
+
return typeof l == "string" ? a.querySelector(l) : l;
|
|
647
|
+
}), n.active && N(), A(), this;
|
|
648
|
+
}
|
|
649
|
+
}, Object.defineProperties(s, {
|
|
650
|
+
_isManuallyPaused: {
|
|
651
|
+
value: function() {
|
|
652
|
+
return n.manuallyPaused;
|
|
653
|
+
}
|
|
654
|
+
},
|
|
655
|
+
_setPausedState: {
|
|
656
|
+
value: function(i, o) {
|
|
657
|
+
if (n.paused === i)
|
|
658
|
+
return this;
|
|
659
|
+
if (n.paused = i, i) {
|
|
660
|
+
var l = b(o, "onPause"), f = b(o, "onPostPause");
|
|
661
|
+
l?.(), ae(), A(), f?.();
|
|
662
|
+
} else {
|
|
663
|
+
var v = b(o, "onUnpause"), y = b(o, "onPostUnpause");
|
|
664
|
+
v?.(), N(), te(), A(), y?.();
|
|
665
|
+
}
|
|
666
|
+
return this;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}), s.updateContainerElements(e), s;
|
|
670
|
+
};
|
|
671
|
+
const at = {
|
|
672
|
+
escapeDeactivates: {
|
|
673
|
+
type: Boolean,
|
|
674
|
+
default: !0
|
|
675
|
+
},
|
|
676
|
+
returnFocusOnDeactivate: {
|
|
677
|
+
type: Boolean,
|
|
678
|
+
default: !0
|
|
679
|
+
},
|
|
680
|
+
allowOutsideClick: {
|
|
681
|
+
type: [Boolean, Function],
|
|
682
|
+
default: !0
|
|
683
|
+
},
|
|
684
|
+
clickOutsideDeactivates: [Boolean, Function],
|
|
685
|
+
initialFocus: [String, Function, Boolean],
|
|
686
|
+
fallbackFocus: [String, Function],
|
|
687
|
+
checkCanFocusTrap: Function,
|
|
688
|
+
checkCanReturnFocus: Function,
|
|
689
|
+
delayInitialFocus: {
|
|
690
|
+
type: Boolean,
|
|
691
|
+
default: !0
|
|
692
|
+
},
|
|
693
|
+
document: Object,
|
|
694
|
+
preventScroll: Boolean,
|
|
695
|
+
setReturnFocus: [Object, String, Boolean, Function],
|
|
696
|
+
tabbableOptions: Object
|
|
697
|
+
}, nt = me({
|
|
698
|
+
props: Object.assign({
|
|
699
|
+
active: {
|
|
700
|
+
// TODO: could be options for activate but what about the options for deactivating?
|
|
701
|
+
type: Boolean,
|
|
702
|
+
default: !0
|
|
703
|
+
}
|
|
704
|
+
}, at),
|
|
705
|
+
emits: [
|
|
706
|
+
"update:active",
|
|
707
|
+
"activate",
|
|
708
|
+
"postActivate",
|
|
709
|
+
"deactivate",
|
|
710
|
+
"postDeactivate"
|
|
711
|
+
],
|
|
712
|
+
render() {
|
|
713
|
+
return this.renderImpl();
|
|
714
|
+
},
|
|
715
|
+
setup(r, { slots: e, emit: t }) {
|
|
716
|
+
let a;
|
|
717
|
+
const u = le(null), c = ge(() => {
|
|
718
|
+
const s = u.value;
|
|
719
|
+
return s && (s instanceof HTMLElement ? s : s.$el);
|
|
720
|
+
});
|
|
721
|
+
function n() {
|
|
722
|
+
return a || (a = tt(c.value, {
|
|
723
|
+
escapeDeactivates: r.escapeDeactivates,
|
|
724
|
+
allowOutsideClick: r.allowOutsideClick,
|
|
725
|
+
returnFocusOnDeactivate: r.returnFocusOnDeactivate,
|
|
726
|
+
clickOutsideDeactivates: r.clickOutsideDeactivates,
|
|
727
|
+
onActivate: () => {
|
|
728
|
+
t("update:active", !0), t("activate");
|
|
729
|
+
},
|
|
730
|
+
onDeactivate: () => {
|
|
731
|
+
t("update:active", !1), t("deactivate");
|
|
732
|
+
},
|
|
733
|
+
onPostActivate: () => t("postActivate"),
|
|
734
|
+
onPostDeactivate: () => t("postDeactivate"),
|
|
735
|
+
initialFocus: r.initialFocus,
|
|
736
|
+
fallbackFocus: r.fallbackFocus,
|
|
737
|
+
tabbableOptions: r.tabbableOptions,
|
|
738
|
+
delayInitialFocus: r.delayInitialFocus
|
|
739
|
+
}));
|
|
740
|
+
}
|
|
741
|
+
return we(() => {
|
|
742
|
+
Fe(() => r.active, (s) => {
|
|
743
|
+
s && c.value ? n().activate() : a && (a.deactivate(), (!c.value || c.value.nodeType === Node.COMMENT_NODE) && (a = null));
|
|
744
|
+
}, { immediate: !0, flush: "post" });
|
|
745
|
+
}), Te(() => {
|
|
746
|
+
a && a.deactivate(), a = null;
|
|
747
|
+
}), {
|
|
748
|
+
activate() {
|
|
749
|
+
n().activate();
|
|
750
|
+
},
|
|
751
|
+
deactivate() {
|
|
752
|
+
a && a.deactivate();
|
|
753
|
+
},
|
|
754
|
+
renderImpl() {
|
|
755
|
+
if (!e.default)
|
|
756
|
+
return null;
|
|
757
|
+
const s = e.default().filter((p) => p.type !== Ne);
|
|
758
|
+
return !s || !s.length || s.length > 1 ? (console.error("[focus-trap-vue]: FocusTrap requires exactly one child."), s) : ke(s[0], { ref: u });
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
}), M = (r) => {
|
|
763
|
+
r.preventDefault(), r.stopPropagation(), r.stopImmediatePropagation();
|
|
764
|
+
}, it = ({
|
|
765
|
+
getNextElement: r,
|
|
766
|
+
getFirstElement: e,
|
|
767
|
+
getLastElement: t,
|
|
768
|
+
close: a,
|
|
769
|
+
disableSpaceToClick: u,
|
|
770
|
+
keepOpenedOnTab: c
|
|
771
|
+
}) => {
|
|
772
|
+
const n = le(null), s = () => {
|
|
773
|
+
};
|
|
774
|
+
let b = s;
|
|
775
|
+
const p = () => {
|
|
776
|
+
n.value = null, b = s;
|
|
777
|
+
}, g = (m) => {
|
|
778
|
+
n.value = m.index, b = m.onClick;
|
|
779
|
+
}, T = (m) => {
|
|
780
|
+
g(r(n.value, m));
|
|
781
|
+
}, N = () => {
|
|
782
|
+
p(), a();
|
|
783
|
+
};
|
|
784
|
+
return {
|
|
785
|
+
onKeydown: (m) => {
|
|
786
|
+
switch (m.code) {
|
|
787
|
+
case "ArrowDown":
|
|
788
|
+
M(m), T(1);
|
|
789
|
+
break;
|
|
790
|
+
case "ArrowUp":
|
|
791
|
+
M(m), T(-1);
|
|
792
|
+
break;
|
|
793
|
+
case "Enter":
|
|
794
|
+
case "Space": {
|
|
795
|
+
const L = m.code === "Enter", j = m.code === "Space";
|
|
796
|
+
n.value !== null && (L || j && !u) && (M(m), b());
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
case "Home":
|
|
800
|
+
e && g(e());
|
|
801
|
+
break;
|
|
802
|
+
case "End":
|
|
803
|
+
t && g(t());
|
|
804
|
+
break;
|
|
805
|
+
case "Escape":
|
|
806
|
+
M(m), N();
|
|
807
|
+
break;
|
|
808
|
+
case "Tab":
|
|
809
|
+
c || N();
|
|
810
|
+
break;
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
currentIndex: Ee(n),
|
|
814
|
+
resetNavigation: p,
|
|
815
|
+
setElement: g
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
export {
|
|
819
|
+
nt as F,
|
|
820
|
+
it as u
|
|
821
|
+
};
|