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