manolis-ui 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manolis-ui.js +251 -255
- package/dist/manolis-ui.umd.cjs +4 -4
- package/package.json +1 -1
package/dist/manolis-ui.js
CHANGED
|
@@ -578,36 +578,36 @@ const gn = be("SunIcon", [
|
|
|
578
578
|
o.value ? s.value = o.value.children.length : s.value = 0;
|
|
579
579
|
}, c = async (S) => {
|
|
580
580
|
if (!o.value || n.slidesPerView <= 0 || l.value || (i(), s.value === 0)) return;
|
|
581
|
-
const D = (S % s.value + s.value) % s.value,
|
|
581
|
+
const D = (S % s.value + s.value) % s.value, x = o.value, C = n.sliderOrientation === "vertical" ? (x.offsetHeight - (n.slidesPerView - 1) * n.gap) / n.slidesPerView : (x.offsetWidth - (n.slidesPerView - 1) * n.gap) / n.slidesPerView;
|
|
582
582
|
if (C <= 0) return;
|
|
583
|
-
const z = C + n.gap, j = D * z, H = n.sliderOrientation === "vertical" ?
|
|
584
|
-
l.value = !0,
|
|
585
|
-
const h = n.sliderOrientation === "vertical" ?
|
|
586
|
-
if (Math.abs(
|
|
583
|
+
const z = C + n.gap, j = D * z, H = n.sliderOrientation === "vertical" ? x.scrollHeight - x.offsetHeight : x.scrollWidth - x.offsetWidth, v = Math.max(0, Math.min(j, H + 0.5));
|
|
584
|
+
l.value = !0, x.style.scrollBehavior = "auto";
|
|
585
|
+
const h = n.sliderOrientation === "vertical" ? x.scrollTop : x.scrollLeft, g = v - h;
|
|
586
|
+
if (Math.abs(g) < 1) {
|
|
587
587
|
l.value = !1, a.value = D;
|
|
588
588
|
return;
|
|
589
589
|
}
|
|
590
|
-
const T = performance.now(), r = (
|
|
591
|
-
const $ =
|
|
592
|
-
n.sliderOrientation === "vertical" ?
|
|
590
|
+
const T = performance.now(), r = (k) => {
|
|
591
|
+
const $ = k - T, I = Math.min(1, $ / n.slideDuration), P = I < 0.5 ? 4 * I * I * I : 1 - Math.pow(-2 * I + 2, 3) / 2, q = h + g * P;
|
|
592
|
+
n.sliderOrientation === "vertical" ? x.scrollTop = q : x.scrollLeft = q, I < 1 ? requestAnimationFrame(r) : (n.sliderOrientation === "vertical" ? x.scrollTop = v : x.scrollLeft = v, a.value = D, l.value = !1);
|
|
593
593
|
};
|
|
594
594
|
requestAnimationFrame(r);
|
|
595
595
|
}, m = () => {
|
|
596
596
|
c(a.value + 1);
|
|
597
597
|
}, w = () => {
|
|
598
598
|
c(a.value - 1);
|
|
599
|
-
},
|
|
599
|
+
}, y = (S) => {
|
|
600
600
|
c(S);
|
|
601
|
-
},
|
|
601
|
+
}, b = () => {
|
|
602
602
|
if (!o.value || n.slidesPerView <= 0 || (i(), s.value === 0)) return;
|
|
603
|
-
const S = o.value, D = n.sliderOrientation === "vertical" ? S.offsetHeight : S.offsetWidth,
|
|
603
|
+
const S = o.value, D = n.sliderOrientation === "vertical" ? S.offsetHeight : S.offsetWidth, x = n.slidesPerView > 1 ? (n.slidesPerView - 1) * n.gap : 0, C = (D - x) / n.slidesPerView;
|
|
604
604
|
if (C <= 0) return;
|
|
605
605
|
const z = Math.max(0, s.value - n.slidesPerView), j = Math.min(Math.max(0, n.initialSlide), z), H = j * (C + n.gap), v = n.sliderOrientation === "vertical" ? S.scrollHeight - S.offsetHeight : S.scrollWidth - S.offsetWidth, h = Math.max(0, Math.min(H, v + 0.5));
|
|
606
606
|
n.sliderOrientation === "vertical" ? S.scrollTo({ top: h, behavior: "auto" }) : S.scrollTo({ left: h, behavior: "auto" }), a.value = j;
|
|
607
607
|
};
|
|
608
608
|
return ue(() => {
|
|
609
609
|
requestAnimationFrame(() => {
|
|
610
|
-
requestAnimationFrame(
|
|
610
|
+
requestAnimationFrame(b);
|
|
611
611
|
}), i();
|
|
612
612
|
}), R(() => n.initialSlide, (S) => {
|
|
613
613
|
requestAnimationFrame(() => c(S));
|
|
@@ -615,8 +615,8 @@ const gn = be("SunIcon", [
|
|
|
615
615
|
requestAnimationFrame(() => {
|
|
616
616
|
requestAnimationFrame(() => {
|
|
617
617
|
if (i(), s.value === 0) return;
|
|
618
|
-
const S = Math.max(0, s.value - n.slidesPerView), D = Math.min(a.value, S),
|
|
619
|
-
n.slideDuration = 0, c(D), n.slideDuration =
|
|
618
|
+
const S = Math.max(0, s.value - n.slidesPerView), D = Math.min(a.value, S), x = n.slideDuration;
|
|
619
|
+
n.slideDuration = 0, c(D), n.slideDuration = x;
|
|
620
620
|
});
|
|
621
621
|
});
|
|
622
622
|
}), t({ scrollToSlide: c }), (S, D) => (f(), p("div", zn, [
|
|
@@ -655,9 +655,9 @@ const gn = be("SunIcon", [
|
|
|
655
655
|
])
|
|
656
656
|
])) : E("", !0),
|
|
657
657
|
e.showIndicators ? (f(), p("div", On, [
|
|
658
|
-
(f(!0), p(U, null, F(s.value, (
|
|
658
|
+
(f(!0), p(U, null, F(s.value, (x, C) => (f(), p("button", {
|
|
659
659
|
key: `dot-${C}`,
|
|
660
|
-
onClick: (z) =>
|
|
660
|
+
onClick: (z) => y(C),
|
|
661
661
|
class: B(["btn btn-circle btn-xs", { "btn-active": C === a.value }]),
|
|
662
662
|
"aria-label": `Go to slide ${C + 1}`
|
|
663
663
|
}, null, 10, Nn))), 128))
|
|
@@ -728,16 +728,16 @@ const gn = be("SunIcon", [
|
|
|
728
728
|
case "datetime":
|
|
729
729
|
if (typeof v.value == "string")
|
|
730
730
|
try {
|
|
731
|
-
const
|
|
732
|
-
if (!isNaN(
|
|
733
|
-
return
|
|
731
|
+
const g = new Date(v.value);
|
|
732
|
+
if (!isNaN(g.getTime()))
|
|
733
|
+
return g.toLocaleString();
|
|
734
734
|
} catch {
|
|
735
735
|
}
|
|
736
736
|
else if (v.range && typeof v.value == "object" && v.value !== null && "start" in v.value && "end" in v.value)
|
|
737
737
|
try {
|
|
738
|
-
const
|
|
739
|
-
if (!isNaN(
|
|
740
|
-
return `${
|
|
738
|
+
const g = new Date(v.value.start), T = new Date(v.value.end);
|
|
739
|
+
if (!isNaN(g.getTime()) && !isNaN(T.getTime()))
|
|
740
|
+
return `${g.toLocaleDateString()} - ${T.toLocaleDateString()}`;
|
|
741
741
|
} catch {
|
|
742
742
|
}
|
|
743
743
|
break;
|
|
@@ -752,11 +752,11 @@ const gn = be("SunIcon", [
|
|
|
752
752
|
case "standard-select":
|
|
753
753
|
case "custom-select":
|
|
754
754
|
if ((h = v.props) != null && h.options && Array.isArray(v.props.options)) {
|
|
755
|
-
const
|
|
755
|
+
const g = v.props.options.find(
|
|
756
756
|
(T) => T.value === v.value
|
|
757
757
|
);
|
|
758
|
-
if (
|
|
759
|
-
return
|
|
758
|
+
if (g)
|
|
759
|
+
return g.text;
|
|
760
760
|
}
|
|
761
761
|
return String(v.value);
|
|
762
762
|
case "custom-text":
|
|
@@ -766,16 +766,16 @@ const gn = be("SunIcon", [
|
|
|
766
766
|
}
|
|
767
767
|
return String(v.value);
|
|
768
768
|
};
|
|
769
|
-
function
|
|
770
|
-
var r,
|
|
769
|
+
function y(v) {
|
|
770
|
+
var r, k;
|
|
771
771
|
const h = (r = l.value) == null ? void 0 : r.name;
|
|
772
772
|
if (!h) {
|
|
773
773
|
console.warn("componentValueUpdated called but no active tab.");
|
|
774
774
|
return;
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const g = (k = n.searchOptions.find(
|
|
777
777
|
($) => ($ == null ? void 0 : $.category) === n.currentCategory
|
|
778
|
-
)) == null ? void 0 :
|
|
778
|
+
)) == null ? void 0 : k.tabs, T = g == null ? void 0 : g.find(
|
|
779
779
|
($) => $.name === h
|
|
780
780
|
);
|
|
781
781
|
T ? (T.value = v, a("update:search-data", {
|
|
@@ -785,18 +785,18 @@ const gn = be("SunIcon", [
|
|
|
785
785
|
`Tab with name "${h}" not found in current category.`
|
|
786
786
|
);
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
|
|
788
|
+
function b(v) {
|
|
789
|
+
y(v);
|
|
790
790
|
}
|
|
791
791
|
function S() {
|
|
792
792
|
a("search");
|
|
793
793
|
}
|
|
794
794
|
async function D(v) {
|
|
795
795
|
var T;
|
|
796
|
-
const h = document.getElementById(`advancedSearchMobile-${o}`),
|
|
797
|
-
((T = l.value) == null ? void 0 : T.displayMode) === "popup" && m.value && !m.value.contains(v.target) && !
|
|
796
|
+
const h = document.getElementById(`advancedSearchMobile-${o}`), g = h && h.contains(v.target);
|
|
797
|
+
((T = l.value) == null ? void 0 : T.displayMode) === "popup" && m.value && !m.value.contains(v.target) && !g && (await Pe(), l.value = null);
|
|
798
798
|
}
|
|
799
|
-
async function
|
|
799
|
+
async function x() {
|
|
800
800
|
if (typeof window < "u" && window.innerWidth <= 768) {
|
|
801
801
|
const v = document.getElementById(
|
|
802
802
|
`advancedSearchMobile-${o}`
|
|
@@ -807,18 +807,18 @@ const gn = be("SunIcon", [
|
|
|
807
807
|
}
|
|
808
808
|
}
|
|
809
809
|
async function C(v) {
|
|
810
|
-
var
|
|
810
|
+
var g, T, r;
|
|
811
811
|
if (typeof window < "u" && window.innerWidth <= 768) {
|
|
812
|
-
|
|
812
|
+
x();
|
|
813
813
|
return;
|
|
814
814
|
}
|
|
815
815
|
const h = v.displayMode ?? "popup";
|
|
816
|
-
if (((
|
|
816
|
+
if (((g = l.value) == null ? void 0 : g.name) === v.name && ((T = l.value) == null ? void 0 : T.displayMode) === h)
|
|
817
817
|
l.value = null;
|
|
818
818
|
else if (l.value = { ...v, displayMode: h }, await Pe(), ((r = l.value) == null ? void 0 : r.displayMode) === "popup") {
|
|
819
|
-
const
|
|
820
|
-
if (
|
|
821
|
-
const $ =
|
|
819
|
+
const k = i.value[v.name];
|
|
820
|
+
if (k && m.value) {
|
|
821
|
+
const $ = k.getBoundingClientRect(), I = m.value.getBoundingClientRect(), P = $.bottom - I.top, q = $.left + $.width / 2 - I.left;
|
|
822
822
|
c.value = {
|
|
823
823
|
left: `${q}px`,
|
|
824
824
|
top: `${P + 8}px`,
|
|
@@ -836,8 +836,8 @@ const gn = be("SunIcon", [
|
|
|
836
836
|
const z = (v) => {
|
|
837
837
|
const h = v.relatedTarget;
|
|
838
838
|
setTimeout(() => {
|
|
839
|
-
var
|
|
840
|
-
((
|
|
839
|
+
var g;
|
|
840
|
+
((g = l.value) == null ? void 0 : g.displayMode) === "inline" && m.value && (!h || !m.value.contains(h)) ? (console.log("Blur detected outside container, closing inline view."), l.value = null) : console.log(
|
|
841
841
|
"Blur detected, but staying within container or not an inline tab."
|
|
842
842
|
);
|
|
843
843
|
}, 50);
|
|
@@ -874,18 +874,18 @@ const gn = be("SunIcon", [
|
|
|
874
874
|
const H = () => {
|
|
875
875
|
var v, h;
|
|
876
876
|
if (typeof window < "u") {
|
|
877
|
-
const
|
|
878
|
-
!
|
|
877
|
+
const g = window.innerWidth <= 768, T = l.value !== null && (l.value.displayMode === "popup" || l.value.displayMode === "inline") && window.innerWidth > 768;
|
|
878
|
+
!g && (((v = l.value) == null ? void 0 : v.displayMode) === "popup" || ((h = l.value) == null ? void 0 : h.displayMode) === "inline") && window.innerWidth <= 768 && (console.log("Resizing to mobile, closing active tab."), l.value = null), g && !T && l.value !== null && (console.log(
|
|
879
879
|
"Resizing to desktop from potential mobile active state, closing active tab."
|
|
880
880
|
), l.value = null);
|
|
881
881
|
const r = document.getElementById(
|
|
882
882
|
`advancedSearchMobile-${o}`
|
|
883
883
|
);
|
|
884
|
-
r != null && r.open && !
|
|
884
|
+
r != null && r.open && !g && (console.log("Modal is open on desktop, closing modal and active tab."), r.close(), l.value = null);
|
|
885
885
|
}
|
|
886
886
|
};
|
|
887
887
|
return (v, h) => {
|
|
888
|
-
var
|
|
888
|
+
var g, T;
|
|
889
889
|
return f(), p(U, null, [
|
|
890
890
|
d("div", {
|
|
891
891
|
ref_key: "searchContainer",
|
|
@@ -894,15 +894,15 @@ const gn = be("SunIcon", [
|
|
|
894
894
|
}, [
|
|
895
895
|
d("div", {
|
|
896
896
|
class: "group/search relative flex place-items-center shadow-md p-2 border-2 border-base-300/25 rounded-sm w-full transition-all cursor-pointer md:cursor-auto",
|
|
897
|
-
onClick:
|
|
897
|
+
onClick: x
|
|
898
898
|
}, [
|
|
899
899
|
d("div", Un, [
|
|
900
|
-
(f(!0), p(U, null, F(((
|
|
900
|
+
(f(!0), p(U, null, F(((g = n.searchOptions.find(
|
|
901
901
|
(r) => r.category === n.currentCategory
|
|
902
|
-
)) == null ? void 0 :
|
|
902
|
+
)) == null ? void 0 : g.tabs) || [], (r, k) => {
|
|
903
903
|
var $, I, P, q, Q;
|
|
904
904
|
return f(), p("button", {
|
|
905
|
-
key: `${r.name}-${
|
|
905
|
+
key: `${r.name}-${k}`,
|
|
906
906
|
onClick: te((Y) => C(r), ["stop"]),
|
|
907
907
|
class: B([{
|
|
908
908
|
"tab-active": (($ = l.value) == null ? void 0 : $.name) === r.name,
|
|
@@ -915,8 +915,8 @@ const gn = be("SunIcon", [
|
|
|
915
915
|
((q = l.value) == null ? void 0 : q.name) === r.name && ((Q = l.value) == null ? void 0 : Q.displayMode) === "inline" ? (f(), p("div", Fn, [
|
|
916
916
|
(f(), ae(Oe(u[l.value.type]), Ne({ ref_for: !0 }, l.value.props || {}, {
|
|
917
917
|
modelValue: l.value.value,
|
|
918
|
-
onUpdated: h[0] || (h[0] = (Y) =>
|
|
919
|
-
"onUpdate:modelValue": h[1] || (h[1] = (Y) =>
|
|
918
|
+
onUpdated: h[0] || (h[0] = (Y) => b(Y)),
|
|
919
|
+
"onUpdate:modelValue": h[1] || (h[1] = (Y) => b(Y)),
|
|
920
920
|
onBlur: z,
|
|
921
921
|
onKeydown: We(te(j, ["stop", "prevent"]), ["enter"]),
|
|
922
922
|
ref_for: !0,
|
|
@@ -937,8 +937,8 @@ const gn = be("SunIcon", [
|
|
|
937
937
|
}, [
|
|
938
938
|
(f(), ae(Oe(u[l.value.type]), Ne(l.value.props || {}, {
|
|
939
939
|
modelValue: l.value.value,
|
|
940
|
-
onUpdated: h[2] || (h[2] = (r) =>
|
|
941
|
-
"onUpdate:modelValue": h[3] || (h[3] = (r) =>
|
|
940
|
+
onUpdated: h[2] || (h[2] = (r) => y(r)),
|
|
941
|
+
"onUpdate:modelValue": h[3] || (h[3] = (r) => y(r))
|
|
942
942
|
}), null, 16, ["modelValue"]))
|
|
943
943
|
], 4)) : E("", !0),
|
|
944
944
|
d("button", {
|
|
@@ -976,14 +976,14 @@ const gn = be("SunIcon", [
|
|
|
976
976
|
], !0),
|
|
977
977
|
(f(!0), p(U, null, F(((T = n.searchOptions.find(
|
|
978
978
|
(r) => r.category === n.currentCategory
|
|
979
|
-
)) == null ? void 0 : T.tabs) || [], (r,
|
|
979
|
+
)) == null ? void 0 : T.tabs) || [], (r, k) => (f(), p("div", {
|
|
980
980
|
class: "collapse bg-base-200 my-4",
|
|
981
981
|
key: r.name
|
|
982
982
|
}, [
|
|
983
983
|
d("input", {
|
|
984
984
|
type: "radio",
|
|
985
985
|
name: `accordion-${Z(o)}`,
|
|
986
|
-
checked:
|
|
986
|
+
checked: k === 0
|
|
987
987
|
}, null, 8, Jn),
|
|
988
988
|
d("div", Xn, [
|
|
989
989
|
d("div", null, O(r.name), 1),
|
|
@@ -993,8 +993,8 @@ const gn = be("SunIcon", [
|
|
|
993
993
|
h[7] || (h[7] = d("br", null, null, -1)),
|
|
994
994
|
(f(), ae(Oe(u[r.type]), Ne({ ref_for: !0 }, r.props || {}, {
|
|
995
995
|
modelValue: r.value,
|
|
996
|
-
onUpdated: h[5] || (h[5] = ($) =>
|
|
997
|
-
"onUpdate:modelValue": h[6] || (h[6] = ($) =>
|
|
996
|
+
onUpdated: h[5] || (h[5] = ($) => y($)),
|
|
997
|
+
"onUpdate:modelValue": h[6] || (h[6] = ($) => y($))
|
|
998
998
|
}), null, 16, ["modelValue"]))
|
|
999
999
|
])
|
|
1000
1000
|
]))), 128)),
|
|
@@ -1137,12 +1137,12 @@ function da(e, t, n, a, o) {
|
|
|
1137
1137
|
* @this {import("dom").AtomicoThisInternal}
|
|
1138
1138
|
* @param {any} newValue
|
|
1139
1139
|
*/
|
|
1140
|
-
set(
|
|
1141
|
-
const
|
|
1142
|
-
w && l != Boolean &&
|
|
1140
|
+
set(y) {
|
|
1141
|
+
const b = this[t];
|
|
1142
|
+
w && l != Boolean && y == null && (y = w());
|
|
1143
1143
|
const { error: S, value: D } = (m ? ha : va)(
|
|
1144
1144
|
l,
|
|
1145
|
-
|
|
1145
|
+
y
|
|
1146
1146
|
);
|
|
1147
1147
|
if (S && D != null)
|
|
1148
1148
|
throw new At(
|
|
@@ -1150,7 +1150,7 @@ function da(e, t, n, a, o) {
|
|
|
1150
1150
|
`The value defined for prop '${t}' must be of type '${l.name}'`,
|
|
1151
1151
|
D
|
|
1152
1152
|
);
|
|
1153
|
-
|
|
1153
|
+
b != D && (this._props[t] = D ?? void 0, this.update(), u && Lt(this, u), this.updated.then(() => {
|
|
1154
1154
|
s && (this._ignoreAttr = c, ma(this, l, c, this[t]), this._ignoreAttr = null);
|
|
1155
1155
|
}));
|
|
1156
1156
|
},
|
|
@@ -1208,35 +1208,35 @@ const ya = (e) => {
|
|
|
1208
1208
|
this._props = {};
|
|
1209
1209
|
let m, w;
|
|
1210
1210
|
this.mounted = new Promise(
|
|
1211
|
-
(
|
|
1212
|
-
|
|
1211
|
+
(x) => this.mount = () => {
|
|
1212
|
+
x(), m != this.parentNode && (w != m ? this.unmounted.then(this.update) : this.update()), m = this.parentNode;
|
|
1213
1213
|
}
|
|
1214
1214
|
), this.unmounted = new Promise(
|
|
1215
|
-
(
|
|
1216
|
-
|
|
1215
|
+
(x) => this.unmount = () => {
|
|
1216
|
+
x(), (m != this.parentNode || !this.isConnected) && (y.cleanEffects(!0)()(), w = this.parentNode, m = null);
|
|
1217
1217
|
}
|
|
1218
1218
|
), this.symbolId = this.symbolId || Symbol(), this.symbolIdParent = Symbol();
|
|
1219
|
-
const
|
|
1219
|
+
const y = sa(
|
|
1220
1220
|
() => this.update(),
|
|
1221
1221
|
this,
|
|
1222
1222
|
ya(this)
|
|
1223
1223
|
);
|
|
1224
|
-
let
|
|
1224
|
+
let b, S = !0;
|
|
1225
1225
|
const D = Ke(this);
|
|
1226
|
-
this.update = () => (
|
|
1226
|
+
this.update = () => (b || (b = !0, this.updated = (this.updated || this.mounted).then(() => {
|
|
1227
1227
|
try {
|
|
1228
|
-
const
|
|
1229
|
-
return
|
|
1230
|
-
|
|
1228
|
+
const x = y.load(this._render), C = y.cleanEffects();
|
|
1229
|
+
return x && //@ts-ignore
|
|
1230
|
+
x.render(this, this.symbolId, D), b = !1, S && !y.isSuspense() && (S = !1, !D && ba(this)), C();
|
|
1231
1231
|
} finally {
|
|
1232
|
-
|
|
1232
|
+
b = !1;
|
|
1233
1233
|
}
|
|
1234
1234
|
}).then(
|
|
1235
1235
|
/**
|
|
1236
1236
|
* @param {import("internal/hooks.js").CleanUseEffects} [cleanUseEffect]
|
|
1237
1237
|
*/
|
|
1238
|
-
(
|
|
1239
|
-
|
|
1238
|
+
(x) => {
|
|
1239
|
+
x && x();
|
|
1240
1240
|
}
|
|
1241
1241
|
)), this.updated), this.update();
|
|
1242
1242
|
}
|
|
@@ -1252,22 +1252,22 @@ const ya = (e) => {
|
|
|
1252
1252
|
* @param {(string|null)} oldValue
|
|
1253
1253
|
* @param {(string|null)} value
|
|
1254
1254
|
*/
|
|
1255
|
-
attributeChangedCallback(m, w,
|
|
1255
|
+
attributeChangedCallback(m, w, y) {
|
|
1256
1256
|
if (n[m]) {
|
|
1257
|
-
if (m === this._ignoreAttr || w ===
|
|
1257
|
+
if (m === this._ignoreAttr || w === y)
|
|
1258
1258
|
return;
|
|
1259
|
-
const { prop:
|
|
1259
|
+
const { prop: b, type: S } = n[m];
|
|
1260
1260
|
try {
|
|
1261
|
-
this[
|
|
1261
|
+
this[b] = pa(S, y);
|
|
1262
1262
|
} catch {
|
|
1263
1263
|
throw new ra(
|
|
1264
1264
|
this,
|
|
1265
1265
|
`The value defined as attr '${m}' cannot be parsed by type '${S.name}'`,
|
|
1266
|
-
|
|
1266
|
+
y
|
|
1267
1267
|
);
|
|
1268
1268
|
}
|
|
1269
1269
|
} else
|
|
1270
|
-
super.attributeChangedCallback(m, w,
|
|
1270
|
+
super.attributeChangedCallback(m, w, y);
|
|
1271
1271
|
}
|
|
1272
1272
|
static get props() {
|
|
1273
1273
|
return { ...super.props, ...s };
|
|
@@ -1443,19 +1443,19 @@ function Ht(e, t, n = Sa, a, o) {
|
|
|
1443
1443
|
)));
|
|
1444
1444
|
const s = t[n] ? t[n] : Se, { vnode: u = Se, cycle: i = 0 } = s;
|
|
1445
1445
|
let { fragment: c, handlers: m } = s;
|
|
1446
|
-
const { children: w = Je, props:
|
|
1446
|
+
const { children: w = Je, props: y = Se } = u;
|
|
1447
1447
|
if (m = l ? {} : m || {}, e.static && !l)
|
|
1448
1448
|
return t;
|
|
1449
1449
|
if (e.shadow && !t.shadowRoot && // @ts-ignore
|
|
1450
|
-
t.attachShadow({ mode: "open", ...e.shadow }), e.props !=
|
|
1451
|
-
const
|
|
1450
|
+
t.attachShadow({ mode: "open", ...e.shadow }), e.props != y && Ia(t, y, e.props, m, o), e.children !== w) {
|
|
1451
|
+
const b = e.shadow ? t.shadowRoot : t;
|
|
1452
1452
|
c = Ma(
|
|
1453
1453
|
e.children,
|
|
1454
1454
|
/**
|
|
1455
1455
|
* @todo for hydration use attribute and send childNodes
|
|
1456
1456
|
*/
|
|
1457
1457
|
c,
|
|
1458
|
-
|
|
1458
|
+
b,
|
|
1459
1459
|
n,
|
|
1460
1460
|
// add support to foreignObject, children will escape from svg
|
|
1461
1461
|
!i && a,
|
|
@@ -1488,27 +1488,27 @@ function Ma(e, t, n, a, o, l) {
|
|
|
1488
1488
|
const s = t || Ta(n, o), { markStart: u, markEnd: i, keyes: c } = s;
|
|
1489
1489
|
let m;
|
|
1490
1490
|
const w = c && /* @__PURE__ */ new Set();
|
|
1491
|
-
let
|
|
1492
|
-
if (e && Pt(e, (
|
|
1493
|
-
if (typeof
|
|
1491
|
+
let y = u;
|
|
1492
|
+
if (e && Pt(e, (b) => {
|
|
1493
|
+
if (typeof b == "object" && !b[pe])
|
|
1494
1494
|
return;
|
|
1495
|
-
const S =
|
|
1496
|
-
|
|
1497
|
-
const
|
|
1498
|
-
let C =
|
|
1499
|
-
if (
|
|
1500
|
-
C = Ht(
|
|
1495
|
+
const S = b[pe] && b.key, D = c && S != null && c.get(S);
|
|
1496
|
+
y != i && y === D ? w.delete(y) : y = y == i ? i : y.nextSibling;
|
|
1497
|
+
const x = c ? D : y;
|
|
1498
|
+
let C = x;
|
|
1499
|
+
if (b[pe])
|
|
1500
|
+
C = Ht(b, x, a, o, l);
|
|
1501
1501
|
else {
|
|
1502
|
-
const z =
|
|
1502
|
+
const z = b + "";
|
|
1503
1503
|
!(C instanceof Text) || C instanceof Xe ? C = new Text(z) : C.data != z && (C.data = z);
|
|
1504
1504
|
}
|
|
1505
|
-
C !=
|
|
1506
|
-
}),
|
|
1507
|
-
for (;
|
|
1508
|
-
const
|
|
1509
|
-
|
|
1505
|
+
C != y && (c && w.delete(C), !x || c ? (n.insertBefore(C, y), c && y != i && w.add(y)) : x == i ? n.insertBefore(C, i) : (n.replaceChild(C, x), y = C)), S != null && (m = m || /* @__PURE__ */ new Map(), m.set(S, C));
|
|
1506
|
+
}), y = y == i ? i : y.nextSibling, t && y != i)
|
|
1507
|
+
for (; y != i; ) {
|
|
1508
|
+
const b = y;
|
|
1509
|
+
y = y.nextSibling, b.remove();
|
|
1510
1510
|
}
|
|
1511
|
-
return w && w.forEach((
|
|
1511
|
+
return w && w.forEach((b) => b.remove()), s.keyes = m, s;
|
|
1512
1512
|
}
|
|
1513
1513
|
function Ia(e, t, n, a, o) {
|
|
1514
1514
|
for (const l in t)
|
|
@@ -1789,27 +1789,27 @@ function _a({ props: e, context: t }) {
|
|
|
1789
1789
|
locale: c,
|
|
1790
1790
|
focusedDate: m,
|
|
1791
1791
|
formatWeekday: w
|
|
1792
|
-
} = t,
|
|
1792
|
+
} = t, y = u ?? et(), b = bt(Ha, a, c), S = J(
|
|
1793
1793
|
() => ({ weekday: w }),
|
|
1794
1794
|
[w]
|
|
1795
|
-
), D = bt(S, a, c),
|
|
1795
|
+
), D = bt(S, a, c), x = ge(Ra, c), C = ge(qa, c), z = J(
|
|
1796
1796
|
() => i.start.add({ months: n }),
|
|
1797
1797
|
[i, n]
|
|
1798
1798
|
), j = J(
|
|
1799
1799
|
() => La(z, a),
|
|
1800
1800
|
[z, a]
|
|
1801
1801
|
), H = X("focusday", Fe), v = X("selectday", Fe), h = X("hoverday", Fe);
|
|
1802
|
-
function
|
|
1803
|
-
H(Ie(
|
|
1802
|
+
function g(k) {
|
|
1803
|
+
H(Ie(k, l, s));
|
|
1804
1804
|
}
|
|
1805
|
-
function T(
|
|
1805
|
+
function T(k) {
|
|
1806
1806
|
let $;
|
|
1807
|
-
switch (
|
|
1807
|
+
switch (k.key) {
|
|
1808
1808
|
case "ArrowRight":
|
|
1809
|
-
$ = m.add({ days: xt(
|
|
1809
|
+
$ = m.add({ days: xt(k) ? 1 : -1 });
|
|
1810
1810
|
break;
|
|
1811
1811
|
case "ArrowLeft":
|
|
1812
|
-
$ = m.add({ days: xt(
|
|
1812
|
+
$ = m.add({ days: xt(k) ? -1 : 1 });
|
|
1813
1813
|
break;
|
|
1814
1814
|
case "ArrowDown":
|
|
1815
1815
|
$ = m.add({ days: 7 });
|
|
@@ -1818,10 +1818,10 @@ function _a({ props: e, context: t }) {
|
|
|
1818
1818
|
$ = m.add({ days: -7 });
|
|
1819
1819
|
break;
|
|
1820
1820
|
case "PageUp":
|
|
1821
|
-
$ = m.add(
|
|
1821
|
+
$ = m.add(k.shiftKey ? { years: -1 } : { months: -1 });
|
|
1822
1822
|
break;
|
|
1823
1823
|
case "PageDown":
|
|
1824
|
-
$ = m.add(
|
|
1824
|
+
$ = m.add(k.shiftKey ? { years: 1 } : { months: 1 });
|
|
1825
1825
|
break;
|
|
1826
1826
|
case "Home":
|
|
1827
1827
|
$ = tt(m, a);
|
|
@@ -1832,20 +1832,20 @@ function _a({ props: e, context: t }) {
|
|
|
1832
1832
|
default:
|
|
1833
1833
|
return;
|
|
1834
1834
|
}
|
|
1835
|
-
|
|
1835
|
+
g($), k.preventDefault();
|
|
1836
1836
|
}
|
|
1837
|
-
function r(
|
|
1837
|
+
function r(k) {
|
|
1838
1838
|
var rt, ut;
|
|
1839
|
-
const $ = z.equals(
|
|
1839
|
+
const $ = z.equals(k);
|
|
1840
1840
|
if (!t.showOutsideDays && !$)
|
|
1841
1841
|
return;
|
|
1842
|
-
const I =
|
|
1842
|
+
const I = k.equals(m), P = k.equals(y), q = _(k), Q = o == null ? void 0 : o(q), Y = !wt(k, l, s);
|
|
1843
1843
|
let it = "", le;
|
|
1844
1844
|
if (t.type === "range") {
|
|
1845
|
-
const [ee, fe] = t.value, ct = ee == null ? void 0 : ee.equals(
|
|
1846
|
-
le = ee && fe && wt(
|
|
1845
|
+
const [ee, fe] = t.value, ct = ee == null ? void 0 : ee.equals(k), dt = fe == null ? void 0 : fe.equals(k);
|
|
1846
|
+
le = ee && fe && wt(k, ee, fe), it = `${ct ? "range-start" : ""} ${dt ? "range-end" : ""} ${le && !ct && !dt ? "range-inner" : ""}`;
|
|
1847
1847
|
} else
|
|
1848
|
-
t.type === "multi" ? le = t.value.some((ee) => ee.equals(
|
|
1848
|
+
t.type === "multi" ? le = t.value.some((ee) => ee.equals(k)) : le = (rt = t.value) == null ? void 0 : rt.equals(k);
|
|
1849
1849
|
return {
|
|
1850
1850
|
part: `${`button day day-${q.getDay()} ${// we don't want outside days to ever be shown as selected
|
|
1851
1851
|
$ ? le ? "selected" : "" : "outside"} ${Q ? "disallowed" : ""} ${P ? "today" : ""} ${((ut = t.getDayParts) == null ? void 0 : ut.call(t, q)) ?? ""}`} ${it}`,
|
|
@@ -1854,20 +1854,20 @@ function _a({ props: e, context: t }) {
|
|
|
1854
1854
|
"aria-disabled": Q ? "true" : void 0,
|
|
1855
1855
|
"aria-pressed": $ && le,
|
|
1856
1856
|
"aria-current": P ? "date" : void 0,
|
|
1857
|
-
"aria-label":
|
|
1857
|
+
"aria-label": x.format(q),
|
|
1858
1858
|
onkeydown: T,
|
|
1859
1859
|
onclick() {
|
|
1860
|
-
Q || v(
|
|
1860
|
+
Q || v(k), g(k);
|
|
1861
1861
|
},
|
|
1862
1862
|
onmouseover() {
|
|
1863
|
-
!Q && !Y && h(
|
|
1863
|
+
!Q && !Y && h(k);
|
|
1864
1864
|
}
|
|
1865
1865
|
};
|
|
1866
1866
|
}
|
|
1867
1867
|
return {
|
|
1868
1868
|
weeks: j,
|
|
1869
1869
|
yearMonth: z,
|
|
1870
|
-
daysLong:
|
|
1870
|
+
daysLong: b,
|
|
1871
1871
|
daysVisible: D,
|
|
1872
1872
|
formatter: C,
|
|
1873
1873
|
getDayProps: r
|
|
@@ -2033,8 +2033,8 @@ function Ja({
|
|
|
2033
2033
|
const s = e === "single" ? 1 : n, [u, i] = Ge(
|
|
2034
2034
|
() => $t(t.toPlainYearMonth(), n)
|
|
2035
2035
|
), c = (w) => i($t(u.start.add({ months: w }), n)), m = (w) => {
|
|
2036
|
-
const
|
|
2037
|
-
return
|
|
2036
|
+
const y = qe(u.start, w.toPlainYearMonth());
|
|
2037
|
+
return y >= 0 && y < n;
|
|
2038
2038
|
};
|
|
2039
2039
|
return ve(() => {
|
|
2040
2040
|
if (m(t))
|
|
@@ -2066,7 +2066,7 @@ function st({
|
|
|
2066
2066
|
function w(C) {
|
|
2067
2067
|
o(C), i(_(C));
|
|
2068
2068
|
}
|
|
2069
|
-
const { next:
|
|
2069
|
+
const { next: y, previous: b, page: S } = Ja({
|
|
2070
2070
|
pageBy: t,
|
|
2071
2071
|
focusedDate: m,
|
|
2072
2072
|
months: e,
|
|
@@ -2074,7 +2074,7 @@ function st({
|
|
|
2074
2074
|
max: s,
|
|
2075
2075
|
goto: w
|
|
2076
2076
|
}), D = xe();
|
|
2077
|
-
function
|
|
2077
|
+
function x(C) {
|
|
2078
2078
|
const z = (C == null ? void 0 : C.target) ?? "day";
|
|
2079
2079
|
z === "day" ? D.current.querySelectorAll("calendar-month").forEach((j) => j.focus(C)) : D.current.shadowRoot.querySelector(`[part~='${z}']`).focus(C);
|
|
2080
2080
|
}
|
|
@@ -2085,14 +2085,14 @@ function st({
|
|
|
2085
2085
|
focusedDate: m,
|
|
2086
2086
|
dispatch: c,
|
|
2087
2087
|
onFocus(C) {
|
|
2088
|
-
C.stopPropagation(), w(C.detail), setTimeout(
|
|
2088
|
+
C.stopPropagation(), w(C.detail), setTimeout(x);
|
|
2089
2089
|
},
|
|
2090
2090
|
min: l,
|
|
2091
2091
|
max: s,
|
|
2092
2092
|
today: u,
|
|
2093
|
-
next:
|
|
2094
|
-
previous:
|
|
2095
|
-
focus:
|
|
2093
|
+
next: y,
|
|
2094
|
+
previous: b,
|
|
2095
|
+
focus: x
|
|
2096
2096
|
};
|
|
2097
2097
|
}
|
|
2098
2098
|
const Xa = ke(
|
|
@@ -2129,15 +2129,15 @@ const St = (e, t) => L.compare(e, t) < 0 ? [e, t] : [t, e], Ga = ke(
|
|
|
2129
2129
|
"tentative"
|
|
2130
2130
|
), [m, w] = Ge();
|
|
2131
2131
|
ve(() => w(void 0), [i]);
|
|
2132
|
-
function
|
|
2133
|
-
l.onFocus(
|
|
2132
|
+
function y(x) {
|
|
2133
|
+
l.onFocus(x), b(x);
|
|
2134
2134
|
}
|
|
2135
|
-
function
|
|
2136
|
-
|
|
2135
|
+
function b(x) {
|
|
2136
|
+
x.stopPropagation(), i && w(x.detail);
|
|
2137
2137
|
}
|
|
2138
|
-
function S(
|
|
2139
|
-
const C =
|
|
2140
|
-
|
|
2138
|
+
function S(x) {
|
|
2139
|
+
const C = x.detail;
|
|
2140
|
+
x.stopPropagation(), i ? (n(St(i, C)), c(void 0), u(_(C)), l.dispatch()) : (c(C), s(_(C)));
|
|
2141
2141
|
}
|
|
2142
2142
|
const D = i ? St(i, m ?? i) : t;
|
|
2143
2143
|
return /* @__PURE__ */ N("host", { shadowDom: !0, focus: l.focus, children: /* @__PURE__ */ N(
|
|
@@ -2147,8 +2147,8 @@ const St = (e, t) => L.compare(e, t) < 0 ? [e, t] : [t, e], Ga = ke(
|
|
|
2147
2147
|
...l,
|
|
2148
2148
|
type: "range",
|
|
2149
2149
|
value: D,
|
|
2150
|
-
onFocus:
|
|
2151
|
-
onHover:
|
|
2150
|
+
onFocus: y,
|
|
2151
|
+
onHover: b,
|
|
2152
2152
|
onSelect: S
|
|
2153
2153
|
}
|
|
2154
2154
|
) });
|
|
@@ -2216,47 +2216,46 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2216
2216
|
from: "",
|
|
2217
2217
|
to: "",
|
|
2218
2218
|
single: ""
|
|
2219
|
-
}),
|
|
2219
|
+
}), y = M({
|
|
2220
2220
|
single: null,
|
|
2221
2221
|
start: null,
|
|
2222
2222
|
end: null
|
|
2223
|
-
}),
|
|
2224
|
-
let h = "",
|
|
2225
|
-
n.mode !== "time" && (n.range &&
|
|
2223
|
+
}), b = K(() => {
|
|
2224
|
+
let h = "", g = "";
|
|
2225
|
+
n.mode !== "time" && (n.range && y.value.start && y.value.end ? h = `${y.value.start} - ${y.value.end}` : !n.range && y.value.single && (h = y.value.single)), n.mode !== "date" && (n.range && w.value.from && w.value.to ? g = `${w.value.from} - ${w.value.to}` : !n.range && w.value.single && (g = w.value.single));
|
|
2226
2226
|
const T = (r) => {
|
|
2227
2227
|
if (!r || r.includes(":")) return r;
|
|
2228
|
-
if (r.match(/^\d{4}-\d{2}-\d{2}$/))
|
|
2229
|
-
const b = r.split("-");
|
|
2228
|
+
if (r.match(/^\d{4}-\d{2}-\d{2}$/))
|
|
2230
2229
|
try {
|
|
2231
2230
|
return new Date(r).toLocaleDateString(n.locale);
|
|
2232
2231
|
} catch {
|
|
2233
|
-
|
|
2232
|
+
const k = r.split("-");
|
|
2233
|
+
return `${k[2]}/${k[1]}/${k[0]}`;
|
|
2234
2234
|
}
|
|
2235
|
-
}
|
|
2236
2235
|
return r;
|
|
2237
2236
|
};
|
|
2238
2237
|
if (n.mode === "date") {
|
|
2239
2238
|
if (n.range) {
|
|
2240
|
-
const [r,
|
|
2241
|
-
return r &&
|
|
2239
|
+
const [r, k] = h.split(" - ").map(T);
|
|
2240
|
+
return r && k ? `${r} - ${k}` : "";
|
|
2242
2241
|
}
|
|
2243
2242
|
return T(h);
|
|
2244
2243
|
}
|
|
2245
|
-
if (n.mode === "time") return
|
|
2244
|
+
if (n.mode === "time") return g;
|
|
2246
2245
|
if (n.range) {
|
|
2247
|
-
const [r,
|
|
2246
|
+
const [r, k] = h.split(" - ").map(T), [$, I] = g.split(" - ");
|
|
2248
2247
|
let P = "";
|
|
2249
|
-
return r && $ && (P += `${r} ${$}`),
|
|
2248
|
+
return r && $ && (P += `${r} ${$}`), k && I && (P += P ? ` - ${k} ${I}` : `${k} ${I}`), P.trim();
|
|
2250
2249
|
}
|
|
2251
|
-
return `${T(h)} ${
|
|
2252
|
-
}), S = (h,
|
|
2250
|
+
return `${T(h)} ${g}`.trim();
|
|
2251
|
+
}), S = (h, g) => {
|
|
2253
2252
|
if (n.range) {
|
|
2254
|
-
const T = h.start, r = h.end,
|
|
2253
|
+
const T = h.start, r = h.end, k = g.from, $ = g.to;
|
|
2255
2254
|
let I = null, P = null;
|
|
2256
|
-
if (n.mode === "time" &&
|
|
2255
|
+
if (n.mode === "time" && k && $ ? (I = k, P = $) : n.mode === "date" && T && r ? (I = T, P = r) : n.mode === "datetime" && T && r && k && $ && (I = `${T}T${k}`, P = `${r}T${$}`), I && P)
|
|
2257
2256
|
return { start: I, end: P };
|
|
2258
2257
|
} else {
|
|
2259
|
-
const T = h.single, r =
|
|
2258
|
+
const T = h.single, r = g.single;
|
|
2260
2259
|
if (n.mode === "date") return T;
|
|
2261
2260
|
if (n.mode === "time") return r || null;
|
|
2262
2261
|
if (n.mode === "datetime" && T && r)
|
|
@@ -2265,58 +2264,57 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2265
2264
|
return null;
|
|
2266
2265
|
}, D = () => {
|
|
2267
2266
|
if (s.value)
|
|
2268
|
-
|
|
2267
|
+
y.value.single = s.value.value || null;
|
|
2269
2268
|
else if (u.value) {
|
|
2270
2269
|
const h = u.value.value;
|
|
2271
|
-
|
|
2270
|
+
y.value.start = (h == null ? void 0 : h.start) || null, y.value.end = (h == null ? void 0 : h.end) || null;
|
|
2272
2271
|
}
|
|
2273
|
-
},
|
|
2272
|
+
}, x = () => {
|
|
2274
2273
|
D();
|
|
2275
|
-
const h = S(
|
|
2274
|
+
const h = S(y.value, w.value);
|
|
2276
2275
|
a("update:modelValue", h), a("change", h);
|
|
2277
2276
|
}, C = () => {
|
|
2278
|
-
var h,
|
|
2279
|
-
n.range ? (w.value.from = ((h = c.value) == null ? void 0 : h.value) || "", w.value.to = ((
|
|
2277
|
+
var h, g, T;
|
|
2278
|
+
n.range ? (w.value.from = ((h = c.value) == null ? void 0 : h.value) || "", w.value.to = ((g = m.value) == null ? void 0 : g.value) || "") : w.value.single = ((T = i.value) == null ? void 0 : T.value) || "", x();
|
|
2280
2279
|
}, z = () => {
|
|
2281
|
-
o.value = !o.value, o.value &&
|
|
2280
|
+
o.value = !o.value, o.value && x();
|
|
2282
2281
|
}, j = () => {
|
|
2283
|
-
o.value = !1,
|
|
2282
|
+
o.value = !1, x();
|
|
2284
2283
|
}, H = () => {
|
|
2285
|
-
if (n.initialDate)
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
} else if (typeof n.initialDate == "string" || n.initialDate instanceof Date) {
|
|
2304
|
-
const h = n.initialDate.toString();
|
|
2305
|
-
if (g.value.single = h.includes("T") ? h.split("T")[0] : h, g.value.start = null, g.value.end = null, n.mode === "datetime" || n.mode === "time") {
|
|
2306
|
-
const x = new Date(h), T = `${String(x.getUTCHours()).padStart(2, "0")}:${String(x.getUTCMinutes()).padStart(2, "0")}`;
|
|
2307
|
-
w.value.single = T, i.value && (i.value.value = T);
|
|
2284
|
+
if (!n.initialDate) return;
|
|
2285
|
+
const h = (g) => g instanceof Date ? g.toISOString() : g;
|
|
2286
|
+
if (n.range) {
|
|
2287
|
+
if (typeof n.initialDate == "object" && n.initialDate !== null && "start" in n.initialDate) {
|
|
2288
|
+
const g = n.initialDate, T = h(g.start), r = h(g.end);
|
|
2289
|
+
if (T && r && (y.value = {
|
|
2290
|
+
single: null,
|
|
2291
|
+
start: T.includes("T") ? T.split("T")[0] : T,
|
|
2292
|
+
end: r.includes("T") ? r.split("T")[0] : r
|
|
2293
|
+
}, n.mode === "datetime" || n.mode === "time")) {
|
|
2294
|
+
const k = new Date(T), $ = new Date(r), I = (P) => `${String(P.getUTCHours()).padStart(2, "0")}:${String(P.getUTCMinutes()).padStart(2, "0")}`;
|
|
2295
|
+
w.value = {
|
|
2296
|
+
single: "",
|
|
2297
|
+
from: I(k),
|
|
2298
|
+
to: I($)
|
|
2299
|
+
}, c.value && (c.value.value = w.value.from), m.value && (m.value.value = w.value.to);
|
|
2308
2300
|
}
|
|
2309
2301
|
}
|
|
2302
|
+
} else if (typeof n.initialDate == "string" || n.initialDate instanceof Date) {
|
|
2303
|
+
const g = h(n.initialDate);
|
|
2304
|
+
if (y.value.single = g.includes("T") ? g.split("T")[0] : g, y.value.start = null, y.value.end = null, n.mode === "datetime" || n.mode === "time") {
|
|
2305
|
+
const T = new Date(g), r = `${String(T.getUTCHours()).padStart(2, "0")}:${String(T.getUTCMinutes()).padStart(2, "0")}`;
|
|
2306
|
+
w.value.single = r, i.value && (i.value.value = r);
|
|
2307
|
+
}
|
|
2310
2308
|
}
|
|
2311
2309
|
}, v = (h) => {
|
|
2312
2310
|
n.popup && o.value && l.value && !l.value.contains(h.target) && j();
|
|
2313
2311
|
};
|
|
2314
2312
|
return ue(() => {
|
|
2315
|
-
s.value && s.value.addEventListener("change",
|
|
2313
|
+
typeof document < "u" && (s.value && s.value.addEventListener("change", x), u.value && u.value.addEventListener("change", x), n.popup && document.addEventListener("click", v)), H(), setTimeout(x, 0);
|
|
2316
2314
|
}), Dt(() => {
|
|
2317
|
-
s.value && s.value.removeEventListener("change",
|
|
2318
|
-
}), (h,
|
|
2319
|
-
const T = Ae("calendar-month"), r = Ae("calendar-date"),
|
|
2315
|
+
typeof document < "u" && (s.value && s.value.removeEventListener("change", x), u.value && u.value.removeEventListener("change", x), n.popup && document.removeEventListener("click", v));
|
|
2316
|
+
}), (h, g) => {
|
|
2317
|
+
const T = Ae("calendar-month"), r = Ae("calendar-date"), k = Ae("calendar-range");
|
|
2320
2318
|
return f(), p("div", {
|
|
2321
2319
|
class: "inline-block relative w-fit lg:w-full",
|
|
2322
2320
|
ref_key: "pickerContainer",
|
|
@@ -2325,13 +2323,13 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2325
2323
|
n.popup ? (f(), p("div", {
|
|
2326
2324
|
key: 0,
|
|
2327
2325
|
class: "flex items-center gap-2 cursor-pointer w-full",
|
|
2328
|
-
onClick:
|
|
2326
|
+
onClick: g[0] || (g[0] = ($) => n.disabled ? null : z())
|
|
2329
2327
|
}, [
|
|
2330
2328
|
d("input", {
|
|
2331
2329
|
type: "text",
|
|
2332
2330
|
class: "input-bordered w-full cursor-pointer input",
|
|
2333
2331
|
placeholder: n.placeholder,
|
|
2334
|
-
value:
|
|
2332
|
+
value: b.value,
|
|
2335
2333
|
readonly: "",
|
|
2336
2334
|
id: `${n.id}-input`,
|
|
2337
2335
|
disabled: n.disabled
|
|
@@ -2339,7 +2337,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2339
2337
|
d("button", {
|
|
2340
2338
|
class: "btn btn-ghost",
|
|
2341
2339
|
disabled: n.disabled
|
|
2342
|
-
}, [...
|
|
2340
|
+
}, [...g[1] || (g[1] = [
|
|
2343
2341
|
d("svg", {
|
|
2344
2342
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2345
2343
|
viewBox: "0 0 24 24",
|
|
@@ -2363,11 +2361,10 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2363
2361
|
min: n.min,
|
|
2364
2362
|
max: n.max,
|
|
2365
2363
|
disabled: n.disabled,
|
|
2366
|
-
|
|
2367
|
-
onChange: k
|
|
2364
|
+
onChange: x
|
|
2368
2365
|
}, {
|
|
2369
2366
|
default: pt(() => [
|
|
2370
|
-
|
|
2367
|
+
g[2] || (g[2] = d("svg", {
|
|
2371
2368
|
"aria-label": "Previous",
|
|
2372
2369
|
class: "fill-current size-4",
|
|
2373
2370
|
slot: "previous",
|
|
@@ -2379,7 +2376,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2379
2376
|
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2380
2377
|
})
|
|
2381
2378
|
], -1)),
|
|
2382
|
-
|
|
2379
|
+
g[3] || (g[3] = d("svg", {
|
|
2383
2380
|
"aria-label": "Next",
|
|
2384
2381
|
class: "fill-current size-4",
|
|
2385
2382
|
slot: "next",
|
|
@@ -2396,8 +2393,8 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2396
2393
|
}, null, 8, ["locale"])
|
|
2397
2394
|
]),
|
|
2398
2395
|
_: 1
|
|
2399
|
-
}, 8, ["id", "min", "max", "disabled"
|
|
2400
|
-
n.range && n.mode !== "time" ? (f(), ae(
|
|
2396
|
+
}, 8, ["id", "min", "max", "disabled"])) : E("", !0),
|
|
2397
|
+
n.range && n.mode !== "time" ? (f(), ae(k, {
|
|
2401
2398
|
key: 1,
|
|
2402
2399
|
class: "cally w-full",
|
|
2403
2400
|
ref_key: "rangeDatePicker",
|
|
@@ -2406,11 +2403,10 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2406
2403
|
min: n.min,
|
|
2407
2404
|
max: n.max,
|
|
2408
2405
|
disabled: n.disabled,
|
|
2409
|
-
|
|
2410
|
-
onChange: k
|
|
2406
|
+
onChange: x
|
|
2411
2407
|
}, {
|
|
2412
2408
|
default: pt(() => [
|
|
2413
|
-
|
|
2409
|
+
g[4] || (g[4] = d("svg", {
|
|
2414
2410
|
"aria-label": "Previous",
|
|
2415
2411
|
class: "fill-current size-4",
|
|
2416
2412
|
slot: "previous",
|
|
@@ -2422,7 +2418,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2422
2418
|
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
2423
2419
|
})
|
|
2424
2420
|
], -1)),
|
|
2425
|
-
|
|
2421
|
+
g[5] || (g[5] = d("svg", {
|
|
2426
2422
|
"aria-label": "Next",
|
|
2427
2423
|
class: "fill-current size-4",
|
|
2428
2424
|
slot: "next",
|
|
@@ -2439,7 +2435,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2439
2435
|
}, null, 8, ["locale"])
|
|
2440
2436
|
]),
|
|
2441
2437
|
_: 1
|
|
2442
|
-
}, 8, ["id", "min", "max", "disabled"
|
|
2438
|
+
}, 8, ["id", "min", "max", "disabled"])) : E("", !0),
|
|
2443
2439
|
n.range && n.mode !== "date" ? (f(), p("div", nl, [
|
|
2444
2440
|
d("div", al, [
|
|
2445
2441
|
d("input", {
|
|
@@ -2453,7 +2449,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2453
2449
|
disabled: n.disabled
|
|
2454
2450
|
}, null, 40, ll)
|
|
2455
2451
|
]),
|
|
2456
|
-
|
|
2452
|
+
g[6] || (g[6] = d("svg", {
|
|
2457
2453
|
class: "join-item",
|
|
2458
2454
|
viewBox: "0 0 1024 1024",
|
|
2459
2455
|
focusable: "false",
|
|
@@ -2574,34 +2570,34 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2574
2570
|
emits: ["update:modelValue"],
|
|
2575
2571
|
setup(e, { emit: t }) {
|
|
2576
2572
|
const n = e, a = t, o = M([...n.modelValue]), l = n.maxTagAmount === void 0 ? -1 : n.maxTagAmount, s = M(null), u = M(""), i = K(() => l < 0 || o.value.length < l), c = () => {
|
|
2577
|
-
const
|
|
2578
|
-
|
|
2579
|
-
}, m = (
|
|
2580
|
-
o.value = o.value.filter((S) => S !==
|
|
2573
|
+
const b = u.value.trim();
|
|
2574
|
+
b && !o.value.includes(b) && (o.value.push(b), a("update:modelValue", o.value), u.value = "");
|
|
2575
|
+
}, m = (b) => {
|
|
2576
|
+
o.value = o.value.filter((S) => S !== b), a("update:modelValue", o.value);
|
|
2581
2577
|
}, w = () => {
|
|
2582
2578
|
u.value === "" && (o.value.pop(), a("update:modelValue", o.value));
|
|
2583
|
-
},
|
|
2584
|
-
|
|
2579
|
+
}, y = (b) => {
|
|
2580
|
+
b.key === "Enter" ? c() : b.key === "Backspace" && u.value === "" && w();
|
|
2585
2581
|
};
|
|
2586
|
-
return R(() => n.modelValue, (
|
|
2587
|
-
o.value = [...
|
|
2588
|
-
}), (
|
|
2589
|
-
class: B(["flex flex-wrap gap-2 bg-base-100 shadow px-4 py-6 border border-base-content/20 rounded",
|
|
2582
|
+
return R(() => n.modelValue, (b) => {
|
|
2583
|
+
o.value = [...b];
|
|
2584
|
+
}), (b, S) => (f(), p("div", {
|
|
2585
|
+
class: B(["flex flex-wrap gap-2 bg-base-100 shadow px-4 py-6 border border-base-content/20 rounded", b.$props.class])
|
|
2590
2586
|
}, [
|
|
2591
|
-
(f(!0), p(U, null, F(o.value, (D) => V(
|
|
2587
|
+
(f(!0), p(U, null, F(o.value, (D) => V(b.$slots, "tag", {
|
|
2592
2588
|
key: D,
|
|
2593
2589
|
tag: D
|
|
2594
2590
|
}, () => [
|
|
2595
2591
|
d("div", cl, [
|
|
2596
2592
|
d("button", {
|
|
2597
2593
|
class: "px-1! py-0! h-fit font-bold cursor-pointer",
|
|
2598
|
-
onClick: (
|
|
2594
|
+
onClick: (x) => m(D),
|
|
2599
2595
|
"aria-label": "Remove tag"
|
|
2600
2596
|
}, "X", 8, dl),
|
|
2601
2597
|
d("span", fl, O(D), 1)
|
|
2602
2598
|
])
|
|
2603
2599
|
])), 128)),
|
|
2604
|
-
V(
|
|
2600
|
+
V(b.$slots, "input", { showInput: i.value }, () => [
|
|
2605
2601
|
i.value ? Ce((f(), p("input", {
|
|
2606
2602
|
key: 0,
|
|
2607
2603
|
ref_key: "inputRef",
|
|
@@ -2610,7 +2606,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2610
2606
|
type: "text",
|
|
2611
2607
|
placeholder: e.placeholder || "Type here",
|
|
2612
2608
|
class: "h-full input input-ghost",
|
|
2613
|
-
onKeydown:
|
|
2609
|
+
onKeydown: y,
|
|
2614
2610
|
"aria-label": "Add tags"
|
|
2615
2611
|
}, null, 40, ml)), [
|
|
2616
2612
|
[Tt, u.value]
|
|
@@ -2705,13 +2701,13 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2705
2701
|
emits: ["update:modelValue", "select", "clear"],
|
|
2706
2702
|
setup(e, { expose: t, emit: n }) {
|
|
2707
2703
|
const a = e, o = n, l = en(), s = K(() => {
|
|
2708
|
-
const
|
|
2709
|
-
return console.log("hasDefaultSlotContent computed:",
|
|
2710
|
-
}), u = M(""), i = M(null), c = M(!1), m = M(null), w = M(null),
|
|
2704
|
+
const k = (l.default ? l.default() : []).filter(($) => $.type !== tn);
|
|
2705
|
+
return console.log("hasDefaultSlotContent computed:", k.length > 0), k.length > 0;
|
|
2706
|
+
}), u = M(""), i = M(null), c = M(!1), m = M(null), w = M(null), y = M(null), b = M(null), S = () => {
|
|
2711
2707
|
c.value = !a.disabled;
|
|
2712
2708
|
}, D = () => {
|
|
2713
|
-
c.value = !1,
|
|
2714
|
-
},
|
|
2709
|
+
c.value = !1, b.value = null, s.value || (i.value && u.value !== i.value.text ? u.value = i.value.text : i.value || (u.value = ""));
|
|
2710
|
+
}, x = () => {
|
|
2715
2711
|
c.value ? D() : S();
|
|
2716
2712
|
}, C = K(() => {
|
|
2717
2713
|
const r = u.value ? u.value.toLowerCase() : "";
|
|
@@ -2721,8 +2717,8 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2721
2717
|
});
|
|
2722
2718
|
R(
|
|
2723
2719
|
() => a.modelValue,
|
|
2724
|
-
(r,
|
|
2725
|
-
if (r !==
|
|
2720
|
+
(r, k) => {
|
|
2721
|
+
if (r !== k && D(), r == null)
|
|
2726
2722
|
i.value = null, !c.value && !s.value && (u.value = "");
|
|
2727
2723
|
else {
|
|
2728
2724
|
const $ = a.options.find((I) => I.value === r);
|
|
@@ -2754,33 +2750,33 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2754
2750
|
i.value = r, s.value || (u.value = r.text), o("update:modelValue", r.value), o("select", r), D();
|
|
2755
2751
|
}, h = () => {
|
|
2756
2752
|
C.value.length > 0 && v(C.value[0]);
|
|
2757
|
-
},
|
|
2753
|
+
}, g = () => {
|
|
2758
2754
|
c.value || S();
|
|
2759
2755
|
}, T = (r) => {
|
|
2760
2756
|
if (!c.value || C.value.length === 0) return;
|
|
2761
|
-
const
|
|
2762
|
-
(I, P) => "option-" + P ===
|
|
2757
|
+
const k = C.value.findIndex(
|
|
2758
|
+
(I, P) => "option-" + P === b.value
|
|
2763
2759
|
);
|
|
2764
2760
|
let $ = -1;
|
|
2765
2761
|
if (r.key === "ArrowDown")
|
|
2766
|
-
r.preventDefault(), $ = (
|
|
2762
|
+
r.preventDefault(), $ = (k + 1) % C.value.length;
|
|
2767
2763
|
else if (r.key === "ArrowUp")
|
|
2768
|
-
r.preventDefault(), $ = (
|
|
2769
|
-
else if (r.key === "Enter" &&
|
|
2764
|
+
r.preventDefault(), $ = (k - 1 + C.value.length) % C.value.length;
|
|
2765
|
+
else if (r.key === "Enter" && b.value) {
|
|
2770
2766
|
r.preventDefault();
|
|
2771
2767
|
const I = C.value.find(
|
|
2772
|
-
(P, q) => "option-" + q ===
|
|
2768
|
+
(P, q) => "option-" + q === b.value
|
|
2773
2769
|
);
|
|
2774
2770
|
I && v(I);
|
|
2775
2771
|
return;
|
|
2776
2772
|
} else if (r.key === "Escape") {
|
|
2777
|
-
r.preventDefault(), D(),
|
|
2773
|
+
r.preventDefault(), D(), y.value && y.value.focus();
|
|
2778
2774
|
return;
|
|
2779
2775
|
} else if (s.value)
|
|
2780
2776
|
return;
|
|
2781
2777
|
if ($ !== -1) {
|
|
2782
|
-
|
|
2783
|
-
const I = document.getElementById(
|
|
2778
|
+
b.value = "option-" + $;
|
|
2779
|
+
const I = document.getElementById(b.value);
|
|
2784
2780
|
I && requestAnimationFrame(() => {
|
|
2785
2781
|
I.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
2786
2782
|
});
|
|
@@ -2799,7 +2795,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2799
2795
|
// Expose method to open
|
|
2800
2796
|
closeDropdown: D,
|
|
2801
2797
|
// Expose method to close
|
|
2802
|
-
toggleDropdown:
|
|
2798
|
+
toggleDropdown: x,
|
|
2803
2799
|
// Expose method to toggle
|
|
2804
2800
|
selectItem: v,
|
|
2805
2801
|
// Expose method to select an item programmatically
|
|
@@ -2807,7 +2803,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2807
2803
|
// Expose filter text (useful if parent controls filtering)
|
|
2808
2804
|
hasDefaultSlotContent: s
|
|
2809
2805
|
// Expose to know if the default slot is used
|
|
2810
|
-
}), (r,
|
|
2806
|
+
}), (r, k) => (f(), p("div", {
|
|
2811
2807
|
class: "relative w-full max-w-xs form-control",
|
|
2812
2808
|
ref_key: "componentRoot",
|
|
2813
2809
|
ref: w
|
|
@@ -2821,7 +2817,7 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2821
2817
|
i.value ? "background-image: unset; padding-right: 0.5rem;" : ""
|
|
2822
2818
|
),
|
|
2823
2819
|
tabindex: "0",
|
|
2824
|
-
onClick:
|
|
2820
|
+
onClick: k[1] || (k[1] = ($) => s.value ? x() : S()),
|
|
2825
2821
|
onKeydown: [
|
|
2826
2822
|
We(te(h, ["prevent"]), ["enter"]),
|
|
2827
2823
|
We(te(h, ["prevent"]), ["space"])
|
|
@@ -2830,10 +2826,10 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2830
2826
|
role: "combobox",
|
|
2831
2827
|
"aria-haspopup": "listbox",
|
|
2832
2828
|
"aria-expanded": c.value,
|
|
2833
|
-
"aria-activedescendant":
|
|
2829
|
+
"aria-activedescendant": b.value,
|
|
2834
2830
|
"aria-autocomplete": "list",
|
|
2835
2831
|
ref_key: "activatorWrapper",
|
|
2836
|
-
ref:
|
|
2832
|
+
ref: y
|
|
2837
2833
|
}, [
|
|
2838
2834
|
V(r.$slots, "default", {}, () => [
|
|
2839
2835
|
s.value ? E("", !0) : Ce((f(), p("input", {
|
|
@@ -2841,11 +2837,11 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2841
2837
|
type: "text",
|
|
2842
2838
|
placeholder: e.placeholder,
|
|
2843
2839
|
class: "bg-transparent border-none focus:outline-none w-full",
|
|
2844
|
-
"onUpdate:modelValue":
|
|
2840
|
+
"onUpdate:modelValue": k[0] || (k[0] = ($) => u.value = $),
|
|
2845
2841
|
ref_key: "filterInput",
|
|
2846
2842
|
ref: m,
|
|
2847
2843
|
onFocus: S,
|
|
2848
|
-
onInput:
|
|
2844
|
+
onInput: g,
|
|
2849
2845
|
tabindex: "-1",
|
|
2850
2846
|
disabled: a.disabled
|
|
2851
2847
|
}, null, 40, $l)), [
|
|
@@ -2909,12 +2905,12 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2909
2905
|
emits: ["update:modelValue", "validate"],
|
|
2910
2906
|
setup(e, { expose: t, emit: n }) {
|
|
2911
2907
|
const a = e, o = n, l = M(null), s = M(!1), u = M(""), i = K(() => {
|
|
2912
|
-
var
|
|
2913
|
-
let
|
|
2908
|
+
var x, C, z, j;
|
|
2909
|
+
let b = !0, S = "";
|
|
2914
2910
|
const D = a.modelValue;
|
|
2915
|
-
return (
|
|
2916
|
-
}), c = K(() => s.value && !i.value), m = (
|
|
2917
|
-
const S =
|
|
2911
|
+
return (x = a.rules) != null && x.required && (D == null || D === "") && (b = !1, S = "This field is required."), b && ((C = a.rules) == null ? void 0 : C.minLength) !== void 0 && typeof D == "string" && D.length < a.rules.minLength && (b = !1, S = `Must be at least ${a.rules.minLength} characters.`), b && ((z = a.rules) == null ? void 0 : z.maxLength) !== void 0 && typeof D == "string" && D.length > a.rules.maxLength && (b = !1, S = `Cannot exceed ${a.rules.maxLength} characters.`), b && ((j = a.rules) != null && j.email) && typeof D == "string" && D && (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(D) || (b = !1, S = "Please enter a valid email address.")), u.value = S, o("validate", b), b;
|
|
2912
|
+
}), c = K(() => s.value && !i.value), m = (b) => {
|
|
2913
|
+
const S = b.target;
|
|
2918
2914
|
o("update:modelValue", S.value), s.value && i.value;
|
|
2919
2915
|
}, w = () => {
|
|
2920
2916
|
s.value = !0, i.value;
|
|
@@ -2926,17 +2922,17 @@ const el = ["placeholder", "value", "id", "disabled"], tl = ["disabled"], nl = {
|
|
|
2926
2922
|
}
|
|
2927
2923
|
), t({
|
|
2928
2924
|
focusInput: () => {
|
|
2929
|
-
var
|
|
2930
|
-
console.log("inputField.vue: focusInput method called."), (
|
|
2925
|
+
var b;
|
|
2926
|
+
console.log("inputField.vue: focusInput method called."), (b = l.value) == null || b.focus();
|
|
2931
2927
|
},
|
|
2932
2928
|
isValid: i,
|
|
2933
2929
|
isTouched: s,
|
|
2934
2930
|
errorMessage: u
|
|
2935
|
-
}), (
|
|
2931
|
+
}), (b, S) => (f(), p("div", Tl, [
|
|
2936
2932
|
e.label ? (f(), p("label", Ml, [
|
|
2937
2933
|
d("span", Il, O(e.label), 1)
|
|
2938
2934
|
])) : E("", !0),
|
|
2939
|
-
V(
|
|
2935
|
+
V(b.$slots, "default"),
|
|
2940
2936
|
d("input", {
|
|
2941
2937
|
ref_key: "inputElement",
|
|
2942
2938
|
ref: l,
|