@starasia/date 5.2.3 → 5.2.4

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