@featherk/composables 0.15.2 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs-manifest.js +24 -24
- package/dist/featherk-composables.es.js +152 -144
- 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 +2 -1
- package/dist/trap/usePopupTrap.d.ts +11 -3
- package/docs/menu/usePopupMenu.md +10 -3
- package/docs/menu/usePopupMenuGridOrchestration.md +2 -1
- package/docs/time/useMaskedTimeInput.md +59 -42
- package/docs/trap/usePopupTrap.md +294 -38
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as Y, onBeforeUnmount as He, nextTick as
|
|
2
|
-
import { useFocusTrap as
|
|
1
|
+
import { ref as Y, onBeforeUnmount as He, nextTick as j, computed as y, watchEffect as Ke, toValue as re, reactive as We, watch as ae, useId as Xe, unref as _e, onUnmounted as Fe, shallowRef as ve, shallowReactive as Ze, readonly as te, isRef as Pe, onScopeDispose as Me, onMounted as Le } from "vue";
|
|
2
|
+
import { useFocusTrap as Ge } from "@vueuse/integrations/useFocusTrap";
|
|
3
3
|
const Ct = (e, t) => {
|
|
4
4
|
const a = Y(null);
|
|
5
5
|
let f = !1, l = null, p = null;
|
|
6
6
|
const b = [], k = ".k-table-row[data-grid-row-index] [tabindex]", L = () => {
|
|
7
7
|
const d = e?.value?.$el;
|
|
8
8
|
return d ? d.closest(".k-grid") : null;
|
|
9
|
-
},
|
|
9
|
+
}, z = (d) => {
|
|
10
10
|
const I = L();
|
|
11
11
|
if (!I) return !1;
|
|
12
12
|
const m = d.closest(".k-grid-aria-root");
|
|
@@ -77,7 +77,7 @@ const Ct = (e, t) => {
|
|
|
77
77
|
const E = m;
|
|
78
78
|
if (E.classList.contains("k-animation-container")) {
|
|
79
79
|
const D = a.value;
|
|
80
|
-
D && (D.dataset.featherKSortable === "true" ||
|
|
80
|
+
D && (D.dataset.featherKSortable === "true" || j(() => {
|
|
81
81
|
E.querySelectorAll(
|
|
82
82
|
".k-columnmenu-item-wrapper"
|
|
83
83
|
).forEach((Z) => {
|
|
@@ -86,7 +86,7 @@ const Ct = (e, t) => {
|
|
|
86
86
|
})), E.addEventListener(
|
|
87
87
|
"keydown",
|
|
88
88
|
A
|
|
89
|
-
),
|
|
89
|
+
), j(() => {
|
|
90
90
|
const P = () => {
|
|
91
91
|
const K = Array.from(
|
|
92
92
|
E.querySelectorAll(
|
|
@@ -147,7 +147,7 @@ const Ct = (e, t) => {
|
|
|
147
147
|
const m = I.closest(
|
|
148
148
|
".k-table-row[data-grid-row-index]"
|
|
149
149
|
);
|
|
150
|
-
if (!
|
|
150
|
+
if (!z(I))
|
|
151
151
|
return;
|
|
152
152
|
const E = ["ArrowLeft", "ArrowRight"].includes(
|
|
153
153
|
d.code
|
|
@@ -221,7 +221,7 @@ const Ct = (e, t) => {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}, g = () => {
|
|
224
|
-
|
|
224
|
+
j(() => {
|
|
225
225
|
const d = e.value?.$el;
|
|
226
226
|
if (!d || typeof d.closest != "function") return;
|
|
227
227
|
const I = d.closest(".k-grid");
|
|
@@ -267,7 +267,7 @@ const Ct = (e, t) => {
|
|
|
267
267
|
console.error("Error setting up row navigation:", d);
|
|
268
268
|
}
|
|
269
269
|
}, q = () => {
|
|
270
|
-
|
|
270
|
+
j(() => {
|
|
271
271
|
const I = document.querySelectorAll(".k-grid-header .k-grid-header-menu.k-grid-column-menu");
|
|
272
272
|
I && I.forEach((m) => {
|
|
273
273
|
m.setAttribute("role", "button"), m.addEventListener(
|
|
@@ -365,8 +365,8 @@ const Ct = (e, t) => {
|
|
|
365
365
|
);
|
|
366
366
|
return;
|
|
367
367
|
}
|
|
368
|
-
typeof I == "function" &&
|
|
369
|
-
a.value && a.value.focus(), I(d),
|
|
368
|
+
typeof I == "function" && j(() => {
|
|
369
|
+
a.value && a.value.focus(), I(d), j(() => {
|
|
370
370
|
W();
|
|
371
371
|
});
|
|
372
372
|
});
|
|
@@ -387,7 +387,7 @@ const Ct = (e, t) => {
|
|
|
387
387
|
handleSortChange: B,
|
|
388
388
|
initA11y: _
|
|
389
389
|
};
|
|
390
|
-
},
|
|
390
|
+
}, je = (e) => !!e && typeof e == "object" && "filters" in e && Array.isArray(e.filters), Je = (e) => !!e && typeof e == "object" && "field" in e, Ue = (e, t) => !e || typeof e != "object" ? !1 : je(e) ? e.filters.some(
|
|
391
391
|
(a) => Ue(a, t)
|
|
392
392
|
) : Je(e) ? e.field === t : !1, Rt = (e) => (t) => e.value?.filters && e.value.filters.some(
|
|
393
393
|
(a) => Ue(a, t)
|
|
@@ -424,7 +424,7 @@ const Ct = (e, t) => {
|
|
|
424
424
|
if (!v) return !1;
|
|
425
425
|
const g = k.join(",");
|
|
426
426
|
return v.closest && v.closest(g) ? !0 : p && c ? p(v, c) : !1;
|
|
427
|
-
},
|
|
427
|
+
}, z = (v) => {
|
|
428
428
|
const g = v?.closest?.(
|
|
429
429
|
".k-table-row[data-grid-row-index]"
|
|
430
430
|
)?.getAttribute("data-grid-row-index");
|
|
@@ -478,7 +478,7 @@ const Ct = (e, t) => {
|
|
|
478
478
|
return;
|
|
479
479
|
const R = {
|
|
480
480
|
dataItem: v.dataItem,
|
|
481
|
-
rowIndex: v.rowIndex ??
|
|
481
|
+
rowIndex: v.rowIndex ?? z(g),
|
|
482
482
|
field: v.field,
|
|
483
483
|
event: c || v,
|
|
484
484
|
triggerType: "click",
|
|
@@ -533,9 +533,9 @@ const Ct = (e, t) => {
|
|
|
533
533
|
), l = y(() => t.value.replace(/\D/g, "")), p = y(() => {
|
|
534
534
|
const A = l.value.length;
|
|
535
535
|
return A === 5 || A === 9;
|
|
536
|
-
}), b = y(() => a.value && !p.value), k = y(() => !a.value || p.value), L = y(() => a.value),
|
|
536
|
+
}), b = y(() => a.value && !p.value), k = y(() => !a.value || p.value), L = y(() => a.value), z = (A, V) => {
|
|
537
537
|
const v = nt(V);
|
|
538
|
-
|
|
538
|
+
j(() => {
|
|
539
539
|
A.isConnected && A.setSelectionRange(v, v);
|
|
540
540
|
});
|
|
541
541
|
};
|
|
@@ -558,12 +558,12 @@ const Ct = (e, t) => {
|
|
|
558
558
|
c.value,
|
|
559
559
|
c.selectionStart
|
|
560
560
|
) : R.replace(/\D/g, "").length;
|
|
561
|
-
t.value = $e(R), c &&
|
|
561
|
+
t.value = $e(R), c && z(c, q);
|
|
562
562
|
},
|
|
563
563
|
submitAndValidate: (A) => {
|
|
564
564
|
a.value = !0;
|
|
565
565
|
const V = p.value;
|
|
566
|
-
return !V && A?.focus &&
|
|
566
|
+
return !V && A?.focus && j(() => {
|
|
567
567
|
document.getElementById(
|
|
568
568
|
e.id
|
|
569
569
|
)?.focus();
|
|
@@ -603,7 +603,7 @@ function ot(e, t) {
|
|
|
603
603
|
])
|
|
604
604
|
);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function z(x) {
|
|
607
607
|
const A = re(x);
|
|
608
608
|
if (!A) return;
|
|
609
609
|
A.querySelector(
|
|
@@ -627,7 +627,7 @@ function ot(e, t) {
|
|
|
627
627
|
reset: C,
|
|
628
628
|
createFieldValidity: k,
|
|
629
629
|
createFieldValidationsMap: L,
|
|
630
|
-
focusFirstInvalidField:
|
|
630
|
+
focusFirstInvalidField: z
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
const lt = [
|
|
@@ -724,8 +724,8 @@ function st(e, t = "zip") {
|
|
|
724
724
|
wrapperClass: b,
|
|
725
725
|
handleZipInput: k
|
|
726
726
|
} = a;
|
|
727
|
-
return ae(l, (
|
|
728
|
-
e.zip =
|
|
727
|
+
return ae(l, (z) => {
|
|
728
|
+
e.zip = z;
|
|
729
729
|
}), {
|
|
730
730
|
zipDisplay: f,
|
|
731
731
|
isZipValid: p,
|
|
@@ -772,7 +772,7 @@ function Lt(e) {
|
|
|
772
772
|
onAddress1Input: b,
|
|
773
773
|
onAddress2Input: k,
|
|
774
774
|
onCityInput: L,
|
|
775
|
-
onStateChange:
|
|
775
|
+
onStateChange: z,
|
|
776
776
|
resetFormData: M
|
|
777
777
|
} = it(), C = `${e.addressId}-zip`, { zipDisplay: x, isZipValid: A, zipWrapperClass: V, onZipInput: v, resetZip: c } = st(p, C), {
|
|
778
778
|
strictAddress1Valid: g,
|
|
@@ -819,10 +819,10 @@ function Lt(e) {
|
|
|
819
819
|
city: p.city.trim(),
|
|
820
820
|
state: (p.state ?? "").trim().toUpperCase(),
|
|
821
821
|
zip: p.zip.replace(/\D/g, "")
|
|
822
|
-
})), s = y(() => p.address1.trim() === "" && p.address2.trim() === "" && p.city.trim() === "" && (p.state ?? "").trim() === "" && p.zip.replace(/\D/g, "") === ""), T = y(() => !s.value),
|
|
822
|
+
})), s = y(() => p.address1.trim() === "" && p.address2.trim() === "" && p.city.trim() === "" && (p.state ?? "").trim() === "" && p.zip.replace(/\D/g, "") === ""), T = y(() => !s.value), N = y(() => !l.value && T.value && (!g.value || !R.value || !q.value)), U = y(() => {
|
|
823
823
|
const w = p.zip.replace(/\D/g, "");
|
|
824
824
|
return !l.value && T.value && w.length !== 5 && w.length !== 9;
|
|
825
|
-
}), Q = y(() => !l.value && T.value && !W.value),
|
|
825
|
+
}), Q = y(() => !l.value && T.value && !W.value), G = y(() => !l.value && Q.value && (f.value || a.value));
|
|
826
826
|
return ae(r, () => {
|
|
827
827
|
l.value || (f.value = !1);
|
|
828
828
|
}), ae(l, (w) => {
|
|
@@ -837,9 +837,9 @@ function Lt(e) {
|
|
|
837
837
|
stateValid: o,
|
|
838
838
|
zipValid: S,
|
|
839
839
|
addressValid: u,
|
|
840
|
-
optionalFeedbackActive:
|
|
840
|
+
optionalFeedbackActive: G,
|
|
841
841
|
optionalPartialInvalid: Q,
|
|
842
|
-
optionalMissingRequiredFields:
|
|
842
|
+
optionalMissingRequiredFields: N,
|
|
843
843
|
optionalZipInvalid: U,
|
|
844
844
|
stateDefaultItem: h,
|
|
845
845
|
stateOptions: $,
|
|
@@ -848,7 +848,7 @@ function Lt(e) {
|
|
|
848
848
|
onAddress1Input: b,
|
|
849
849
|
onAddress2Input: k,
|
|
850
850
|
onCityInput: L,
|
|
851
|
-
onStateChange:
|
|
851
|
+
onStateChange: z,
|
|
852
852
|
onZipInput: v,
|
|
853
853
|
onFieldsetFocusout: (w) => {
|
|
854
854
|
const O = dt(t.value, w);
|
|
@@ -858,7 +858,7 @@ function Lt(e) {
|
|
|
858
858
|
validateForSubmit: async () => l.value ? (a.value = !0, W.value ? {
|
|
859
859
|
isValid: !0,
|
|
860
860
|
payload: r.value
|
|
861
|
-
} : (await
|
|
861
|
+
} : (await j(), ct(t.value), { isValid: !1, payload: null })) : s.value || W.value ? (a.value = !1, {
|
|
862
862
|
isValid: !0,
|
|
863
863
|
payload: r.value
|
|
864
864
|
}) : (a.value = !0, { isValid: !1, payload: null }),
|
|
@@ -870,7 +870,7 @@ function Lt(e) {
|
|
|
870
870
|
const Oe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", Ve = (e) => e === "top" ? "bottom" : e === "bottom" ? "top" : "center", Te = (e, t, a, f) => {
|
|
871
871
|
const l = e.left + (a.horizontal === "right" ? e.width : a.horizontal === "center" ? e.width / 2 : 0), p = e.top + (a.vertical === "bottom" ? e.height : a.vertical === "center" ? e.height / 2 : 0), b = t ? f.horizontal === "right" ? t.width : f.horizontal === "center" ? t.width / 2 : 0 : 0, k = t ? f.vertical === "bottom" ? t.height : f.vertical === "center" ? t.height / 2 : 0 : 0;
|
|
872
872
|
return { left: l - b, top: p - k };
|
|
873
|
-
},
|
|
873
|
+
}, Ne = (e, t, a, f) => t >= f - a ? a : Math.min(Math.max(e, a), f - t), ft = ({
|
|
874
874
|
anchor: e,
|
|
875
875
|
popup: t,
|
|
876
876
|
anchorAlign: a,
|
|
@@ -882,10 +882,10 @@ const Oe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", Ve
|
|
|
882
882
|
if (!t) return b;
|
|
883
883
|
let { left: k, top: L } = b;
|
|
884
884
|
if (p.horizontal === "fit")
|
|
885
|
-
k =
|
|
885
|
+
k = Ne(k, t.width, l.left, l.right);
|
|
886
886
|
else {
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
887
|
+
const z = k + t.width - l.right, M = l.left - k;
|
|
888
|
+
if (z > 0 || M > 0) {
|
|
889
889
|
const C = Te(
|
|
890
890
|
e,
|
|
891
891
|
t,
|
|
@@ -897,15 +897,15 @@ const Oe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", Ve
|
|
|
897
897
|
horizontal: Oe(f.horizontal),
|
|
898
898
|
vertical: f.vertical
|
|
899
899
|
}
|
|
900
|
-
), x = Math.max(
|
|
900
|
+
), x = Math.max(z, 0) + Math.max(M, 0);
|
|
901
901
|
Math.max(C.left + t.width - l.right, 0) + Math.max(l.left - C.left, 0) < x && (k = C.left);
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
904
|
if (p.vertical === "fit")
|
|
905
|
-
L =
|
|
905
|
+
L = Ne(L, t.height, l.top, l.bottom);
|
|
906
906
|
else {
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
907
|
+
const z = L + t.height - l.bottom, M = l.top - L;
|
|
908
|
+
if (z > 0 || M > 0) {
|
|
909
909
|
const C = Te(
|
|
910
910
|
e,
|
|
911
911
|
t,
|
|
@@ -917,7 +917,7 @@ const Oe = (e) => e === "left" ? "right" : e === "right" ? "left" : "center", Ve
|
|
|
917
917
|
horizontal: f.horizontal,
|
|
918
918
|
vertical: Ve(f.vertical)
|
|
919
919
|
}
|
|
920
|
-
), x = Math.max(
|
|
920
|
+
), x = Math.max(z, 0) + Math.max(M, 0);
|
|
921
921
|
Math.max(C.top + t.height - l.bottom, 0) + Math.max(l.top - C.top, 0) < x && (L = C.top);
|
|
922
922
|
}
|
|
923
923
|
}
|
|
@@ -959,7 +959,7 @@ function Re(...e) {
|
|
|
959
959
|
];
|
|
960
960
|
}, ([f, l, p, b], k, L) => {
|
|
961
961
|
if (!f?.length || !l?.length || !p?.length) return;
|
|
962
|
-
const
|
|
962
|
+
const z = mt(b) ? { ...b } : b, M = f.flatMap((C) => l.flatMap((x) => p.map((A) => t(C, x, A, z))));
|
|
963
963
|
L(() => {
|
|
964
964
|
M.forEach((C) => C());
|
|
965
965
|
});
|
|
@@ -973,7 +973,7 @@ function Be(e, t, a = {}) {
|
|
|
973
973
|
trigger: Ae
|
|
974
974
|
} : Ae;
|
|
975
975
|
let L = !0;
|
|
976
|
-
const
|
|
976
|
+
const z = (c) => re(l).some((g) => {
|
|
977
977
|
if (typeof g == "string") return Array.from(f.document.querySelectorAll(g)).some((R) => R === c.target || c.composedPath().includes(R));
|
|
978
978
|
{
|
|
979
979
|
const R = Se(g);
|
|
@@ -991,7 +991,7 @@ function Be(e, t, a = {}) {
|
|
|
991
991
|
const x = (c) => {
|
|
992
992
|
const g = Se(e);
|
|
993
993
|
if (c.target != null && !(!(g instanceof Element) && M(e) && C(e, c)) && !(!g || g === c.target || c.composedPath().includes(g))) {
|
|
994
|
-
if ("detail" in c && c.detail === 0 && (L = !
|
|
994
|
+
if ("detail" in c && c.detail === 0 && (L = !z(c)), !L) {
|
|
995
995
|
L = !0;
|
|
996
996
|
return;
|
|
997
997
|
}
|
|
@@ -1010,7 +1010,7 @@ function Be(e, t, a = {}) {
|
|
|
1010
1010
|
}),
|
|
1011
1011
|
Re(f, "pointerdown", (c) => {
|
|
1012
1012
|
const g = Se(e);
|
|
1013
|
-
L = !
|
|
1013
|
+
L = !z(c) && !!(g && !c.composedPath().includes(g));
|
|
1014
1014
|
}, { passive: !0 }),
|
|
1015
1015
|
b && Re(f, "blur", (c) => {
|
|
1016
1016
|
setTimeout(() => {
|
|
@@ -1069,7 +1069,7 @@ const gt = (e) => {
|
|
|
1069
1069
|
const t = Y(null), a = e.menuItemSelector ?? ".k-menu-item:not(.k-disabled)", f = e.triggerMode, l = e.anchor === !0 ? {} : e.anchor, p = l?.activationPoint ? l.activationPoint === !0 ? {} : l.activationPoint : null, b = ve(null), k = ve(null), L = l?.anchorAlign ?? {
|
|
1070
1070
|
horizontal: "left",
|
|
1071
1071
|
vertical: "bottom"
|
|
1072
|
-
},
|
|
1072
|
+
}, z = l?.popupAlign ?? {
|
|
1073
1073
|
horizontal: "left",
|
|
1074
1074
|
vertical: "top"
|
|
1075
1075
|
}, M = l?.collision ?? {
|
|
@@ -1101,7 +1101,7 @@ const gt = (e) => {
|
|
|
1101
1101
|
anchor: u,
|
|
1102
1102
|
popup: C.value,
|
|
1103
1103
|
anchorAlign: L,
|
|
1104
|
-
popupAlign:
|
|
1104
|
+
popupAlign: z,
|
|
1105
1105
|
bounds: h,
|
|
1106
1106
|
collision: M
|
|
1107
1107
|
});
|
|
@@ -1121,10 +1121,10 @@ const gt = (e) => {
|
|
|
1121
1121
|
return k.value = null, !1;
|
|
1122
1122
|
const r = $.getBoundingClientRect();
|
|
1123
1123
|
if (h.triggerType === "keyboard") {
|
|
1124
|
-
const s = p.keyboardPosition, T = s?.y ?? "center",
|
|
1124
|
+
const s = p.keyboardPosition, T = s?.y ?? "center", N = typeof T == "number" ? T : T === "top" ? 0 : T === "bottom" ? r.height : r.height / 2;
|
|
1125
1125
|
return k.value = {
|
|
1126
1126
|
trigger: $,
|
|
1127
|
-
point: { x: s?.x ?? 8, y:
|
|
1127
|
+
point: { x: s?.x ?? 8, y: N },
|
|
1128
1128
|
hasMatchedTrigger: !1
|
|
1129
1129
|
}, !0;
|
|
1130
1130
|
}
|
|
@@ -1159,7 +1159,7 @@ const gt = (e) => {
|
|
|
1159
1159
|
} else t.value === "mouse-selection" && _.value?.focus();
|
|
1160
1160
|
t.value = null, B.value = null, _.value = null;
|
|
1161
1161
|
}, m = (u) => {
|
|
1162
|
-
e.isOpen.value && (t.value = u, B.value = g() ?? (u === "escape" ? q() : null), _.value = x(), K(!1), e.requestHide(),
|
|
1162
|
+
e.isOpen.value && (t.value = u, B.value = g() ?? (u === "escape" ? q() : null), _.value = x(), K(!1), e.requestHide(), j(I));
|
|
1163
1163
|
};
|
|
1164
1164
|
ae(
|
|
1165
1165
|
[A, k],
|
|
@@ -1186,12 +1186,12 @@ const gt = (e) => {
|
|
|
1186
1186
|
b.value = l.getRect?.(u) ?? u.getBoundingClientRect();
|
|
1187
1187
|
}, T = () => {
|
|
1188
1188
|
r === null && (r = window.requestAnimationFrame(s));
|
|
1189
|
-
},
|
|
1190
|
-
|
|
1189
|
+
}, N = typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
|
|
1190
|
+
N?.observe(u), window.addEventListener("scroll", T, {
|
|
1191
1191
|
capture: !0,
|
|
1192
1192
|
passive: !0
|
|
1193
1193
|
}), window.addEventListener("resize", T, { passive: !0 }), T(), $(() => {
|
|
1194
|
-
r !== null && window.cancelAnimationFrame(r),
|
|
1194
|
+
r !== null && window.cancelAnimationFrame(r), N?.disconnect(), window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
|
|
1195
1195
|
});
|
|
1196
1196
|
},
|
|
1197
1197
|
{ immediate: !0, flush: "post" }
|
|
@@ -1216,8 +1216,8 @@ const gt = (e) => {
|
|
|
1216
1216
|
C.value = Q?.getBoundingClientRect() ?? null;
|
|
1217
1217
|
}, T = () => {
|
|
1218
1218
|
r === null && (r = window.requestAnimationFrame(s));
|
|
1219
|
-
},
|
|
1220
|
-
U?.observe(
|
|
1219
|
+
}, N = E(), U = N && typeof window.ResizeObserver == "function" ? new window.ResizeObserver(T) : null;
|
|
1220
|
+
U?.observe(N), T(), $(() => {
|
|
1221
1221
|
r !== null && window.cancelAnimationFrame(r), U?.disconnect();
|
|
1222
1222
|
});
|
|
1223
1223
|
},
|
|
@@ -1331,7 +1331,7 @@ const gt = (e) => {
|
|
|
1331
1331
|
* outside clicks do not move focus.
|
|
1332
1332
|
*/
|
|
1333
1333
|
handlePopupClose: () => {
|
|
1334
|
-
|
|
1334
|
+
j(I);
|
|
1335
1335
|
},
|
|
1336
1336
|
offset: c
|
|
1337
1337
|
};
|
|
@@ -1352,8 +1352,8 @@ const gt = (e) => {
|
|
|
1352
1352
|
return t instanceof HTMLElement ? t : null;
|
|
1353
1353
|
}, Vt = () => {
|
|
1354
1354
|
const e = Ze(/* @__PURE__ */ new Map()), t = Y(null), a = (k, L) => {
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1355
|
+
const z = kt(L);
|
|
1356
|
+
z ? e.set(k, z) : e.delete(k);
|
|
1357
1357
|
}, f = (k) => e.get(k) ?? null, l = (k) => {
|
|
1358
1358
|
t.value = k;
|
|
1359
1359
|
}, p = () => {
|
|
@@ -1371,7 +1371,7 @@ const gt = (e) => {
|
|
|
1371
1371
|
deactivate: p,
|
|
1372
1372
|
isIdActive: b
|
|
1373
1373
|
};
|
|
1374
|
-
},
|
|
1374
|
+
}, ze = {
|
|
1375
1375
|
title: "My Window",
|
|
1376
1376
|
draggable: !0,
|
|
1377
1377
|
resizable: !0,
|
|
@@ -1388,12 +1388,12 @@ const gt = (e) => {
|
|
|
1388
1388
|
left: void 0,
|
|
1389
1389
|
top: void 0
|
|
1390
1390
|
}, At = (e) => e === "DEFAULT" || e === "MINIMIZED" || e === "FULLSCREEN", Et = 120, Dt = 100, xt = ["n", "e", "s", "w", "ne", "nw", "se", "sw"], ye = (e, t, a) => Math.min(Math.max(e, t), a), qe = (e) => typeof e == "object" && e !== null && "drag" in e && "left" in e && "top" in e && "width" in e && "height" in e && typeof e.left == "number" && typeof e.top == "number" && typeof e.width == "number" && typeof e.height == "number", Mt = (e, t, a) => Math.max(e - t - a, 0);
|
|
1391
|
-
function
|
|
1391
|
+
function Nt(e = {}) {
|
|
1392
1392
|
Pe(e.settings) && (e.settings.value = {
|
|
1393
|
-
...
|
|
1393
|
+
...ze,
|
|
1394
1394
|
...e.settings.value
|
|
1395
1395
|
});
|
|
1396
|
-
const t = Pe(e.settings) ? e.settings : Y({ ...
|
|
1396
|
+
const t = Pe(e.settings) ? e.settings : Y({ ...ze, ...e.settings }), a = ve(null), f = Y(!1), l = Y(e.initialStage ?? "DEFAULT"), p = Y(!1), b = Y(!1), k = Y(0), L = Y(0), z = y(() => t.value.minWidth ?? Et), M = y(
|
|
1397
1397
|
() => t.value.minHeight ?? Dt
|
|
1398
1398
|
);
|
|
1399
1399
|
let C = null, x = null;
|
|
@@ -1421,7 +1421,7 @@ function zt(e = {}) {
|
|
|
1421
1421
|
window.innerWidth,
|
|
1422
1422
|
t.value.initialWidth,
|
|
1423
1423
|
u
|
|
1424
|
-
), L.value = t.value.initialTop ?? $ + u, f.value = !0, await
|
|
1424
|
+
), L.value = t.value.initialTop ?? $ + u, f.value = !0, await j(), t.value.width = t.value.initialWidth, t.value.height = t.value.initialHeight;
|
|
1425
1425
|
} else
|
|
1426
1426
|
f.value = !0;
|
|
1427
1427
|
e.onOpen?.();
|
|
@@ -1439,32 +1439,32 @@ function zt(e = {}) {
|
|
|
1439
1439
|
const S = a.value?.$el, h = (S instanceof Element ? S.querySelector(".k-window-titlebar") : null)?.getBoundingClientRect(), $ = h?.width ?? o.width, r = h?.height ?? o.height, s = A(), T = Math.max(
|
|
1440
1440
|
s.right - $,
|
|
1441
1441
|
s.left
|
|
1442
|
-
),
|
|
1442
|
+
), N = Math.max(
|
|
1443
1443
|
s.bottom - r,
|
|
1444
1444
|
s.top
|
|
1445
1445
|
);
|
|
1446
|
-
t.value.left = ye(o.left, s.left, T), t.value.top = ye(o.top, s.top,
|
|
1446
|
+
t.value.left = ye(o.left, s.left, T), t.value.top = ye(o.top, s.top, N), p.value = o.drag && !o.end, e.onMove?.(o);
|
|
1447
1447
|
}
|
|
1448
1448
|
}, q = (n) => {
|
|
1449
1449
|
const { direction: o, start: S } = n, u = A(), h = n.pointerX - n.startX, $ = n.pointerY - n.startY;
|
|
1450
|
-
let r = S.left, s = S.top, T = S.left + S.width,
|
|
1450
|
+
let r = S.left, s = S.top, T = S.left + S.width, N = S.top + S.height;
|
|
1451
1451
|
return o.includes("n") && (s = ye(
|
|
1452
1452
|
S.top + $,
|
|
1453
1453
|
Math.min(u.top, S.top),
|
|
1454
|
-
|
|
1455
|
-
)), o.includes("s") && (
|
|
1456
|
-
|
|
1454
|
+
N - M.value
|
|
1455
|
+
)), o.includes("s") && (N = ye(
|
|
1456
|
+
N + $,
|
|
1457
1457
|
s + M.value,
|
|
1458
|
-
Math.max(u.bottom,
|
|
1458
|
+
Math.max(u.bottom, N)
|
|
1459
1459
|
)), o.includes("w") && (r = ye(
|
|
1460
1460
|
S.left + h,
|
|
1461
1461
|
Math.min(u.left, S.left),
|
|
1462
|
-
T -
|
|
1462
|
+
T - z.value
|
|
1463
1463
|
)), o.includes("e") && (T = ye(
|
|
1464
1464
|
T + h,
|
|
1465
|
-
r +
|
|
1465
|
+
r + z.value,
|
|
1466
1466
|
Math.max(u.right, T)
|
|
1467
|
-
)), { left: r, top: s, width: T - r, height:
|
|
1467
|
+
)), { left: r, top: s, width: T - r, height: N - s };
|
|
1468
1468
|
}, X = (n) => {
|
|
1469
1469
|
const o = V(), S = x ?? o, u = A(), h = Math.max(u.right, o.left + o.width) - o.left, $ = Math.max(u.bottom, o.top + o.height) - o.top;
|
|
1470
1470
|
return {
|
|
@@ -1472,7 +1472,7 @@ function zt(e = {}) {
|
|
|
1472
1472
|
top: o.top,
|
|
1473
1473
|
width: Math.max(
|
|
1474
1474
|
Math.min(o.width + n.width - S.width, h),
|
|
1475
|
-
|
|
1475
|
+
z.value
|
|
1476
1476
|
),
|
|
1477
1477
|
height: Math.max(
|
|
1478
1478
|
Math.min(
|
|
@@ -1552,7 +1552,7 @@ function zt(e = {}) {
|
|
|
1552
1552
|
initialHeight: t.value.initialHeight,
|
|
1553
1553
|
width: t.value.width,
|
|
1554
1554
|
height: t.value.height,
|
|
1555
|
-
minWidth:
|
|
1555
|
+
minWidth: z.value,
|
|
1556
1556
|
minHeight: M.value,
|
|
1557
1557
|
stage: l.value,
|
|
1558
1558
|
windowClass: Z.value
|
|
@@ -1575,8 +1575,8 @@ function zt(e = {}) {
|
|
|
1575
1575
|
close: c
|
|
1576
1576
|
};
|
|
1577
1577
|
}
|
|
1578
|
-
function
|
|
1579
|
-
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(e.dateFormat ?? "mm/dd/yyyy"), p = y(() => !!e.required), b = 1e3, k = Y(!1), L = ["ArrowUp", "ArrowDown"],
|
|
1578
|
+
function zt(e) {
|
|
1579
|
+
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(e.dateFormat ?? "mm/dd/yyyy"), p = y(() => !!e.required), b = 1e3, k = Y(!1), L = ["ArrowUp", "ArrowDown"], z = ["ArrowLeft", "ArrowRight"], M = y(() => (t.value ?? "").replace(/\D/g, "")), C = (n) => n <= 2 ? "mm" : n <= 5 ? "dd" : M.value.length <= 10 ? "yyyy" : "mm", x = y(() => {
|
|
1580
1580
|
const n = t.value && t.value.substring(0, 2).replace(/\D/g, "0") || "0";
|
|
1581
1581
|
return parseInt(n).toString().padStart(2, "0");
|
|
1582
1582
|
}), A = y(() => {
|
|
@@ -1646,13 +1646,13 @@ function Nt(e) {
|
|
|
1646
1646
|
2,
|
|
1647
1647
|
"0"
|
|
1648
1648
|
)}/${String(r)}`;
|
|
1649
|
-
const [
|
|
1649
|
+
const [N, U, Q] = t.value.split("/"), G = q(
|
|
1650
1650
|
parseInt(Q),
|
|
1651
|
-
parseInt(
|
|
1651
|
+
parseInt(N),
|
|
1652
1652
|
parseInt(U)
|
|
1653
1653
|
);
|
|
1654
|
-
|
|
1655
|
-
value: c(
|
|
1654
|
+
G.toString() !== "Invalid Date" && parseInt(Q) >= 1e3 ? e.onChange({
|
|
1655
|
+
value: c(G) ? G : null,
|
|
1656
1656
|
event: S
|
|
1657
1657
|
}) : e.onChange({ value: null, event: S }), D({ useRAF: !0 });
|
|
1658
1658
|
}, I = (n) => {
|
|
@@ -1677,7 +1677,7 @@ function Nt(e) {
|
|
|
1677
1677
|
d(o, n.target, n);
|
|
1678
1678
|
}, E = (n) => {
|
|
1679
1679
|
const o = n.target;
|
|
1680
|
-
if (
|
|
1680
|
+
if (z.includes(n.key)) {
|
|
1681
1681
|
a.value = o?.selectionStart ?? 0;
|
|
1682
1682
|
return;
|
|
1683
1683
|
}
|
|
@@ -1701,7 +1701,7 @@ function Nt(e) {
|
|
|
1701
1701
|
} catch {
|
|
1702
1702
|
}
|
|
1703
1703
|
};
|
|
1704
|
-
|
|
1704
|
+
j(() => {
|
|
1705
1705
|
if (n?.delay && n.delay > 0) {
|
|
1706
1706
|
setTimeout(o, n.delay);
|
|
1707
1707
|
return;
|
|
@@ -1789,7 +1789,7 @@ function Nt(e) {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
return "";
|
|
1791
1791
|
}), se = () => {
|
|
1792
|
-
|
|
1792
|
+
j(() => {
|
|
1793
1793
|
const n = document.getElementById(
|
|
1794
1794
|
e.id
|
|
1795
1795
|
);
|
|
@@ -1840,8 +1840,8 @@ function Nt(e) {
|
|
|
1840
1840
|
};
|
|
1841
1841
|
}
|
|
1842
1842
|
function qt(e) {
|
|
1843
|
-
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(!1), p = 1440 * 60 * 1e3, b = 365 * p, k = /* @__PURE__ */ new Date(), L = new Date(k.getTime() - b),
|
|
1844
|
-
e.min = e.min ?? L, e.max = e.max ??
|
|
1843
|
+
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(!1), p = 1440 * 60 * 1e3, b = 365 * p, k = /* @__PURE__ */ new Date(), L = new Date(k.getTime() - b), z = new Date(k.getTime() + b);
|
|
1844
|
+
e.min = e.min ?? L, e.max = e.max ?? z;
|
|
1845
1845
|
const M = y(() => (t.value ?? "").replace(/\D/g, "")), C = (i, w) => new Date(i, w, 0).getDate(), x = (i, w, O) => w >= 1 && w <= 12 && i >= 1e3 && O >= 1 && O <= C(i, w), A = (i) => Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()), V = (i) => {
|
|
1846
1846
|
if (!i) return null;
|
|
1847
1847
|
const w = e.min ?? new Date(Date.now() - 90 * p), O = e.max ?? /* @__PURE__ */ new Date(), H = A(i);
|
|
@@ -1897,7 +1897,7 @@ function qt(e) {
|
|
|
1897
1897
|
const { start: oe, end: le } = g(t.value);
|
|
1898
1898
|
if (!oe && !le) {
|
|
1899
1899
|
const ee = /* @__PURE__ */ new Date(), de = D(ee);
|
|
1900
|
-
t.value = `${de} - ${de}`, e.onChange({ value: { start: ee, end: ee }, event: O }),
|
|
1900
|
+
t.value = `${de} - ${de}`, e.onChange({ value: { start: ee, end: ee }, event: O }), j(() => {
|
|
1901
1901
|
requestAnimationFrame(() => {
|
|
1902
1902
|
const ie = document.getElementById(
|
|
1903
1903
|
e.id
|
|
@@ -1929,7 +1929,7 @@ function qt(e) {
|
|
|
1929
1929
|
const Ee = D(he), De = D(ge);
|
|
1930
1930
|
t.value = `${Ee} - ${De}`;
|
|
1931
1931
|
const pe = V(he), xe = V(ge);
|
|
1932
|
-
pe && xe && v(pe, xe) ? e.onChange({ value: { start: pe, end: xe }, event: O }) : e.onChange({ value: null, event: O }),
|
|
1932
|
+
pe && xe && v(pe, xe) ? e.onChange({ value: { start: pe, end: xe }, event: O }) : e.onChange({ value: null, event: O }), j(() => {
|
|
1933
1933
|
requestAnimationFrame(() => {
|
|
1934
1934
|
const ee = document.getElementById(
|
|
1935
1935
|
e.id
|
|
@@ -1993,7 +1993,7 @@ function qt(e) {
|
|
|
1993
1993
|
}, h = (i) => {
|
|
1994
1994
|
u();
|
|
1995
1995
|
}, $ = (i) => {
|
|
1996
|
-
t.value = "", a.value = 0, e.onChange({ value: null, event: i }), u(),
|
|
1996
|
+
t.value = "", a.value = 0, e.onChange({ value: null, event: i }), u(), j(() => {
|
|
1997
1997
|
const w = document.getElementById(
|
|
1998
1998
|
e.id
|
|
1999
1999
|
);
|
|
@@ -2022,13 +2022,13 @@ function qt(e) {
|
|
|
2022
2022
|
() => t.value && t.value.substring(3, 5).replace(/\D/g, "0") || "0"
|
|
2023
2023
|
), T = y(
|
|
2024
2024
|
() => t.value && t.value.substring(6, 10).replace(/\D/g, "0") || "0"
|
|
2025
|
-
),
|
|
2025
|
+
), N = y(
|
|
2026
2026
|
() => t.value && t.value.substring(13, 15).replace(/\D/g, "0") || "0"
|
|
2027
2027
|
), U = y(
|
|
2028
2028
|
() => t.value && t.value.substring(16, 18).replace(/\D/g, "0") || "0"
|
|
2029
2029
|
), Q = y(
|
|
2030
2030
|
() => t.value && t.value.substring(19, 23).replace(/\D/g, "0") || "0"
|
|
2031
|
-
),
|
|
2031
|
+
), G = y(() => {
|
|
2032
2032
|
const { start: i, end: w } = g(t.value);
|
|
2033
2033
|
return [
|
|
2034
2034
|
{
|
|
@@ -2051,7 +2051,7 @@ function qt(e) {
|
|
|
2051
2051
|
},
|
|
2052
2052
|
{
|
|
2053
2053
|
label: "End",
|
|
2054
|
-
value: `${String(
|
|
2054
|
+
value: `${String(N.value).padStart(2, "0")} / ${String(
|
|
2055
2055
|
U.value
|
|
2056
2056
|
).padStart(2, "0")} / ${String(Q.value).padStart(4, "0")}`
|
|
2057
2057
|
},
|
|
@@ -2079,7 +2079,7 @@ function qt(e) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
];
|
|
2081
2081
|
}), J = () => {
|
|
2082
|
-
|
|
2082
|
+
j(() => {
|
|
2083
2083
|
const i = document.getElementById(e.id);
|
|
2084
2084
|
if (!i) {
|
|
2085
2085
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -2097,7 +2097,7 @@ function qt(e) {
|
|
|
2097
2097
|
J();
|
|
2098
2098
|
});
|
|
2099
2099
|
const ce = () => {
|
|
2100
|
-
|
|
2100
|
+
j(() => {
|
|
2101
2101
|
try {
|
|
2102
2102
|
const i = Array.from(
|
|
2103
2103
|
document.querySelectorAll(".k-animation-container")
|
|
@@ -2129,7 +2129,7 @@ function qt(e) {
|
|
|
2129
2129
|
raw: t,
|
|
2130
2130
|
cursorPos: a,
|
|
2131
2131
|
debugEnabled: f,
|
|
2132
|
-
debugLines:
|
|
2132
|
+
debugLines: G,
|
|
2133
2133
|
digitsOnly: M,
|
|
2134
2134
|
valid: R,
|
|
2135
2135
|
validComputed: te(d),
|
|
@@ -2139,7 +2139,7 @@ function qt(e) {
|
|
|
2139
2139
|
month1: te(r),
|
|
2140
2140
|
day1: te(s),
|
|
2141
2141
|
year1: te(T),
|
|
2142
|
-
month2: te(
|
|
2142
|
+
month2: te(N),
|
|
2143
2143
|
day2: te(U),
|
|
2144
2144
|
year2: te(Q),
|
|
2145
2145
|
handleChange: ne,
|
|
@@ -2156,7 +2156,7 @@ function qt(e) {
|
|
|
2156
2156
|
};
|
|
2157
2157
|
}
|
|
2158
2158
|
function Kt(e) {
|
|
2159
|
-
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(e.timeFormat ?? "hh:mm AM"), p = y(() => !!e.required), b = Y(!1), k = ["ArrowUp", "ArrowDown"], L = ["ArrowLeft", "ArrowRight"],
|
|
2159
|
+
const t = Y(""), a = Y(void 0), f = Y(!!e.debug), l = Y(e.timeFormat ?? "hh:mm AM"), p = y(() => !!e.required), b = Y(!1), k = ["ArrowUp", "ArrowDown"], L = ["ArrowLeft", "ArrowRight"], z = y(() => (t.value ?? "").replace(/\D/g, "")), M = {
|
|
2160
2160
|
H: /[0-9]/,
|
|
2161
2161
|
h: /[0-9]/,
|
|
2162
2162
|
M: /[0-9]/,
|
|
@@ -2175,22 +2175,22 @@ function Kt(e) {
|
|
|
2175
2175
|
}), c = y(() => g.value ? `${String(v.value).padStart(2, "0")}:${String(A.value).padStart(2, "0")}:00` : null), g = y(
|
|
2176
2176
|
() => /^(\d{2}):(\d{2})\s([AP]M)$/i.test(t.value ?? "")
|
|
2177
2177
|
), R = (r, s, T) => {
|
|
2178
|
-
let
|
|
2179
|
-
return
|
|
2178
|
+
let N = r % 12;
|
|
2179
|
+
return N === 0 && (N = 12), `${String(N).padStart(2, "0")}:${String(s).padStart(
|
|
2180
2180
|
2,
|
|
2181
2181
|
"0"
|
|
2182
2182
|
)} ${T}`;
|
|
2183
2183
|
}, q = (r) => {
|
|
2184
2184
|
const s = r.match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
2185
2185
|
if (!s) return null;
|
|
2186
|
-
const T = parseInt(s[1]),
|
|
2187
|
-
if (T < 1 || T > 12 ||
|
|
2186
|
+
const T = parseInt(s[1]), N = parseInt(s[2]), U = s[3].toUpperCase();
|
|
2187
|
+
if (T < 1 || T > 12 || N < 0 || N > 59) return null;
|
|
2188
2188
|
let Q = T % 12;
|
|
2189
2189
|
U === "PM" && (Q += 12);
|
|
2190
|
-
const
|
|
2191
|
-
return
|
|
2190
|
+
const G = /* @__PURE__ */ new Date();
|
|
2191
|
+
return G.setSeconds(0, 0), G.setHours(Q), G.setMinutes(N), G;
|
|
2192
2192
|
}, X = (r) => {
|
|
2193
|
-
if (
|
|
2193
|
+
if (z.value.length === 0) {
|
|
2194
2194
|
e.onChange({ value: null, event: r });
|
|
2195
2195
|
return;
|
|
2196
2196
|
}
|
|
@@ -2201,14 +2201,14 @@ function Kt(e) {
|
|
|
2201
2201
|
const s = q(t.value);
|
|
2202
2202
|
s && B(s) ? e.onChange({ value: s, event: r }) : e.onChange({ value: null, event: r });
|
|
2203
2203
|
}, W = (r) => r.getHours() * 60 + r.getMinutes(), B = (r) => {
|
|
2204
|
-
const s = e.min ?? void 0, T = e.max ?? void 0,
|
|
2204
|
+
const s = e.min ?? void 0, T = e.max ?? void 0, N = W(r);
|
|
2205
2205
|
if (s) {
|
|
2206
2206
|
const U = W(s);
|
|
2207
|
-
if (
|
|
2207
|
+
if (N < U) return !1;
|
|
2208
2208
|
}
|
|
2209
2209
|
if (T) {
|
|
2210
2210
|
const U = W(T);
|
|
2211
|
-
if (
|
|
2211
|
+
if (N > U) return !1;
|
|
2212
2212
|
}
|
|
2213
2213
|
return !0;
|
|
2214
2214
|
}, _ = (r) => {
|
|
@@ -2217,7 +2217,7 @@ function Kt(e) {
|
|
|
2217
2217
|
}, d = (r, s) => {
|
|
2218
2218
|
e.onChange({ value: r, event: s });
|
|
2219
2219
|
}, I = () => {
|
|
2220
|
-
|
|
2220
|
+
j(() => {
|
|
2221
2221
|
requestAnimationFrame(() => {
|
|
2222
2222
|
requestAnimationFrame(() => {
|
|
2223
2223
|
const r = document.getElementById(
|
|
@@ -2255,25 +2255,25 @@ function Kt(e) {
|
|
|
2255
2255
|
return;
|
|
2256
2256
|
}
|
|
2257
2257
|
t.value = s.value;
|
|
2258
|
-
const
|
|
2259
|
-
a.value =
|
|
2258
|
+
const N = s.event?.target;
|
|
2259
|
+
a.value = N?.selectionStart ?? 0;
|
|
2260
2260
|
try {
|
|
2261
2261
|
const U = a.value ?? 0;
|
|
2262
2262
|
if (C(U) === "ampm" && (t.value ?? "").length >= 8) {
|
|
2263
2263
|
const Q = t.value.charAt(6);
|
|
2264
|
-
/[Aa]/.test(Q) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`,
|
|
2264
|
+
/[Aa]/.test(Q) ? (t.value = `${t.value.slice(0, 6)}AM${t.value.slice(8)}`, j(() => {
|
|
2265
2265
|
requestAnimationFrame(() => {
|
|
2266
|
-
const
|
|
2266
|
+
const G = document.getElementById(
|
|
2267
2267
|
e.id
|
|
2268
2268
|
);
|
|
2269
|
-
|
|
2269
|
+
G && (G.focus(), G.setSelectionRange(8, 8));
|
|
2270
2270
|
});
|
|
2271
|
-
})) : /[Pp]/.test(Q) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`,
|
|
2271
|
+
})) : /[Pp]/.test(Q) && (t.value = `${t.value.slice(0, 6)}PM${t.value.slice(8)}`, j(() => {
|
|
2272
2272
|
requestAnimationFrame(() => {
|
|
2273
|
-
const
|
|
2273
|
+
const G = document.getElementById(
|
|
2274
2274
|
e.id
|
|
2275
2275
|
);
|
|
2276
|
-
|
|
2276
|
+
G && (G.focus(), G.setSelectionRange(8, 8));
|
|
2277
2277
|
});
|
|
2278
2278
|
}));
|
|
2279
2279
|
}
|
|
@@ -2283,15 +2283,15 @@ function Kt(e) {
|
|
|
2283
2283
|
}, D = (r) => {
|
|
2284
2284
|
a.value = r.target.selectionStart ?? 0;
|
|
2285
2285
|
}, P = (r, s, T) => {
|
|
2286
|
-
const
|
|
2287
|
-
a.value =
|
|
2288
|
-
const U = C(
|
|
2286
|
+
const N = s?.selectionStart ?? a.value ?? 0;
|
|
2287
|
+
a.value = N;
|
|
2288
|
+
const U = C(N), Q = (t.value ?? "").match(/^(\d{2}):(\d{2})\s([AP]M)$/i);
|
|
2289
2289
|
if (!Q) {
|
|
2290
|
-
if ((t.value ?? "").length === 0 ||
|
|
2290
|
+
if ((t.value ?? "").length === 0 || z.value.length === 0) {
|
|
2291
2291
|
const w = /* @__PURE__ */ new Date(), O = w.getHours(), H = O >= 12 ? "PM" : "AM";
|
|
2292
2292
|
t.value = R(O, w.getMinutes(), H);
|
|
2293
2293
|
const oe = q(t.value);
|
|
2294
|
-
E(oe, T),
|
|
2294
|
+
E(oe, T), j(() => {
|
|
2295
2295
|
requestAnimationFrame(() => {
|
|
2296
2296
|
const le = document.getElementById(
|
|
2297
2297
|
e.id
|
|
@@ -2302,9 +2302,9 @@ function Kt(e) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
return;
|
|
2304
2304
|
}
|
|
2305
|
-
let
|
|
2305
|
+
let G = parseInt(Q[1]), J = parseInt(Q[2]), ce = Q[3].toUpperCase();
|
|
2306
2306
|
if (U === "hh")
|
|
2307
|
-
r === "ArrowUp" ?
|
|
2307
|
+
r === "ArrowUp" ? G = G < 12 ? G + 1 : 1 : G = G > 1 ? G - 1 : 12;
|
|
2308
2308
|
else if (U === "mm") {
|
|
2309
2309
|
const w = e.minuteStepRef?.value ?? e.minuteStep ?? 1;
|
|
2310
2310
|
if (w === 1)
|
|
@@ -2319,12 +2319,12 @@ function Kt(e) {
|
|
|
2319
2319
|
H < 0 && (H = 60 - w), J = H;
|
|
2320
2320
|
}
|
|
2321
2321
|
} else U === "ampm" && (ce = ce === "AM" ? "PM" : "AM");
|
|
2322
|
-
t.value = `${String(
|
|
2322
|
+
t.value = `${String(G).padStart(2, "0")}:${String(J).padStart(
|
|
2323
2323
|
2,
|
|
2324
2324
|
"0"
|
|
2325
2325
|
)} ${ce}`;
|
|
2326
2326
|
const i = q(t.value);
|
|
2327
|
-
E(i, T),
|
|
2327
|
+
E(i, T), j(() => {
|
|
2328
2328
|
requestAnimationFrame(() => {
|
|
2329
2329
|
const w = document.getElementById(
|
|
2330
2330
|
e.id
|
|
@@ -2363,7 +2363,7 @@ function Kt(e) {
|
|
|
2363
2363
|
a.value = s?.selectionStart ?? 0;
|
|
2364
2364
|
}
|
|
2365
2365
|
}, se = (r) => {
|
|
2366
|
-
b.value = !0, p.value && e.externalValue && e.externalValue.value === void 0 &&
|
|
2366
|
+
b.value = !0, p.value && e.externalValue && e.externalValue.value === void 0 && z.value.length === 0 && (e.externalValue.value = "");
|
|
2367
2367
|
const s = r.target;
|
|
2368
2368
|
s && (a.value = s.selectionStart ?? 0);
|
|
2369
2369
|
};
|
|
@@ -2373,8 +2373,8 @@ function Kt(e) {
|
|
|
2373
2373
|
if (r) {
|
|
2374
2374
|
const s = new Date(r);
|
|
2375
2375
|
if (s.toString() !== "Invalid Date") {
|
|
2376
|
-
const T = s.getHours(),
|
|
2377
|
-
t.value = R(T, s.getMinutes(),
|
|
2376
|
+
const T = s.getHours(), N = T >= 12 ? "PM" : "AM";
|
|
2377
|
+
t.value = R(T, s.getMinutes(), N);
|
|
2378
2378
|
return;
|
|
2379
2379
|
}
|
|
2380
2380
|
}
|
|
@@ -2388,7 +2388,7 @@ function Kt(e) {
|
|
|
2388
2388
|
["Minute", A.value],
|
|
2389
2389
|
["Period", V.value],
|
|
2390
2390
|
["Time (24h)", c.value ?? "--:--:--"],
|
|
2391
|
-
["Digits only",
|
|
2391
|
+
["Digits only", z.value],
|
|
2392
2392
|
[
|
|
2393
2393
|
"Parsed Date",
|
|
2394
2394
|
o.value?.toLocaleDateString("en-US", {
|
|
@@ -2431,7 +2431,7 @@ function Kt(e) {
|
|
|
2431
2431
|
return s ? B(s) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
2432
2432
|
}
|
|
2433
2433
|
if (!b.value) return;
|
|
2434
|
-
if (
|
|
2434
|
+
if (z.value.length === 0 || !g.value)
|
|
2435
2435
|
return "incomplete";
|
|
2436
2436
|
const r = o.value;
|
|
2437
2437
|
return r ? B(r) ? "valid" : "out-of-bounds" : "invalid-time";
|
|
@@ -2445,15 +2445,15 @@ function Kt(e) {
|
|
|
2445
2445
|
const s = {
|
|
2446
2446
|
hour: "2-digit",
|
|
2447
2447
|
minute: "2-digit"
|
|
2448
|
-
}, T = e.min ? e.min.toLocaleTimeString("en-US", s) : null,
|
|
2448
|
+
}, T = e.min ? e.min.toLocaleTimeString("en-US", s) : null, N = e.max ? e.max.toLocaleTimeString("en-US", s) : null;
|
|
2449
2449
|
if (r === "out-of-bounds") {
|
|
2450
|
-
if (T &&
|
|
2450
|
+
if (T && N) return `Must be between ${T} and ${N}.`;
|
|
2451
2451
|
if (T) return `Must be ${T} or later.`;
|
|
2452
|
-
if (
|
|
2452
|
+
if (N) return `Must be ${N} or earlier.`;
|
|
2453
2453
|
}
|
|
2454
2454
|
return "";
|
|
2455
2455
|
}), $ = () => {
|
|
2456
|
-
|
|
2456
|
+
j(() => {
|
|
2457
2457
|
const r = document.getElementById(e.id);
|
|
2458
2458
|
if (!r) {
|
|
2459
2459
|
console.warn(`#${e.id} not found for styling.`);
|
|
@@ -2507,12 +2507,15 @@ function Kt(e) {
|
|
|
2507
2507
|
};
|
|
2508
2508
|
}
|
|
2509
2509
|
const Ut = {
|
|
2510
|
+
outsideClick: !1,
|
|
2510
2511
|
returnFocusToTrigger: !1,
|
|
2511
2512
|
focusTrapOptions: {
|
|
2512
2513
|
returnFocusOnDeactivate: !1
|
|
2513
2514
|
}
|
|
2515
|
+
}, Yt = {
|
|
2516
|
+
outsideClick: !1
|
|
2514
2517
|
};
|
|
2515
|
-
function
|
|
2518
|
+
function Bt(e) {
|
|
2516
2519
|
const t = ve(null), a = [
|
|
2517
2520
|
".k-animation-container .k-popup",
|
|
2518
2521
|
".k-popup",
|
|
@@ -2520,7 +2523,7 @@ function Yt(e) {
|
|
|
2520
2523
|
".k-menu-popup"
|
|
2521
2524
|
], f = Array.isArray(e.popupSelector) ? e.popupSelector : [e.popupSelector ?? a].flat(), l = (M) => M ? typeof e.initialFocus == "string" ? M.querySelector(e.initialFocus) ?? M : typeof e.initialFocus == "function" ? e.initialFocus(M) ?? M : M.querySelector(
|
|
2522
2525
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
2523
|
-
) ?? M : null, { activate: p, deactivate: b } =
|
|
2526
|
+
) ?? M : null, { activate: p, deactivate: b } = Ge(t, {
|
|
2524
2527
|
escapeDeactivates: !1,
|
|
2525
2528
|
clickOutsideDeactivates: !1,
|
|
2526
2529
|
// Without this, focus-trap's own default (false) preventDefault()s and
|
|
@@ -2533,7 +2536,7 @@ function Yt(e) {
|
|
|
2533
2536
|
...e.focusTrapOptions ?? {}
|
|
2534
2537
|
});
|
|
2535
2538
|
let k = null, L = Y(null);
|
|
2536
|
-
const
|
|
2539
|
+
const z = () => {
|
|
2537
2540
|
if (e.resolvePopupEl) return e.resolvePopupEl();
|
|
2538
2541
|
const M = (x, A) => {
|
|
2539
2542
|
const V = Array.from(x.querySelectorAll(A));
|
|
@@ -2553,13 +2556,17 @@ function Yt(e) {
|
|
|
2553
2556
|
}
|
|
2554
2557
|
return null;
|
|
2555
2558
|
};
|
|
2556
|
-
return
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
+
return e.outsideClick !== !1 && Be(
|
|
2560
|
+
t,
|
|
2561
|
+
(M) => {
|
|
2562
|
+
e.isOpen.value && (L.value = "outside", e.onRequestClose?.("outside", M));
|
|
2563
|
+
},
|
|
2564
|
+
e.outsideClick
|
|
2565
|
+
), ae(
|
|
2559
2566
|
() => e.isOpen.value,
|
|
2560
2567
|
(M) => {
|
|
2561
|
-
M ? (L.value = null,
|
|
2562
|
-
const C =
|
|
2568
|
+
M ? (L.value = null, j(() => {
|
|
2569
|
+
const C = z();
|
|
2563
2570
|
C && (C.tabIndex < 0 && (C.tabIndex = -1), t.value = C, setTimeout(() => {
|
|
2564
2571
|
try {
|
|
2565
2572
|
p();
|
|
@@ -2572,13 +2579,13 @@ function Yt(e) {
|
|
|
2572
2579
|
}, 0), k || (k = (x) => {
|
|
2573
2580
|
x.key === "Escape" && (L.value = "escape", e.isOpen.value && e.onRequestClose?.("escape", x));
|
|
2574
2581
|
}, document.addEventListener("keydown", k, !0)));
|
|
2575
|
-
})) : (b(), k && (document.removeEventListener("keydown", k, !0), k = null), t.value = null, L.value === "outside" &&
|
|
2582
|
+
})) : (b(), k && (document.removeEventListener("keydown", k, !0), k = null), t.value = null, L.value === "outside" && j(() => {
|
|
2576
2583
|
const C = () => {
|
|
2577
2584
|
const x = e.triggerEl?.value, A = x?.querySelector("input"), V = document.activeElement;
|
|
2578
2585
|
V && (V === A || x && x.contains(V)) && (A ?? x)?.blur?.();
|
|
2579
2586
|
};
|
|
2580
2587
|
requestAnimationFrame(() => setTimeout(C, 0));
|
|
2581
|
-
}), e.returnFocusToTrigger !== !1 && L.value === "escape" && e.triggerEl?.value &&
|
|
2588
|
+
}), e.returnFocusToTrigger !== !1 && L.value === "escape" && e.triggerEl?.value && j(() => {
|
|
2582
2589
|
const C = () => {
|
|
2583
2590
|
const x = e.triggerEl?.value;
|
|
2584
2591
|
if (!x) return;
|
|
@@ -2596,8 +2603,9 @@ function Yt(e) {
|
|
|
2596
2603
|
};
|
|
2597
2604
|
}
|
|
2598
2605
|
export {
|
|
2606
|
+
Yt as DIALOG_TRAP_OPTIONS,
|
|
2599
2607
|
Ut as POPUP_MENU_TRAP_OPTIONS,
|
|
2600
|
-
|
|
2608
|
+
ze as WINDOW_SETTINGS_DEFAULTS,
|
|
2601
2609
|
ft as computeCollisionOffset,
|
|
2602
2610
|
Vt as useActiveIdRegistry,
|
|
2603
2611
|
Pt as useCompositeId,
|
|
@@ -2608,13 +2616,13 @@ export {
|
|
|
2608
2616
|
Rt as useGridActiveFilter,
|
|
2609
2617
|
Ft as useGridRowAction,
|
|
2610
2618
|
gt as useIntersectionObserver,
|
|
2611
|
-
|
|
2619
|
+
zt as useMaskedDateInput,
|
|
2612
2620
|
qt as useMaskedDateRangeInput,
|
|
2613
2621
|
Kt as useMaskedTimeInput,
|
|
2614
2622
|
$t as usePopupMenu,
|
|
2615
|
-
|
|
2623
|
+
Bt as usePopupTrap,
|
|
2616
2624
|
Lt as useUSAddress,
|
|
2617
|
-
|
|
2625
|
+
Nt as useWindow,
|
|
2618
2626
|
rt as useZipTextBox
|
|
2619
2627
|
};
|
|
2620
2628
|
//# sourceMappingURL=featherk-composables.es.js.map
|