@featherk/composables 0.11.0 → 0.11.1
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.
|
@@ -3,10 +3,10 @@ import { useFocusTrap as qe } from "@vueuse/integrations/useFocusTrap";
|
|
|
3
3
|
const st = (e, t) => {
|
|
4
4
|
const r = U(null);
|
|
5
5
|
let h = !1, p = null, m = null;
|
|
6
|
-
const D = [],
|
|
6
|
+
const D = [], V = ".k-table-row[data-grid-row-index] [tabindex]", T = () => {
|
|
7
7
|
const s = e?.value?.$el;
|
|
8
8
|
return s ? s.closest(".k-grid") : null;
|
|
9
|
-
},
|
|
9
|
+
}, F = (s) => {
|
|
10
10
|
const w = T();
|
|
11
11
|
if (!w) return !1;
|
|
12
12
|
const f = s.closest(".k-grid-aria-root");
|
|
@@ -16,10 +16,10 @@ const st = (e, t) => {
|
|
|
16
16
|
".k-grid-header, .k-grid-content, .k-grid-content-locked"
|
|
17
17
|
);
|
|
18
18
|
return b ? w.contains(b) : !1;
|
|
19
|
-
},
|
|
19
|
+
}, k = (s) => s.key === "Enter" || s.code === "Enter" || s.code === "NumpadEnter", R = () => e?.value?.columns, E = (s) => {
|
|
20
20
|
const w = s.key || s.code;
|
|
21
|
-
([" ", "Spacebar", "Space"].includes(w) ||
|
|
22
|
-
},
|
|
21
|
+
([" ", "Spacebar", "Space"].includes(w) || k(s)) && (s.preventDefault(), s.stopPropagation(), r.value = s.target, s.target.click());
|
|
22
|
+
}, A = (s) => {
|
|
23
23
|
if (!r.value) return;
|
|
24
24
|
if (s.code === "Escape") {
|
|
25
25
|
s.stopPropagation(), r.value && r.value.focus();
|
|
@@ -85,7 +85,7 @@ const st = (e, t) => {
|
|
|
85
85
|
});
|
|
86
86
|
})), b.addEventListener(
|
|
87
87
|
"keydown",
|
|
88
|
-
|
|
88
|
+
A
|
|
89
89
|
), B(() => {
|
|
90
90
|
const M = () => {
|
|
91
91
|
const N = Array.from(
|
|
@@ -109,7 +109,7 @@ const st = (e, t) => {
|
|
|
109
109
|
).forEach((S) => {
|
|
110
110
|
S.addEventListener(
|
|
111
111
|
"keydown",
|
|
112
|
-
|
|
112
|
+
A
|
|
113
113
|
);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
@@ -118,13 +118,13 @@ const st = (e, t) => {
|
|
|
118
118
|
const b = f;
|
|
119
119
|
b.classList.contains("k-animation-container") && b.removeEventListener(
|
|
120
120
|
"keydown",
|
|
121
|
-
|
|
121
|
+
A
|
|
122
122
|
), b.querySelectorAll(
|
|
123
123
|
".k-animation-container"
|
|
124
124
|
).forEach((S) => {
|
|
125
125
|
S.removeEventListener(
|
|
126
126
|
"keydown",
|
|
127
|
-
|
|
127
|
+
A
|
|
128
128
|
);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
@@ -147,7 +147,7 @@ const st = (e, t) => {
|
|
|
147
147
|
const f = w.closest(
|
|
148
148
|
".k-table-row[data-grid-row-index]"
|
|
149
149
|
);
|
|
150
|
-
if (!
|
|
150
|
+
if (!F(w))
|
|
151
151
|
return;
|
|
152
152
|
const b = ["ArrowLeft", "ArrowRight"].includes(
|
|
153
153
|
s.code
|
|
@@ -204,7 +204,7 @@ const st = (e, t) => {
|
|
|
204
204
|
if (["ArrowLeft", "ArrowRight"].includes(s.code)) {
|
|
205
205
|
s.preventDefault(), s.stopPropagation();
|
|
206
206
|
const I = f.querySelectorAll(
|
|
207
|
-
|
|
207
|
+
V
|
|
208
208
|
);
|
|
209
209
|
if (I.length === 0) return;
|
|
210
210
|
let S = Array.from(I).findIndex(
|
|
@@ -266,7 +266,7 @@ const st = (e, t) => {
|
|
|
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
272
|
w && w.forEach((f) => {
|
|
@@ -322,7 +322,7 @@ const st = (e, t) => {
|
|
|
322
322
|
f.removeEventListener("click", re);
|
|
323
323
|
});
|
|
324
324
|
const se = (a) => {
|
|
325
|
-
if ((
|
|
325
|
+
if ((k(a) || a.code === "Space") && (M || N)) {
|
|
326
326
|
if (a.preventDefault(), a.stopPropagation(), r.value = f, r.value.focus(), M)
|
|
327
327
|
W(a);
|
|
328
328
|
else if (N) {
|
|
@@ -339,7 +339,7 @@ const st = (e, t) => {
|
|
|
339
339
|
if (w && w.dataset.featherKHeaderBound !== "true") {
|
|
340
340
|
const f = (b) => {
|
|
341
341
|
const I = b.target.closest("th");
|
|
342
|
-
I && (
|
|
342
|
+
I && (k(b) || b.code === "Space") && I.dataset.featherKFilterable === "false" && I.dataset.featherKSortable === "false" && (b.preventDefault(), b.stopImmediatePropagation());
|
|
343
343
|
};
|
|
344
344
|
w.addEventListener(
|
|
345
345
|
"keydown",
|
|
@@ -374,7 +374,7 @@ const st = (e, t) => {
|
|
|
374
374
|
}, ee = () => {
|
|
375
375
|
if (!h)
|
|
376
376
|
try {
|
|
377
|
-
l(), g(),
|
|
377
|
+
l(), g(), L(), h = !0;
|
|
378
378
|
} catch (s) {
|
|
379
379
|
console.error("initA11y failed:", s), Y();
|
|
380
380
|
}
|
|
@@ -417,42 +417,42 @@ const st = (e, t) => {
|
|
|
417
417
|
ignoreSelectors: p = [],
|
|
418
418
|
shouldIgnoreTarget: m,
|
|
419
419
|
enableKeyboardAction: D = !0
|
|
420
|
-
} = e,
|
|
420
|
+
} = e, V = [
|
|
421
421
|
...Be,
|
|
422
422
|
...p
|
|
423
423
|
], T = (u, i) => {
|
|
424
424
|
if (!u) return !1;
|
|
425
|
-
const l =
|
|
425
|
+
const l = V.join(",");
|
|
426
426
|
return u.closest && u.closest(l) ? !0 : m && i ? m(u, i) : !1;
|
|
427
|
-
},
|
|
427
|
+
}, F = (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
432
|
const g = parseInt(l, 10);
|
|
433
433
|
return Number.isNaN(g) ? void 0 : g;
|
|
434
|
-
},
|
|
434
|
+
}, k = (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, g = typeof window < "u" && window.screenX || 0,
|
|
437
|
+
const i = typeof window < "u" && window.scrollX || 0, l = typeof window < "u" && window.scrollY || 0, g = 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
443
|
screenX: typeof u.screenX == "number" ? u.screenX : u.clientX + g,
|
|
444
|
-
screenY: typeof u.screenY == "number" ? u.screenY : u.clientY +
|
|
444
|
+
screenY: typeof u.screenY == "number" ? u.screenY : u.clientY + L
|
|
445
445
|
};
|
|
446
446
|
}, R = (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, g = i.bottom,
|
|
451
|
+
const l = i.left, g = i.bottom, L = typeof window < "u" && window.scrollX || 0, Y = typeof window < "u" && window.scrollY || 0;
|
|
452
452
|
return {
|
|
453
453
|
clientX: l,
|
|
454
454
|
clientY: g,
|
|
455
|
-
pageX: l +
|
|
455
|
+
pageX: l + L,
|
|
456
456
|
pageY: g + Y,
|
|
457
457
|
screenX: l,
|
|
458
458
|
screenY: g
|
|
@@ -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, g = i.anchorNode.nodeType === Node.ELEMENT_NODE ? i.anchorNode : i.anchorNode.parentElement,
|
|
466
|
+
const l = u.closest(".k-table-row") || u.closest(".k-grid") || u, g = i.anchorNode.nodeType === Node.ELEMENT_NODE ? i.anchorNode : i.anchorNode.parentElement, L = i.focusNode.nodeType === Node.ELEMENT_NODE ? i.focusNode : i.focusNode.parentElement, Y = !!(g && l.contains(g)), z = !!(L && l.contains(L));
|
|
467
467
|
return Y || z;
|
|
468
468
|
}
|
|
469
469
|
return !0;
|
|
@@ -478,7 +478,7 @@ const st = (e, t) => {
|
|
|
478
478
|
return;
|
|
479
479
|
const g = {
|
|
480
480
|
dataItem: u.dataItem,
|
|
481
|
-
rowIndex: u.rowIndex ??
|
|
481
|
+
rowIndex: u.rowIndex ?? F(l),
|
|
482
482
|
field: u.field,
|
|
483
483
|
event: i || u,
|
|
484
484
|
triggerType: "click",
|
|
@@ -486,7 +486,7 @@ const st = (e, t) => {
|
|
|
486
486
|
shiftKey: !!i?.shiftKey,
|
|
487
487
|
metaKey: !!i?.metaKey,
|
|
488
488
|
altKey: !!i?.altKey,
|
|
489
|
-
coordinates:
|
|
489
|
+
coordinates: k(i) ?? R(l)
|
|
490
490
|
};
|
|
491
491
|
t(u.dataItem, g);
|
|
492
492
|
},
|
|
@@ -494,12 +494,12 @@ const st = (e, t) => {
|
|
|
494
494
|
if (!D) 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 || T(
|
|
502
|
+
if (!Y || T(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;
|
|
@@ -531,12 +531,12 @@ const st = (e, t) => {
|
|
|
531
531
|
const t = U(Ce(e.initialValue ?? "")), r = U(!1), h = U(
|
|
532
532
|
e.errorMessage?.trim() || Ye
|
|
533
533
|
), p = y(() => t.value.replace(/\D/g, "")), m = y(() => {
|
|
534
|
-
const
|
|
535
|
-
return
|
|
536
|
-
}), D = y(() => r.value && !m.value),
|
|
534
|
+
const A = p.value.length;
|
|
535
|
+
return A === 5 || A === 9;
|
|
536
|
+
}), D = y(() => r.value && !m.value), V = y(() => !r.value || m.value), T = y(() => r.value), F = (A, C) => {
|
|
537
537
|
const u = He(C);
|
|
538
538
|
B(() => {
|
|
539
|
-
|
|
539
|
+
A.isConnected && A.setSelectionRange(u, u);
|
|
540
540
|
});
|
|
541
541
|
};
|
|
542
542
|
return {
|
|
@@ -550,20 +550,20 @@ const st = (e, t) => {
|
|
|
550
550
|
zipRaw: p,
|
|
551
551
|
isZipValid: m,
|
|
552
552
|
showZipError: D,
|
|
553
|
-
textBoxValid:
|
|
553
|
+
textBoxValid: V,
|
|
554
554
|
textBoxValidate: T,
|
|
555
555
|
// actions
|
|
556
|
-
handleZipInput: (...
|
|
557
|
-
const C =
|
|
556
|
+
handleZipInput: (...A) => {
|
|
557
|
+
const C = A[0], i = C?.event?.target, l = C?.value, g = Array.isArray(l) ? l.join("") : String(l ?? ""), L = i?.selectionStart !== void 0 && i.selectionStart !== null ? ze(
|
|
558
558
|
i.value,
|
|
559
559
|
i.selectionStart
|
|
560
560
|
) : g.replace(/\D/g, "").length;
|
|
561
|
-
t.value = Ce(g), i &&
|
|
561
|
+
t.value = Ce(g), i && F(i, L);
|
|
562
562
|
},
|
|
563
|
-
submitAndValidate: (
|
|
563
|
+
submitAndValidate: (A) => {
|
|
564
564
|
r.value = !0;
|
|
565
565
|
const C = m.value;
|
|
566
|
-
return !C &&
|
|
566
|
+
return !C && A?.focus && B(() => {
|
|
567
567
|
document.getElementById(
|
|
568
568
|
e.id
|
|
569
569
|
)?.focus();
|
|
@@ -578,8 +578,8 @@ function Xe(e, t) {
|
|
|
578
578
|
e.value?.setAttribute("aria-invalid", String(!t.isValid()));
|
|
579
579
|
});
|
|
580
580
|
function h(m) {
|
|
581
|
-
const D = e.value ?? m.currentTarget,
|
|
582
|
-
(!D || !D.contains(
|
|
581
|
+
const D = e.value ?? m.currentTarget, V = m.relatedTarget;
|
|
582
|
+
(!D || !D.contains(V)) && (r.value = !0);
|
|
583
583
|
}
|
|
584
584
|
function p() {
|
|
585
585
|
r.value = !1;
|
|
@@ -592,25 +592,25 @@ function We(e, t) {
|
|
|
592
592
|
), m = y(() => !p.value || t.isValid()), D = Xe(e, {
|
|
593
593
|
isValid: () => m.value
|
|
594
594
|
});
|
|
595
|
-
function
|
|
595
|
+
function V(E) {
|
|
596
596
|
return y(() => !p.value || le(E));
|
|
597
597
|
}
|
|
598
598
|
function T(E) {
|
|
599
599
|
return Object.fromEntries(
|
|
600
|
-
Object.entries(E).map(([
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
Object.entries(E).map(([A, C]) => [
|
|
601
|
+
A,
|
|
602
|
+
V(C)
|
|
603
603
|
])
|
|
604
604
|
);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
const
|
|
608
|
-
if (!
|
|
609
|
-
|
|
606
|
+
function F(E) {
|
|
607
|
+
const A = le(E);
|
|
608
|
+
if (!A) return;
|
|
609
|
+
A.querySelector(
|
|
610
610
|
'.k-invalid input, .k-invalid[tabindex="0"]'
|
|
611
611
|
)?.focus();
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function k(E) {
|
|
614
614
|
if (h.value) {
|
|
615
615
|
h.value = !1;
|
|
616
616
|
return;
|
|
@@ -623,11 +623,11 @@ function We(e, t) {
|
|
|
623
623
|
return {
|
|
624
624
|
touched: r,
|
|
625
625
|
fieldsetValidate: p,
|
|
626
|
-
onFocusout:
|
|
626
|
+
onFocusout: k,
|
|
627
627
|
reset: R,
|
|
628
|
-
createFieldValidity:
|
|
628
|
+
createFieldValidity: V,
|
|
629
629
|
createFieldValidationsMap: T,
|
|
630
|
-
focusFirstInvalidField:
|
|
630
|
+
focusFirstInvalidField: F
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
const Ge = [
|
|
@@ -722,15 +722,15 @@ function _e(e, t = "zip") {
|
|
|
722
722
|
zipRaw: p,
|
|
723
723
|
isZipValid: m,
|
|
724
724
|
wrapperClass: D,
|
|
725
|
-
handleZipInput:
|
|
725
|
+
handleZipInput: V
|
|
726
726
|
} = r;
|
|
727
|
-
return ue(p, (
|
|
728
|
-
e.zip =
|
|
727
|
+
return ue(p, (F) => {
|
|
728
|
+
e.zip = F;
|
|
729
729
|
}), {
|
|
730
730
|
zipDisplay: h,
|
|
731
731
|
isZipValid: m,
|
|
732
732
|
zipWrapperClass: D,
|
|
733
|
-
onZipInput:
|
|
733
|
+
onZipInput: V,
|
|
734
734
|
resetZip: () => {
|
|
735
735
|
h.value = "", e.zip = "";
|
|
736
736
|
}
|
|
@@ -770,26 +770,26 @@ function dt(e) {
|
|
|
770
770
|
const r = U(!1), h = U(!1), p = y(() => le(e.required) ?? !0), {
|
|
771
771
|
formData: m,
|
|
772
772
|
onAddress1Input: D,
|
|
773
|
-
onAddress2Input:
|
|
773
|
+
onAddress2Input: V,
|
|
774
774
|
onCityInput: T,
|
|
775
|
-
onStateChange:
|
|
776
|
-
resetFormData:
|
|
777
|
-
} = je(), R = `${e.addressId}-zip`, { zipDisplay: E, isZipValid:
|
|
775
|
+
onStateChange: F,
|
|
776
|
+
resetFormData: k
|
|
777
|
+
} = je(), R = `${e.addressId}-zip`, { zipDisplay: E, isZipValid: A, zipWrapperClass: C, onZipInput: u, resetZip: i } = _e(m, R), {
|
|
778
778
|
strictAddress1Valid: l,
|
|
779
779
|
strictCityValid: g,
|
|
780
|
-
strictStateValid:
|
|
780
|
+
strictStateValid: L,
|
|
781
781
|
strictZipValid: Y,
|
|
782
782
|
strictAddressValid: z
|
|
783
783
|
} = Je({
|
|
784
784
|
formData: m,
|
|
785
|
-
isZipValid:
|
|
785
|
+
isZipValid: A
|
|
786
786
|
}), _ = We(t, {
|
|
787
787
|
submitted: r,
|
|
788
788
|
isValid: () => z.value
|
|
789
789
|
}), { touched: ee, fieldsetValidate: s, onFocusout: w, reset: f } = _, b = _.createFieldValidationsMap({
|
|
790
790
|
address1: l,
|
|
791
791
|
city: g,
|
|
792
|
-
state:
|
|
792
|
+
state: L,
|
|
793
793
|
zip: Y,
|
|
794
794
|
address: z
|
|
795
795
|
}), {
|
|
@@ -806,7 +806,7 @@ function dt(e) {
|
|
|
806
806
|
() => p.value ? S.value : !0
|
|
807
807
|
), v = y(
|
|
808
808
|
() => p.value ? M.value : !0
|
|
809
|
-
),
|
|
809
|
+
), P = y(
|
|
810
810
|
() => p.value ? N.value : !0
|
|
811
811
|
), H = y(
|
|
812
812
|
() => p.value ? W.value : !0
|
|
@@ -819,10 +819,10 @@ function dt(e) {
|
|
|
819
819
|
city: m.city.trim(),
|
|
820
820
|
state: (m.state ?? "").trim().toUpperCase(),
|
|
821
821
|
zip: m.zip.replace(/\D/g, "")
|
|
822
|
-
})), c = y(() => m.address1.trim() === "" && m.address2.trim() === "" && m.city.trim() === "" && (m.state ?? "").trim() === "" && m.zip.replace(/\D/g, "") === ""),
|
|
822
|
+
})), c = y(() => m.address1.trim() === "" && m.address2.trim() === "" && m.city.trim() === "" && (m.state ?? "").trim() === "" && m.zip.replace(/\D/g, "") === ""), $ = y(() => !c.value), q = y(() => !p.value && $.value && (!l.value || !g.value || !L.value)), j = y(() => {
|
|
823
823
|
const d = m.zip.replace(/\D/g, "");
|
|
824
|
-
return !p.value &&
|
|
825
|
-
}), te = y(() => !p.value &&
|
|
824
|
+
return !p.value && $.value && d.length !== 5 && d.length !== 9;
|
|
825
|
+
}), te = y(() => !p.value && $.value && !z.value), O = y(() => !p.value && te.value && (h.value || r.value));
|
|
826
826
|
return ue(n, () => {
|
|
827
827
|
p.value || (h.value = !1);
|
|
828
828
|
}), ue(p, (d) => {
|
|
@@ -835,7 +835,7 @@ function dt(e) {
|
|
|
835
835
|
address1Valid: se,
|
|
836
836
|
cityValid: a,
|
|
837
837
|
stateValid: v,
|
|
838
|
-
zipValid:
|
|
838
|
+
zipValid: P,
|
|
839
839
|
addressValid: H,
|
|
840
840
|
optionalFeedbackActive: O,
|
|
841
841
|
optionalPartialInvalid: te,
|
|
@@ -846,9 +846,9 @@ function dt(e) {
|
|
|
846
846
|
zipDisplay: E,
|
|
847
847
|
zipWrapperClass: C,
|
|
848
848
|
onAddress1Input: D,
|
|
849
|
-
onAddress2Input:
|
|
849
|
+
onAddress2Input: V,
|
|
850
850
|
onCityInput: T,
|
|
851
|
-
onStateChange:
|
|
851
|
+
onStateChange: F,
|
|
852
852
|
onZipInput: u,
|
|
853
853
|
onFieldsetFocusout: (d) => {
|
|
854
854
|
const x = et(t.value, d);
|
|
@@ -863,7 +863,7 @@ function dt(e) {
|
|
|
863
863
|
payload: n.value
|
|
864
864
|
}) : (r.value = !0, { isValid: !1, payload: null }),
|
|
865
865
|
reset: () => {
|
|
866
|
-
r.value = !1, h.value = !1, f(),
|
|
866
|
+
r.value = !1, h.value = !1, f(), k(), i();
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
869
|
}
|
|
@@ -899,52 +899,52 @@ function xe(...e) {
|
|
|
899
899
|
Ee(Le(r.value ? e[2] : e[1])),
|
|
900
900
|
le(r.value ? e[3] : e[2])
|
|
901
901
|
];
|
|
902
|
-
}, ([h, p, m, D],
|
|
902
|
+
}, ([h, p, m, D], V, T) => {
|
|
903
903
|
if (!h?.length || !p?.length || !m?.length) return;
|
|
904
|
-
const
|
|
904
|
+
const F = at(D) ? { ...D } : D, k = h.flatMap((R) => p.flatMap((E) => m.map((A) => t(R, E, A, F))));
|
|
905
905
|
T(() => {
|
|
906
|
-
|
|
906
|
+
k.forEach((R) => R());
|
|
907
907
|
});
|
|
908
908
|
}, { flush: "post" });
|
|
909
909
|
}
|
|
910
910
|
function $e(e, t, r = {}) {
|
|
911
|
-
const { window: h = Fe, ignore: p = [], capture: m = !0, detectIframe: D = !1, controls:
|
|
912
|
-
if (!h) return
|
|
911
|
+
const { window: h = Fe, ignore: p = [], capture: m = !0, detectIframe: D = !1, controls: V = !1 } = r;
|
|
912
|
+
if (!h) return V ? {
|
|
913
913
|
stop: we,
|
|
914
914
|
cancel: we,
|
|
915
915
|
trigger: we
|
|
916
916
|
} : we;
|
|
917
917
|
let T = !0;
|
|
918
|
-
const
|
|
918
|
+
const F = (i) => le(p).some((l) => {
|
|
919
919
|
if (typeof l == "string") return Array.from(h.document.querySelectorAll(l)).some((g) => g === i.target || i.composedPath().includes(g));
|
|
920
920
|
{
|
|
921
921
|
const g = he(l);
|
|
922
922
|
return g && (i.target === g || i.composedPath().includes(g));
|
|
923
923
|
}
|
|
924
924
|
});
|
|
925
|
-
function
|
|
925
|
+
function k(i) {
|
|
926
926
|
const l = le(i);
|
|
927
927
|
return l && l.$.subTree.shapeFlag === 16;
|
|
928
928
|
}
|
|
929
929
|
function R(i, l) {
|
|
930
|
-
const g = le(i),
|
|
931
|
-
return
|
|
930
|
+
const g = le(i), L = g.$.subTree && g.$.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 && (T = !
|
|
935
|
+
if (i.target != null && !(!(l instanceof Element) && k(e) && R(e, i)) && !(!l || l === i.target || i.composedPath().includes(l))) {
|
|
936
|
+
if ("detail" in i && i.detail === 0 && (T = !F(i)), !T) {
|
|
937
937
|
T = !0;
|
|
938
938
|
return;
|
|
939
939
|
}
|
|
940
940
|
t(i);
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
|
-
let
|
|
943
|
+
let A = !1;
|
|
944
944
|
const C = [
|
|
945
945
|
xe(h, "click", (i) => {
|
|
946
|
-
|
|
947
|
-
|
|
946
|
+
A || (A = !0, setTimeout(() => {
|
|
947
|
+
A = !1;
|
|
948
948
|
}, 0), E(i));
|
|
949
949
|
}, {
|
|
950
950
|
passive: !0,
|
|
@@ -952,7 +952,7 @@ function $e(e, t, r = {}) {
|
|
|
952
952
|
}),
|
|
953
953
|
xe(h, "pointerdown", (i) => {
|
|
954
954
|
const l = he(e);
|
|
955
|
-
T = !
|
|
955
|
+
T = !F(i) && !!(l && !i.composedPath().includes(l));
|
|
956
956
|
}, { passive: !0 }),
|
|
957
957
|
D && xe(h, "blur", (i) => {
|
|
958
958
|
setTimeout(() => {
|
|
@@ -963,7 +963,7 @@ function $e(e, t, r = {}) {
|
|
|
963
963
|
}, 0);
|
|
964
964
|
}, { passive: !0 })
|
|
965
965
|
].filter(Boolean), u = () => C.forEach((i) => i());
|
|
966
|
-
return
|
|
966
|
+
return V ? {
|
|
967
967
|
stop: u,
|
|
968
968
|
cancel: () => {
|
|
969
969
|
T = !1;
|
|
@@ -984,37 +984,44 @@ const Ie = (e) => {
|
|
|
984
984
|
return l.focus(), !0;
|
|
985
985
|
const g = p();
|
|
986
986
|
return g?.focus(), !!g;
|
|
987
|
-
},
|
|
987
|
+
}, V = () => {
|
|
988
988
|
Ie(e.menuRef.value)?.querySelector(r)?.focus();
|
|
989
989
|
}, T = (l) => {
|
|
990
|
-
e.isOpen.value && (t.value = l, e.requestHide());
|
|
990
|
+
e.isOpen.value && (t.value = l, R(!1), e.requestHide());
|
|
991
991
|
};
|
|
992
992
|
$e(e.menuRef, () => T("outside-click"), {
|
|
993
993
|
ignore: [e.triggerRef]
|
|
994
994
|
});
|
|
995
|
-
let
|
|
996
|
-
const
|
|
997
|
-
|
|
995
|
+
let F = null;
|
|
996
|
+
const k = () => {
|
|
997
|
+
F?.removeAttribute("aria-haspopup"), F?.removeAttribute("aria-expanded"), F = null;
|
|
998
998
|
}, R = (l) => {
|
|
999
999
|
if (e.manageMenuTriggerAria === !1) return;
|
|
1000
1000
|
const g = p();
|
|
1001
|
-
if (!g
|
|
1002
|
-
|
|
1001
|
+
if (!g) {
|
|
1002
|
+
F && (F.isConnected ? (F.setAttribute("aria-haspopup", "menu"), F.setAttribute(
|
|
1003
|
+
"aria-expanded",
|
|
1004
|
+
l ? "true" : "false"
|
|
1005
|
+
)) : k());
|
|
1003
1006
|
return;
|
|
1004
1007
|
}
|
|
1005
|
-
|
|
1008
|
+
if (!ot(g, h)) {
|
|
1009
|
+
k();
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
F && F !== g && k(), g.setAttribute("aria-haspopup", "menu"), g.setAttribute("aria-expanded", l ? "true" : "false"), F = g;
|
|
1006
1013
|
};
|
|
1007
1014
|
ue(
|
|
1008
1015
|
[e.isOpen, e.triggerRef],
|
|
1009
1016
|
([l]) => R(l),
|
|
1010
1017
|
{ immediate: !0, flush: "post" }
|
|
1011
|
-
), Ke(
|
|
1018
|
+
), Ke(k);
|
|
1012
1019
|
const E = () => {
|
|
1013
1020
|
if (e.isOpen.value) {
|
|
1014
1021
|
T("trigger-click");
|
|
1015
1022
|
return;
|
|
1016
1023
|
}
|
|
1017
|
-
e.requestShow(), B(
|
|
1024
|
+
e.requestShow(), B(V);
|
|
1018
1025
|
};
|
|
1019
1026
|
return {
|
|
1020
1027
|
/**
|
|
@@ -1065,85 +1072,85 @@ const Ie = (e) => {
|
|
|
1065
1072
|
};
|
|
1066
1073
|
};
|
|
1067
1074
|
function pt(e) {
|
|
1068
|
-
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(e.dateFormat ?? "mm/dd/yyyy"), m = y(() => !!e.required), D = 1e3,
|
|
1075
|
+
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(e.dateFormat ?? "mm/dd/yyyy"), m = y(() => !!e.required), D = 1e3, V = U(!1), T = ["ArrowUp", "ArrowDown"], F = ["ArrowLeft", "ArrowRight"], k = y(() => (t.value ?? "").replace(/\D/g, "")), R = (a) => a <= 2 ? "mm" : a <= 5 ? "dd" : k.value.length <= 10 ? "yyyy" : "mm", E = y(() => {
|
|
1069
1076
|
const a = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
|
|
1070
1077
|
return parseInt(a).toString().padStart(2, "0");
|
|
1071
|
-
}),
|
|
1078
|
+
}), A = y(() => {
|
|
1072
1079
|
const a = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0";
|
|
1073
1080
|
return parseInt(a).toString().padStart(2, "0");
|
|
1074
1081
|
}), C = y(() => {
|
|
1075
1082
|
const a = t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0";
|
|
1076
1083
|
return parseInt(a).toString().padStart(4, "0");
|
|
1077
1084
|
}), u = (a) => {
|
|
1078
|
-
if (
|
|
1085
|
+
if (k.value.length === 0) {
|
|
1079
1086
|
e.onChange({ value: null, event: a });
|
|
1080
1087
|
return;
|
|
1081
1088
|
}
|
|
1082
|
-
if (
|
|
1089
|
+
if (k.value.length < 8) {
|
|
1083
1090
|
e.onChange({ value: null, event: a });
|
|
1084
1091
|
return;
|
|
1085
1092
|
}
|
|
1086
|
-
if ((t.value ?? "").length === 10 &&
|
|
1087
|
-
const [v,
|
|
1093
|
+
if ((t.value ?? "").length === 10 && k.value.length === 8) {
|
|
1094
|
+
const [v, P, H] = t.value.split("/"), Z = parseInt(v), G = parseInt(P), n = parseInt(H);
|
|
1088
1095
|
if (z(n, Z, G)) {
|
|
1089
|
-
const c =
|
|
1096
|
+
const c = L(n, Z, G);
|
|
1090
1097
|
i(c) ? e.onChange({ value: c, event: a }) : e.onChange({ value: null, event: a });
|
|
1091
1098
|
} else
|
|
1092
1099
|
e.onChange({ value: null, event: a });
|
|
1093
1100
|
}
|
|
1094
1101
|
}, i = (a) => {
|
|
1095
|
-
const v = e.min ?? void 0,
|
|
1096
|
-
return !(v && a < v ||
|
|
1102
|
+
const v = e.min ?? void 0, P = e.max ?? void 0;
|
|
1103
|
+
return !(v && a < v || P && a > P);
|
|
1097
1104
|
}, l = y(() => {
|
|
1098
|
-
if ((t.value ?? "").length === 10 &&
|
|
1099
|
-
const [a, v,
|
|
1105
|
+
if ((t.value ?? "").length === 10 && k.value.length === 8) {
|
|
1106
|
+
const [a, v, P] = (t.value ?? "").split("/"), H = parseInt(a), Z = parseInt(v), G = parseInt(P);
|
|
1100
1107
|
if (z(G, H, Z))
|
|
1101
|
-
return
|
|
1108
|
+
return L(G, H, Z);
|
|
1102
1109
|
}
|
|
1103
1110
|
return null;
|
|
1104
|
-
}), g = y(() => (t.value ?? "").length === 10 &&
|
|
1111
|
+
}), g = y(() => (t.value ?? "").length === 10 && k.value.length === 8), L = (a, v, P) => {
|
|
1105
1112
|
const H = /* @__PURE__ */ new Date(0);
|
|
1106
|
-
return H.setFullYear(a, v - 1,
|
|
1107
|
-
}, Y = (a, v) =>
|
|
1113
|
+
return H.setFullYear(a, v - 1, P), H.setHours(0, 0, 0, 0), H;
|
|
1114
|
+
}, Y = (a, v) => L(a, v + 1, 0).getDate(), z = (a, v, P) => v >= 1 && v <= 12 && a >= D && P >= 1 && P <= Y(a, v), _ = (a) => {
|
|
1108
1115
|
t.value = a.value;
|
|
1109
1116
|
const v = a.event?.target;
|
|
1110
1117
|
r.value = v?.selectionStart ?? 0, u(a);
|
|
1111
1118
|
}, ee = (a) => {
|
|
1112
1119
|
r.value = a.target.selectionStart ?? 0;
|
|
1113
|
-
}, s = (a, v,
|
|
1120
|
+
}, s = (a, v, P) => {
|
|
1114
1121
|
const H = v?.selectionStart ?? r.value ?? 0;
|
|
1115
1122
|
r.value = H;
|
|
1116
|
-
let Z = parseInt(E.value), G = parseInt(
|
|
1117
|
-
if (!(
|
|
1123
|
+
let Z = parseInt(E.value), G = parseInt(A.value), n = parseInt(C.value);
|
|
1124
|
+
if (!(k.value.length >= 8) || !z(n, Z, G)) {
|
|
1118
1125
|
const X = e.defaultValue ?? /* @__PURE__ */ new Date();
|
|
1119
1126
|
Z = X.getMonth() + 1, G = X.getDate(), n = X.getFullYear(), t.value = `${String(Z).padStart(2, "0")}/${String(G).padStart(
|
|
1120
1127
|
2,
|
|
1121
1128
|
"0"
|
|
1122
1129
|
)}/${String(n)}`;
|
|
1123
|
-
const ce =
|
|
1124
|
-
e.onChange({ value: i(ce) ? ce : null, event:
|
|
1130
|
+
const ce = L(n, Z, G);
|
|
1131
|
+
e.onChange({ value: i(ce) ? ce : null, event: P }), S({ useRAF: !0 });
|
|
1125
1132
|
return;
|
|
1126
1133
|
}
|
|
1127
|
-
const
|
|
1128
|
-
if (
|
|
1134
|
+
const $ = R(H);
|
|
1135
|
+
if ($ === "mm")
|
|
1129
1136
|
Z = a === "ArrowUp" ? Z < 12 ? Z + 1 : 1 : Z > 1 ? Z - 1 : 12;
|
|
1130
|
-
else if (
|
|
1137
|
+
else if ($ === "dd") {
|
|
1131
1138
|
const X = new Date(n, Z, 0).getDate();
|
|
1132
1139
|
G = a === "ArrowUp" ? G < X ? G + 1 : 1 : G > 1 ? G - 1 : X;
|
|
1133
|
-
} else
|
|
1140
|
+
} else $ === "yyyy" && (n = a === "ArrowUp" ? n + 1 : Math.max(1, n - 1));
|
|
1134
1141
|
t.value = `${String(Z).padStart(2, "0")}/${String(G).padStart(
|
|
1135
1142
|
2,
|
|
1136
1143
|
"0"
|
|
1137
1144
|
)}/${String(n)}`;
|
|
1138
|
-
const [q, j, te] = t.value.split("/"), O =
|
|
1145
|
+
const [q, j, te] = t.value.split("/"), O = L(
|
|
1139
1146
|
parseInt(te),
|
|
1140
1147
|
parseInt(q),
|
|
1141
1148
|
parseInt(j)
|
|
1142
1149
|
);
|
|
1143
1150
|
O.toString() !== "Invalid Date" && parseInt(te) >= 1e3 ? e.onChange({
|
|
1144
1151
|
value: i(O) ? O : null,
|
|
1145
|
-
event:
|
|
1146
|
-
}) : e.onChange({ value: null, event:
|
|
1152
|
+
event: P
|
|
1153
|
+
}) : e.onChange({ value: null, event: P }), S({ useRAF: !0 });
|
|
1147
1154
|
}, w = (a) => {
|
|
1148
1155
|
if (a.code === "Space" || a.key === " ") {
|
|
1149
1156
|
a.preventDefault(), a.stopPropagation(), e.onShowCalendar(a);
|
|
@@ -1166,7 +1173,7 @@ function pt(e) {
|
|
|
1166
1173
|
s(v, a.target, a);
|
|
1167
1174
|
}, b = (a) => {
|
|
1168
1175
|
const v = a.target;
|
|
1169
|
-
if (
|
|
1176
|
+
if (F.includes(a.key)) {
|
|
1170
1177
|
r.value = v?.selectionStart ?? 0;
|
|
1171
1178
|
return;
|
|
1172
1179
|
}
|
|
@@ -1175,18 +1182,18 @@ function pt(e) {
|
|
|
1175
1182
|
r.value = v?.selectionStart ?? 0;
|
|
1176
1183
|
}
|
|
1177
1184
|
}, I = (a) => {
|
|
1178
|
-
|
|
1185
|
+
V.value = !0, m.value && !e.defaultValue && e.externalValue && e.externalValue.value === void 0 && k.value.length === 0 && (e.externalValue.value = "");
|
|
1179
1186
|
const v = a.target;
|
|
1180
1187
|
v && (r.value = v.selectionStart ?? 0);
|
|
1181
1188
|
}, S = (a) => {
|
|
1182
1189
|
const v = () => {
|
|
1183
|
-
const
|
|
1190
|
+
const P = document.getElementById(
|
|
1184
1191
|
e.id
|
|
1185
1192
|
);
|
|
1186
|
-
if (
|
|
1187
|
-
const H = a?.pos ?? r.value ??
|
|
1193
|
+
if (!P) return;
|
|
1194
|
+
const H = a?.pos ?? r.value ?? P.value.length;
|
|
1188
1195
|
try {
|
|
1189
|
-
|
|
1196
|
+
P.focus(), P.setSelectionRange(H, H);
|
|
1190
1197
|
} catch {
|
|
1191
1198
|
}
|
|
1192
1199
|
};
|
|
@@ -1208,8 +1215,8 @@ function pt(e) {
|
|
|
1208
1215
|
if (a) {
|
|
1209
1216
|
const v = new Date(a);
|
|
1210
1217
|
if (v.toString() !== "Invalid Date") {
|
|
1211
|
-
const
|
|
1212
|
-
t.value = `${
|
|
1218
|
+
const P = (v.getMonth() + 1).toString().padStart(2, "0"), H = v.getDate().toString().padStart(2, "0"), Z = v.getFullYear().toString();
|
|
1219
|
+
t.value = `${P}/${H}/${Z}`, S({ delay: 50 });
|
|
1213
1220
|
return;
|
|
1214
1221
|
}
|
|
1215
1222
|
}
|
|
@@ -1217,8 +1224,8 @@ function pt(e) {
|
|
|
1217
1224
|
{ immediate: !0 }
|
|
1218
1225
|
);
|
|
1219
1226
|
const M = y(() => [
|
|
1220
|
-
["Date", `${E.value} / ${
|
|
1221
|
-
["Digits only",
|
|
1227
|
+
["Date", `${E.value} / ${A.value} / ${C.value}`],
|
|
1228
|
+
["Digits only", k.value],
|
|
1222
1229
|
[
|
|
1223
1230
|
"min",
|
|
1224
1231
|
e.min?.toLocaleDateString("en-US", {
|
|
@@ -1241,7 +1248,7 @@ function pt(e) {
|
|
|
1241
1248
|
const v = l.value;
|
|
1242
1249
|
return v ? i(v) : !1;
|
|
1243
1250
|
}
|
|
1244
|
-
if (!
|
|
1251
|
+
if (!V.value) return !0;
|
|
1245
1252
|
const a = l.value;
|
|
1246
1253
|
return !g.value || !a ? !1 : i(a);
|
|
1247
1254
|
}), W = y(() => {
|
|
@@ -1250,8 +1257,8 @@ function pt(e) {
|
|
|
1250
1257
|
const v = l.value;
|
|
1251
1258
|
return v ? i(v) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
1252
1259
|
}
|
|
1253
|
-
if (!
|
|
1254
|
-
if (
|
|
1260
|
+
if (!V.value) return;
|
|
1261
|
+
if (k.value.length === 0 || !g.value)
|
|
1255
1262
|
return "incomplete";
|
|
1256
1263
|
const a = l.value;
|
|
1257
1264
|
return a ? i(a) ? "valid" : "out-of-bounds" : "invalid-date";
|
|
@@ -1266,15 +1273,15 @@ function pt(e) {
|
|
|
1266
1273
|
year: "numeric",
|
|
1267
1274
|
month: "2-digit",
|
|
1268
1275
|
day: "2-digit"
|
|
1269
|
-
}) : null,
|
|
1276
|
+
}) : null, P = e.max ? e.max.toLocaleDateString("en-US", {
|
|
1270
1277
|
year: "numeric",
|
|
1271
1278
|
month: "2-digit",
|
|
1272
1279
|
day: "2-digit"
|
|
1273
1280
|
}) : null;
|
|
1274
1281
|
if (a === "out-of-bounds") {
|
|
1275
|
-
if (v &&
|
|
1282
|
+
if (v && P) return `Must be between ${v} and ${P}.`;
|
|
1276
1283
|
if (v) return `Must be on or after ${v}.`;
|
|
1277
|
-
if (
|
|
1284
|
+
if (P) return `Must be on or before ${P}.`;
|
|
1278
1285
|
}
|
|
1279
1286
|
return "";
|
|
1280
1287
|
}), se = () => {
|
|
@@ -1291,11 +1298,11 @@ function pt(e) {
|
|
|
1291
1298
|
console.warn(`.k-datepicker parent not found for #${e.id} styling.`);
|
|
1292
1299
|
return;
|
|
1293
1300
|
}
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
if (
|
|
1301
|
+
const P = v.parentElement;
|
|
1302
|
+
if (P) {
|
|
1303
|
+
if (P.classList.contains("fk-datepicker"))
|
|
1297
1304
|
return;
|
|
1298
|
-
|
|
1305
|
+
P.classList.add("fk-datepicker");
|
|
1299
1306
|
} else
|
|
1300
1307
|
console.warn(
|
|
1301
1308
|
`Parent of .k-datepicker not found for #${e.id} styling.`
|
|
@@ -1313,9 +1320,9 @@ function pt(e) {
|
|
|
1313
1320
|
isValid: N,
|
|
1314
1321
|
reason: Q(W),
|
|
1315
1322
|
validationMessage: re,
|
|
1316
|
-
digitsOnly:
|
|
1323
|
+
digitsOnly: k,
|
|
1317
1324
|
month: Q(E),
|
|
1318
|
-
day: Q(
|
|
1325
|
+
day: Q(A),
|
|
1319
1326
|
year: Q(C),
|
|
1320
1327
|
datePart: R,
|
|
1321
1328
|
handleChange: _,
|
|
@@ -1329,29 +1336,29 @@ function pt(e) {
|
|
|
1329
1336
|
};
|
|
1330
1337
|
}
|
|
1331
1338
|
function mt(e) {
|
|
1332
|
-
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(!1), m = 1440 * 60 * 1e3, D = 365 * m,
|
|
1333
|
-
e.min = e.min ?? T, e.max = e.max ??
|
|
1334
|
-
const
|
|
1339
|
+
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(!1), m = 1440 * 60 * 1e3, D = 365 * m, V = /* @__PURE__ */ new Date(), T = new Date(V.getTime() - D), F = new Date(V.getTime() + D);
|
|
1340
|
+
e.min = e.min ?? T, e.max = e.max ?? F;
|
|
1341
|
+
const k = y(() => (t.value ?? "").replace(/\D/g, "")), R = (o, d) => new Date(o, d, 0).getDate(), E = (o, d, x) => d >= 1 && d <= 12 && o >= 1e3 && x >= 1 && x <= R(o, d), A = (o) => Date.UTC(o.getFullYear(), o.getMonth(), o.getDate()), C = (o) => {
|
|
1335
1342
|
if (!o) return null;
|
|
1336
|
-
const d = e.min ?? new Date(Date.now() - 90 * m), x = e.max ?? /* @__PURE__ */ new Date(), K =
|
|
1337
|
-
return K <
|
|
1338
|
-
}, u = (o, d) => e.allowReverse ?? !1 ? !0 : o <= d, i = y(() => (t.value?.length ?? 0) >= 23 &&
|
|
1339
|
-
if ((o ?? "").length < 23 ||
|
|
1343
|
+
const d = e.min ?? new Date(Date.now() - 90 * m), x = e.max ?? /* @__PURE__ */ new Date(), K = A(o);
|
|
1344
|
+
return K < A(d) || K > A(x) ? null : o;
|
|
1345
|
+
}, u = (o, d) => e.allowReverse ?? !1 ? !0 : o <= d, i = y(() => (t.value?.length ?? 0) >= 23 && k.value.length >= 16), l = (o) => {
|
|
1346
|
+
if ((o ?? "").length < 23 || k.value.length < 16)
|
|
1340
1347
|
return { start: null, end: null };
|
|
1341
1348
|
const d = o.substring(0, 10), x = o.substring(13, 23), [K, ne, ae] = d.split("/").map((pe) => parseInt(pe || "0", 10)), [fe, me, ve] = x.split("/").map((pe) => parseInt(pe || "0", 10)), ge = new Date(ae, K - 1, ne), ye = new Date(ve, fe - 1, me), Se = E(ae, K, ne) && ge.toString() !== "Invalid Date", ke = E(ve, fe, me) && ye.toString() !== "Invalid Date";
|
|
1342
1349
|
return { start: Se ? ge : null, end: ke ? ye : null };
|
|
1343
|
-
}, g = e.externalValid ?? U(!0),
|
|
1344
|
-
const o = C(
|
|
1350
|
+
}, g = e.externalValid ?? U(!0), L = y(() => l(t.value)), Y = y(() => {
|
|
1351
|
+
const o = C(L.value.start), d = C(L.value.end);
|
|
1345
1352
|
return { start: o, end: d };
|
|
1346
1353
|
}), z = y(() => {
|
|
1347
1354
|
if (!i.value) return;
|
|
1348
1355
|
const o = Y.value.start, d = Y.value.end;
|
|
1349
1356
|
if (!o || !d) return;
|
|
1350
|
-
const x = Math.abs(
|
|
1357
|
+
const x = Math.abs(A(d) - A(o));
|
|
1351
1358
|
return Math.round(x / 864e5 + 1);
|
|
1352
1359
|
}), _ = U(!1), ee = y(() => {
|
|
1353
1360
|
if (!_.value) return;
|
|
1354
|
-
const { start: o, end: d } =
|
|
1361
|
+
const { start: o, end: d } = L.value;
|
|
1355
1362
|
if (!i.value) return "incomplete";
|
|
1356
1363
|
if (!o || !d) return "invalid-date";
|
|
1357
1364
|
if (!Y.value.start || !Y.value.end) return "out-of-bounds";
|
|
@@ -1472,7 +1479,7 @@ function mt(e) {
|
|
|
1472
1479
|
o.preventDefault();
|
|
1473
1480
|
const d = o.deltaY < 0 ? "ArrowUp" : "ArrowDown";
|
|
1474
1481
|
N(d, o.target, o);
|
|
1475
|
-
},
|
|
1482
|
+
}, P = (o) => {
|
|
1476
1483
|
if (b.includes(o.key) || f.includes(o.key)) {
|
|
1477
1484
|
const d = o.target;
|
|
1478
1485
|
r.value = d?.selectionStart ?? 0;
|
|
@@ -1509,7 +1516,7 @@ function mt(e) {
|
|
|
1509
1516
|
() => t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0"
|
|
1510
1517
|
), c = y(
|
|
1511
1518
|
() => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
|
|
1512
|
-
),
|
|
1519
|
+
), $ = y(
|
|
1513
1520
|
() => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
|
|
1514
1521
|
), q = y(
|
|
1515
1522
|
() => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
|
|
@@ -1536,7 +1543,7 @@ function mt(e) {
|
|
|
1536
1543
|
label: "Start",
|
|
1537
1544
|
value: `${String(n.value).padStart(2, "0")} / ${String(
|
|
1538
1545
|
c.value
|
|
1539
|
-
).padStart(2, "0")} / ${String(
|
|
1546
|
+
).padStart(2, "0")} / ${String($.value).padStart(4, "0")}`
|
|
1540
1547
|
},
|
|
1541
1548
|
{
|
|
1542
1549
|
label: "End",
|
|
@@ -1544,7 +1551,7 @@ function mt(e) {
|
|
|
1544
1551
|
j.value
|
|
1545
1552
|
).padStart(2, "0")} / ${String(te.value).padStart(4, "0")}`
|
|
1546
1553
|
},
|
|
1547
|
-
{ label: "Digits only", value:
|
|
1554
|
+
{ label: "Digits only", value: k.value },
|
|
1548
1555
|
{ label: "Mask complete", value: `${i.value}` },
|
|
1549
1556
|
{
|
|
1550
1557
|
label: "Parsed",
|
|
@@ -1619,7 +1626,7 @@ function mt(e) {
|
|
|
1619
1626
|
cursorPos: r,
|
|
1620
1627
|
debugEnabled: h,
|
|
1621
1628
|
debugLines: O,
|
|
1622
|
-
digitsOnly:
|
|
1629
|
+
digitsOnly: k,
|
|
1623
1630
|
valid: g,
|
|
1624
1631
|
validComputed: Q(s),
|
|
1625
1632
|
reason: Q(ee),
|
|
@@ -1627,14 +1634,14 @@ function mt(e) {
|
|
|
1627
1634
|
spanDays: Q(z),
|
|
1628
1635
|
month1: Q(n),
|
|
1629
1636
|
day1: Q(c),
|
|
1630
|
-
year1: Q(
|
|
1637
|
+
year1: Q($),
|
|
1631
1638
|
month2: Q(q),
|
|
1632
1639
|
day2: Q(j),
|
|
1633
1640
|
year2: Q(te),
|
|
1634
1641
|
handleChange: re,
|
|
1635
1642
|
handleKeyDown: a,
|
|
1636
1643
|
handleWheel: v,
|
|
1637
|
-
handleKeyUp:
|
|
1644
|
+
handleKeyUp: P,
|
|
1638
1645
|
handleClick: se,
|
|
1639
1646
|
handleBlur: Z,
|
|
1640
1647
|
handleClear: G,
|
|
@@ -1645,7 +1652,7 @@ function mt(e) {
|
|
|
1645
1652
|
};
|
|
1646
1653
|
}
|
|
1647
1654
|
function vt(e) {
|
|
1648
|
-
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(e.timeFormat ?? "hh:mm AM"), m = y(() => !!e.required), D = U(!1),
|
|
1655
|
+
const t = U(""), r = U(void 0), h = U(!!e.debug), p = U(e.timeFormat ?? "hh:mm AM"), m = y(() => !!e.required), D = U(!1), V = ["ArrowUp", "ArrowDown"], T = ["ArrowLeft", "ArrowRight"], F = y(() => (t.value ?? "").replace(/\D/g, "")), k = {
|
|
1649
1656
|
H: /[0-9]/,
|
|
1650
1657
|
h: /[0-9]/,
|
|
1651
1658
|
M: /[0-9]/,
|
|
@@ -1655,31 +1662,31 @@ function vt(e) {
|
|
|
1655
1662
|
}, R = (n) => n <= 2 ? "hh" : n <= 5 ? "mm" : "ampm", E = y(() => {
|
|
1656
1663
|
const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0", c = parseInt(n);
|
|
1657
1664
|
return Math.min(Math.max(c, 0), 23);
|
|
1658
|
-
}),
|
|
1665
|
+
}), A = y(() => {
|
|
1659
1666
|
const n = t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0", c = parseInt(n);
|
|
1660
1667
|
return Math.min(Math.max(c, 0), 59);
|
|
1661
1668
|
}), C = y(() => (t.value?.substring(6, 8) || "AM").toUpperCase().startsWith("P") ? "PM" : "AM"), u = y(() => {
|
|
1662
1669
|
const n = parseInt(t.value?.substring(0, 2).replace(/\D/g, "0") || "0"), c = C.value;
|
|
1663
1670
|
return n === 12 ? c === "AM" ? 0 : 12 : c === "PM" ? n + 12 : n;
|
|
1664
|
-
}), i = y(() => l.value ? `${String(u.value).padStart(2, "0")}:${String(
|
|
1671
|
+
}), i = y(() => l.value ? `${String(u.value).padStart(2, "0")}:${String(A.value).padStart(2, "0")}:00` : null), l = y(
|
|
1665
1672
|
() => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
|
|
1666
|
-
), g = (n, c,
|
|
1673
|
+
), g = (n, c, $) => {
|
|
1667
1674
|
let q = n % 12;
|
|
1668
1675
|
return q === 0 && (q = 12), `${String(q).padStart(2, "0")}:${String(c).padStart(
|
|
1669
1676
|
2,
|
|
1670
1677
|
"0"
|
|
1671
|
-
)} ${
|
|
1672
|
-
},
|
|
1678
|
+
)} ${$}`;
|
|
1679
|
+
}, L = (n) => {
|
|
1673
1680
|
const c = n.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1674
1681
|
if (!c) return null;
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
let te =
|
|
1682
|
+
const $ = parseInt(c[1]), q = parseInt(c[2]), j = c[3].toUpperCase();
|
|
1683
|
+
if ($ < 1 || $ > 12 || q < 0 || q > 59) return null;
|
|
1684
|
+
let te = $ % 12;
|
|
1678
1685
|
j === "PM" && (te += 12);
|
|
1679
1686
|
const O = /* @__PURE__ */ new Date();
|
|
1680
1687
|
return O.setSeconds(0, 0), O.setHours(te), O.setMinutes(q), O;
|
|
1681
1688
|
}, Y = (n) => {
|
|
1682
|
-
if (
|
|
1689
|
+
if (F.value.length === 0) {
|
|
1683
1690
|
e.onChange({ value: null, event: n });
|
|
1684
1691
|
return;
|
|
1685
1692
|
}
|
|
@@ -1687,22 +1694,22 @@ function vt(e) {
|
|
|
1687
1694
|
e.onChange({ value: null, event: n });
|
|
1688
1695
|
return;
|
|
1689
1696
|
}
|
|
1690
|
-
const c =
|
|
1697
|
+
const c = L(t.value);
|
|
1691
1698
|
c && _(c) ? e.onChange({ value: c, event: n }) : e.onChange({ value: null, event: n });
|
|
1692
1699
|
}, z = (n) => n.getHours() * 60 + n.getMinutes(), _ = (n) => {
|
|
1693
|
-
const c = e.min ?? void 0,
|
|
1700
|
+
const c = e.min ?? void 0, $ = e.max ?? void 0, q = z(n);
|
|
1694
1701
|
if (c) {
|
|
1695
1702
|
const j = z(c);
|
|
1696
1703
|
if (q < j) return !1;
|
|
1697
1704
|
}
|
|
1698
|
-
if (
|
|
1699
|
-
const j = z(
|
|
1705
|
+
if ($) {
|
|
1706
|
+
const j = z($);
|
|
1700
1707
|
if (q > j) return !1;
|
|
1701
1708
|
}
|
|
1702
1709
|
return !0;
|
|
1703
1710
|
}, ee = (n) => {
|
|
1704
|
-
const c = n.getHours(),
|
|
1705
|
-
t.value = g(c, n.getMinutes(),
|
|
1711
|
+
const c = n.getHours(), $ = c >= 12 ? "PM" : "AM";
|
|
1712
|
+
t.value = g(c, n.getMinutes(), $);
|
|
1706
1713
|
}, s = (n, c) => {
|
|
1707
1714
|
e.onChange({ value: n, event: c });
|
|
1708
1715
|
}, w = () => {
|
|
@@ -1728,15 +1735,15 @@ function vt(e) {
|
|
|
1728
1735
|
}, I = (...n) => {
|
|
1729
1736
|
const c = n[0];
|
|
1730
1737
|
if (!c) return;
|
|
1731
|
-
const
|
|
1732
|
-
if (
|
|
1738
|
+
const $ = f(c);
|
|
1739
|
+
if ($ === "now") {
|
|
1733
1740
|
const j = /* @__PURE__ */ new Date();
|
|
1734
1741
|
ee(j), b(j, c), w();
|
|
1735
1742
|
return;
|
|
1736
1743
|
}
|
|
1737
1744
|
if (c?.value instanceof Date) {
|
|
1738
1745
|
const j = new Date(c.value);
|
|
1739
|
-
ee(j), b(j, c),
|
|
1746
|
+
ee(j), b(j, c), $ === "set" && w();
|
|
1740
1747
|
return;
|
|
1741
1748
|
}
|
|
1742
1749
|
if (c?.value === null) {
|
|
@@ -1771,16 +1778,16 @@ function vt(e) {
|
|
|
1771
1778
|
Y(c);
|
|
1772
1779
|
}, S = (n) => {
|
|
1773
1780
|
r.value = n.target.selectionStart ?? 0;
|
|
1774
|
-
}, M = (n, c,
|
|
1781
|
+
}, M = (n, c, $) => {
|
|
1775
1782
|
const q = c?.selectionStart ?? r.value ?? 0;
|
|
1776
1783
|
r.value = q;
|
|
1777
1784
|
const j = R(q), te = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
1778
1785
|
if (!te) {
|
|
1779
|
-
if ((t.value ?? "").length === 0 ||
|
|
1786
|
+
if ((t.value ?? "").length === 0 || F.value.length === 0) {
|
|
1780
1787
|
const d = /* @__PURE__ */ new Date(), x = d.getHours(), K = x >= 12 ? "PM" : "AM";
|
|
1781
1788
|
t.value = g(x, d.getMinutes(), K);
|
|
1782
|
-
const ne =
|
|
1783
|
-
b(ne,
|
|
1789
|
+
const ne = L(t.value);
|
|
1790
|
+
b(ne, $), B(() => {
|
|
1784
1791
|
requestAnimationFrame(() => {
|
|
1785
1792
|
const ae = document.getElementById(
|
|
1786
1793
|
e.id
|
|
@@ -1812,8 +1819,8 @@ function vt(e) {
|
|
|
1812
1819
|
2,
|
|
1813
1820
|
"0"
|
|
1814
1821
|
)} ${ce}`;
|
|
1815
|
-
const o =
|
|
1816
|
-
b(o,
|
|
1822
|
+
const o = L(t.value);
|
|
1823
|
+
b(o, $), B(() => {
|
|
1817
1824
|
requestAnimationFrame(() => {
|
|
1818
1825
|
const d = document.getElementById(
|
|
1819
1826
|
e.id
|
|
@@ -1830,7 +1837,7 @@ function vt(e) {
|
|
|
1830
1837
|
n.preventDefault(), n.stopPropagation(), e.onShowPicker(n);
|
|
1831
1838
|
return;
|
|
1832
1839
|
}
|
|
1833
|
-
if (
|
|
1840
|
+
if (V.includes(n.key)) {
|
|
1834
1841
|
if (n.altKey) return;
|
|
1835
1842
|
n.preventDefault(), n.stopPropagation();
|
|
1836
1843
|
const c = n.target;
|
|
@@ -1847,12 +1854,12 @@ function vt(e) {
|
|
|
1847
1854
|
r.value = c?.selectionStart ?? 0;
|
|
1848
1855
|
return;
|
|
1849
1856
|
}
|
|
1850
|
-
if (
|
|
1857
|
+
if (V.includes(n.key)) {
|
|
1851
1858
|
if (n.altKey) return;
|
|
1852
1859
|
r.value = c?.selectionStart ?? 0;
|
|
1853
1860
|
}
|
|
1854
1861
|
}, se = (n) => {
|
|
1855
|
-
D.value = !0, m.value && e.externalValue && e.externalValue.value === void 0 &&
|
|
1862
|
+
D.value = !0, m.value && e.externalValue && e.externalValue.value === void 0 && F.value.length === 0 && (e.externalValue.value = "");
|
|
1856
1863
|
const c = n.target;
|
|
1857
1864
|
c && (r.value = c.selectionStart ?? 0);
|
|
1858
1865
|
};
|
|
@@ -1862,8 +1869,8 @@ function vt(e) {
|
|
|
1862
1869
|
if (n) {
|
|
1863
1870
|
const c = new Date(n);
|
|
1864
1871
|
if (c.toString() !== "Invalid Date") {
|
|
1865
|
-
const
|
|
1866
|
-
t.value = g(
|
|
1872
|
+
const $ = c.getHours(), q = $ >= 12 ? "PM" : "AM";
|
|
1873
|
+
t.value = g($, c.getMinutes(), q);
|
|
1867
1874
|
return;
|
|
1868
1875
|
}
|
|
1869
1876
|
}
|
|
@@ -1874,10 +1881,10 @@ function vt(e) {
|
|
|
1874
1881
|
["Time", t.value || "--:-- --"],
|
|
1875
1882
|
["Hour (12h)", E.value],
|
|
1876
1883
|
["Hour (24h)", u.value],
|
|
1877
|
-
["Minute",
|
|
1884
|
+
["Minute", A.value],
|
|
1878
1885
|
["Period", C.value],
|
|
1879
1886
|
["Time (24h)", i.value ?? "--:--:--"],
|
|
1880
|
-
["Digits only",
|
|
1887
|
+
["Digits only", F.value],
|
|
1881
1888
|
[
|
|
1882
1889
|
"Parsed Date",
|
|
1883
1890
|
v.value?.toLocaleDateString("en-US", {
|
|
@@ -1899,12 +1906,12 @@ function vt(e) {
|
|
|
1899
1906
|
minute: "2-digit"
|
|
1900
1907
|
}) ?? null
|
|
1901
1908
|
],
|
|
1902
|
-
["valid",
|
|
1909
|
+
["valid", P.value],
|
|
1903
1910
|
["reason", H.value],
|
|
1904
1911
|
["validationMessage", Z.value]
|
|
1905
1912
|
]), v = y(
|
|
1906
|
-
() =>
|
|
1907
|
-
),
|
|
1913
|
+
() => L(t.value) ?? null
|
|
1914
|
+
), P = y(() => {
|
|
1908
1915
|
if (!m.value) {
|
|
1909
1916
|
if (!l.value) return !0;
|
|
1910
1917
|
const c = v.value;
|
|
@@ -1920,7 +1927,7 @@ function vt(e) {
|
|
|
1920
1927
|
return c ? _(c) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
1921
1928
|
}
|
|
1922
1929
|
if (!D.value) return;
|
|
1923
|
-
if (
|
|
1930
|
+
if (F.value.length === 0 || !l.value)
|
|
1924
1931
|
return "incomplete";
|
|
1925
1932
|
const n = v.value;
|
|
1926
1933
|
return n ? _(n) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
@@ -1934,10 +1941,10 @@ function vt(e) {
|
|
|
1934
1941
|
const c = {
|
|
1935
1942
|
hour: "2-digit",
|
|
1936
1943
|
minute: "2-digit"
|
|
1937
|
-
},
|
|
1944
|
+
}, $ = e.min ? e.min.toLocaleTimeString("en-US", c) : null, q = e.max ? e.max.toLocaleTimeString("en-US", c) : null;
|
|
1938
1945
|
if (n === "out-of-bounds") {
|
|
1939
|
-
if (
|
|
1940
|
-
if (
|
|
1946
|
+
if ($ && q) return `Must be between ${$} and ${q}.`;
|
|
1947
|
+
if ($) return `Must be ${$} or later.`;
|
|
1941
1948
|
if (q) return `Must be ${q} or earlier.`;
|
|
1942
1949
|
}
|
|
1943
1950
|
return "";
|
|
@@ -1955,25 +1962,25 @@ function vt(e) {
|
|
|
1955
1962
|
);
|
|
1956
1963
|
return;
|
|
1957
1964
|
}
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
1965
|
+
const $ = c.parentElement;
|
|
1966
|
+
if (!$) {
|
|
1960
1967
|
console.warn(
|
|
1961
1968
|
`Parent of .k-timepicker not found for #${e.id} styling.`
|
|
1962
1969
|
);
|
|
1963
1970
|
return;
|
|
1964
1971
|
}
|
|
1965
|
-
|
|
1972
|
+
$.classList.contains("fk-timepicker") || $.classList.add("fk-timepicker");
|
|
1966
1973
|
});
|
|
1967
1974
|
};
|
|
1968
1975
|
return Me(() => {
|
|
1969
1976
|
G();
|
|
1970
1977
|
}), {
|
|
1971
1978
|
raw: t,
|
|
1972
|
-
rules:
|
|
1979
|
+
rules: k,
|
|
1973
1980
|
debugEnabled: h,
|
|
1974
1981
|
debugLines: a,
|
|
1975
1982
|
placeholder: p,
|
|
1976
|
-
isValid:
|
|
1983
|
+
isValid: P,
|
|
1977
1984
|
reason: Q(H),
|
|
1978
1985
|
validationMessage: Z,
|
|
1979
1986
|
isComplete: l,
|
|
@@ -1981,7 +1988,7 @@ function vt(e) {
|
|
|
1981
1988
|
cursorPos: r,
|
|
1982
1989
|
hour: Q(E),
|
|
1983
1990
|
hour24: Q(u),
|
|
1984
|
-
minute: Q(
|
|
1991
|
+
minute: Q(A),
|
|
1985
1992
|
period: Q(C),
|
|
1986
1993
|
time24: Q(i),
|
|
1987
1994
|
parsedRawTime: Q(v),
|
|
@@ -2001,20 +2008,20 @@ function gt(e) {
|
|
|
2001
2008
|
".k-popup",
|
|
2002
2009
|
".k-timepicker-popup",
|
|
2003
2010
|
".k-menu-popup"
|
|
2004
|
-
], h = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), p = (
|
|
2011
|
+
], h = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? r].flat(), p = (k) => k ? typeof e.initialFocus == "string" ? k.querySelector(e.initialFocus) ?? k : typeof e.initialFocus == "function" ? e.initialFocus(k) ?? k : k.querySelector(
|
|
2005
2012
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
2006
|
-
) ??
|
|
2013
|
+
) ?? k : null, { activate: m, deactivate: D } = qe(t, {
|
|
2007
2014
|
escapeDeactivates: !1,
|
|
2008
2015
|
clickOutsideDeactivates: !1,
|
|
2009
2016
|
fallbackFocus: () => t.value,
|
|
2010
2017
|
initialFocus: () => p(t.value),
|
|
2011
2018
|
...e.focusTrapOptions ?? {}
|
|
2012
2019
|
});
|
|
2013
|
-
let
|
|
2014
|
-
const
|
|
2020
|
+
let V = null, T = U(null);
|
|
2021
|
+
const F = () => {
|
|
2015
2022
|
if (e.resolvePopupEl) return e.resolvePopupEl();
|
|
2016
|
-
const
|
|
2017
|
-
const C = Array.from(E.querySelectorAll(
|
|
2023
|
+
const k = (E, A) => {
|
|
2024
|
+
const C = Array.from(E.querySelectorAll(A));
|
|
2018
2025
|
if (!C.length) return null;
|
|
2019
2026
|
const u = C.filter(
|
|
2020
2027
|
(i) => i.offsetParent !== null || i.getClientRects().length > 0
|
|
@@ -2022,29 +2029,29 @@ function gt(e) {
|
|
|
2022
2029
|
return u[u.length - 1] ?? C[C.length - 1] ?? null;
|
|
2023
2030
|
}, R = e.triggerEl?.value?.closest?.(".k-animation-container") ?? document.body;
|
|
2024
2031
|
for (const E of h) {
|
|
2025
|
-
const
|
|
2026
|
-
if (
|
|
2032
|
+
const A = k(R, E);
|
|
2033
|
+
if (A) return A;
|
|
2027
2034
|
}
|
|
2028
2035
|
for (const E of h) {
|
|
2029
|
-
const
|
|
2030
|
-
if (
|
|
2036
|
+
const A = k(document, E);
|
|
2037
|
+
if (A) return A;
|
|
2031
2038
|
}
|
|
2032
2039
|
return null;
|
|
2033
2040
|
};
|
|
2034
|
-
return $e(t, (
|
|
2035
|
-
T.value = "outside", e.isOpen.value && e.onRequestClose?.("outside",
|
|
2041
|
+
return $e(t, (k) => {
|
|
2042
|
+
T.value = "outside", e.isOpen.value && e.onRequestClose?.("outside", k);
|
|
2036
2043
|
}), ue(
|
|
2037
2044
|
() => e.isOpen.value,
|
|
2038
|
-
(
|
|
2039
|
-
|
|
2040
|
-
const R =
|
|
2041
|
-
R && (t.value = R, setTimeout(() => m(), 0),
|
|
2045
|
+
(k) => {
|
|
2046
|
+
k ? (T.value = null, B(() => {
|
|
2047
|
+
const R = F();
|
|
2048
|
+
R && (t.value = R, setTimeout(() => m(), 0), V || (V = (E) => {
|
|
2042
2049
|
E.key === "Escape" && (T.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", E));
|
|
2043
|
-
}, document.addEventListener("keydown",
|
|
2044
|
-
})) : (D(),
|
|
2050
|
+
}, document.addEventListener("keydown", V, !0)));
|
|
2051
|
+
})) : (D(), V && (document.removeEventListener("keydown", V, !0), V = null), t.value = null, T.value === "outside" && B(() => {
|
|
2045
2052
|
const R = () => {
|
|
2046
|
-
const E = e.triggerEl?.value,
|
|
2047
|
-
C && (C ===
|
|
2053
|
+
const E = e.triggerEl?.value, A = E?.querySelector("input"), C = document.activeElement;
|
|
2054
|
+
C && (C === A || E && E.contains(C)) && (A ?? E)?.blur?.();
|
|
2048
2055
|
};
|
|
2049
2056
|
requestAnimationFrame(() => setTimeout(R, 0));
|
|
2050
2057
|
}), e.returnFocusToTrigger !== !1 && T.value === "escape" && e.triggerEl?.value && B(() => {
|
|
@@ -2061,7 +2068,7 @@ function gt(e) {
|
|
|
2061
2068
|
activate: m,
|
|
2062
2069
|
deactivate: D,
|
|
2063
2070
|
lastCloseReason: Q(T),
|
|
2064
|
-
setPopupEl: (
|
|
2071
|
+
setPopupEl: (k) => t.value = k
|
|
2065
2072
|
};
|
|
2066
2073
|
}
|
|
2067
2074
|
export {
|