@featherk/composables 0.11.0 → 0.11.2
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/README.md +6 -0
- package/dist/featherk-composables.es.js +740 -706
- package/dist/featherk-composables.es.js.map +1 -1
- package/dist/featherk-composables.umd.js +1 -1
- package/dist/featherk-composables.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/menu/usePopupMenu.d.ts +11 -3
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/useActiveIdRegistry.d.ts +35 -0
- package/dist/registry/useActiveIdRegistry.test.d.ts +1 -0
- package/docs/menu/usePopupMenu.md +123 -25
- package/docs/registry/useActiveIdRegistry.md +136 -0
- package/package.json +6 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { useFocusTrap as
|
|
3
|
-
const
|
|
4
|
-
const r =
|
|
5
|
-
let
|
|
6
|
-
const
|
|
1
|
+
import { ref as O, onBeforeUnmount as Pe, nextTick as B, computed as v, watchEffect as Te, toValue as le, reactive as Ve, watch as ue, unref as Le, onUnmounted as Ne, shallowReactive as Ke, readonly as Q, onMounted as Me, shallowRef as qe } from "vue";
|
|
2
|
+
import { useFocusTrap as Oe } from "@vueuse/integrations/useFocusTrap";
|
|
3
|
+
const dt = (e, t) => {
|
|
4
|
+
const r = O(null);
|
|
5
|
+
let y = !1, f = null, m = null;
|
|
6
|
+
const A = [], x = ".k-table-row[data-grid-row-index] [tabindex]", C = () => {
|
|
7
7
|
const s = e?.value?.$el;
|
|
8
8
|
return s ? s.closest(".k-grid") : null;
|
|
9
|
-
},
|
|
10
|
-
const w =
|
|
9
|
+
}, $ = (s) => {
|
|
10
|
+
const w = C();
|
|
11
11
|
if (!w) return !1;
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
return w.contains(
|
|
12
|
+
const p = s.closest(".k-grid-aria-root");
|
|
13
|
+
if (p)
|
|
14
|
+
return w.contains(p);
|
|
15
15
|
const b = s.closest(
|
|
16
16
|
".k-grid-header, .k-grid-content, .k-grid-content-locked"
|
|
17
17
|
);
|
|
18
18
|
return b ? w.contains(b) : !1;
|
|
19
|
-
},
|
|
19
|
+
}, D = (s) => s.key === "Enter" || s.code === "Enter" || s.code === "NumpadEnter", F = () => e?.value?.columns, E = (s) => {
|
|
20
20
|
const w = s.key || s.code;
|
|
21
|
-
([" ", "Spacebar", "Space"].includes(w) ||
|
|
21
|
+
([" ", "Spacebar", "Space"].includes(w) || D(s)) && (s.preventDefault(), s.stopPropagation(), r.value = s.target, s.target.click());
|
|
22
22
|
}, k = (s) => {
|
|
23
23
|
if (!r.value) return;
|
|
24
24
|
if (s.code === "Escape") {
|
|
@@ -29,10 +29,10 @@ const st = (e, t) => {
|
|
|
29
29
|
document.querySelectorAll(
|
|
30
30
|
".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
|
|
31
31
|
)
|
|
32
|
-
),
|
|
32
|
+
), p = document.querySelector(
|
|
33
33
|
".k-animation-container .k-popup .k-column-menu .k-filter-menu-container"
|
|
34
34
|
);
|
|
35
|
-
if (
|
|
35
|
+
if (p) {
|
|
36
36
|
if (s.code === "Tab") {
|
|
37
37
|
const b = [
|
|
38
38
|
// ".k-filter-menu-container .k-dropdownlist[tabindex='0']",
|
|
@@ -43,23 +43,23 @@ const st = (e, t) => {
|
|
|
43
43
|
"input.k-input-inner:not([tabindex='-1']):not([disabled])",
|
|
44
44
|
"button:not([tabindex='-1']):not([disabled])",
|
|
45
45
|
".k-checkbox"
|
|
46
|
-
],
|
|
47
|
-
|
|
46
|
+
], M = t?.focusableMenuSelectors ?? b, S = Array.from(
|
|
47
|
+
p.querySelectorAll(M.join(","))
|
|
48
48
|
);
|
|
49
49
|
if (S.length === 0) return;
|
|
50
|
-
const
|
|
50
|
+
const T = S.findIndex(
|
|
51
51
|
(W) => W === document.activeElement
|
|
52
52
|
);
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
let K;
|
|
54
|
+
T === -1 ? K = 0 : s.shiftKey ? K = (T - 1 + S.length) % S.length : K = (T + 1) % S.length, s.preventDefault(), s.stopPropagation(), S[K]?.focus();
|
|
55
55
|
}
|
|
56
56
|
} else if (s.code === "ArrowUp" || s.code === "ArrowDown") {
|
|
57
57
|
s.preventDefault(), s.stopPropagation();
|
|
58
58
|
const b = w.findIndex(
|
|
59
59
|
(S) => S === document.activeElement
|
|
60
60
|
);
|
|
61
|
-
let
|
|
62
|
-
s.code === "ArrowUp" ?
|
|
61
|
+
let M = b;
|
|
62
|
+
s.code === "ArrowUp" ? M = b > 0 ? b - 1 : w.length - 1 : s.code === "ArrowDown" && (M = b < w.length - 1 ? b + 1 : 0), w[M]?.focus();
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
if (s.code === "Tab") {
|
|
@@ -69,12 +69,12 @@ const st = (e, t) => {
|
|
|
69
69
|
"button, [role='button'], .k-link"
|
|
70
70
|
)?.focus();
|
|
71
71
|
}
|
|
72
|
-
},
|
|
73
|
-
|
|
72
|
+
}, R = () => {
|
|
73
|
+
f = new MutationObserver((s) => {
|
|
74
74
|
s.forEach((w) => {
|
|
75
|
-
w.addedNodes.forEach((
|
|
76
|
-
if (
|
|
77
|
-
const b =
|
|
75
|
+
w.addedNodes.forEach((p) => {
|
|
76
|
+
if (p.nodeType === Node.ELEMENT_NODE) {
|
|
77
|
+
const b = p;
|
|
78
78
|
if (b.classList.contains("k-animation-container")) {
|
|
79
79
|
const S = r.value;
|
|
80
80
|
S && (S.dataset.featherKSortable === "true" || B(() => {
|
|
@@ -87,21 +87,21 @@ const st = (e, t) => {
|
|
|
87
87
|
"keydown",
|
|
88
88
|
k
|
|
89
89
|
), B(() => {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
90
|
+
const T = () => {
|
|
91
|
+
const K = Array.from(
|
|
92
92
|
b.querySelectorAll(
|
|
93
93
|
".k-animation-container .k-popup .k-column-menu .k-columnmenu-item-wrapper .k-columnmenu-item"
|
|
94
94
|
)
|
|
95
95
|
);
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
else if (
|
|
99
|
-
|
|
96
|
+
if (K.length === 1)
|
|
97
|
+
K[0].focus(), K[0].click(), T.attempts = 0;
|
|
98
|
+
else if (K.length > 1) {
|
|
99
|
+
T.attempts = 0;
|
|
100
100
|
return;
|
|
101
101
|
} else
|
|
102
|
-
|
|
102
|
+
T.attempts === void 0 && (T.attempts = 0), T.attempts++ < 3 && setTimeout(T, 200);
|
|
103
103
|
};
|
|
104
|
-
|
|
104
|
+
T();
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
b.querySelectorAll(
|
|
@@ -113,9 +113,9 @@ const st = (e, t) => {
|
|
|
113
113
|
);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
}), w.removedNodes.forEach((
|
|
117
|
-
if (
|
|
118
|
-
const b =
|
|
116
|
+
}), w.removedNodes.forEach((p) => {
|
|
117
|
+
if (p.nodeType === Node.ELEMENT_NODE) {
|
|
118
|
+
const b = p;
|
|
119
119
|
b.classList.contains("k-animation-container") && b.removeEventListener(
|
|
120
120
|
"keydown",
|
|
121
121
|
k
|
|
@@ -130,7 +130,7 @@ const st = (e, t) => {
|
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
}),
|
|
133
|
+
}), f.observe(document.body, {
|
|
134
134
|
childList: !0,
|
|
135
135
|
subtree: !0
|
|
136
136
|
});
|
|
@@ -144,28 +144,28 @@ const st = (e, t) => {
|
|
|
144
144
|
return;
|
|
145
145
|
const w = s.target;
|
|
146
146
|
if (!w) return;
|
|
147
|
-
const
|
|
147
|
+
const p = w.closest(
|
|
148
148
|
".k-table-row[data-grid-row-index]"
|
|
149
149
|
);
|
|
150
|
-
if (
|
|
150
|
+
if (!$(w))
|
|
151
151
|
return;
|
|
152
152
|
const b = ["ArrowLeft", "ArrowRight"].includes(
|
|
153
153
|
s.code
|
|
154
154
|
);
|
|
155
|
-
if (!(u(w) && !(
|
|
155
|
+
if (!(u(w) && !(p && b))) {
|
|
156
156
|
if (s.code === "Escape") {
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
157
|
+
const M = document.activeElement?.closest(".k-table-row[data-grid-row-index]");
|
|
158
|
+
if (M) {
|
|
159
159
|
s.preventDefault(), s.stopPropagation();
|
|
160
160
|
try {
|
|
161
161
|
Array.from(
|
|
162
162
|
e?.value.$el.querySelectorAll(
|
|
163
163
|
".k-table-row[data-grid-row-index]"
|
|
164
164
|
)
|
|
165
|
-
).forEach((
|
|
165
|
+
).forEach((T) => T.setAttribute("tabindex", "-1"));
|
|
166
166
|
} catch {
|
|
167
167
|
}
|
|
168
|
-
|
|
168
|
+
M.setAttribute("tabindex", "0"), M.focus();
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -182,11 +182,11 @@ const st = (e, t) => {
|
|
|
182
182
|
r.value = w;
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (p) {
|
|
186
186
|
if (["ArrowDown", "ArrowUp"].includes(s.code)) {
|
|
187
187
|
s.preventDefault(), s.stopPropagation();
|
|
188
|
-
const
|
|
189
|
-
let W =
|
|
188
|
+
const M = (T, K) => {
|
|
189
|
+
let W = K === "next" ? T.nextElementSibling : T.previousElementSibling;
|
|
190
190
|
for (; W; ) {
|
|
191
191
|
const re = W;
|
|
192
192
|
try {
|
|
@@ -194,27 +194,27 @@ const st = (e, t) => {
|
|
|
194
194
|
return re;
|
|
195
195
|
} catch {
|
|
196
196
|
}
|
|
197
|
-
W =
|
|
197
|
+
W = K === "next" ? W.nextElementSibling : W.previousElementSibling;
|
|
198
198
|
}
|
|
199
199
|
return null;
|
|
200
|
-
}, S = s.code === "ArrowDown" ?
|
|
201
|
-
S && (
|
|
200
|
+
}, S = s.code === "ArrowDown" ? M(p, "next") : M(p, "previous");
|
|
201
|
+
S && (p.setAttribute("tabindex", "-1"), S.setAttribute("tabindex", "0"), S.focus());
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
if (["ArrowLeft", "ArrowRight"].includes(s.code)) {
|
|
205
205
|
s.preventDefault(), s.stopPropagation();
|
|
206
|
-
const
|
|
207
|
-
|
|
206
|
+
const M = p.querySelectorAll(
|
|
207
|
+
x
|
|
208
208
|
);
|
|
209
|
-
if (
|
|
210
|
-
let S = Array.from(
|
|
211
|
-
(
|
|
209
|
+
if (M.length === 0) return;
|
|
210
|
+
let S = Array.from(M).findIndex(
|
|
211
|
+
(T) => T === document.activeElement
|
|
212
212
|
);
|
|
213
|
-
if (S === -1 && document.activeElement ===
|
|
214
|
-
|
|
213
|
+
if (S === -1 && document.activeElement === p) {
|
|
214
|
+
M[0].focus();
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
s.code === "ArrowRight" ? S = S ===
|
|
217
|
+
s.code === "ArrowRight" ? S = S === M.length - 1 ? 0 : S + 1 : s.code === "ArrowLeft" && (S = S === 0 ? M.length - 1 : S - 1), M[S].focus();
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
@@ -227,7 +227,7 @@ const st = (e, t) => {
|
|
|
227
227
|
const w = s.closest(".k-grid");
|
|
228
228
|
w && w.classList.add("fk-grid");
|
|
229
229
|
});
|
|
230
|
-
},
|
|
230
|
+
}, h = () => {
|
|
231
231
|
if (!m)
|
|
232
232
|
try {
|
|
233
233
|
const s = () => {
|
|
@@ -238,12 +238,12 @@ const st = (e, t) => {
|
|
|
238
238
|
)
|
|
239
239
|
);
|
|
240
240
|
if (!b || b.length === 0 || b.filter(
|
|
241
|
-
(
|
|
241
|
+
(T) => T.getAttribute("tabindex") === "0"
|
|
242
242
|
).length === 1) return;
|
|
243
243
|
const S = b.find(
|
|
244
|
-
(
|
|
244
|
+
(T) => T === document.activeElement || T.contains(document.activeElement)
|
|
245
245
|
);
|
|
246
|
-
if (b.forEach((
|
|
246
|
+
if (b.forEach((T) => T.setAttribute("tabindex", "-1")), S) {
|
|
247
247
|
S.setAttribute("tabindex", "0");
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
@@ -256,110 +256,110 @@ const st = (e, t) => {
|
|
|
256
256
|
".k-table-row[data-grid-row-index]"
|
|
257
257
|
)
|
|
258
258
|
);
|
|
259
|
-
w.length > 0 && w.forEach((b,
|
|
260
|
-
b.setAttribute("tabindex",
|
|
259
|
+
w.length > 0 && w.forEach((b, M) => {
|
|
260
|
+
b.setAttribute("tabindex", M === 0 ? "0" : "-1");
|
|
261
261
|
});
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const p = e.value.$el.querySelector(".k-table-tbody");
|
|
263
|
+
p && (m = new MutationObserver(() => {
|
|
264
264
|
s();
|
|
265
|
-
}), m.observe(
|
|
265
|
+
}), m.observe(p, { childList: !0, subtree: !0 }));
|
|
266
266
|
} catch (s) {
|
|
267
267
|
console.error("Error setting up row navigation:", s);
|
|
268
268
|
}
|
|
269
|
-
},
|
|
269
|
+
}, L = () => {
|
|
270
270
|
B(() => {
|
|
271
271
|
const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
|
|
272
|
-
w && w.forEach((
|
|
273
|
-
|
|
272
|
+
w && w.forEach((p) => {
|
|
273
|
+
p.setAttribute("role", "button"), p.addEventListener(
|
|
274
274
|
"keydown",
|
|
275
275
|
E
|
|
276
276
|
);
|
|
277
|
-
}),
|
|
277
|
+
}), R(), z();
|
|
278
278
|
});
|
|
279
279
|
}, Y = () => {
|
|
280
280
|
const w = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
|
|
281
|
-
w && w.forEach((
|
|
282
|
-
|
|
281
|
+
w && w.forEach((p) => {
|
|
282
|
+
p.removeEventListener(
|
|
283
283
|
"keydown",
|
|
284
284
|
E
|
|
285
285
|
);
|
|
286
|
-
}),
|
|
286
|
+
}), f && (f.disconnect(), f = null), m && (m.disconnect(), m = null), A.forEach((p) => p()), A.length = 0;
|
|
287
287
|
}, z = () => {
|
|
288
288
|
document.querySelectorAll(
|
|
289
289
|
".k-grid-header .k-table-thead th"
|
|
290
|
-
).forEach((
|
|
291
|
-
if (
|
|
290
|
+
).forEach((p, b) => {
|
|
291
|
+
if (p.dataset.featherKHeaderBound === "true")
|
|
292
292
|
return;
|
|
293
|
-
const
|
|
293
|
+
const M = p.querySelector(
|
|
294
294
|
".k-grid-header-menu.k-grid-column-menu"
|
|
295
295
|
);
|
|
296
|
-
if (!
|
|
297
|
-
const S =
|
|
296
|
+
if (!M) return;
|
|
297
|
+
const S = F();
|
|
298
298
|
if (S && S[b]) {
|
|
299
299
|
const a = S[b].field ?? "";
|
|
300
|
-
|
|
300
|
+
p.setAttribute("data-feather-k-field", a), p.setAttribute(
|
|
301
301
|
"data-feather-k-filterable",
|
|
302
302
|
S[b].filterable === !1 ? "false" : "true"
|
|
303
|
-
),
|
|
303
|
+
), p.setAttribute(
|
|
304
304
|
"data-feather-k-sortable",
|
|
305
305
|
S[b].sortable === !1 ? "false" : "true"
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
|
-
const
|
|
309
|
-
|
|
308
|
+
const T = p.dataset.featherKFilterable !== "false", K = p.dataset.featherKSortable !== "false";
|
|
309
|
+
M.setAttribute("tabindex", "-1"), T || K ? p.style.cursor = "pointer" : p.style.cursor = "default", T ? (p.setAttribute("tabindex", "0"), p.setAttribute("role", "button"), p.setAttribute("aria-haspopup", "menu")) : (p.setAttribute("tabindex", "0"), p.setAttribute("role", "columnheader"), p.removeAttribute("aria-haspopup"));
|
|
310
310
|
const W = (a) => {
|
|
311
|
-
a.target?.closest(".k-column-resizer") || (r.value =
|
|
311
|
+
a.target?.closest(".k-column-resizer") || (r.value = p, M.click());
|
|
312
312
|
}, re = (a) => {
|
|
313
|
-
if (
|
|
314
|
-
r.value =
|
|
315
|
-
else if (
|
|
316
|
-
r.value =
|
|
317
|
-
const
|
|
318
|
-
|
|
313
|
+
if (T)
|
|
314
|
+
r.value = p, a.preventDefault(), a.stopPropagation(), W(a);
|
|
315
|
+
else if (K) {
|
|
316
|
+
r.value = p;
|
|
317
|
+
const g = p.querySelector(".k-link");
|
|
318
|
+
g && g.click();
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
p.addEventListener("click", re), A.push(() => {
|
|
322
|
+
p.removeEventListener("click", re);
|
|
323
323
|
});
|
|
324
324
|
const se = (a) => {
|
|
325
|
-
if ((
|
|
326
|
-
if (a.preventDefault(), a.stopPropagation(), r.value =
|
|
325
|
+
if ((D(a) || a.code === "Space") && (T || K)) {
|
|
326
|
+
if (a.preventDefault(), a.stopPropagation(), r.value = p, r.value.focus(), T)
|
|
327
327
|
W(a);
|
|
328
|
-
else if (
|
|
329
|
-
const
|
|
330
|
-
|
|
328
|
+
else if (K) {
|
|
329
|
+
const g = p.querySelector(".k-link");
|
|
330
|
+
g && g.click();
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}),
|
|
334
|
+
p.addEventListener("keydown", se, !0), A.push(() => {
|
|
335
|
+
p.removeEventListener("keydown", se, !0);
|
|
336
|
+
}), p.dataset.featherKHeaderBound = "true";
|
|
337
337
|
});
|
|
338
338
|
const w = document.querySelector(".k-grid-header .k-table-thead");
|
|
339
339
|
if (w && w.dataset.featherKHeaderBound !== "true") {
|
|
340
|
-
const
|
|
341
|
-
const
|
|
342
|
-
|
|
340
|
+
const p = (b) => {
|
|
341
|
+
const M = b.target.closest("th");
|
|
342
|
+
M && (D(b) || b.code === "Space") && M.dataset.featherKFilterable === "false" && M.dataset.featherKSortable === "false" && (b.preventDefault(), b.stopImmediatePropagation());
|
|
343
343
|
};
|
|
344
344
|
w.addEventListener(
|
|
345
345
|
"keydown",
|
|
346
|
-
|
|
346
|
+
p,
|
|
347
347
|
!0
|
|
348
348
|
// NOTE: capture phase
|
|
349
|
-
),
|
|
349
|
+
), A.push(() => {
|
|
350
350
|
w.removeEventListener(
|
|
351
351
|
"keydown",
|
|
352
|
-
|
|
352
|
+
p,
|
|
353
353
|
!0
|
|
354
354
|
);
|
|
355
355
|
}), w.dataset.featherKHeaderBound = "true";
|
|
356
356
|
}
|
|
357
357
|
}, _ = function(s, w) {
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
const
|
|
361
|
-
if (!
|
|
362
|
-
if (S && !
|
|
358
|
+
const p = s?.event?.event.target, b = F();
|
|
359
|
+
if (!p || !b) return;
|
|
360
|
+
const M = p.classList.contains("k-grid-header-menu"), S = p.classList.contains("k-columnmenu-item"), T = b.find((K) => K.field === s?.event?.field)?.sortable && !0;
|
|
361
|
+
if (!M) {
|
|
362
|
+
if (S && !T) {
|
|
363
363
|
s?.event?.sort?.filter(
|
|
364
364
|
(W) => W.field !== s?.event?.field
|
|
365
365
|
);
|
|
@@ -372,9 +372,9 @@ const st = (e, t) => {
|
|
|
372
372
|
});
|
|
373
373
|
}
|
|
374
374
|
}, ee = () => {
|
|
375
|
-
if (!
|
|
375
|
+
if (!y)
|
|
376
376
|
try {
|
|
377
|
-
l(),
|
|
377
|
+
l(), h(), L(), y = !0;
|
|
378
378
|
} catch (s) {
|
|
379
379
|
console.error("initA11y failed:", s), Y();
|
|
380
380
|
}
|
|
@@ -387,11 +387,11 @@ const st = (e, t) => {
|
|
|
387
387
|
handleSortChange: _,
|
|
388
388
|
initA11y: ee
|
|
389
389
|
};
|
|
390
|
-
},
|
|
390
|
+
}, Ue = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), Be = (e) => !!e && typeof e == "object" && "field" in e, Re = (e, t) => !e || typeof e != "object" ? !1 : Ue(e) ? e.filters.some(
|
|
391
391
|
(r) => Re(r, t)
|
|
392
|
-
) :
|
|
392
|
+
) : Be(e) ? e.field === t : !1, ft = (e) => (t) => e.value?.filters && e.value.filters.some(
|
|
393
393
|
(r) => Re(r, t)
|
|
394
|
-
) ? "active" : "",
|
|
394
|
+
) ? "active" : "", Ye = [
|
|
395
395
|
"button",
|
|
396
396
|
"a",
|
|
397
397
|
"input",
|
|
@@ -409,53 +409,53 @@ const st = (e, t) => {
|
|
|
409
409
|
".k-hierarchy-cell",
|
|
410
410
|
".k-grid-header-menu",
|
|
411
411
|
".k-column-menu"
|
|
412
|
-
],
|
|
412
|
+
], pt = (e) => {
|
|
413
413
|
const {
|
|
414
414
|
onRowAction: t,
|
|
415
415
|
gridRef: r,
|
|
416
|
-
dataItems:
|
|
417
|
-
ignoreSelectors:
|
|
416
|
+
dataItems: y,
|
|
417
|
+
ignoreSelectors: f = [],
|
|
418
418
|
shouldIgnoreTarget: m,
|
|
419
|
-
enableKeyboardAction:
|
|
420
|
-
} = e,
|
|
421
|
-
...
|
|
422
|
-
...
|
|
423
|
-
],
|
|
419
|
+
enableKeyboardAction: A = !0
|
|
420
|
+
} = e, x = [
|
|
421
|
+
...Ye,
|
|
422
|
+
...f
|
|
423
|
+
], C = (u, i) => {
|
|
424
424
|
if (!u) return !1;
|
|
425
|
-
const l =
|
|
425
|
+
const l = x.join(",");
|
|
426
426
|
return u.closest && u.closest(l) ? !0 : m && i ? m(u, i) : !1;
|
|
427
|
-
},
|
|
427
|
+
}, $ = (u) => {
|
|
428
428
|
const l = u?.closest?.(
|
|
429
429
|
".k-table-row[data-grid-row-index]"
|
|
430
430
|
)?.getAttribute("data-grid-row-index");
|
|
431
431
|
if (l == null) return;
|
|
432
|
-
const
|
|
433
|
-
return Number.isNaN(
|
|
434
|
-
},
|
|
432
|
+
const h = parseInt(l, 10);
|
|
433
|
+
return Number.isNaN(h) ? void 0 : h;
|
|
434
|
+
}, D = (u) => {
|
|
435
435
|
if (!u || typeof u.clientX != "number")
|
|
436
436
|
return;
|
|
437
|
-
const i = typeof window < "u" && window.scrollX || 0, l = typeof window < "u" && window.scrollY || 0,
|
|
437
|
+
const i = typeof window < "u" && window.scrollX || 0, l = typeof window < "u" && window.scrollY || 0, h = typeof window < "u" && window.screenX || 0, L = typeof window < "u" && window.screenY || 0;
|
|
438
438
|
return {
|
|
439
439
|
clientX: u.clientX,
|
|
440
440
|
clientY: u.clientY,
|
|
441
441
|
pageX: typeof u.pageX == "number" ? u.pageX : u.clientX + i,
|
|
442
442
|
pageY: typeof u.pageY == "number" ? u.pageY : u.clientY + l,
|
|
443
|
-
screenX: typeof u.screenX == "number" ? u.screenX : u.clientX +
|
|
444
|
-
screenY: typeof u.screenY == "number" ? u.screenY : u.clientY +
|
|
443
|
+
screenX: typeof u.screenX == "number" ? u.screenX : u.clientX + h,
|
|
444
|
+
screenY: typeof u.screenY == "number" ? u.screenY : u.clientY + L
|
|
445
445
|
};
|
|
446
|
-
},
|
|
446
|
+
}, F = (u) => {
|
|
447
447
|
if (!u || typeof u.getBoundingClientRect != "function")
|
|
448
448
|
return;
|
|
449
449
|
const i = u.getBoundingClientRect();
|
|
450
450
|
if (!i) return;
|
|
451
|
-
const l = i.left,
|
|
451
|
+
const l = i.left, h = i.bottom, L = typeof window < "u" && window.scrollX || 0, Y = typeof window < "u" && window.scrollY || 0;
|
|
452
452
|
return {
|
|
453
453
|
clientX: l,
|
|
454
|
-
clientY:
|
|
455
|
-
pageX: l +
|
|
456
|
-
pageY:
|
|
454
|
+
clientY: h,
|
|
455
|
+
pageX: l + L,
|
|
456
|
+
pageY: h + Y,
|
|
457
457
|
screenX: l,
|
|
458
|
-
screenY:
|
|
458
|
+
screenY: h
|
|
459
459
|
};
|
|
460
460
|
}, E = (u) => {
|
|
461
461
|
if (typeof window > "u") return !1;
|
|
@@ -463,7 +463,7 @@ const st = (e, t) => {
|
|
|
463
463
|
if (!i || i.isCollapsed || !i.toString().trim())
|
|
464
464
|
return !1;
|
|
465
465
|
if (u && i.anchorNode && i.focusNode) {
|
|
466
|
-
const l = u.closest(".k-table-row") || u.closest(".k-grid") || u,
|
|
466
|
+
const l = u.closest(".k-table-row") || u.closest(".k-grid") || u, h = i.anchorNode.nodeType === Node.ELEMENT_NODE ? i.anchorNode : i.anchorNode.parentElement, L = i.focusNode.nodeType === Node.ELEMENT_NODE ? i.focusNode : i.focusNode.parentElement, Y = !!(h && l.contains(h)), z = !!(L && l.contains(L));
|
|
467
467
|
return Y || z;
|
|
468
468
|
}
|
|
469
469
|
return !0;
|
|
@@ -474,11 +474,11 @@ const st = (e, t) => {
|
|
|
474
474
|
if (i && i.button !== void 0 && i.button !== 0)
|
|
475
475
|
return;
|
|
476
476
|
const l = i?.target || u?.target;
|
|
477
|
-
if (l &&
|
|
477
|
+
if (l && C(l, i || u) || E(l))
|
|
478
478
|
return;
|
|
479
|
-
const
|
|
479
|
+
const h = {
|
|
480
480
|
dataItem: u.dataItem,
|
|
481
|
-
rowIndex: u.rowIndex ??
|
|
481
|
+
rowIndex: u.rowIndex ?? $(l),
|
|
482
482
|
field: u.field,
|
|
483
483
|
event: i || u,
|
|
484
484
|
triggerType: "click",
|
|
@@ -486,26 +486,26 @@ const st = (e, t) => {
|
|
|
486
486
|
shiftKey: !!i?.shiftKey,
|
|
487
487
|
metaKey: !!i?.metaKey,
|
|
488
488
|
altKey: !!i?.altKey,
|
|
489
|
-
coordinates:
|
|
489
|
+
coordinates: D(i) ?? F(l)
|
|
490
490
|
};
|
|
491
|
-
t(u.dataItem,
|
|
491
|
+
t(u.dataItem, h);
|
|
492
492
|
},
|
|
493
493
|
handleRowKeyDown: (u, i) => {
|
|
494
|
-
if (!
|
|
494
|
+
if (!A) return;
|
|
495
495
|
const l = u.key || u.code;
|
|
496
496
|
if (!(l === "Enter" || l === "NumpadEnter" || l === " " || l === "Space" || u.code === "Enter" || u.code === "NumpadEnter" || u.code === "Space")) return;
|
|
497
|
-
const
|
|
498
|
-
if (!
|
|
499
|
-
const Y =
|
|
497
|
+
const L = u.target;
|
|
498
|
+
if (!L) return;
|
|
499
|
+
const Y = L.closest(
|
|
500
500
|
".k-table-row[data-grid-row-index], .k-table-row"
|
|
501
501
|
);
|
|
502
|
-
if (!Y ||
|
|
502
|
+
if (!Y || C(L, u))
|
|
503
503
|
return;
|
|
504
504
|
u.preventDefault(), u.stopPropagation();
|
|
505
505
|
const z = Y.getAttribute("data-grid-row-index"), _ = z !== null ? parseInt(z, 10) : void 0;
|
|
506
506
|
let ee = i;
|
|
507
507
|
if (ee === void 0) {
|
|
508
|
-
const w = (Array.isArray(
|
|
508
|
+
const w = (Array.isArray(y) ? y : y?.value) || r?.value?.props?.dataItems || r?.value?.dataItems;
|
|
509
509
|
w && _ !== void 0 && _ >= 0 && _ < w.length && (ee = w[_]);
|
|
510
510
|
}
|
|
511
511
|
if (ee === void 0) return;
|
|
@@ -518,23 +518,23 @@ const st = (e, t) => {
|
|
|
518
518
|
shiftKey: !!u.shiftKey,
|
|
519
519
|
metaKey: !!u.metaKey,
|
|
520
520
|
altKey: !!u.altKey,
|
|
521
|
-
coordinates:
|
|
521
|
+
coordinates: F(Y)
|
|
522
522
|
};
|
|
523
523
|
t(ee, s);
|
|
524
524
|
},
|
|
525
|
-
isIgnoredTarget:
|
|
525
|
+
isIgnoredTarget: C
|
|
526
526
|
};
|
|
527
|
-
},
|
|
527
|
+
}, ze = "Enter a valid ZIP code with exactly 5 or 9 digits.", Ce = (e) => {
|
|
528
528
|
const t = e.replace(/\D/g, "").slice(0, 9);
|
|
529
529
|
return t.length > 5 ? `${t.slice(0, 5)}-${t.slice(5)}` : t;
|
|
530
|
-
},
|
|
531
|
-
const t =
|
|
532
|
-
e.errorMessage?.trim() ||
|
|
533
|
-
),
|
|
534
|
-
const k =
|
|
530
|
+
}, He = (e, t) => e.slice(0, Math.max(0, t)).replace(/\D/g, "").length, Ze = (e) => e <= 5 ? e : Math.min(e + 1, 10), Xe = (e) => {
|
|
531
|
+
const t = O(Ce(e.initialValue ?? "")), r = O(!1), y = O(
|
|
532
|
+
e.errorMessage?.trim() || ze
|
|
533
|
+
), f = v(() => t.value.replace(/\D/g, "")), m = v(() => {
|
|
534
|
+
const k = f.value.length;
|
|
535
535
|
return k === 5 || k === 9;
|
|
536
|
-
}),
|
|
537
|
-
const u =
|
|
536
|
+
}), A = v(() => r.value && !m.value), x = v(() => !r.value || m.value), C = v(() => r.value), $ = (k, R) => {
|
|
537
|
+
const u = Ze(R);
|
|
538
538
|
B(() => {
|
|
539
539
|
k.isConnected && k.setSelectionRange(u, u);
|
|
540
540
|
});
|
|
@@ -543,91 +543,91 @@ const st = (e, t) => {
|
|
|
543
543
|
// writable state
|
|
544
544
|
zipDisplay: t,
|
|
545
545
|
submitted: r,
|
|
546
|
-
errorMessage:
|
|
546
|
+
errorMessage: y,
|
|
547
547
|
// bindings
|
|
548
548
|
wrapperClass: "fk-zip-textbox",
|
|
549
549
|
// derived state
|
|
550
|
-
zipRaw:
|
|
550
|
+
zipRaw: f,
|
|
551
551
|
isZipValid: m,
|
|
552
|
-
showZipError:
|
|
553
|
-
textBoxValid:
|
|
554
|
-
textBoxValidate:
|
|
552
|
+
showZipError: A,
|
|
553
|
+
textBoxValid: x,
|
|
554
|
+
textBoxValidate: C,
|
|
555
555
|
// actions
|
|
556
556
|
handleZipInput: (...k) => {
|
|
557
|
-
const
|
|
557
|
+
const R = k[0], i = R?.event?.target, l = R?.value, h = Array.isArray(l) ? l.join("") : String(l ?? ""), L = i?.selectionStart !== void 0 && i.selectionStart !== null ? He(
|
|
558
558
|
i.value,
|
|
559
559
|
i.selectionStart
|
|
560
|
-
) :
|
|
561
|
-
t.value = Ce(
|
|
560
|
+
) : h.replace(/\D/g, "").length;
|
|
561
|
+
t.value = Ce(h), i && $(i, L);
|
|
562
562
|
},
|
|
563
563
|
submitAndValidate: (k) => {
|
|
564
564
|
r.value = !0;
|
|
565
|
-
const
|
|
566
|
-
return !
|
|
565
|
+
const R = m.value;
|
|
566
|
+
return !R && k?.focus && B(() => {
|
|
567
567
|
document.getElementById(
|
|
568
568
|
e.id
|
|
569
569
|
)?.focus();
|
|
570
|
-
}),
|
|
570
|
+
}), R;
|
|
571
571
|
},
|
|
572
|
-
buildPayload: () => ({ zip:
|
|
572
|
+
buildPayload: () => ({ zip: f.value })
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
|
-
function
|
|
576
|
-
const r =
|
|
575
|
+
function We(e, t) {
|
|
576
|
+
const r = O(!1);
|
|
577
577
|
Te(() => {
|
|
578
578
|
e.value?.setAttribute("aria-invalid", String(!t.isValid()));
|
|
579
579
|
});
|
|
580
|
-
function
|
|
581
|
-
const
|
|
582
|
-
(!
|
|
580
|
+
function y(m) {
|
|
581
|
+
const A = e.value ?? m.currentTarget, x = m.relatedTarget;
|
|
582
|
+
(!A || !A.contains(x)) && (r.value = !0);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function f() {
|
|
585
585
|
r.value = !1;
|
|
586
586
|
}
|
|
587
|
-
return { touched: r, onFocusout:
|
|
587
|
+
return { touched: r, onFocusout: y, reset: f };
|
|
588
588
|
}
|
|
589
|
-
function
|
|
590
|
-
const r =
|
|
589
|
+
function je(e, t) {
|
|
590
|
+
const r = O(!1), y = O(!1), f = v(
|
|
591
591
|
() => le(t.submitted) || r.value
|
|
592
|
-
), m =
|
|
592
|
+
), m = v(() => !f.value || t.isValid()), A = We(e, {
|
|
593
593
|
isValid: () => m.value
|
|
594
594
|
});
|
|
595
|
-
function
|
|
596
|
-
return
|
|
595
|
+
function x(E) {
|
|
596
|
+
return v(() => !f.value || le(E));
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function C(E) {
|
|
599
599
|
return Object.fromEntries(
|
|
600
|
-
Object.entries(E).map(([k,
|
|
600
|
+
Object.entries(E).map(([k, R]) => [
|
|
601
601
|
k,
|
|
602
|
-
|
|
602
|
+
x(R)
|
|
603
603
|
])
|
|
604
604
|
);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function $(E) {
|
|
607
607
|
const k = le(E);
|
|
608
608
|
if (!k) return;
|
|
609
609
|
k.querySelector(
|
|
610
610
|
'.k-invalid input, .k-invalid[tabindex="0"]'
|
|
611
611
|
)?.focus();
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
if (
|
|
615
|
-
|
|
613
|
+
function D(E) {
|
|
614
|
+
if (y.value) {
|
|
615
|
+
y.value = !1;
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
|
-
|
|
618
|
+
A.onFocusout(E), A.touched.value && (r.value = !0);
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
r.value = !1,
|
|
620
|
+
function F() {
|
|
621
|
+
r.value = !1, y.value = !0, A.reset();
|
|
622
622
|
}
|
|
623
623
|
return {
|
|
624
624
|
touched: r,
|
|
625
|
-
fieldsetValidate:
|
|
626
|
-
onFocusout:
|
|
627
|
-
reset:
|
|
628
|
-
createFieldValidity:
|
|
629
|
-
createFieldValidationsMap:
|
|
630
|
-
focusFirstInvalidField:
|
|
625
|
+
fieldsetValidate: f,
|
|
626
|
+
onFocusout: D,
|
|
627
|
+
reset: F,
|
|
628
|
+
createFieldValidity: x,
|
|
629
|
+
createFieldValidationsMap: C,
|
|
630
|
+
focusFirstInvalidField: $
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
const Ge = [
|
|
@@ -689,7 +689,7 @@ function De(e) {
|
|
|
689
689
|
}
|
|
690
690
|
return "";
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function _e() {
|
|
693
693
|
const e = Ve({
|
|
694
694
|
address1: "",
|
|
695
695
|
address2: "",
|
|
@@ -699,134 +699,134 @@ function je() {
|
|
|
699
699
|
});
|
|
700
700
|
return {
|
|
701
701
|
formData: e,
|
|
702
|
-
onAddress1Input: (...
|
|
703
|
-
e.address1 = De(
|
|
702
|
+
onAddress1Input: (...A) => {
|
|
703
|
+
e.address1 = De(A[0]);
|
|
704
704
|
},
|
|
705
|
-
onAddress2Input: (...
|
|
706
|
-
e.address2 = De(
|
|
705
|
+
onAddress2Input: (...A) => {
|
|
706
|
+
e.address2 = De(A[0]);
|
|
707
707
|
},
|
|
708
|
-
onCityInput: (...
|
|
709
|
-
e.city = De(
|
|
708
|
+
onCityInput: (...A) => {
|
|
709
|
+
e.city = De(A[0]);
|
|
710
710
|
},
|
|
711
|
-
onStateChange: (
|
|
712
|
-
e.state =
|
|
711
|
+
onStateChange: (A) => {
|
|
712
|
+
e.state = A.value;
|
|
713
713
|
},
|
|
714
714
|
resetFormData: () => {
|
|
715
715
|
e.address1 = "", e.address2 = "", e.city = "", e.state = null, e.zip = "";
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
718
|
}
|
|
719
|
-
function
|
|
720
|
-
const r =
|
|
721
|
-
zipDisplay:
|
|
722
|
-
zipRaw:
|
|
719
|
+
function Je(e, t = "zip") {
|
|
720
|
+
const r = Xe({ id: t }), {
|
|
721
|
+
zipDisplay: y,
|
|
722
|
+
zipRaw: f,
|
|
723
723
|
isZipValid: m,
|
|
724
|
-
wrapperClass:
|
|
725
|
-
handleZipInput:
|
|
724
|
+
wrapperClass: A,
|
|
725
|
+
handleZipInput: x
|
|
726
726
|
} = r;
|
|
727
|
-
return ue(
|
|
728
|
-
e.zip =
|
|
727
|
+
return ue(f, ($) => {
|
|
728
|
+
e.zip = $;
|
|
729
729
|
}), {
|
|
730
|
-
zipDisplay:
|
|
730
|
+
zipDisplay: y,
|
|
731
731
|
isZipValid: m,
|
|
732
|
-
zipWrapperClass:
|
|
733
|
-
onZipInput:
|
|
732
|
+
zipWrapperClass: A,
|
|
733
|
+
onZipInput: x,
|
|
734
734
|
resetZip: () => {
|
|
735
|
-
|
|
735
|
+
y.value = "", e.zip = "";
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
}
|
|
739
|
-
function
|
|
740
|
-
const t =
|
|
739
|
+
function Qe(e) {
|
|
740
|
+
const t = v(
|
|
741
741
|
() => e.formData.address1.trim() !== ""
|
|
742
|
-
), r =
|
|
743
|
-
() => t.value && r.value &&
|
|
742
|
+
), r = v(() => e.formData.city.trim() !== ""), y = v(() => !!e.formData.state), f = v(() => le(e.isZipValid)), m = v(
|
|
743
|
+
() => t.value && r.value && y.value && f.value
|
|
744
744
|
);
|
|
745
745
|
return {
|
|
746
746
|
strictAddress1Valid: t,
|
|
747
747
|
strictCityValid: r,
|
|
748
|
-
strictStateValid:
|
|
749
|
-
strictZipValid:
|
|
748
|
+
strictStateValid: y,
|
|
749
|
+
strictZipValid: f,
|
|
750
750
|
strictAddressValid: m
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function et(e) {
|
|
754
754
|
if (!e) return;
|
|
755
755
|
e.querySelector(
|
|
756
756
|
'.k-invalid input, .k-invalid[tabindex="0"]'
|
|
757
757
|
)?.focus();
|
|
758
758
|
}
|
|
759
|
-
function
|
|
760
|
-
const r = e ?? t.currentTarget,
|
|
761
|
-
return !r || !r.contains(
|
|
759
|
+
function tt(e, t) {
|
|
760
|
+
const r = e ?? t.currentTarget, y = t.relatedTarget;
|
|
761
|
+
return !r || !r.contains(y);
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
const t =
|
|
763
|
+
function mt(e) {
|
|
764
|
+
const t = O(
|
|
765
765
|
le(e.fieldsetRef)
|
|
766
766
|
);
|
|
767
767
|
Te(() => {
|
|
768
768
|
t.value = le(e.fieldsetRef);
|
|
769
769
|
});
|
|
770
|
-
const r =
|
|
770
|
+
const r = O(!1), y = O(!1), f = v(() => le(e.required) ?? !0), {
|
|
771
771
|
formData: m,
|
|
772
|
-
onAddress1Input:
|
|
773
|
-
onAddress2Input:
|
|
774
|
-
onCityInput:
|
|
775
|
-
onStateChange:
|
|
776
|
-
resetFormData:
|
|
777
|
-
} =
|
|
772
|
+
onAddress1Input: A,
|
|
773
|
+
onAddress2Input: x,
|
|
774
|
+
onCityInput: C,
|
|
775
|
+
onStateChange: $,
|
|
776
|
+
resetFormData: D
|
|
777
|
+
} = _e(), F = `${e.addressId}-zip`, { zipDisplay: E, isZipValid: k, zipWrapperClass: R, onZipInput: u, resetZip: i } = Je(m, F), {
|
|
778
778
|
strictAddress1Valid: l,
|
|
779
|
-
strictCityValid:
|
|
780
|
-
strictStateValid:
|
|
779
|
+
strictCityValid: h,
|
|
780
|
+
strictStateValid: L,
|
|
781
781
|
strictZipValid: Y,
|
|
782
782
|
strictAddressValid: z
|
|
783
|
-
} =
|
|
783
|
+
} = Qe({
|
|
784
784
|
formData: m,
|
|
785
785
|
isZipValid: k
|
|
786
|
-
}), _ =
|
|
786
|
+
}), _ = je(t, {
|
|
787
787
|
submitted: r,
|
|
788
788
|
isValid: () => z.value
|
|
789
|
-
}), { touched: ee, fieldsetValidate: s, onFocusout: w, reset:
|
|
789
|
+
}), { touched: ee, fieldsetValidate: s, onFocusout: w, reset: p } = _, b = _.createFieldValidationsMap({
|
|
790
790
|
address1: l,
|
|
791
|
-
city:
|
|
792
|
-
state:
|
|
791
|
+
city: h,
|
|
792
|
+
state: L,
|
|
793
793
|
zip: Y,
|
|
794
794
|
address: z
|
|
795
795
|
}), {
|
|
796
|
-
address1:
|
|
796
|
+
address1: M,
|
|
797
797
|
city: S,
|
|
798
|
-
state:
|
|
799
|
-
zip:
|
|
798
|
+
state: T,
|
|
799
|
+
zip: K,
|
|
800
800
|
address: W
|
|
801
|
-
} = b, re =
|
|
802
|
-
() =>
|
|
803
|
-
), se =
|
|
804
|
-
() =>
|
|
805
|
-
), a =
|
|
806
|
-
() =>
|
|
807
|
-
),
|
|
808
|
-
() =>
|
|
809
|
-
),
|
|
810
|
-
() =>
|
|
811
|
-
), H =
|
|
812
|
-
() =>
|
|
813
|
-
), Z = { value: null, label: "State" },
|
|
801
|
+
} = b, re = v(
|
|
802
|
+
() => f.value ? s.value : !1
|
|
803
|
+
), se = v(
|
|
804
|
+
() => f.value ? M.value : !0
|
|
805
|
+
), a = v(
|
|
806
|
+
() => f.value ? S.value : !0
|
|
807
|
+
), g = v(
|
|
808
|
+
() => f.value ? T.value : !0
|
|
809
|
+
), V = v(
|
|
810
|
+
() => f.value ? K.value : !0
|
|
811
|
+
), H = v(
|
|
812
|
+
() => f.value ? W.value : !0
|
|
813
|
+
), Z = { value: null, label: "State" }, j = Ge.map(({ label: d, value: I }) => ({
|
|
814
814
|
label: d,
|
|
815
|
-
value:
|
|
816
|
-
})), n =
|
|
815
|
+
value: I
|
|
816
|
+
})), n = v(() => ({
|
|
817
817
|
address1: m.address1.trim(),
|
|
818
818
|
address2: m.address2.trim(),
|
|
819
819
|
city: m.city.trim(),
|
|
820
820
|
state: (m.state ?? "").trim().toUpperCase(),
|
|
821
821
|
zip: m.zip.replace(/\D/g, "")
|
|
822
|
-
})), c =
|
|
822
|
+
})), c = v(() => m.address1.trim() === "" && m.address2.trim() === "" && m.city.trim() === "" && (m.state ?? "").trim() === "" && m.zip.replace(/\D/g, "") === ""), P = v(() => !c.value), q = v(() => !f.value && P.value && (!l.value || !h.value || !L.value)), G = v(() => {
|
|
823
823
|
const d = m.zip.replace(/\D/g, "");
|
|
824
|
-
return !
|
|
825
|
-
}), te =
|
|
824
|
+
return !f.value && P.value && d.length !== 5 && d.length !== 9;
|
|
825
|
+
}), te = v(() => !f.value && P.value && !z.value), U = v(() => !f.value && te.value && (y.value || r.value));
|
|
826
826
|
return ue(n, () => {
|
|
827
|
-
|
|
828
|
-
}), ue(
|
|
829
|
-
d || (r.value = !1,
|
|
827
|
+
f.value || (y.value = !1);
|
|
828
|
+
}), ue(f, (d) => {
|
|
829
|
+
d || (r.value = !1, y.value = !1, p());
|
|
830
830
|
}), {
|
|
831
831
|
formData: m,
|
|
832
832
|
submitted: r,
|
|
@@ -834,115 +834,115 @@ function dt(e) {
|
|
|
834
834
|
addressValidate: re,
|
|
835
835
|
address1Valid: se,
|
|
836
836
|
cityValid: a,
|
|
837
|
-
stateValid:
|
|
838
|
-
zipValid:
|
|
837
|
+
stateValid: g,
|
|
838
|
+
zipValid: V,
|
|
839
839
|
addressValid: H,
|
|
840
|
-
optionalFeedbackActive:
|
|
840
|
+
optionalFeedbackActive: U,
|
|
841
841
|
optionalPartialInvalid: te,
|
|
842
842
|
optionalMissingRequiredFields: q,
|
|
843
|
-
optionalZipInvalid:
|
|
843
|
+
optionalZipInvalid: G,
|
|
844
844
|
stateDefaultItem: Z,
|
|
845
|
-
stateOptions:
|
|
845
|
+
stateOptions: j,
|
|
846
846
|
zipDisplay: E,
|
|
847
|
-
zipWrapperClass:
|
|
848
|
-
onAddress1Input:
|
|
849
|
-
onAddress2Input:
|
|
850
|
-
onCityInput:
|
|
851
|
-
onStateChange:
|
|
847
|
+
zipWrapperClass: R,
|
|
848
|
+
onAddress1Input: A,
|
|
849
|
+
onAddress2Input: x,
|
|
850
|
+
onCityInput: C,
|
|
851
|
+
onStateChange: $,
|
|
852
852
|
onZipInput: u,
|
|
853
853
|
onFieldsetFocusout: (d) => {
|
|
854
|
-
const
|
|
855
|
-
w(d), !
|
|
854
|
+
const I = tt(t.value, d);
|
|
855
|
+
w(d), !f.value && I && (y.value = !0);
|
|
856
856
|
},
|
|
857
857
|
normalizedPayload: n,
|
|
858
|
-
validateForSubmit: async () =>
|
|
858
|
+
validateForSubmit: async () => f.value ? (r.value = !0, z.value ? {
|
|
859
859
|
isValid: !0,
|
|
860
860
|
payload: n.value
|
|
861
|
-
} : (await B(),
|
|
861
|
+
} : (await B(), et(t.value), { isValid: !1, payload: null })) : c.value || z.value ? (r.value = !1, {
|
|
862
862
|
isValid: !0,
|
|
863
863
|
payload: n.value
|
|
864
864
|
}) : (r.value = !0, { isValid: !1, payload: null }),
|
|
865
865
|
reset: () => {
|
|
866
|
-
r.value = !1,
|
|
866
|
+
r.value = !1, y.value = !1, p(), D(), i();
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
869
|
}
|
|
870
|
-
const
|
|
870
|
+
const nt = typeof window < "u" && typeof document < "u";
|
|
871
871
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
872
|
-
const
|
|
872
|
+
const at = Object.prototype.toString, rt = (e) => at.call(e) === "[object Object]", we = () => {
|
|
873
873
|
};
|
|
874
874
|
function Ee(e) {
|
|
875
875
|
return Array.isArray(e) ? e : [e];
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function ot(e, t, r) {
|
|
878
878
|
return ue(e, t, {
|
|
879
879
|
...r,
|
|
880
880
|
immediate: !0
|
|
881
881
|
});
|
|
882
882
|
}
|
|
883
|
-
const
|
|
883
|
+
const $e = nt ? window : void 0;
|
|
884
884
|
function he(e) {
|
|
885
885
|
var t;
|
|
886
886
|
const r = le(e);
|
|
887
887
|
return (t = r?.$el) !== null && t !== void 0 ? t : r;
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
const t = (
|
|
891
|
-
const
|
|
892
|
-
return
|
|
889
|
+
function Ie(...e) {
|
|
890
|
+
const t = (y, f, m, A) => (y.addEventListener(f, m, A), () => y.removeEventListener(f, m, A)), r = v(() => {
|
|
891
|
+
const y = Ee(le(e[0])).filter((f) => f != null);
|
|
892
|
+
return y.every((f) => typeof f != "string") ? y : void 0;
|
|
893
893
|
});
|
|
894
|
-
return
|
|
895
|
-
var
|
|
894
|
+
return ot(() => {
|
|
895
|
+
var y, f;
|
|
896
896
|
return [
|
|
897
|
-
(
|
|
897
|
+
(y = (f = r.value) === null || f === void 0 ? void 0 : f.map((m) => he(m))) !== null && y !== void 0 ? y : [$e].filter((m) => m != null),
|
|
898
898
|
Ee(le(r.value ? e[1] : e[0])),
|
|
899
899
|
Ee(Le(r.value ? e[2] : e[1])),
|
|
900
900
|
le(r.value ? e[3] : e[2])
|
|
901
901
|
];
|
|
902
|
-
}, ([
|
|
903
|
-
if (!
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
|
|
902
|
+
}, ([y, f, m, A], x, C) => {
|
|
903
|
+
if (!y?.length || !f?.length || !m?.length) return;
|
|
904
|
+
const $ = rt(A) ? { ...A } : A, D = y.flatMap((F) => f.flatMap((E) => m.map((k) => t(F, E, k, $))));
|
|
905
|
+
C(() => {
|
|
906
|
+
D.forEach((F) => F());
|
|
907
907
|
});
|
|
908
908
|
}, { flush: "post" });
|
|
909
909
|
}
|
|
910
|
-
function
|
|
911
|
-
const { window:
|
|
912
|
-
if (!
|
|
910
|
+
function Fe(e, t, r = {}) {
|
|
911
|
+
const { window: y = $e, ignore: f = [], capture: m = !0, detectIframe: A = !1, controls: x = !1 } = r;
|
|
912
|
+
if (!y) return x ? {
|
|
913
913
|
stop: we,
|
|
914
914
|
cancel: we,
|
|
915
915
|
trigger: we
|
|
916
916
|
} : we;
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
if (typeof l == "string") return Array.from(
|
|
917
|
+
let C = !0;
|
|
918
|
+
const $ = (i) => le(f).some((l) => {
|
|
919
|
+
if (typeof l == "string") return Array.from(y.document.querySelectorAll(l)).some((h) => h === i.target || i.composedPath().includes(h));
|
|
920
920
|
{
|
|
921
|
-
const
|
|
922
|
-
return
|
|
921
|
+
const h = he(l);
|
|
922
|
+
return h && (i.target === h || i.composedPath().includes(h));
|
|
923
923
|
}
|
|
924
924
|
});
|
|
925
|
-
function
|
|
925
|
+
function D(i) {
|
|
926
926
|
const l = le(i);
|
|
927
927
|
return l && l.$.subTree.shapeFlag === 16;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
const
|
|
931
|
-
return
|
|
929
|
+
function F(i, l) {
|
|
930
|
+
const h = le(i), L = h.$.subTree && h.$.subTree.children;
|
|
931
|
+
return L == null || !Array.isArray(L) ? !1 : L.some((Y) => Y.el === l.target || l.composedPath().includes(Y.el));
|
|
932
932
|
}
|
|
933
933
|
const E = (i) => {
|
|
934
934
|
const l = he(e);
|
|
935
|
-
if (i.target != null && !(!(l instanceof Element) &&
|
|
936
|
-
if ("detail" in i && i.detail === 0 && (
|
|
937
|
-
|
|
935
|
+
if (i.target != null && !(!(l instanceof Element) && D(e) && F(e, i)) && !(!l || l === i.target || i.composedPath().includes(l))) {
|
|
936
|
+
if ("detail" in i && i.detail === 0 && (C = !$(i)), !C) {
|
|
937
|
+
C = !0;
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
940
|
t(i);
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
943
|
let k = !1;
|
|
944
|
-
const
|
|
945
|
-
|
|
944
|
+
const R = [
|
|
945
|
+
Ie(y, "click", (i) => {
|
|
946
946
|
k || (k = !0, setTimeout(() => {
|
|
947
947
|
k = !1;
|
|
948
948
|
}, 0), E(i));
|
|
@@ -950,81 +950,89 @@ function $e(e, t, r = {}) {
|
|
|
950
950
|
passive: !0,
|
|
951
951
|
capture: m
|
|
952
952
|
}),
|
|
953
|
-
|
|
953
|
+
Ie(y, "pointerdown", (i) => {
|
|
954
954
|
const l = he(e);
|
|
955
|
-
|
|
955
|
+
C = !$(i) && !!(l && !i.composedPath().includes(l));
|
|
956
956
|
}, { passive: !0 }),
|
|
957
|
-
|
|
957
|
+
A && Ie(y, "blur", (i) => {
|
|
958
958
|
setTimeout(() => {
|
|
959
959
|
const l = he(e);
|
|
960
|
-
let
|
|
961
|
-
for (;
|
|
962
|
-
|
|
960
|
+
let h = y.document.activeElement;
|
|
961
|
+
for (; h?.shadowRoot; ) h = h.shadowRoot.activeElement;
|
|
962
|
+
h?.tagName === "IFRAME" && !l?.contains(y.document.activeElement) && t(i);
|
|
963
963
|
}, 0);
|
|
964
964
|
}, { passive: !0 })
|
|
965
|
-
].filter(Boolean), u = () =>
|
|
966
|
-
return
|
|
965
|
+
].filter(Boolean), u = () => R.forEach((i) => i());
|
|
966
|
+
return x ? {
|
|
967
967
|
stop: u,
|
|
968
968
|
cancel: () => {
|
|
969
|
-
|
|
969
|
+
C = !1;
|
|
970
970
|
},
|
|
971
971
|
trigger: (i) => {
|
|
972
|
-
|
|
972
|
+
C = !0, E(i), C = !1;
|
|
973
973
|
}
|
|
974
974
|
} : u;
|
|
975
975
|
}
|
|
976
|
-
const
|
|
976
|
+
const xe = (e) => {
|
|
977
977
|
if (e instanceof HTMLElement) return e;
|
|
978
978
|
const t = e?.$el;
|
|
979
979
|
return t instanceof HTMLElement ? t : null;
|
|
980
|
-
},
|
|
981
|
-
|
|
980
|
+
}, lt = (e, t) => t === "row" ? e.matches("tr.k-table-row") : !e.matches("tr.k-table-row"), it = (e, t) => {
|
|
981
|
+
console.warn(
|
|
982
|
+
`usePopupMenu: triggerMode "${t}" does not match resolved element <${e.tagName.toLowerCase()}${e.className ? `.${e.className.split(" ").join(".")}` : ""}>; ARIA management skipped.`
|
|
983
|
+
);
|
|
984
|
+
}, vt = (e) => {
|
|
985
|
+
const t = O(null), r = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", y = e.triggerMode, f = () => xe(e.triggerRef.value), m = () => e.resolveFocusTarget?.() ?? xe(e.focusTargetRef?.value), A = () => {
|
|
982
986
|
const l = m();
|
|
983
987
|
if (l)
|
|
984
988
|
return l.focus(), !0;
|
|
985
|
-
const
|
|
986
|
-
return
|
|
987
|
-
},
|
|
988
|
-
|
|
989
|
-
},
|
|
990
|
-
e.isOpen.value && (t.value = l, e.requestHide());
|
|
989
|
+
const h = f();
|
|
990
|
+
return h?.focus(), !!h;
|
|
991
|
+
}, x = () => {
|
|
992
|
+
xe(e.menuRef.value)?.querySelector(r)?.focus();
|
|
993
|
+
}, C = (l) => {
|
|
994
|
+
e.isOpen.value && (t.value = l, F(!1), e.requestHide());
|
|
991
995
|
};
|
|
992
|
-
|
|
996
|
+
Fe(e.menuRef, () => C("outside-click"), {
|
|
993
997
|
ignore: [e.triggerRef]
|
|
994
998
|
});
|
|
995
|
-
let
|
|
996
|
-
const
|
|
997
|
-
|
|
998
|
-
},
|
|
999
|
+
let $ = null;
|
|
1000
|
+
const D = () => {
|
|
1001
|
+
$?.isConnected && $.setAttribute("aria-expanded", "false"), $ = null;
|
|
1002
|
+
}, F = (l) => {
|
|
999
1003
|
if (e.manageMenuTriggerAria === !1) return;
|
|
1000
|
-
const
|
|
1001
|
-
if (!
|
|
1002
|
-
|
|
1004
|
+
const h = f();
|
|
1005
|
+
if (!h) {
|
|
1006
|
+
$?.isConnected && $.setAttribute("aria-expanded", l ? "true" : "false");
|
|
1003
1007
|
return;
|
|
1004
1008
|
}
|
|
1005
|
-
|
|
1009
|
+
if (!lt(h, y)) {
|
|
1010
|
+
it(h, y), D();
|
|
1011
|
+
return;
|
|
1012
|
+
}
|
|
1013
|
+
$ && $ !== h && D(), h.setAttribute("aria-expanded", l ? "true" : "false"), $ = h;
|
|
1006
1014
|
};
|
|
1007
1015
|
ue(
|
|
1008
1016
|
[e.isOpen, e.triggerRef],
|
|
1009
|
-
([l]) =>
|
|
1017
|
+
([l]) => F(l),
|
|
1010
1018
|
{ immediate: !0, flush: "post" }
|
|
1011
|
-
),
|
|
1019
|
+
), Ne(D);
|
|
1012
1020
|
const E = () => {
|
|
1013
1021
|
if (e.isOpen.value) {
|
|
1014
|
-
|
|
1022
|
+
C("trigger-click");
|
|
1015
1023
|
return;
|
|
1016
1024
|
}
|
|
1017
|
-
e.requestShow(), B(
|
|
1025
|
+
e.requestShow(), B(x);
|
|
1018
1026
|
};
|
|
1019
1027
|
return {
|
|
1020
1028
|
/**
|
|
1021
1029
|
* Handles Kendo Menu selection: records keyboard or mouse modality,
|
|
1022
1030
|
* requests popup close, then runs the optional caller-owned action.
|
|
1023
1031
|
*/
|
|
1024
|
-
handleMenuSelect: (l,
|
|
1025
|
-
|
|
1032
|
+
handleMenuSelect: (l, h) => {
|
|
1033
|
+
C(
|
|
1026
1034
|
l.event?.type?.startsWith("key") ? "keyboard" : "mouse-selection"
|
|
1027
|
-
),
|
|
1035
|
+
), h?.(l);
|
|
1028
1036
|
},
|
|
1029
1037
|
/**
|
|
1030
1038
|
* Toggles the action menu. When opening, focuses the first enabled Kendo
|
|
@@ -1042,15 +1050,15 @@ const Ie = (e) => {
|
|
|
1042
1050
|
}
|
|
1043
1051
|
if (l.key === "Escape") {
|
|
1044
1052
|
if (l.preventDefault(), l.stopPropagation(), e.isOpen.value) {
|
|
1045
|
-
|
|
1053
|
+
C("keyboard");
|
|
1046
1054
|
return;
|
|
1047
1055
|
}
|
|
1048
|
-
|
|
1056
|
+
A();
|
|
1049
1057
|
}
|
|
1050
1058
|
},
|
|
1051
1059
|
/** Closes the open menu through the keyboard path when Escape is pressed inside it. */
|
|
1052
1060
|
handleActionMenuEscape: (l) => {
|
|
1053
|
-
l.preventDefault(), l.stopPropagation(),
|
|
1061
|
+
l.preventDefault(), l.stopPropagation(), C("keyboard");
|
|
1054
1062
|
},
|
|
1055
1063
|
/**
|
|
1056
1064
|
* Restores focus after Kendo Popup closes: keyboard closes prefer the
|
|
@@ -1059,91 +1067,116 @@ const Ie = (e) => {
|
|
|
1059
1067
|
*/
|
|
1060
1068
|
handlePopupClose: () => {
|
|
1061
1069
|
B(() => {
|
|
1062
|
-
t.value === "keyboard" ?
|
|
1070
|
+
t.value === "keyboard" ? A() : t.value === "mouse-selection" && f()?.focus(), t.value = null;
|
|
1063
1071
|
});
|
|
1064
1072
|
}
|
|
1065
1073
|
};
|
|
1074
|
+
}, st = (e) => {
|
|
1075
|
+
if (e instanceof HTMLElement) return e;
|
|
1076
|
+
const t = e && "$el" in e ? e.$el : null;
|
|
1077
|
+
return t instanceof HTMLElement ? t : null;
|
|
1078
|
+
}, gt = () => {
|
|
1079
|
+
const e = Ke(/* @__PURE__ */ new Map()), t = O(null), r = (x, C) => {
|
|
1080
|
+
const $ = st(C);
|
|
1081
|
+
$ ? e.set(x, $) : e.delete(x);
|
|
1082
|
+
}, y = (x) => e.get(x) ?? null, f = (x) => {
|
|
1083
|
+
t.value = x;
|
|
1084
|
+
}, m = () => {
|
|
1085
|
+
t.value = null;
|
|
1086
|
+
}, A = (x) => t.value === x;
|
|
1087
|
+
return {
|
|
1088
|
+
activeId: Q(t),
|
|
1089
|
+
isActive: v(() => t.value !== null),
|
|
1090
|
+
activeElement: v(
|
|
1091
|
+
() => t.value !== null ? y(t.value) : null
|
|
1092
|
+
),
|
|
1093
|
+
register: r,
|
|
1094
|
+
resolve: y,
|
|
1095
|
+
activate: f,
|
|
1096
|
+
deactivate: m,
|
|
1097
|
+
isIdActive: A
|
|
1098
|
+
};
|
|
1066
1099
|
};
|
|
1067
|
-
function
|
|
1068
|
-
const t =
|
|
1100
|
+
function yt(e) {
|
|
1101
|
+
const t = O(""), r = O(void 0), y = O(!!e.debug), f = O(e.dateFormat ?? "mm/dd/yyyy"), m = v(() => !!e.required), A = 1e3, x = O(!1), C = ["ArrowUp", "ArrowDown"], $ = ["ArrowLeft", "ArrowRight"], D = v(() => (t.value ?? "").replace(/\D/g, "")), F = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : D.value.length <= 10 ? "yyyy" : "mm", E = v(() => {
|
|
1069
1102
|
const a = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
|
|
1070
1103
|
return parseInt(a).toString().padStart(2, "0");
|
|
1071
|
-
}), k =
|
|
1104
|
+
}), k = v(() => {
|
|
1072
1105
|
const a = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
|
|
1073
1106
|
return parseInt(a).toString().padStart(2, "0");
|
|
1074
|
-
}),
|
|
1107
|
+
}), R = v(() => {
|
|
1075
1108
|
const a = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
|
|
1076
1109
|
return parseInt(a).toString().padStart(4, "0");
|
|
1077
1110
|
}), u = (a) => {
|
|
1078
|
-
if (
|
|
1111
|
+
if (D.value.length === 0) {
|
|
1079
1112
|
e.onChange({ value: null, event: a });
|
|
1080
1113
|
return;
|
|
1081
1114
|
}
|
|
1082
|
-
if (
|
|
1115
|
+
if (D.value.length < 8) {
|
|
1083
1116
|
e.onChange({ value: null, event: a });
|
|
1084
1117
|
return;
|
|
1085
1118
|
}
|
|
1086
|
-
if ((t.value ?? "").length === 10 &&
|
|
1087
|
-
const [
|
|
1088
|
-
if (z(n, Z,
|
|
1089
|
-
const c =
|
|
1119
|
+
if ((t.value ?? "").length === 10 && D.value.length === 8) {
|
|
1120
|
+
const [g, V, H] = t.value.split("/"), Z = parseInt(g), j = parseInt(V), n = parseInt(H);
|
|
1121
|
+
if (z(n, Z, j)) {
|
|
1122
|
+
const c = L(n, Z, j);
|
|
1090
1123
|
i(c) ? e.onChange({ value: c, event: a }) : e.onChange({ value: null, event: a });
|
|
1091
1124
|
} else
|
|
1092
1125
|
e.onChange({ value: null, event: a });
|
|
1093
1126
|
}
|
|
1094
1127
|
}, i = (a) => {
|
|
1095
|
-
const
|
|
1096
|
-
return !(
|
|
1097
|
-
}, l =
|
|
1098
|
-
if ((t.value ?? "").length === 10 &&
|
|
1099
|
-
const [a,
|
|
1100
|
-
if (z(
|
|
1101
|
-
return
|
|
1128
|
+
const g = e.min ?? void 0, V = e.max ?? void 0;
|
|
1129
|
+
return !(g && a < g || V && a > V);
|
|
1130
|
+
}, l = v(() => {
|
|
1131
|
+
if ((t.value ?? "").length === 10 && D.value.length === 8) {
|
|
1132
|
+
const [a, g, V] = (t.value ?? "").split("/"), H = parseInt(a), Z = parseInt(g), j = parseInt(V);
|
|
1133
|
+
if (z(j, H, Z))
|
|
1134
|
+
return L(j, H, Z);
|
|
1102
1135
|
}
|
|
1103
1136
|
return null;
|
|
1104
|
-
}),
|
|
1137
|
+
}), h = v(() => (t.value ?? "").length === 10 && D.value.length === 8), L = (a, g, V) => {
|
|
1105
1138
|
const H = /* @__PURE__ */ new Date(0);
|
|
1106
|
-
return H.setFullYear(a,
|
|
1107
|
-
}, Y = (a,
|
|
1139
|
+
return H.setFullYear(a, g - 1, V), H.setHours(0, 0, 0, 0), H;
|
|
1140
|
+
}, Y = (a, g) => L(a, g + 1, 0).getDate(), z = (a, g, V) => g >= 1 && g <= 12 && a >= A && V >= 1 && V <= Y(a, g), _ = (a) => {
|
|
1108
1141
|
t.value = a.value;
|
|
1109
|
-
const
|
|
1110
|
-
r.value =
|
|
1142
|
+
const g = a.event?.target;
|
|
1143
|
+
r.value = g?.selectionStart ?? 0, u(a);
|
|
1111
1144
|
}, ee = (a) => {
|
|
1112
1145
|
r.value = a.target.selectionStart ?? 0;
|
|
1113
|
-
}, s = (a,
|
|
1114
|
-
const H =
|
|
1146
|
+
}, s = (a, g, V) => {
|
|
1147
|
+
const H = g?.selectionStart ?? r.value ?? 0;
|
|
1115
1148
|
r.value = H;
|
|
1116
|
-
let Z = parseInt(E.value),
|
|
1117
|
-
if (!(
|
|
1149
|
+
let Z = parseInt(E.value), j = parseInt(k.value), n = parseInt(R.value);
|
|
1150
|
+
if (!(D.value.length >= 8) || !z(n, Z, j)) {
|
|
1118
1151
|
const X = e.defaultValue ?? /* @__PURE__ */ new Date();
|
|
1119
|
-
Z = X.getMonth() + 1,
|
|
1152
|
+
Z = X.getMonth() + 1, j = X.getDate(), n = X.getFullYear(), t.value = `${String(Z).padStart(2, "0")}/${String(j).padStart(
|
|
1120
1153
|
2,
|
|
1121
1154
|
"0"
|
|
1122
1155
|
)}/${String(n)}`;
|
|
1123
|
-
const ce =
|
|
1124
|
-
e.onChange({ value: i(ce) ? ce : null, event:
|
|
1156
|
+
const ce = L(n, Z, j);
|
|
1157
|
+
e.onChange({ value: i(ce) ? ce : null, event: V }), S({ useRAF: !0 });
|
|
1125
1158
|
return;
|
|
1126
1159
|
}
|
|
1127
|
-
const
|
|
1128
|
-
if (
|
|
1160
|
+
const P = F(H);
|
|
1161
|
+
if (P === "mm")
|
|
1129
1162
|
Z = a === "ArrowUp" ? Z < 12 ? Z + 1 : 1 : Z > 1 ? Z - 1 : 12;
|
|
1130
|
-
else if (
|
|
1163
|
+
else if (P === "dd") {
|
|
1131
1164
|
const X = new Date(n, Z, 0).getDate();
|
|
1132
|
-
|
|
1133
|
-
} else
|
|
1134
|
-
t.value = `${String(Z).padStart(2, "0")}/${String(
|
|
1165
|
+
j = a === "ArrowUp" ? j < X ? j + 1 : 1 : j > 1 ? j - 1 : X;
|
|
1166
|
+
} else P === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
|
|
1167
|
+
t.value = `${String(Z).padStart(2, "0")}/${String(j).padStart(
|
|
1135
1168
|
2,
|
|
1136
1169
|
"0"
|
|
1137
1170
|
)}/${String(n)}`;
|
|
1138
|
-
const [q,
|
|
1171
|
+
const [q, G, te] = t.value.split("/"), U = L(
|
|
1139
1172
|
parseInt(te),
|
|
1140
1173
|
parseInt(q),
|
|
1141
|
-
parseInt(
|
|
1174
|
+
parseInt(G)
|
|
1142
1175
|
);
|
|
1143
|
-
|
|
1144
|
-
value: i(
|
|
1145
|
-
event:
|
|
1146
|
-
}) : e.onChange({ value: null, event:
|
|
1176
|
+
U.toString() !== "Invalid Date" && parseInt(te) >= 1e3 ? e.onChange({
|
|
1177
|
+
value: i(U) ? U : null,
|
|
1178
|
+
event: V
|
|
1179
|
+
}) : e.onChange({ value: null, event: V }), S({ useRAF: !0 });
|
|
1147
1180
|
}, w = (a) => {
|
|
1148
1181
|
if (a.code === "Space" || a.key === " ") {
|
|
1149
1182
|
a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
|
|
@@ -1153,72 +1186,72 @@ function pt(e) {
|
|
|
1153
1186
|
a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
|
|
1154
1187
|
return;
|
|
1155
1188
|
}
|
|
1156
|
-
if (
|
|
1189
|
+
if (C.includes(a.key)) {
|
|
1157
1190
|
if (a.altKey) return;
|
|
1158
1191
|
a.preventDefault(), a.stopPropagation();
|
|
1159
|
-
const
|
|
1160
|
-
s(a.key,
|
|
1192
|
+
const g = a.target;
|
|
1193
|
+
s(a.key, g, a);
|
|
1161
1194
|
return;
|
|
1162
1195
|
}
|
|
1163
|
-
},
|
|
1196
|
+
}, p = (a) => {
|
|
1164
1197
|
a.preventDefault();
|
|
1165
|
-
const
|
|
1166
|
-
s(
|
|
1198
|
+
const g = a.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1199
|
+
s(g, a.target, a);
|
|
1167
1200
|
}, b = (a) => {
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
r.value =
|
|
1201
|
+
const g = a.target;
|
|
1202
|
+
if ($.includes(a.key)) {
|
|
1203
|
+
r.value = g?.selectionStart ?? 0;
|
|
1171
1204
|
return;
|
|
1172
1205
|
}
|
|
1173
|
-
if (
|
|
1206
|
+
if (C.includes(a.key)) {
|
|
1174
1207
|
if (a.altKey) return;
|
|
1175
|
-
r.value =
|
|
1208
|
+
r.value = g?.selectionStart ?? 0;
|
|
1176
1209
|
}
|
|
1177
|
-
},
|
|
1178
|
-
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1210
|
+
}, M = (a) => {
|
|
1211
|
+
x.value = !0, m.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && D.value.length === 0 && (e.externalValue.value = "");
|
|
1212
|
+
const g = a.target;
|
|
1213
|
+
g && (r.value = g.selectionStart ?? 0);
|
|
1181
1214
|
}, S = (a) => {
|
|
1182
|
-
const
|
|
1183
|
-
const
|
|
1215
|
+
const g = () => {
|
|
1216
|
+
const V = document.getElementById(
|
|
1184
1217
|
e.id
|
|
1185
1218
|
);
|
|
1186
|
-
if (
|
|
1187
|
-
const H = a?.pos ?? r.value ??
|
|
1219
|
+
if (!V) return;
|
|
1220
|
+
const H = a?.pos ?? r.value ?? V.value.length;
|
|
1188
1221
|
try {
|
|
1189
|
-
|
|
1222
|
+
V.focus(), V.setSelectionRange(H, H);
|
|
1190
1223
|
} catch {
|
|
1191
1224
|
}
|
|
1192
1225
|
};
|
|
1193
1226
|
B(() => {
|
|
1194
1227
|
if (a?.delay && a.delay > 0) {
|
|
1195
|
-
setTimeout(
|
|
1228
|
+
setTimeout(g, a.delay);
|
|
1196
1229
|
return;
|
|
1197
1230
|
}
|
|
1198
1231
|
if (a?.useRAF) {
|
|
1199
|
-
requestAnimationFrame(
|
|
1232
|
+
requestAnimationFrame(g);
|
|
1200
1233
|
return;
|
|
1201
1234
|
}
|
|
1202
|
-
|
|
1235
|
+
g();
|
|
1203
1236
|
});
|
|
1204
1237
|
};
|
|
1205
1238
|
e.externalValue && ue(
|
|
1206
1239
|
e.externalValue,
|
|
1207
1240
|
(a) => {
|
|
1208
1241
|
if (a) {
|
|
1209
|
-
const
|
|
1210
|
-
if (
|
|
1211
|
-
const
|
|
1212
|
-
t.value = `${
|
|
1242
|
+
const g = new Date(a);
|
|
1243
|
+
if (g.toString() !== "Invalid Date") {
|
|
1244
|
+
const V = (g.getMonth() + 1).toString().padStart(2, "0"), H = g.getDate().toString().padStart(2, "0"), Z = g.getFullYear().toString();
|
|
1245
|
+
t.value = `${V}/${H}/${Z}`, S({ delay: 50 });
|
|
1213
1246
|
return;
|
|
1214
1247
|
}
|
|
1215
1248
|
}
|
|
1216
1249
|
},
|
|
1217
1250
|
{ immediate: !0 }
|
|
1218
1251
|
);
|
|
1219
|
-
const
|
|
1220
|
-
["Date", `${E.value} / ${k.value} / ${
|
|
1221
|
-
["Digits only",
|
|
1252
|
+
const T = v(() => [
|
|
1253
|
+
["Date", `${E.value} / ${k.value} / ${R.value}`],
|
|
1254
|
+
["Digits only", D.value],
|
|
1222
1255
|
[
|
|
1223
1256
|
"min",
|
|
1224
1257
|
e.min?.toLocaleDateString("en-US", {
|
|
@@ -1235,46 +1268,46 @@ function pt(e) {
|
|
|
1235
1268
|
day: "2-digit"
|
|
1236
1269
|
}) ?? null
|
|
1237
1270
|
]
|
|
1238
|
-
]),
|
|
1271
|
+
]), K = v(() => {
|
|
1239
1272
|
if (!m.value) {
|
|
1240
|
-
if (!
|
|
1241
|
-
const
|
|
1242
|
-
return
|
|
1273
|
+
if (!h.value) return !0;
|
|
1274
|
+
const g = l.value;
|
|
1275
|
+
return g ? i(g) : !1;
|
|
1243
1276
|
}
|
|
1244
|
-
if (!
|
|
1277
|
+
if (!x.value) return !0;
|
|
1245
1278
|
const a = l.value;
|
|
1246
|
-
return !
|
|
1247
|
-
}), W =
|
|
1279
|
+
return !h.value || !a ? !1 : i(a);
|
|
1280
|
+
}), W = v(() => {
|
|
1248
1281
|
if (!m.value) {
|
|
1249
|
-
if (!
|
|
1250
|
-
const
|
|
1251
|
-
return
|
|
1282
|
+
if (!h.value) return;
|
|
1283
|
+
const g = l.value;
|
|
1284
|
+
return g ? i(g) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
1252
1285
|
}
|
|
1253
|
-
if (!
|
|
1254
|
-
if (
|
|
1286
|
+
if (!x.value) return;
|
|
1287
|
+
if (D.value.length === 0 || !h.value)
|
|
1255
1288
|
return "incomplete";
|
|
1256
1289
|
const a = l.value;
|
|
1257
1290
|
return a ? i(a) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
1258
|
-
}), re =
|
|
1291
|
+
}), re = v(() => {
|
|
1259
1292
|
const a = W.value;
|
|
1260
1293
|
if (!a || a === "valid") return "";
|
|
1261
1294
|
if (a === "incomplete")
|
|
1262
1295
|
return "Required";
|
|
1263
1296
|
if (a === "invalid-date")
|
|
1264
|
-
return `Must be in ${
|
|
1265
|
-
const
|
|
1297
|
+
return `Must be in ${f.value} format.`;
|
|
1298
|
+
const g = e.min ? e.min.toLocaleDateString("en-US", {
|
|
1266
1299
|
year: "numeric",
|
|
1267
1300
|
month: "2-digit",
|
|
1268
1301
|
day: "2-digit"
|
|
1269
|
-
}) : null,
|
|
1302
|
+
}) : null, V = e.max ? e.max.toLocaleDateString("en-US", {
|
|
1270
1303
|
year: "numeric",
|
|
1271
1304
|
month: "2-digit",
|
|
1272
1305
|
day: "2-digit"
|
|
1273
1306
|
}) : null;
|
|
1274
1307
|
if (a === "out-of-bounds") {
|
|
1275
|
-
if (
|
|
1276
|
-
if (
|
|
1277
|
-
if (
|
|
1308
|
+
if (g && V) return `Must be between ${g} and ${V}.`;
|
|
1309
|
+
if (g) return `Must be on or after ${g}.`;
|
|
1310
|
+
if (V) return `Must be on or before ${V}.`;
|
|
1278
1311
|
}
|
|
1279
1312
|
return "";
|
|
1280
1313
|
}), se = () => {
|
|
@@ -1286,16 +1319,16 @@ function pt(e) {
|
|
|
1286
1319
|
console.warn(`ID (#${e.id}) not found for styling.`);
|
|
1287
1320
|
return;
|
|
1288
1321
|
}
|
|
1289
|
-
const
|
|
1290
|
-
if (!
|
|
1322
|
+
const g = a.closest(".k-datepicker");
|
|
1323
|
+
if (!g) {
|
|
1291
1324
|
console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
|
|
1292
1325
|
return;
|
|
1293
1326
|
}
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
if (
|
|
1327
|
+
const V = g.parentElement;
|
|
1328
|
+
if (V) {
|
|
1329
|
+
if (V.classList.contains("fk-datepicker"))
|
|
1297
1330
|
return;
|
|
1298
|
-
|
|
1331
|
+
V.classList.add("fk-datepicker");
|
|
1299
1332
|
} else
|
|
1300
1333
|
console.warn(
|
|
1301
1334
|
`Parent of .k-datepicker not found for #${e.id} styling.`
|
|
@@ -1307,63 +1340,63 @@ function pt(e) {
|
|
|
1307
1340
|
}), {
|
|
1308
1341
|
raw: t,
|
|
1309
1342
|
cursorPos: r,
|
|
1310
|
-
debugEnabled:
|
|
1311
|
-
debugLines:
|
|
1312
|
-
placeholder:
|
|
1313
|
-
isValid:
|
|
1343
|
+
debugEnabled: y,
|
|
1344
|
+
debugLines: T,
|
|
1345
|
+
placeholder: f,
|
|
1346
|
+
isValid: K,
|
|
1314
1347
|
reason: Q(W),
|
|
1315
1348
|
validationMessage: re,
|
|
1316
|
-
digitsOnly:
|
|
1349
|
+
digitsOnly: D,
|
|
1317
1350
|
month: Q(E),
|
|
1318
1351
|
day: Q(k),
|
|
1319
|
-
year: Q(
|
|
1320
|
-
datePart:
|
|
1352
|
+
year: Q(R),
|
|
1353
|
+
datePart: F,
|
|
1321
1354
|
handleChange: _,
|
|
1322
1355
|
handleKeyDown: w,
|
|
1323
|
-
handleWheel:
|
|
1356
|
+
handleWheel: p,
|
|
1324
1357
|
handleKeyUp: b,
|
|
1325
1358
|
handleClick: ee,
|
|
1326
|
-
handleBlur:
|
|
1359
|
+
handleBlur: M,
|
|
1327
1360
|
// Expose so consumers can re-run styling when needed
|
|
1328
1361
|
initStyling: se
|
|
1329
1362
|
};
|
|
1330
1363
|
}
|
|
1331
|
-
function
|
|
1332
|
-
const t =
|
|
1333
|
-
e.min = e.min ??
|
|
1334
|
-
const
|
|
1364
|
+
function ht(e) {
|
|
1365
|
+
const t = O(""), r = O(void 0), y = O(!!e.debug), f = O(!1), m = 1440 * 60 * 1e3, A = 365 * m, x = /* @__PURE__ */ new Date(), C = new Date(x.getTime() - A), $ = new Date(x.getTime() + A);
|
|
1366
|
+
e.min = e.min ?? C, e.max = e.max ?? $;
|
|
1367
|
+
const D = v(() => (t.value ?? "").replace(/\D/g, "")), F = (o, d) => new Date(o, d, 0).getDate(), E = (o, d, I) => d >= 1 && d <= 12 && o >= 1e3 && I >= 1 && I <= F(o, d), k = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), R = (o) => {
|
|
1335
1368
|
if (!o) return null;
|
|
1336
|
-
const d = e.min ?? new Date(Date.now() - 90 * m),
|
|
1337
|
-
return
|
|
1338
|
-
}, u = (o, d) => e.allowReverse ?? !1 ? !0 : o <= d, i =
|
|
1339
|
-
if ((o ?? "").length < 23 ||
|
|
1369
|
+
const d = e.min ?? new Date(Date.now() - 90 * m), I = e.max ?? /* @__PURE__ */ new Date(), N = k(o);
|
|
1370
|
+
return N < k(d) || N > k(I) ? null : o;
|
|
1371
|
+
}, u = (o, d) => e.allowReverse ?? !1 ? !0 : o <= d, i = v(() => (t.value?.length ?? 0) >= 23 && D.value.length >= 16), l = (o) => {
|
|
1372
|
+
if ((o ?? "").length < 23 || D.value.length < 16)
|
|
1340
1373
|
return { start: null, end: null };
|
|
1341
|
-
const d = o.substring(0, 10),
|
|
1374
|
+
const d = o.substring(0, 10), I = o.substring(13, 23), [N, ne, ae] = d.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = I.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ae, N - 1, ne), ye = new Date(ve, fe - 1, me), Se = E(ae, N, ne) && ge.toString() !== "Invalid Date", ke = E(ve, fe, me) && ye.toString() !== "Invalid Date";
|
|
1342
1375
|
return { start: Se ? ge : null, end: ke ? ye : null };
|
|
1343
|
-
},
|
|
1344
|
-
const o =
|
|
1376
|
+
}, h = e.externalValid ?? O(!0), L = v(() => l(t.value)), Y = v(() => {
|
|
1377
|
+
const o = R(L.value.start), d = R(L.value.end);
|
|
1345
1378
|
return { start: o, end: d };
|
|
1346
|
-
}), z =
|
|
1379
|
+
}), z = v(() => {
|
|
1347
1380
|
if (!i.value) return;
|
|
1348
1381
|
const o = Y.value.start, d = Y.value.end;
|
|
1349
1382
|
if (!o || !d) return;
|
|
1350
|
-
const
|
|
1351
|
-
return Math.round(
|
|
1352
|
-
}), _ =
|
|
1383
|
+
const I = Math.abs(k(d) - k(o));
|
|
1384
|
+
return Math.round(I / 864e5 + 1);
|
|
1385
|
+
}), _ = O(!1), ee = v(() => {
|
|
1353
1386
|
if (!_.value) return;
|
|
1354
|
-
const { start: o, end: d } =
|
|
1387
|
+
const { start: o, end: d } = L.value;
|
|
1355
1388
|
if (!i.value) return "incomplete";
|
|
1356
1389
|
if (!o || !d) return "invalid-date";
|
|
1357
1390
|
if (!Y.value.start || !Y.value.end) return "out-of-bounds";
|
|
1358
|
-
const
|
|
1359
|
-
return u(
|
|
1360
|
-
}), s =
|
|
1391
|
+
const I = Y.value.start, N = Y.value.end;
|
|
1392
|
+
return u(I, N) ? typeof e.maxSpanDays == "number" && z.value !== void 0 && z.value > e.maxSpanDays ? "span-exceeds-limit" : "valid" : "reversed-range";
|
|
1393
|
+
}), s = v(() => {
|
|
1361
1394
|
const o = ee.value;
|
|
1362
1395
|
return o === void 0 || o === "valid";
|
|
1363
|
-
}), w =
|
|
1364
|
-
const { min: o, max: d } = e,
|
|
1365
|
-
if (!
|
|
1366
|
-
switch (
|
|
1396
|
+
}), w = v(() => {
|
|
1397
|
+
const { min: o, max: d } = e, I = ee.value;
|
|
1398
|
+
if (!I) return "";
|
|
1399
|
+
switch (I) {
|
|
1367
1400
|
case "incomplete":
|
|
1368
1401
|
return "Required";
|
|
1369
1402
|
case "invalid-date":
|
|
@@ -1377,16 +1410,16 @@ function mt(e) {
|
|
|
1377
1410
|
default:
|
|
1378
1411
|
return "";
|
|
1379
1412
|
}
|
|
1380
|
-
}),
|
|
1413
|
+
}), p = ["ArrowUp", "ArrowDown"], b = ["ArrowLeft", "ArrowRight"], M = (o, d) => String(o).padStart(d, "0"), S = (o) => `${M(o.getMonth() + 1, 2)}/${M(o.getDate(), 2)}/${M(
|
|
1381
1414
|
o.getFullYear(),
|
|
1382
1415
|
4
|
|
1383
|
-
)}`,
|
|
1384
|
-
const
|
|
1385
|
-
r.value =
|
|
1416
|
+
)}`, T = (o) => o <= 2 ? { side: "start", part: "mm" } : o <= 5 ? { side: "start", part: (o <= 3, "dd") } : o <= 11 ? { side: "start", part: "yyyy" } : o <= 15 ? { side: "end", part: "mm" } : o <= 18 ? { side: "end", part: "dd" } : { side: "end", part: "yyyy" }, K = (o, d, I) => {
|
|
1417
|
+
const N = d?.selectionStart ?? r.value ?? 0;
|
|
1418
|
+
r.value = N;
|
|
1386
1419
|
const { start: ne, end: ae } = l(t.value);
|
|
1387
1420
|
if (!ne && !ae) {
|
|
1388
1421
|
const J = /* @__PURE__ */ new Date(), de = S(J);
|
|
1389
|
-
t.value = `${de} - ${de}`, e.onChange({ value: { start: J, end: J }, event:
|
|
1422
|
+
t.value = `${de} - ${de}`, e.onChange({ value: { start: J, end: J }, event: I }), B(() => {
|
|
1390
1423
|
requestAnimationFrame(() => {
|
|
1391
1424
|
const oe = document.getElementById(
|
|
1392
1425
|
e.id
|
|
@@ -1396,29 +1429,29 @@ function mt(e) {
|
|
|
1396
1429
|
});
|
|
1397
1430
|
return;
|
|
1398
1431
|
}
|
|
1399
|
-
const fe = /* @__PURE__ */ new Date(), me =
|
|
1432
|
+
const fe = /* @__PURE__ */ new Date(), me = T(N);
|
|
1400
1433
|
let ve = ne ? new Date(ne) : new Date(fe), ge = ae ? new Date(ae) : new Date(fe);
|
|
1401
1434
|
const ye = (J, de) => {
|
|
1402
1435
|
if (de === "mm") {
|
|
1403
1436
|
const oe = J.getMonth() + 1, ie = o === "ArrowUp" ? oe < 12 ? oe + 1 : 1 : oe > 1 ? oe - 1 : 12;
|
|
1404
1437
|
J.setMonth(ie - 1);
|
|
1405
|
-
const be =
|
|
1438
|
+
const be = F(J.getFullYear(), ie);
|
|
1406
1439
|
J.getDate() > be && J.setDate(be);
|
|
1407
1440
|
} else if (de === "dd") {
|
|
1408
|
-
const oe =
|
|
1441
|
+
const oe = F(J.getFullYear(), J.getMonth() + 1), ie = J.getDate(), be = o === "ArrowUp" ? ie < oe ? ie + 1 : 1 : ie > 1 ? ie - 1 : oe;
|
|
1409
1442
|
J.setDate(be);
|
|
1410
1443
|
} else if (de === "yyyy") {
|
|
1411
1444
|
const oe = J.getFullYear();
|
|
1412
1445
|
J.setFullYear(o === "ArrowUp" ? oe + 1 : Math.max(1, oe - 1));
|
|
1413
|
-
const ie =
|
|
1446
|
+
const ie = F(J.getFullYear(), J.getMonth() + 1);
|
|
1414
1447
|
J.getDate() > ie && J.setDate(ie);
|
|
1415
1448
|
}
|
|
1416
1449
|
};
|
|
1417
1450
|
me.side === "start" ? ye(ve, me.part) : ye(ge, me.part);
|
|
1418
1451
|
const Se = S(ve), ke = S(ge);
|
|
1419
1452
|
t.value = `${Se} - ${ke}`;
|
|
1420
|
-
const pe =
|
|
1421
|
-
pe && Ae && u(pe, Ae) ? e.onChange({ value: { start: pe, end: Ae }, event:
|
|
1453
|
+
const pe = R(ve), Ae = R(ge);
|
|
1454
|
+
pe && Ae && u(pe, Ae) ? e.onChange({ value: { start: pe, end: Ae }, event: I }) : e.onChange({ value: null, event: I }), B(() => {
|
|
1422
1455
|
requestAnimationFrame(() => {
|
|
1423
1456
|
const J = document.getElementById(
|
|
1424
1457
|
e.id
|
|
@@ -1427,30 +1460,30 @@ function mt(e) {
|
|
|
1427
1460
|
});
|
|
1428
1461
|
});
|
|
1429
1462
|
}, W = (o) => {
|
|
1430
|
-
const { start: d, end:
|
|
1431
|
-
if (!d || !
|
|
1463
|
+
const { start: d, end: I } = l(t.value);
|
|
1464
|
+
if (!d || !I) {
|
|
1432
1465
|
e.onChange({ value: null, event: o });
|
|
1433
1466
|
return;
|
|
1434
1467
|
}
|
|
1435
|
-
const
|
|
1436
|
-
if (!
|
|
1468
|
+
const N = R(d), ne = R(I);
|
|
1469
|
+
if (!N || !ne) {
|
|
1437
1470
|
e.onChange({ value: null, event: o });
|
|
1438
1471
|
return;
|
|
1439
1472
|
}
|
|
1440
|
-
if (!u(
|
|
1473
|
+
if (!u(N, ne)) {
|
|
1441
1474
|
e.onChange({ value: null, event: o });
|
|
1442
1475
|
return;
|
|
1443
1476
|
}
|
|
1444
|
-
e.onChange({ value: { start:
|
|
1477
|
+
e.onChange({ value: { start: N, end: ne }, event: o });
|
|
1445
1478
|
}, re = (o) => {
|
|
1446
|
-
const d = o.value ?? "",
|
|
1447
|
-
if (!d &&
|
|
1448
|
-
|
|
1479
|
+
const d = o.value ?? "", I = o.event;
|
|
1480
|
+
if (!d && I && I.type === "click") {
|
|
1481
|
+
j(I);
|
|
1449
1482
|
return;
|
|
1450
1483
|
}
|
|
1451
1484
|
t.value = d;
|
|
1452
|
-
const
|
|
1453
|
-
r.value =
|
|
1485
|
+
const N = I?.target;
|
|
1486
|
+
r.value = N?.selectionStart ?? 0, W(o);
|
|
1454
1487
|
}, se = (o) => {
|
|
1455
1488
|
r.value = o.target.selectionStart ?? 0;
|
|
1456
1489
|
}, a = (o) => {
|
|
@@ -1462,26 +1495,26 @@ function mt(e) {
|
|
|
1462
1495
|
o.preventDefault(), o.stopPropagation(), e.onShowCalendar(o);
|
|
1463
1496
|
return;
|
|
1464
1497
|
}
|
|
1465
|
-
if (
|
|
1498
|
+
if (p.includes(o.key)) {
|
|
1466
1499
|
o.preventDefault(), o.stopPropagation();
|
|
1467
1500
|
const d = o.target;
|
|
1468
|
-
|
|
1501
|
+
K(o.key, d, o);
|
|
1469
1502
|
return;
|
|
1470
1503
|
}
|
|
1471
|
-
},
|
|
1504
|
+
}, g = (o) => {
|
|
1472
1505
|
o.preventDefault();
|
|
1473
1506
|
const d = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1474
|
-
|
|
1475
|
-
},
|
|
1476
|
-
if (b.includes(o.key) ||
|
|
1507
|
+
K(d, o.target, o);
|
|
1508
|
+
}, V = (o) => {
|
|
1509
|
+
if (b.includes(o.key) || p.includes(o.key)) {
|
|
1477
1510
|
const d = o.target;
|
|
1478
1511
|
r.value = d?.selectionStart ?? 0;
|
|
1479
1512
|
}
|
|
1480
1513
|
}, H = () => {
|
|
1481
|
-
_.value = !0, (e.manageValid ?? !0) && (
|
|
1514
|
+
_.value = !0, (e.manageValid ?? !0) && (h.value = s.value);
|
|
1482
1515
|
}, Z = (o) => {
|
|
1483
1516
|
H();
|
|
1484
|
-
},
|
|
1517
|
+
}, j = (o) => {
|
|
1485
1518
|
t.value = "", r.value = 0, e.onChange({ value: null, event: o }), H(), B(() => {
|
|
1486
1519
|
const d = document.getElementById(
|
|
1487
1520
|
e.id
|
|
@@ -1492,32 +1525,32 @@ function mt(e) {
|
|
|
1492
1525
|
e.externalValue && ue(
|
|
1493
1526
|
e.externalValue,
|
|
1494
1527
|
(o) => {
|
|
1495
|
-
const d = o?.start ?? null,
|
|
1496
|
-
if (d &&
|
|
1497
|
-
if (t.value = `${S(d)} - ${S(
|
|
1498
|
-
const
|
|
1528
|
+
const d = o?.start ?? null, I = o?.end ?? null;
|
|
1529
|
+
if (d && I) {
|
|
1530
|
+
if (t.value = `${S(d)} - ${S(I)}`, e.isOpen?.value && f.value && e.onRequestClose) {
|
|
1531
|
+
const N = typeof e.closeDelay == "number" ? e.closeDelay : e.closeDelay?.value ?? 0;
|
|
1499
1532
|
setTimeout(() => {
|
|
1500
|
-
e.onRequestClose?.(),
|
|
1501
|
-
},
|
|
1533
|
+
e.onRequestClose?.(), f.value = !1, H();
|
|
1534
|
+
}, N);
|
|
1502
1535
|
}
|
|
1503
1536
|
return;
|
|
1504
1537
|
}
|
|
1505
1538
|
},
|
|
1506
1539
|
{ immediate: !0 }
|
|
1507
1540
|
);
|
|
1508
|
-
const n =
|
|
1541
|
+
const n = v(
|
|
1509
1542
|
() => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
|
|
1510
|
-
), c =
|
|
1543
|
+
), c = v(
|
|
1511
1544
|
() => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
|
|
1512
|
-
),
|
|
1545
|
+
), P = v(
|
|
1513
1546
|
() => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
|
|
1514
|
-
), q =
|
|
1547
|
+
), q = v(
|
|
1515
1548
|
() => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
|
|
1516
|
-
),
|
|
1549
|
+
), G = v(
|
|
1517
1550
|
() => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
|
|
1518
|
-
), te =
|
|
1551
|
+
), te = v(
|
|
1519
1552
|
() => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
|
|
1520
|
-
),
|
|
1553
|
+
), U = v(() => {
|
|
1521
1554
|
const { start: o, end: d } = l(t.value);
|
|
1522
1555
|
return [
|
|
1523
1556
|
{
|
|
@@ -1536,15 +1569,15 @@ function mt(e) {
|
|
|
1536
1569
|
label: "Start",
|
|
1537
1570
|
value: `${String(n.value).padStart(2, "0")} / ${String(
|
|
1538
1571
|
c.value
|
|
1539
|
-
).padStart(2, "0")} / ${String(
|
|
1572
|
+
).padStart(2, "0")} / ${String(P.value).padStart(4, "0")}`
|
|
1540
1573
|
},
|
|
1541
1574
|
{
|
|
1542
1575
|
label: "End",
|
|
1543
1576
|
value: `${String(q.value).padStart(2, "0")} / ${String(
|
|
1544
|
-
|
|
1577
|
+
G.value
|
|
1545
1578
|
).padStart(2, "0")} / ${String(te.value).padStart(4, "0")}`
|
|
1546
1579
|
},
|
|
1547
|
-
{ label: "Digits only", value:
|
|
1580
|
+
{ label: "Digits only", value: D.value },
|
|
1548
1581
|
{ label: "Mask complete", value: `${i.value}` },
|
|
1549
1582
|
{
|
|
1550
1583
|
label: "Parsed",
|
|
@@ -1552,7 +1585,7 @@ function mt(e) {
|
|
|
1552
1585
|
},
|
|
1553
1586
|
{
|
|
1554
1587
|
label: "Valid (managed)",
|
|
1555
|
-
value: `${
|
|
1588
|
+
value: `${h.value ?? "-"}`
|
|
1556
1589
|
},
|
|
1557
1590
|
{ label: "Span (days)", value: `${z.value ?? "-"}` },
|
|
1558
1591
|
{
|
|
@@ -1562,8 +1595,8 @@ function mt(e) {
|
|
|
1562
1595
|
{
|
|
1563
1596
|
label: "Cursor in",
|
|
1564
1597
|
value: `${r.value ?? "-"} (${(() => {
|
|
1565
|
-
const
|
|
1566
|
-
return `${
|
|
1598
|
+
const I = r.value ?? 0, N = T(I);
|
|
1599
|
+
return `${N.side}.${N.part}`;
|
|
1567
1600
|
})()})`
|
|
1568
1601
|
}
|
|
1569
1602
|
];
|
|
@@ -1592,15 +1625,15 @@ function mt(e) {
|
|
|
1592
1625
|
document.querySelectorAll(".k-animation-container")
|
|
1593
1626
|
);
|
|
1594
1627
|
if (!o.length) return;
|
|
1595
|
-
const
|
|
1628
|
+
const I = [...o].reverse().find((ae) => ae.querySelector(".k-calendar"))?.querySelector(
|
|
1596
1629
|
".k-calendar"
|
|
1597
1630
|
);
|
|
1598
|
-
if (!
|
|
1599
|
-
const
|
|
1631
|
+
if (!I) return;
|
|
1632
|
+
const N = I.querySelectorAll(
|
|
1600
1633
|
".k-calendar-table"
|
|
1601
1634
|
);
|
|
1602
1635
|
let ne = !1;
|
|
1603
|
-
|
|
1636
|
+
N.forEach((ae) => {
|
|
1604
1637
|
ae.tabIndex === 0 && (ne ? ae.tabIndex = -1 : ne = !0);
|
|
1605
1638
|
});
|
|
1606
1639
|
} catch (o) {
|
|
@@ -1617,69 +1650,69 @@ function mt(e) {
|
|
|
1617
1650
|
), {
|
|
1618
1651
|
raw: t,
|
|
1619
1652
|
cursorPos: r,
|
|
1620
|
-
debugEnabled:
|
|
1621
|
-
debugLines:
|
|
1622
|
-
digitsOnly:
|
|
1623
|
-
valid:
|
|
1653
|
+
debugEnabled: y,
|
|
1654
|
+
debugLines: U,
|
|
1655
|
+
digitsOnly: D,
|
|
1656
|
+
valid: h,
|
|
1624
1657
|
validComputed: Q(s),
|
|
1625
1658
|
reason: Q(ee),
|
|
1626
1659
|
validationMessage: Q(w),
|
|
1627
1660
|
spanDays: Q(z),
|
|
1628
1661
|
month1: Q(n),
|
|
1629
1662
|
day1: Q(c),
|
|
1630
|
-
year1: Q(
|
|
1663
|
+
year1: Q(P),
|
|
1631
1664
|
month2: Q(q),
|
|
1632
|
-
day2: Q(
|
|
1665
|
+
day2: Q(G),
|
|
1633
1666
|
year2: Q(te),
|
|
1634
1667
|
handleChange: re,
|
|
1635
1668
|
handleKeyDown: a,
|
|
1636
|
-
handleWheel:
|
|
1637
|
-
handleKeyUp:
|
|
1669
|
+
handleWheel: g,
|
|
1670
|
+
handleKeyUp: V,
|
|
1638
1671
|
handleClick: se,
|
|
1639
1672
|
handleBlur: Z,
|
|
1640
|
-
handleClear:
|
|
1673
|
+
handleClear: j,
|
|
1641
1674
|
onCalendarChange: () => {
|
|
1642
|
-
|
|
1675
|
+
f.value = !0;
|
|
1643
1676
|
},
|
|
1644
1677
|
initStyling: X
|
|
1645
1678
|
};
|
|
1646
1679
|
}
|
|
1647
|
-
function
|
|
1648
|
-
const t =
|
|
1680
|
+
function bt(e) {
|
|
1681
|
+
const t = O(""), r = O(void 0), y = O(!!e.debug), f = O(e.timeFormat ?? "hh:mm AM"), m = v(() => !!e.required), A = O(!1), x = ["ArrowUp", "ArrowDown"], C = ["ArrowLeft", "ArrowRight"], $ = v(() => (t.value ?? "").replace(/\D/g, "")), D = {
|
|
1649
1682
|
H: /[0-9]/,
|
|
1650
1683
|
h: /[0-9]/,
|
|
1651
1684
|
M: /[0-9]/,
|
|
1652
1685
|
m: /[0-9]/,
|
|
1653
1686
|
A: /[AaPp]/,
|
|
1654
1687
|
a: /[Mm]/
|
|
1655
|
-
},
|
|
1688
|
+
}, F = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = v(() => {
|
|
1656
1689
|
const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", c = parseInt(n);
|
|
1657
1690
|
return Math.min(Math.max(c, 0), 23);
|
|
1658
|
-
}), k =
|
|
1691
|
+
}), k = v(() => {
|
|
1659
1692
|
const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", c = parseInt(n);
|
|
1660
1693
|
return Math.min(Math.max(c, 0), 59);
|
|
1661
|
-
}),
|
|
1662
|
-
const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), c =
|
|
1694
|
+
}), R = v(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), u = v(() => {
|
|
1695
|
+
const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), c = R.value;
|
|
1663
1696
|
return n === 12 ? c === "AM" ? 0 : 12 : c === "PM" ? n + 12 : n;
|
|
1664
|
-
}), i =
|
|
1697
|
+
}), i = v(() => l.value ? `${String(u.value).padStart(2, "0")}:${String(k.value).padStart(2, "0")}:00` : null), l = v(
|
|
1665
1698
|
() => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
|
|
1666
|
-
),
|
|
1699
|
+
), h = (n, c, P) => {
|
|
1667
1700
|
let q = n % 12;
|
|
1668
1701
|
return q === 0 && (q = 12), `${String(q).padStart(2, "0")}:${String(c).padStart(
|
|
1669
1702
|
2,
|
|
1670
1703
|
"0"
|
|
1671
|
-
)} ${
|
|
1672
|
-
},
|
|
1704
|
+
)} ${P}`;
|
|
1705
|
+
}, L = (n) => {
|
|
1673
1706
|
const c = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1674
1707
|
if (!c) return null;
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
let te =
|
|
1678
|
-
|
|
1679
|
-
const
|
|
1680
|
-
return
|
|
1708
|
+
const P = parseInt(c[1]), q = parseInt(c[2]), G = c[3].toUpperCase();
|
|
1709
|
+
if (P < 1 || P > 12 || q < 0 || q > 59) return null;
|
|
1710
|
+
let te = P % 12;
|
|
1711
|
+
G === "PM" && (te += 12);
|
|
1712
|
+
const U = /* @__PURE__ */ new Date();
|
|
1713
|
+
return U.setSeconds(0, 0), U.setHours(te), U.setMinutes(q), U;
|
|
1681
1714
|
}, Y = (n) => {
|
|
1682
|
-
if (
|
|
1715
|
+
if ($.value.length === 0) {
|
|
1683
1716
|
e.onChange({ value: null, event: n });
|
|
1684
1717
|
return;
|
|
1685
1718
|
}
|
|
@@ -1687,22 +1720,22 @@ function vt(e) {
|
|
|
1687
1720
|
e.onChange({ value: null, event: n });
|
|
1688
1721
|
return;
|
|
1689
1722
|
}
|
|
1690
|
-
const c =
|
|
1723
|
+
const c = L(t.value);
|
|
1691
1724
|
c && _(c) ? e.onChange({ value: c, event: n }) : e.onChange({ value: null, event: n });
|
|
1692
1725
|
}, z = (n) => n.getHours() * 60 + n.getMinutes(), _ = (n) => {
|
|
1693
|
-
const c = e.min ?? void 0,
|
|
1726
|
+
const c = e.min ?? void 0, P = e.max ?? void 0, q = z(n);
|
|
1694
1727
|
if (c) {
|
|
1695
|
-
const
|
|
1696
|
-
if (q <
|
|
1728
|
+
const G = z(c);
|
|
1729
|
+
if (q < G) return !1;
|
|
1697
1730
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
const
|
|
1700
|
-
if (q >
|
|
1731
|
+
if (P) {
|
|
1732
|
+
const G = z(P);
|
|
1733
|
+
if (q > G) return !1;
|
|
1701
1734
|
}
|
|
1702
1735
|
return !0;
|
|
1703
1736
|
}, ee = (n) => {
|
|
1704
|
-
const c = n.getHours(),
|
|
1705
|
-
t.value =
|
|
1737
|
+
const c = n.getHours(), P = c >= 12 ? "PM" : "AM";
|
|
1738
|
+
t.value = h(c, n.getMinutes(), P);
|
|
1706
1739
|
}, s = (n, c) => {
|
|
1707
1740
|
e.onChange({ value: n, event: c });
|
|
1708
1741
|
}, w = () => {
|
|
@@ -1720,23 +1753,23 @@ function vt(e) {
|
|
|
1720
1753
|
});
|
|
1721
1754
|
});
|
|
1722
1755
|
});
|
|
1723
|
-
},
|
|
1756
|
+
}, p = (n) => {
|
|
1724
1757
|
const c = n?.event?.target;
|
|
1725
1758
|
return c ? c.closest(".k-time-now") ? "now" : c.closest(".k-time-accept") ? "set" : null : null;
|
|
1726
1759
|
}, b = (n, c) => {
|
|
1727
1760
|
n && _(n) ? s(n, c) : s(null, c);
|
|
1728
|
-
},
|
|
1761
|
+
}, M = (...n) => {
|
|
1729
1762
|
const c = n[0];
|
|
1730
1763
|
if (!c) return;
|
|
1731
|
-
const
|
|
1732
|
-
if (
|
|
1733
|
-
const
|
|
1734
|
-
ee(
|
|
1764
|
+
const P = p(c);
|
|
1765
|
+
if (P === "now") {
|
|
1766
|
+
const G = /* @__PURE__ */ new Date();
|
|
1767
|
+
ee(G), b(G, c), w();
|
|
1735
1768
|
return;
|
|
1736
1769
|
}
|
|
1737
1770
|
if (c?.value instanceof Date) {
|
|
1738
|
-
const
|
|
1739
|
-
ee(
|
|
1771
|
+
const G = new Date(c.value);
|
|
1772
|
+
ee(G), b(G, c), P === "set" && w();
|
|
1740
1773
|
return;
|
|
1741
1774
|
}
|
|
1742
1775
|
if (c?.value === null) {
|
|
@@ -1747,22 +1780,22 @@ function vt(e) {
|
|
|
1747
1780
|
const q = c.event?.target;
|
|
1748
1781
|
r.value = q?.selectionStart ?? 0;
|
|
1749
1782
|
try {
|
|
1750
|
-
const
|
|
1751
|
-
if (
|
|
1783
|
+
const G = r.value ?? 0;
|
|
1784
|
+
if (F(G) === "ampm" && (t.value ?? "").length >= 8) {
|
|
1752
1785
|
const te = t.value.charAt(6);
|
|
1753
1786
|
/[Aa]/.test(te) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, B(() => {
|
|
1754
1787
|
requestAnimationFrame(() => {
|
|
1755
|
-
const
|
|
1788
|
+
const U = document.getElementById(
|
|
1756
1789
|
e.id
|
|
1757
1790
|
);
|
|
1758
|
-
|
|
1791
|
+
U && (U.focus(), U.setSelectionRange(8, 8));
|
|
1759
1792
|
});
|
|
1760
1793
|
})) : /[Pp]/.test(te) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, B(() => {
|
|
1761
1794
|
requestAnimationFrame(() => {
|
|
1762
|
-
const
|
|
1795
|
+
const U = document.getElementById(
|
|
1763
1796
|
e.id
|
|
1764
1797
|
);
|
|
1765
|
-
|
|
1798
|
+
U && (U.focus(), U.setSelectionRange(8, 8));
|
|
1766
1799
|
});
|
|
1767
1800
|
}));
|
|
1768
1801
|
}
|
|
@@ -1771,16 +1804,16 @@ function vt(e) {
|
|
|
1771
1804
|
Y(c);
|
|
1772
1805
|
}, S = (n) => {
|
|
1773
1806
|
r.value = n.target.selectionStart ?? 0;
|
|
1774
|
-
},
|
|
1807
|
+
}, T = (n, c, P) => {
|
|
1775
1808
|
const q = c?.selectionStart ?? r.value ?? 0;
|
|
1776
1809
|
r.value = q;
|
|
1777
|
-
const
|
|
1810
|
+
const G = F(q), te = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1778
1811
|
if (!te) {
|
|
1779
|
-
if ((t.value ?? "").length === 0 ||
|
|
1780
|
-
const d = /* @__PURE__ */ new Date(),
|
|
1781
|
-
t.value =
|
|
1782
|
-
const ne =
|
|
1783
|
-
b(ne,
|
|
1812
|
+
if ((t.value ?? "").length === 0 || $.value.length === 0) {
|
|
1813
|
+
const d = /* @__PURE__ */ new Date(), I = d.getHours(), N = I >= 12 ? "PM" : "AM";
|
|
1814
|
+
t.value = h(I, d.getMinutes(), N);
|
|
1815
|
+
const ne = L(t.value);
|
|
1816
|
+
b(ne, P), B(() => {
|
|
1784
1817
|
requestAnimationFrame(() => {
|
|
1785
1818
|
const ae = document.getElementById(
|
|
1786
1819
|
e.id
|
|
@@ -1791,37 +1824,37 @@ function vt(e) {
|
|
|
1791
1824
|
}
|
|
1792
1825
|
return;
|
|
1793
1826
|
}
|
|
1794
|
-
let
|
|
1795
|
-
if (
|
|
1796
|
-
n === "ArrowUp" ?
|
|
1797
|
-
else if (
|
|
1827
|
+
let U = parseInt(te[1]), X = parseInt(te[2]), ce = te[3].toUpperCase();
|
|
1828
|
+
if (G === "hh")
|
|
1829
|
+
n === "ArrowUp" ? U = U < 12 ? U + 1 : 1 : U = U > 1 ? U - 1 : 12;
|
|
1830
|
+
else if (G === "mm") {
|
|
1798
1831
|
const d = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
|
|
1799
1832
|
if (d === 1)
|
|
1800
1833
|
n === "ArrowUp" ? X = X < 59 ? X + 1 : 0 : X = X > 0 ? X - 1 : 59;
|
|
1801
1834
|
else if (n === "ArrowUp") {
|
|
1802
|
-
const
|
|
1803
|
-
let
|
|
1804
|
-
|
|
1835
|
+
const I = X % d;
|
|
1836
|
+
let N = I === 0 ? X + d : X + (d - I);
|
|
1837
|
+
N >= 60 && (N = 0), X = N;
|
|
1805
1838
|
} else {
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1808
|
-
|
|
1839
|
+
const I = X % d;
|
|
1840
|
+
let N = I === 0 ? X - d : X - I;
|
|
1841
|
+
N < 0 && (N = 60 - d), X = N;
|
|
1809
1842
|
}
|
|
1810
|
-
} else
|
|
1811
|
-
t.value = `${String(
|
|
1843
|
+
} else G === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
|
|
1844
|
+
t.value = `${String(U).padStart(2, "0")}:${String(X).padStart(
|
|
1812
1845
|
2,
|
|
1813
1846
|
"0"
|
|
1814
1847
|
)} ${ce}`;
|
|
1815
|
-
const o =
|
|
1816
|
-
b(o,
|
|
1848
|
+
const o = L(t.value);
|
|
1849
|
+
b(o, P), B(() => {
|
|
1817
1850
|
requestAnimationFrame(() => {
|
|
1818
1851
|
const d = document.getElementById(
|
|
1819
1852
|
e.id
|
|
1820
|
-
),
|
|
1821
|
-
d && (d.focus(), d.setSelectionRange(
|
|
1853
|
+
), I = r.value ?? 0;
|
|
1854
|
+
d && (d.focus(), d.setSelectionRange(I, I));
|
|
1822
1855
|
});
|
|
1823
1856
|
});
|
|
1824
|
-
},
|
|
1857
|
+
}, K = (n) => {
|
|
1825
1858
|
if (n.code === "Space" || n.key === " ") {
|
|
1826
1859
|
n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
|
|
1827
1860
|
return;
|
|
@@ -1830,29 +1863,29 @@ function vt(e) {
|
|
|
1830
1863
|
n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
|
|
1831
1864
|
return;
|
|
1832
1865
|
}
|
|
1833
|
-
if (
|
|
1866
|
+
if (x.includes(n.key)) {
|
|
1834
1867
|
if (n.altKey) return;
|
|
1835
1868
|
n.preventDefault(), n.stopPropagation();
|
|
1836
1869
|
const c = n.target;
|
|
1837
|
-
|
|
1870
|
+
T(n.key, c, n);
|
|
1838
1871
|
return;
|
|
1839
1872
|
}
|
|
1840
1873
|
}, W = (n) => {
|
|
1841
1874
|
n.preventDefault();
|
|
1842
1875
|
const c = n.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1843
|
-
|
|
1876
|
+
T(c, n.target, n);
|
|
1844
1877
|
}, re = (n) => {
|
|
1845
1878
|
const c = n.target;
|
|
1846
|
-
if (
|
|
1879
|
+
if (C.includes(n.key)) {
|
|
1847
1880
|
r.value = c?.selectionStart ?? 0;
|
|
1848
1881
|
return;
|
|
1849
1882
|
}
|
|
1850
|
-
if (
|
|
1883
|
+
if (x.includes(n.key)) {
|
|
1851
1884
|
if (n.altKey) return;
|
|
1852
1885
|
r.value = c?.selectionStart ?? 0;
|
|
1853
1886
|
}
|
|
1854
1887
|
}, se = (n) => {
|
|
1855
|
-
|
|
1888
|
+
A.value = !0, m.value && e.externalValue && e.externalValue.value === void 0 && $.value.length === 0 && (e.externalValue.value = "");
|
|
1856
1889
|
const c = n.target;
|
|
1857
1890
|
c && (r.value = c.selectionStart ?? 0);
|
|
1858
1891
|
};
|
|
@@ -1862,25 +1895,25 @@ function vt(e) {
|
|
|
1862
1895
|
if (n) {
|
|
1863
1896
|
const c = new Date(n);
|
|
1864
1897
|
if (c.toString() !== "Invalid Date") {
|
|
1865
|
-
const
|
|
1866
|
-
t.value =
|
|
1898
|
+
const P = c.getHours(), q = P >= 12 ? "PM" : "AM";
|
|
1899
|
+
t.value = h(P, c.getMinutes(), q);
|
|
1867
1900
|
return;
|
|
1868
1901
|
}
|
|
1869
1902
|
}
|
|
1870
1903
|
},
|
|
1871
1904
|
{ immediate: !0 }
|
|
1872
1905
|
);
|
|
1873
|
-
const a =
|
|
1906
|
+
const a = v(() => [
|
|
1874
1907
|
["Time", t.value || "--:-- --"],
|
|
1875
1908
|
["Hour (12h)", E.value],
|
|
1876
1909
|
["Hour (24h)", u.value],
|
|
1877
1910
|
["Minute", k.value],
|
|
1878
|
-
["Period",
|
|
1911
|
+
["Period", R.value],
|
|
1879
1912
|
["Time (24h)", i.value ?? "--:--:--"],
|
|
1880
|
-
["Digits only",
|
|
1913
|
+
["Digits only", $.value],
|
|
1881
1914
|
[
|
|
1882
1915
|
"Parsed Date",
|
|
1883
|
-
|
|
1916
|
+
g.value?.toLocaleDateString("en-US", {
|
|
1884
1917
|
hour: "2-digit",
|
|
1885
1918
|
minute: "2-digit"
|
|
1886
1919
|
}) ?? null
|
|
@@ -1899,49 +1932,49 @@ function vt(e) {
|
|
|
1899
1932
|
minute: "2-digit"
|
|
1900
1933
|
}) ?? null
|
|
1901
1934
|
],
|
|
1902
|
-
["valid",
|
|
1935
|
+
["valid", V.value],
|
|
1903
1936
|
["reason", H.value],
|
|
1904
1937
|
["validationMessage", Z.value]
|
|
1905
|
-
]),
|
|
1906
|
-
() =>
|
|
1907
|
-
),
|
|
1938
|
+
]), g = v(
|
|
1939
|
+
() => L(t.value) ?? null
|
|
1940
|
+
), V = v(() => {
|
|
1908
1941
|
if (!m.value) {
|
|
1909
1942
|
if (!l.value) return !0;
|
|
1910
|
-
const c =
|
|
1943
|
+
const c = g.value;
|
|
1911
1944
|
return c ? _(c) : !1;
|
|
1912
1945
|
}
|
|
1913
|
-
if (!
|
|
1914
|
-
const n =
|
|
1946
|
+
if (!A.value) return !0;
|
|
1947
|
+
const n = g.value;
|
|
1915
1948
|
return !l.value || !n ? !1 : _(n);
|
|
1916
|
-
}), H =
|
|
1949
|
+
}), H = v(() => {
|
|
1917
1950
|
if (!m.value) {
|
|
1918
1951
|
if (!l.value) return;
|
|
1919
|
-
const c =
|
|
1952
|
+
const c = g.value;
|
|
1920
1953
|
return c ? _(c) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1921
1954
|
}
|
|
1922
|
-
if (!
|
|
1923
|
-
if (
|
|
1955
|
+
if (!A.value) return;
|
|
1956
|
+
if ($.value.length === 0 || !l.value)
|
|
1924
1957
|
return "incomplete";
|
|
1925
|
-
const n =
|
|
1958
|
+
const n = g.value;
|
|
1926
1959
|
return n ? _(n) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1927
|
-
}), Z =
|
|
1960
|
+
}), Z = v(() => {
|
|
1928
1961
|
const n = H.value;
|
|
1929
1962
|
if (!n || n === "valid") return "";
|
|
1930
1963
|
if (n === "incomplete")
|
|
1931
1964
|
return "Required";
|
|
1932
1965
|
if (n === "invalid-time")
|
|
1933
|
-
return `Must be in ${
|
|
1966
|
+
return `Must be in ${f.value} format.`;
|
|
1934
1967
|
const c = {
|
|
1935
1968
|
hour: "2-digit",
|
|
1936
1969
|
minute: "2-digit"
|
|
1937
|
-
},
|
|
1970
|
+
}, P = e.min ? e.min.toLocaleTimeString("en-US", c) : null, q = e.max ? e.max.toLocaleTimeString("en-US", c) : null;
|
|
1938
1971
|
if (n === "out-of-bounds") {
|
|
1939
|
-
if (
|
|
1940
|
-
if (
|
|
1972
|
+
if (P && q) return `Must be between ${P} and ${q}.`;
|
|
1973
|
+
if (P) return `Must be ${P} or later.`;
|
|
1941
1974
|
if (q) return `Must be ${q} or earlier.`;
|
|
1942
1975
|
}
|
|
1943
1976
|
return "";
|
|
1944
|
-
}),
|
|
1977
|
+
}), j = () => {
|
|
1945
1978
|
B(() => {
|
|
1946
1979
|
const n = document.getElementById(e.id);
|
|
1947
1980
|
if (!n) {
|
|
@@ -1955,25 +1988,25 @@ function vt(e) {
|
|
|
1955
1988
|
);
|
|
1956
1989
|
return;
|
|
1957
1990
|
}
|
|
1958
|
-
const
|
|
1959
|
-
if (!
|
|
1991
|
+
const P = c.parentElement;
|
|
1992
|
+
if (!P) {
|
|
1960
1993
|
console.warn(
|
|
1961
1994
|
`Parent of .k-timepicker not found for #${e.id} styling.`
|
|
1962
1995
|
);
|
|
1963
1996
|
return;
|
|
1964
1997
|
}
|
|
1965
|
-
|
|
1998
|
+
P.classList.contains("fk-timepicker") || P.classList.add("fk-timepicker");
|
|
1966
1999
|
});
|
|
1967
2000
|
};
|
|
1968
2001
|
return Me(() => {
|
|
1969
|
-
|
|
2002
|
+
j();
|
|
1970
2003
|
}), {
|
|
1971
2004
|
raw: t,
|
|
1972
|
-
rules:
|
|
1973
|
-
debugEnabled:
|
|
2005
|
+
rules: D,
|
|
2006
|
+
debugEnabled: y,
|
|
1974
2007
|
debugLines: a,
|
|
1975
|
-
placeholder:
|
|
1976
|
-
isValid:
|
|
2008
|
+
placeholder: f,
|
|
2009
|
+
isValid: V,
|
|
1977
2010
|
reason: Q(H),
|
|
1978
2011
|
validationMessage: Z,
|
|
1979
2012
|
isComplete: l,
|
|
@@ -1982,100 +2015,101 @@ function vt(e) {
|
|
|
1982
2015
|
hour: Q(E),
|
|
1983
2016
|
hour24: Q(u),
|
|
1984
2017
|
minute: Q(k),
|
|
1985
|
-
period: Q(
|
|
2018
|
+
period: Q(R),
|
|
1986
2019
|
time24: Q(i),
|
|
1987
|
-
parsedRawTime: Q(
|
|
1988
|
-
handleChange:
|
|
1989
|
-
handleKeyDown:
|
|
2020
|
+
parsedRawTime: Q(g),
|
|
2021
|
+
handleChange: M,
|
|
2022
|
+
handleKeyDown: K,
|
|
1990
2023
|
handleKeyUp: re,
|
|
1991
2024
|
handleClick: S,
|
|
1992
2025
|
handleWheel: W,
|
|
1993
2026
|
handleBlur: se,
|
|
1994
2027
|
// Expose so consumers can reapply theming when Kendo updates DOM
|
|
1995
|
-
initStyling:
|
|
2028
|
+
initStyling: j
|
|
1996
2029
|
};
|
|
1997
2030
|
}
|
|
1998
|
-
function
|
|
1999
|
-
const t =
|
|
2031
|
+
function wt(e) {
|
|
2032
|
+
const t = qe(null), r = [
|
|
2000
2033
|
".k-animation-container .k-popup",
|
|
2001
2034
|
".k-popup",
|
|
2002
2035
|
".k-timepicker-popup",
|
|
2003
2036
|
".k-menu-popup"
|
|
2004
|
-
],
|
|
2037
|
+
], y = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), f = (D) => D ? typeof e.initialFocus == "string" ? D.querySelector(e.initialFocus) ?? D : typeof e.initialFocus == "function" ? e.initialFocus(D) ?? D : D.querySelector(
|
|
2005
2038
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
2006
|
-
) ??
|
|
2039
|
+
) ?? D : null, { activate: m, deactivate: A } = Oe(t, {
|
|
2007
2040
|
escapeDeactivates: !1,
|
|
2008
2041
|
clickOutsideDeactivates: !1,
|
|
2009
2042
|
fallbackFocus: () => t.value,
|
|
2010
|
-
initialFocus: () =>
|
|
2043
|
+
initialFocus: () => f(t.value),
|
|
2011
2044
|
...e.focusTrapOptions ?? {}
|
|
2012
2045
|
});
|
|
2013
|
-
let
|
|
2014
|
-
const
|
|
2046
|
+
let x = null, C = O(null);
|
|
2047
|
+
const $ = () => {
|
|
2015
2048
|
if (e.resolvePopupEl) return e.resolvePopupEl();
|
|
2016
|
-
const
|
|
2017
|
-
const
|
|
2018
|
-
if (!
|
|
2019
|
-
const u =
|
|
2049
|
+
const D = (E, k) => {
|
|
2050
|
+
const R = Array.from(E.querySelectorAll(k));
|
|
2051
|
+
if (!R.length) return null;
|
|
2052
|
+
const u = R.filter(
|
|
2020
2053
|
(i) => i.offsetParent !== null || i.getClientRects().length > 0
|
|
2021
2054
|
);
|
|
2022
|
-
return u[u.length - 1] ??
|
|
2023
|
-
},
|
|
2024
|
-
for (const E of
|
|
2025
|
-
const k =
|
|
2055
|
+
return u[u.length - 1] ?? R[R.length - 1] ?? null;
|
|
2056
|
+
}, F = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
|
|
2057
|
+
for (const E of y) {
|
|
2058
|
+
const k = D(F, E);
|
|
2026
2059
|
if (k) return k;
|
|
2027
2060
|
}
|
|
2028
|
-
for (const E of
|
|
2029
|
-
const k =
|
|
2061
|
+
for (const E of y) {
|
|
2062
|
+
const k = D(document, E);
|
|
2030
2063
|
if (k) return k;
|
|
2031
2064
|
}
|
|
2032
2065
|
return null;
|
|
2033
2066
|
};
|
|
2034
|
-
return
|
|
2035
|
-
|
|
2067
|
+
return Fe(t, (D) => {
|
|
2068
|
+
C.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", D);
|
|
2036
2069
|
}), ue(
|
|
2037
2070
|
() => e.isOpen.value,
|
|
2038
|
-
(
|
|
2039
|
-
|
|
2040
|
-
const
|
|
2041
|
-
|
|
2042
|
-
E.key === "Escape" && (
|
|
2043
|
-
}, document.addEventListener("keydown",
|
|
2044
|
-
})) : (
|
|
2045
|
-
const
|
|
2046
|
-
const E = e.triggerEl?.value, k = E?.querySelector("input"),
|
|
2047
|
-
|
|
2071
|
+
(D) => {
|
|
2072
|
+
D ? (C.value = null, B(() => {
|
|
2073
|
+
const F = $();
|
|
2074
|
+
F && (t.value = F, setTimeout(() => m(), 0), x || (x = (E) => {
|
|
2075
|
+
E.key === "Escape" && (C.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", E));
|
|
2076
|
+
}, document.addEventListener("keydown", x, !0)));
|
|
2077
|
+
})) : (A(), x && (document.removeEventListener("keydown", x, !0), x = null), t.value = null, C.value === "outside" && B(() => {
|
|
2078
|
+
const F = () => {
|
|
2079
|
+
const E = e.triggerEl?.value, k = E?.querySelector("input"), R = document.activeElement;
|
|
2080
|
+
R && (R === k || E && E.contains(R)) && (k ?? E)?.blur?.();
|
|
2048
2081
|
};
|
|
2049
|
-
requestAnimationFrame(() => setTimeout(
|
|
2050
|
-
}), e.returnFocusToTrigger !== !1 &&
|
|
2051
|
-
const
|
|
2082
|
+
requestAnimationFrame(() => setTimeout(F, 0));
|
|
2083
|
+
}), e.returnFocusToTrigger !== !1 && C.value === "escape" && e.triggerEl?.value && B(() => {
|
|
2084
|
+
const F = () => {
|
|
2052
2085
|
const E = e.triggerEl?.value;
|
|
2053
2086
|
if (!E) return;
|
|
2054
2087
|
(E.querySelector("input") ?? E)?.focus?.();
|
|
2055
2088
|
};
|
|
2056
|
-
requestAnimationFrame(() => setTimeout(
|
|
2089
|
+
requestAnimationFrame(() => setTimeout(F, 0));
|
|
2057
2090
|
}));
|
|
2058
2091
|
}
|
|
2059
2092
|
), {
|
|
2060
2093
|
popupRef: t,
|
|
2061
2094
|
activate: m,
|
|
2062
|
-
deactivate:
|
|
2063
|
-
lastCloseReason: Q(
|
|
2064
|
-
setPopupEl: (
|
|
2095
|
+
deactivate: A,
|
|
2096
|
+
lastCloseReason: Q(C),
|
|
2097
|
+
setPopupEl: (D) => t.value = D
|
|
2065
2098
|
};
|
|
2066
2099
|
}
|
|
2067
2100
|
export {
|
|
2068
|
-
|
|
2069
|
-
We as
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
pt as
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2101
|
+
gt as useActiveIdRegistry,
|
|
2102
|
+
We as useFieldsetTouchTracker,
|
|
2103
|
+
je as useFieldsetValidationKit,
|
|
2104
|
+
dt as useGridA11y,
|
|
2105
|
+
ft as useGridActiveFilter,
|
|
2106
|
+
pt as useGridRowAction,
|
|
2107
|
+
yt as useMaskedDateInput,
|
|
2108
|
+
ht as useMaskedDateRangeInput,
|
|
2109
|
+
bt as useMaskedTimeInput,
|
|
2110
|
+
vt as usePopupMenu,
|
|
2111
|
+
wt as usePopupTrap,
|
|
2112
|
+
mt as useUSAddress,
|
|
2113
|
+
Xe as useZipTextBox
|
|
2080
2114
|
};
|
|
2081
2115
|
//# sourceMappingURL=featherk-composables.es.js.map
|