@stonecrop/utilities 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/tsdoc-metadata.json +1 -1
- package/dist/utilities.js +248 -177
- package/dist/utilities.js.map +1 -1
- package/dist/utilities.umd.cjs +1 -1
- package/dist/utilities.umd.cjs.map +1 -1
- package/package.json +9 -9
package/dist/utilities.js
CHANGED
|
@@ -1,134 +1,205 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function I(e) {
|
|
3
|
-
return W() ? (K(e), !0) : !1;
|
|
4
|
-
}
|
|
1
|
+
import { watch as T, getCurrentScope as K, onScopeDispose as V, computed as y, shallowRef as N, toValue as $, ref as k, watchEffect as j, unref as B, getCurrentInstance as q, onMounted as F, onBeforeUnmount as G } from "vue";
|
|
5
2
|
function A(e) {
|
|
6
|
-
return
|
|
3
|
+
return K() ? (V(e), !0) : !1;
|
|
7
4
|
}
|
|
8
|
-
const
|
|
5
|
+
const z = typeof window < "u" && typeof document < "u";
|
|
9
6
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
-
const
|
|
11
|
-
}
|
|
12
|
-
function
|
|
7
|
+
const J = (e) => e != null, Q = Object.prototype.toString, X = (e) => Q.call(e) === "[object Object]", Y = () => {
|
|
8
|
+
};
|
|
9
|
+
function S(e) {
|
|
10
|
+
return Array.isArray(e) ? e : [e];
|
|
11
|
+
}
|
|
12
|
+
function Z(e, t, n) {
|
|
13
|
+
return T(
|
|
14
|
+
e,
|
|
15
|
+
t,
|
|
16
|
+
{
|
|
17
|
+
...n,
|
|
18
|
+
immediate: !0
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
const C = z ? window : void 0;
|
|
23
|
+
function v(e) {
|
|
13
24
|
var t;
|
|
14
|
-
const n =
|
|
25
|
+
const n = $(e);
|
|
15
26
|
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
16
27
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
function b(...e) {
|
|
29
|
+
const t = [], n = () => {
|
|
30
|
+
t.forEach((s) => s()), t.length = 0;
|
|
31
|
+
}, o = (s, i, u, c) => (s.addEventListener(i, u, c), () => s.removeEventListener(i, u, c)), a = y(() => {
|
|
32
|
+
const s = S($(e[0])).filter((i) => i != null);
|
|
33
|
+
return s.every((i) => typeof i != "string") ? s : void 0;
|
|
34
|
+
}), r = Z(
|
|
35
|
+
() => {
|
|
36
|
+
var s, i;
|
|
37
|
+
return [
|
|
38
|
+
(i = (s = a.value) == null ? void 0 : s.map((u) => v(u))) != null ? i : [C].filter((u) => u != null),
|
|
39
|
+
S($(a.value ? e[1] : e[0])),
|
|
40
|
+
S(B(a.value ? e[2] : e[1])),
|
|
41
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
42
|
+
$(a.value ? e[3] : e[2])
|
|
43
|
+
];
|
|
44
|
+
},
|
|
45
|
+
([s, i, u, c]) => {
|
|
46
|
+
if (n(), !(s != null && s.length) || !(i != null && i.length) || !(u != null && u.length))
|
|
28
47
|
return;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
...
|
|
48
|
+
const p = X(c) ? { ...c } : c;
|
|
49
|
+
t.push(
|
|
50
|
+
...s.flatMap(
|
|
51
|
+
(f) => i.flatMap(
|
|
52
|
+
(d) => u.map((m) => o(f, d, m, p))
|
|
53
|
+
)
|
|
54
|
+
)
|
|
32
55
|
);
|
|
33
56
|
},
|
|
34
|
-
{
|
|
35
|
-
),
|
|
36
|
-
|
|
57
|
+
{ flush: "post" }
|
|
58
|
+
), l = () => {
|
|
59
|
+
r(), n();
|
|
37
60
|
};
|
|
38
|
-
return
|
|
61
|
+
return A(n), l;
|
|
39
62
|
}
|
|
40
|
-
function
|
|
41
|
-
const e =
|
|
42
|
-
return t &&
|
|
63
|
+
function ee() {
|
|
64
|
+
const e = N(!1), t = q();
|
|
65
|
+
return t && F(() => {
|
|
43
66
|
e.value = !0;
|
|
44
67
|
}, t), e;
|
|
45
68
|
}
|
|
46
|
-
function
|
|
47
|
-
const t =
|
|
48
|
-
return
|
|
69
|
+
function te(e) {
|
|
70
|
+
const t = ee();
|
|
71
|
+
return y(() => (t.value, !!e()));
|
|
49
72
|
}
|
|
50
|
-
function
|
|
51
|
-
const { window: o =
|
|
73
|
+
function ne(e, t, n = {}) {
|
|
74
|
+
const { window: o = C, ...a } = n;
|
|
52
75
|
let r;
|
|
53
|
-
const l =
|
|
76
|
+
const l = te(() => o && "MutationObserver" in o), s = () => {
|
|
54
77
|
r && (r.disconnect(), r = void 0);
|
|
55
|
-
},
|
|
56
|
-
const
|
|
78
|
+
}, i = y(() => {
|
|
79
|
+
const f = $(e), d = S(f).map(v).filter(J);
|
|
57
80
|
return new Set(d);
|
|
58
|
-
}),
|
|
59
|
-
() =>
|
|
60
|
-
(
|
|
61
|
-
|
|
81
|
+
}), u = T(
|
|
82
|
+
() => i.value,
|
|
83
|
+
(f) => {
|
|
84
|
+
s(), l.value && f.size && (r = new MutationObserver(t), f.forEach((d) => r.observe(d, a)));
|
|
62
85
|
},
|
|
63
86
|
{ immediate: !0, flush: "post" }
|
|
64
|
-
),
|
|
65
|
-
|
|
87
|
+
), c = () => r == null ? void 0 : r.takeRecords(), p = () => {
|
|
88
|
+
u(), s();
|
|
66
89
|
};
|
|
67
|
-
return
|
|
90
|
+
return A(p), {
|
|
68
91
|
isSupported: l,
|
|
69
92
|
stop: p,
|
|
70
|
-
takeRecords:
|
|
93
|
+
takeRecords: c
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function oe(e, t, n = {}) {
|
|
97
|
+
const {
|
|
98
|
+
window: o = C,
|
|
99
|
+
document: a = o == null ? void 0 : o.document,
|
|
100
|
+
flush: r = "sync"
|
|
101
|
+
} = n;
|
|
102
|
+
if (!o || !a)
|
|
103
|
+
return Y;
|
|
104
|
+
let l;
|
|
105
|
+
const s = (c) => {
|
|
106
|
+
l == null || l(), l = c;
|
|
107
|
+
}, i = j(() => {
|
|
108
|
+
const c = v(e);
|
|
109
|
+
if (c) {
|
|
110
|
+
const { stop: p } = ne(
|
|
111
|
+
a,
|
|
112
|
+
(f) => {
|
|
113
|
+
f.map((m) => [...m.removedNodes]).flat().some((m) => m === c || m.contains(c)) && t(f);
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
window: o,
|
|
117
|
+
childList: !0,
|
|
118
|
+
subtree: !0
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
s(p);
|
|
122
|
+
}
|
|
123
|
+
}, { flush: r }), u = () => {
|
|
124
|
+
i(), s();
|
|
71
125
|
};
|
|
126
|
+
return A(u), u;
|
|
72
127
|
}
|
|
73
|
-
function
|
|
128
|
+
function le(e = {}) {
|
|
74
129
|
var t;
|
|
75
130
|
const {
|
|
76
|
-
window: n =
|
|
131
|
+
window: n = C,
|
|
77
132
|
deep: o = !0,
|
|
78
|
-
triggerOnRemoval:
|
|
133
|
+
triggerOnRemoval: a = !1
|
|
79
134
|
} = e, r = (t = e.document) != null ? t : n == null ? void 0 : n.document, l = () => {
|
|
80
|
-
var
|
|
81
|
-
let
|
|
135
|
+
var u;
|
|
136
|
+
let c = r == null ? void 0 : r.activeElement;
|
|
82
137
|
if (o)
|
|
83
|
-
for (;
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
|
|
138
|
+
for (; c != null && c.shadowRoot; )
|
|
139
|
+
c = (u = c == null ? void 0 : c.shadowRoot) == null ? void 0 : u.activeElement;
|
|
140
|
+
return c;
|
|
141
|
+
}, s = k(), i = () => {
|
|
142
|
+
s.value = l();
|
|
88
143
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
144
|
+
if (n) {
|
|
145
|
+
const u = {
|
|
146
|
+
capture: !0,
|
|
147
|
+
passive: !0
|
|
148
|
+
};
|
|
149
|
+
b(
|
|
150
|
+
n,
|
|
151
|
+
"blur",
|
|
152
|
+
(c) => {
|
|
153
|
+
c.relatedTarget === null && i();
|
|
154
|
+
},
|
|
155
|
+
u
|
|
156
|
+
), b(
|
|
157
|
+
n,
|
|
158
|
+
"focus",
|
|
159
|
+
i,
|
|
160
|
+
u
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return a && oe(s, i, { document: r }), i(), s;
|
|
99
164
|
}
|
|
100
|
-
const
|
|
101
|
-
function
|
|
102
|
-
const { window: n =
|
|
103
|
-
|
|
165
|
+
const se = "focusin", re = "focusout", ie = ":focus-within";
|
|
166
|
+
function ce(e, t = {}) {
|
|
167
|
+
const { window: n = C } = t, o = y(() => v(e)), a = N(!1), r = y(() => a.value), l = le(t);
|
|
168
|
+
if (!n || !l.value)
|
|
169
|
+
return { focused: r };
|
|
170
|
+
const s = { passive: !0 };
|
|
171
|
+
return b(o, se, () => a.value = !0, s), b(o, re, () => {
|
|
172
|
+
var i, u, c;
|
|
173
|
+
return a.value = (c = (u = (i = o.value) == null ? void 0 : i.matches) == null ? void 0 : u.call(i, ie)) != null ? c : !1;
|
|
174
|
+
}, s), { focused: r };
|
|
104
175
|
}
|
|
105
|
-
function
|
|
106
|
-
const o =
|
|
176
|
+
function ae(e, { window: t = C, scrollTarget: n } = {}) {
|
|
177
|
+
const o = k(!1), a = () => {
|
|
107
178
|
if (!t) return;
|
|
108
|
-
const r = t.document, l =
|
|
179
|
+
const r = t.document, l = v(e);
|
|
109
180
|
if (!l)
|
|
110
181
|
o.value = !1;
|
|
111
182
|
else {
|
|
112
|
-
const
|
|
113
|
-
o.value =
|
|
183
|
+
const s = l.getBoundingClientRect();
|
|
184
|
+
o.value = s.top <= (t.innerHeight || r.documentElement.clientHeight) && s.left <= (t.innerWidth || r.documentElement.clientWidth) && s.bottom >= 0 && s.right >= 0;
|
|
114
185
|
}
|
|
115
186
|
};
|
|
116
187
|
return T(
|
|
117
|
-
() =>
|
|
118
|
-
() =>
|
|
188
|
+
() => v(e),
|
|
189
|
+
() => a(),
|
|
119
190
|
{ immediate: !0, flush: "post" }
|
|
120
|
-
), t &&
|
|
191
|
+
), t && b(n || t, "scroll", a, {
|
|
121
192
|
capture: !1,
|
|
122
193
|
passive: !0
|
|
123
194
|
}), o;
|
|
124
195
|
}
|
|
125
|
-
const
|
|
126
|
-
let t =
|
|
196
|
+
const g = (e) => {
|
|
197
|
+
let t = ae(e).value;
|
|
127
198
|
return t = t && e.offsetHeight > 0, t;
|
|
128
|
-
},
|
|
199
|
+
}, E = (e) => e.tabIndex >= 0, P = (e) => {
|
|
129
200
|
const t = e.target;
|
|
130
|
-
return
|
|
131
|
-
},
|
|
201
|
+
return L(t);
|
|
202
|
+
}, L = (e) => {
|
|
132
203
|
var n;
|
|
133
204
|
let t;
|
|
134
205
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -141,29 +212,29 @@ const m = (e) => {
|
|
|
141
212
|
const o = e.previousElementSibling;
|
|
142
213
|
o && (t = o);
|
|
143
214
|
}
|
|
144
|
-
return t && (!
|
|
145
|
-
},
|
|
215
|
+
return t && (!E(t) || !g(t)) ? L(t) : t;
|
|
216
|
+
}, ue = (e) => {
|
|
146
217
|
var o;
|
|
147
218
|
const t = e.target;
|
|
148
219
|
let n;
|
|
149
220
|
if (t instanceof HTMLTableCellElement) {
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
const r =
|
|
221
|
+
const a = (o = t.parentElement) == null ? void 0 : o.parentElement;
|
|
222
|
+
if (a) {
|
|
223
|
+
const r = a.firstElementChild, l = r == null ? void 0 : r.children[t.cellIndex];
|
|
153
224
|
l && (n = l);
|
|
154
225
|
}
|
|
155
226
|
} else if (t instanceof HTMLTableRowElement) {
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
const r =
|
|
227
|
+
const a = t.parentElement;
|
|
228
|
+
if (a) {
|
|
229
|
+
const r = a.firstElementChild;
|
|
159
230
|
r && (n = r);
|
|
160
231
|
}
|
|
161
232
|
}
|
|
162
|
-
return n && (!
|
|
163
|
-
},
|
|
233
|
+
return n && (!E(n) || !g(n)) ? H(n) : n;
|
|
234
|
+
}, O = (e) => {
|
|
164
235
|
const t = e.target;
|
|
165
|
-
return
|
|
166
|
-
},
|
|
236
|
+
return H(t);
|
|
237
|
+
}, H = (e) => {
|
|
167
238
|
var n;
|
|
168
239
|
let t;
|
|
169
240
|
if (e instanceof HTMLTableCellElement) {
|
|
@@ -176,29 +247,29 @@ const m = (e) => {
|
|
|
176
247
|
const o = e.nextElementSibling;
|
|
177
248
|
o && (t = o);
|
|
178
249
|
}
|
|
179
|
-
return t && (!
|
|
180
|
-
},
|
|
250
|
+
return t && (!E(t) || !g(t)) ? H(t) : t;
|
|
251
|
+
}, fe = (e) => {
|
|
181
252
|
var o;
|
|
182
253
|
const t = e.target;
|
|
183
254
|
let n;
|
|
184
255
|
if (t instanceof HTMLTableCellElement) {
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const r =
|
|
256
|
+
const a = (o = t.parentElement) == null ? void 0 : o.parentElement;
|
|
257
|
+
if (a) {
|
|
258
|
+
const r = a.lastElementChild, l = r == null ? void 0 : r.children[t.cellIndex];
|
|
188
259
|
l && (n = l);
|
|
189
260
|
}
|
|
190
261
|
} else if (t instanceof HTMLTableRowElement) {
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const r =
|
|
262
|
+
const a = t.parentElement;
|
|
263
|
+
if (a) {
|
|
264
|
+
const r = a.lastElementChild;
|
|
194
265
|
r && (n = r);
|
|
195
266
|
}
|
|
196
267
|
}
|
|
197
|
-
return n && (!
|
|
198
|
-
},
|
|
268
|
+
return n && (!E(n) || !g(n)) ? L(n) : n;
|
|
269
|
+
}, U = (e) => {
|
|
199
270
|
const t = e.target;
|
|
200
|
-
return
|
|
201
|
-
},
|
|
271
|
+
return D(t);
|
|
272
|
+
}, D = (e) => {
|
|
202
273
|
var n;
|
|
203
274
|
let t;
|
|
204
275
|
if (e.previousElementSibling)
|
|
@@ -207,11 +278,11 @@ const m = (e) => {
|
|
|
207
278
|
const o = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;
|
|
208
279
|
t = o == null ? void 0 : o.lastElementChild;
|
|
209
280
|
}
|
|
210
|
-
return t && (!
|
|
211
|
-
},
|
|
281
|
+
return t && (!E(t) || !g(t)) ? D(t) : t;
|
|
282
|
+
}, _ = (e) => {
|
|
212
283
|
const t = e.target;
|
|
213
|
-
return
|
|
214
|
-
},
|
|
284
|
+
return R(t);
|
|
285
|
+
}, R = (e) => {
|
|
215
286
|
var n;
|
|
216
287
|
let t;
|
|
217
288
|
if (e.nextElementSibling)
|
|
@@ -220,152 +291,152 @@ const m = (e) => {
|
|
|
220
291
|
const o = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;
|
|
221
292
|
t = o == null ? void 0 : o.firstElementChild;
|
|
222
293
|
}
|
|
223
|
-
return t && (!
|
|
224
|
-
},
|
|
294
|
+
return t && (!E(t) || !g(t)) ? R(t) : t;
|
|
295
|
+
}, I = (e) => {
|
|
225
296
|
const n = e.target.parentElement, o = n == null ? void 0 : n.firstElementChild;
|
|
226
|
-
return o && (!
|
|
227
|
-
},
|
|
297
|
+
return o && (!E(o) || !g(o)) ? R(o) : o;
|
|
298
|
+
}, W = (e) => {
|
|
228
299
|
const n = e.target.parentElement, o = n == null ? void 0 : n.lastElementChild;
|
|
229
|
-
return o && (!
|
|
230
|
-
},
|
|
300
|
+
return o && (!E(o) || !g(o)) ? D(o) : o;
|
|
301
|
+
}, w = ["alt", "control", "shift", "meta"], pe = {
|
|
231
302
|
ArrowUp: "up",
|
|
232
303
|
ArrowDown: "down",
|
|
233
304
|
ArrowLeft: "left",
|
|
234
305
|
ArrowRight: "right"
|
|
235
|
-
},
|
|
306
|
+
}, de = {
|
|
236
307
|
"keydown.up": (e) => {
|
|
237
|
-
const t =
|
|
308
|
+
const t = P(e);
|
|
238
309
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
239
310
|
},
|
|
240
311
|
"keydown.down": (e) => {
|
|
241
|
-
const t =
|
|
312
|
+
const t = O(e);
|
|
242
313
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
243
314
|
},
|
|
244
315
|
"keydown.left": (e) => {
|
|
245
|
-
const t =
|
|
316
|
+
const t = U(e);
|
|
246
317
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
247
318
|
},
|
|
248
319
|
"keydown.right": (e) => {
|
|
249
|
-
const t =
|
|
320
|
+
const t = _(e);
|
|
250
321
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
251
322
|
},
|
|
252
323
|
"keydown.control.up": (e) => {
|
|
253
|
-
const t =
|
|
324
|
+
const t = ue(e);
|
|
254
325
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
255
326
|
},
|
|
256
327
|
"keydown.control.down": (e) => {
|
|
257
|
-
const t =
|
|
328
|
+
const t = fe(e);
|
|
258
329
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
259
330
|
},
|
|
260
331
|
"keydown.control.left": (e) => {
|
|
261
|
-
const t =
|
|
332
|
+
const t = I(e);
|
|
262
333
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
263
334
|
},
|
|
264
335
|
"keydown.control.right": (e) => {
|
|
265
|
-
const t =
|
|
336
|
+
const t = W(e);
|
|
266
337
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
267
338
|
},
|
|
268
339
|
"keydown.end": (e) => {
|
|
269
|
-
const t =
|
|
340
|
+
const t = W(e);
|
|
270
341
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
271
342
|
},
|
|
272
343
|
"keydown.enter": (e) => {
|
|
273
344
|
if (e.target instanceof HTMLTableCellElement) {
|
|
274
345
|
e.preventDefault(), e.stopPropagation();
|
|
275
|
-
const n =
|
|
346
|
+
const n = O(e);
|
|
276
347
|
n && n.focus();
|
|
277
348
|
}
|
|
278
349
|
},
|
|
279
350
|
"keydown.shift.enter": (e) => {
|
|
280
351
|
if (e.target instanceof HTMLTableCellElement) {
|
|
281
352
|
e.preventDefault(), e.stopPropagation();
|
|
282
|
-
const n =
|
|
353
|
+
const n = P(e);
|
|
283
354
|
n && n.focus();
|
|
284
355
|
}
|
|
285
356
|
},
|
|
286
357
|
"keydown.home": (e) => {
|
|
287
|
-
const t =
|
|
358
|
+
const t = I(e);
|
|
288
359
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
289
360
|
},
|
|
290
361
|
"keydown.tab": (e) => {
|
|
291
|
-
const t =
|
|
362
|
+
const t = _(e);
|
|
292
363
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
293
364
|
},
|
|
294
365
|
"keydown.shift.tab": (e) => {
|
|
295
|
-
const t =
|
|
366
|
+
const t = U(e);
|
|
296
367
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
297
368
|
}
|
|
298
369
|
};
|
|
299
|
-
function
|
|
370
|
+
function ge(e) {
|
|
300
371
|
const t = (l) => {
|
|
301
|
-
let
|
|
302
|
-
return l.parent && (typeof l.parent == "string" ?
|
|
372
|
+
let s = null;
|
|
373
|
+
return l.parent && (typeof l.parent == "string" ? s = document.querySelector(l.parent) : l.parent instanceof HTMLElement ? s = l.parent : s = l.parent.value), s;
|
|
303
374
|
}, n = (l) => {
|
|
304
|
-
var
|
|
305
|
-
const
|
|
306
|
-
let
|
|
375
|
+
var u;
|
|
376
|
+
const s = t(l);
|
|
377
|
+
let i = [];
|
|
307
378
|
if (typeof l.selectors == "string")
|
|
308
|
-
|
|
379
|
+
i = s ? Array.from(s.querySelectorAll(l.selectors)) : Array.from(document.querySelectorAll(l.selectors));
|
|
309
380
|
else if (Array.isArray(l.selectors))
|
|
310
|
-
for (const
|
|
311
|
-
|
|
381
|
+
for (const c of l.selectors)
|
|
382
|
+
c instanceof HTMLElement ? i.push(c) : i.push(c.$el);
|
|
312
383
|
else if (l.selectors instanceof HTMLElement)
|
|
313
|
-
|
|
314
|
-
else if ((
|
|
384
|
+
i.push(l.selectors);
|
|
385
|
+
else if ((u = l.selectors) != null && u.value)
|
|
315
386
|
if (Array.isArray(l.selectors.value))
|
|
316
|
-
for (const
|
|
317
|
-
|
|
387
|
+
for (const c of l.selectors.value)
|
|
388
|
+
c instanceof HTMLElement ? i.push(c) : i.push(c.$el);
|
|
318
389
|
else
|
|
319
|
-
|
|
320
|
-
return
|
|
390
|
+
i.push(l.selectors.value);
|
|
391
|
+
return i;
|
|
321
392
|
}, o = (l) => {
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
return l.selectors ?
|
|
325
|
-
},
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
329
|
-
for (const
|
|
330
|
-
const [p, ...
|
|
331
|
-
if (p === "keydown" &&
|
|
332
|
-
const d =
|
|
333
|
-
const
|
|
334
|
-
return
|
|
393
|
+
const s = t(l);
|
|
394
|
+
let i = [];
|
|
395
|
+
return l.selectors ? i = n(l) : s && (i = Array.from(s.children).filter((c) => E(c) && g(c))), i;
|
|
396
|
+
}, a = (l) => (s) => {
|
|
397
|
+
const i = pe[s.key] || s.key.toLowerCase();
|
|
398
|
+
if (w.includes(i)) return;
|
|
399
|
+
const u = l.handlers || de;
|
|
400
|
+
for (const c of Object.keys(u)) {
|
|
401
|
+
const [p, ...f] = c.split(".");
|
|
402
|
+
if (p === "keydown" && f.includes(i)) {
|
|
403
|
+
const d = u[c], m = f.filter((h) => w.includes(h)), x = w.some((h) => {
|
|
404
|
+
const M = h.charAt(0).toUpperCase() + h.slice(1);
|
|
405
|
+
return s.getModifierState(M);
|
|
335
406
|
});
|
|
336
|
-
if (
|
|
407
|
+
if (m.length > 0) {
|
|
337
408
|
if (x) {
|
|
338
|
-
for (const
|
|
339
|
-
if (
|
|
340
|
-
const
|
|
341
|
-
|
|
409
|
+
for (const h of w)
|
|
410
|
+
if (f.includes(h)) {
|
|
411
|
+
const M = h.charAt(0).toUpperCase() + h.slice(1);
|
|
412
|
+
s.getModifierState(M) && d(s);
|
|
342
413
|
}
|
|
343
414
|
}
|
|
344
415
|
} else
|
|
345
|
-
x || d(
|
|
416
|
+
x || d(s);
|
|
346
417
|
}
|
|
347
418
|
}
|
|
348
419
|
}, r = [];
|
|
349
|
-
|
|
420
|
+
F(() => {
|
|
350
421
|
for (const l of e) {
|
|
351
|
-
const
|
|
352
|
-
for (const p of
|
|
353
|
-
const { focused:
|
|
354
|
-
|
|
422
|
+
const s = t(l), i = o(l), u = a(l), c = s ? [s] : i;
|
|
423
|
+
for (const p of c) {
|
|
424
|
+
const { focused: f } = ce(k(p)), d = T(f, (m) => {
|
|
425
|
+
m ? p.addEventListener("keydown", u) : p.removeEventListener("keydown", u);
|
|
355
426
|
});
|
|
356
427
|
r.push(d);
|
|
357
428
|
}
|
|
358
429
|
}
|
|
359
|
-
}),
|
|
430
|
+
}), G(() => {
|
|
360
431
|
for (const l of r)
|
|
361
432
|
l();
|
|
362
433
|
});
|
|
363
434
|
}
|
|
364
|
-
function
|
|
435
|
+
function Ee(e) {
|
|
365
436
|
}
|
|
366
437
|
export {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
438
|
+
de as defaultKeypressHandlers,
|
|
439
|
+
Ee as install,
|
|
440
|
+
ge as useKeyboardNav
|
|
370
441
|
};
|
|
371
442
|
//# sourceMappingURL=utilities.js.map
|