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