@starasia/date 5.2.4 → 5.3.0
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/date.es.js +432 -388
- package/dist/date.umd.js +39 -2
- package/dist/interfaces.d.ts +2 -2
- package/package.json +1 -1
package/dist/date.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as $, jsx as a, Fragment as en } from "react/jsx-runtime";
|
|
2
2
|
import { useState as A, useRef as J, useEffect as B, forwardRef as K } from "react";
|
|
3
3
|
const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
|
|
4
4
|
|
|
@@ -348,6 +348,12 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
348
348
|
border-style: solid;
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
.sa-calendar-input-container.xs {
|
|
352
|
+
height: var(--sa-h-7, 28px);
|
|
353
|
+
border-radius: var(--sa-radii-sm, 6px);
|
|
354
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
355
|
+
padding-inline: var(--sa-spacing-2, 8px);
|
|
356
|
+
}
|
|
351
357
|
.sa-calendar-input-container.sm {
|
|
352
358
|
height: var(--sa-h-8, 32px);
|
|
353
359
|
border-radius: var(--sa-radii-sm, 6px);
|
|
@@ -501,6 +507,37 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
501
507
|
height: 38px;
|
|
502
508
|
}
|
|
503
509
|
|
|
510
|
+
/* xs trigger → reuse the compact (sm) calendar panel */
|
|
511
|
+
.sa-calendar.sa-calendar-size-xs {
|
|
512
|
+
padding: 16px 12px;
|
|
513
|
+
gap: 8px;
|
|
514
|
+
}
|
|
515
|
+
.sa-calendar.sa-calendar-size-xs.sa-calendar-no-padding {
|
|
516
|
+
padding: 0;
|
|
517
|
+
}
|
|
518
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-name-preivew,
|
|
519
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-number-preivew {
|
|
520
|
+
gap: 4px;
|
|
521
|
+
}
|
|
522
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-name-preivew p,
|
|
523
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-number-preivew p {
|
|
524
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
525
|
+
}
|
|
526
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-number-preivew p {
|
|
527
|
+
width: 28px;
|
|
528
|
+
height: 26px;
|
|
529
|
+
}
|
|
530
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-days-today::before {
|
|
531
|
+
width: 22px;
|
|
532
|
+
height: 22px;
|
|
533
|
+
}
|
|
534
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-months-preview p,
|
|
535
|
+
.sa-calendar.sa-calendar-size-xs .sa-calendar-years-preview p {
|
|
536
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
537
|
+
width: 76px;
|
|
538
|
+
height: 38px;
|
|
539
|
+
}
|
|
540
|
+
|
|
504
541
|
.sa-calendar.sa-calendar-size-lg {
|
|
505
542
|
padding: 28px 20px;
|
|
506
543
|
gap: 16px;
|
|
@@ -571,48 +608,50 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
571
608
|
"Nov",
|
|
572
609
|
"Dec"
|
|
573
610
|
];
|
|
574
|
-
function rn(
|
|
575
|
-
const [n, t] = A(
|
|
611
|
+
function rn(e) {
|
|
612
|
+
const [n, t] = A(e), o = J(null), l = (u) => {
|
|
576
613
|
o.current && !o.current.contains(u.target) && t(!1);
|
|
577
614
|
};
|
|
578
615
|
return B(() => (document.addEventListener("click", l, !0), () => {
|
|
579
616
|
document.removeEventListener("click", l, !0);
|
|
580
617
|
}), []), { ref: o, isComponentVisible: n, setIsComponentVisible: t };
|
|
581
618
|
}
|
|
582
|
-
const Q = "sa-calendar-input-styles", dn = (
|
|
619
|
+
const Q = "sa-calendar-input-styles", dn = (e) => {
|
|
583
620
|
if (!document.getElementById(Q)) {
|
|
584
621
|
const n = document.createElement("style");
|
|
585
|
-
n.id = Q, n.textContent =
|
|
622
|
+
n.id = Q, n.textContent = e, document.head.appendChild(n);
|
|
586
623
|
}
|
|
587
624
|
};
|
|
588
625
|
dn(R);
|
|
589
|
-
const O = (
|
|
590
|
-
if (
|
|
626
|
+
const O = (e) => {
|
|
627
|
+
if (e === "xs")
|
|
628
|
+
return 14;
|
|
629
|
+
if (e === "sm")
|
|
591
630
|
return 16;
|
|
592
|
-
if (
|
|
631
|
+
if (e === "md")
|
|
593
632
|
return 16;
|
|
594
|
-
if (
|
|
633
|
+
if (e === "lg")
|
|
595
634
|
return 20;
|
|
596
|
-
}, cn = (
|
|
635
|
+
}, cn = (e) => {
|
|
597
636
|
const {
|
|
598
|
-
size: n = "
|
|
637
|
+
size: n = "sm",
|
|
599
638
|
status: t = "default",
|
|
600
639
|
variant: o = "outline",
|
|
601
640
|
clearable: l,
|
|
602
641
|
onClear: u,
|
|
603
642
|
...i
|
|
604
|
-
} =
|
|
605
|
-
|
|
606
|
-
}, r = t === "disable" || i.disabled, d = !!i.value,
|
|
643
|
+
} = e, g = J(null), f = () => {
|
|
644
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
645
|
+
}, r = t === "disable" || i.disabled, d = !!i.value, w = l && d && !r, M = (k) => {
|
|
607
646
|
k.stopPropagation(), u == null || u();
|
|
608
647
|
};
|
|
609
|
-
return /* @__PURE__ */
|
|
648
|
+
return /* @__PURE__ */ $(
|
|
610
649
|
"div",
|
|
611
650
|
{
|
|
612
651
|
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${n} `,
|
|
613
|
-
onClick:
|
|
652
|
+
onClick: f,
|
|
614
653
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
616
655
|
"svg",
|
|
617
656
|
{
|
|
618
657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -620,7 +659,7 @@ const O = (a) => {
|
|
|
620
659
|
height: O(n),
|
|
621
660
|
viewBox: "0 0 20 20",
|
|
622
661
|
fill: "none",
|
|
623
|
-
children: /* @__PURE__ */
|
|
662
|
+
children: /* @__PURE__ */ a(
|
|
624
663
|
"path",
|
|
625
664
|
{
|
|
626
665
|
d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
|
|
@@ -632,24 +671,24 @@ const O = (a) => {
|
|
|
632
671
|
)
|
|
633
672
|
}
|
|
634
673
|
) }),
|
|
635
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-preview-container", children: /* @__PURE__ */ a(
|
|
636
675
|
"input",
|
|
637
676
|
{
|
|
638
677
|
className: "sa-calendar-input",
|
|
639
678
|
...i,
|
|
640
679
|
disabled: r,
|
|
641
680
|
value: i.value,
|
|
642
|
-
ref:
|
|
681
|
+
ref: g
|
|
643
682
|
}
|
|
644
683
|
) }),
|
|
645
|
-
|
|
684
|
+
w ? /* @__PURE__ */ a(
|
|
646
685
|
"button",
|
|
647
686
|
{
|
|
648
687
|
type: "button",
|
|
649
688
|
"aria-label": "Clear date",
|
|
650
689
|
className: "sa-calendar-input-clear",
|
|
651
690
|
onClick: M,
|
|
652
|
-
children: /* @__PURE__ */
|
|
691
|
+
children: /* @__PURE__ */ a(
|
|
653
692
|
"svg",
|
|
654
693
|
{
|
|
655
694
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -657,7 +696,7 @@ const O = (a) => {
|
|
|
657
696
|
height: O(n),
|
|
658
697
|
viewBox: "0 0 20 20",
|
|
659
698
|
fill: "none",
|
|
660
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ a(
|
|
661
700
|
"path",
|
|
662
701
|
{
|
|
663
702
|
d: "M5 5L15 15M15 5L5 15",
|
|
@@ -670,7 +709,7 @@ const O = (a) => {
|
|
|
670
709
|
}
|
|
671
710
|
)
|
|
672
711
|
}
|
|
673
|
-
) : /* @__PURE__ */
|
|
712
|
+
) : /* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-right", children: /* @__PURE__ */ a(
|
|
674
713
|
"svg",
|
|
675
714
|
{
|
|
676
715
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -678,7 +717,7 @@ const O = (a) => {
|
|
|
678
717
|
height: O(n),
|
|
679
718
|
viewBox: "0 0 20 20",
|
|
680
719
|
fill: "none",
|
|
681
|
-
children: /* @__PURE__ */
|
|
720
|
+
children: /* @__PURE__ */ a(
|
|
682
721
|
"path",
|
|
683
722
|
{
|
|
684
723
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -693,122 +732,124 @@ const O = (a) => {
|
|
|
693
732
|
]
|
|
694
733
|
}
|
|
695
734
|
);
|
|
696
|
-
},
|
|
697
|
-
date:
|
|
735
|
+
}, pn = ({
|
|
736
|
+
date: e,
|
|
698
737
|
setDate: n,
|
|
699
738
|
dateRange: t,
|
|
700
739
|
setDateRange: o,
|
|
701
740
|
onChange: l,
|
|
702
741
|
minDate: u,
|
|
703
742
|
maxDate: i,
|
|
704
|
-
input:
|
|
743
|
+
input: g
|
|
705
744
|
}) => {
|
|
706
|
-
var
|
|
707
|
-
const [
|
|
708
|
-
let d = new Date(
|
|
709
|
-
const k =
|
|
710
|
-
for (let
|
|
711
|
-
|
|
712
|
-
d.getDate() + (
|
|
745
|
+
var z, c, y;
|
|
746
|
+
const [f, r] = A(null);
|
|
747
|
+
let d = new Date(e.getFullYear(), e.getMonth(), 1), w = d.getDay(), M = [];
|
|
748
|
+
const k = e.getMonth(), N = (/* @__PURE__ */ new Date()).toDateString(), m = !!(t.from && !t.to), h = m && f ? f : null;
|
|
749
|
+
for (let p = 0; p < 42; p++) {
|
|
750
|
+
p === 0 && w === 0 ? d.setDate(d.getDate() - 7) : p === 0 ? d.setDate(
|
|
751
|
+
d.getDate() + (p - w)
|
|
713
752
|
) : d.setDate(d.getDate() + 1);
|
|
714
|
-
let
|
|
753
|
+
let b = {
|
|
715
754
|
currentMonth: d.getMonth() === k,
|
|
716
755
|
date: new Date(d),
|
|
717
756
|
month: d.getMonth(),
|
|
718
757
|
number: d.getDate(),
|
|
719
|
-
selected: d.toDateString() === ((
|
|
720
|
-
isToday: d.toDateString() ===
|
|
758
|
+
selected: d.toDateString() === ((z = t.from) == null ? void 0 : z.toDateString()) || d.toDateString() === (((c = t.to) == null ? void 0 : c.toDateString()) || ((y = t.from) == null ? void 0 : y.toDateString())),
|
|
759
|
+
isToday: d.toDateString() === N,
|
|
721
760
|
year: d.getFullYear(),
|
|
722
761
|
isDisabled: u && d < u || i && d > i
|
|
723
762
|
};
|
|
724
|
-
M.push(
|
|
763
|
+
M.push(b);
|
|
725
764
|
}
|
|
726
|
-
const s = (
|
|
727
|
-
n(
|
|
728
|
-
}, x = (
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
765
|
+
const s = (p) => {
|
|
766
|
+
n(p);
|
|
767
|
+
}, x = (p) => {
|
|
768
|
+
let b = { ...t };
|
|
769
|
+
if (b.from && b.to)
|
|
770
|
+
b = { from: p, to: null };
|
|
771
|
+
else if (!b.from)
|
|
772
|
+
b = { from: p, to: null };
|
|
733
773
|
else {
|
|
734
|
-
const
|
|
735
|
-
|
|
774
|
+
const E = b.from.getTime();
|
|
775
|
+
p.getTime() > E ? b = { from: b.from, to: p } : b = { from: p, to: b.from };
|
|
736
776
|
}
|
|
737
|
-
o(
|
|
777
|
+
o(b), l(b);
|
|
738
778
|
};
|
|
739
|
-
return /* @__PURE__ */
|
|
779
|
+
return /* @__PURE__ */ $(
|
|
740
780
|
"div",
|
|
741
781
|
{
|
|
742
782
|
className: "sa-calendar-days-preivew",
|
|
743
783
|
onMouseLeave: () => r(null),
|
|
744
784
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
const
|
|
748
|
-
if (!
|
|
785
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: an.map((p, b) => /* @__PURE__ */ a("p", { children: p }, b)) }),
|
|
786
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: M.map((p, b) => {
|
|
787
|
+
const E = t.from && t.to && p.date.getTime() > t.from.getTime() && p.date.getTime() < t.to.getTime(), S = (() => {
|
|
788
|
+
if (!h || !t.from)
|
|
749
789
|
return !1;
|
|
750
|
-
const
|
|
751
|
-
return
|
|
752
|
-
})(),
|
|
753
|
-
return /* @__PURE__ */
|
|
790
|
+
const Y = p.date.getTime(), C = t.from.getTime(), L = h.getTime();
|
|
791
|
+
return L > C ? Y > C && Y < L : Y < C && Y > L;
|
|
792
|
+
})(), D = m && f && p.date.toDateString() === f.toDateString(), F = p.isDisabled, I = () => E || S ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "", T = () => F ? "var(--sa-color-gray-400, #b7b9be)" : E || S ? "var(--sa-color-gray-500, #8c8f97)" : "";
|
|
793
|
+
return /* @__PURE__ */ a(
|
|
754
794
|
"p",
|
|
755
795
|
{
|
|
756
|
-
className: `${
|
|
796
|
+
className: `${p.currentMonth ? "sa-calendar-days-current" : "sa-calendar-days"} ${p.selected || D ? "sa-calendar-days-active" : ""} ${p.isToday && !p.selected ? "sa-calendar-days-today" : ""}`,
|
|
757
797
|
style: {
|
|
758
798
|
backgroundColor: I(),
|
|
759
|
-
pointerEvents:
|
|
760
|
-
cursor:
|
|
799
|
+
pointerEvents: F ? "none" : void 0,
|
|
800
|
+
cursor: F ? "not-allowed" : "pointer",
|
|
761
801
|
color: T(),
|
|
762
|
-
opacity:
|
|
763
|
-
...
|
|
802
|
+
opacity: D && !p.selected ? 0.75 : 1,
|
|
803
|
+
...g ? {} : { width: "100%" }
|
|
764
804
|
},
|
|
765
805
|
onClick: () => {
|
|
766
|
-
|
|
806
|
+
F || (s(p.date), x(p.date));
|
|
767
807
|
},
|
|
768
808
|
onMouseEnter: () => {
|
|
769
|
-
|
|
809
|
+
F || r(p.date);
|
|
770
810
|
},
|
|
771
|
-
children:
|
|
811
|
+
children: p.number
|
|
772
812
|
},
|
|
773
|
-
|
|
813
|
+
b
|
|
774
814
|
);
|
|
775
815
|
}) })
|
|
776
816
|
]
|
|
777
817
|
}
|
|
778
818
|
);
|
|
779
|
-
},
|
|
780
|
-
date:
|
|
819
|
+
}, un = ({
|
|
820
|
+
date: e,
|
|
781
821
|
setDate: n,
|
|
782
822
|
filter: t,
|
|
783
823
|
setViews: o,
|
|
784
824
|
dateRange: l,
|
|
785
825
|
setDateRange: u,
|
|
786
826
|
onChange: i,
|
|
787
|
-
minDate:
|
|
788
|
-
maxDate:
|
|
827
|
+
minDate: g,
|
|
828
|
+
maxDate: f,
|
|
789
829
|
input: r
|
|
790
830
|
}) => {
|
|
791
|
-
var
|
|
792
|
-
const d = (
|
|
831
|
+
var N;
|
|
832
|
+
const d = (N = l.from) == null ? void 0 : N.getFullYear(), w = e.getFullYear(), M = (m) => {
|
|
793
833
|
t ? (k(m), n(m)) : (o("days"), n(m));
|
|
794
834
|
}, k = (m) => {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
835
|
+
let h = { ...l };
|
|
836
|
+
if (h.from && h.to)
|
|
837
|
+
h = { from: m, to: null };
|
|
838
|
+
else if (!h.from)
|
|
839
|
+
h = { from: m, to: null };
|
|
799
840
|
else {
|
|
800
|
-
const
|
|
801
|
-
m.getTime() >
|
|
841
|
+
const s = h.from.getTime();
|
|
842
|
+
m.getTime() > s ? h = { from: h.from, to: m } : h = { from: m, to: h.from };
|
|
802
843
|
}
|
|
803
|
-
u(
|
|
844
|
+
u(h), i(h);
|
|
804
845
|
};
|
|
805
|
-
return /* @__PURE__ */
|
|
806
|
-
var
|
|
807
|
-
const s = l.from != null && new Date(
|
|
808
|
-
return /* @__PURE__ */
|
|
846
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((m, h) => {
|
|
847
|
+
var z, c, y;
|
|
848
|
+
const s = l.from != null && new Date(w, h).getTime() > l.from.getTime() && new Date(w, h).getTime() < (((z = l.to) == null ? void 0 : z.getTime()) || l.from.getTime()), x = g && new Date(w, h) < g || f && new Date(w, h) > f;
|
|
849
|
+
return /* @__PURE__ */ a(
|
|
809
850
|
"p",
|
|
810
851
|
{
|
|
811
|
-
className: d ===
|
|
852
|
+
className: d === w && (h === ((c = l.from) == null ? void 0 : c.getMonth()) || h === ((y = l.to) == null ? void 0 : y.getMonth())) ? "sa-calendar-months-active" : "",
|
|
812
853
|
style: {
|
|
813
854
|
backgroundColor: s ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
814
855
|
pointerEvents: x ? "none" : void 0,
|
|
@@ -817,72 +858,73 @@ const O = (a) => {
|
|
|
817
858
|
...r ? {} : { width: "100%" }
|
|
818
859
|
},
|
|
819
860
|
onClick: () => {
|
|
820
|
-
x || M(new Date(
|
|
861
|
+
x || M(new Date(w, h));
|
|
821
862
|
},
|
|
822
863
|
children: m.slice(0, 3)
|
|
823
864
|
},
|
|
824
|
-
|
|
865
|
+
h
|
|
825
866
|
);
|
|
826
867
|
}) });
|
|
827
|
-
}, q = (
|
|
828
|
-
const n = Math.floor(
|
|
868
|
+
}, q = (e) => {
|
|
869
|
+
const n = Math.floor(e / 10) * 10, t = n + 10;
|
|
829
870
|
return { start: n, end: t };
|
|
830
871
|
}, hn = ({
|
|
831
|
-
date:
|
|
872
|
+
date: e,
|
|
832
873
|
filter: n,
|
|
833
874
|
setViews: t,
|
|
834
875
|
setDate: o,
|
|
835
876
|
dateRange: l,
|
|
836
877
|
setDateRange: u,
|
|
837
878
|
onChange: i,
|
|
838
|
-
minDate:
|
|
839
|
-
maxDate:
|
|
879
|
+
minDate: g,
|
|
880
|
+
maxDate: f,
|
|
840
881
|
input: r
|
|
841
882
|
}) => {
|
|
842
|
-
var x,
|
|
883
|
+
var x, z;
|
|
843
884
|
let d = [];
|
|
844
|
-
const
|
|
845
|
-
for (let
|
|
846
|
-
const
|
|
885
|
+
const w = e.getFullYear(), { start: M, end: k } = q(w), N = (x = l.from) == null ? void 0 : x.getFullYear(), m = (z = l.to) == null ? void 0 : z.getFullYear();
|
|
886
|
+
for (let c = M; c < k; c++) {
|
|
887
|
+
const y = new Date(c, 0), p = (!g || y >= g) && (!f || y <= f), b = N != null && c === N || m != null && c === m, E = l.from != null && l.to != null && y > l.from && y < l.to;
|
|
847
888
|
d.push({
|
|
848
|
-
year:
|
|
849
|
-
active:
|
|
850
|
-
highlight:
|
|
851
|
-
disabled: !
|
|
889
|
+
year: c,
|
|
890
|
+
active: b && p,
|
|
891
|
+
highlight: E && p,
|
|
892
|
+
disabled: !p
|
|
852
893
|
});
|
|
853
894
|
}
|
|
854
|
-
const
|
|
855
|
-
n ? (s(
|
|
856
|
-
}, s = (
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
895
|
+
const h = (c) => {
|
|
896
|
+
n ? (s(c), o(c)) : (o(c), t("months"));
|
|
897
|
+
}, s = (c) => {
|
|
898
|
+
let y = { ...l };
|
|
899
|
+
if (y.from && y.to)
|
|
900
|
+
y = { from: c, to: null };
|
|
901
|
+
else if (!y.from)
|
|
902
|
+
y = { from: c, to: null };
|
|
861
903
|
else {
|
|
862
|
-
const
|
|
863
|
-
|
|
904
|
+
const p = y.from.getTime();
|
|
905
|
+
c.getTime() > p ? y = { from: y.from, to: c } : y = { from: c, to: y.from };
|
|
864
906
|
}
|
|
865
|
-
u(
|
|
907
|
+
u(y), i(y);
|
|
866
908
|
};
|
|
867
|
-
return /* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: d.map((c, y) => /* @__PURE__ */ a(
|
|
868
910
|
"p",
|
|
869
911
|
{
|
|
870
|
-
className: `${
|
|
912
|
+
className: `${c.active ? "sa-calendar-months-active" : ""} ${c.highlight ? "sa-calendar-months-highlight" : ""} ${c.disabled ? "sa-calendar-disabled" : ""}`,
|
|
871
913
|
onClick: () => {
|
|
872
|
-
|
|
914
|
+
c.disabled || h(new Date(c.year, 0));
|
|
873
915
|
},
|
|
874
916
|
style: {
|
|
875
|
-
backgroundColor:
|
|
876
|
-
color:
|
|
877
|
-
cursor:
|
|
878
|
-
pointerEvents:
|
|
917
|
+
backgroundColor: c.highlight ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
918
|
+
color: c.highlight ? "var(--sa-color-gray-500, #8c8f97)" : c.active ? "" : c.disabled ? "var(--sa-color-gray-400, #b7b9be)" : "",
|
|
919
|
+
cursor: c.disabled ? "not-allowed" : "pointer",
|
|
920
|
+
pointerEvents: c.disbled ? "none" : "all",
|
|
879
921
|
...r ? {} : { width: "100%" }
|
|
880
922
|
},
|
|
881
|
-
children:
|
|
923
|
+
children: c.year
|
|
882
924
|
},
|
|
883
|
-
|
|
925
|
+
y
|
|
884
926
|
)) });
|
|
885
|
-
}, tn = ({ ...
|
|
927
|
+
}, tn = ({ ...e }) => /* @__PURE__ */ a(
|
|
886
928
|
"svg",
|
|
887
929
|
{
|
|
888
930
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -890,8 +932,8 @@ const O = (a) => {
|
|
|
890
932
|
height: "20",
|
|
891
933
|
viewBox: "0 0 20 20",
|
|
892
934
|
fill: "none",
|
|
893
|
-
...
|
|
894
|
-
children: /* @__PURE__ */
|
|
935
|
+
...e,
|
|
936
|
+
children: /* @__PURE__ */ a(
|
|
895
937
|
"path",
|
|
896
938
|
{
|
|
897
939
|
d: "M12.5 3.33334L5.83337 10L12.5 16.6667",
|
|
@@ -902,7 +944,7 @@ const O = (a) => {
|
|
|
902
944
|
}
|
|
903
945
|
)
|
|
904
946
|
}
|
|
905
|
-
), sn = ({ ...
|
|
947
|
+
), sn = ({ ...e }) => /* @__PURE__ */ a(
|
|
906
948
|
"svg",
|
|
907
949
|
{
|
|
908
950
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -910,8 +952,8 @@ const O = (a) => {
|
|
|
910
952
|
height: "20",
|
|
911
953
|
viewBox: "0 0 20 20",
|
|
912
954
|
fill: "none",
|
|
913
|
-
...
|
|
914
|
-
children: /* @__PURE__ */
|
|
955
|
+
...e,
|
|
956
|
+
children: /* @__PURE__ */ a(
|
|
915
957
|
"path",
|
|
916
958
|
{
|
|
917
959
|
d: "M7.5 16.6667L14.1667 10L7.5 3.33334",
|
|
@@ -923,14 +965,14 @@ const O = (a) => {
|
|
|
923
965
|
)
|
|
924
966
|
}
|
|
925
967
|
), gn = ({
|
|
926
|
-
setViews:
|
|
968
|
+
setViews: e,
|
|
927
969
|
views: n,
|
|
928
970
|
filter: t,
|
|
929
971
|
date: o,
|
|
930
972
|
setDate: l
|
|
931
973
|
}) => {
|
|
932
974
|
const u = () => {
|
|
933
|
-
t ||
|
|
975
|
+
t || e((r) => r === "days" ? "months" : r === "months" ? "years" : "days");
|
|
934
976
|
}, i = () => {
|
|
935
977
|
if (n === "years") {
|
|
936
978
|
l((r) => new Date(r.getFullYear() + 10, 0));
|
|
@@ -941,7 +983,7 @@ const O = (a) => {
|
|
|
941
983
|
return;
|
|
942
984
|
}
|
|
943
985
|
l((r) => new Date(r.getFullYear(), r.getMonth() + 1));
|
|
944
|
-
},
|
|
986
|
+
}, g = () => {
|
|
945
987
|
if (n === "years") {
|
|
946
988
|
l((r) => new Date(r.getFullYear() - 10, 0));
|
|
947
989
|
return;
|
|
@@ -957,8 +999,8 @@ const O = (a) => {
|
|
|
957
999
|
)
|
|
958
1000
|
);
|
|
959
1001
|
};
|
|
960
|
-
return /* @__PURE__ */
|
|
961
|
-
/* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-header", children: [
|
|
1003
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: u, children: (() => {
|
|
962
1004
|
if (n === "days")
|
|
963
1005
|
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
964
1006
|
if (n === "months")
|
|
@@ -966,140 +1008,140 @@ const O = (a) => {
|
|
|
966
1008
|
if (n === "years")
|
|
967
1009
|
return `${q(o.getFullYear()).start} ~ ${q(o.getFullYear()).end}`;
|
|
968
1010
|
})() }),
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
1011
|
+
/* @__PURE__ */ $("div", { className: "sa-calendar-header-nav", children: [
|
|
1012
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: g, children: /* @__PURE__ */ a(tn, {}) }),
|
|
1013
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: i, children: /* @__PURE__ */ a(sn, {}) })
|
|
972
1014
|
] })
|
|
973
1015
|
] });
|
|
974
1016
|
};
|
|
975
|
-
function P(
|
|
976
|
-
const n = new Date(
|
|
1017
|
+
function P(e) {
|
|
1018
|
+
const n = new Date(e), t = n.getFullYear(), o = n.getMonth();
|
|
977
1019
|
return `${n.getDate().toString().padStart(2, "0")} ${ln[o]} ${t}`;
|
|
978
1020
|
}
|
|
979
1021
|
const on = ({
|
|
980
|
-
label:
|
|
1022
|
+
label: e,
|
|
981
1023
|
labelPosition: n = "outside-top",
|
|
982
1024
|
required: t,
|
|
983
1025
|
optional: o,
|
|
984
1026
|
description: l,
|
|
985
1027
|
helperText: u,
|
|
986
1028
|
errorText: i,
|
|
987
|
-
fullWidth:
|
|
988
|
-
children:
|
|
1029
|
+
fullWidth: g,
|
|
1030
|
+
children: f
|
|
989
1031
|
}) => {
|
|
990
1032
|
const r = [
|
|
991
1033
|
"sa-date-field",
|
|
992
|
-
|
|
993
|
-
].filter(Boolean).join(" "), d =
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
o && /* @__PURE__ */
|
|
996
|
-
t && /* @__PURE__ */
|
|
997
|
-
] }) : null,
|
|
998
|
-
u && !i && /* @__PURE__ */
|
|
999
|
-
i && /* @__PURE__ */
|
|
1034
|
+
g ? "sa-date-field-fullwidth" : ""
|
|
1035
|
+
].filter(Boolean).join(" "), d = e ? /* @__PURE__ */ $("div", { className: "sa-date-field-label-row", children: [
|
|
1036
|
+
/* @__PURE__ */ a("span", { className: "sa-date-field-label-text", children: e }),
|
|
1037
|
+
o && /* @__PURE__ */ a("span", { className: "sa-date-field-optional-badge", children: "Optional" }),
|
|
1038
|
+
t && /* @__PURE__ */ a("span", { className: "sa-date-field-required", children: "*" })
|
|
1039
|
+
] }) : null, w = /* @__PURE__ */ $(en, { children: [
|
|
1040
|
+
u && !i && /* @__PURE__ */ a("p", { className: "sa-date-field-helper", children: u }),
|
|
1041
|
+
i && /* @__PURE__ */ a("p", { className: "sa-date-field-error-msg", children: i })
|
|
1000
1042
|
] });
|
|
1001
|
-
return
|
|
1002
|
-
/* @__PURE__ */
|
|
1043
|
+
return e ? n === "outside-left" ? /* @__PURE__ */ $("div", { className: `${r} sa-date-field-left`, children: [
|
|
1044
|
+
/* @__PURE__ */ $("div", { className: "sa-date-field-left-label", children: [
|
|
1003
1045
|
d,
|
|
1004
|
-
l && /* @__PURE__ */
|
|
1046
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l })
|
|
1005
1047
|
] }),
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
|
|
1008
|
-
|
|
1048
|
+
/* @__PURE__ */ $("div", { className: "sa-date-field-input-wrap", children: [
|
|
1049
|
+
f,
|
|
1050
|
+
w
|
|
1009
1051
|
] })
|
|
1010
|
-
] }) : /* @__PURE__ */
|
|
1052
|
+
] }) : /* @__PURE__ */ $("div", { className: r, children: [
|
|
1011
1053
|
d,
|
|
1012
|
-
l && /* @__PURE__ */
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
] }) : /* @__PURE__ */
|
|
1016
|
-
l && /* @__PURE__ */
|
|
1017
|
-
|
|
1018
|
-
|
|
1054
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
1055
|
+
f,
|
|
1056
|
+
w
|
|
1057
|
+
] }) : /* @__PURE__ */ $("div", { className: r, children: [
|
|
1058
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
1059
|
+
f,
|
|
1060
|
+
w
|
|
1019
1061
|
] });
|
|
1020
|
-
}, X = "sa-calendar-styles", fn = (
|
|
1062
|
+
}, X = "sa-calendar-styles", fn = (e) => {
|
|
1021
1063
|
if (!document.getElementById(X)) {
|
|
1022
1064
|
const n = document.createElement("style");
|
|
1023
|
-
n.id = X, n.textContent =
|
|
1065
|
+
n.id = X, n.textContent = e, document.head.appendChild(n);
|
|
1024
1066
|
}
|
|
1025
1067
|
};
|
|
1026
1068
|
fn(R);
|
|
1027
|
-
const
|
|
1069
|
+
const mn = K(
|
|
1028
1070
|
({
|
|
1029
|
-
value:
|
|
1071
|
+
value: e,
|
|
1030
1072
|
onChange: n,
|
|
1031
1073
|
filter: t,
|
|
1032
1074
|
input: o = !0,
|
|
1033
1075
|
disabled: l,
|
|
1034
1076
|
minDate: u,
|
|
1035
1077
|
maxDate: i,
|
|
1036
|
-
placeholder:
|
|
1037
|
-
size:
|
|
1078
|
+
placeholder: g,
|
|
1079
|
+
size: f = "sm",
|
|
1038
1080
|
variant: r,
|
|
1039
1081
|
status: d,
|
|
1040
|
-
clearable:
|
|
1082
|
+
clearable: w,
|
|
1041
1083
|
fullWidth: M = !0,
|
|
1042
1084
|
withPadding: k = !0,
|
|
1043
|
-
label:
|
|
1085
|
+
label: N,
|
|
1044
1086
|
labelPosition: m,
|
|
1045
|
-
required:
|
|
1087
|
+
required: h,
|
|
1046
1088
|
optional: s,
|
|
1047
1089
|
description: x,
|
|
1048
|
-
helperText:
|
|
1049
|
-
errorText:
|
|
1050
|
-
},
|
|
1051
|
-
const
|
|
1052
|
-
from: (
|
|
1053
|
-
to: (
|
|
1090
|
+
helperText: z,
|
|
1091
|
+
errorText: c
|
|
1092
|
+
}, y) => {
|
|
1093
|
+
const p = c ? "error" : d, { ref: b, isComponentVisible: E, setIsComponentVisible: S } = rn(!1), D = J(null), [F, I] = A("days"), [T, Y] = A(/* @__PURE__ */ new Date()), [C, L] = A({
|
|
1094
|
+
from: (e == null ? void 0 : e.from) ?? null,
|
|
1095
|
+
to: (e == null ? void 0 : e.to) ?? null
|
|
1054
1096
|
});
|
|
1055
1097
|
B(() => {
|
|
1056
|
-
if (
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1098
|
+
if (e) {
|
|
1099
|
+
const v = e;
|
|
1100
|
+
v.from && Y(v.from), L(v);
|
|
1059
1101
|
} else
|
|
1060
|
-
|
|
1061
|
-
}, [
|
|
1102
|
+
Y(/* @__PURE__ */ new Date()), L({ from: null, to: null });
|
|
1103
|
+
}, [e]), B(() => {
|
|
1062
1104
|
t && I(t);
|
|
1063
1105
|
}, [t]), B(() => {
|
|
1064
1106
|
t || I("days");
|
|
1065
|
-
}, [
|
|
1107
|
+
}, [E]), B(() => {
|
|
1066
1108
|
o || S(!0);
|
|
1067
1109
|
}, [o]);
|
|
1068
1110
|
const G = () => {
|
|
1069
|
-
var
|
|
1070
|
-
if (!
|
|
1111
|
+
var v, V;
|
|
1112
|
+
if (!e)
|
|
1071
1113
|
return "";
|
|
1072
1114
|
if (t) {
|
|
1073
|
-
if (
|
|
1074
|
-
return `${P(
|
|
1075
|
-
if (
|
|
1076
|
-
return `${W[
|
|
1077
|
-
if (
|
|
1078
|
-
return `${(
|
|
1115
|
+
if (F === "days")
|
|
1116
|
+
return `${P(C.from)} ~ ${P(C.to || C.from) || "-"}`;
|
|
1117
|
+
if (F === "months")
|
|
1118
|
+
return `${W[C.from.getMonth()]} ~ ${C.to ? W[C.to.getMonth()] : "-"}`;
|
|
1119
|
+
if (F === "years")
|
|
1120
|
+
return `${(v = C.from) == null ? void 0 : v.getFullYear()} ~ ${((V = C.to) == null ? void 0 : V.getFullYear()) || "-"}`;
|
|
1079
1121
|
} else
|
|
1080
|
-
return `${P(
|
|
1122
|
+
return `${P(C.from)} ~ ${P(C.to || C.from) || "-"}`;
|
|
1081
1123
|
}, j = () => {
|
|
1082
|
-
if (
|
|
1083
|
-
const
|
|
1084
|
-
window.innerWidth <
|
|
1124
|
+
if (D.current && b.current && o) {
|
|
1125
|
+
const v = b.current.getBoundingClientRect(), V = D.current.getBoundingClientRect();
|
|
1126
|
+
window.innerWidth < v.left + V.width ? D.current.style.left = `${v.left - V.width + v.width}px` : D.current.style.left = `${v.left}px`, v.top + V.height > window.innerHeight ? D.current.style.top = `${v.y - (v.height + V.height - 28)}px` : D.current.style.top = `${v.y + v.height}px`;
|
|
1085
1127
|
}
|
|
1086
1128
|
};
|
|
1087
1129
|
B(() => {
|
|
1088
|
-
|
|
1089
|
-
}, [
|
|
1090
|
-
const
|
|
1091
|
-
return
|
|
1092
|
-
|
|
1130
|
+
D.current && b.current && o && j();
|
|
1131
|
+
}, [D, b, E]), B(() => {
|
|
1132
|
+
const v = y == null ? void 0 : y.current;
|
|
1133
|
+
return v && v.addEventListener("scroll", j), window.addEventListener("scroll", j), () => {
|
|
1134
|
+
v && v.removeEventListener("scroll", j), window.removeEventListener("scroll", j);
|
|
1093
1135
|
};
|
|
1094
1136
|
}, []);
|
|
1095
|
-
const U = /* @__PURE__ */
|
|
1137
|
+
const U = /* @__PURE__ */ $(
|
|
1096
1138
|
"div",
|
|
1097
1139
|
{
|
|
1098
1140
|
className: "sa-calendar-wrapper",
|
|
1099
1141
|
style: { height: o ? "auto" : "100%" },
|
|
1100
|
-
ref: o ?
|
|
1142
|
+
ref: o ? b : null,
|
|
1101
1143
|
children: [
|
|
1102
|
-
o ? /* @__PURE__ */
|
|
1144
|
+
o ? /* @__PURE__ */ a(
|
|
1103
1145
|
cn,
|
|
1104
1146
|
{
|
|
1105
1147
|
value: G(),
|
|
@@ -1110,68 +1152,68 @@ const bn = K(
|
|
|
1110
1152
|
onChange: () => {
|
|
1111
1153
|
},
|
|
1112
1154
|
disabled: l,
|
|
1113
|
-
placeholder:
|
|
1114
|
-
size:
|
|
1155
|
+
placeholder: g,
|
|
1156
|
+
size: f,
|
|
1115
1157
|
variant: r,
|
|
1116
|
-
status:
|
|
1117
|
-
clearable:
|
|
1158
|
+
status: p,
|
|
1159
|
+
clearable: w,
|
|
1118
1160
|
onClear: () => n(void 0)
|
|
1119
1161
|
}
|
|
1120
1162
|
) : null,
|
|
1121
|
-
|
|
1163
|
+
E ? /* @__PURE__ */ $(
|
|
1122
1164
|
"div",
|
|
1123
1165
|
{
|
|
1124
|
-
className: `sa-calendar sa-calendar-size-${
|
|
1166
|
+
className: `sa-calendar sa-calendar-size-${f || "sm"} ${o ? "" : "sa-calendar-no-input"} ${k ? "" : "sa-calendar-no-padding"}`,
|
|
1125
1167
|
style: l ? { pointerEvents: "none" } : void 0,
|
|
1126
|
-
ref:
|
|
1168
|
+
ref: D,
|
|
1127
1169
|
children: [
|
|
1128
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ a(
|
|
1129
1171
|
gn,
|
|
1130
1172
|
{
|
|
1131
1173
|
setViews: I,
|
|
1132
|
-
views:
|
|
1174
|
+
views: F,
|
|
1133
1175
|
filter: t,
|
|
1134
1176
|
date: T,
|
|
1135
|
-
setDate:
|
|
1177
|
+
setDate: Y
|
|
1136
1178
|
}
|
|
1137
1179
|
),
|
|
1138
|
-
/* @__PURE__ */
|
|
1139
|
-
|
|
1180
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: F === "days" ? /* @__PURE__ */ a(
|
|
1181
|
+
pn,
|
|
1140
1182
|
{
|
|
1141
1183
|
date: T,
|
|
1142
|
-
setDate:
|
|
1184
|
+
setDate: Y,
|
|
1143
1185
|
setIsComponentVisible: S,
|
|
1144
|
-
dateRange:
|
|
1145
|
-
setDateRange:
|
|
1186
|
+
dateRange: C,
|
|
1187
|
+
setDateRange: L,
|
|
1146
1188
|
input: o,
|
|
1147
1189
|
onChange: n,
|
|
1148
1190
|
minDate: u,
|
|
1149
1191
|
maxDate: i
|
|
1150
1192
|
}
|
|
1151
|
-
) :
|
|
1152
|
-
|
|
1193
|
+
) : F === "months" ? /* @__PURE__ */ a(
|
|
1194
|
+
un,
|
|
1153
1195
|
{
|
|
1154
1196
|
date: T,
|
|
1155
|
-
setDate:
|
|
1197
|
+
setDate: Y,
|
|
1156
1198
|
filter: t,
|
|
1157
1199
|
setViews: I,
|
|
1158
|
-
dateRange:
|
|
1159
|
-
setDateRange:
|
|
1200
|
+
dateRange: C,
|
|
1201
|
+
setDateRange: L,
|
|
1160
1202
|
setIsComponentVisible: S,
|
|
1161
1203
|
input: o,
|
|
1162
1204
|
onChange: n,
|
|
1163
1205
|
minDate: u,
|
|
1164
1206
|
maxDate: i
|
|
1165
1207
|
}
|
|
1166
|
-
) : /* @__PURE__ */
|
|
1208
|
+
) : /* @__PURE__ */ a(
|
|
1167
1209
|
hn,
|
|
1168
1210
|
{
|
|
1169
1211
|
date: T,
|
|
1170
|
-
setDate:
|
|
1212
|
+
setDate: Y,
|
|
1171
1213
|
filter: t,
|
|
1172
1214
|
setViews: I,
|
|
1173
|
-
dateRange:
|
|
1174
|
-
setDateRange:
|
|
1215
|
+
dateRange: C,
|
|
1216
|
+
setDateRange: L,
|
|
1175
1217
|
setIsComponentVisible: S,
|
|
1176
1218
|
input: o,
|
|
1177
1219
|
onChange: n,
|
|
@@ -1185,55 +1227,57 @@ const bn = K(
|
|
|
1185
1227
|
]
|
|
1186
1228
|
}
|
|
1187
1229
|
);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ a(
|
|
1189
1231
|
on,
|
|
1190
1232
|
{
|
|
1191
|
-
label:
|
|
1233
|
+
label: N,
|
|
1192
1234
|
labelPosition: m,
|
|
1193
|
-
required:
|
|
1235
|
+
required: h,
|
|
1194
1236
|
optional: s,
|
|
1195
1237
|
description: x,
|
|
1196
|
-
helperText:
|
|
1197
|
-
errorText:
|
|
1238
|
+
helperText: z,
|
|
1239
|
+
errorText: c,
|
|
1198
1240
|
fullWidth: M,
|
|
1199
1241
|
children: U
|
|
1200
1242
|
}
|
|
1201
1243
|
);
|
|
1202
1244
|
}
|
|
1203
|
-
), _ = "sa-calendar-input-styles",
|
|
1245
|
+
), _ = "sa-calendar-input-styles", bn = (e) => {
|
|
1204
1246
|
if (!document.getElementById(_)) {
|
|
1205
1247
|
const n = document.createElement("style");
|
|
1206
|
-
n.id = _, n.textContent =
|
|
1248
|
+
n.id = _, n.textContent = e, document.head.appendChild(n);
|
|
1207
1249
|
}
|
|
1208
1250
|
};
|
|
1209
|
-
|
|
1210
|
-
const H = (
|
|
1211
|
-
if (
|
|
1251
|
+
bn(R);
|
|
1252
|
+
const H = (e) => {
|
|
1253
|
+
if (e === "xs")
|
|
1254
|
+
return 14;
|
|
1255
|
+
if (e === "sm")
|
|
1212
1256
|
return 16;
|
|
1213
|
-
if (
|
|
1257
|
+
if (e === "md")
|
|
1214
1258
|
return 16;
|
|
1215
|
-
if (
|
|
1259
|
+
if (e === "lg")
|
|
1216
1260
|
return 20;
|
|
1217
|
-
}, vn = (
|
|
1261
|
+
}, vn = (e) => {
|
|
1218
1262
|
const {
|
|
1219
|
-
size: n = "
|
|
1263
|
+
size: n = "sm",
|
|
1220
1264
|
status: t = "default",
|
|
1221
1265
|
variant: o = "outline",
|
|
1222
1266
|
clearable: l,
|
|
1223
1267
|
onClear: u,
|
|
1224
1268
|
...i
|
|
1225
|
-
} =
|
|
1226
|
-
|
|
1227
|
-
}, r = t === "disable" || i.disabled, d = !!i.value,
|
|
1269
|
+
} = e, g = J(null), f = () => {
|
|
1270
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
1271
|
+
}, r = t === "disable" || i.disabled, d = !!i.value, w = l && d && !r, M = (k) => {
|
|
1228
1272
|
k.stopPropagation(), u == null || u();
|
|
1229
1273
|
};
|
|
1230
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ $(
|
|
1231
1275
|
"div",
|
|
1232
1276
|
{
|
|
1233
1277
|
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${n} `,
|
|
1234
|
-
onClick:
|
|
1278
|
+
onClick: f,
|
|
1235
1279
|
children: [
|
|
1236
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
1237
1281
|
"svg",
|
|
1238
1282
|
{
|
|
1239
1283
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1241,7 +1285,7 @@ const H = (a) => {
|
|
|
1241
1285
|
height: H(n),
|
|
1242
1286
|
viewBox: "0 0 20 20",
|
|
1243
1287
|
fill: "none",
|
|
1244
|
-
children: /* @__PURE__ */
|
|
1288
|
+
children: /* @__PURE__ */ a(
|
|
1245
1289
|
"path",
|
|
1246
1290
|
{
|
|
1247
1291
|
d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
|
|
@@ -1253,24 +1297,24 @@ const H = (a) => {
|
|
|
1253
1297
|
)
|
|
1254
1298
|
}
|
|
1255
1299
|
) }),
|
|
1256
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-preview-container", children: /* @__PURE__ */ a(
|
|
1257
1301
|
"input",
|
|
1258
1302
|
{
|
|
1259
1303
|
className: "sa-calendar-input",
|
|
1260
1304
|
...i,
|
|
1261
1305
|
disabled: r,
|
|
1262
1306
|
value: i.value,
|
|
1263
|
-
ref:
|
|
1307
|
+
ref: g
|
|
1264
1308
|
}
|
|
1265
1309
|
) }),
|
|
1266
|
-
|
|
1310
|
+
w ? /* @__PURE__ */ a(
|
|
1267
1311
|
"button",
|
|
1268
1312
|
{
|
|
1269
1313
|
type: "button",
|
|
1270
1314
|
"aria-label": "Clear date",
|
|
1271
1315
|
className: "sa-calendar-input-clear",
|
|
1272
1316
|
onClick: M,
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1317
|
+
children: /* @__PURE__ */ a(
|
|
1274
1318
|
"svg",
|
|
1275
1319
|
{
|
|
1276
1320
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1278,7 +1322,7 @@ const H = (a) => {
|
|
|
1278
1322
|
height: H(n),
|
|
1279
1323
|
viewBox: "0 0 20 20",
|
|
1280
1324
|
fill: "none",
|
|
1281
|
-
children: /* @__PURE__ */
|
|
1325
|
+
children: /* @__PURE__ */ a(
|
|
1282
1326
|
"path",
|
|
1283
1327
|
{
|
|
1284
1328
|
d: "M5 5L15 15M15 5L5 15",
|
|
@@ -1291,7 +1335,7 @@ const H = (a) => {
|
|
|
1291
1335
|
}
|
|
1292
1336
|
)
|
|
1293
1337
|
}
|
|
1294
|
-
) : /* @__PURE__ */
|
|
1338
|
+
) : /* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-right", children: /* @__PURE__ */ a(
|
|
1295
1339
|
"svg",
|
|
1296
1340
|
{
|
|
1297
1341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1299,7 +1343,7 @@ const H = (a) => {
|
|
|
1299
1343
|
height: H(n),
|
|
1300
1344
|
viewBox: "0 0 20 20",
|
|
1301
1345
|
fill: "none",
|
|
1302
|
-
children: /* @__PURE__ */
|
|
1346
|
+
children: /* @__PURE__ */ a(
|
|
1303
1347
|
"path",
|
|
1304
1348
|
{
|
|
1305
1349
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1315,26 +1359,26 @@ const H = (a) => {
|
|
|
1315
1359
|
}
|
|
1316
1360
|
);
|
|
1317
1361
|
}, yn = ({
|
|
1318
|
-
date:
|
|
1362
|
+
date: e,
|
|
1319
1363
|
setDate: n,
|
|
1320
1364
|
previewDate: t,
|
|
1321
1365
|
setPreviewDate: o,
|
|
1322
1366
|
setIsComponentVisible: l,
|
|
1323
1367
|
minDate: u,
|
|
1324
1368
|
maxDate: i,
|
|
1325
|
-
input:
|
|
1326
|
-
onChange:
|
|
1369
|
+
input: g,
|
|
1370
|
+
onChange: f,
|
|
1327
1371
|
hasValue: r
|
|
1328
1372
|
}) => {
|
|
1329
1373
|
let d = new Date(
|
|
1330
1374
|
t.getFullYear(),
|
|
1331
1375
|
t.getMonth(),
|
|
1332
1376
|
1
|
|
1333
|
-
),
|
|
1334
|
-
const k =
|
|
1377
|
+
), w = d.getDay(), M = [];
|
|
1378
|
+
const k = e.toDateString(), N = (/* @__PURE__ */ new Date()).toDateString(), m = t.getMonth();
|
|
1335
1379
|
for (let s = 0; s < 42; s++) {
|
|
1336
|
-
s === 0 &&
|
|
1337
|
-
d.getDate() + (s -
|
|
1380
|
+
s === 0 && w === 0 ? d.setDate(d.getDate() - 7) : s === 0 ? d.setDate(
|
|
1381
|
+
d.getDate() + (s - w)
|
|
1338
1382
|
) : d.setDate(d.getDate() + 1);
|
|
1339
1383
|
let x = {
|
|
1340
1384
|
currentMonth: d.getMonth() === m,
|
|
@@ -1342,31 +1386,31 @@ const H = (a) => {
|
|
|
1342
1386
|
month: d.getMonth(),
|
|
1343
1387
|
number: d.getDate(),
|
|
1344
1388
|
selected: r && d.toDateString() === k,
|
|
1345
|
-
isToday: d.toDateString() ===
|
|
1389
|
+
isToday: d.toDateString() === N,
|
|
1346
1390
|
year: d.getFullYear(),
|
|
1347
1391
|
isDisabled: u && d < u || i && d > i
|
|
1348
1392
|
};
|
|
1349
1393
|
M.push(x);
|
|
1350
1394
|
}
|
|
1351
|
-
const
|
|
1352
|
-
(!u || s >= u) && (!i || s <= i) && (n(s),
|
|
1395
|
+
const h = (s) => {
|
|
1396
|
+
(!u || s >= u) && (!i || s <= i) && (n(s), f(s), o(s), g && l(!1));
|
|
1353
1397
|
};
|
|
1354
|
-
return /* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
const
|
|
1358
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-days-preivew", children: [
|
|
1399
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: an.map((s, x) => /* @__PURE__ */ a("p", { children: s }, x)) }),
|
|
1400
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: M.map((s, x) => {
|
|
1401
|
+
const z = s.isDisabled;
|
|
1402
|
+
return /* @__PURE__ */ a(
|
|
1359
1403
|
"p",
|
|
1360
1404
|
{
|
|
1361
1405
|
className: `${s.currentMonth ? "sa-calendar-days-current" : "sa-calendar-days"} ${s.selected ? "sa-calendar-days-active" : ""} ${s.isToday && !s.selected ? "sa-calendar-days-today" : ""}`,
|
|
1362
1406
|
style: {
|
|
1363
|
-
color:
|
|
1364
|
-
pointerEvents:
|
|
1365
|
-
cursor:
|
|
1366
|
-
...
|
|
1407
|
+
color: z ? "#ccc" : void 0,
|
|
1408
|
+
pointerEvents: z ? "none" : void 0,
|
|
1409
|
+
cursor: z ? "not-allowed" : "pointer",
|
|
1410
|
+
...g ? {} : { width: "100%" }
|
|
1367
1411
|
},
|
|
1368
1412
|
onClick: () => {
|
|
1369
|
-
|
|
1413
|
+
z || h(s.date);
|
|
1370
1414
|
},
|
|
1371
1415
|
children: s.number
|
|
1372
1416
|
},
|
|
@@ -1375,27 +1419,27 @@ const H = (a) => {
|
|
|
1375
1419
|
}) })
|
|
1376
1420
|
] });
|
|
1377
1421
|
}, wn = ({
|
|
1378
|
-
date:
|
|
1422
|
+
date: e,
|
|
1379
1423
|
setDate: n,
|
|
1380
1424
|
filter: t,
|
|
1381
1425
|
setViews: o,
|
|
1382
1426
|
onChange: l,
|
|
1383
1427
|
previewDate: u,
|
|
1384
1428
|
setPreviewDate: i,
|
|
1385
|
-
minDate:
|
|
1386
|
-
maxDate:
|
|
1429
|
+
minDate: g,
|
|
1430
|
+
maxDate: f,
|
|
1387
1431
|
input: r,
|
|
1388
1432
|
hasValue: d
|
|
1389
1433
|
}) => {
|
|
1390
|
-
const
|
|
1391
|
-
(!
|
|
1434
|
+
const w = e.getMonth(), M = e.getFullYear(), k = u.getFullYear(), N = (m) => {
|
|
1435
|
+
(!g || m >= g) && (!f || m <= f) && (t ? (l(m), n(m), i(m)) : (o("days"), i(m)));
|
|
1392
1436
|
};
|
|
1393
|
-
return /* @__PURE__ */
|
|
1394
|
-
const s =
|
|
1395
|
-
return /* @__PURE__ */
|
|
1437
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((m, h) => {
|
|
1438
|
+
const s = g && new Date(k, h, 1) < g || f && new Date(k, h + 1, 0) > f;
|
|
1439
|
+
return /* @__PURE__ */ a(
|
|
1396
1440
|
"p",
|
|
1397
1441
|
{
|
|
1398
|
-
className: d &&
|
|
1442
|
+
className: d && h === w && k === M ? "sa-calendar-months-active" : "",
|
|
1399
1443
|
style: {
|
|
1400
1444
|
color: s ? "#ccc" : void 0,
|
|
1401
1445
|
pointerEvents: s ? "none" : void 0,
|
|
@@ -1403,43 +1447,43 @@ const H = (a) => {
|
|
|
1403
1447
|
...r ? {} : { width: "100%" }
|
|
1404
1448
|
},
|
|
1405
1449
|
onClick: () => {
|
|
1406
|
-
s ||
|
|
1450
|
+
s || N(new Date(k, h));
|
|
1407
1451
|
},
|
|
1408
1452
|
children: m.slice(0, 3)
|
|
1409
1453
|
},
|
|
1410
|
-
|
|
1454
|
+
h
|
|
1411
1455
|
);
|
|
1412
1456
|
}) });
|
|
1413
|
-
}, Z = (
|
|
1414
|
-
const n = Math.floor(
|
|
1457
|
+
}, Z = (e) => {
|
|
1458
|
+
const n = Math.floor(e / 10) * 10, t = n + 10;
|
|
1415
1459
|
return { start: n, end: t };
|
|
1416
1460
|
}, xn = ({
|
|
1417
|
-
date:
|
|
1461
|
+
date: e,
|
|
1418
1462
|
filter: n,
|
|
1419
1463
|
setViews: t,
|
|
1420
1464
|
setDate: o,
|
|
1421
1465
|
onChange: l,
|
|
1422
1466
|
previewDate: u,
|
|
1423
1467
|
setPreviewDate: i,
|
|
1424
|
-
minDate:
|
|
1425
|
-
maxDate:
|
|
1468
|
+
minDate: g,
|
|
1469
|
+
maxDate: f,
|
|
1426
1470
|
input: r,
|
|
1427
1471
|
hasValue: d
|
|
1428
1472
|
}) => {
|
|
1429
|
-
let
|
|
1430
|
-
const M = u.getFullYear(), { start: k, end:
|
|
1431
|
-
for (let s = k; s <
|
|
1432
|
-
let x =
|
|
1433
|
-
|
|
1473
|
+
let w = [];
|
|
1474
|
+
const M = u.getFullYear(), { start: k, end: N } = Z(M), m = e.getFullYear();
|
|
1475
|
+
for (let s = k; s < N; s++) {
|
|
1476
|
+
let x = g && new Date(s, 0, 1) < g || f && new Date(s, 11, 31) > f;
|
|
1477
|
+
w.push({
|
|
1434
1478
|
year: s,
|
|
1435
1479
|
active: !!d && s === m,
|
|
1436
1480
|
isDisabled: x
|
|
1437
1481
|
});
|
|
1438
1482
|
}
|
|
1439
|
-
const
|
|
1440
|
-
(!
|
|
1483
|
+
const h = (s) => {
|
|
1484
|
+
(!g || s >= g) && (!f || s <= f) && (n ? (l(s), o(s), i(s)) : (t("months"), i(s)));
|
|
1441
1485
|
};
|
|
1442
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: w.map((s, x) => /* @__PURE__ */ a(
|
|
1443
1487
|
"p",
|
|
1444
1488
|
{
|
|
1445
1489
|
className: s.active ? "sa-calendar-months-active" : "",
|
|
@@ -1450,21 +1494,21 @@ const H = (a) => {
|
|
|
1450
1494
|
...r ? {} : { width: "100%" }
|
|
1451
1495
|
},
|
|
1452
1496
|
onClick: () => {
|
|
1453
|
-
s.isDisabled ||
|
|
1497
|
+
s.isDisabled || h(new Date(s.year, 0));
|
|
1454
1498
|
},
|
|
1455
1499
|
children: s.year
|
|
1456
1500
|
},
|
|
1457
1501
|
x
|
|
1458
1502
|
)) });
|
|
1459
1503
|
}, kn = ({
|
|
1460
|
-
setViews:
|
|
1504
|
+
setViews: e,
|
|
1461
1505
|
views: n,
|
|
1462
1506
|
filter: t,
|
|
1463
1507
|
previewDate: o,
|
|
1464
1508
|
setPreviewDate: l
|
|
1465
1509
|
}) => {
|
|
1466
1510
|
const u = () => {
|
|
1467
|
-
t ||
|
|
1511
|
+
t || e((r) => r === "days" ? "months" : r === "months" ? "years" : "days");
|
|
1468
1512
|
}, i = () => {
|
|
1469
1513
|
if (n === "years") {
|
|
1470
1514
|
l((r) => new Date(r.getFullYear() + 10, 0));
|
|
@@ -1477,7 +1521,7 @@ const H = (a) => {
|
|
|
1477
1521
|
return;
|
|
1478
1522
|
}
|
|
1479
1523
|
l((r) => new Date(r.getFullYear(), r.getMonth() + 1));
|
|
1480
|
-
},
|
|
1524
|
+
}, g = () => {
|
|
1481
1525
|
if (n === "years") {
|
|
1482
1526
|
l((r) => new Date(r.getFullYear() - 10, 0));
|
|
1483
1527
|
return;
|
|
@@ -1495,8 +1539,8 @@ const H = (a) => {
|
|
|
1495
1539
|
)
|
|
1496
1540
|
);
|
|
1497
1541
|
};
|
|
1498
|
-
return /* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1542
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-header", children: [
|
|
1543
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: u, children: (() => {
|
|
1500
1544
|
if (n === "days")
|
|
1501
1545
|
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
1502
1546
|
if (n === "months")
|
|
@@ -1504,151 +1548,151 @@ const H = (a) => {
|
|
|
1504
1548
|
if (n === "years")
|
|
1505
1549
|
return `${Z(o.getFullYear()).start} ~ ${Z(o.getFullYear()).end}`;
|
|
1506
1550
|
})() }),
|
|
1507
|
-
/* @__PURE__ */
|
|
1508
|
-
/* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ $("div", { className: "sa-calendar-header-nav", children: [
|
|
1552
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: g, children: /* @__PURE__ */ a(tn, {}) }),
|
|
1553
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: i, children: /* @__PURE__ */ a(sn, {}) })
|
|
1510
1554
|
] })
|
|
1511
1555
|
] });
|
|
1512
|
-
}, nn = "sa-calendar-styles", Mn = (
|
|
1556
|
+
}, nn = "sa-calendar-styles", Mn = (e) => {
|
|
1513
1557
|
if (!document.getElementById(nn)) {
|
|
1514
1558
|
const n = document.createElement("style");
|
|
1515
|
-
n.id = nn, n.textContent =
|
|
1559
|
+
n.id = nn, n.textContent = e, document.head.appendChild(n);
|
|
1516
1560
|
}
|
|
1517
1561
|
};
|
|
1518
1562
|
Mn(R);
|
|
1519
1563
|
const Cn = K(
|
|
1520
1564
|
({
|
|
1521
|
-
value:
|
|
1565
|
+
value: e,
|
|
1522
1566
|
onChange: n,
|
|
1523
1567
|
filter: t,
|
|
1524
1568
|
input: o = !0,
|
|
1525
1569
|
disabled: l,
|
|
1526
1570
|
minDate: u,
|
|
1527
1571
|
maxDate: i,
|
|
1528
|
-
placeholder:
|
|
1529
|
-
size:
|
|
1572
|
+
placeholder: g,
|
|
1573
|
+
size: f = "sm",
|
|
1530
1574
|
variant: r,
|
|
1531
1575
|
status: d,
|
|
1532
|
-
clearable:
|
|
1576
|
+
clearable: w,
|
|
1533
1577
|
fullWidth: M = !0,
|
|
1534
1578
|
withPadding: k = !0,
|
|
1535
|
-
label:
|
|
1579
|
+
label: N,
|
|
1536
1580
|
labelPosition: m,
|
|
1537
|
-
required:
|
|
1581
|
+
required: h,
|
|
1538
1582
|
optional: s,
|
|
1539
1583
|
description: x,
|
|
1540
|
-
helperText:
|
|
1541
|
-
errorText:
|
|
1542
|
-
},
|
|
1543
|
-
const
|
|
1584
|
+
helperText: z,
|
|
1585
|
+
errorText: c
|
|
1586
|
+
}, y) => {
|
|
1587
|
+
const p = c ? "error" : d, { ref: b, isComponentVisible: E, setIsComponentVisible: S } = rn(!1), D = J(null), [F, I] = A("days"), [T, Y] = A(/* @__PURE__ */ new Date()), [C, L] = A(/* @__PURE__ */ new Date());
|
|
1544
1588
|
B(() => {
|
|
1545
|
-
|
|
1546
|
-
}, [
|
|
1589
|
+
e ? (Y(e), L(e)) : (Y(/* @__PURE__ */ new Date()), L(/* @__PURE__ */ new Date()));
|
|
1590
|
+
}, [e]), B(() => {
|
|
1547
1591
|
t && I(t);
|
|
1548
1592
|
}, [t]), B(() => {
|
|
1549
1593
|
t || I("days");
|
|
1550
|
-
}, [
|
|
1594
|
+
}, [E]), B(() => {
|
|
1551
1595
|
o || S(!0);
|
|
1552
1596
|
}, [o]);
|
|
1553
|
-
const G = () =>
|
|
1554
|
-
if (
|
|
1555
|
-
const
|
|
1556
|
-
window.innerWidth <
|
|
1597
|
+
const G = () => e ? t === "days" ? P(T) : t === "months" ? `${W[T.getMonth()]} ${T.getFullYear()}` : t === "years" ? T.getFullYear() : P(T) : "", j = () => {
|
|
1598
|
+
if (D.current && b.current && o) {
|
|
1599
|
+
const v = b.current.getBoundingClientRect(), V = D.current.getBoundingClientRect();
|
|
1600
|
+
window.innerWidth < v.left + V.width ? D.current.style.left = `${v.left - V.width + v.width}px` : D.current.style.left = `${v.left}px`, v.top + V.height > window.innerHeight ? D.current.style.top = `${v.y - (v.height + V.height - 28)}px` : D.current.style.top = `${v.y + v.height}px`;
|
|
1557
1601
|
}
|
|
1558
1602
|
};
|
|
1559
1603
|
B(() => {
|
|
1560
|
-
|
|
1561
|
-
}, [
|
|
1562
|
-
const
|
|
1563
|
-
return
|
|
1564
|
-
|
|
1604
|
+
D.current && b.current && o && j();
|
|
1605
|
+
}, [D, b, E]), B(() => {
|
|
1606
|
+
const v = y == null ? void 0 : y.current;
|
|
1607
|
+
return v && v.addEventListener("scroll", j), window.addEventListener("scroll", j), () => {
|
|
1608
|
+
v && v.removeEventListener("scroll", j), window.removeEventListener("scroll", j);
|
|
1565
1609
|
};
|
|
1566
1610
|
}, []);
|
|
1567
|
-
const U = /* @__PURE__ */
|
|
1611
|
+
const U = /* @__PURE__ */ $(
|
|
1568
1612
|
"div",
|
|
1569
1613
|
{
|
|
1570
1614
|
className: "sa-calendar-wrapper",
|
|
1571
1615
|
style: { height: o ? "auto" : "100%" },
|
|
1572
|
-
ref: o ?
|
|
1616
|
+
ref: o ? b : null,
|
|
1573
1617
|
children: [
|
|
1574
|
-
o ? /* @__PURE__ */
|
|
1618
|
+
o ? /* @__PURE__ */ a(
|
|
1575
1619
|
vn,
|
|
1576
1620
|
{
|
|
1577
1621
|
value: G(),
|
|
1578
1622
|
onClick: () => S(!0),
|
|
1579
1623
|
onChange: () => {
|
|
1580
1624
|
},
|
|
1581
|
-
placeholder:
|
|
1625
|
+
placeholder: g,
|
|
1582
1626
|
disabled: l,
|
|
1583
|
-
size:
|
|
1627
|
+
size: f,
|
|
1584
1628
|
variant: r,
|
|
1585
|
-
status:
|
|
1629
|
+
status: p,
|
|
1586
1630
|
inputMode: "none",
|
|
1587
|
-
clearable:
|
|
1631
|
+
clearable: w,
|
|
1588
1632
|
onClear: () => n(void 0)
|
|
1589
1633
|
}
|
|
1590
1634
|
) : null,
|
|
1591
|
-
|
|
1635
|
+
E ? /* @__PURE__ */ $(
|
|
1592
1636
|
"div",
|
|
1593
1637
|
{
|
|
1594
|
-
className: `sa-calendar sa-calendar-size-${
|
|
1638
|
+
className: `sa-calendar sa-calendar-size-${f || "sm"} ${o ? "" : "sa-calendar-no-input"} ${k ? "" : "sa-calendar-no-padding"}`,
|
|
1595
1639
|
style: l ? { pointerEvents: "none" } : void 0,
|
|
1596
|
-
ref:
|
|
1640
|
+
ref: D,
|
|
1597
1641
|
children: [
|
|
1598
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ a(
|
|
1599
1643
|
kn,
|
|
1600
1644
|
{
|
|
1601
1645
|
setViews: I,
|
|
1602
|
-
views:
|
|
1646
|
+
views: F,
|
|
1603
1647
|
filter: t,
|
|
1604
|
-
previewDate:
|
|
1605
|
-
setPreviewDate:
|
|
1606
|
-
isComponentVisible:
|
|
1648
|
+
previewDate: C,
|
|
1649
|
+
setPreviewDate: L,
|
|
1650
|
+
isComponentVisible: E
|
|
1607
1651
|
}
|
|
1608
1652
|
),
|
|
1609
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: F === "days" ? /* @__PURE__ */ a(
|
|
1610
1654
|
yn,
|
|
1611
1655
|
{
|
|
1612
1656
|
date: T,
|
|
1613
|
-
setDate:
|
|
1614
|
-
previewDate:
|
|
1615
|
-
setPreviewDate:
|
|
1657
|
+
setDate: Y,
|
|
1658
|
+
previewDate: C,
|
|
1659
|
+
setPreviewDate: L,
|
|
1616
1660
|
setIsComponentVisible: S,
|
|
1617
1661
|
input: o,
|
|
1618
1662
|
minDate: u,
|
|
1619
1663
|
maxDate: i,
|
|
1620
1664
|
onChange: n,
|
|
1621
|
-
hasValue:
|
|
1665
|
+
hasValue: e != null
|
|
1622
1666
|
}
|
|
1623
|
-
) :
|
|
1667
|
+
) : F === "months" ? /* @__PURE__ */ a(
|
|
1624
1668
|
wn,
|
|
1625
1669
|
{
|
|
1626
1670
|
date: T,
|
|
1627
|
-
setDate:
|
|
1628
|
-
previewDate:
|
|
1629
|
-
setPreviewDate:
|
|
1671
|
+
setDate: Y,
|
|
1672
|
+
previewDate: C,
|
|
1673
|
+
setPreviewDate: L,
|
|
1630
1674
|
filter: t,
|
|
1631
1675
|
setViews: I,
|
|
1632
1676
|
onChange: n,
|
|
1633
1677
|
minDate: u,
|
|
1634
1678
|
maxDate: i,
|
|
1635
1679
|
input: o,
|
|
1636
|
-
hasValue:
|
|
1680
|
+
hasValue: e != null
|
|
1637
1681
|
}
|
|
1638
|
-
) : /* @__PURE__ */
|
|
1682
|
+
) : /* @__PURE__ */ a(
|
|
1639
1683
|
xn,
|
|
1640
1684
|
{
|
|
1641
1685
|
date: T,
|
|
1642
|
-
setDate:
|
|
1643
|
-
previewDate:
|
|
1644
|
-
setPreviewDate:
|
|
1686
|
+
setDate: Y,
|
|
1687
|
+
previewDate: C,
|
|
1688
|
+
setPreviewDate: L,
|
|
1645
1689
|
filter: t,
|
|
1646
1690
|
setViews: I,
|
|
1647
1691
|
onChange: n,
|
|
1648
1692
|
minDate: u,
|
|
1649
1693
|
maxDate: i,
|
|
1650
1694
|
input: o,
|
|
1651
|
-
hasValue:
|
|
1695
|
+
hasValue: e != null
|
|
1652
1696
|
}
|
|
1653
1697
|
) })
|
|
1654
1698
|
]
|
|
@@ -1657,72 +1701,72 @@ const Cn = K(
|
|
|
1657
1701
|
]
|
|
1658
1702
|
}
|
|
1659
1703
|
);
|
|
1660
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ a(
|
|
1661
1705
|
on,
|
|
1662
1706
|
{
|
|
1663
|
-
label:
|
|
1707
|
+
label: N,
|
|
1664
1708
|
labelPosition: m,
|
|
1665
|
-
required:
|
|
1709
|
+
required: h,
|
|
1666
1710
|
optional: s,
|
|
1667
1711
|
description: x,
|
|
1668
|
-
helperText:
|
|
1669
|
-
errorText:
|
|
1712
|
+
helperText: z,
|
|
1713
|
+
errorText: c,
|
|
1670
1714
|
fullWidth: M,
|
|
1671
1715
|
children: U
|
|
1672
1716
|
}
|
|
1673
1717
|
);
|
|
1674
1718
|
}
|
|
1675
|
-
),
|
|
1719
|
+
), zn = K(
|
|
1676
1720
|
({
|
|
1677
|
-
value:
|
|
1721
|
+
value: e,
|
|
1678
1722
|
onChange: n,
|
|
1679
1723
|
filter: t,
|
|
1680
1724
|
input: o = !0,
|
|
1681
1725
|
rangedDate: l,
|
|
1682
1726
|
disabled: u,
|
|
1683
1727
|
minDate: i,
|
|
1684
|
-
maxDate:
|
|
1685
|
-
placeholder:
|
|
1728
|
+
maxDate: g,
|
|
1729
|
+
placeholder: f,
|
|
1686
1730
|
size: r,
|
|
1687
1731
|
variant: d,
|
|
1688
|
-
status:
|
|
1732
|
+
status: w,
|
|
1689
1733
|
clearable: M,
|
|
1690
1734
|
fullWidth: k,
|
|
1691
|
-
withPadding:
|
|
1735
|
+
withPadding: N,
|
|
1692
1736
|
label: m,
|
|
1693
|
-
labelPosition:
|
|
1737
|
+
labelPosition: h,
|
|
1694
1738
|
required: s,
|
|
1695
1739
|
optional: x,
|
|
1696
|
-
description:
|
|
1697
|
-
helperText:
|
|
1698
|
-
errorText:
|
|
1699
|
-
},
|
|
1700
|
-
const
|
|
1740
|
+
description: z,
|
|
1741
|
+
helperText: c,
|
|
1742
|
+
errorText: y
|
|
1743
|
+
}, p) => {
|
|
1744
|
+
const b = {
|
|
1701
1745
|
onChange: n,
|
|
1702
|
-
value:
|
|
1746
|
+
value: e,
|
|
1703
1747
|
input: o,
|
|
1704
1748
|
filter: t,
|
|
1705
1749
|
disabled: u,
|
|
1706
1750
|
minDate: i,
|
|
1707
|
-
maxDate:
|
|
1708
|
-
placeholder:
|
|
1751
|
+
maxDate: g,
|
|
1752
|
+
placeholder: f,
|
|
1709
1753
|
size: r,
|
|
1710
1754
|
variant: d,
|
|
1711
|
-
status:
|
|
1755
|
+
status: w,
|
|
1712
1756
|
clearable: M,
|
|
1713
1757
|
fullWidth: k,
|
|
1714
|
-
withPadding:
|
|
1758
|
+
withPadding: N,
|
|
1715
1759
|
label: m,
|
|
1716
|
-
labelPosition:
|
|
1760
|
+
labelPosition: h,
|
|
1717
1761
|
required: s,
|
|
1718
1762
|
optional: x,
|
|
1719
|
-
description:
|
|
1720
|
-
helperText:
|
|
1721
|
-
errorText:
|
|
1763
|
+
description: z,
|
|
1764
|
+
helperText: c,
|
|
1765
|
+
errorText: y
|
|
1722
1766
|
};
|
|
1723
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ a(en, { children: l ? /* @__PURE__ */ a(mn, { ...b, ref: p }) : /* @__PURE__ */ a(Cn, { ...b, ref: p }) });
|
|
1724
1768
|
}
|
|
1725
1769
|
);
|
|
1726
1770
|
export {
|
|
1727
|
-
|
|
1771
|
+
zn as StarasiaDate
|
|
1728
1772
|
};
|