@stonecrop/utilities 0.2.11 → 0.2.18
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/utilities.js +211 -214
- 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 +1 -1
- package/src/composables/keyboard.ts +66 -36
- package/src/index.ts +2 -1
package/dist/utilities.js
CHANGED
|
@@ -1,333 +1,330 @@
|
|
|
1
|
-
import { unref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
M && ((v = window == null ? void 0 : window.navigator) != null && v.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
6
|
-
function H(e) {
|
|
7
|
-
return typeof e == "function" ? e() : Q(e);
|
|
8
|
-
}
|
|
9
|
-
function q(e) {
|
|
10
|
-
return e;
|
|
1
|
+
import { unref as I, getCurrentScope as O, onScopeDispose as U, computed as M, ref as b, watch as v, onMounted as j, onBeforeUnmount as V } from "vue";
|
|
2
|
+
function B(e) {
|
|
3
|
+
return O() ? (U(e), !0) : !1;
|
|
11
4
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
5
|
+
function _(e) {
|
|
6
|
+
return typeof e == "function" ? e() : I(e);
|
|
14
7
|
}
|
|
8
|
+
const F = typeof window < "u" && typeof document < "u";
|
|
9
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
10
|
+
const q = Object.prototype.toString, N = (e) => q.call(e) === "[object Object]", G = () => {
|
|
11
|
+
};
|
|
15
12
|
function y(e) {
|
|
16
13
|
var t;
|
|
17
|
-
const
|
|
18
|
-
return (t =
|
|
14
|
+
const n = _(e);
|
|
15
|
+
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
19
16
|
}
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
let t,
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
25
|
-
Array.isArray(
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
const T = F ? window : void 0;
|
|
18
|
+
function w(...e) {
|
|
19
|
+
let t, n, l, s;
|
|
20
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, l, s] = e, t = T) : [t, n, l, s] = e, !t)
|
|
21
|
+
return G;
|
|
22
|
+
Array.isArray(n) || (n = [n]), Array.isArray(l) || (l = [l]);
|
|
23
|
+
const i = [], o = () => {
|
|
24
|
+
i.forEach((f) => f()), i.length = 0;
|
|
25
|
+
}, r = (f, u, p, d) => (f.addEventListener(u, p, d), () => f.removeEventListener(u, p, d)), c = v(
|
|
26
|
+
() => [y(t), _(s)],
|
|
27
|
+
([f, u]) => {
|
|
28
|
+
if (o(), !f)
|
|
29
|
+
return;
|
|
30
|
+
const p = N(u) ? { ...u } : u;
|
|
31
|
+
i.push(
|
|
32
|
+
...n.flatMap((d) => l.map((E) => r(f, d, E, p)))
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
{ immediate: !0, flush: "post" }
|
|
36
|
+
), a = () => {
|
|
37
|
+
c(), o();
|
|
32
38
|
};
|
|
33
|
-
return
|
|
39
|
+
return B(a), a;
|
|
34
40
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
function z(e = {}) {
|
|
42
|
+
var t;
|
|
43
|
+
const {
|
|
44
|
+
window: n = T,
|
|
45
|
+
deep: l = !0
|
|
46
|
+
} = e, s = (t = e.document) != null ? t : n == null ? void 0 : n.document, i = () => {
|
|
47
|
+
var c;
|
|
48
|
+
let a = s == null ? void 0 : s.activeElement;
|
|
49
|
+
if (l)
|
|
50
|
+
for (; a != null && a.shadowRoot; )
|
|
51
|
+
a = (c = a == null ? void 0 : a.shadowRoot) == null ? void 0 : c.activeElement;
|
|
52
|
+
return a;
|
|
53
|
+
}, o = b(), r = () => {
|
|
54
|
+
o.value = i();
|
|
55
|
+
};
|
|
56
|
+
return n && (w(n, "blur", (c) => {
|
|
57
|
+
c.relatedTarget === null && r();
|
|
58
|
+
}, !0), w(n, "focus", r, !0)), r(), o;
|
|
59
|
+
}
|
|
60
|
+
function J(e, t = {}) {
|
|
61
|
+
const n = z(t), l = M(() => y(e));
|
|
62
|
+
return { focused: M(() => l.value && n.value ? l.value.contains(n.value) : !1) };
|
|
63
|
+
}
|
|
64
|
+
function Q(e, { window: t = T, scrollTarget: n } = {}) {
|
|
65
|
+
const l = b(!1), s = () => {
|
|
39
66
|
if (!t)
|
|
40
67
|
return;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
|
|
68
|
+
const i = t.document, o = y(e);
|
|
69
|
+
if (!o)
|
|
70
|
+
l.value = !1;
|
|
44
71
|
else {
|
|
45
|
-
const
|
|
46
|
-
|
|
72
|
+
const r = o.getBoundingClientRect();
|
|
73
|
+
l.value = r.top <= (t.innerHeight || i.documentElement.clientHeight) && r.left <= (t.innerWidth || i.documentElement.clientWidth) && r.bottom >= 0 && r.right >= 0;
|
|
47
74
|
}
|
|
48
75
|
};
|
|
49
|
-
return
|
|
76
|
+
return v(
|
|
77
|
+
() => y(e),
|
|
78
|
+
() => s(),
|
|
79
|
+
{ immediate: !0, flush: "post" }
|
|
80
|
+
), t && w(n || t, "scroll", s, {
|
|
50
81
|
capture: !1,
|
|
51
82
|
passive: !0
|
|
52
|
-
}),
|
|
83
|
+
}), l;
|
|
53
84
|
}
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
57
|
-
})(P || (P = {}));
|
|
58
|
-
var X = Object.defineProperty, I = Object.getOwnPropertySymbols, Y = Object.prototype.hasOwnProperty, Z = Object.prototype.propertyIsEnumerable, _ = (e, t, r) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ee = (e, t) => {
|
|
59
|
-
for (var r in t || (t = {}))
|
|
60
|
-
Y.call(t, r) && _(e, r, t[r]);
|
|
61
|
-
if (I)
|
|
62
|
-
for (var r of I(t))
|
|
63
|
-
Z.call(t, r) && _(e, r, t[r]);
|
|
64
|
-
return e;
|
|
65
|
-
};
|
|
66
|
-
const te = {
|
|
67
|
-
easeInSine: [0.12, 0, 0.39, 0],
|
|
68
|
-
easeOutSine: [0.61, 1, 0.88, 1],
|
|
69
|
-
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
70
|
-
easeInQuad: [0.11, 0, 0.5, 0],
|
|
71
|
-
easeOutQuad: [0.5, 1, 0.89, 1],
|
|
72
|
-
easeInOutQuad: [0.45, 0, 0.55, 1],
|
|
73
|
-
easeInCubic: [0.32, 0, 0.67, 0],
|
|
74
|
-
easeOutCubic: [0.33, 1, 0.68, 1],
|
|
75
|
-
easeInOutCubic: [0.65, 0, 0.35, 1],
|
|
76
|
-
easeInQuart: [0.5, 0, 0.75, 0],
|
|
77
|
-
easeOutQuart: [0.25, 1, 0.5, 1],
|
|
78
|
-
easeInOutQuart: [0.76, 0, 0.24, 1],
|
|
79
|
-
easeInQuint: [0.64, 0, 0.78, 0],
|
|
80
|
-
easeOutQuint: [0.22, 1, 0.36, 1],
|
|
81
|
-
easeInOutQuint: [0.83, 0, 0.17, 1],
|
|
82
|
-
easeInExpo: [0.7, 0, 0.84, 0],
|
|
83
|
-
easeOutExpo: [0.16, 1, 0.3, 1],
|
|
84
|
-
easeInOutExpo: [0.87, 0, 0.13, 1],
|
|
85
|
-
easeInCirc: [0.55, 0, 1, 0.45],
|
|
86
|
-
easeOutCirc: [0, 0.55, 0.45, 1],
|
|
87
|
-
easeInOutCirc: [0.85, 0, 0.15, 1],
|
|
88
|
-
easeInBack: [0.36, 0, 0.66, -0.56],
|
|
89
|
-
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
90
|
-
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
91
|
-
};
|
|
92
|
-
ee({
|
|
93
|
-
linear: q
|
|
94
|
-
}, te);
|
|
95
|
-
const f = (e) => {
|
|
96
|
-
let t = J(e).value;
|
|
85
|
+
const g = (e) => {
|
|
86
|
+
let t = Q(e).value;
|
|
97
87
|
return t = t && e.offsetHeight > 0, t;
|
|
98
|
-
},
|
|
88
|
+
}, m = (e) => e.tabIndex >= 0, x = (e) => {
|
|
99
89
|
const t = e.target;
|
|
100
|
-
return
|
|
101
|
-
},
|
|
102
|
-
var
|
|
90
|
+
return A(t);
|
|
91
|
+
}, A = (e) => {
|
|
92
|
+
var n;
|
|
103
93
|
let t;
|
|
104
94
|
if (e instanceof HTMLTableCellElement) {
|
|
105
|
-
const
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
|
|
95
|
+
const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;
|
|
96
|
+
if (l) {
|
|
97
|
+
const i = Array.from(l.children)[e.cellIndex];
|
|
98
|
+
i && (t = i);
|
|
109
99
|
}
|
|
110
100
|
} else if (e instanceof HTMLTableRowElement) {
|
|
111
|
-
const
|
|
112
|
-
|
|
101
|
+
const l = e.previousElementSibling;
|
|
102
|
+
l && (t = l);
|
|
113
103
|
}
|
|
114
|
-
return t && (!
|
|
115
|
-
},
|
|
116
|
-
var
|
|
104
|
+
return t && (!m(t) || !g(t)) ? A(t) : t;
|
|
105
|
+
}, X = (e) => {
|
|
106
|
+
var l;
|
|
117
107
|
const t = e.target;
|
|
118
|
-
let
|
|
108
|
+
let n;
|
|
119
109
|
if (t instanceof HTMLTableCellElement) {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
|
|
110
|
+
const s = (l = t.parentElement) == null ? void 0 : l.parentElement;
|
|
111
|
+
if (s) {
|
|
112
|
+
const o = s.firstElementChild.children[t.cellIndex];
|
|
113
|
+
o && (n = o);
|
|
124
114
|
}
|
|
125
115
|
} else if (t instanceof HTMLTableRowElement) {
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
|
|
116
|
+
const s = t.parentElement;
|
|
117
|
+
if (s) {
|
|
118
|
+
const i = s.firstElementChild;
|
|
119
|
+
i && (n = i);
|
|
130
120
|
}
|
|
131
121
|
}
|
|
132
|
-
return
|
|
133
|
-
},
|
|
122
|
+
return n && (!m(n) || !g(n)) ? S(n) : n;
|
|
123
|
+
}, D = (e) => {
|
|
134
124
|
const t = e.target;
|
|
135
|
-
return
|
|
136
|
-
},
|
|
137
|
-
var
|
|
125
|
+
return S(t);
|
|
126
|
+
}, S = (e) => {
|
|
127
|
+
var n;
|
|
138
128
|
let t;
|
|
139
129
|
if (e instanceof HTMLTableCellElement) {
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
const
|
|
143
|
-
|
|
130
|
+
const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;
|
|
131
|
+
if (l) {
|
|
132
|
+
const i = Array.from(l.children)[e.cellIndex];
|
|
133
|
+
i && (t = i);
|
|
144
134
|
}
|
|
145
135
|
} else if (e instanceof HTMLTableRowElement) {
|
|
146
|
-
const
|
|
147
|
-
|
|
136
|
+
const l = e.nextElementSibling;
|
|
137
|
+
l && (t = l);
|
|
148
138
|
}
|
|
149
|
-
return t && (!
|
|
150
|
-
},
|
|
151
|
-
var
|
|
139
|
+
return t && (!m(t) || !g(t)) ? S(t) : t;
|
|
140
|
+
}, Y = (e) => {
|
|
141
|
+
var l;
|
|
152
142
|
const t = e.target;
|
|
153
|
-
let
|
|
143
|
+
let n;
|
|
154
144
|
if (t instanceof HTMLTableCellElement) {
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
|
|
145
|
+
const s = (l = t.parentElement) == null ? void 0 : l.parentElement;
|
|
146
|
+
if (s) {
|
|
147
|
+
const o = s.lastElementChild.children[t.cellIndex];
|
|
148
|
+
o && (n = o);
|
|
159
149
|
}
|
|
160
150
|
} else if (t instanceof HTMLTableRowElement) {
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
const
|
|
164
|
-
|
|
151
|
+
const s = t.parentElement;
|
|
152
|
+
if (s) {
|
|
153
|
+
const i = s.lastElementChild;
|
|
154
|
+
i && (n = i);
|
|
165
155
|
}
|
|
166
156
|
}
|
|
167
|
-
return
|
|
168
|
-
},
|
|
157
|
+
return n && (!m(n) || !g(n)) ? A(n) : n;
|
|
158
|
+
}, R = (e) => {
|
|
169
159
|
const t = e.target;
|
|
170
|
-
return
|
|
171
|
-
},
|
|
172
|
-
var
|
|
160
|
+
return k(t);
|
|
161
|
+
}, k = (e) => {
|
|
162
|
+
var n;
|
|
173
163
|
let t;
|
|
174
164
|
if (e.previousElementSibling)
|
|
175
165
|
t = e.previousElementSibling;
|
|
176
166
|
else {
|
|
177
|
-
const
|
|
178
|
-
t =
|
|
167
|
+
const l = (n = e.parentElement) == null ? void 0 : n.previousElementSibling;
|
|
168
|
+
t = l == null ? void 0 : l.lastElementChild;
|
|
179
169
|
}
|
|
180
|
-
return t && (!
|
|
181
|
-
},
|
|
170
|
+
return t && (!m(t) || !g(t)) ? k(t) : t;
|
|
171
|
+
}, P = (e) => {
|
|
182
172
|
const t = e.target;
|
|
183
|
-
return
|
|
184
|
-
},
|
|
185
|
-
var
|
|
173
|
+
return L(t);
|
|
174
|
+
}, L = (e) => {
|
|
175
|
+
var n;
|
|
186
176
|
let t;
|
|
187
177
|
if (e.nextElementSibling)
|
|
188
178
|
t = e.nextElementSibling;
|
|
189
179
|
else {
|
|
190
|
-
const
|
|
191
|
-
t =
|
|
180
|
+
const l = (n = e.parentElement) == null ? void 0 : n.nextElementSibling;
|
|
181
|
+
t = l == null ? void 0 : l.firstElementChild;
|
|
192
182
|
}
|
|
193
|
-
return t && (!
|
|
194
|
-
},
|
|
195
|
-
const
|
|
196
|
-
return
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
return
|
|
200
|
-
},
|
|
183
|
+
return t && (!m(t) || !g(t)) ? L(t) : t;
|
|
184
|
+
}, K = (e) => {
|
|
185
|
+
const l = e.target.parentElement.firstElementChild;
|
|
186
|
+
return l && (!m(l) || !g(l)) ? L(l) : l;
|
|
187
|
+
}, W = (e) => {
|
|
188
|
+
const l = e.target.parentElement.lastElementChild;
|
|
189
|
+
return l && (!m(l) || !g(l)) ? k(l) : l;
|
|
190
|
+
}, C = ["alt", "control", "shift", "meta"], Z = {
|
|
201
191
|
ArrowUp: "up",
|
|
202
192
|
ArrowDown: "down",
|
|
203
193
|
ArrowLeft: "left",
|
|
204
194
|
ArrowRight: "right"
|
|
205
|
-
},
|
|
195
|
+
}, ee = {
|
|
206
196
|
"keydown.up": (e) => {
|
|
207
|
-
const t =
|
|
197
|
+
const t = x(e);
|
|
208
198
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
209
199
|
},
|
|
210
200
|
"keydown.down": (e) => {
|
|
211
|
-
const t =
|
|
201
|
+
const t = D(e);
|
|
212
202
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
213
203
|
},
|
|
214
204
|
"keydown.left": (e) => {
|
|
215
|
-
const t =
|
|
205
|
+
const t = R(e);
|
|
216
206
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
217
207
|
},
|
|
218
208
|
"keydown.right": (e) => {
|
|
219
|
-
const t =
|
|
209
|
+
const t = P(e);
|
|
220
210
|
e.preventDefault(), e.stopPropagation(), t && t.focus();
|
|
221
211
|
},
|
|
222
212
|
"keydown.control.up": (e) => {
|
|
223
|
-
const t =
|
|
213
|
+
const t = X(e);
|
|
224
214
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
225
215
|
},
|
|
226
216
|
"keydown.control.down": (e) => {
|
|
227
|
-
const t =
|
|
217
|
+
const t = Y(e);
|
|
228
218
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
229
219
|
},
|
|
230
220
|
"keydown.control.left": (e) => {
|
|
231
|
-
const t =
|
|
221
|
+
const t = K(e);
|
|
232
222
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
233
223
|
},
|
|
234
224
|
"keydown.control.right": (e) => {
|
|
235
|
-
const t =
|
|
225
|
+
const t = W(e);
|
|
236
226
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
237
227
|
},
|
|
238
228
|
"keydown.end": (e) => {
|
|
239
|
-
const t =
|
|
229
|
+
const t = W(e);
|
|
240
230
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
241
231
|
},
|
|
242
232
|
"keydown.enter": (e) => {
|
|
243
233
|
if (e.target instanceof HTMLTableCellElement) {
|
|
244
234
|
e.preventDefault(), e.stopPropagation();
|
|
245
|
-
const
|
|
246
|
-
|
|
235
|
+
const n = D(e);
|
|
236
|
+
n && n.focus();
|
|
247
237
|
}
|
|
248
238
|
},
|
|
249
239
|
"keydown.shift.enter": (e) => {
|
|
250
240
|
if (e.target instanceof HTMLTableCellElement) {
|
|
251
241
|
e.preventDefault(), e.stopPropagation();
|
|
252
|
-
const
|
|
253
|
-
|
|
242
|
+
const n = x(e);
|
|
243
|
+
n && n.focus();
|
|
254
244
|
}
|
|
255
245
|
},
|
|
256
246
|
"keydown.home": (e) => {
|
|
257
|
-
const t =
|
|
247
|
+
const t = K(e);
|
|
258
248
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
259
249
|
},
|
|
260
250
|
"keydown.tab": (e) => {
|
|
261
|
-
const t =
|
|
251
|
+
const t = P(e);
|
|
262
252
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
263
253
|
},
|
|
264
254
|
"keydown.shift.tab": (e) => {
|
|
265
|
-
const t =
|
|
255
|
+
const t = R(e);
|
|
266
256
|
t && (e.preventDefault(), e.stopPropagation(), t.focus());
|
|
267
257
|
}
|
|
268
258
|
};
|
|
269
|
-
function
|
|
270
|
-
const t = (
|
|
271
|
-
let
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
259
|
+
function ne(e) {
|
|
260
|
+
const t = (o) => {
|
|
261
|
+
let r = null;
|
|
262
|
+
return o.parent && (typeof o.parent == "string" ? r = document.querySelector(o.parent) : o.parent instanceof HTMLElement ? r = o.parent : r = o.parent.value), r;
|
|
263
|
+
}, n = (o) => {
|
|
264
|
+
const r = t(o);
|
|
265
|
+
let c = [];
|
|
266
|
+
if (typeof o.selectors == "string")
|
|
267
|
+
c = r ? Array.from(r.querySelectorAll(o.selectors)) : Array.from(document.querySelectorAll(o.selectors));
|
|
268
|
+
else if (Array.isArray(o.selectors))
|
|
269
|
+
for (const a of o.selectors)
|
|
270
|
+
a instanceof HTMLElement ? c.push(a) : c.push(a.$el);
|
|
271
|
+
else if (o.selectors instanceof HTMLElement)
|
|
272
|
+
c.push(o.selectors);
|
|
273
|
+
else if (Array.isArray(o.selectors.value))
|
|
274
|
+
for (const a of o.selectors.value)
|
|
275
|
+
a instanceof HTMLElement ? c.push(a) : c.push(a.$el);
|
|
284
276
|
else
|
|
285
|
-
|
|
286
|
-
return
|
|
287
|
-
},
|
|
288
|
-
const
|
|
289
|
-
|
|
277
|
+
c.push(o.selectors.value);
|
|
278
|
+
return c;
|
|
279
|
+
}, l = (o) => {
|
|
280
|
+
const r = t(o);
|
|
281
|
+
let c = [];
|
|
282
|
+
return o.selectors ? c = n(o) : r && (c = Array.from(r.children).filter((f) => m(f) && g(f))), c;
|
|
283
|
+
}, s = (o) => (r) => {
|
|
284
|
+
const c = Z[r.key] || r.key.toLowerCase();
|
|
285
|
+
if (C.includes(c))
|
|
290
286
|
return;
|
|
291
|
-
const
|
|
292
|
-
for (const
|
|
293
|
-
const [
|
|
294
|
-
if (
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
return
|
|
287
|
+
const a = o.handlers || ee;
|
|
288
|
+
for (const f of Object.keys(a)) {
|
|
289
|
+
const [u, ...p] = f.split(".");
|
|
290
|
+
if (u === "keydown" && p.includes(c)) {
|
|
291
|
+
const d = a[f], E = p.filter(($) => C.includes($)), H = C.some(($) => {
|
|
292
|
+
const h = $.charAt(0).toUpperCase() + $.slice(1);
|
|
293
|
+
return r.getModifierState(h);
|
|
298
294
|
});
|
|
299
|
-
if (
|
|
300
|
-
if (
|
|
301
|
-
for (const
|
|
302
|
-
if (
|
|
303
|
-
const
|
|
304
|
-
|
|
295
|
+
if (E.length > 0) {
|
|
296
|
+
if (H) {
|
|
297
|
+
for (const $ of C)
|
|
298
|
+
if (p.includes($)) {
|
|
299
|
+
const h = $.charAt(0).toUpperCase() + $.slice(1);
|
|
300
|
+
r.getModifierState(h) && d(r);
|
|
305
301
|
}
|
|
306
302
|
}
|
|
307
303
|
} else
|
|
308
|
-
|
|
304
|
+
H || d(r);
|
|
309
305
|
}
|
|
310
306
|
}
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
for (const
|
|
314
|
-
const
|
|
315
|
-
for (const
|
|
316
|
-
|
|
307
|
+
}, i = [];
|
|
308
|
+
j(() => {
|
|
309
|
+
for (const o of e) {
|
|
310
|
+
const r = t(o), c = l(o), a = s(o), f = r ? [r] : c;
|
|
311
|
+
for (const u of f) {
|
|
312
|
+
const { focused: p } = J(b(u)), d = v(p, (E) => {
|
|
313
|
+
E ? u.addEventListener("keydown", a) : u.removeEventListener("keydown", a);
|
|
314
|
+
});
|
|
315
|
+
i.push(d);
|
|
316
|
+
}
|
|
317
317
|
}
|
|
318
318
|
}), V(() => {
|
|
319
|
-
for (const
|
|
320
|
-
|
|
321
|
-
for (const l of o)
|
|
322
|
-
l.removeEventListener("keydown", r(n));
|
|
323
|
-
}
|
|
319
|
+
for (const o of i)
|
|
320
|
+
o();
|
|
324
321
|
});
|
|
325
322
|
}
|
|
326
|
-
function
|
|
323
|
+
function le(e) {
|
|
327
324
|
}
|
|
328
325
|
export {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
326
|
+
ee as defaultKeypressHandlers,
|
|
327
|
+
le as install,
|
|
328
|
+
ne as useKeyboardNav
|
|
332
329
|
};
|
|
333
330
|
//# sourceMappingURL=utilities.js.map
|