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