@knime/jsonforms 1.19.6 → 1.20.1
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 +28 -0
- package/dist/{AnyOfTwinlist-DXjbNRLq.js → AnyOfTwinlist-CosNPUKG.js} +1 -1
- package/dist/{Checkbox-CZIoPAZU.js → Checkbox-BLHyWo4X.js} +1 -1
- package/dist/{CheckboxControl-D6LP2SAg.js → CheckboxControl-DyBcYCFe.js} +1 -1
- package/dist/{CheckboxesControl-D9DA7-T0.js → CheckboxesControl-DqcN6RcZ.js} +2 -2
- package/dist/{ColorControl-rCN_X6Wk.js → ColorControl-CPklP_Ox.js} +1 -1
- package/dist/{ColorPreviewControl-Dv7_mc6t.js → ColorPreviewControl-BhbI9XDV.js} +1 -1
- package/dist/{ComboBoxControl-DUaaxMZ_.js → ComboBoxControl-DR9x8i0b.js} +8 -8
- package/dist/{DateControl-5AuxnnvM.js → DateControl-DJxV5wzs.js} +1 -1
- package/dist/DateTimeControl-CoNsGbev.js +44 -0
- package/dist/{DateTimeFormatPickerControl-CbLnDDbr.js → DateTimeFormatPickerControl-BmtxQjzI.js} +1 -1
- package/dist/{DateTimeFormatPickerWithTypeControl-BBpPB5TM.js → DateTimeFormatPickerWithTypeControl-CK7LsO-R.js} +12 -12
- package/dist/{DropdownControl-2UdsfufQ.js → DropdownControl-nLA0kshc.js} +5 -5
- package/dist/ExecutorCoresControl-BgB0R_Xv.js +42 -0
- package/dist/ExecutorMemoryControl-Ck5naUl2.js +41 -0
- package/dist/FileUploadControl-CByhtwi1.js +197 -0
- package/dist/GridSelectionControl-8g--blrX.js +115 -0
- package/dist/{HorizontalLayout-ao9JZxiP.js → HorizontalLayout-Bc4F2xJR.js} +6 -6
- package/dist/InputField-Gw6K93vY.js +148 -0
- package/dist/{IntegerControl-wq8pma-E.js → IntegerControl-CAh031mO.js} +1 -1
- package/dist/{IntervalControl-DuI-4Y1d.js → IntervalControl-ocjzEBto.js} +168 -184
- package/dist/LinkControl-BML6cXj-.js +35 -0
- package/dist/LoadingDropdown.vue_vue_type_script_setup_true_lang-C2sH3IaG.js +57 -0
- package/dist/{LoadingIcon-BhelL9SM.js → LoadingIcon-B0S8ig5H.js} +1 -1
- package/dist/{ManualTwinlistControl-rP4L1RP6.js → ManualTwinlistControl-BdbrjZtS.js} +4 -4
- package/dist/{MultiSelectListBoxControl-iUqimLmu.js → MultiSelectListBoxControl-0M1iLfXZ.js} +2 -2
- package/dist/{MultimodeTwinlistControl-DTuLtZRx.js → MultimodeTwinlistControl-aL0Jr_Hp.js} +19 -20
- package/dist/{MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_0aa76d2b_lang-DhQuoNrM.js → MultimodeTwinlistControl.vue_vue_type_style_index_0_scoped_0aa76d2b_lang-C61plPNM.js} +2 -2
- package/dist/{MultiselectListBox-DijeK4wH.js → MultiselectListBox-BJqQv0AT.js} +5 -5
- package/dist/{NameFilter-C1_u0chZ.js → NameFilter-DvoXjvd8.js} +1 -1
- package/dist/{NumberControl-BYvfrBJs.js → NumberControl-BEYR3aHU.js} +1 -1
- package/dist/{NumberControlBase.vue_vue_type_script_setup_true_lang-DBbHZCg_.js → NumberControlBase.vue_vue_type_script_setup_true_lang-CSwuzJVa.js} +2 -2
- package/dist/{OneOfDropdown-BcqrG6U3.js → OneOfDropdown-Bg1JOuCZ.js} +1 -1
- package/dist/RadioButtonsWithDescriptionControl-Cmzn6X0W.js +57 -0
- package/dist/{RadioControl-BNB_hYVd.js → RadioControl-D4invwra.js} +2 -2
- package/dist/{RadioControlBase.vue_vue_type_script_setup_true_lang-C7JiVgxq.js → RadioControlBase.vue_vue_type_script_setup_true_lang-CuOORFSE.js} +2 -2
- package/dist/ResourceControlBase-BCx6cBBz.js +158 -0
- package/dist/{RichTextControl-BIjtuTf7.js → RichTextControl-TbANBneT.js} +2059 -1991
- package/dist/{SectionHeading-CUxdd2GX.js → SectionHeading-DoNDREK2.js} +1 -1
- package/dist/{SectionLayout-NqTBT8Al.js → SectionLayout-Dsd4wFck.js} +3 -3
- package/dist/SettingsSubPanel-sQPONy-U.js +5 -0
- package/dist/{SettingsSubPanelLayout-Biu_QPw1.js → SettingsSubPanelLayout-DbYqmGOS.js} +7 -7
- package/dist/{SimpleButtonControl-B0cnKTy4.js → SimpleButtonControl-DhM4t6v3.js} +6 -6
- package/dist/SimpleButtonControl.vue_vue_type_style_index_0_scoped_17a4a240_lang-DAdzHTim.js +26176 -0
- package/dist/{SimpleTwinlistControl-BIIN8GzH.js → SimpleTwinlistControl-Chay0D48.js} +2 -2
- package/dist/{SingleSelectControl-GbRcLm19.js → SingleSelectControl-BRfqeLOh.js} +2 -2
- package/dist/{SingleSelectListBoxControl-DkRfB8oZ.js → SingleSelectListBoxControl-DyDspddM.js} +5 -5
- package/dist/{SortListControl-BTS1lJOo.js → SortListControl-DX0uhRfk.js} +104 -118
- package/dist/{StyledListItem-DBa0VNHX.js → StyledListItem-B_FaDixp.js} +1 -1
- package/dist/TeamAndSpacesControl-CVGPGpqd.js +64 -0
- package/dist/TeamResourceControl-DD-USgie.js +38 -0
- package/dist/{TextAreaControl-DrABn8Uh.js → TextAreaControl-BCIrrOzR.js} +1 -1
- package/dist/{TextControl-CHyUjofE.js → TextControl-B_2oeFoq.js} +1 -1
- package/dist/TextControl.vue_vue_type_script_setup_true_lang-CuCBV4pA.js +45 -0
- package/dist/{TimeControl-B4oVEJCX.js → TimeControl-CeL2KxIB.js} +1 -1
- package/dist/TimePartInput-BbHxGv7L.js +254 -0
- package/dist/TimeframesControl-BBUDxMaB.js +87 -0
- package/dist/Tooltip-B5O8iOuG.js +24 -0
- package/dist/{TwinlistControlBase-CiK7yseq.js → TwinlistControlBase--CFSodU_.js} +3 -3
- package/dist/{TwinlistLoadingInfo-x51VCOej.js → TwinlistLoadingInfo-aB5QCSFX.js} +18 -18
- package/dist/{TypedStringFilter-DC6B-Fds.js → TypedStringFilter-BjyKvhn1.js} +1 -1
- package/dist/{ValueSwitch-ChY5YK2o.js → ValueSwitch-DYxCMQ9c.js} +4 -4
- package/dist/{ValueSwitchControl-CJdAUIwq.js → ValueSwitchControl-CQkiPcwC.js} +1 -1
- package/dist/{VerticalLayout-DWbD5oCa.js → VerticalLayout-DygOb7L9.js} +2 -2
- package/dist/{VerticalLayoutBase-COwlULuo.js → VerticalLayoutBase-Dq_p4WmZ.js} +1 -1
- package/dist/{ZonedDateTimeControl-CLiwgCKR.js → ZonedDateTimeControl-CKyKzTtF.js} +2 -2
- package/dist/_Uint8Array-Boy5On8p.js +349 -0
- package/dist/_baseAssignValue-CG1hoqdJ.js +19 -0
- package/dist/{_baseEach-84mBqaP3.js → _baseEach-LxtQB6N-.js} +1 -1
- package/dist/_baseIteratee-BBGehgFZ.js +308 -0
- package/dist/floating-ui.vue-Bk6u3tWN.js +1060 -0
- package/dist/isArray-WzO_os3q.js +4 -0
- package/dist/knime-jsonforms.css +1 -1
- package/dist/knime-jsonforms.js +53 -51
- package/dist/{localTimeUtils-LXk5i7aP.js → localTimeUtils-C7kma5fB.js} +3163 -3553
- package/dist/src/JsonFormsDialog.vue.d.ts +2 -2
- package/dist/src/constants/inputFormats.d.ts +14 -0
- package/dist/src/higherOrderComponents/control/DescriptionPopover.vue.d.ts +6 -0
- package/dist/src/higherOrderComponents/control/index.d.ts +1 -0
- package/dist/src/higherOrderComponents/control/withDescription.d.ts +2 -0
- package/dist/src/layoutComponents/index.d.ts +2 -1
- package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayout.vue.d.ts +74 -0
- package/dist/src/layoutComponents/simpleArrayLayout/SimpleArrayLayoutItemControls.vue.d.ts +16 -0
- package/dist/src/renderers/defaultRenderers.d.ts +152 -3
- package/dist/src/renderers/executorCoresResourceRenderer.d.ts +1 -0
- package/dist/src/renderers/executorMemoryResourceRenderer.d.ts +1 -0
- package/dist/src/renderers/fileUploadRenderer.d.ts +1 -0
- package/dist/src/renderers/gridSelectionRenderer.d.ts +1 -0
- package/dist/src/renderers/linkRenderer.d.ts +69 -0
- package/dist/src/renderers/passwordRenderer.d.ts +1 -0
- package/dist/src/renderers/quantityRenderer.d.ts +1 -0
- package/dist/src/renderers/radioWithDescriptionRenderer.d.ts +69 -0
- package/dist/src/renderers/simpleArrayLayoutRenderer.d.ts +76 -0
- package/dist/src/renderers/sortListRenderer.d.ts +1 -3
- package/dist/src/renderers/teamAndSpaceDropdownRenderer.d.ts +3 -0
- package/dist/src/renderers/teamResourceRenderer.d.ts +1 -0
- package/dist/src/renderers/timeframesRenderer.d.ts +4 -0
- package/dist/src/renderers/usernameRenderer.d.ts +1 -0
- package/dist/src/types/ChoicesUiSchema.d.ts +13 -1
- package/dist/src/uiComponents/DateControl.vue.d.ts +1 -1
- package/dist/src/uiComponents/DateTimeControl.vue.d.ts +1 -1
- package/dist/src/uiComponents/FileUploadControl.vue.d.ts +6 -0
- package/dist/src/uiComponents/GridSelectionControl.vue.d.ts +9 -0
- package/dist/src/uiComponents/LinkControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/PasswordControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/QuantityControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/RadioButtonsWithDescriptionControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/SortListControl.vue.d.ts +1 -3
- package/dist/src/uiComponents/TeamAndSpacesControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/TimeControl.vue.d.ts +1 -1
- package/dist/src/uiComponents/TimeframesControl.vue.d.ts +8 -0
- package/dist/src/uiComponents/UsernameControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/configs/executionContexts.config.d.ts +29 -0
- package/dist/src/uiComponents/loading/types/LoadingDropdownProps.d.ts +2 -2
- package/dist/src/uiComponents/resourceControls/ExecutorCoresControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/resourceControls/ExecutorMemoryControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/resourceControls/ResourceControlBase.vue.d.ts +19 -0
- package/dist/src/uiComponents/resourceControls/SmallDonutChart.vue.d.ts +20 -0
- package/dist/src/uiComponents/resourceControls/TeamResourceControl.vue.d.ts +4 -0
- package/dist/src/uiComponents/richTextControl/RichTextControl.vue.d.ts +1 -3
- package/dist/testing.js +2602 -2589
- package/dist/toString-Bbm8o0hZ.js +25 -0
- package/dist/{useBuiltinValidations-BUVcN7lQ.js → useBuiltinValidations-zKGc6Pdt.js} +1 -1
- package/dist/useDropdownNavigation-EOwf_fL0.js +946 -0
- package/dist/{usePossibleValues-D16WFE9l.js → usePossibleValues-DhdKca4Z.js} +1 -1
- package/package.json +5 -5
- package/dist/DateTimeControl-DZjFx11V.js +0 -44
- package/dist/Label-Vxe-id5C.js +0 -218
- package/dist/LoadingDropdown.vue_vue_type_script_setup_true_lang-DGUZn4wH.js +0 -52
- package/dist/SectionHeading.vue_vue_type_style_index_0_scoped_2310b6b8_lang-CYe4TfJy.js +0 -25430
- package/dist/SettingsSubPanel-CO7Sguho.js +0 -5
- package/dist/TextControl.vue_vue_type_script_setup_true_lang-yTQu10VH.js +0 -45
- package/dist/_baseIteratee-CBFfQfHB.js +0 -640
- package/dist/floating-ui.vue-Fx4CxKut.js +0 -1057
- package/dist/toString-gvdOTqCo.js +0 -25
- package/dist/useDropdownNavigation-2Yhk7zes.js +0 -821
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
import { defineComponent as Te, ref as se, computed as Se, onMounted as Fe, watch as Ne, onUnmounted as Ee, Comment as ke, cloneVNode as Ae, readonly as Ie } from "vue";
|
|
2
|
+
var de = ["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] *)"], V = /* @__PURE__ */ de.join(","), fe = typeof Element > "u", R = fe ? function() {
|
|
3
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, q = !fe && Element.prototype.getRootNode ? function(n) {
|
|
4
|
+
var e;
|
|
5
|
+
return n == null || (e = n.getRootNode) === null || e === void 0 ? void 0 : e.call(n);
|
|
6
|
+
} : function(n) {
|
|
7
|
+
return n?.ownerDocument;
|
|
8
|
+
}, H = 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", r = 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]") : H(e.parentNode));
|
|
14
|
+
return r;
|
|
15
|
+
}, De = 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
|
+
}, ve = function(e, t, a) {
|
|
19
|
+
if (H(e))
|
|
20
|
+
return [];
|
|
21
|
+
var u = Array.prototype.slice.apply(e.querySelectorAll(V));
|
|
22
|
+
return t && R.call(e, V) && u.unshift(e), u = u.filter(a), u;
|
|
23
|
+
}, U = function(e, t, a) {
|
|
24
|
+
for (var u = [], c = Array.from(e); c.length; ) {
|
|
25
|
+
var r = c.shift();
|
|
26
|
+
if (!H(r, !1))
|
|
27
|
+
if (r.tagName === "SLOT") {
|
|
28
|
+
var s = r.assignedElements(), b = s.length ? s : r.children, m = U(b, !0, a);
|
|
29
|
+
a.flatten ? u.push.apply(u, m) : u.push({
|
|
30
|
+
scopeParent: r,
|
|
31
|
+
candidates: m
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
var T = R.call(r, V);
|
|
35
|
+
T && a.filter(r) && (t || !e.includes(r)) && u.push(r);
|
|
36
|
+
var S = r.shadowRoot || // check for an undisclosed shadow
|
|
37
|
+
typeof a.getShadowRoot == "function" && a.getShadowRoot(r), E = !H(S, !1) && (!a.shadowRootFilter || a.shadowRootFilter(r));
|
|
38
|
+
if (S && E) {
|
|
39
|
+
var D = U(S === !0 ? r.children : S.children, !0, a);
|
|
40
|
+
a.flatten ? u.push.apply(u, D) : u.push({
|
|
41
|
+
scopeParent: r,
|
|
42
|
+
candidates: D
|
|
43
|
+
});
|
|
44
|
+
} else
|
|
45
|
+
c.unshift.apply(c, r.children);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return u;
|
|
49
|
+
}, be = function(e) {
|
|
50
|
+
return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
|
|
51
|
+
}, C = function(e) {
|
|
52
|
+
if (!e)
|
|
53
|
+
throw new Error("No node provided");
|
|
54
|
+
return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || De(e)) && !be(e) ? 0 : e.tabIndex;
|
|
55
|
+
}, Oe = function(e, t) {
|
|
56
|
+
var a = C(e);
|
|
57
|
+
return a < 0 && t && !be(e) ? 0 : a;
|
|
58
|
+
}, Ce = function(e, t) {
|
|
59
|
+
return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
|
|
60
|
+
}, pe = function(e) {
|
|
61
|
+
return e.tagName === "INPUT";
|
|
62
|
+
}, Re = function(e) {
|
|
63
|
+
return pe(e) && e.type === "hidden";
|
|
64
|
+
}, Pe = 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
|
+
}, xe = 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
|
+
}, je = function(e) {
|
|
74
|
+
if (!e.name)
|
|
75
|
+
return !0;
|
|
76
|
+
var t = e.form || q(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 (r) {
|
|
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", r.message), !1;
|
|
86
|
+
}
|
|
87
|
+
var c = xe(u, e.form);
|
|
88
|
+
return !c || c === e;
|
|
89
|
+
}, Be = function(e) {
|
|
90
|
+
return pe(e) && e.type === "radio";
|
|
91
|
+
}, Le = function(e) {
|
|
92
|
+
return Be(e) && !je(e);
|
|
93
|
+
}, Ke = function(e) {
|
|
94
|
+
var t, a = e && q(e), u = (t = a) === null || t === void 0 ? void 0 : t.host, c = !1;
|
|
95
|
+
if (a && a !== e) {
|
|
96
|
+
var r, s, b;
|
|
97
|
+
for (c = !!((r = u) !== null && r !== void 0 && (s = r.ownerDocument) !== null && s !== void 0 && s.contains(u) || e != null && (b = e.ownerDocument) !== null && b !== void 0 && b.contains(e)); !c && u; ) {
|
|
98
|
+
var m, T, S;
|
|
99
|
+
a = q(u), u = (m = a) === null || m === void 0 ? void 0 : m.host, c = !!((T = u) !== null && T !== void 0 && (S = T.ownerDocument) !== null && S !== void 0 && S.contains(u));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return c;
|
|
103
|
+
}, ie = function(e) {
|
|
104
|
+
var t = e.getBoundingClientRect(), a = t.width, u = t.height;
|
|
105
|
+
return a === 0 && u === 0;
|
|
106
|
+
}, Me = 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 r = R.call(e, "details>summary:first-of-type"), s = r ? e.parentElement : e;
|
|
127
|
+
if (R.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 m = e.parentElement, T = q(e);
|
|
135
|
+
if (m && !m.shadowRoot && u(m) === !0)
|
|
136
|
+
return ie(e);
|
|
137
|
+
e.assignedSlot ? e = e.assignedSlot : !m && T !== e.ownerDocument ? e = T.host : e = m;
|
|
138
|
+
}
|
|
139
|
+
e = b;
|
|
140
|
+
}
|
|
141
|
+
if (Ke(e))
|
|
142
|
+
return !e.getClientRects().length;
|
|
143
|
+
if (a !== "legacy-full")
|
|
144
|
+
return !0;
|
|
145
|
+
} else if (a === "non-zero-area")
|
|
146
|
+
return ie(e);
|
|
147
|
+
return !1;
|
|
148
|
+
}, _e = 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 R.call(t, "fieldset[disabled] *") ? !0 : !u.contains(e);
|
|
156
|
+
}
|
|
157
|
+
return !0;
|
|
158
|
+
}
|
|
159
|
+
t = t.parentElement;
|
|
160
|
+
}
|
|
161
|
+
return !1;
|
|
162
|
+
}, W = function(e, t) {
|
|
163
|
+
return !(t.disabled || Re(t) || Me(t, e) || // For a details element with a summary, the summary element gets the focus
|
|
164
|
+
Pe(t) || _e(t));
|
|
165
|
+
}, J = function(e, t) {
|
|
166
|
+
return !(Le(t) || C(t) < 0 || !W(e, t));
|
|
167
|
+
}, Ge = function(e) {
|
|
168
|
+
var t = parseInt(e.getAttribute("tabindex"), 10);
|
|
169
|
+
return !!(isNaN(t) || t >= 0);
|
|
170
|
+
}, he = function(e) {
|
|
171
|
+
var t = [], a = [];
|
|
172
|
+
return e.forEach(function(u, c) {
|
|
173
|
+
var r = !!u.scopeParent, s = r ? u.scopeParent : u, b = Oe(s, r), m = r ? he(u.candidates) : s;
|
|
174
|
+
b === 0 ? r ? t.push.apply(t, m) : t.push(s) : a.push({
|
|
175
|
+
documentOrder: c,
|
|
176
|
+
tabIndex: b,
|
|
177
|
+
item: u,
|
|
178
|
+
isScope: r,
|
|
179
|
+
content: m
|
|
180
|
+
});
|
|
181
|
+
}), a.sort(Ce).reduce(function(u, c) {
|
|
182
|
+
return c.isScope ? u.push.apply(u, c.content) : u.push(c.content), u;
|
|
183
|
+
}, []).concat(t);
|
|
184
|
+
}, Ve = function(e, t) {
|
|
185
|
+
t = t || {};
|
|
186
|
+
var a;
|
|
187
|
+
return t.getShadowRoot ? a = U([e], t.includeContainer, {
|
|
188
|
+
filter: J.bind(null, t),
|
|
189
|
+
flatten: !1,
|
|
190
|
+
getShadowRoot: t.getShadowRoot,
|
|
191
|
+
shadowRootFilter: Ge
|
|
192
|
+
}) : a = ve(e, t.includeContainer, J.bind(null, t)), he(a);
|
|
193
|
+
}, qe = function(e, t) {
|
|
194
|
+
t = t || {};
|
|
195
|
+
var a;
|
|
196
|
+
return t.getShadowRoot ? a = U([e], t.includeContainer, {
|
|
197
|
+
filter: W.bind(null, t),
|
|
198
|
+
flatten: !0,
|
|
199
|
+
getShadowRoot: t.getShadowRoot
|
|
200
|
+
}) : a = ve(e, t.includeContainer, W.bind(null, t)), a;
|
|
201
|
+
}, P = function(e, t) {
|
|
202
|
+
if (t = t || {}, !e)
|
|
203
|
+
throw new Error("No node provided");
|
|
204
|
+
return R.call(e, V) === !1 ? !1 : J(t, e);
|
|
205
|
+
}, He = /* @__PURE__ */ de.concat("iframe:not([inert]):not([inert] *)").join(","), X = function(e, t) {
|
|
206
|
+
if (t = t || {}, !e)
|
|
207
|
+
throw new Error("No node provided");
|
|
208
|
+
return R.call(e, He) === !1 ? !1 : W(t, e);
|
|
209
|
+
};
|
|
210
|
+
function Q(n, e) {
|
|
211
|
+
(e == null || e > n.length) && (e = n.length);
|
|
212
|
+
for (var t = 0, a = Array(e); t < e; t++) a[t] = n[t];
|
|
213
|
+
return a;
|
|
214
|
+
}
|
|
215
|
+
function Ue(n) {
|
|
216
|
+
if (Array.isArray(n)) return Q(n);
|
|
217
|
+
}
|
|
218
|
+
function oe(n, e) {
|
|
219
|
+
var t = typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"];
|
|
220
|
+
if (!t) {
|
|
221
|
+
if (Array.isArray(n) || (t = ye(n)) || e) {
|
|
222
|
+
t && (n = t);
|
|
223
|
+
var a = 0, u = function() {
|
|
224
|
+
};
|
|
225
|
+
return {
|
|
226
|
+
s: u,
|
|
227
|
+
n: function() {
|
|
228
|
+
return a >= n.length ? {
|
|
229
|
+
done: !0
|
|
230
|
+
} : {
|
|
231
|
+
done: !1,
|
|
232
|
+
value: n[a++]
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
e: function(b) {
|
|
236
|
+
throw b;
|
|
237
|
+
},
|
|
238
|
+
f: u
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
242
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
243
|
+
}
|
|
244
|
+
var c, r = !0, s = !1;
|
|
245
|
+
return {
|
|
246
|
+
s: function() {
|
|
247
|
+
t = t.call(n);
|
|
248
|
+
},
|
|
249
|
+
n: function() {
|
|
250
|
+
var b = t.next();
|
|
251
|
+
return r = b.done, b;
|
|
252
|
+
},
|
|
253
|
+
e: function(b) {
|
|
254
|
+
s = !0, c = b;
|
|
255
|
+
},
|
|
256
|
+
f: function() {
|
|
257
|
+
try {
|
|
258
|
+
r || t.return == null || t.return();
|
|
259
|
+
} finally {
|
|
260
|
+
if (s) throw c;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function We(n, e, t) {
|
|
266
|
+
return (e = Xe(e)) in n ? Object.defineProperty(n, e, {
|
|
267
|
+
value: t,
|
|
268
|
+
enumerable: !0,
|
|
269
|
+
configurable: !0,
|
|
270
|
+
writable: !0
|
|
271
|
+
}) : n[e] = t, n;
|
|
272
|
+
}
|
|
273
|
+
function Ye(n) {
|
|
274
|
+
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n);
|
|
275
|
+
}
|
|
276
|
+
function Ze() {
|
|
277
|
+
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
278
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
279
|
+
}
|
|
280
|
+
function ue(n, e) {
|
|
281
|
+
var t = Object.keys(n);
|
|
282
|
+
if (Object.getOwnPropertySymbols) {
|
|
283
|
+
var a = Object.getOwnPropertySymbols(n);
|
|
284
|
+
e && (a = a.filter(function(u) {
|
|
285
|
+
return Object.getOwnPropertyDescriptor(n, u).enumerable;
|
|
286
|
+
})), t.push.apply(t, a);
|
|
287
|
+
}
|
|
288
|
+
return t;
|
|
289
|
+
}
|
|
290
|
+
function ce(n) {
|
|
291
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
292
|
+
var t = arguments[e] != null ? arguments[e] : {};
|
|
293
|
+
e % 2 ? ue(Object(t), !0).forEach(function(a) {
|
|
294
|
+
We(n, a, t[a]);
|
|
295
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : ue(Object(t)).forEach(function(a) {
|
|
296
|
+
Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(t, a));
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return n;
|
|
300
|
+
}
|
|
301
|
+
function $e(n) {
|
|
302
|
+
return Ue(n) || Ye(n) || ye(n) || Ze();
|
|
303
|
+
}
|
|
304
|
+
function ze(n, e) {
|
|
305
|
+
if (typeof n != "object" || !n) return n;
|
|
306
|
+
var t = n[Symbol.toPrimitive];
|
|
307
|
+
if (t !== void 0) {
|
|
308
|
+
var a = t.call(n, e);
|
|
309
|
+
if (typeof a != "object") return a;
|
|
310
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
311
|
+
}
|
|
312
|
+
return (e === "string" ? String : Number)(n);
|
|
313
|
+
}
|
|
314
|
+
function Xe(n) {
|
|
315
|
+
var e = ze(n, "string");
|
|
316
|
+
return typeof e == "symbol" ? e : e + "";
|
|
317
|
+
}
|
|
318
|
+
function ye(n, e) {
|
|
319
|
+
if (n) {
|
|
320
|
+
if (typeof n == "string") return Q(n, e);
|
|
321
|
+
var t = {}.toString.call(n).slice(8, -1);
|
|
322
|
+
return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Q(n, e) : void 0;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
var A = {
|
|
326
|
+
// Returns the trap from the top of the stack.
|
|
327
|
+
getActiveTrap: function(e) {
|
|
328
|
+
return e?.length > 0 ? e[e.length - 1] : null;
|
|
329
|
+
},
|
|
330
|
+
// Pauses the currently active trap, then adds a new trap to the stack.
|
|
331
|
+
activateTrap: function(e, t) {
|
|
332
|
+
var a = A.getActiveTrap(e);
|
|
333
|
+
t !== a && A.pauseTrap(e);
|
|
334
|
+
var u = e.indexOf(t);
|
|
335
|
+
u === -1 || e.splice(u, 1), e.push(t);
|
|
336
|
+
},
|
|
337
|
+
// Removes the trap from the top of the stack, then unpauses the next trap down.
|
|
338
|
+
deactivateTrap: function(e, t) {
|
|
339
|
+
var a = e.indexOf(t);
|
|
340
|
+
a !== -1 && e.splice(a, 1), A.unpauseTrap(e);
|
|
341
|
+
},
|
|
342
|
+
// Pauses the trap at the top of the stack.
|
|
343
|
+
pauseTrap: function(e) {
|
|
344
|
+
var t = A.getActiveTrap(e);
|
|
345
|
+
t?._setPausedState(!0);
|
|
346
|
+
},
|
|
347
|
+
// Unpauses the trap at the top of the stack.
|
|
348
|
+
unpauseTrap: function(e) {
|
|
349
|
+
var t = A.getActiveTrap(e);
|
|
350
|
+
t && !t._isManuallyPaused() && t._setPausedState(!1);
|
|
351
|
+
}
|
|
352
|
+
}, Je = function(e) {
|
|
353
|
+
return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
|
|
354
|
+
}, Qe = function(e) {
|
|
355
|
+
return e?.key === "Escape" || e?.key === "Esc" || e?.keyCode === 27;
|
|
356
|
+
}, L = function(e) {
|
|
357
|
+
return e?.key === "Tab" || e?.keyCode === 9;
|
|
358
|
+
}, et = function(e) {
|
|
359
|
+
return L(e) && !e.shiftKey;
|
|
360
|
+
}, tt = function(e) {
|
|
361
|
+
return L(e) && e.shiftKey;
|
|
362
|
+
}, le = function(e) {
|
|
363
|
+
return setTimeout(e, 0);
|
|
364
|
+
}, B = function(e) {
|
|
365
|
+
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), u = 1; u < t; u++)
|
|
366
|
+
a[u - 1] = arguments[u];
|
|
367
|
+
return typeof e == "function" ? e.apply(void 0, a) : e;
|
|
368
|
+
}, _ = function(e) {
|
|
369
|
+
return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
|
|
370
|
+
}, at = [], rt = function(e, t) {
|
|
371
|
+
var a = t?.document || document, u = t?.trapStack || at, c = ce({
|
|
372
|
+
returnFocusOnDeactivate: !0,
|
|
373
|
+
escapeDeactivates: !0,
|
|
374
|
+
delayInitialFocus: !0,
|
|
375
|
+
isolateSubtrees: !1,
|
|
376
|
+
isKeyForward: et,
|
|
377
|
+
isKeyBackward: tt
|
|
378
|
+
}, t), r = {
|
|
379
|
+
// containers given to createFocusTrap()
|
|
380
|
+
/** @type {Array<HTMLElement>} */
|
|
381
|
+
containers: [],
|
|
382
|
+
// list of objects identifying tabbable nodes in `containers` in the trap
|
|
383
|
+
// NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
|
|
384
|
+
// is active, but the trap should never get to a state where there isn't at least one group
|
|
385
|
+
// with at least one tabbable node in it (that would lead to an error condition that would
|
|
386
|
+
// result in an error being thrown)
|
|
387
|
+
/** @type {Array<{
|
|
388
|
+
* container: HTMLElement,
|
|
389
|
+
* tabbableNodes: Array<HTMLElement>, // empty if none
|
|
390
|
+
* focusableNodes: Array<HTMLElement>, // empty if none
|
|
391
|
+
* posTabIndexesFound: boolean,
|
|
392
|
+
* firstTabbableNode: HTMLElement|undefined,
|
|
393
|
+
* lastTabbableNode: HTMLElement|undefined,
|
|
394
|
+
* firstDomTabbableNode: HTMLElement|undefined,
|
|
395
|
+
* lastDomTabbableNode: HTMLElement|undefined,
|
|
396
|
+
* nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
|
|
397
|
+
* }>}
|
|
398
|
+
*/
|
|
399
|
+
containerGroups: [],
|
|
400
|
+
// same order/length as `containers` list
|
|
401
|
+
// references to objects in `containerGroups`, but only those that actually have
|
|
402
|
+
// tabbable nodes in them
|
|
403
|
+
// NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
|
|
404
|
+
// the same length
|
|
405
|
+
tabbableGroups: [],
|
|
406
|
+
// references to nodes that are siblings to the ancestors of this trap's containers.
|
|
407
|
+
/** @type {Set<HTMLElement>} */
|
|
408
|
+
adjacentElements: /* @__PURE__ */ new Set(),
|
|
409
|
+
// references to nodes that were inert or aria-hidden before the trap was activated.
|
|
410
|
+
/** @type {Set<HTMLElement>} */
|
|
411
|
+
alreadySilent: /* @__PURE__ */ new Set(),
|
|
412
|
+
nodeFocusedBeforeActivation: null,
|
|
413
|
+
mostRecentlyFocusedNode: null,
|
|
414
|
+
active: !1,
|
|
415
|
+
paused: !1,
|
|
416
|
+
manuallyPaused: !1,
|
|
417
|
+
// timer ID for when delayInitialFocus is true and initial focus in this trap
|
|
418
|
+
// has been delayed during activation
|
|
419
|
+
delayInitialFocusTimer: void 0,
|
|
420
|
+
// the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
|
|
421
|
+
recentNavEvent: void 0
|
|
422
|
+
}, s, b = function(i, o, l) {
|
|
423
|
+
return i && i[o] !== void 0 ? i[o] : c[l || o];
|
|
424
|
+
}, m = function(i, o) {
|
|
425
|
+
var l = typeof o?.composedPath == "function" ? o.composedPath() : void 0;
|
|
426
|
+
return r.containerGroups.findIndex(function(v) {
|
|
427
|
+
var f = v.container, p = v.tabbableNodes;
|
|
428
|
+
return f.contains(i) || l?.includes(f) || p.find(function(d) {
|
|
429
|
+
return d === i;
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
}, T = function(i) {
|
|
433
|
+
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = o.hasFallback, v = l === void 0 ? !1 : l, f = o.params, p = f === void 0 ? [] : f, d = c[i];
|
|
434
|
+
if (typeof d == "function" && (d = d.apply(void 0, $e(p))), d === !0 && (d = void 0), !d) {
|
|
435
|
+
if (d === void 0 || d === !1)
|
|
436
|
+
return d;
|
|
437
|
+
throw new Error("`".concat(i, "` was specified but was not a node, or did not return a node"));
|
|
438
|
+
}
|
|
439
|
+
var h = d;
|
|
440
|
+
if (typeof d == "string") {
|
|
441
|
+
try {
|
|
442
|
+
h = a.querySelector(d);
|
|
443
|
+
} catch (y) {
|
|
444
|
+
throw new Error("`".concat(i, '` appears to be an invalid selector; error="').concat(y.message, '"'));
|
|
445
|
+
}
|
|
446
|
+
if (!h && !v)
|
|
447
|
+
throw new Error("`".concat(i, "` as selector refers to no known node"));
|
|
448
|
+
}
|
|
449
|
+
return h;
|
|
450
|
+
}, S = function() {
|
|
451
|
+
var i = T("initialFocus", {
|
|
452
|
+
hasFallback: !0
|
|
453
|
+
});
|
|
454
|
+
if (i === !1)
|
|
455
|
+
return !1;
|
|
456
|
+
if (i === void 0 || i && !X(i, c.tabbableOptions))
|
|
457
|
+
if (m(a.activeElement) >= 0)
|
|
458
|
+
i = a.activeElement;
|
|
459
|
+
else {
|
|
460
|
+
var o = r.tabbableGroups[0], l = o && o.firstTabbableNode;
|
|
461
|
+
i = l || T("fallbackFocus");
|
|
462
|
+
}
|
|
463
|
+
else i === null && (i = T("fallbackFocus"));
|
|
464
|
+
if (!i)
|
|
465
|
+
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
466
|
+
return i;
|
|
467
|
+
}, E = function() {
|
|
468
|
+
if (r.containerGroups = r.containers.map(function(i) {
|
|
469
|
+
var o = Ve(i, c.tabbableOptions), l = qe(i, c.tabbableOptions), v = o.length > 0 ? o[0] : void 0, f = o.length > 0 ? o[o.length - 1] : void 0, p = l.find(function(y) {
|
|
470
|
+
return P(y);
|
|
471
|
+
}), d = l.slice().reverse().find(function(y) {
|
|
472
|
+
return P(y);
|
|
473
|
+
}), h = !!o.find(function(y) {
|
|
474
|
+
return C(y) > 0;
|
|
475
|
+
});
|
|
476
|
+
return {
|
|
477
|
+
container: i,
|
|
478
|
+
tabbableNodes: o,
|
|
479
|
+
focusableNodes: l,
|
|
480
|
+
/** True if at least one node with positive `tabindex` was found in this container. */
|
|
481
|
+
posTabIndexesFound: h,
|
|
482
|
+
/** First tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
483
|
+
firstTabbableNode: v,
|
|
484
|
+
/** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
|
|
485
|
+
lastTabbableNode: f,
|
|
486
|
+
// NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
|
|
487
|
+
// would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
|
488
|
+
// because that API doesn't work with Shadow DOM as well as it should (@see
|
|
489
|
+
// https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
|
|
490
|
+
// to address an edge case related to positive tabindex support, this seems like a much easier,
|
|
491
|
+
// "close enough most of the time" alternative for positive tabindexes which should generally
|
|
492
|
+
// be avoided anyway...
|
|
493
|
+
/** First tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
494
|
+
firstDomTabbableNode: p,
|
|
495
|
+
/** Last tabbable node in container, __DOM__ order; `undefined` if none. */
|
|
496
|
+
lastDomTabbableNode: d,
|
|
497
|
+
/**
|
|
498
|
+
* Finds the __tabbable__ node that follows the given node in the specified direction,
|
|
499
|
+
* in this container, if any.
|
|
500
|
+
* @param {HTMLElement} node
|
|
501
|
+
* @param {boolean} [forward] True if going in forward tab order; false if going
|
|
502
|
+
* in reverse.
|
|
503
|
+
* @returns {HTMLElement|undefined} The next tabbable node, if any.
|
|
504
|
+
*/
|
|
505
|
+
nextTabbableNode: function(F) {
|
|
506
|
+
var k = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, N = o.indexOf(F);
|
|
507
|
+
return N < 0 ? k ? l.slice(l.indexOf(F) + 1).find(function(O) {
|
|
508
|
+
return P(O);
|
|
509
|
+
}) : l.slice(0, l.indexOf(F)).reverse().find(function(O) {
|
|
510
|
+
return P(O);
|
|
511
|
+
}) : o[N + (k ? 1 : -1)];
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
}), r.tabbableGroups = r.containerGroups.filter(function(i) {
|
|
515
|
+
return i.tabbableNodes.length > 0;
|
|
516
|
+
}), r.tabbableGroups.length <= 0 && !T("fallbackFocus"))
|
|
517
|
+
throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
518
|
+
if (r.containerGroups.find(function(i) {
|
|
519
|
+
return i.posTabIndexesFound;
|
|
520
|
+
}) && r.containerGroups.length > 1)
|
|
521
|
+
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.");
|
|
522
|
+
}, D = function(i) {
|
|
523
|
+
var o = i.activeElement;
|
|
524
|
+
if (o)
|
|
525
|
+
return o.shadowRoot && o.shadowRoot.activeElement !== null ? D(o.shadowRoot) : o;
|
|
526
|
+
}, w = function(i) {
|
|
527
|
+
if (i !== !1 && i !== D(document)) {
|
|
528
|
+
if (!i || !i.focus) {
|
|
529
|
+
w(S());
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
i.focus({
|
|
533
|
+
preventScroll: !!c.preventScroll
|
|
534
|
+
}), r.mostRecentlyFocusedNode = i, Je(i) && i.select();
|
|
535
|
+
}
|
|
536
|
+
}, K = function(i) {
|
|
537
|
+
var o = T("setReturnFocus", {
|
|
538
|
+
params: [i]
|
|
539
|
+
});
|
|
540
|
+
return o || (o === !1 ? !1 : i);
|
|
541
|
+
}, M = function(i) {
|
|
542
|
+
var o = i.target, l = i.event, v = i.isBackward, f = v === void 0 ? !1 : v;
|
|
543
|
+
o = o || _(l), E();
|
|
544
|
+
var p = null;
|
|
545
|
+
if (r.tabbableGroups.length > 0) {
|
|
546
|
+
var d = m(o, l), h = d >= 0 ? r.containerGroups[d] : void 0;
|
|
547
|
+
if (d < 0)
|
|
548
|
+
f ? p = r.tabbableGroups[r.tabbableGroups.length - 1].lastTabbableNode : p = r.tabbableGroups[0].firstTabbableNode;
|
|
549
|
+
else if (f) {
|
|
550
|
+
var y = r.tabbableGroups.findIndex(function($) {
|
|
551
|
+
var z = $.firstTabbableNode;
|
|
552
|
+
return o === z;
|
|
553
|
+
});
|
|
554
|
+
if (y < 0 && (h.container === o || X(o, c.tabbableOptions) && !P(o, c.tabbableOptions) && !h.nextTabbableNode(o, !1)) && (y = d), y >= 0) {
|
|
555
|
+
var F = y === 0 ? r.tabbableGroups.length - 1 : y - 1, k = r.tabbableGroups[F];
|
|
556
|
+
p = C(o) >= 0 ? k.lastTabbableNode : k.lastDomTabbableNode;
|
|
557
|
+
} else L(l) || (p = h.nextTabbableNode(o, !1));
|
|
558
|
+
} else {
|
|
559
|
+
var N = r.tabbableGroups.findIndex(function($) {
|
|
560
|
+
var z = $.lastTabbableNode;
|
|
561
|
+
return o === z;
|
|
562
|
+
});
|
|
563
|
+
if (N < 0 && (h.container === o || X(o, c.tabbableOptions) && !P(o, c.tabbableOptions) && !h.nextTabbableNode(o)) && (N = d), N >= 0) {
|
|
564
|
+
var O = N === r.tabbableGroups.length - 1 ? 0 : N + 1, I = r.tabbableGroups[O];
|
|
565
|
+
p = C(o) >= 0 ? I.firstTabbableNode : I.firstDomTabbableNode;
|
|
566
|
+
} else L(l) || (p = h.nextTabbableNode(o));
|
|
567
|
+
}
|
|
568
|
+
} else
|
|
569
|
+
p = T("fallbackFocus");
|
|
570
|
+
return p;
|
|
571
|
+
}, x = function(i) {
|
|
572
|
+
var o = _(i);
|
|
573
|
+
if (!(m(o, i) >= 0)) {
|
|
574
|
+
if (B(c.clickOutsideDeactivates, i)) {
|
|
575
|
+
s.deactivate({
|
|
576
|
+
// NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
|
|
577
|
+
// which will result in the outside click setting focus to the node
|
|
578
|
+
// that was clicked (and if not focusable, to "nothing"); by setting
|
|
579
|
+
// `returnFocus: true`, we'll attempt to re-focus the node originally-focused
|
|
580
|
+
// on activation (or the configured `setReturnFocus` node), whether the
|
|
581
|
+
// outside click was on a focusable node or not
|
|
582
|
+
returnFocus: c.returnFocusOnDeactivate
|
|
583
|
+
});
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
B(c.allowOutsideClick, i) || i.preventDefault();
|
|
587
|
+
}
|
|
588
|
+
}, Y = function(i) {
|
|
589
|
+
var o = _(i), l = m(o, i) >= 0;
|
|
590
|
+
if (l || o instanceof Document)
|
|
591
|
+
l && (r.mostRecentlyFocusedNode = o);
|
|
592
|
+
else {
|
|
593
|
+
i.stopImmediatePropagation();
|
|
594
|
+
var v, f = !0;
|
|
595
|
+
if (r.mostRecentlyFocusedNode)
|
|
596
|
+
if (C(r.mostRecentlyFocusedNode) > 0) {
|
|
597
|
+
var p = m(r.mostRecentlyFocusedNode), d = r.containerGroups[p].tabbableNodes;
|
|
598
|
+
if (d.length > 0) {
|
|
599
|
+
var h = d.findIndex(function(y) {
|
|
600
|
+
return y === r.mostRecentlyFocusedNode;
|
|
601
|
+
});
|
|
602
|
+
h >= 0 && (c.isKeyForward(r.recentNavEvent) ? h + 1 < d.length && (v = d[h + 1], f = !1) : h - 1 >= 0 && (v = d[h - 1], f = !1));
|
|
603
|
+
}
|
|
604
|
+
} else
|
|
605
|
+
r.containerGroups.some(function(y) {
|
|
606
|
+
return y.tabbableNodes.some(function(F) {
|
|
607
|
+
return C(F) > 0;
|
|
608
|
+
});
|
|
609
|
+
}) || (f = !1);
|
|
610
|
+
else
|
|
611
|
+
f = !1;
|
|
612
|
+
f && (v = M({
|
|
613
|
+
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
614
|
+
// outside the trap causing the focus escape we're trying to fix)
|
|
615
|
+
target: r.mostRecentlyFocusedNode,
|
|
616
|
+
isBackward: c.isKeyBackward(r.recentNavEvent)
|
|
617
|
+
})), w(v || r.mostRecentlyFocusedNode || S());
|
|
618
|
+
}
|
|
619
|
+
r.recentNavEvent = void 0;
|
|
620
|
+
}, me = function(i) {
|
|
621
|
+
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
622
|
+
r.recentNavEvent = i;
|
|
623
|
+
var l = M({
|
|
624
|
+
event: i,
|
|
625
|
+
isBackward: o
|
|
626
|
+
});
|
|
627
|
+
l && (L(i) && i.preventDefault(), w(l));
|
|
628
|
+
}, ee = function(i) {
|
|
629
|
+
(c.isKeyForward(i) || c.isKeyBackward(i)) && me(i, c.isKeyBackward(i));
|
|
630
|
+
}, te = function(i) {
|
|
631
|
+
Qe(i) && B(c.escapeDeactivates, i) !== !1 && (i.preventDefault(), s.deactivate());
|
|
632
|
+
}, ae = function(i) {
|
|
633
|
+
var o = _(i);
|
|
634
|
+
m(o, i) >= 0 || B(c.clickOutsideDeactivates, i) || B(c.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
635
|
+
}, re = function() {
|
|
636
|
+
if (r.active)
|
|
637
|
+
return A.activateTrap(u, s), r.delayInitialFocusTimer = c.delayInitialFocus ? le(function() {
|
|
638
|
+
w(S());
|
|
639
|
+
}) : w(S()), a.addEventListener("focusin", Y, !0), a.addEventListener("mousedown", x, {
|
|
640
|
+
capture: !0,
|
|
641
|
+
passive: !1
|
|
642
|
+
}), a.addEventListener("touchstart", x, {
|
|
643
|
+
capture: !0,
|
|
644
|
+
passive: !1
|
|
645
|
+
}), a.addEventListener("click", ae, {
|
|
646
|
+
capture: !0,
|
|
647
|
+
passive: !1
|
|
648
|
+
}), a.addEventListener("keydown", ee, {
|
|
649
|
+
capture: !0,
|
|
650
|
+
passive: !1
|
|
651
|
+
}), a.addEventListener("keydown", te), s;
|
|
652
|
+
}, ge = function(i) {
|
|
653
|
+
r.active && !r.paused && s._setSubtreeIsolation(!1), r.adjacentElements.clear(), r.alreadySilent.clear();
|
|
654
|
+
var o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), v = oe(i), f;
|
|
655
|
+
try {
|
|
656
|
+
for (v.s(); !(f = v.n()).done; ) {
|
|
657
|
+
var p = f.value;
|
|
658
|
+
o.add(p);
|
|
659
|
+
for (var d = typeof ShadowRoot < "u" && p.getRootNode() instanceof ShadowRoot, h = p; h; ) {
|
|
660
|
+
o.add(h);
|
|
661
|
+
var y = h.parentElement, F = [];
|
|
662
|
+
y ? F = y.children : !y && d && (F = h.getRootNode().children, y = h.getRootNode().host, d = typeof ShadowRoot < "u" && y.getRootNode() instanceof ShadowRoot);
|
|
663
|
+
var k = oe(F), N;
|
|
664
|
+
try {
|
|
665
|
+
for (k.s(); !(N = k.n()).done; ) {
|
|
666
|
+
var O = N.value;
|
|
667
|
+
l.add(O);
|
|
668
|
+
}
|
|
669
|
+
} catch (I) {
|
|
670
|
+
k.e(I);
|
|
671
|
+
} finally {
|
|
672
|
+
k.f();
|
|
673
|
+
}
|
|
674
|
+
h = y;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
} catch (I) {
|
|
678
|
+
v.e(I);
|
|
679
|
+
} finally {
|
|
680
|
+
v.f();
|
|
681
|
+
}
|
|
682
|
+
o.forEach(function(I) {
|
|
683
|
+
l.delete(I);
|
|
684
|
+
}), r.adjacentElements = l;
|
|
685
|
+
}, ne = function() {
|
|
686
|
+
if (r.active)
|
|
687
|
+
return a.removeEventListener("focusin", Y, !0), a.removeEventListener("mousedown", x, !0), a.removeEventListener("touchstart", x, !0), a.removeEventListener("click", ae, !0), a.removeEventListener("keydown", ee, !0), a.removeEventListener("keydown", te), s;
|
|
688
|
+
}, we = function(i) {
|
|
689
|
+
var o = i.some(function(l) {
|
|
690
|
+
var v = Array.from(l.removedNodes);
|
|
691
|
+
return v.some(function(f) {
|
|
692
|
+
return f === r.mostRecentlyFocusedNode;
|
|
693
|
+
});
|
|
694
|
+
});
|
|
695
|
+
o && w(S());
|
|
696
|
+
}, Z = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(we) : void 0, j = function() {
|
|
697
|
+
Z && (Z.disconnect(), r.active && !r.paused && r.containers.map(function(i) {
|
|
698
|
+
Z.observe(i, {
|
|
699
|
+
subtree: !0,
|
|
700
|
+
childList: !0
|
|
701
|
+
});
|
|
702
|
+
}));
|
|
703
|
+
};
|
|
704
|
+
return s = {
|
|
705
|
+
get active() {
|
|
706
|
+
return r.active;
|
|
707
|
+
},
|
|
708
|
+
get paused() {
|
|
709
|
+
return r.paused;
|
|
710
|
+
},
|
|
711
|
+
activate: function(i) {
|
|
712
|
+
if (r.active)
|
|
713
|
+
return this;
|
|
714
|
+
var o = b(i, "onActivate"), l = b(i, "onPostActivate"), v = b(i, "checkCanFocusTrap"), f = A.getActiveTrap(u), p = !1;
|
|
715
|
+
if (f && !f.paused) {
|
|
716
|
+
var d;
|
|
717
|
+
(d = f._setSubtreeIsolation) === null || d === void 0 || d.call(f, !1), p = !0;
|
|
718
|
+
}
|
|
719
|
+
try {
|
|
720
|
+
v || E(), r.active = !0, r.paused = !1, r.nodeFocusedBeforeActivation = D(a), o?.();
|
|
721
|
+
var h = function() {
|
|
722
|
+
v && E(), re(), j(), c.isolateSubtrees && s._setSubtreeIsolation(!0), l?.();
|
|
723
|
+
};
|
|
724
|
+
if (v)
|
|
725
|
+
return v(r.containers.concat()).then(h, h), this;
|
|
726
|
+
h();
|
|
727
|
+
} catch (F) {
|
|
728
|
+
if (f === A.getActiveTrap(u) && p) {
|
|
729
|
+
var y;
|
|
730
|
+
(y = f._setSubtreeIsolation) === null || y === void 0 || y.call(f, !0);
|
|
731
|
+
}
|
|
732
|
+
throw F;
|
|
733
|
+
}
|
|
734
|
+
return this;
|
|
735
|
+
},
|
|
736
|
+
deactivate: function(i) {
|
|
737
|
+
if (!r.active)
|
|
738
|
+
return this;
|
|
739
|
+
var o = ce({
|
|
740
|
+
onDeactivate: c.onDeactivate,
|
|
741
|
+
onPostDeactivate: c.onPostDeactivate,
|
|
742
|
+
checkCanReturnFocus: c.checkCanReturnFocus
|
|
743
|
+
}, i);
|
|
744
|
+
clearTimeout(r.delayInitialFocusTimer), r.delayInitialFocusTimer = void 0, r.paused || s._setSubtreeIsolation(!1), r.alreadySilent.clear(), ne(), r.active = !1, r.paused = !1, j(), A.deactivateTrap(u, s);
|
|
745
|
+
var l = b(o, "onDeactivate"), v = b(o, "onPostDeactivate"), f = b(o, "checkCanReturnFocus"), p = b(o, "returnFocus", "returnFocusOnDeactivate");
|
|
746
|
+
l?.();
|
|
747
|
+
var d = function() {
|
|
748
|
+
le(function() {
|
|
749
|
+
p && w(K(r.nodeFocusedBeforeActivation)), v?.();
|
|
750
|
+
});
|
|
751
|
+
};
|
|
752
|
+
return p && f ? (f(K(r.nodeFocusedBeforeActivation)).then(d, d), this) : (d(), this);
|
|
753
|
+
},
|
|
754
|
+
pause: function(i) {
|
|
755
|
+
return r.active ? (r.manuallyPaused = !0, this._setPausedState(!0, i)) : this;
|
|
756
|
+
},
|
|
757
|
+
unpause: function(i) {
|
|
758
|
+
return r.active ? (r.manuallyPaused = !1, u[u.length - 1] !== this ? this : this._setPausedState(!1, i)) : this;
|
|
759
|
+
},
|
|
760
|
+
updateContainerElements: function(i) {
|
|
761
|
+
var o = [].concat(i).filter(Boolean);
|
|
762
|
+
return r.containers = o.map(function(l) {
|
|
763
|
+
return typeof l == "string" ? a.querySelector(l) : l;
|
|
764
|
+
}), c.isolateSubtrees && ge(r.containers), r.active && (E(), c.isolateSubtrees && !r.paused && s._setSubtreeIsolation(!0)), j(), this;
|
|
765
|
+
}
|
|
766
|
+
}, Object.defineProperties(s, {
|
|
767
|
+
_isManuallyPaused: {
|
|
768
|
+
value: function() {
|
|
769
|
+
return r.manuallyPaused;
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
_setPausedState: {
|
|
773
|
+
value: function(i, o) {
|
|
774
|
+
if (r.paused === i)
|
|
775
|
+
return this;
|
|
776
|
+
if (r.paused = i, i) {
|
|
777
|
+
var l = b(o, "onPause"), v = b(o, "onPostPause");
|
|
778
|
+
l?.(), ne(), j(), s._setSubtreeIsolation(!1), v?.();
|
|
779
|
+
} else {
|
|
780
|
+
var f = b(o, "onUnpause"), p = b(o, "onPostUnpause");
|
|
781
|
+
f?.(), s._setSubtreeIsolation(!0), E(), re(), j(), p?.();
|
|
782
|
+
}
|
|
783
|
+
return this;
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
_setSubtreeIsolation: {
|
|
787
|
+
value: function(i) {
|
|
788
|
+
c.isolateSubtrees && r.adjacentElements.forEach(function(o) {
|
|
789
|
+
var l;
|
|
790
|
+
i ? c.isolateSubtrees === "aria-hidden" ? ((o.ariaHidden === "true" || ((l = o.getAttribute("aria-hidden")) === null || l === void 0 ? void 0 : l.toLowerCase()) === "true") && r.alreadySilent.add(o), o.setAttribute("aria-hidden", "true")) : ((o.inert || o.hasAttribute("inert")) && r.alreadySilent.add(o), o.setAttribute("inert", !0)) : r.alreadySilent.has(o) || (c.isolateSubtrees === "aria-hidden" ? o.removeAttribute("aria-hidden") : o.removeAttribute("inert"));
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
}), s.updateContainerElements(e), s;
|
|
795
|
+
};
|
|
796
|
+
const nt = {
|
|
797
|
+
escapeDeactivates: {
|
|
798
|
+
type: Boolean,
|
|
799
|
+
default: !0
|
|
800
|
+
},
|
|
801
|
+
returnFocusOnDeactivate: {
|
|
802
|
+
type: Boolean,
|
|
803
|
+
default: !0
|
|
804
|
+
},
|
|
805
|
+
allowOutsideClick: {
|
|
806
|
+
type: [Boolean, Function],
|
|
807
|
+
default: !0
|
|
808
|
+
},
|
|
809
|
+
clickOutsideDeactivates: [Boolean, Function],
|
|
810
|
+
initialFocus: [String, Function, Boolean],
|
|
811
|
+
fallbackFocus: [String, Function],
|
|
812
|
+
checkCanFocusTrap: Function,
|
|
813
|
+
checkCanReturnFocus: Function,
|
|
814
|
+
delayInitialFocus: {
|
|
815
|
+
type: Boolean,
|
|
816
|
+
default: !0
|
|
817
|
+
},
|
|
818
|
+
document: Object,
|
|
819
|
+
preventScroll: Boolean,
|
|
820
|
+
setReturnFocus: [Object, String, Boolean, Function],
|
|
821
|
+
tabbableOptions: Object
|
|
822
|
+
}, ot = Te({
|
|
823
|
+
props: Object.assign({
|
|
824
|
+
active: {
|
|
825
|
+
// TODO: could be options for activate but what about the options for deactivating?
|
|
826
|
+
type: Boolean,
|
|
827
|
+
default: !0
|
|
828
|
+
}
|
|
829
|
+
}, nt),
|
|
830
|
+
emits: [
|
|
831
|
+
"update:active",
|
|
832
|
+
"activate",
|
|
833
|
+
"postActivate",
|
|
834
|
+
"deactivate",
|
|
835
|
+
"postDeactivate"
|
|
836
|
+
],
|
|
837
|
+
render() {
|
|
838
|
+
return this.renderImpl();
|
|
839
|
+
},
|
|
840
|
+
setup(n, { slots: e, emit: t }) {
|
|
841
|
+
let a;
|
|
842
|
+
const u = se(null), c = Se(() => {
|
|
843
|
+
const s = u.value;
|
|
844
|
+
return s && (s instanceof HTMLElement ? s : s.$el);
|
|
845
|
+
});
|
|
846
|
+
function r() {
|
|
847
|
+
return a || (a = rt(c.value, {
|
|
848
|
+
escapeDeactivates: n.escapeDeactivates,
|
|
849
|
+
allowOutsideClick: n.allowOutsideClick,
|
|
850
|
+
returnFocusOnDeactivate: n.returnFocusOnDeactivate,
|
|
851
|
+
clickOutsideDeactivates: n.clickOutsideDeactivates,
|
|
852
|
+
onActivate: () => {
|
|
853
|
+
t("update:active", !0), t("activate");
|
|
854
|
+
},
|
|
855
|
+
onDeactivate: () => {
|
|
856
|
+
t("update:active", !1), t("deactivate");
|
|
857
|
+
},
|
|
858
|
+
onPostActivate: () => t("postActivate"),
|
|
859
|
+
onPostDeactivate: () => t("postDeactivate"),
|
|
860
|
+
initialFocus: n.initialFocus,
|
|
861
|
+
fallbackFocus: n.fallbackFocus,
|
|
862
|
+
tabbableOptions: n.tabbableOptions,
|
|
863
|
+
delayInitialFocus: n.delayInitialFocus
|
|
864
|
+
}));
|
|
865
|
+
}
|
|
866
|
+
return Fe(() => {
|
|
867
|
+
Ne(() => n.active, (s) => {
|
|
868
|
+
s && c.value ? r().activate() : a && (a.deactivate(), (!c.value || c.value.nodeType === Node.COMMENT_NODE) && (a = null));
|
|
869
|
+
}, { immediate: !0, flush: "post" });
|
|
870
|
+
}), Ee(() => {
|
|
871
|
+
a && a.deactivate(), a = null;
|
|
872
|
+
}), {
|
|
873
|
+
activate() {
|
|
874
|
+
r().activate();
|
|
875
|
+
},
|
|
876
|
+
deactivate() {
|
|
877
|
+
a && a.deactivate();
|
|
878
|
+
},
|
|
879
|
+
renderImpl() {
|
|
880
|
+
if (!e.default)
|
|
881
|
+
return null;
|
|
882
|
+
const s = e.default().filter((m) => m.type !== ke);
|
|
883
|
+
return !s || !s.length || s.length > 1 ? (console.error("[focus-trap-vue]: FocusTrap requires exactly one child."), s) : Ae(s[0], { ref: u });
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
}), G = (n) => {
|
|
888
|
+
n.preventDefault(), n.stopPropagation(), n.stopImmediatePropagation();
|
|
889
|
+
}, ut = ({
|
|
890
|
+
getNextElement: n,
|
|
891
|
+
getFirstElement: e,
|
|
892
|
+
getLastElement: t,
|
|
893
|
+
close: a,
|
|
894
|
+
disableSpaceToClick: u,
|
|
895
|
+
keepOpenedOnTab: c
|
|
896
|
+
}) => {
|
|
897
|
+
const r = se(null), s = () => {
|
|
898
|
+
};
|
|
899
|
+
let b = s;
|
|
900
|
+
const m = () => {
|
|
901
|
+
r.value = null, b = s;
|
|
902
|
+
}, T = (w) => {
|
|
903
|
+
r.value = w.index, b = w.onClick;
|
|
904
|
+
}, S = (w) => {
|
|
905
|
+
T(n(r.value, w));
|
|
906
|
+
}, E = () => {
|
|
907
|
+
m(), a();
|
|
908
|
+
};
|
|
909
|
+
return {
|
|
910
|
+
onKeydown: (w) => {
|
|
911
|
+
switch (w.code) {
|
|
912
|
+
case "ArrowDown":
|
|
913
|
+
G(w), S(1);
|
|
914
|
+
break;
|
|
915
|
+
case "ArrowUp":
|
|
916
|
+
G(w), S(-1);
|
|
917
|
+
break;
|
|
918
|
+
case "Enter":
|
|
919
|
+
case "Space": {
|
|
920
|
+
const K = w.code === "Enter", M = w.code === "Space";
|
|
921
|
+
r.value !== null && (K || M && !u) && (G(w), b());
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
924
|
+
case "Home":
|
|
925
|
+
e && T(e());
|
|
926
|
+
break;
|
|
927
|
+
case "End":
|
|
928
|
+
t && T(t());
|
|
929
|
+
break;
|
|
930
|
+
case "Escape":
|
|
931
|
+
G(w), E();
|
|
932
|
+
break;
|
|
933
|
+
case "Tab":
|
|
934
|
+
c || E();
|
|
935
|
+
break;
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
currentIndex: Ie(r),
|
|
939
|
+
resetNavigation: m,
|
|
940
|
+
setElement: T
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
export {
|
|
944
|
+
ot as F,
|
|
945
|
+
ut as u
|
|
946
|
+
};
|