@starasia/date 5.1.1 → 5.2.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 +449 -430
- package/dist/date.umd.js +17 -2
- package/dist/interfaces.d.ts +1 -0
- package/package.json +1 -1
package/dist/date.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as Y, jsx as a, Fragment as en } from "react/jsx-runtime";
|
|
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
|
|
|
5
5
|
* {
|
|
@@ -453,6 +453,13 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
453
453
|
outline-offset: 1px;
|
|
454
454
|
}
|
|
455
455
|
|
|
456
|
+
/* === NO PADDING OVERRIDE === */
|
|
457
|
+
.sa-calendar.sa-calendar-no-padding,
|
|
458
|
+
.sa-calendar.sa-calendar-size-sm.sa-calendar-no-padding,
|
|
459
|
+
.sa-calendar.sa-calendar-size-lg.sa-calendar-no-padding {
|
|
460
|
+
padding: 0;
|
|
461
|
+
}
|
|
462
|
+
|
|
456
463
|
/* === CALENDAR PANEL SIZE VARIANTS === */
|
|
457
464
|
/* sa-calendar-size-md is the default — no override needed */
|
|
458
465
|
|
|
@@ -474,6 +481,10 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
474
481
|
width: 28px;
|
|
475
482
|
height: 26px;
|
|
476
483
|
}
|
|
484
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-days-today::before {
|
|
485
|
+
width: 26px;
|
|
486
|
+
height: 26px;
|
|
487
|
+
}
|
|
477
488
|
.sa-calendar.sa-calendar-size-sm .sa-calendar-months-preview p,
|
|
478
489
|
.sa-calendar.sa-calendar-size-sm .sa-calendar-years-preview p {
|
|
479
490
|
font-size: var(--sa-font-size-sm, 12px);
|
|
@@ -499,6 +510,10 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
499
510
|
width: 40px;
|
|
500
511
|
height: 36px;
|
|
501
512
|
}
|
|
513
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-days-today::before {
|
|
514
|
+
width: 36px;
|
|
515
|
+
height: 36px;
|
|
516
|
+
}
|
|
502
517
|
.sa-calendar.sa-calendar-size-lg .sa-calendar-months-preview p,
|
|
503
518
|
.sa-calendar.sa-calendar-size-lg .sa-calendar-years-preview p {
|
|
504
519
|
font-size: 16px;
|
|
@@ -520,7 +535,7 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
520
535
|
width: 32px;
|
|
521
536
|
height: 32px;
|
|
522
537
|
}
|
|
523
|
-
`,
|
|
538
|
+
`, an = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], W = [
|
|
524
539
|
"January",
|
|
525
540
|
"February",
|
|
526
541
|
"March",
|
|
@@ -533,7 +548,7 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
533
548
|
"October",
|
|
534
549
|
"November",
|
|
535
550
|
"December"
|
|
536
|
-
],
|
|
551
|
+
], ln = [
|
|
537
552
|
"Jan",
|
|
538
553
|
"Feb",
|
|
539
554
|
"Mar",
|
|
@@ -547,53 +562,53 @@ const R = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
547
562
|
"Nov",
|
|
548
563
|
"Dec"
|
|
549
564
|
];
|
|
550
|
-
function
|
|
551
|
-
const [e, t] =
|
|
552
|
-
o.current && !o.current.contains(
|
|
565
|
+
function rn(r) {
|
|
566
|
+
const [e, t] = A(r), o = J(null), l = (c) => {
|
|
567
|
+
o.current && !o.current.contains(c.target) && t(!1);
|
|
553
568
|
};
|
|
554
|
-
return
|
|
569
|
+
return B(() => (document.addEventListener("click", l, !0), () => {
|
|
555
570
|
document.removeEventListener("click", l, !0);
|
|
556
571
|
}), []), { ref: o, isComponentVisible: e, setIsComponentVisible: t };
|
|
557
572
|
}
|
|
558
|
-
const
|
|
559
|
-
if (!document.getElementById(
|
|
573
|
+
const Q = "sa-calendar-input-styles", dn = (r) => {
|
|
574
|
+
if (!document.getElementById(Q)) {
|
|
560
575
|
const e = document.createElement("style");
|
|
561
|
-
e.id =
|
|
576
|
+
e.id = Q, e.textContent = r, document.head.appendChild(e);
|
|
562
577
|
}
|
|
563
578
|
};
|
|
564
|
-
|
|
565
|
-
const
|
|
579
|
+
dn(R);
|
|
580
|
+
const O = (r) => {
|
|
566
581
|
if (r === "sm")
|
|
567
582
|
return 16;
|
|
568
583
|
if (r === "md")
|
|
569
584
|
return 16;
|
|
570
585
|
if (r === "lg")
|
|
571
586
|
return 20;
|
|
572
|
-
},
|
|
587
|
+
}, cn = (r) => {
|
|
573
588
|
const {
|
|
574
589
|
size: e = "md",
|
|
575
590
|
status: t = "default",
|
|
576
591
|
variant: o = "outline",
|
|
577
592
|
clearable: l,
|
|
578
|
-
onClear:
|
|
593
|
+
onClear: c,
|
|
579
594
|
...d
|
|
580
|
-
} = r,
|
|
581
|
-
|
|
582
|
-
}, n = t === "disable" || d.disabled,
|
|
583
|
-
|
|
595
|
+
} = r, u = J(null), h = () => {
|
|
596
|
+
u.current && d.onClick && (u.current.focus(), d.onClick(""));
|
|
597
|
+
}, n = t === "disable" || d.disabled, i = !!d.value, v = l && i && !n, k = (C) => {
|
|
598
|
+
C.stopPropagation(), c == null || c();
|
|
584
599
|
};
|
|
585
|
-
return /* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ Y(
|
|
586
601
|
"div",
|
|
587
602
|
{
|
|
588
603
|
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${e} `,
|
|
589
|
-
onClick:
|
|
604
|
+
onClick: h,
|
|
590
605
|
children: [
|
|
591
606
|
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
592
607
|
"svg",
|
|
593
608
|
{
|
|
594
609
|
xmlns: "http://www.w3.org/2000/svg",
|
|
595
|
-
width:
|
|
596
|
-
height:
|
|
610
|
+
width: O(e),
|
|
611
|
+
height: O(e),
|
|
597
612
|
viewBox: "0 0 20 20",
|
|
598
613
|
fill: "none",
|
|
599
614
|
children: /* @__PURE__ */ a(
|
|
@@ -615,7 +630,7 @@ const H = (r) => {
|
|
|
615
630
|
...d,
|
|
616
631
|
disabled: n,
|
|
617
632
|
value: d.value,
|
|
618
|
-
ref:
|
|
633
|
+
ref: u
|
|
619
634
|
}
|
|
620
635
|
) }),
|
|
621
636
|
v ? /* @__PURE__ */ a(
|
|
@@ -629,8 +644,8 @@ const H = (r) => {
|
|
|
629
644
|
"svg",
|
|
630
645
|
{
|
|
631
646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
632
|
-
width:
|
|
633
|
-
height:
|
|
647
|
+
width: O(e),
|
|
648
|
+
height: O(e),
|
|
634
649
|
viewBox: "0 0 20 20",
|
|
635
650
|
fill: "none",
|
|
636
651
|
children: /* @__PURE__ */ a(
|
|
@@ -650,8 +665,8 @@ const H = (r) => {
|
|
|
650
665
|
"svg",
|
|
651
666
|
{
|
|
652
667
|
xmlns: "http://www.w3.org/2000/svg",
|
|
653
|
-
width:
|
|
654
|
-
height:
|
|
668
|
+
width: O(e),
|
|
669
|
+
height: O(e),
|
|
655
670
|
viewBox: "0 0 20 20",
|
|
656
671
|
fill: "none",
|
|
657
672
|
children: /* @__PURE__ */ a(
|
|
@@ -669,121 +684,121 @@ const H = (r) => {
|
|
|
669
684
|
]
|
|
670
685
|
}
|
|
671
686
|
);
|
|
672
|
-
},
|
|
687
|
+
}, un = ({
|
|
673
688
|
date: r,
|
|
674
689
|
setDate: e,
|
|
675
690
|
dateRange: t,
|
|
676
691
|
setDateRange: o,
|
|
677
692
|
onChange: l,
|
|
678
|
-
minDate:
|
|
693
|
+
minDate: c,
|
|
679
694
|
maxDate: d,
|
|
680
|
-
input:
|
|
695
|
+
input: u
|
|
681
696
|
}) => {
|
|
682
|
-
var
|
|
683
|
-
const [
|
|
684
|
-
let
|
|
685
|
-
const
|
|
686
|
-
for (let
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
) :
|
|
690
|
-
let
|
|
691
|
-
currentMonth:
|
|
692
|
-
date: new Date(
|
|
693
|
-
month:
|
|
694
|
-
number:
|
|
695
|
-
selected:
|
|
696
|
-
isToday:
|
|
697
|
-
year:
|
|
698
|
-
isDisabled:
|
|
697
|
+
var g, w, $;
|
|
698
|
+
const [h, n] = A(null);
|
|
699
|
+
let i = new Date(r.getFullYear(), r.getMonth(), 1), v = i.getDay(), k = [];
|
|
700
|
+
const C = r.getMonth(), m = (/* @__PURE__ */ new Date()).toDateString(), p = !!(t.from && !t.to), s = p && h ? h : null;
|
|
701
|
+
for (let f = 0; f < 42; f++) {
|
|
702
|
+
f === 0 && v === 0 ? i.setDate(i.getDate() - 7) : f === 0 ? i.setDate(
|
|
703
|
+
i.getDate() + (f - v)
|
|
704
|
+
) : i.setDate(i.getDate() + 1);
|
|
705
|
+
let b = {
|
|
706
|
+
currentMonth: i.getMonth() === C,
|
|
707
|
+
date: new Date(i),
|
|
708
|
+
month: i.getMonth(),
|
|
709
|
+
number: i.getDate(),
|
|
710
|
+
selected: i.toDateString() === ((g = t.from) == null ? void 0 : g.toDateString()) || i.toDateString() === (((w = t.to) == null ? void 0 : w.toDateString()) || (($ = t.from) == null ? void 0 : $.toDateString())),
|
|
711
|
+
isToday: i.toDateString() === m,
|
|
712
|
+
year: i.getFullYear(),
|
|
713
|
+
isDisabled: c && i < c || d && i > d
|
|
699
714
|
};
|
|
700
|
-
k.push(
|
|
715
|
+
k.push(b);
|
|
701
716
|
}
|
|
702
|
-
const x = (
|
|
703
|
-
e(
|
|
704
|
-
}, N = (
|
|
705
|
-
var
|
|
706
|
-
let
|
|
707
|
-
if (
|
|
708
|
-
|
|
717
|
+
const x = (f) => {
|
|
718
|
+
e(f);
|
|
719
|
+
}, N = (f) => {
|
|
720
|
+
var T;
|
|
721
|
+
let b = { ...t };
|
|
722
|
+
if (b.from && b.to)
|
|
723
|
+
b = { from: f, to: null };
|
|
709
724
|
else {
|
|
710
|
-
const
|
|
711
|
-
|
|
725
|
+
const S = ((T = b.from) == null ? void 0 : T.getTime()) || 0;
|
|
726
|
+
f.getTime() > S ? b = { from: b.from, to: f } : b = { from: f, to: b.from };
|
|
712
727
|
}
|
|
713
|
-
o(
|
|
728
|
+
o(b), l(b);
|
|
714
729
|
};
|
|
715
|
-
return /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ Y(
|
|
716
731
|
"div",
|
|
717
732
|
{
|
|
718
733
|
className: "sa-calendar-days-preivew",
|
|
719
734
|
onMouseLeave: () => n(null),
|
|
720
735
|
children: [
|
|
721
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children:
|
|
722
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: k.map((
|
|
723
|
-
const
|
|
736
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: an.map((f, b) => /* @__PURE__ */ a("p", { children: f }, b)) }),
|
|
737
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: k.map((f, b) => {
|
|
738
|
+
const T = t.from && t.to && f.date.getTime() > t.from.getTime() && f.date.getTime() < t.to.getTime(), S = (() => {
|
|
724
739
|
if (!s || !t.from)
|
|
725
740
|
return !1;
|
|
726
|
-
const
|
|
727
|
-
return
|
|
728
|
-
})(),
|
|
741
|
+
const z = f.date.getTime(), M = t.from.getTime(), L = s.getTime();
|
|
742
|
+
return L > M ? z > M && z < L : z < M && z > L;
|
|
743
|
+
})(), D = p && h && f.date.toDateString() === h.toDateString(), F = f.isDisabled, I = () => T || S ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "", E = () => F ? "var(--sa-color-gray-400, #b7b9be)" : T || S ? "var(--sa-color-gray-500, #8c8f97)" : "";
|
|
729
744
|
return /* @__PURE__ */ a(
|
|
730
745
|
"p",
|
|
731
746
|
{
|
|
732
|
-
className: `${
|
|
747
|
+
className: `${f.currentMonth ? "sa-calendar-days-current" : "sa-calendar-days"} ${f.selected || D ? "sa-calendar-days-active" : ""} ${f.isToday && !f.selected ? "sa-calendar-days-today" : ""}`,
|
|
733
748
|
style: {
|
|
734
|
-
backgroundColor:
|
|
735
|
-
pointerEvents:
|
|
736
|
-
cursor:
|
|
737
|
-
color:
|
|
738
|
-
opacity:
|
|
739
|
-
...
|
|
749
|
+
backgroundColor: I(),
|
|
750
|
+
pointerEvents: F ? "none" : void 0,
|
|
751
|
+
cursor: F ? "not-allowed" : "pointer",
|
|
752
|
+
color: E(),
|
|
753
|
+
opacity: D && !f.selected ? 0.75 : 1,
|
|
754
|
+
...u ? {} : { width: "100%" }
|
|
740
755
|
},
|
|
741
756
|
onClick: () => {
|
|
742
|
-
|
|
757
|
+
F || (x(f.date), N(f.date));
|
|
743
758
|
},
|
|
744
759
|
onMouseEnter: () => {
|
|
745
|
-
|
|
760
|
+
F || n(f.date);
|
|
746
761
|
},
|
|
747
|
-
children:
|
|
762
|
+
children: f.number
|
|
748
763
|
},
|
|
749
|
-
|
|
764
|
+
b
|
|
750
765
|
);
|
|
751
766
|
}) })
|
|
752
767
|
]
|
|
753
768
|
}
|
|
754
769
|
);
|
|
755
|
-
},
|
|
770
|
+
}, hn = ({
|
|
756
771
|
date: r,
|
|
757
772
|
setDate: e,
|
|
758
773
|
filter: t,
|
|
759
774
|
setViews: o,
|
|
760
775
|
dateRange: l,
|
|
761
|
-
setDateRange:
|
|
776
|
+
setDateRange: c,
|
|
762
777
|
onChange: d,
|
|
763
|
-
minDate:
|
|
764
|
-
maxDate:
|
|
778
|
+
minDate: u,
|
|
779
|
+
maxDate: h,
|
|
765
780
|
input: n
|
|
766
781
|
}) => {
|
|
767
|
-
const
|
|
768
|
-
t ? (
|
|
769
|
-
},
|
|
782
|
+
const i = l.from.getFullYear(), v = r.getFullYear(), k = (m) => {
|
|
783
|
+
t ? (C(m), e(m)) : (o("days"), e(m));
|
|
784
|
+
}, C = (m) => {
|
|
770
785
|
var s;
|
|
771
|
-
let
|
|
772
|
-
if (
|
|
773
|
-
|
|
786
|
+
let p = { ...l };
|
|
787
|
+
if (p.from && p.to)
|
|
788
|
+
p = { from: m, to: null };
|
|
774
789
|
else {
|
|
775
|
-
const x = ((s =
|
|
776
|
-
|
|
790
|
+
const x = ((s = p.from) == null ? void 0 : s.getTime()) || 0;
|
|
791
|
+
m.getTime() > x ? p = { from: p.from, to: m } : p = { from: m, to: p.from };
|
|
777
792
|
}
|
|
778
|
-
|
|
793
|
+
c(p), d(p);
|
|
779
794
|
};
|
|
780
|
-
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((
|
|
781
|
-
var N,
|
|
782
|
-
const s = new Date(v,
|
|
795
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((m, p) => {
|
|
796
|
+
var N, g, w;
|
|
797
|
+
const s = new Date(v, p).getTime() > l.from.getTime() && new Date(v, p).getTime() < (((N = l.to) == null ? void 0 : N.getTime()) || l.from.getTime()), x = u && new Date(v, p) < u || h && new Date(v, p) > h;
|
|
783
798
|
return /* @__PURE__ */ a(
|
|
784
799
|
"p",
|
|
785
800
|
{
|
|
786
|
-
className:
|
|
801
|
+
className: i === v && (p === ((g = l.from) == null ? void 0 : g.getMonth()) || p === ((w = l.to) == null ? void 0 : w.getMonth())) ? "sa-calendar-months-active" : "",
|
|
787
802
|
style: {
|
|
788
803
|
backgroundColor: s ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
789
804
|
pointerEvents: x ? "none" : void 0,
|
|
@@ -792,72 +807,72 @@ const H = (r) => {
|
|
|
792
807
|
...n ? {} : { width: "100%" }
|
|
793
808
|
},
|
|
794
809
|
onClick: () => {
|
|
795
|
-
x || k(new Date(v,
|
|
810
|
+
x || k(new Date(v, p));
|
|
796
811
|
},
|
|
797
|
-
children:
|
|
812
|
+
children: m.slice(0, 3)
|
|
798
813
|
},
|
|
799
|
-
|
|
814
|
+
p
|
|
800
815
|
);
|
|
801
816
|
}) });
|
|
802
817
|
}, q = (r) => {
|
|
803
818
|
const e = Math.floor(r / 10) * 10, t = e + 10;
|
|
804
819
|
return { start: e, end: t };
|
|
805
|
-
},
|
|
820
|
+
}, pn = ({
|
|
806
821
|
date: r,
|
|
807
822
|
filter: e,
|
|
808
823
|
setViews: t,
|
|
809
824
|
setDate: o,
|
|
810
825
|
dateRange: l,
|
|
811
|
-
setDateRange:
|
|
826
|
+
setDateRange: c,
|
|
812
827
|
onChange: d,
|
|
813
|
-
minDate:
|
|
814
|
-
maxDate:
|
|
828
|
+
minDate: u,
|
|
829
|
+
maxDate: h,
|
|
815
830
|
input: n
|
|
816
831
|
}) => {
|
|
817
832
|
var N;
|
|
818
|
-
let
|
|
819
|
-
const v = r.getFullYear(), { start: k, end:
|
|
820
|
-
for (let
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
year:
|
|
824
|
-
active:
|
|
825
|
-
highlight:
|
|
826
|
-
disabled:
|
|
833
|
+
let i = [];
|
|
834
|
+
const v = r.getFullYear(), { start: k, end: C } = q(v), m = l.from.getFullYear(), p = (N = l.to) == null ? void 0 : N.getFullYear();
|
|
835
|
+
for (let g = k; g < C; g++) {
|
|
836
|
+
const w = new Date(g, 0), $ = (!u || w >= u) && (!h || w <= h), f = g === m || g === p, b = w > l.from && w < l.to;
|
|
837
|
+
i.push({
|
|
838
|
+
year: g,
|
|
839
|
+
active: f && $,
|
|
840
|
+
highlight: b && $,
|
|
841
|
+
disabled: !$
|
|
827
842
|
});
|
|
828
843
|
}
|
|
829
|
-
const s = (
|
|
830
|
-
e ? (x(
|
|
831
|
-
}, x = (
|
|
832
|
-
var
|
|
833
|
-
let
|
|
834
|
-
if (
|
|
835
|
-
|
|
844
|
+
const s = (g) => {
|
|
845
|
+
e ? (x(g), o(g)) : (o(g), t("months"));
|
|
846
|
+
}, x = (g) => {
|
|
847
|
+
var $;
|
|
848
|
+
let w = { ...l };
|
|
849
|
+
if (w.from && w.to)
|
|
850
|
+
w = { from: g, to: null };
|
|
836
851
|
else {
|
|
837
|
-
const
|
|
838
|
-
|
|
852
|
+
const f = (($ = w.from) == null ? void 0 : $.getTime()) || 0;
|
|
853
|
+
g.getTime() > f ? w = { from: w.from, to: g } : w = { from: g, to: w.from };
|
|
839
854
|
}
|
|
840
|
-
|
|
855
|
+
c(w), d(w);
|
|
841
856
|
};
|
|
842
|
-
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children:
|
|
857
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: i.map((g, w) => /* @__PURE__ */ a(
|
|
843
858
|
"p",
|
|
844
859
|
{
|
|
845
|
-
className: `${
|
|
860
|
+
className: `${g.active ? "sa-calendar-months-active" : ""} ${g.highlight ? "sa-calendar-months-highlight" : ""} ${g.disabled ? "sa-calendar-disabled" : ""}`,
|
|
846
861
|
onClick: () => {
|
|
847
|
-
|
|
862
|
+
g.disabled || s(new Date(g.year, 0));
|
|
848
863
|
},
|
|
849
864
|
style: {
|
|
850
|
-
backgroundColor:
|
|
851
|
-
color:
|
|
852
|
-
cursor:
|
|
853
|
-
pointerEvents:
|
|
865
|
+
backgroundColor: g.highlight ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
866
|
+
color: g.highlight ? "var(--sa-color-gray-500, #8c8f97)" : g.active ? "" : g.disabled ? "var(--sa-color-gray-400, #b7b9be)" : "",
|
|
867
|
+
cursor: g.disabled ? "not-allowed" : "pointer",
|
|
868
|
+
pointerEvents: g.disbled ? "none" : "all",
|
|
854
869
|
...n ? {} : { width: "100%" }
|
|
855
870
|
},
|
|
856
|
-
children:
|
|
871
|
+
children: g.year
|
|
857
872
|
},
|
|
858
|
-
|
|
873
|
+
w
|
|
859
874
|
)) });
|
|
860
|
-
},
|
|
875
|
+
}, tn = ({ ...r }) => /* @__PURE__ */ a(
|
|
861
876
|
"svg",
|
|
862
877
|
{
|
|
863
878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -877,7 +892,7 @@ const H = (r) => {
|
|
|
877
892
|
}
|
|
878
893
|
)
|
|
879
894
|
}
|
|
880
|
-
),
|
|
895
|
+
), sn = ({ ...r }) => /* @__PURE__ */ a(
|
|
881
896
|
"svg",
|
|
882
897
|
{
|
|
883
898
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -897,14 +912,14 @@ const H = (r) => {
|
|
|
897
912
|
}
|
|
898
913
|
)
|
|
899
914
|
}
|
|
900
|
-
),
|
|
915
|
+
), gn = ({
|
|
901
916
|
setViews: r,
|
|
902
917
|
views: e,
|
|
903
918
|
filter: t,
|
|
904
919
|
date: o,
|
|
905
920
|
setDate: l
|
|
906
921
|
}) => {
|
|
907
|
-
const
|
|
922
|
+
const c = () => {
|
|
908
923
|
t || r((n) => n === "days" ? "months" : n === "months" ? "years" : "days");
|
|
909
924
|
}, d = () => {
|
|
910
925
|
if (e === "years") {
|
|
@@ -916,7 +931,7 @@ const H = (r) => {
|
|
|
916
931
|
return;
|
|
917
932
|
}
|
|
918
933
|
l((n) => new Date(n.getFullYear(), n.getMonth() + 1));
|
|
919
|
-
},
|
|
934
|
+
}, u = () => {
|
|
920
935
|
if (e === "years") {
|
|
921
936
|
l((n) => new Date(n.getFullYear() - 10, 0));
|
|
922
937
|
return;
|
|
@@ -932,8 +947,8 @@ const H = (r) => {
|
|
|
932
947
|
)
|
|
933
948
|
);
|
|
934
949
|
};
|
|
935
|
-
return /* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick:
|
|
950
|
+
return /* @__PURE__ */ Y("div", { className: "sa-calendar-header", children: [
|
|
951
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: c, children: (() => {
|
|
937
952
|
if (e === "days")
|
|
938
953
|
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
939
954
|
if (e === "months")
|
|
@@ -941,213 +956,214 @@ const H = (r) => {
|
|
|
941
956
|
if (e === "years")
|
|
942
957
|
return `${q(o.getFullYear()).start} ~ ${q(o.getFullYear()).end}`;
|
|
943
958
|
})() }),
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick:
|
|
946
|
-
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(
|
|
959
|
+
/* @__PURE__ */ Y("div", { className: "sa-calendar-header-nav", children: [
|
|
960
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: u, children: /* @__PURE__ */ a(tn, {}) }),
|
|
961
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(sn, {}) })
|
|
947
962
|
] })
|
|
948
963
|
] });
|
|
949
964
|
};
|
|
950
965
|
function P(r) {
|
|
951
966
|
const e = new Date(r), t = e.getFullYear(), o = e.getMonth();
|
|
952
|
-
return `${e.getDate().toString().padStart(2, "0")} ${
|
|
967
|
+
return `${e.getDate().toString().padStart(2, "0")} ${ln[o]} ${t}`;
|
|
953
968
|
}
|
|
954
|
-
const
|
|
969
|
+
const on = ({
|
|
955
970
|
label: r,
|
|
956
971
|
labelPosition: e = "outside-top",
|
|
957
972
|
required: t,
|
|
958
973
|
optional: o,
|
|
959
974
|
description: l,
|
|
960
|
-
helperText:
|
|
975
|
+
helperText: c,
|
|
961
976
|
errorText: d,
|
|
962
|
-
fullWidth:
|
|
963
|
-
children:
|
|
977
|
+
fullWidth: u,
|
|
978
|
+
children: h
|
|
964
979
|
}) => {
|
|
965
980
|
const n = [
|
|
966
981
|
"sa-date-field",
|
|
967
|
-
|
|
968
|
-
].filter(Boolean).join(" "),
|
|
982
|
+
u ? "sa-date-field-fullwidth" : ""
|
|
983
|
+
].filter(Boolean).join(" "), i = r ? /* @__PURE__ */ Y("div", { className: "sa-date-field-label-row", children: [
|
|
969
984
|
/* @__PURE__ */ a("span", { className: "sa-date-field-label-text", children: r }),
|
|
970
985
|
o && /* @__PURE__ */ a("span", { className: "sa-date-field-optional-badge", children: "Optional" }),
|
|
971
986
|
t && /* @__PURE__ */ a("span", { className: "sa-date-field-required", children: "*" })
|
|
972
|
-
] }) : null, v = /* @__PURE__ */
|
|
973
|
-
|
|
987
|
+
] }) : null, v = /* @__PURE__ */ Y(en, { children: [
|
|
988
|
+
c && !d && /* @__PURE__ */ a("p", { className: "sa-date-field-helper", children: c }),
|
|
974
989
|
d && /* @__PURE__ */ a("p", { className: "sa-date-field-error-msg", children: d })
|
|
975
990
|
] });
|
|
976
|
-
return r ? e === "outside-left" ? /* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
991
|
+
return r ? e === "outside-left" ? /* @__PURE__ */ Y("div", { className: `${n} sa-date-field-left`, children: [
|
|
992
|
+
/* @__PURE__ */ Y("div", { className: "sa-date-field-left-label", children: [
|
|
993
|
+
i,
|
|
979
994
|
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l })
|
|
980
995
|
] }),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
|
|
996
|
+
/* @__PURE__ */ Y("div", { className: "sa-date-field-input-wrap", children: [
|
|
997
|
+
h,
|
|
983
998
|
v
|
|
984
999
|
] })
|
|
985
|
-
] }) : /* @__PURE__ */
|
|
986
|
-
|
|
1000
|
+
] }) : /* @__PURE__ */ Y("div", { className: n, children: [
|
|
1001
|
+
i,
|
|
987
1002
|
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
988
|
-
|
|
1003
|
+
h,
|
|
989
1004
|
v
|
|
990
|
-
] }) : /* @__PURE__ */
|
|
1005
|
+
] }) : /* @__PURE__ */ Y("div", { className: n, children: [
|
|
991
1006
|
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
992
|
-
|
|
1007
|
+
h,
|
|
993
1008
|
v
|
|
994
1009
|
] });
|
|
995
|
-
},
|
|
996
|
-
if (!document.getElementById(
|
|
1010
|
+
}, X = "sa-calendar-styles", fn = (r) => {
|
|
1011
|
+
if (!document.getElementById(X)) {
|
|
997
1012
|
const e = document.createElement("style");
|
|
998
|
-
e.id =
|
|
1013
|
+
e.id = X, e.textContent = r, document.head.appendChild(e);
|
|
999
1014
|
}
|
|
1000
1015
|
};
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1016
|
+
fn(R);
|
|
1017
|
+
const bn = K(
|
|
1003
1018
|
({
|
|
1004
1019
|
value: r,
|
|
1005
1020
|
onChange: e,
|
|
1006
1021
|
filter: t,
|
|
1007
1022
|
input: o = !0,
|
|
1008
1023
|
disabled: l,
|
|
1009
|
-
minDate:
|
|
1024
|
+
minDate: c,
|
|
1010
1025
|
maxDate: d,
|
|
1011
|
-
placeholder:
|
|
1012
|
-
size:
|
|
1026
|
+
placeholder: u,
|
|
1027
|
+
size: h,
|
|
1013
1028
|
variant: n,
|
|
1014
|
-
status:
|
|
1029
|
+
status: i,
|
|
1015
1030
|
clearable: v,
|
|
1016
1031
|
fullWidth: k = !0,
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1032
|
+
withPadding: C = !0,
|
|
1033
|
+
label: m,
|
|
1034
|
+
labelPosition: p,
|
|
1035
|
+
required: s,
|
|
1036
|
+
optional: x,
|
|
1037
|
+
description: N,
|
|
1038
|
+
helperText: g,
|
|
1039
|
+
errorText: w
|
|
1040
|
+
}, $) => {
|
|
1041
|
+
const f = w ? "error" : i, { ref: b, isComponentVisible: T, setIsComponentVisible: S } = rn(!1), D = J(null), [F, I] = A("days"), [E, z] = A(/* @__PURE__ */ new Date()), [M, L] = A({
|
|
1026
1042
|
from: (r == null ? void 0 : r.from) || /* @__PURE__ */ new Date(),
|
|
1027
1043
|
to: (r == null ? void 0 : r.to) || /* @__PURE__ */ new Date()
|
|
1028
1044
|
});
|
|
1029
|
-
|
|
1030
|
-
r ? (
|
|
1045
|
+
B(() => {
|
|
1046
|
+
r ? (z(r.from), L(r)) : (z(/* @__PURE__ */ new Date()), L({
|
|
1031
1047
|
from: /* @__PURE__ */ new Date(),
|
|
1032
1048
|
to: /* @__PURE__ */ new Date()
|
|
1033
1049
|
}));
|
|
1034
|
-
}, [r]),
|
|
1035
|
-
t &&
|
|
1036
|
-
}, [t]),
|
|
1037
|
-
t ||
|
|
1038
|
-
}, [
|
|
1039
|
-
o ||
|
|
1050
|
+
}, [r]), B(() => {
|
|
1051
|
+
t && I(t);
|
|
1052
|
+
}, [t]), B(() => {
|
|
1053
|
+
t || I("days");
|
|
1054
|
+
}, [T]), B(() => {
|
|
1055
|
+
o || S(!0);
|
|
1040
1056
|
}, [o]);
|
|
1041
|
-
const
|
|
1042
|
-
var y,
|
|
1057
|
+
const G = () => {
|
|
1058
|
+
var y, V;
|
|
1043
1059
|
if (!r)
|
|
1044
1060
|
return "";
|
|
1045
1061
|
if (t) {
|
|
1046
|
-
if (
|
|
1047
|
-
return `${P(
|
|
1048
|
-
if (
|
|
1049
|
-
return `${W[
|
|
1050
|
-
if (
|
|
1051
|
-
return `${(y =
|
|
1062
|
+
if (F === "days")
|
|
1063
|
+
return `${P(M.from)} ~ ${P(M.to || M.from) || "-"}`;
|
|
1064
|
+
if (F === "months")
|
|
1065
|
+
return `${W[M.from.getMonth()]} ~ ${M.to ? W[M.to.getMonth()] : "-"}`;
|
|
1066
|
+
if (F === "years")
|
|
1067
|
+
return `${(y = M.from) == null ? void 0 : y.getFullYear()} ~ ${((V = M.to) == null ? void 0 : V.getFullYear()) || "-"}`;
|
|
1052
1068
|
} else
|
|
1053
|
-
return `${P(
|
|
1054
|
-
},
|
|
1055
|
-
if (
|
|
1056
|
-
const y =
|
|
1057
|
-
window.innerWidth < y.left +
|
|
1069
|
+
return `${P(M.from)} ~ ${P(M.to || M.from) || "-"}`;
|
|
1070
|
+
}, j = () => {
|
|
1071
|
+
if (D.current && b.current && o) {
|
|
1072
|
+
const y = b.current.getBoundingClientRect(), V = D.current.getBoundingClientRect();
|
|
1073
|
+
window.innerWidth < y.left + V.width ? D.current.style.left = `${y.left - V.width + y.width}px` : D.current.style.left = `${y.left}px`, y.top + V.height > window.innerHeight ? D.current.style.top = `${y.y - (y.height + V.height - 28)}px` : D.current.style.top = `${y.y + y.height}px`;
|
|
1058
1074
|
}
|
|
1059
1075
|
};
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}, [
|
|
1063
|
-
const y =
|
|
1064
|
-
return y && y.addEventListener("scroll",
|
|
1065
|
-
y && y.removeEventListener("scroll",
|
|
1076
|
+
B(() => {
|
|
1077
|
+
D.current && b.current && o && j();
|
|
1078
|
+
}, [D, b, T]), B(() => {
|
|
1079
|
+
const y = $ == null ? void 0 : $.current;
|
|
1080
|
+
return y && y.addEventListener("scroll", j), window.addEventListener("scroll", j), () => {
|
|
1081
|
+
y && y.removeEventListener("scroll", j), window.removeEventListener("scroll", j);
|
|
1066
1082
|
};
|
|
1067
1083
|
}, []);
|
|
1068
|
-
const U = /* @__PURE__ */
|
|
1084
|
+
const U = /* @__PURE__ */ Y(
|
|
1069
1085
|
"div",
|
|
1070
1086
|
{
|
|
1071
1087
|
className: "sa-calendar-wrapper",
|
|
1072
1088
|
style: { height: o ? "auto" : "100%" },
|
|
1073
|
-
ref: o ?
|
|
1089
|
+
ref: o ? b : null,
|
|
1074
1090
|
children: [
|
|
1075
1091
|
o ? /* @__PURE__ */ a(
|
|
1076
|
-
|
|
1092
|
+
cn,
|
|
1077
1093
|
{
|
|
1078
|
-
value:
|
|
1094
|
+
value: G(),
|
|
1079
1095
|
inputMode: "none",
|
|
1080
1096
|
onClick: () => {
|
|
1081
|
-
|
|
1097
|
+
S(!0);
|
|
1082
1098
|
},
|
|
1083
1099
|
onChange: () => {
|
|
1084
1100
|
},
|
|
1085
1101
|
disabled: l,
|
|
1086
|
-
placeholder:
|
|
1087
|
-
size:
|
|
1102
|
+
placeholder: u,
|
|
1103
|
+
size: h,
|
|
1088
1104
|
variant: n,
|
|
1089
|
-
status:
|
|
1105
|
+
status: f,
|
|
1090
1106
|
clearable: v,
|
|
1091
1107
|
onClear: () => e(void 0)
|
|
1092
1108
|
}
|
|
1093
1109
|
) : null,
|
|
1094
|
-
|
|
1110
|
+
T ? /* @__PURE__ */ Y(
|
|
1095
1111
|
"div",
|
|
1096
1112
|
{
|
|
1097
|
-
className: `sa-calendar sa-calendar-size-${
|
|
1098
|
-
ref:
|
|
1113
|
+
className: `sa-calendar sa-calendar-size-${h || "md"} ${o ? "" : "sa-calendar-no-input"} ${C ? "" : "sa-calendar-no-padding"}`,
|
|
1114
|
+
ref: D,
|
|
1099
1115
|
children: [
|
|
1100
1116
|
/* @__PURE__ */ a(
|
|
1101
|
-
|
|
1117
|
+
gn,
|
|
1102
1118
|
{
|
|
1103
|
-
setViews:
|
|
1104
|
-
views:
|
|
1119
|
+
setViews: I,
|
|
1120
|
+
views: F,
|
|
1105
1121
|
filter: t,
|
|
1106
1122
|
date: E,
|
|
1107
|
-
setDate:
|
|
1123
|
+
setDate: z
|
|
1108
1124
|
}
|
|
1109
1125
|
),
|
|
1110
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children:
|
|
1111
|
-
|
|
1126
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: F === "days" ? /* @__PURE__ */ a(
|
|
1127
|
+
un,
|
|
1112
1128
|
{
|
|
1113
1129
|
date: E,
|
|
1114
|
-
setDate:
|
|
1115
|
-
setIsComponentVisible:
|
|
1116
|
-
dateRange:
|
|
1117
|
-
setDateRange:
|
|
1130
|
+
setDate: z,
|
|
1131
|
+
setIsComponentVisible: S,
|
|
1132
|
+
dateRange: M,
|
|
1133
|
+
setDateRange: L,
|
|
1118
1134
|
input: o,
|
|
1119
1135
|
onChange: e,
|
|
1120
|
-
minDate:
|
|
1136
|
+
minDate: c,
|
|
1121
1137
|
maxDate: d
|
|
1122
1138
|
}
|
|
1123
|
-
) :
|
|
1124
|
-
|
|
1139
|
+
) : F === "months" ? /* @__PURE__ */ a(
|
|
1140
|
+
hn,
|
|
1125
1141
|
{
|
|
1126
1142
|
date: E,
|
|
1127
|
-
setDate:
|
|
1143
|
+
setDate: z,
|
|
1128
1144
|
filter: t,
|
|
1129
|
-
setViews:
|
|
1130
|
-
dateRange:
|
|
1131
|
-
setDateRange:
|
|
1132
|
-
setIsComponentVisible:
|
|
1145
|
+
setViews: I,
|
|
1146
|
+
dateRange: M,
|
|
1147
|
+
setDateRange: L,
|
|
1148
|
+
setIsComponentVisible: S,
|
|
1133
1149
|
input: o,
|
|
1134
1150
|
onChange: e,
|
|
1135
|
-
minDate:
|
|
1151
|
+
minDate: c,
|
|
1136
1152
|
maxDate: d
|
|
1137
1153
|
}
|
|
1138
1154
|
) : /* @__PURE__ */ a(
|
|
1139
|
-
|
|
1155
|
+
pn,
|
|
1140
1156
|
{
|
|
1141
1157
|
date: E,
|
|
1142
|
-
setDate:
|
|
1158
|
+
setDate: z,
|
|
1143
1159
|
filter: t,
|
|
1144
|
-
setViews:
|
|
1145
|
-
dateRange:
|
|
1146
|
-
setDateRange:
|
|
1147
|
-
setIsComponentVisible:
|
|
1160
|
+
setViews: I,
|
|
1161
|
+
dateRange: M,
|
|
1162
|
+
setDateRange: L,
|
|
1163
|
+
setIsComponentVisible: S,
|
|
1148
1164
|
input: o,
|
|
1149
1165
|
onChange: e,
|
|
1150
|
-
minDate:
|
|
1166
|
+
minDate: c,
|
|
1151
1167
|
maxDate: d
|
|
1152
1168
|
}
|
|
1153
1169
|
) })
|
|
@@ -1158,59 +1174,59 @@ const fn = Z(
|
|
|
1158
1174
|
}
|
|
1159
1175
|
);
|
|
1160
1176
|
return /* @__PURE__ */ a(
|
|
1161
|
-
|
|
1177
|
+
on,
|
|
1162
1178
|
{
|
|
1163
|
-
label:
|
|
1164
|
-
labelPosition:
|
|
1165
|
-
required:
|
|
1166
|
-
optional:
|
|
1167
|
-
description:
|
|
1168
|
-
helperText:
|
|
1169
|
-
errorText:
|
|
1179
|
+
label: m,
|
|
1180
|
+
labelPosition: p,
|
|
1181
|
+
required: s,
|
|
1182
|
+
optional: x,
|
|
1183
|
+
description: N,
|
|
1184
|
+
helperText: g,
|
|
1185
|
+
errorText: w,
|
|
1170
1186
|
fullWidth: k,
|
|
1171
1187
|
children: U
|
|
1172
1188
|
}
|
|
1173
1189
|
);
|
|
1174
1190
|
}
|
|
1175
|
-
),
|
|
1176
|
-
if (!document.getElementById(
|
|
1191
|
+
), _ = "sa-calendar-input-styles", mn = (r) => {
|
|
1192
|
+
if (!document.getElementById(_)) {
|
|
1177
1193
|
const e = document.createElement("style");
|
|
1178
|
-
e.id =
|
|
1194
|
+
e.id = _, e.textContent = r, document.head.appendChild(e);
|
|
1179
1195
|
}
|
|
1180
1196
|
};
|
|
1181
|
-
|
|
1182
|
-
const
|
|
1197
|
+
mn(R);
|
|
1198
|
+
const H = (r) => {
|
|
1183
1199
|
if (r === "sm")
|
|
1184
1200
|
return 16;
|
|
1185
1201
|
if (r === "md")
|
|
1186
1202
|
return 16;
|
|
1187
1203
|
if (r === "lg")
|
|
1188
1204
|
return 20;
|
|
1189
|
-
},
|
|
1205
|
+
}, vn = (r) => {
|
|
1190
1206
|
const {
|
|
1191
1207
|
size: e = "md",
|
|
1192
1208
|
status: t = "default",
|
|
1193
1209
|
variant: o = "outline",
|
|
1194
1210
|
clearable: l,
|
|
1195
|
-
onClear:
|
|
1211
|
+
onClear: c,
|
|
1196
1212
|
...d
|
|
1197
|
-
} = r,
|
|
1198
|
-
|
|
1199
|
-
}, n = t === "disable" || d.disabled,
|
|
1200
|
-
|
|
1213
|
+
} = r, u = J(null), h = () => {
|
|
1214
|
+
u.current && d.onClick && (u.current.focus(), d.onClick(""));
|
|
1215
|
+
}, n = t === "disable" || d.disabled, i = !!d.value, v = l && i && !n, k = (C) => {
|
|
1216
|
+
C.stopPropagation(), c == null || c();
|
|
1201
1217
|
};
|
|
1202
|
-
return /* @__PURE__ */
|
|
1218
|
+
return /* @__PURE__ */ Y(
|
|
1203
1219
|
"div",
|
|
1204
1220
|
{
|
|
1205
1221
|
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${e} `,
|
|
1206
|
-
onClick:
|
|
1222
|
+
onClick: h,
|
|
1207
1223
|
children: [
|
|
1208
1224
|
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
1209
1225
|
"svg",
|
|
1210
1226
|
{
|
|
1211
1227
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1212
|
-
width:
|
|
1213
|
-
height:
|
|
1228
|
+
width: H(e),
|
|
1229
|
+
height: H(e),
|
|
1214
1230
|
viewBox: "0 0 20 20",
|
|
1215
1231
|
fill: "none",
|
|
1216
1232
|
children: /* @__PURE__ */ a(
|
|
@@ -1232,7 +1248,7 @@ const O = (r) => {
|
|
|
1232
1248
|
...d,
|
|
1233
1249
|
disabled: n,
|
|
1234
1250
|
value: d.value,
|
|
1235
|
-
ref:
|
|
1251
|
+
ref: u
|
|
1236
1252
|
}
|
|
1237
1253
|
) }),
|
|
1238
1254
|
v ? /* @__PURE__ */ a(
|
|
@@ -1246,8 +1262,8 @@ const O = (r) => {
|
|
|
1246
1262
|
"svg",
|
|
1247
1263
|
{
|
|
1248
1264
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1249
|
-
width:
|
|
1250
|
-
height:
|
|
1265
|
+
width: H(e),
|
|
1266
|
+
height: H(e),
|
|
1251
1267
|
viewBox: "0 0 20 20",
|
|
1252
1268
|
fill: "none",
|
|
1253
1269
|
children: /* @__PURE__ */ a(
|
|
@@ -1267,8 +1283,8 @@ const O = (r) => {
|
|
|
1267
1283
|
"svg",
|
|
1268
1284
|
{
|
|
1269
1285
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1270
|
-
width:
|
|
1271
|
-
height:
|
|
1286
|
+
width: H(e),
|
|
1287
|
+
height: H(e),
|
|
1272
1288
|
viewBox: "0 0 20 20",
|
|
1273
1289
|
fill: "none",
|
|
1274
1290
|
children: /* @__PURE__ */ a(
|
|
@@ -1286,44 +1302,44 @@ const O = (r) => {
|
|
|
1286
1302
|
]
|
|
1287
1303
|
}
|
|
1288
1304
|
);
|
|
1289
|
-
},
|
|
1305
|
+
}, yn = ({
|
|
1290
1306
|
date: r,
|
|
1291
1307
|
setDate: e,
|
|
1292
1308
|
previewDate: t,
|
|
1293
1309
|
setPreviewDate: o,
|
|
1294
1310
|
setIsComponentVisible: l,
|
|
1295
|
-
minDate:
|
|
1311
|
+
minDate: c,
|
|
1296
1312
|
maxDate: d,
|
|
1297
|
-
input:
|
|
1298
|
-
onChange:
|
|
1313
|
+
input: u,
|
|
1314
|
+
onChange: h
|
|
1299
1315
|
}) => {
|
|
1300
1316
|
let n = new Date(
|
|
1301
1317
|
t.getFullYear(),
|
|
1302
1318
|
t.getMonth(),
|
|
1303
1319
|
1
|
|
1304
|
-
),
|
|
1305
|
-
const k = r.toDateString(),
|
|
1320
|
+
), i = n.getDay(), v = [];
|
|
1321
|
+
const k = r.toDateString(), C = (/* @__PURE__ */ new Date()).toDateString(), m = t.getMonth();
|
|
1306
1322
|
for (let s = 0; s < 42; s++) {
|
|
1307
|
-
s === 0 &&
|
|
1308
|
-
n.getDate() + (s -
|
|
1323
|
+
s === 0 && i === 0 ? n.setDate(n.getDate() - 7) : s === 0 ? n.setDate(
|
|
1324
|
+
n.getDate() + (s - i)
|
|
1309
1325
|
) : n.setDate(n.getDate() + 1);
|
|
1310
1326
|
let x = {
|
|
1311
|
-
currentMonth: n.getMonth() ===
|
|
1327
|
+
currentMonth: n.getMonth() === m,
|
|
1312
1328
|
date: new Date(n),
|
|
1313
1329
|
month: n.getMonth(),
|
|
1314
1330
|
number: n.getDate(),
|
|
1315
1331
|
selected: n.toDateString() === k,
|
|
1316
|
-
isToday: n.toDateString() ===
|
|
1332
|
+
isToday: n.toDateString() === C,
|
|
1317
1333
|
year: n.getFullYear(),
|
|
1318
|
-
isDisabled:
|
|
1334
|
+
isDisabled: c && n < c || d && n > d
|
|
1319
1335
|
};
|
|
1320
1336
|
v.push(x);
|
|
1321
1337
|
}
|
|
1322
|
-
const
|
|
1323
|
-
(!
|
|
1338
|
+
const p = (s) => {
|
|
1339
|
+
(!c || s >= c) && (!d || s <= d) && (e(s), h(s), o(s), u && l(!1));
|
|
1324
1340
|
};
|
|
1325
|
-
return /* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children:
|
|
1341
|
+
return /* @__PURE__ */ Y("div", { className: "sa-calendar-days-preivew", children: [
|
|
1342
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: an.map((s, x) => /* @__PURE__ */ a("p", { children: s }, x)) }),
|
|
1327
1343
|
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: v.map((s, x) => {
|
|
1328
1344
|
const N = s.isDisabled;
|
|
1329
1345
|
return /* @__PURE__ */ a(
|
|
@@ -1334,10 +1350,10 @@ const O = (r) => {
|
|
|
1334
1350
|
color: N ? "#ccc" : void 0,
|
|
1335
1351
|
pointerEvents: N ? "none" : void 0,
|
|
1336
1352
|
cursor: N ? "not-allowed" : "pointer",
|
|
1337
|
-
...
|
|
1353
|
+
...u ? {} : { width: "100%" }
|
|
1338
1354
|
},
|
|
1339
1355
|
onClick: () => {
|
|
1340
|
-
N ||
|
|
1356
|
+
N || p(s.date);
|
|
1341
1357
|
},
|
|
1342
1358
|
children: s.number
|
|
1343
1359
|
},
|
|
@@ -1345,27 +1361,27 @@ const O = (r) => {
|
|
|
1345
1361
|
);
|
|
1346
1362
|
}) })
|
|
1347
1363
|
] });
|
|
1348
|
-
},
|
|
1364
|
+
}, wn = ({
|
|
1349
1365
|
date: r,
|
|
1350
1366
|
setDate: e,
|
|
1351
1367
|
filter: t,
|
|
1352
1368
|
setViews: o,
|
|
1353
1369
|
onChange: l,
|
|
1354
|
-
previewDate:
|
|
1370
|
+
previewDate: c,
|
|
1355
1371
|
setPreviewDate: d,
|
|
1356
|
-
minDate:
|
|
1357
|
-
maxDate:
|
|
1372
|
+
minDate: u,
|
|
1373
|
+
maxDate: h,
|
|
1358
1374
|
input: n
|
|
1359
1375
|
}) => {
|
|
1360
|
-
const
|
|
1361
|
-
(!
|
|
1376
|
+
const i = r.getMonth(), v = r.getFullYear(), k = c.getFullYear(), C = (m) => {
|
|
1377
|
+
(!u || m >= u) && (!h || m <= h) && (t ? (l(m), e(m), d(m)) : (o("days"), d(m)));
|
|
1362
1378
|
};
|
|
1363
|
-
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((
|
|
1364
|
-
const s =
|
|
1379
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((m, p) => {
|
|
1380
|
+
const s = u && new Date(k, p, 1) < u || h && new Date(k, p + 1, 0) > h;
|
|
1365
1381
|
return /* @__PURE__ */ a(
|
|
1366
1382
|
"p",
|
|
1367
1383
|
{
|
|
1368
|
-
className:
|
|
1384
|
+
className: p === i && k === v ? "sa-calendar-months-active" : "",
|
|
1369
1385
|
style: {
|
|
1370
1386
|
color: s ? "#ccc" : void 0,
|
|
1371
1387
|
pointerEvents: s ? "none" : void 0,
|
|
@@ -1373,38 +1389,38 @@ const O = (r) => {
|
|
|
1373
1389
|
...n ? {} : { width: "100%" }
|
|
1374
1390
|
},
|
|
1375
1391
|
onClick: () => {
|
|
1376
|
-
s ||
|
|
1392
|
+
s || C(new Date(k, p));
|
|
1377
1393
|
},
|
|
1378
|
-
children:
|
|
1394
|
+
children: m.slice(0, 3)
|
|
1379
1395
|
},
|
|
1380
|
-
|
|
1396
|
+
p
|
|
1381
1397
|
);
|
|
1382
1398
|
}) });
|
|
1383
|
-
},
|
|
1399
|
+
}, Z = (r) => {
|
|
1384
1400
|
const e = Math.floor(r / 10) * 10, t = e + 10;
|
|
1385
1401
|
return { start: e, end: t };
|
|
1386
|
-
},
|
|
1402
|
+
}, xn = ({
|
|
1387
1403
|
date: r,
|
|
1388
1404
|
filter: e,
|
|
1389
1405
|
setViews: t,
|
|
1390
1406
|
setDate: o,
|
|
1391
1407
|
onChange: l,
|
|
1392
|
-
previewDate:
|
|
1408
|
+
previewDate: c,
|
|
1393
1409
|
setPreviewDate: d,
|
|
1394
|
-
minDate:
|
|
1395
|
-
maxDate:
|
|
1410
|
+
minDate: u,
|
|
1411
|
+
maxDate: h,
|
|
1396
1412
|
input: n
|
|
1397
1413
|
}) => {
|
|
1398
|
-
let
|
|
1399
|
-
const v =
|
|
1400
|
-
for (let s = k; s <
|
|
1401
|
-
let x =
|
|
1402
|
-
|
|
1414
|
+
let i = [];
|
|
1415
|
+
const v = c.getFullYear(), { start: k, end: C } = Z(v), m = r.getFullYear();
|
|
1416
|
+
for (let s = k; s < C; s++) {
|
|
1417
|
+
let x = u && new Date(s, 0, 1) < u || h && new Date(s, 11, 31) > h;
|
|
1418
|
+
i.push({ year: s, active: s === m, isDisabled: x });
|
|
1403
1419
|
}
|
|
1404
|
-
const
|
|
1405
|
-
(!
|
|
1420
|
+
const p = (s) => {
|
|
1421
|
+
(!u || s >= u) && (!h || s <= h) && (e ? (l(s), o(s), d(s)) : (t("months"), d(s)));
|
|
1406
1422
|
};
|
|
1407
|
-
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children:
|
|
1423
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: i.map((s, x) => /* @__PURE__ */ a(
|
|
1408
1424
|
"p",
|
|
1409
1425
|
{
|
|
1410
1426
|
className: s.active ? "sa-calendar-months-active" : "",
|
|
@@ -1415,20 +1431,20 @@ const O = (r) => {
|
|
|
1415
1431
|
...n ? {} : { width: "100%" }
|
|
1416
1432
|
},
|
|
1417
1433
|
onClick: () => {
|
|
1418
|
-
s.isDisabled ||
|
|
1434
|
+
s.isDisabled || p(new Date(s.year, 0));
|
|
1419
1435
|
},
|
|
1420
1436
|
children: s.year
|
|
1421
1437
|
},
|
|
1422
1438
|
x
|
|
1423
1439
|
)) });
|
|
1424
|
-
},
|
|
1440
|
+
}, kn = ({
|
|
1425
1441
|
setViews: r,
|
|
1426
1442
|
views: e,
|
|
1427
1443
|
filter: t,
|
|
1428
1444
|
previewDate: o,
|
|
1429
1445
|
setPreviewDate: l
|
|
1430
1446
|
}) => {
|
|
1431
|
-
const
|
|
1447
|
+
const c = () => {
|
|
1432
1448
|
t || r((n) => n === "days" ? "months" : n === "months" ? "years" : "days");
|
|
1433
1449
|
}, d = () => {
|
|
1434
1450
|
if (e === "years") {
|
|
@@ -1442,7 +1458,7 @@ const O = (r) => {
|
|
|
1442
1458
|
return;
|
|
1443
1459
|
}
|
|
1444
1460
|
l((n) => new Date(n.getFullYear(), n.getMonth() + 1));
|
|
1445
|
-
},
|
|
1461
|
+
}, u = () => {
|
|
1446
1462
|
if (e === "years") {
|
|
1447
1463
|
l((n) => new Date(n.getFullYear() - 10, 0));
|
|
1448
1464
|
return;
|
|
@@ -1460,153 +1476,154 @@ const O = (r) => {
|
|
|
1460
1476
|
)
|
|
1461
1477
|
);
|
|
1462
1478
|
};
|
|
1463
|
-
return /* @__PURE__ */
|
|
1464
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick:
|
|
1479
|
+
return /* @__PURE__ */ Y("div", { className: "sa-calendar-header", children: [
|
|
1480
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: c, children: (() => {
|
|
1465
1481
|
if (e === "days")
|
|
1466
1482
|
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
1467
1483
|
if (e === "months")
|
|
1468
1484
|
return `${o.getFullYear()}`;
|
|
1469
1485
|
if (e === "years")
|
|
1470
|
-
return `${
|
|
1486
|
+
return `${Z(o.getFullYear()).start} ~ ${Z(o.getFullYear()).end}`;
|
|
1471
1487
|
})() }),
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick:
|
|
1474
|
-
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(
|
|
1488
|
+
/* @__PURE__ */ Y("div", { className: "sa-calendar-header-nav", children: [
|
|
1489
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: u, children: /* @__PURE__ */ a(tn, {}) }),
|
|
1490
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(sn, {}) })
|
|
1475
1491
|
] })
|
|
1476
1492
|
] });
|
|
1477
|
-
},
|
|
1478
|
-
if (!document.getElementById(
|
|
1493
|
+
}, nn = "sa-calendar-styles", Dn = (r) => {
|
|
1494
|
+
if (!document.getElementById(nn)) {
|
|
1479
1495
|
const e = document.createElement("style");
|
|
1480
|
-
e.id =
|
|
1496
|
+
e.id = nn, e.textContent = r, document.head.appendChild(e);
|
|
1481
1497
|
}
|
|
1482
1498
|
};
|
|
1483
|
-
|
|
1484
|
-
const Mn =
|
|
1499
|
+
Dn(R);
|
|
1500
|
+
const Mn = K(
|
|
1485
1501
|
({
|
|
1486
1502
|
value: r,
|
|
1487
1503
|
onChange: e,
|
|
1488
1504
|
filter: t,
|
|
1489
1505
|
input: o = !0,
|
|
1490
1506
|
disabled: l,
|
|
1491
|
-
minDate:
|
|
1507
|
+
minDate: c,
|
|
1492
1508
|
maxDate: d,
|
|
1493
|
-
placeholder:
|
|
1494
|
-
size:
|
|
1509
|
+
placeholder: u,
|
|
1510
|
+
size: h,
|
|
1495
1511
|
variant: n,
|
|
1496
|
-
status:
|
|
1512
|
+
status: i,
|
|
1497
1513
|
clearable: v,
|
|
1498
1514
|
fullWidth: k = !0,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
I(()
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1515
|
+
withPadding: C = !0,
|
|
1516
|
+
label: m,
|
|
1517
|
+
labelPosition: p,
|
|
1518
|
+
required: s,
|
|
1519
|
+
optional: x,
|
|
1520
|
+
description: N,
|
|
1521
|
+
helperText: g,
|
|
1522
|
+
errorText: w
|
|
1523
|
+
}, $) => {
|
|
1524
|
+
const f = w ? "error" : i, { ref: b, isComponentVisible: T, setIsComponentVisible: S } = rn(!1), D = J(null), [F, I] = A("days"), [E, z] = A(/* @__PURE__ */ new Date()), [M, L] = A(/* @__PURE__ */ new Date());
|
|
1525
|
+
B(() => {
|
|
1526
|
+
r ? (z(r), L(r)) : (z(/* @__PURE__ */ new Date()), L(/* @__PURE__ */ new Date()));
|
|
1527
|
+
}, [r]), B(() => {
|
|
1528
|
+
t && I(t);
|
|
1529
|
+
}, [t]), B(() => {
|
|
1530
|
+
t || I("days");
|
|
1531
|
+
}, [T]), B(() => {
|
|
1532
|
+
o || S(!0);
|
|
1516
1533
|
}, [o]);
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1519
|
-
const y =
|
|
1520
|
-
window.innerWidth < y.left +
|
|
1534
|
+
const G = () => r ? t === "days" ? P(E) : t === "months" ? `${W[E.getMonth()]} ${E.getFullYear()}` : t === "years" ? E.getFullYear() : P(E) : "", j = () => {
|
|
1535
|
+
if (D.current && b.current && o) {
|
|
1536
|
+
const y = b.current.getBoundingClientRect(), V = D.current.getBoundingClientRect();
|
|
1537
|
+
window.innerWidth < y.left + V.width ? D.current.style.left = `${y.left - V.width + y.width}px` : D.current.style.left = `${y.left}px`, y.top + V.height > window.innerHeight ? D.current.style.top = `${y.y - (y.height + V.height - 28)}px` : D.current.style.top = `${y.y + y.height}px`;
|
|
1521
1538
|
}
|
|
1522
1539
|
};
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
}, [
|
|
1526
|
-
const y =
|
|
1527
|
-
return y && y.addEventListener("scroll",
|
|
1528
|
-
y && y.removeEventListener("scroll",
|
|
1540
|
+
B(() => {
|
|
1541
|
+
D.current && b.current && o && j();
|
|
1542
|
+
}, [D, b, T]), B(() => {
|
|
1543
|
+
const y = $ == null ? void 0 : $.current;
|
|
1544
|
+
return y && y.addEventListener("scroll", j), window.addEventListener("scroll", j), () => {
|
|
1545
|
+
y && y.removeEventListener("scroll", j), window.removeEventListener("scroll", j);
|
|
1529
1546
|
};
|
|
1530
1547
|
}, []);
|
|
1531
|
-
const U = /* @__PURE__ */
|
|
1548
|
+
const U = /* @__PURE__ */ Y(
|
|
1532
1549
|
"div",
|
|
1533
1550
|
{
|
|
1534
1551
|
className: "sa-calendar-wrapper",
|
|
1535
1552
|
style: { height: o ? "auto" : "100%" },
|
|
1536
|
-
ref: o ?
|
|
1553
|
+
ref: o ? b : null,
|
|
1537
1554
|
children: [
|
|
1538
1555
|
o ? /* @__PURE__ */ a(
|
|
1539
|
-
|
|
1556
|
+
vn,
|
|
1540
1557
|
{
|
|
1541
|
-
value:
|
|
1542
|
-
onClick: () =>
|
|
1558
|
+
value: G(),
|
|
1559
|
+
onClick: () => S(!0),
|
|
1543
1560
|
onChange: () => {
|
|
1544
1561
|
},
|
|
1545
|
-
placeholder:
|
|
1562
|
+
placeholder: u,
|
|
1546
1563
|
disabled: l,
|
|
1547
|
-
size:
|
|
1564
|
+
size: h,
|
|
1548
1565
|
variant: n,
|
|
1549
|
-
status:
|
|
1566
|
+
status: f,
|
|
1550
1567
|
inputMode: "none",
|
|
1551
1568
|
clearable: v,
|
|
1552
1569
|
onClear: () => e(void 0)
|
|
1553
1570
|
}
|
|
1554
1571
|
) : null,
|
|
1555
|
-
|
|
1572
|
+
T ? /* @__PURE__ */ Y(
|
|
1556
1573
|
"div",
|
|
1557
1574
|
{
|
|
1558
|
-
className: `sa-calendar sa-calendar-size-${
|
|
1559
|
-
ref:
|
|
1575
|
+
className: `sa-calendar sa-calendar-size-${h || "md"} ${o ? "" : "sa-calendar-no-input"} ${C ? "" : "sa-calendar-no-padding"}`,
|
|
1576
|
+
ref: D,
|
|
1560
1577
|
children: [
|
|
1561
1578
|
/* @__PURE__ */ a(
|
|
1562
|
-
|
|
1579
|
+
kn,
|
|
1563
1580
|
{
|
|
1564
|
-
setViews:
|
|
1565
|
-
views:
|
|
1581
|
+
setViews: I,
|
|
1582
|
+
views: F,
|
|
1566
1583
|
filter: t,
|
|
1567
|
-
previewDate:
|
|
1568
|
-
setPreviewDate:
|
|
1569
|
-
isComponentVisible:
|
|
1584
|
+
previewDate: M,
|
|
1585
|
+
setPreviewDate: L,
|
|
1586
|
+
isComponentVisible: T
|
|
1570
1587
|
}
|
|
1571
1588
|
),
|
|
1572
|
-
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children:
|
|
1573
|
-
|
|
1589
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: F === "days" ? /* @__PURE__ */ a(
|
|
1590
|
+
yn,
|
|
1574
1591
|
{
|
|
1575
1592
|
date: E,
|
|
1576
|
-
setDate:
|
|
1577
|
-
previewDate:
|
|
1578
|
-
setPreviewDate:
|
|
1579
|
-
setIsComponentVisible:
|
|
1593
|
+
setDate: z,
|
|
1594
|
+
previewDate: M,
|
|
1595
|
+
setPreviewDate: L,
|
|
1596
|
+
setIsComponentVisible: S,
|
|
1580
1597
|
input: o,
|
|
1581
|
-
minDate:
|
|
1598
|
+
minDate: c,
|
|
1582
1599
|
maxDate: d,
|
|
1583
1600
|
onChange: e
|
|
1584
1601
|
}
|
|
1585
|
-
) :
|
|
1586
|
-
|
|
1602
|
+
) : F === "months" ? /* @__PURE__ */ a(
|
|
1603
|
+
wn,
|
|
1587
1604
|
{
|
|
1588
1605
|
date: E,
|
|
1589
|
-
setDate:
|
|
1590
|
-
previewDate:
|
|
1591
|
-
setPreviewDate:
|
|
1606
|
+
setDate: z,
|
|
1607
|
+
previewDate: M,
|
|
1608
|
+
setPreviewDate: L,
|
|
1592
1609
|
filter: t,
|
|
1593
|
-
setViews:
|
|
1610
|
+
setViews: I,
|
|
1594
1611
|
onChange: e,
|
|
1595
|
-
minDate:
|
|
1612
|
+
minDate: c,
|
|
1596
1613
|
maxDate: d,
|
|
1597
1614
|
input: o
|
|
1598
1615
|
}
|
|
1599
1616
|
) : /* @__PURE__ */ a(
|
|
1600
|
-
|
|
1617
|
+
xn,
|
|
1601
1618
|
{
|
|
1602
1619
|
date: E,
|
|
1603
|
-
setDate:
|
|
1604
|
-
previewDate:
|
|
1605
|
-
setPreviewDate:
|
|
1620
|
+
setDate: z,
|
|
1621
|
+
previewDate: M,
|
|
1622
|
+
setPreviewDate: L,
|
|
1606
1623
|
filter: t,
|
|
1607
|
-
setViews:
|
|
1624
|
+
setViews: I,
|
|
1608
1625
|
onChange: e,
|
|
1609
|
-
minDate:
|
|
1626
|
+
minDate: c,
|
|
1610
1627
|
maxDate: d,
|
|
1611
1628
|
input: o
|
|
1612
1629
|
}
|
|
@@ -1618,69 +1635,71 @@ const Mn = Z(
|
|
|
1618
1635
|
}
|
|
1619
1636
|
);
|
|
1620
1637
|
return /* @__PURE__ */ a(
|
|
1621
|
-
|
|
1638
|
+
on,
|
|
1622
1639
|
{
|
|
1623
|
-
label:
|
|
1624
|
-
labelPosition:
|
|
1625
|
-
required:
|
|
1626
|
-
optional:
|
|
1627
|
-
description:
|
|
1628
|
-
helperText:
|
|
1629
|
-
errorText:
|
|
1640
|
+
label: m,
|
|
1641
|
+
labelPosition: p,
|
|
1642
|
+
required: s,
|
|
1643
|
+
optional: x,
|
|
1644
|
+
description: N,
|
|
1645
|
+
helperText: g,
|
|
1646
|
+
errorText: w,
|
|
1630
1647
|
fullWidth: k,
|
|
1631
1648
|
children: U
|
|
1632
1649
|
}
|
|
1633
1650
|
);
|
|
1634
1651
|
}
|
|
1635
|
-
),
|
|
1652
|
+
), $n = K(
|
|
1636
1653
|
({
|
|
1637
1654
|
value: r,
|
|
1638
1655
|
onChange: e,
|
|
1639
1656
|
filter: t,
|
|
1640
1657
|
input: o = !0,
|
|
1641
1658
|
rangedDate: l,
|
|
1642
|
-
disabled:
|
|
1659
|
+
disabled: c,
|
|
1643
1660
|
minDate: d,
|
|
1644
|
-
maxDate:
|
|
1645
|
-
placeholder:
|
|
1661
|
+
maxDate: u,
|
|
1662
|
+
placeholder: h,
|
|
1646
1663
|
size: n,
|
|
1647
|
-
variant:
|
|
1664
|
+
variant: i,
|
|
1648
1665
|
status: v,
|
|
1649
1666
|
clearable: k,
|
|
1650
|
-
fullWidth:
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1667
|
+
fullWidth: C,
|
|
1668
|
+
withPadding: m,
|
|
1669
|
+
label: p,
|
|
1670
|
+
labelPosition: s,
|
|
1671
|
+
required: x,
|
|
1672
|
+
optional: N,
|
|
1673
|
+
description: g,
|
|
1674
|
+
helperText: w,
|
|
1675
|
+
errorText: $
|
|
1676
|
+
}, f) => {
|
|
1677
|
+
const b = {
|
|
1660
1678
|
onChange: e,
|
|
1661
1679
|
value: r,
|
|
1662
1680
|
input: o,
|
|
1663
1681
|
filter: t,
|
|
1664
|
-
disabled:
|
|
1682
|
+
disabled: c,
|
|
1665
1683
|
minDate: d,
|
|
1666
|
-
maxDate:
|
|
1667
|
-
placeholder:
|
|
1684
|
+
maxDate: u,
|
|
1685
|
+
placeholder: h,
|
|
1668
1686
|
size: n,
|
|
1669
|
-
variant:
|
|
1687
|
+
variant: i,
|
|
1670
1688
|
status: v,
|
|
1671
1689
|
clearable: k,
|
|
1672
|
-
fullWidth:
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1690
|
+
fullWidth: C,
|
|
1691
|
+
withPadding: m,
|
|
1692
|
+
label: p,
|
|
1693
|
+
labelPosition: s,
|
|
1694
|
+
required: x,
|
|
1695
|
+
optional: N,
|
|
1696
|
+
description: g,
|
|
1697
|
+
helperText: w,
|
|
1698
|
+
errorText: $
|
|
1680
1699
|
};
|
|
1681
|
-
return /* @__PURE__ */ a(
|
|
1700
|
+
return /* @__PURE__ */ a(en, { children: l ? /* @__PURE__ */ a(bn, { ...b, ref: f }) : /* @__PURE__ */ a(Mn, { ...b, ref: f }) });
|
|
1682
1701
|
}
|
|
1683
1702
|
);
|
|
1684
1703
|
export {
|
|
1685
|
-
|
|
1704
|
+
$n as StarasiaDate
|
|
1686
1705
|
};
|