1mpacto-react-ui 2.0.20 → 2.0.21

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.
Files changed (91) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/components/Alert/index.cjs +1 -1
  3. package/dist/components/Alert/index.mjs +40 -40
  4. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
  5. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
  6. package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
  7. package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
  8. package/dist/components/Calendar/Calendar.cjs +1 -1
  9. package/dist/components/Calendar/Calendar.mjs +98 -100
  10. package/dist/components/Calendar/CalendarMonth.cjs +1 -1
  11. package/dist/components/Calendar/CalendarMonth.mjs +41 -42
  12. package/dist/components/Calendar/CalendarRange.cjs +1 -1
  13. package/dist/components/Calendar/CalendarRange.mjs +59 -61
  14. package/dist/components/Calendar/CalendarYear.cjs +2 -2
  15. package/dist/components/Calendar/CalendarYear.mjs +37 -38
  16. package/dist/components/Chart/DoughnutChart.cjs +1 -1
  17. package/dist/components/Chart/DoughnutChart.mjs +93 -96
  18. package/dist/components/Chart/GradientBarChart.cjs +1 -1
  19. package/dist/components/Chart/GradientBarChart.mjs +80 -81
  20. package/dist/components/Chart/GradientLineChart.cjs +1 -1
  21. package/dist/components/Chart/GradientLineChart.mjs +50 -51
  22. package/dist/components/Chart/LineChart.cjs +1 -1
  23. package/dist/components/Chart/LineChart.mjs +23 -23
  24. package/dist/components/Chart/PieChart.cjs +1 -1
  25. package/dist/components/Chart/PieChart.mjs +45 -48
  26. package/dist/components/Collapse/Collapse.cjs +1 -1
  27. package/dist/components/Collapse/Collapse.mjs +23 -24
  28. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  29. package/dist/components/DatePicker/DatePicker.mjs +86 -89
  30. package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
  31. package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
  32. package/dist/components/DatePicker/FilterDate.cjs +1 -1
  33. package/dist/components/DatePicker/FilterDate.mjs +107 -110
  34. package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
  35. package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
  36. package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
  37. package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
  38. package/dist/components/Input/InputFloatingInner.cjs +5 -5
  39. package/dist/components/Input/InputFloatingInner.mjs +24 -25
  40. package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
  41. package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
  42. package/dist/components/Pagination/Pagination.cjs +2 -2
  43. package/dist/components/Pagination/Pagination.mjs +76 -80
  44. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
  45. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
  46. package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
  47. package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
  48. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  49. package/dist/components/Sidebar/Sidebar.mjs +65 -68
  50. package/dist/components/Step/Step.cjs +5 -5
  51. package/dist/components/Step/Step.mjs +52 -52
  52. package/dist/components/Table/Table.cjs +3 -3
  53. package/dist/components/Table/Table.mjs +275 -298
  54. package/dist/components/Table/TableSubMobile.cjs +1 -1
  55. package/dist/components/Table/TableSubMobile.mjs +32 -35
  56. package/dist/components/Tabs/Tabs.cjs +8 -8
  57. package/dist/components/Tabs/Tabs.mjs +66 -70
  58. package/dist/components/Textarea/Textarea.cjs +7 -7
  59. package/dist/components/Textarea/Textarea.mjs +47 -50
  60. package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
  61. package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
  62. package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
  63. package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
  64. package/dist/components/TimeRange/TimeRange.cjs +1 -1
  65. package/dist/components/TimeRange/TimeRange.mjs +88 -91
  66. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  67. package/dist/components/Tooltip/Tooltip.mjs +44 -46
  68. package/dist/components/Upload/UploadFile.cjs +1 -1
  69. package/dist/components/Upload/UploadFile.mjs +50 -54
  70. package/dist/components/Upload/UploadImage.cjs +3 -3
  71. package/dist/components/Upload/UploadImage.mjs +62 -68
  72. package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
  73. package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
  74. package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
  75. package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
  76. package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
  77. package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
  78. package/dist/config/components/tinymce.cjs +2 -2
  79. package/dist/config/components/tinymce.mjs +3 -3
  80. package/dist/hooks/useCountdown.cjs +1 -1
  81. package/dist/hooks/useCountdown.mjs +15 -15
  82. package/dist/hooks/useDebounce.cjs +1 -1
  83. package/dist/hooks/useDebounce.mjs +19 -19
  84. package/dist/hooks/useOtpInput.cjs +1 -1
  85. package/dist/hooks/useOtpInput.mjs +47 -51
  86. package/dist/package.json.cjs +1 -1
  87. package/dist/package.json.d.ts +5 -4
  88. package/dist/package.json.mjs +1 -1
  89. package/dist/utils/common.cjs +1 -1
  90. package/dist/utils/common.mjs +172 -173
  91. package/package.json +4 -4
@@ -1,17 +1,17 @@
1
- import { jsxs as f, jsx as a, Fragment as G } from "react/jsx-runtime";
2
- import x, { useEffect as L, isValidElement as w } from "react";
3
- import { createCalendar as P, getLocalTimeZone as H, getWeeksInMonth as V } from "@internationalized/date";
4
- import { useCalendar as B, useCalendarGrid as W } from "react-aria";
1
+ import { jsxs as h, jsx as n, Fragment as G } from "react/jsx-runtime";
2
+ import $, { useEffect as L, isValidElement as N } from "react";
3
+ import { createCalendar as P, getLocalTimeZone as I, getWeeksInMonth as V } from "@internationalized/date";
4
+ import { useCalendar as q, useCalendarGrid as W } from "react-aria";
5
5
  import { useCalendarState as j } from "react-stately";
6
- import d from "./style.module.scss.mjs";
7
- import q from "../Button/Button.mjs";
6
+ import i from "./style.module.scss.mjs";
7
+ import M from "../Button/Button.mjs";
8
8
  import F from "./CalendarCell.mjs";
9
- import R from "./CalendarButton.mjs";
9
+ import w from "./CalendarButton.mjs";
10
10
  import O from "./CalendarMonth.mjs";
11
- import z, { ChevronDownIcon as A } from "./CalendarYear.mjs";
11
+ import z, { ChevronDownIcon as H } from "./CalendarYear.mjs";
12
12
  import { useDeepCompareEffect as _ } from "../../hooks/useDeepCompareEffect.mjs";
13
13
  const K = (e) => {
14
- const C = V(e.state.visibleRange.start, e.locale), { gridProps: i, headerProps: n, weekDays: b } = W({}, e.state), { prevButtonProps: g, nextButtonProps: m, title: s } = B(e, e.state), h = (l) => {
14
+ const y = V(e.state.visibleRange.start, e.locale), { gridProps: a, headerProps: c, weekDays: C } = W({}, e.state), { prevButtonProps: f, nextButtonProps: g, title: d } = q(e, e.state), o = (l) => {
15
15
  let r = "";
16
16
  switch (l) {
17
17
  case 0:
@@ -38,72 +38,72 @@ const K = (e) => {
38
38
  }
39
39
  return r;
40
40
  };
41
- return /* @__PURE__ */ f("div", { children: [
42
- !e.hiddenHeader && /* @__PURE__ */ f("div", { className: d["header-calendar"], children: [
43
- /* @__PURE__ */ a(R, { ...g, children: typeof (e == null ? void 0 : e.prevIcon) == "function" || w(e == null ? void 0 : e.prevIcon) ? w(e.prevIcon) ? e.prevIcon : e.prevIcon() : /* @__PURE__ */ a(A, { className: "iru-rotate-90" }) }),
44
- /* @__PURE__ */ a("div", { className: d["header-button-calendar"], onClick: () => e.setActiveTypeCalendar("month"), children: s }),
45
- /* @__PURE__ */ a(R, { ...m, children: typeof (e == null ? void 0 : e.nextIcon) == "function" || w(e == null ? void 0 : e.nextIcon) ? w(e.nextIcon) ? e.nextIcon : e.nextIcon() : /* @__PURE__ */ a(A, { className: "-iru-rotate-90" }) })
41
+ return /* @__PURE__ */ h("div", { children: [
42
+ !e.hiddenHeader && /* @__PURE__ */ h("div", { className: i["header-calendar"], children: [
43
+ /* @__PURE__ */ n(w, { ...f, children: typeof e?.prevIcon == "function" || N(e?.prevIcon) ? N(e.prevIcon) ? e.prevIcon : e.prevIcon() : /* @__PURE__ */ n(H, { className: "iru-rotate-90" }) }),
44
+ /* @__PURE__ */ n("div", { className: i["header-button-calendar"], onClick: () => e.setActiveTypeCalendar("month"), children: d }),
45
+ /* @__PURE__ */ n(w, { ...g, children: typeof e?.nextIcon == "function" || N(e?.nextIcon) ? N(e.nextIcon) ? e.nextIcon : e.nextIcon() : /* @__PURE__ */ n(H, { className: "-iru-rotate-90" }) })
46
46
  ] }),
47
- /* @__PURE__ */ f("table", { ...i, children: [
48
- /* @__PURE__ */ a("thead", { ...n, children: /* @__PURE__ */ a("tr", { children: b.map((l, r) => /* @__PURE__ */ a("th", { className: d["days-calendar"], children: h(r) }, r)) }) }),
49
- /* @__PURE__ */ a("tbody", { children: [...new Array(C).keys()].map((l) => /* @__PURE__ */ a("tr", { children: e.state.getDatesInWeek(l).map((r, v) => r ? /* @__PURE__ */ a(F, { state: e.state, date: r }, v) : /* @__PURE__ */ a("td", {}, v)) }, l)) })
47
+ /* @__PURE__ */ h("table", { ...a, children: [
48
+ /* @__PURE__ */ n("thead", { ...c, children: /* @__PURE__ */ n("tr", { children: C.map((l, r) => /* @__PURE__ */ n("th", { className: i["days-calendar"], children: o(r) }, r)) }) }),
49
+ /* @__PURE__ */ n("tbody", { children: [...new Array(y).keys()].map((l) => /* @__PURE__ */ n("tr", { children: e.state.getDatesInWeek(l).map((r, b) => r ? /* @__PURE__ */ n(F, { state: e.state, date: r }, b) : /* @__PURE__ */ n("td", {}, b)) }, l)) })
50
50
  ] })
51
51
  ] });
52
- }, M = ({
52
+ }, R = ({
53
53
  minDate: e,
54
- maxDate: C,
55
- value: i,
56
- time: n,
57
- hiddenHeader: b,
58
- handlerChangeTime: g,
59
- timeLabel: m,
60
- type: s
54
+ maxDate: y,
55
+ value: a,
56
+ time: c,
57
+ hiddenHeader: C,
58
+ handlerChangeTime: f,
59
+ timeLabel: g,
60
+ type: d
61
61
  }) => {
62
- const h = e ? new Date(e) : null, l = C ? new Date(C) : null, r = h == null ? void 0 : h.getHours(), v = l == null ? void 0 : l.getHours(), N = h == null ? void 0 : h.getMinutes(), $ = l == null ? void 0 : l.getMinutes(), [D, I] = x.useState(!0), k = (t, c, u) => Array.from({ length: (c - t) / u + 1 }, (o, T) => t + T * u), E = (t, c) => {
63
- typeof g == "function" && g({ hour: t, minut: c, second: n == null ? void 0 : n.second });
64
- }, S = () => {
65
- const t = document.getElementById(`calendar-hour-${n == null ? void 0 : n.hour}-${s}`), c = document.getElementById(`calendar-minut-${n == null ? void 0 : n.minut}-${s}`), u = document.getElementById(`wrapper-calendar-hour-${s}`), o = document.getElementById(`wrapper-calendar-minut-${s}`);
66
- t && u && u.scrollTo({ behavior: "instant", top: t.offsetTop - 78 }), c && o && o.scrollTo({ behavior: "instant", top: c.offsetTop - 78 });
67
- }, y = (t, c) => {
68
- let u = !0;
69
- if (h && i) {
70
- const o = i.year === h.getFullYear(), T = i.month === h.getMonth() + 1;
71
- i.day === h.getDate() && T && o ? (c === "hour" && t < (r ?? 0) || c === "minut" && ((n == null ? void 0 : n.hour) ?? 0) <= h.getHours() && t < (N ?? 0)) && (u = !1) : i.toDate(H()).getTime() < h.getTime() && (u = !1);
62
+ const o = e ? new Date(e) : null, l = y ? new Date(y) : null, r = o?.getHours(), b = l?.getHours(), m = o?.getMinutes(), D = l?.getMinutes(), [E, A] = $.useState(!0), S = (t, u, s) => Array.from({ length: (u - t) / s + 1 }, (v, k) => t + k * s), x = (t, u) => {
63
+ typeof f == "function" && f({ hour: t, minut: u, second: c?.second });
64
+ }, B = () => {
65
+ const t = document.getElementById(`calendar-hour-${c?.hour}-${d}`), u = document.getElementById(`calendar-minut-${c?.minut}-${d}`), s = document.getElementById(`wrapper-calendar-hour-${d}`), v = document.getElementById(`wrapper-calendar-minut-${d}`);
66
+ t && s && s.scrollTo({ behavior: "instant", top: t.offsetTop - 78 }), u && v && v.scrollTo({ behavior: "instant", top: u.offsetTop - 78 });
67
+ }, T = (t, u) => {
68
+ let s = !0;
69
+ if (o && a) {
70
+ const v = a.year === o.getFullYear(), k = a.month === o.getMonth() + 1;
71
+ a.day === o.getDate() && k && v ? (u === "hour" && t < (r ?? 0) || u === "minut" && (c?.hour ?? 0) <= o.getHours() && t < (m ?? 0)) && (s = !1) : a.toDate(I()).getTime() < o.getTime() && (s = !1);
72
72
  }
73
- if (l && i) {
74
- const o = i.year === l.getFullYear(), T = i.month === l.getMonth() + 1;
75
- i.day === l.getDate() && T && o ? (c === "hour" && t > (v ?? 0) || c === "minut" && ((n == null ? void 0 : n.hour) ?? 0) >= l.getHours() && t > ($ ?? 0)) && (u = !1) : i.toDate(H()).getTime() > l.getTime() && (u = !1);
73
+ if (l && a) {
74
+ const v = a.year === l.getFullYear(), k = a.month === l.getMonth() + 1;
75
+ a.day === l.getDate() && k && v ? (u === "hour" && t > (b ?? 0) || u === "minut" && (c?.hour ?? 0) >= l.getHours() && t > (D ?? 0)) && (s = !1) : a.toDate(I()).getTime() > l.getTime() && (s = !1);
76
76
  }
77
- return u;
77
+ return s;
78
78
  };
79
- return x.useEffect(() => {
80
- D && S(), n && I(!1);
81
- }, [JSON.stringify(i), JSON.stringify(n)]), /* @__PURE__ */ f("div", { className: d["custom-time-calendar"], children: [
82
- !b && /* @__PURE__ */ a("div", { className: d["header-time"], children: m || "Atur Waktu" }),
83
- /* @__PURE__ */ f("div", { className: d["type-time"], children: [
84
- /* @__PURE__ */ a("div", { children: "Jam" }),
85
- /* @__PURE__ */ a("div", { children: "Menit" })
79
+ return $.useEffect(() => {
80
+ E && B(), c && A(!1);
81
+ }, [JSON.stringify(a), JSON.stringify(c)]), /* @__PURE__ */ h("div", { className: i["custom-time-calendar"], children: [
82
+ !C && /* @__PURE__ */ n("div", { className: i["header-time"], children: g || "Atur Waktu" }),
83
+ /* @__PURE__ */ h("div", { className: i["type-time"], children: [
84
+ /* @__PURE__ */ n("div", { children: "Jam" }),
85
+ /* @__PURE__ */ n("div", { children: "Menit" })
86
86
  ] }),
87
- /* @__PURE__ */ f("div", { className: "iru-flex iru-justify-around", children: [
88
- /* @__PURE__ */ a("div", { id: `wrapper-calendar-hour-${s}`, className: d["container-cell-time"], children: k(0, 23, 1).map((t) => /* @__PURE__ */ a(
87
+ /* @__PURE__ */ h("div", { className: "iru-flex iru-justify-around", children: [
88
+ /* @__PURE__ */ n("div", { id: `wrapper-calendar-hour-${d}`, className: i["container-cell-time"], children: S(0, 23, 1).map((t) => /* @__PURE__ */ n(
89
89
  "div",
90
90
  {
91
- id: `calendar-hour-${t}-${s}`,
92
- className: `${d["cell-time"]} ${(n == null ? void 0 : n.hour) === t ? y(t, "hour") ? d.selected : d.error : ""} ${y(t, "hour") && (n == null ? void 0 : n.hour) != t ? d.valid : d.invalid}`,
91
+ id: `calendar-hour-${t}-${d}`,
92
+ className: `${i["cell-time"]} ${c?.hour === t ? T(t, "hour") ? i.selected : i.error : ""} ${T(t, "hour") && c?.hour != t ? i.valid : i.invalid}`,
93
93
  onClick: () => {
94
- y(t, "hour") && E(t, n == null ? void 0 : n.minut);
94
+ T(t, "hour") && x(t, c?.minut);
95
95
  },
96
96
  children: t < 10 ? `0${t}` : t
97
97
  },
98
98
  t
99
99
  )) }),
100
- /* @__PURE__ */ a("div", { id: `wrapper-calendar-minut-${s}`, className: d["container-cell-time"], children: k(0, 59, 1).map((t) => /* @__PURE__ */ a(
100
+ /* @__PURE__ */ n("div", { id: `wrapper-calendar-minut-${d}`, className: i["container-cell-time"], children: S(0, 59, 1).map((t) => /* @__PURE__ */ n(
101
101
  "div",
102
102
  {
103
- id: `calendar-minut-${t}-${s}`,
104
- className: `${d["cell-time"]} ${(n == null ? void 0 : n.minut) === t ? y(t, "minut") ? d.selected : d.error : ""} ${y(t, "minut") && (n == null ? void 0 : n.minut) != t ? d.valid : d.invalid}`,
103
+ id: `calendar-minut-${t}-${d}`,
104
+ className: `${i["cell-time"]} ${c?.minut === t ? T(t, "minut") ? i.selected : i.error : ""} ${T(t, "minut") && c?.minut != t ? i.valid : i.invalid}`,
105
105
  onClick: () => {
106
- y(t, "minut") && E(n == null ? void 0 : n.hour, t);
106
+ T(t, "minut") && x(c?.hour, t);
107
107
  },
108
108
  children: t < 10 ? `0${t}` : t
109
109
  },
@@ -111,89 +111,87 @@ const K = (e) => {
111
111
  )) })
112
112
  ] })
113
113
  ] });
114
- }, de = (e) => {
115
- var N, $, D, I, k, E, S, y, t;
116
- const C = e.typeTime ?? "SINGLE", i = j({
114
+ }, le = (e) => {
115
+ const y = e.typeTime ?? "SINGLE", a = j({
117
116
  ...e,
118
117
  locale: e.locale,
119
118
  createCalendar: P
120
- }), { title: n } = B(e, i), [b, g] = x.useState((e == null ? void 0 : e.activeType) ?? "date"), [m, s] = x.useState({ start: void 0, end: void 0 }), h = (($ = (N = m.start) == null ? void 0 : N.hour) == null ? void 0 : $.toString()) && ((I = (D = m == null ? void 0 : m.start) == null ? void 0 : D.minut) == null ? void 0 : I.toString()) && ((S = e.value) == null ? void 0 : S.toDate(H()).setHours((k = m.start) == null ? void 0 : k.hour, (E = m.start) == null ? void 0 : E.minut)) || e.minDate, l = e.maxDate, r = (c, u) => {
121
- const o = {
122
- ...m,
123
- [u]: c
119
+ }), { title: c } = q(e, a), [C, f] = $.useState(e?.activeType ?? "date"), [g, d] = $.useState({ start: void 0, end: void 0 }), o = g.start?.hour?.toString() && g?.start?.minut?.toString() && e.value?.toDate(I()).setHours(g.start?.hour, g.start?.minut) || e.minDate, l = e.maxDate, r = (m, D) => {
120
+ const E = {
121
+ ...g,
122
+ [D]: m
124
123
  };
125
- s(o), typeof (e == null ? void 0 : e.handlerChangeTime) == "function" && e.handlerChangeTime(o);
126
- }, v = (c) => {
127
- i.setValue(c);
124
+ d(E), typeof e?.handlerChangeTime == "function" && e.handlerChangeTime(E);
125
+ }, b = (m) => {
126
+ a.setValue(m);
128
127
  };
129
128
  return _(() => {
130
- e != null && e.activeType && g(e.activeType);
131
- }, [e == null ? void 0 : e.activeType]), L(() => {
132
- var c, u;
133
- if ((c = e.time) != null && c.start && ((u = e.time) != null && u.end)) {
134
- const o = e.time.start, T = e.time.end;
135
- s({ start: o, end: T });
129
+ e?.activeType && f(e.activeType);
130
+ }, [e?.activeType]), L(() => {
131
+ if (e.time?.start && e.time?.end) {
132
+ const m = e.time.start, D = e.time.end;
133
+ d({ start: m, end: D });
136
134
  }
137
- }, [JSON.stringify(e.time)]), /* @__PURE__ */ f("div", { className: "iru-text-laba-base-sr", children: [
138
- b === "date" && /* @__PURE__ */ a(G, { children: /* @__PURE__ */ f("div", { className: d["container-calendar"], children: [
139
- /* @__PURE__ */ f("div", { className: "iru-flex iru-gap-2", children: [
140
- /* @__PURE__ */ a(K, { state: i, setActiveTypeCalendar: g, ...e }),
141
- (e == null ? void 0 : e.isCustomTime) && /* @__PURE__ */ f("div", { className: "iru-flex", children: [
142
- /* @__PURE__ */ a(
143
- M,
135
+ }, [JSON.stringify(e.time)]), /* @__PURE__ */ h("div", { className: "iru-text-laba-base-sr", children: [
136
+ C === "date" && /* @__PURE__ */ n(G, { children: /* @__PURE__ */ h("div", { className: i["container-calendar"], children: [
137
+ /* @__PURE__ */ h("div", { className: "iru-flex iru-gap-2", children: [
138
+ /* @__PURE__ */ n(K, { state: a, setActiveTypeCalendar: f, ...e }),
139
+ e?.isCustomTime && /* @__PURE__ */ h("div", { className: "iru-flex", children: [
140
+ /* @__PURE__ */ n(
141
+ R,
144
142
  {
145
143
  minDate: e.minDate,
146
144
  maxDate: e.maxDate,
147
- time: (y = e.time) == null ? void 0 : y.start,
145
+ time: e.time?.start,
148
146
  value: e.value,
149
- timeLabel: C === "RANGE" ? "Awal" : "Atur Waktu",
147
+ timeLabel: y === "RANGE" ? "Awal" : "Atur Waktu",
150
148
  type: "start",
151
- handlerChangeTime: (c) => r(c, "start")
149
+ handlerChangeTime: (m) => r(m, "start")
152
150
  }
153
151
  ),
154
- C === "RANGE" && /* @__PURE__ */ a(
155
- M,
152
+ y === "RANGE" && /* @__PURE__ */ n(
153
+ R,
156
154
  {
157
- minDate: h,
155
+ minDate: o,
158
156
  maxDate: l,
159
- time: (t = e.time) == null ? void 0 : t.end,
157
+ time: e.time?.end,
160
158
  value: e.value,
161
159
  timeLabel: "Akhir",
162
160
  type: "end",
163
- handlerChangeTime: (c) => r(c, "end")
161
+ handlerChangeTime: (m) => r(m, "end")
164
162
  }
165
163
  )
166
164
  ] })
167
165
  ] }),
168
- ((e == null ? void 0 : e.withConfirm) ?? (e == null ? void 0 : e.isCustomTime)) && /* @__PURE__ */ f("div", { className: `${d["footer-calendar"]}`, children: [
169
- typeof (e == null ? void 0 : e.buttonReset) == "function" ? /* @__PURE__ */ a("div", { onClick: () => e.handlerReset(i), children: e.buttonReset() }) : /* @__PURE__ */ a(q, { variants: "nude-laba-blue-10", size: "small", onClick: () => e.handlerReset(i), children: "Reset" }),
170
- typeof (e == null ? void 0 : e.buttonSubmit) == "function" ? /* @__PURE__ */ a("div", { onClick: e.handlerSubmit, children: e.buttonSubmit() }) : /* @__PURE__ */ a(q, { size: "small", onClick: e.handlerSubmit, children: "Terapkan" })
166
+ (e?.withConfirm ?? e?.isCustomTime) && /* @__PURE__ */ h("div", { className: `${i["footer-calendar"]}`, children: [
167
+ typeof e?.buttonReset == "function" ? /* @__PURE__ */ n("div", { onClick: () => e.handlerReset(a), children: e.buttonReset() }) : /* @__PURE__ */ n(M, { variants: "nude-laba-blue-10", size: "small", onClick: () => e.handlerReset(a), children: "Reset" }),
168
+ typeof e?.buttonSubmit == "function" ? /* @__PURE__ */ n("div", { onClick: e.handlerSubmit, children: e.buttonSubmit() }) : /* @__PURE__ */ n(M, { size: "small", onClick: e.handlerSubmit, children: "Terapkan" })
171
169
  ] })
172
170
  ] }) }),
173
- b === "month" && /* @__PURE__ */ a(
171
+ C === "month" && /* @__PURE__ */ n(
174
172
  O,
175
173
  {
176
- state: i,
177
- setActiveTypeCalendar: g,
174
+ state: a,
175
+ setActiveTypeCalendar: f,
178
176
  type: e.type,
179
- onChangeMonth: v,
177
+ onChangeMonth: b,
180
178
  hiddenHeader: e.hiddenHeader
181
179
  }
182
180
  ),
183
- b === "year" && /* @__PURE__ */ a(
181
+ C === "year" && /* @__PURE__ */ n(
184
182
  z,
185
183
  {
186
- state: i,
184
+ state: a,
187
185
  type: e.type,
188
- setActiveTypeCalendar: g,
189
- title: n,
190
- onChangeYear: v,
186
+ setActiveTypeCalendar: f,
187
+ title: c,
188
+ onChangeYear: b,
191
189
  hiddenHeader: e.hiddenHeader
192
190
  }
193
191
  )
194
192
  ] });
195
193
  };
196
194
  export {
197
- M as CustomTimeCalendar,
198
- de as default
195
+ R as CustomTimeCalendar,
196
+ le as default
199
197
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),Y=require("react-aria"),n=require("./style.module.scss.cjs"),x=require("./CalendarButton.cjs"),c=require("react"),j=require("./CalendarYear.cjs"),E=({prevIcon:l,nextIcon:d,state:e,setActiveTypeCalendar:m,onChangeMonth:f,type:s,hiddenHeader:b})=>{const g=new Date().getFullYear(),C=e.focusedDate.calendar.getMonthsInYear(e.focusedDate),N=Y.useDateFormatter({month:"short",timeZone:e.timeZone}),$=(o,r)=>{const u=e.focusedDate.set({month:o});r?(m("date"),e.setFocusedDate(u)):!r&&typeof f=="function"&&f(u)},h=o=>{const r=e.focusedDate.set({year:o});e.setFocusedDate(r)};return a.jsxs("div",{className:`iru-w-[296px] ${n.default["container-calendar"]}`,children:[!b&&a.jsxs("div",{className:n.default["header-calendar"],children:[a.jsx(x.default,{isDisabled:e!=null&&e.minValue?e.focusedDate.year<=e.minValue.year:!1,onPress:()=>h(e.focusedDate.year-1),children:typeof l=="function"||c.isValidElement(l)?c.isValidElement(l)?l:l():a.jsx(j.ChevronDownIcon,{className:"iru-rotate-90"})}),a.jsx("div",{className:`${n.default["header-button-calendar"]} ${s.includes("year")?"":n.default.disabled}`,onClick:()=>{s.includes("year")&&m("year")},children:e.focusedDate.year}),a.jsx(x.default,{isDisabled:e!=null&&e.maxValue?e.focusedDate.year>=e.maxValue.year:!1,onPress:()=>h(e.focusedDate.year+1),children:typeof d=="function"||c.isValidElement(d)?c.isValidElement(d)?d:d():a.jsx(j.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),a.jsx("div",{className:n.default["month-calendar"],children:[...Array(C).keys()].map(o=>{var t,y,D,V;const r=e.focusedDate.set({month:o+1}),u=N.format(r.toDate(e.timeZone)),q=((t=e.value)==null?void 0:t.year)||((D=(y=e.value)==null?void 0:y.start)==null?void 0:D.year)||g,v=e!=null&&e.minValue?r.month<((V=e==null?void 0:e.minValue)==null?void 0:V.month)&&r.year<=e.minValue.year:!1,M=e!=null&&e.maxValue?r.month>e.maxValue.month&&r.year>=e.maxValue.year:!1,i=v||M;return a.jsx("div",{onClick:()=>{i||$(r.month,s.includes("date"))},className:`${n.default["cell-month"]} ${e.focusedDate.month===r.month&&!i&&r.year===q?n.default.selected:""} ${e.focusedDate.month!==r.month&&!i?"hover:iru-bg-laba-blue-01":""} ${i?"iru-text-gray-400":"iru-cursor-pointer"}`,children:u},o)})})]})};exports.default=E;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),$=require("react-aria"),n=require("./style.module.scss.cjs"),h=require("./CalendarButton.cjs"),i=require("react"),y=require("./CalendarYear.cjs"),q=({prevIcon:l,nextIcon:s,state:e,setActiveTypeCalendar:c,onChangeMonth:m,type:t,hiddenHeader:D})=>{const V=new Date().getFullYear(),x=e.focusedDate.calendar.getMonthsInYear(e.focusedDate),j=$.useDateFormatter({month:"short",timeZone:e.timeZone}),b=(o,a)=>{const d=e.focusedDate.set({month:o});a?(c("date"),e.setFocusedDate(d)):!a&&typeof m=="function"&&m(d)},f=o=>{const a=e.focusedDate.set({year:o});e.setFocusedDate(a)};return r.jsxs("div",{className:`iru-w-[296px] ${n.default["container-calendar"]}`,children:[!D&&r.jsxs("div",{className:n.default["header-calendar"],children:[r.jsx(h.default,{isDisabled:e?.minValue?e.focusedDate.year<=e.minValue.year:!1,onPress:()=>f(e.focusedDate.year-1),children:typeof l=="function"||i.isValidElement(l)?i.isValidElement(l)?l:l():r.jsx(y.ChevronDownIcon,{className:"iru-rotate-90"})}),r.jsx("div",{className:`${n.default["header-button-calendar"]} ${t.includes("year")?"":n.default.disabled}`,onClick:()=>{t.includes("year")&&c("year")},children:e.focusedDate.year}),r.jsx(h.default,{isDisabled:e?.maxValue?e.focusedDate.year>=e.maxValue.year:!1,onPress:()=>f(e.focusedDate.year+1),children:typeof s=="function"||i.isValidElement(s)?i.isValidElement(s)?s:s():r.jsx(y.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),r.jsx("div",{className:n.default["month-calendar"],children:[...Array(x).keys()].map(o=>{const a=e.focusedDate.set({month:o+1}),d=j.format(a.toDate(e.timeZone)),g=e.value?.year||e.value?.start?.year||V,C=e?.minValue?a.month<e?.minValue?.month&&a.year<=e.minValue.year:!1,N=e?.maxValue?a.month>e.maxValue.month&&a.year>=e.maxValue.year:!1,u=C||N;return r.jsx("div",{onClick:()=>{u||b(a.month,t.includes("date"))},className:`${n.default["cell-month"]} ${e.focusedDate.month===a.month&&!u&&a.year===g?n.default.selected:""} ${e.focusedDate.month!==a.month&&!u?"hover:iru-bg-laba-blue-01":""} ${u?"iru-text-gray-400":"iru-cursor-pointer"}`,children:d},o)})})]})};exports.default=q;
@@ -1,74 +1,73 @@
1
- import { jsxs as N, jsx as r } from "react/jsx-runtime";
2
- import { useDateFormatter as v } from "react-aria";
3
- import n from "./style.module.scss.mjs";
4
- import $ from "./CalendarButton.mjs";
5
- import { isValidElement as c } from "react";
6
- import { ChevronDownIcon as p } from "./CalendarYear.mjs";
7
- const E = ({
1
+ import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
+ import { useDateFormatter as Y } from "react-aria";
3
+ import r from "./style.module.scss.mjs";
4
+ import y from "./CalendarButton.mjs";
5
+ import { isValidElement as m } from "react";
6
+ import { ChevronDownIcon as D } from "./CalendarYear.mjs";
7
+ const w = ({
8
8
  prevIcon: l,
9
9
  nextIcon: i,
10
10
  state: e,
11
- setActiveTypeCalendar: f,
12
- onChangeMonth: s,
13
- type: u,
14
- hiddenHeader: x
11
+ setActiveTypeCalendar: u,
12
+ onChangeMonth: t,
13
+ type: c,
14
+ hiddenHeader: V
15
15
  }) => {
16
- const g = (/* @__PURE__ */ new Date()).getFullYear(), t = e.focusedDate.calendar.getMonthsInYear(e.focusedDate), C = v({
16
+ const b = (/* @__PURE__ */ new Date()).getFullYear(), N = e.focusedDate.calendar.getMonthsInYear(e.focusedDate), $ = Y({
17
17
  month: "short",
18
18
  timeZone: e.timeZone
19
- }), Y = (a, o) => {
20
- const d = e.focusedDate.set({ month: a });
21
- o ? (f("date"), e.setFocusedDate(d)) : !o && typeof s == "function" && s(d);
22
- }, h = (a) => {
23
- const o = e.focusedDate.set({ year: a });
24
- e.setFocusedDate(o);
19
+ }), p = (n, a) => {
20
+ const s = e.focusedDate.set({ month: n });
21
+ a ? (u("date"), e.setFocusedDate(s)) : !a && typeof t == "function" && t(s);
22
+ }, f = (n) => {
23
+ const a = e.focusedDate.set({ year: n });
24
+ e.setFocusedDate(a);
25
25
  };
26
- return /* @__PURE__ */ N("div", { className: `iru-w-[296px] ${n["container-calendar"]}`, children: [
27
- !x && /* @__PURE__ */ N("div", { className: n["header-calendar"], children: [
28
- /* @__PURE__ */ r(
29
- $,
26
+ return /* @__PURE__ */ h("div", { className: `iru-w-[296px] ${r["container-calendar"]}`, children: [
27
+ !V && /* @__PURE__ */ h("div", { className: r["header-calendar"], children: [
28
+ /* @__PURE__ */ o(
29
+ y,
30
30
  {
31
- isDisabled: e != null && e.minValue ? e.focusedDate.year <= e.minValue.year : !1,
32
- onPress: () => h(e.focusedDate.year - 1),
33
- children: typeof l == "function" || c(l) ? c(l) ? l : l() : /* @__PURE__ */ r(p, { className: "iru-rotate-90" })
31
+ isDisabled: e?.minValue ? e.focusedDate.year <= e.minValue.year : !1,
32
+ onPress: () => f(e.focusedDate.year - 1),
33
+ children: typeof l == "function" || m(l) ? m(l) ? l : l() : /* @__PURE__ */ o(D, { className: "iru-rotate-90" })
34
34
  }
35
35
  ),
36
- /* @__PURE__ */ r(
36
+ /* @__PURE__ */ o(
37
37
  "div",
38
38
  {
39
- className: `${n["header-button-calendar"]} ${u.includes("year") ? "" : n.disabled}`,
39
+ className: `${r["header-button-calendar"]} ${c.includes("year") ? "" : r.disabled}`,
40
40
  onClick: () => {
41
- u.includes("year") && f("year");
41
+ c.includes("year") && u("year");
42
42
  },
43
43
  children: e.focusedDate.year
44
44
  }
45
45
  ),
46
- /* @__PURE__ */ r(
47
- $,
46
+ /* @__PURE__ */ o(
47
+ y,
48
48
  {
49
- isDisabled: e != null && e.maxValue ? e.focusedDate.year >= e.maxValue.year : !1,
50
- onPress: () => h(e.focusedDate.year + 1),
51
- children: typeof i == "function" || c(i) ? c(i) ? i : i() : /* @__PURE__ */ r(p, { className: "-iru-rotate-90" })
49
+ isDisabled: e?.maxValue ? e.focusedDate.year >= e.maxValue.year : !1,
50
+ onPress: () => f(e.focusedDate.year + 1),
51
+ children: typeof i == "function" || m(i) ? m(i) ? i : i() : /* @__PURE__ */ o(D, { className: "-iru-rotate-90" })
52
52
  }
53
53
  )
54
54
  ] }),
55
- /* @__PURE__ */ r("div", { className: n["month-calendar"], children: [...Array(t).keys()].map((a) => {
56
- var y, D, V, b;
57
- const o = e.focusedDate.set({ month: a + 1 }), d = C.format(o.toDate(e.timeZone)), F = ((y = e.value) == null ? void 0 : y.year) || ((V = (D = e.value) == null ? void 0 : D.start) == null ? void 0 : V.year) || g, M = e != null && e.minValue ? o.month < ((b = e == null ? void 0 : e.minValue) == null ? void 0 : b.month) && o.year <= e.minValue.year : !1, k = e != null && e.maxValue ? o.month > e.maxValue.month && o.year >= e.maxValue.year : !1, m = M || k;
58
- return /* @__PURE__ */ r(
55
+ /* @__PURE__ */ o("div", { className: r["month-calendar"], children: [...Array(N).keys()].map((n) => {
56
+ const a = e.focusedDate.set({ month: n + 1 }), s = $.format(a.toDate(e.timeZone)), x = e.value?.year || e.value?.start?.year || b, g = e?.minValue ? a.month < e?.minValue?.month && a.year <= e.minValue.year : !1, C = e?.maxValue ? a.month > e.maxValue.month && a.year >= e.maxValue.year : !1, d = g || C;
57
+ return /* @__PURE__ */ o(
59
58
  "div",
60
59
  {
61
60
  onClick: () => {
62
- m || Y(o.month, u.includes("date"));
61
+ d || p(a.month, c.includes("date"));
63
62
  },
64
- className: `${n["cell-month"]} ${e.focusedDate.month === o.month && !m && o.year === F ? n.selected : ""} ${e.focusedDate.month !== o.month && !m ? "hover:iru-bg-laba-blue-01" : ""} ${m ? "iru-text-gray-400" : "iru-cursor-pointer"}`,
65
- children: d
63
+ className: `${r["cell-month"]} ${e.focusedDate.month === a.month && !d && a.year === x ? r.selected : ""} ${e.focusedDate.month !== a.month && !d ? "hover:iru-bg-laba-blue-01" : ""} ${d ? "iru-text-gray-400" : "iru-cursor-pointer"}`,
64
+ children: s
66
65
  },
67
- a
66
+ n
68
67
  );
69
68
  }) })
70
69
  ] });
71
70
  };
72
71
  export {
73
- E as default
72
+ w as default
74
73
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),l=require("react"),o=require("@internationalized/date"),m=require("react-aria"),A=require("react-stately"),P=require("./CalendarButton.cjs"),r=require("./style.module.scss.cjs"),K=require("./CalendarCell.cjs"),E=require("../Button/Button.cjs"),Y=require("./CalendarMonth.cjs"),f=require("./CalendarYear.cjs"),M=require("./Calendar.cjs"),Z=e=>{var j,g,y,R,D,S,k,T,I,N,q,w;const u=l.useRef(null),{locale:s}=m.useLocale(),i=A.useRangeCalendarState({...e,locale:s,createCalendar:o.createCalendar}),B=n=>{let a="";switch(n){case 0:a="Min";break;case 1:a="Sen";break;case 2:a="Sel";break;case 3:a="Rab";break;case 4:a="Kam";break;case 5:a="Jum";break;case 6:a="Sab";break}return a},{calendarProps:L,prevButtonProps:V,nextButtonProps:_,title:C}=m.useRangeCalendar(e,i,u),{gridProps:z,headerProps:J,weekDays:O}=m.useCalendarGrid({},i),W=o.getWeeksInMonth(i.visibleRange.start,s),[h,x]=l.useState("date"),[c,b]=l.useState({start:void 0,end:void 0}),F=((g=(j=c.start)==null?void 0:j.hour)==null?void 0:g.toString())&&((R=(y=c==null?void 0:c.start)==null?void 0:y.minut)==null?void 0:R.toString())&&((T=(D=e.value)==null?void 0:D.start)==null?void 0:T.toDate(o.getLocalTimeZone()).setHours((S=c.start)==null?void 0:S.hour,(k=c.start)==null?void 0:k.minut))||e.minDate,G=e.maxDate,v=(n,a)=>{const d={...c,[a]:n};b(d),typeof(e==null?void 0:e.handlerChangeTimeRange)=="function"&&e.handlerChangeTimeRange(d)};return l.useEffect(()=>{var n,a;if((n=e.time)!=null&&n.start&&((a=e.time)!=null&&a.end)){const d=e.time.start,H=e.time.end;b({start:d,end:H})}},[JSON.stringify(e.time)]),t.jsxs("div",{className:"iru-text-laba-base-sr",children:[h==="date"&&t.jsx(t.Fragment,{children:t.jsx("div",{...L,ref:u,children:t.jsxs("div",{className:r.default["container-calendar"],children:[t.jsxs("div",{className:"iru-flex iru-gap-2",children:[t.jsxs("div",{children:[t.jsxs("div",{className:r.default["header-calendar"],children:[t.jsx(P.default,{...V,children:typeof(e==null?void 0:e.prevIcon)=="function"||l.isValidElement(e==null?void 0:e.prevIcon)?l.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():t.jsx(f.ChevronDownIcon,{className:"iru-rotate-90"})}),t.jsx("div",{className:r.default["header-button-calendar"],onClick:()=>x("month"),children:C}),t.jsx(P.default,{..._,children:typeof(e==null?void 0:e.nextIcon)=="function"||l.isValidElement(e==null?void 0:e.nextIcon)?l.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():t.jsx(f.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),t.jsxs("table",{...z,cellPadding:"0",className:"flex-1",children:[t.jsx("thead",{...J,className:"text-gray-600",children:t.jsx("tr",{children:O.map((n,a)=>t.jsx("th",{className:r.default["days-calendar"],children:B(a)},a))})}),t.jsx("tbody",{children:[...new Array(W).keys()].map(n=>t.jsx("tr",{children:i.getDatesInWeek(n).map((a,d)=>a?t.jsx(K.default,{state:i,date:a},d):t.jsx("td",{},d))},n))})]})]}),(e==null?void 0:e.isCustomTime)&&t.jsxs("div",{className:"iru-flex",children:[t.jsx(M.CustomTimeCalendar,{minDate:e.minDate,maxDate:e.maxDate,time:(I=e.time)==null?void 0:I.start,value:(N=e.value)==null?void 0:N.start,timeLabel:"Awal",type:"start",handlerChangeTime:n=>v(n,"start")}),t.jsx(M.CustomTimeCalendar,{minDate:F,maxDate:G,time:(q=e.time)==null?void 0:q.end,value:(w=e.value)==null?void 0:w.end,timeLabel:"Akhir",type:"end",handlerChangeTime:n=>v(n,"end")})]})]}),e.withConfirm&&t.jsxs("div",{className:r.default["footer-calendar"],children:[typeof(e==null?void 0:e.buttonReset)=="function"?t.jsx("div",{onClick:()=>e.handlerReset(i),children:e.buttonReset()}):t.jsx(E.default,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(i),children:"Reset"}),typeof(e==null?void 0:e.buttonSubmit)=="function"?t.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):t.jsx(E.default,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})})}),h==="month"&&t.jsx(Y.default,{state:i,setActiveTypeCalendar:x,type:["date","month","year"]}),h==="year"&&t.jsx(f.default,{state:i,setActiveTypeCalendar:x,title:C,type:["date","month","year"]})]})},Q=e=>{const u=A.useDateRangePickerState(e),s=l.useRef(null),{calendarProps:i}=m.useDateRangePicker(e,u,s);return t.jsx("div",{ref:s,children:t.jsx(Z,{handlerReset:e.handlerReset,handlerSubmit:e.handlerSubmit,withConfirm:e.withConfirm,prevIcon:e.prevIcon,nextIcon:e.nextIcon,buttonReset:e.buttonReset,buttonSubmit:e.buttonSubmit,isCustomTime:e.isCustomTime,time:e.time,minDate:e.minDate,maxDate:e.maxDate,handlerChangeTimeRange:e.handlerChangeTimeRange,...i})})};exports.default=Q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),l=require("react"),x=require("@internationalized/date"),m=require("react-aria"),y=require("react-stately"),v=require("./CalendarButton.cjs"),d=require("./style.module.scss.cjs"),M=require("./CalendarCell.cjs"),j=require("../Button/Button.cjs"),A=require("./CalendarMonth.cjs"),f=require("./CalendarYear.cjs"),R=require("./Calendar.cjs"),B=e=>{const u=l.useRef(null),{locale:s}=m.useLocale(),i=y.useRangeCalendarState({...e,locale:s,createCalendar:x.createCalendar}),D=n=>{let a="";switch(n){case 0:a="Min";break;case 1:a="Sen";break;case 2:a="Sel";break;case 3:a="Rab";break;case 4:a="Kam";break;case 5:a="Jum";break;case 6:a="Sab";break}return a},{calendarProps:S,prevButtonProps:k,nextButtonProps:T,title:C}=m.useRangeCalendar(e,i,u),{gridProps:I,headerProps:N,weekDays:q}=m.useCalendarGrid({},i),w=x.getWeeksInMonth(i.visibleRange.start,s),[o,h]=l.useState("date"),[r,b]=l.useState({start:void 0,end:void 0}),P=r.start?.hour?.toString()&&r?.start?.minut?.toString()&&e.value?.start?.toDate(x.getLocalTimeZone()).setHours(r.start?.hour,r.start?.minut)||e.minDate,E=e.maxDate,g=(n,a)=>{const c={...r,[a]:n};b(c),typeof e?.handlerChangeTimeRange=="function"&&e.handlerChangeTimeRange(c)};return l.useEffect(()=>{if(e.time?.start&&e.time?.end){const n=e.time.start,a=e.time.end;b({start:n,end:a})}},[JSON.stringify(e.time)]),t.jsxs("div",{className:"iru-text-laba-base-sr",children:[o==="date"&&t.jsx(t.Fragment,{children:t.jsx("div",{...S,ref:u,children:t.jsxs("div",{className:d.default["container-calendar"],children:[t.jsxs("div",{className:"iru-flex iru-gap-2",children:[t.jsxs("div",{children:[t.jsxs("div",{className:d.default["header-calendar"],children:[t.jsx(v.default,{...k,children:typeof e?.prevIcon=="function"||l.isValidElement(e?.prevIcon)?l.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():t.jsx(f.ChevronDownIcon,{className:"iru-rotate-90"})}),t.jsx("div",{className:d.default["header-button-calendar"],onClick:()=>h("month"),children:C}),t.jsx(v.default,{...T,children:typeof e?.nextIcon=="function"||l.isValidElement(e?.nextIcon)?l.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():t.jsx(f.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),t.jsxs("table",{...I,cellPadding:"0",className:"flex-1",children:[t.jsx("thead",{...N,className:"text-gray-600",children:t.jsx("tr",{children:q.map((n,a)=>t.jsx("th",{className:d.default["days-calendar"],children:D(a)},a))})}),t.jsx("tbody",{children:[...new Array(w).keys()].map(n=>t.jsx("tr",{children:i.getDatesInWeek(n).map((a,c)=>a?t.jsx(M.default,{state:i,date:a},c):t.jsx("td",{},c))},n))})]})]}),e?.isCustomTime&&t.jsxs("div",{className:"iru-flex",children:[t.jsx(R.CustomTimeCalendar,{minDate:e.minDate,maxDate:e.maxDate,time:e.time?.start,value:e.value?.start,timeLabel:"Awal",type:"start",handlerChangeTime:n=>g(n,"start")}),t.jsx(R.CustomTimeCalendar,{minDate:P,maxDate:E,time:e.time?.end,value:e.value?.end,timeLabel:"Akhir",type:"end",handlerChangeTime:n=>g(n,"end")})]})]}),e.withConfirm&&t.jsxs("div",{className:d.default["footer-calendar"],children:[typeof e?.buttonReset=="function"?t.jsx("div",{onClick:()=>e.handlerReset(i),children:e.buttonReset()}):t.jsx(j.default,{variants:"nude-laba-blue-10",size:"small",onClick:()=>e.handlerReset(i),children:"Reset"}),typeof e?.buttonSubmit=="function"?t.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):t.jsx(j.default,{size:"small",onClick:e.handlerSubmit,children:"Terapkan"})]})]})})}),o==="month"&&t.jsx(A.default,{state:i,setActiveTypeCalendar:h,type:["date","month","year"]}),o==="year"&&t.jsx(f.default,{state:i,setActiveTypeCalendar:h,title:C,type:["date","month","year"]})]})},L=e=>{const u=y.useDateRangePickerState(e),s=l.useRef(null),{calendarProps:i}=m.useDateRangePicker(e,u,s);return t.jsx("div",{ref:s,children:t.jsx(B,{handlerReset:e.handlerReset,handlerSubmit:e.handlerSubmit,withConfirm:e.withConfirm,prevIcon:e.prevIcon,nextIcon:e.nextIcon,buttonReset:e.buttonReset,buttonSubmit:e.buttonSubmit,isCustomTime:e.isCustomTime,time:e.time,minDate:e.minDate,maxDate:e.maxDate,handlerChangeTimeRange:e.handlerChangeTimeRange,...i})})};exports.default=L;