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