bitboss-ui 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
  2. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -0
  3. package/dist/index104.js +2 -2
  4. package/dist/index112.js +1 -1
  5. package/dist/index114.js +4 -4
  6. package/dist/index116.js +1 -1
  7. package/dist/index119.js.map +1 -1
  8. package/dist/index12.js +3 -3
  9. package/dist/index120.js +1 -1
  10. package/dist/index121.js +1 -1
  11. package/dist/index122.js +1 -1
  12. package/dist/index128.js +1 -1
  13. package/dist/index129.js +1 -1
  14. package/dist/index130.js +1 -1
  15. package/dist/index134.js +2 -2
  16. package/dist/index14.js +9 -8
  17. package/dist/index14.js.map +1 -1
  18. package/dist/index16.js +8 -8
  19. package/dist/index18.js +11 -11
  20. package/dist/index20.js +3 -3
  21. package/dist/index201.js +2 -295
  22. package/dist/index201.js.map +1 -1
  23. package/dist/index202.js +4 -16
  24. package/dist/index202.js.map +1 -1
  25. package/dist/index203.js +2 -16
  26. package/dist/index203.js.map +1 -1
  27. package/dist/index204.js +234 -18
  28. package/dist/index204.js.map +1 -1
  29. package/dist/index205.js +2 -20
  30. package/dist/index205.js.map +1 -1
  31. package/dist/index206.js +5 -29
  32. package/dist/index206.js.map +1 -1
  33. package/dist/index207.js +16 -8
  34. package/dist/index207.js.map +1 -1
  35. package/dist/index208.js +16 -2
  36. package/dist/index208.js.map +1 -1
  37. package/dist/index209.js +19 -2
  38. package/dist/index209.js.map +1 -1
  39. package/dist/index210.js +20 -4
  40. package/dist/index210.js.map +1 -1
  41. package/dist/index211.js +29 -2
  42. package/dist/index211.js.map +1 -1
  43. package/dist/index212.js +8 -3
  44. package/dist/index212.js.map +1 -1
  45. package/dist/index213.js +2 -35
  46. package/dist/index213.js.map +1 -1
  47. package/dist/index214.js +3 -6
  48. package/dist/index214.js.map +1 -1
  49. package/dist/index215.js +3 -121
  50. package/dist/index215.js.map +1 -1
  51. package/dist/index216.js +118 -131
  52. package/dist/index216.js.map +1 -1
  53. package/dist/index217.js +134 -2
  54. package/dist/index217.js.map +1 -1
  55. package/dist/index218.js +33 -172
  56. package/dist/index218.js.map +1 -1
  57. package/dist/index219.js +159 -353
  58. package/dist/index219.js.map +1 -1
  59. package/dist/index22.js +2 -2
  60. package/dist/index220.js +6 -373
  61. package/dist/index220.js.map +1 -1
  62. package/dist/index221.js +346 -213
  63. package/dist/index221.js.map +1 -1
  64. package/dist/index222.js +364 -70
  65. package/dist/index222.js.map +1 -1
  66. package/dist/index224.js +3 -3
  67. package/dist/index224.js.map +1 -1
  68. package/dist/index225.js +79 -3
  69. package/dist/index225.js.map +1 -1
  70. package/dist/index227.js +9 -8
  71. package/dist/index227.js.map +1 -1
  72. package/dist/index228.js +9 -23
  73. package/dist/index228.js.map +1 -1
  74. package/dist/index229.js +23 -6
  75. package/dist/index229.js.map +1 -1
  76. package/dist/index230.js +6 -17
  77. package/dist/index230.js.map +1 -1
  78. package/dist/index231.js +17 -79
  79. package/dist/index231.js.map +1 -1
  80. package/dist/index232.js +78 -5
  81. package/dist/index232.js.map +1 -1
  82. package/dist/index233.js +4 -2
  83. package/dist/index233.js.map +1 -1
  84. package/dist/index234.js +295 -2
  85. package/dist/index234.js.map +1 -1
  86. package/dist/index235.js +6 -2
  87. package/dist/index235.js.map +1 -1
  88. package/dist/index236.js +2 -2
  89. package/dist/index239.js +2 -4
  90. package/dist/index239.js.map +1 -1
  91. package/dist/index24.js.map +1 -1
  92. package/dist/index240.js +2 -2
  93. package/dist/index240.js.map +1 -1
  94. package/dist/index241.js +2 -5
  95. package/dist/index241.js.map +1 -1
  96. package/dist/index242.js +224 -69
  97. package/dist/index242.js.map +1 -1
  98. package/dist/index243.js +252 -429
  99. package/dist/index243.js.map +1 -1
  100. package/dist/index244.js +2 -89
  101. package/dist/index244.js.map +1 -1
  102. package/dist/index247.js +424 -189
  103. package/dist/index247.js.map +1 -1
  104. package/dist/index249.js +200 -224
  105. package/dist/index249.js.map +1 -1
  106. package/dist/index250.js +68 -257
  107. package/dist/index250.js.map +1 -1
  108. package/dist/index251.js +5 -2
  109. package/dist/index251.js.map +1 -1
  110. package/dist/index252.js +2 -15
  111. package/dist/index252.js.map +1 -1
  112. package/dist/index253.js +89 -4
  113. package/dist/index253.js.map +1 -1
  114. package/dist/index254.js +15 -4
  115. package/dist/index254.js.map +1 -1
  116. package/dist/index255.js +4 -61
  117. package/dist/index255.js.map +1 -1
  118. package/dist/index256.js +4 -2
  119. package/dist/index256.js.map +1 -1
  120. package/dist/index257.js +64 -0
  121. package/dist/index257.js.map +1 -0
  122. package/dist/index258.js +5 -0
  123. package/dist/index258.js.map +1 -0
  124. package/dist/index26.js +2 -2
  125. package/dist/index30.js +3 -3
  126. package/dist/index32.js +6 -6
  127. package/dist/index34.js +1 -1
  128. package/dist/index36.js +2 -2
  129. package/dist/index44.js +4 -4
  130. package/dist/index44.js.map +1 -1
  131. package/dist/index50.js +1 -1
  132. package/dist/index52.js +1 -1
  133. package/dist/index52.js.map +1 -1
  134. package/dist/index56.js +24 -18
  135. package/dist/index56.js.map +1 -1
  136. package/dist/index58.js +8 -8
  137. package/dist/index58.js.map +1 -1
  138. package/dist/index60.js +8 -8
  139. package/dist/index60.js.map +1 -1
  140. package/dist/index68.js +5 -5
  141. package/dist/index72.js +2 -2
  142. package/dist/index75.js +1 -1
  143. package/dist/index78.js +1 -1
  144. package/dist/index80.js +1 -1
  145. package/dist/index82.js +4 -4
  146. package/dist/style.css +1 -1
  147. package/package.json +2 -2
package/dist/index247.js CHANGED
@@ -1,203 +1,438 @@
1
+ import { isFocusable as G, tabbable as te, focusable as ae, isTabbable as T, getTabIndex as K } from "./index249.js";
1
2
  /*!
2
- * tabbable 6.2.0
3
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
3
+ * focus-trap 7.5.4
4
+ * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
4
5
  */
5
- var w = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], v = /* @__PURE__ */ w.join(","), T = typeof Element > "u", o = T ? function() {
6
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, b = !T && Element.prototype.getRootNode ? function(i) {
7
- var t;
8
- return i == null || (t = i.getRootNode) === null || t === void 0 ? void 0 : t.call(i);
9
- } : function(i) {
10
- return i == null ? void 0 : i.ownerDocument;
11
- }, h = function i(t, e) {
12
- var r;
13
- e === void 0 && (e = !0);
14
- var a = t == null || (r = t.getAttribute) === null || r === void 0 ? void 0 : r.call(t, "inert"), l = a === "" || a === "true", n = l || e && t && i(t.parentNode);
15
- return n;
16
- }, A = function(t) {
17
- var e, r = t == null || (e = t.getAttribute) === null || e === void 0 ? void 0 : e.call(t, "contenteditable");
18
- return r === "" || r === "true";
19
- }, I = function(t, e, r) {
20
- if (h(t))
21
- return [];
22
- var a = Array.prototype.slice.apply(t.querySelectorAll(v));
23
- return e && o.call(t, v) && a.unshift(t), a = a.filter(r), a;
24
- }, m = function i(t, e, r) {
25
- for (var a = [], l = Array.from(t); l.length; ) {
26
- var n = l.shift();
27
- if (!h(n, !1))
28
- if (n.tagName === "SLOT") {
29
- var u = n.assignedElements(), c = u.length ? u : n.children, s = i(c, !0, r);
30
- r.flatten ? a.push.apply(a, s) : a.push({
31
- scopeParent: n,
32
- candidates: s
33
- });
34
- } else {
35
- var f = o.call(n, v);
36
- f && r.filter(n) && (e || !t.includes(n)) && a.push(n);
37
- var d = n.shadowRoot || // check for an undisclosed shadow
38
- typeof r.getShadowRoot == "function" && r.getShadowRoot(n), E = !h(d, !1) && (!r.shadowRootFilter || r.shadowRootFilter(n));
39
- if (d && E) {
40
- var y = i(d === !0 ? n.children : d.children, !0, r);
41
- r.flatten ? a.push.apply(a, y) : a.push({
42
- scopeParent: n,
43
- candidates: y
44
- });
45
- } else
46
- l.unshift.apply(l, n.children);
47
- }
6
+ function z(u, a) {
7
+ var o = Object.keys(u);
8
+ if (Object.getOwnPropertySymbols) {
9
+ var i = Object.getOwnPropertySymbols(u);
10
+ a && (i = i.filter(function(m) {
11
+ return Object.getOwnPropertyDescriptor(u, m).enumerable;
12
+ })), o.push.apply(o, i);
48
13
  }
49
- return a;
50
- }, N = function(t) {
51
- return !isNaN(parseInt(t.getAttribute("tabindex"), 10));
52
- }, R = function(t) {
53
- if (!t)
54
- throw new Error("No node provided");
55
- return t.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName) || A(t)) && !N(t) ? 0 : t.tabIndex;
56
- }, x = function(t, e) {
57
- var r = R(t);
58
- return r < 0 && e && !N(t) ? 0 : r;
59
- }, O = function(t, e) {
60
- return t.tabIndex === e.tabIndex ? t.documentOrder - e.documentOrder : t.tabIndex - e.tabIndex;
61
- }, C = function(t) {
62
- return t.tagName === "INPUT";
63
- }, F = function(t) {
64
- return C(t) && t.type === "hidden";
65
- }, D = function(t) {
66
- var e = t.tagName === "DETAILS" && Array.prototype.slice.apply(t.children).some(function(r) {
67
- return r.tagName === "SUMMARY";
68
- });
69
- return e;
70
- }, k = function(t, e) {
71
- for (var r = 0; r < t.length; r++)
72
- if (t[r].checked && t[r].form === e)
73
- return t[r];
74
- }, M = function(t) {
75
- if (!t.name)
76
- return !0;
77
- var e = t.form || b(t), r = function(u) {
78
- return e.querySelectorAll('input[type="radio"][name="' + u + '"]');
79
- }, a;
80
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
81
- a = r(window.CSS.escape(t.name));
82
- else
83
- try {
84
- a = r(t.name);
85
- } catch (n) {
86
- 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;
87
- }
88
- var l = k(a, t.form);
89
- return !l || l === t;
90
- }, L = function(t) {
91
- return C(t) && t.type === "radio";
92
- }, P = function(t) {
93
- return L(t) && !M(t);
94
- }, B = function(t) {
95
- var e, r = t && b(t), a = (e = r) === null || e === void 0 ? void 0 : e.host, l = !1;
96
- if (r && r !== t) {
97
- var n, u, c;
98
- for (l = !!((n = a) !== null && n !== void 0 && (u = n.ownerDocument) !== null && u !== void 0 && u.contains(a) || t != null && (c = t.ownerDocument) !== null && c !== void 0 && c.contains(t)); !l && a; ) {
99
- var s, f, d;
100
- r = b(a), a = (s = r) === null || s === void 0 ? void 0 : s.host, l = !!((f = a) !== null && f !== void 0 && (d = f.ownerDocument) !== null && d !== void 0 && d.contains(a));
14
+ return o;
15
+ }
16
+ function J(u) {
17
+ for (var a = 1; a < arguments.length; a++) {
18
+ var o = arguments[a] != null ? arguments[a] : {};
19
+ a % 2 ? z(Object(o), !0).forEach(function(i) {
20
+ ne(u, i, o[i]);
21
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(u, Object.getOwnPropertyDescriptors(o)) : z(Object(o)).forEach(function(i) {
22
+ Object.defineProperty(u, i, Object.getOwnPropertyDescriptor(o, i));
23
+ });
24
+ }
25
+ return u;
26
+ }
27
+ function ne(u, a, o) {
28
+ return a = ie(a), a in u ? Object.defineProperty(u, a, {
29
+ value: o,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }) : u[a] = o, u;
34
+ }
35
+ function re(u, a) {
36
+ if (typeof u != "object" || u === null)
37
+ return u;
38
+ var o = u[Symbol.toPrimitive];
39
+ if (o !== void 0) {
40
+ var i = o.call(u, a || "default");
41
+ if (typeof i != "object")
42
+ return i;
43
+ throw new TypeError("@@toPrimitive must return a primitive value.");
44
+ }
45
+ return (a === "string" ? String : Number)(u);
46
+ }
47
+ function ie(u) {
48
+ var a = re(u, "string");
49
+ return typeof a == "symbol" ? a : String(a);
50
+ }
51
+ var Q = {
52
+ activateTrap: function(a, o) {
53
+ if (a.length > 0) {
54
+ var i = a[a.length - 1];
55
+ i !== o && i.pause();
101
56
  }
57
+ var m = a.indexOf(o);
58
+ m === -1 || a.splice(m, 1), a.push(o);
59
+ },
60
+ deactivateTrap: function(a, o) {
61
+ var i = a.indexOf(o);
62
+ i !== -1 && a.splice(i, 1), a.length > 0 && a[a.length - 1].unpause();
102
63
  }
103
- return l;
104
- }, p = function(t) {
105
- var e = t.getBoundingClientRect(), r = e.width, a = e.height;
106
- return r === 0 && a === 0;
107
- }, q = function(t, e) {
108
- var r = e.displayCheck, a = e.getShadowRoot;
109
- if (getComputedStyle(t).visibility === "hidden")
110
- return !0;
111
- var l = o.call(t, "details>summary:first-of-type"), n = l ? t.parentElement : t;
112
- if (o.call(n, "details:not([open]) *"))
113
- return !0;
114
- if (!r || r === "full" || r === "legacy-full") {
115
- if (typeof a == "function") {
116
- for (var u = t; t; ) {
117
- var c = t.parentElement, s = b(t);
118
- if (c && !c.shadowRoot && a(c) === !0)
119
- return p(t);
120
- t.assignedSlot ? t = t.assignedSlot : !c && s !== t.ownerDocument ? t = s.host : t = c;
121
- }
122
- t = u;
64
+ }, oe = function(a) {
65
+ return a.tagName && a.tagName.toLowerCase() === "input" && typeof a.select == "function";
66
+ }, ue = function(a) {
67
+ return (a == null ? void 0 : a.key) === "Escape" || (a == null ? void 0 : a.key) === "Esc" || (a == null ? void 0 : a.keyCode) === 27;
68
+ }, L = function(a) {
69
+ return (a == null ? void 0 : a.key) === "Tab" || (a == null ? void 0 : a.keyCode) === 9;
70
+ }, se = function(a) {
71
+ return L(a) && !a.shiftKey;
72
+ }, ce = function(a) {
73
+ return L(a) && a.shiftKey;
74
+ }, W = function(a) {
75
+ return setTimeout(a, 0);
76
+ }, X = function(a, o) {
77
+ var i = -1;
78
+ return a.every(function(m, s) {
79
+ return o(m) ? (i = s, !1) : !0;
80
+ }), i;
81
+ }, B = function(a) {
82
+ for (var o = arguments.length, i = new Array(o > 1 ? o - 1 : 0), m = 1; m < o; m++)
83
+ i[m - 1] = arguments[m];
84
+ return typeof a == "function" ? a.apply(void 0, i) : a;
85
+ }, C = function(a) {
86
+ return a.target.shadowRoot && typeof a.composedPath == "function" ? a.composedPath()[0] : a.target;
87
+ }, le = [], de = function(a, o) {
88
+ var i = (o == null ? void 0 : o.document) || document, m = (o == null ? void 0 : o.trapStack) || le, s = J({
89
+ returnFocusOnDeactivate: !0,
90
+ escapeDeactivates: !0,
91
+ delayInitialFocus: !0,
92
+ isKeyForward: se,
93
+ isKeyBackward: ce
94
+ }, o), n = {
95
+ // containers given to createFocusTrap()
96
+ // @type {Array<HTMLElement>}
97
+ containers: [],
98
+ // list of objects identifying tabbable nodes in `containers` in the trap
99
+ // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
100
+ // is active, but the trap should never get to a state where there isn't at least one group
101
+ // with at least one tabbable node in it (that would lead to an error condition that would
102
+ // result in an error being thrown)
103
+ // @type {Array<{
104
+ // container: HTMLElement,
105
+ // tabbableNodes: Array<HTMLElement>, // empty if none
106
+ // focusableNodes: Array<HTMLElement>, // empty if none
107
+ // posTabIndexesFound: boolean,
108
+ // firstTabbableNode: HTMLElement|undefined,
109
+ // lastTabbableNode: HTMLElement|undefined,
110
+ // firstDomTabbableNode: HTMLElement|undefined,
111
+ // lastDomTabbableNode: HTMLElement|undefined,
112
+ // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
113
+ // }>}
114
+ containerGroups: [],
115
+ // same order/length as `containers` list
116
+ // references to objects in `containerGroups`, but only those that actually have
117
+ // tabbable nodes in them
118
+ // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
119
+ // the same length
120
+ tabbableGroups: [],
121
+ nodeFocusedBeforeActivation: null,
122
+ mostRecentlyFocusedNode: null,
123
+ active: !1,
124
+ paused: !1,
125
+ // timer ID for when delayInitialFocus is true and initial focus in this trap
126
+ // has been delayed during activation
127
+ delayInitialFocusTimer: void 0,
128
+ // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
129
+ recentNavEvent: void 0
130
+ }, g, h = function(t, e, r) {
131
+ return t && t[e] !== void 0 ? t[e] : s[r || e];
132
+ }, F = function(t, e) {
133
+ var r = typeof (e == null ? void 0 : e.composedPath) == "function" ? e.composedPath() : void 0;
134
+ return n.containerGroups.findIndex(function(c) {
135
+ var l = c.container, d = c.tabbableNodes;
136
+ return l.contains(t) || // fall back to explicit tabbable search which will take into consideration any
137
+ // web components if the `tabbableOptions.getShadowRoot` option was used for
138
+ // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
139
+ // look inside web components even if open)
140
+ (r == null ? void 0 : r.includes(l)) || d.find(function(v) {
141
+ return v === t;
142
+ });
143
+ });
144
+ }, E = function(t) {
145
+ var e = s[t];
146
+ if (typeof e == "function") {
147
+ for (var r = arguments.length, c = new Array(r > 1 ? r - 1 : 0), l = 1; l < r; l++)
148
+ c[l - 1] = arguments[l];
149
+ e = e.apply(void 0, c);
150
+ }
151
+ if (e === !0 && (e = void 0), !e) {
152
+ if (e === void 0 || e === !1)
153
+ return e;
154
+ throw new Error("`".concat(t, "` was specified but was not a node, or did not return a node"));
123
155
  }
124
- if (B(t))
125
- return !t.getClientRects().length;
126
- if (r !== "legacy-full")
127
- return !0;
128
- } else if (r === "non-zero-area")
129
- return p(t);
130
- return !1;
131
- }, U = function(t) {
132
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))
133
- for (var e = t.parentElement; e; ) {
134
- if (e.tagName === "FIELDSET" && e.disabled) {
135
- for (var r = 0; r < e.children.length; r++) {
136
- var a = e.children.item(r);
137
- if (a.tagName === "LEGEND")
138
- return o.call(e, "fieldset[disabled] *") ? !0 : !a.contains(t);
156
+ var d = e;
157
+ if (typeof e == "string" && (d = i.querySelector(e), !d))
158
+ throw new Error("`".concat(t, "` as selector refers to no known node"));
159
+ return d;
160
+ }, P = function() {
161
+ var t = E("initialFocus");
162
+ if (t === !1)
163
+ return !1;
164
+ if (t === void 0 || !G(t, s.tabbableOptions))
165
+ if (F(i.activeElement) >= 0)
166
+ t = i.activeElement;
167
+ else {
168
+ var e = n.tabbableGroups[0], r = e && e.firstTabbableNode;
169
+ t = r || E("fallbackFocus");
170
+ }
171
+ if (!t)
172
+ throw new Error("Your focus-trap needs to have at least one focusable element");
173
+ return t;
174
+ }, D = function() {
175
+ if (n.containerGroups = n.containers.map(function(t) {
176
+ var e = te(t, s.tabbableOptions), r = ae(t, s.tabbableOptions), c = e.length > 0 ? e[0] : void 0, l = e.length > 0 ? e[e.length - 1] : void 0, d = r.find(function(b) {
177
+ return T(b);
178
+ }), v = r.slice().reverse().find(function(b) {
179
+ return T(b);
180
+ }), p = !!e.find(function(b) {
181
+ return K(b) > 0;
182
+ });
183
+ return {
184
+ container: t,
185
+ tabbableNodes: e,
186
+ focusableNodes: r,
187
+ /** True if at least one node with positive `tabindex` was found in this container. */
188
+ posTabIndexesFound: p,
189
+ /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
190
+ firstTabbableNode: c,
191
+ /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
192
+ lastTabbableNode: l,
193
+ // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
194
+ // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
195
+ // because that API doesn't work with Shadow DOM as well as it should (@see
196
+ // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
197
+ // to address an edge case related to positive tabindex support, this seems like a much easier,
198
+ // "close enough most of the time" alternative for positive tabindexes which should generally
199
+ // be avoided anyway...
200
+ /** First tabbable node in container, __DOM__ order; `undefined` if none. */
201
+ firstDomTabbableNode: d,
202
+ /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
203
+ lastDomTabbableNode: v,
204
+ /**
205
+ * Finds the __tabbable__ node that follows the given node in the specified direction,
206
+ * in this container, if any.
207
+ * @param {HTMLElement} node
208
+ * @param {boolean} [forward] True if going in forward tab order; false if going
209
+ * in reverse.
210
+ * @returns {HTMLElement|undefined} The next tabbable node, if any.
211
+ */
212
+ nextTabbableNode: function(N) {
213
+ var O = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, y = e.indexOf(N);
214
+ return y < 0 ? O ? r.slice(r.indexOf(N) + 1).find(function(R) {
215
+ return T(R);
216
+ }) : r.slice(0, r.indexOf(N)).reverse().find(function(R) {
217
+ return T(R);
218
+ }) : e[y + (O ? 1 : -1)];
139
219
  }
140
- return !0;
220
+ };
221
+ }), n.tabbableGroups = n.containerGroups.filter(function(t) {
222
+ return t.tabbableNodes.length > 0;
223
+ }), n.tabbableGroups.length <= 0 && !E("fallbackFocus"))
224
+ throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
225
+ if (n.containerGroups.find(function(t) {
226
+ return t.posTabIndexesFound;
227
+ }) && n.containerGroups.length > 1)
228
+ 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.");
229
+ }, Z = function f(t) {
230
+ var e = t.activeElement;
231
+ if (e)
232
+ return e.shadowRoot && e.shadowRoot.activeElement !== null ? f(e.shadowRoot) : e;
233
+ }, w = function f(t) {
234
+ if (t !== !1 && t !== Z(document)) {
235
+ if (!t || !t.focus) {
236
+ f(P());
237
+ return;
141
238
  }
142
- e = e.parentElement;
239
+ t.focus({
240
+ preventScroll: !!s.preventScroll
241
+ }), n.mostRecentlyFocusedNode = t, oe(t) && t.select();
143
242
  }
144
- return !1;
145
- }, g = function(t, e) {
146
- return !(e.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
147
- // because we're limited in the type of selectors we can use in JSDom (see related
148
- // note related to `candidateSelectors`)
149
- h(e) || F(e) || q(e, t) || // For a details element with a summary, the summary element gets the focus
150
- D(e) || U(e));
151
- }, S = function(t, e) {
152
- return !(P(e) || R(e) < 0 || !g(t, e));
153
- }, V = function(t) {
154
- var e = parseInt(t.getAttribute("tabindex"), 10);
155
- return !!(isNaN(e) || e >= 0);
156
- }, j = function i(t) {
157
- var e = [], r = [];
158
- return t.forEach(function(a, l) {
159
- var n = !!a.scopeParent, u = n ? a.scopeParent : a, c = x(u, n), s = n ? i(a.candidates) : u;
160
- c === 0 ? n ? e.push.apply(e, s) : e.push(u) : r.push({
161
- documentOrder: l,
162
- tabIndex: c,
163
- item: a,
164
- isScope: n,
165
- content: s
243
+ }, S = function(t) {
244
+ var e = E("setReturnFocus", t);
245
+ return e || (e === !1 ? !1 : t);
246
+ }, U = function(t) {
247
+ var e = t.target, r = t.event, c = t.isBackward, l = c === void 0 ? !1 : c;
248
+ e = e || C(r), D();
249
+ var d = null;
250
+ if (n.tabbableGroups.length > 0) {
251
+ var v = F(e, r), p = v >= 0 ? n.containerGroups[v] : void 0;
252
+ if (v < 0)
253
+ l ? d = n.tabbableGroups[n.tabbableGroups.length - 1].lastTabbableNode : d = n.tabbableGroups[0].firstTabbableNode;
254
+ else if (l) {
255
+ var b = X(n.tabbableGroups, function(I) {
256
+ var x = I.firstTabbableNode;
257
+ return e === x;
258
+ });
259
+ if (b < 0 && (p.container === e || G(e, s.tabbableOptions) && !T(e, s.tabbableOptions) && !p.nextTabbableNode(e, !1)) && (b = v), b >= 0) {
260
+ var N = b === 0 ? n.tabbableGroups.length - 1 : b - 1, O = n.tabbableGroups[N];
261
+ d = K(e) >= 0 ? O.lastTabbableNode : O.lastDomTabbableNode;
262
+ } else
263
+ L(r) || (d = p.nextTabbableNode(e, !1));
264
+ } else {
265
+ var y = X(n.tabbableGroups, function(I) {
266
+ var x = I.lastTabbableNode;
267
+ return e === x;
268
+ });
269
+ if (y < 0 && (p.container === e || G(e, s.tabbableOptions) && !T(e, s.tabbableOptions) && !p.nextTabbableNode(e)) && (y = v), y >= 0) {
270
+ var R = y === n.tabbableGroups.length - 1 ? 0 : y + 1, $ = n.tabbableGroups[R];
271
+ d = K(e) >= 0 ? $.firstTabbableNode : $.firstDomTabbableNode;
272
+ } else
273
+ L(r) || (d = p.nextTabbableNode(e));
274
+ }
275
+ } else
276
+ d = E("fallbackFocus");
277
+ return d;
278
+ }, A = function(t) {
279
+ var e = C(t);
280
+ if (!(F(e, t) >= 0)) {
281
+ if (B(s.clickOutsideDeactivates, t)) {
282
+ g.deactivate({
283
+ // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
284
+ // which will result in the outside click setting focus to the node
285
+ // that was clicked (and if not focusable, to "nothing"); by setting
286
+ // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
287
+ // on activation (or the configured `setReturnFocus` node), whether the
288
+ // outside click was on a focusable node or not
289
+ returnFocus: s.returnFocusOnDeactivate
290
+ });
291
+ return;
292
+ }
293
+ B(s.allowOutsideClick, t) || t.preventDefault();
294
+ }
295
+ }, q = function(t) {
296
+ var e = C(t), r = F(e, t) >= 0;
297
+ if (r || e instanceof Document)
298
+ r && (n.mostRecentlyFocusedNode = e);
299
+ else {
300
+ t.stopImmediatePropagation();
301
+ var c, l = !0;
302
+ if (n.mostRecentlyFocusedNode)
303
+ if (K(n.mostRecentlyFocusedNode) > 0) {
304
+ var d = F(n.mostRecentlyFocusedNode), v = n.containerGroups[d].tabbableNodes;
305
+ if (v.length > 0) {
306
+ var p = v.findIndex(function(b) {
307
+ return b === n.mostRecentlyFocusedNode;
308
+ });
309
+ p >= 0 && (s.isKeyForward(n.recentNavEvent) ? p + 1 < v.length && (c = v[p + 1], l = !1) : p - 1 >= 0 && (c = v[p - 1], l = !1));
310
+ }
311
+ } else
312
+ n.containerGroups.some(function(b) {
313
+ return b.tabbableNodes.some(function(N) {
314
+ return K(N) > 0;
315
+ });
316
+ }) || (l = !1);
317
+ else
318
+ l = !1;
319
+ l && (c = U({
320
+ // move FROM the MRU node, not event-related node (which will be the node that is
321
+ // outside the trap causing the focus escape we're trying to fix)
322
+ target: n.mostRecentlyFocusedNode,
323
+ isBackward: s.isKeyBackward(n.recentNavEvent)
324
+ })), w(c || n.mostRecentlyFocusedNode || P());
325
+ }
326
+ n.recentNavEvent = void 0;
327
+ }, _ = function(t) {
328
+ var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
329
+ n.recentNavEvent = t;
330
+ var r = U({
331
+ event: t,
332
+ isBackward: e
333
+ });
334
+ r && (L(t) && t.preventDefault(), w(r));
335
+ }, H = function(t) {
336
+ if (ue(t) && B(s.escapeDeactivates, t) !== !1) {
337
+ t.preventDefault(), g.deactivate();
338
+ return;
339
+ }
340
+ (s.isKeyForward(t) || s.isKeyBackward(t)) && _(t, s.isKeyBackward(t));
341
+ }, M = function(t) {
342
+ var e = C(t);
343
+ F(e, t) >= 0 || B(s.clickOutsideDeactivates, t) || B(s.allowOutsideClick, t) || (t.preventDefault(), t.stopImmediatePropagation());
344
+ }, Y = function() {
345
+ if (n.active)
346
+ return Q.activateTrap(m, g), n.delayInitialFocusTimer = s.delayInitialFocus ? W(function() {
347
+ w(P());
348
+ }) : w(P()), i.addEventListener("focusin", q, !0), i.addEventListener("mousedown", A, {
349
+ capture: !0,
350
+ passive: !1
351
+ }), i.addEventListener("touchstart", A, {
352
+ capture: !0,
353
+ passive: !1
354
+ }), i.addEventListener("click", M, {
355
+ capture: !0,
356
+ passive: !1
357
+ }), i.addEventListener("keydown", H, {
358
+ capture: !0,
359
+ passive: !1
360
+ }), g;
361
+ }, V = function() {
362
+ if (n.active)
363
+ return i.removeEventListener("focusin", q, !0), i.removeEventListener("mousedown", A, !0), i.removeEventListener("touchstart", A, !0), i.removeEventListener("click", M, !0), i.removeEventListener("keydown", H, !0), g;
364
+ }, ee = function(t) {
365
+ var e = t.some(function(r) {
366
+ var c = Array.from(r.removedNodes);
367
+ return c.some(function(l) {
368
+ return l === n.mostRecentlyFocusedNode;
369
+ });
166
370
  });
167
- }), r.sort(O).reduce(function(a, l) {
168
- return l.isScope ? a.push.apply(a, l.content) : a.push(l.content), a;
169
- }, []).concat(e);
170
- }, Z = function(t, e) {
171
- e = e || {};
172
- var r;
173
- return e.getShadowRoot ? r = m([t], e.includeContainer, {
174
- filter: S.bind(null, e),
175
- flatten: !1,
176
- getShadowRoot: e.getShadowRoot,
177
- shadowRootFilter: V
178
- }) : r = I(t, e.includeContainer, S.bind(null, e)), j(r);
179
- }, z = function(t, e) {
180
- e = e || {};
181
- var r;
182
- return e.getShadowRoot ? r = m([t], e.includeContainer, {
183
- filter: g.bind(null, e),
184
- flatten: !0,
185
- getShadowRoot: e.getShadowRoot
186
- }) : r = I(t, e.includeContainer, g.bind(null, e)), r;
187
- }, G = function(t, e) {
188
- if (e = e || {}, !t)
189
- throw new Error("No node provided");
190
- return o.call(t, v) === !1 ? !1 : S(e, t);
191
- }, W = /* @__PURE__ */ w.concat("iframe").join(","), X = function(t, e) {
192
- if (e = e || {}, !t)
193
- throw new Error("No node provided");
194
- return o.call(t, W) === !1 ? !1 : g(e, t);
371
+ e && w(P());
372
+ }, j = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(ee) : void 0, k = function() {
373
+ j && (j.disconnect(), n.active && !n.paused && n.containers.map(function(t) {
374
+ j.observe(t, {
375
+ subtree: !0,
376
+ childList: !0
377
+ });
378
+ }));
379
+ };
380
+ return g = {
381
+ get active() {
382
+ return n.active;
383
+ },
384
+ get paused() {
385
+ return n.paused;
386
+ },
387
+ activate: function(t) {
388
+ if (n.active)
389
+ return this;
390
+ var e = h(t, "onActivate"), r = h(t, "onPostActivate"), c = h(t, "checkCanFocusTrap");
391
+ c || D(), n.active = !0, n.paused = !1, n.nodeFocusedBeforeActivation = i.activeElement, e == null || e();
392
+ var l = function() {
393
+ c && D(), Y(), k(), r == null || r();
394
+ };
395
+ return c ? (c(n.containers.concat()).then(l, l), this) : (l(), this);
396
+ },
397
+ deactivate: function(t) {
398
+ if (!n.active)
399
+ return this;
400
+ var e = J({
401
+ onDeactivate: s.onDeactivate,
402
+ onPostDeactivate: s.onPostDeactivate,
403
+ checkCanReturnFocus: s.checkCanReturnFocus
404
+ }, t);
405
+ clearTimeout(n.delayInitialFocusTimer), n.delayInitialFocusTimer = void 0, V(), n.active = !1, n.paused = !1, k(), Q.deactivateTrap(m, g);
406
+ var r = h(e, "onDeactivate"), c = h(e, "onPostDeactivate"), l = h(e, "checkCanReturnFocus"), d = h(e, "returnFocus", "returnFocusOnDeactivate");
407
+ r == null || r();
408
+ var v = function() {
409
+ W(function() {
410
+ d && w(S(n.nodeFocusedBeforeActivation)), c == null || c();
411
+ });
412
+ };
413
+ return d && l ? (l(S(n.nodeFocusedBeforeActivation)).then(v, v), this) : (v(), this);
414
+ },
415
+ pause: function(t) {
416
+ if (n.paused || !n.active)
417
+ return this;
418
+ var e = h(t, "onPause"), r = h(t, "onPostPause");
419
+ return n.paused = !0, e == null || e(), V(), k(), r == null || r(), this;
420
+ },
421
+ unpause: function(t) {
422
+ if (!n.paused || !n.active)
423
+ return this;
424
+ var e = h(t, "onUnpause"), r = h(t, "onPostUnpause");
425
+ return n.paused = !1, e == null || e(), D(), Y(), k(), r == null || r(), this;
426
+ },
427
+ updateContainerElements: function(t) {
428
+ var e = [].concat(t).filter(Boolean);
429
+ return n.containers = e.map(function(r) {
430
+ return typeof r == "string" ? i.querySelector(r) : r;
431
+ }), n.active && D(), k(), this;
432
+ }
433
+ }, g.updateContainerElements(a), g;
195
434
  };
196
435
  export {
197
- z as focusable,
198
- R as getTabIndex,
199
- X as isFocusable,
200
- G as isTabbable,
201
- Z as tabbable
436
+ de as createFocusTrap
202
437
  };
203
438
  //# sourceMappingURL=index247.js.map