1mpacto-react-ui 2.0.25 → 2.0.27
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/assets/_colors.scss +42 -0
- package/dist/assets/_mixins.scss +6 -1
- package/dist/assets/_typography.scss +37 -3
- package/dist/assets/core.css +1 -1
- package/dist/assets/fontfamily.css +1 -1
- package/dist/assets/style.css +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.config.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.config.mjs +4 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +33 -33
- package/dist/components/Breadcrumbs/style.module.scss.cjs +1 -1
- package/dist/components/Breadcrumbs/style.module.scss.mjs +13 -10
- package/dist/components/Button/Button.config.cjs +1 -1
- package/dist/components/Button/Button.config.mjs +67 -56
- package/dist/components/Button/style.module.scss.cjs +1 -1
- package/dist/components/Button/style.module.scss.mjs +63 -56
- package/dist/components/ButtonIcon/ButtonIcon.config.cjs +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.config.mjs +58 -47
- package/dist/components/ButtonIcon/style.module.scss.cjs +1 -1
- package/dist/components/ButtonIcon/style.module.scss.mjs +53 -46
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.config.cjs +1 -0
- package/dist/components/Calendar/Calendar.config.mjs +22 -0
- package/dist/components/Calendar/Calendar.mjs +221 -133
- package/dist/components/Calendar/CalendarCell.cjs +1 -1
- package/dist/components/Calendar/CalendarCell.mjs +9 -9
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +23 -21
- package/dist/components/Calendar/CalendarRange.cjs +1 -1
- package/dist/components/Calendar/CalendarRange.mjs +100 -98
- package/dist/components/Calendar/CalendarYear.cjs +2 -2
- package/dist/components/Calendar/CalendarYear.mjs +25 -23
- package/dist/components/Calendar/style.module.scss.cjs +1 -1
- package/dist/components/Calendar/style.module.scss.mjs +35 -33
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.mjs +1 -1
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +78 -69
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DatePicker/DateRangePicker.mjs +91 -79
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +181 -127
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +58 -49
- package/dist/components/Input/InputInnerLabel.cjs +6 -6
- package/dist/components/Input/InputInnerLabel.config.cjs +1 -1
- package/dist/components/Input/InputInnerLabel.config.mjs +9 -5
- package/dist/components/Input/InputInnerLabel.mjs +36 -35
- package/dist/components/Input/InputInnerLabel.module.scss.cjs +1 -1
- package/dist/components/Input/InputInnerLabel.module.scss.mjs +19 -17
- package/dist/components/Modal/ModalDialog.cjs +1 -1
- package/dist/components/Modal/ModalDialog.config.cjs +1 -1
- package/dist/components/Modal/ModalDialog.config.mjs +11 -7
- package/dist/components/Modal/ModalDialog.mjs +24 -23
- package/dist/components/Modal/style.module.scss.cjs +1 -1
- package/dist/components/Modal/style.module.scss.mjs +13 -11
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.config.cjs +1 -0
- package/dist/components/Popover/Popover.config.mjs +10 -0
- package/dist/components/Popover/Popover.mjs +42 -40
- package/dist/components/Popover/style.module.scss.cjs +1 -1
- package/dist/components/Popover/style.module.scss.mjs +7 -4
- package/dist/components/Sidebar/ItemSidebar.config.cjs +1 -1
- package/dist/components/Sidebar/ItemSidebar.config.mjs +6 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.config.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.config.mjs +14 -12
- package/dist/components/Sidebar/Sidebar.mjs +78 -77
- package/dist/components/Sidebar/Sidebar.module.scss.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.module.scss.mjs +25 -23
- package/dist/components/Sidebar/itemSidebar.module.scss.cjs +1 -1
- package/dist/components/Sidebar/itemSidebar.module.scss.mjs +25 -24
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -5
- package/dist/components/Textarea/TextareaFloatingInner.config.cjs +1 -1
- package/dist/components/Textarea/TextareaFloatingInner.config.mjs +6 -2
- package/dist/components/Textarea/TextareaFloatingInner.mjs +38 -36
- package/dist/components/Textarea/TextareaFloatingInner.module.scss.cjs +1 -1
- package/dist/components/Textarea/TextareaFloatingInner.module.scss.mjs +14 -12
- package/dist/config/resources/index.cjs +1 -1
- package/dist/config/resources/index.mjs +1 -1
- package/dist/config/tailwind/colors.cjs +1 -1
- package/dist/config/tailwind/colors.mjs +22 -1
- package/dist/config/tailwind/typography.cjs +1 -1
- package/dist/config/tailwind/typography.mjs +79 -4
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/components/Breadcrumbs/Breadcrumbs.config.d.ts +1 -0
- package/dist/src/components/Button/Button.config.d.ts +11 -0
- package/dist/src/components/ButtonIcon/ButtonIcon.config.d.ts +11 -0
- package/dist/src/components/Calendar/Calendar.config.d.ts +19 -0
- package/dist/src/components/Calendar/Calendar.d.ts +5 -3
- package/dist/src/components/Calendar/Calendar.stories.d.ts +21 -5
- package/dist/src/components/Calendar/CalendarMonth.d.ts +1 -1
- package/dist/src/components/Calendar/CalendarRange.d.ts +1 -1
- package/dist/src/components/Calendar/CalendarYear.d.ts +1 -1
- package/dist/src/components/DatePicker/DatePicker.stories.d.ts +28 -0
- package/dist/src/components/DatePicker/FilterDate.d.ts +1 -1
- package/dist/src/components/DatePicker/FilterDate.stories.d.ts +29 -1
- package/dist/src/components/DatePicker/MonthYearPicker.d.ts +1 -1
- package/dist/src/components/DatePicker/MonthYearPicker.stories.d.ts +29 -1
- package/dist/src/components/Input/InputInnerLabel.config.d.ts +5 -1
- package/dist/src/components/Input/InputInnerLabel.stories.d.ts +16 -0
- package/dist/src/components/Modal/ModalDialog.config.d.ts +4 -0
- package/dist/src/components/Modal/ModalDialog.d.ts +1 -1
- package/dist/src/components/Modal/ModalDialog.stories.d.ts +1 -1
- package/dist/src/components/Popover/Popover.config.d.ts +7 -0
- package/dist/src/components/Sidebar/ItemSidebar.config.d.ts +4 -0
- package/dist/src/components/Sidebar/Sidebar.config.d.ts +2 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.config.d.ts +5 -0
- package/dist/src/config/resources/index.d.ts +2 -2
- package/dist/src/config/tailwind/typography.d.ts +1 -0
- package/dist/src/interfaces/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/src/interfaces/components/Button/index.d.ts +2 -2
- package/dist/src/interfaces/components/ButtonIcon/index.d.ts +2 -2
- package/dist/src/interfaces/components/Calendar/index.d.ts +41 -0
- package/dist/src/interfaces/components/DatePicker/index.d.ts +41 -1
- package/dist/src/interfaces/components/Input/index.d.ts +10 -0
- package/dist/src/interfaces/components/Modal/index.d.ts +5 -0
- package/dist/src/interfaces/components/Popover/index.d.ts +5 -0
- package/dist/src/interfaces/components/Sidebar/index.d.ts +6 -1
- package/dist/src/interfaces/components/Textarea/index.d.ts +5 -0
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +7 -7
- package/package.json +1 -1
|
@@ -1,109 +1,176 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import $, { useEffect as
|
|
3
|
-
import { createCalendar as
|
|
4
|
-
import { useCalendar as
|
|
5
|
-
import { useCalendarState as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useDeepCompareEffect as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
import { jsxs as f, jsx as a, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import $, { useEffect as j, isValidElement as k } from "react";
|
|
3
|
+
import { createCalendar as G, getLocalTimeZone as R, getWeeksInMonth as P } from "@internationalized/date";
|
|
4
|
+
import { useCalendar as F, useCalendarGrid as z } from "react-aria";
|
|
5
|
+
import { useCalendarState as O } from "react-stately";
|
|
6
|
+
import c from "./style.module.scss.mjs";
|
|
7
|
+
import w from "../Button/Button.mjs";
|
|
8
|
+
import Z from "./CalendarCell.mjs";
|
|
9
|
+
import A from "./CalendarButton.mjs";
|
|
10
|
+
import U from "./CalendarMonth.mjs";
|
|
11
|
+
import _, { ChevronDownIcon as q } from "./CalendarYear.mjs";
|
|
12
|
+
import { useDeepCompareEffect as K } from "../../hooks/useDeepCompareEffect.mjs";
|
|
13
|
+
import { configCalendar as I } from "./Calendar.config.mjs";
|
|
14
|
+
const o = {
|
|
15
|
+
"en-US": {
|
|
16
|
+
Reset: "Reset",
|
|
17
|
+
Apply: "Apply",
|
|
18
|
+
Start: "Start",
|
|
19
|
+
End: "End",
|
|
20
|
+
Hour: "Hour",
|
|
21
|
+
Minute: "Minute",
|
|
22
|
+
"Set Time": "Set time",
|
|
23
|
+
Sun: "Sun",
|
|
24
|
+
Mon: "Mon",
|
|
25
|
+
Tue: "Tue",
|
|
26
|
+
Wed: "Wed",
|
|
27
|
+
Thu: "Thu",
|
|
28
|
+
Fri: "Fri",
|
|
29
|
+
Sat: "Sat"
|
|
30
|
+
},
|
|
31
|
+
"id-ID": {
|
|
32
|
+
Reset: "Reset",
|
|
33
|
+
Apply: "Terapkan",
|
|
34
|
+
Start: "Awal",
|
|
35
|
+
End: "Akhir",
|
|
36
|
+
Hour: "Jam",
|
|
37
|
+
Minute: "Menit",
|
|
38
|
+
"Set Time": "Atur waktu",
|
|
39
|
+
Sun: "Min",
|
|
40
|
+
Mon: "Sen",
|
|
41
|
+
Tue: "Sel",
|
|
42
|
+
Wed: "Rab",
|
|
43
|
+
Thu: "Kam",
|
|
44
|
+
Fri: "Jum",
|
|
45
|
+
Sat: "Sab"
|
|
46
|
+
},
|
|
47
|
+
"zh-CN": {
|
|
48
|
+
Reset: "重置",
|
|
49
|
+
Apply: "应用",
|
|
50
|
+
Start: "开始",
|
|
51
|
+
End: "结束",
|
|
52
|
+
Hour: "小时",
|
|
53
|
+
Minute: "分钟",
|
|
54
|
+
"Set Time": "设置时间",
|
|
55
|
+
Sun: "周日",
|
|
56
|
+
Mon: "周一",
|
|
57
|
+
Tue: "周二",
|
|
58
|
+
Wed: "周三",
|
|
59
|
+
Thu: "周四",
|
|
60
|
+
Fri: "周五",
|
|
61
|
+
Sat: "周六"
|
|
62
|
+
},
|
|
63
|
+
"nl-NL": {
|
|
64
|
+
Reset: "Reset",
|
|
65
|
+
Apply: "Toepassen",
|
|
66
|
+
Start: "Start",
|
|
67
|
+
End: "Einde",
|
|
68
|
+
Hour: "Uur",
|
|
69
|
+
Minute: "Minuten",
|
|
70
|
+
"Set Time": "Tijd instellen",
|
|
71
|
+
Sun: "Zo",
|
|
72
|
+
Mon: "Ma",
|
|
73
|
+
Tue: "Di",
|
|
74
|
+
Wed: "Wo",
|
|
75
|
+
Thu: "Do",
|
|
76
|
+
Fri: "Vr",
|
|
77
|
+
Sat: "Za"
|
|
78
|
+
}
|
|
79
|
+
}, Q = (n, e) => {
|
|
80
|
+
let i = "";
|
|
81
|
+
switch (n) {
|
|
82
|
+
case 0:
|
|
83
|
+
i = o[e].Sun;
|
|
84
|
+
break;
|
|
85
|
+
case 1:
|
|
86
|
+
i = o[e].Mon;
|
|
87
|
+
break;
|
|
88
|
+
case 2:
|
|
89
|
+
i = o[e].Tue;
|
|
90
|
+
break;
|
|
91
|
+
case 3:
|
|
92
|
+
i = o[e].Wed;
|
|
93
|
+
break;
|
|
94
|
+
case 4:
|
|
95
|
+
i = o[e].Thu;
|
|
96
|
+
break;
|
|
97
|
+
case 5:
|
|
98
|
+
i = o[e].Fri;
|
|
99
|
+
break;
|
|
100
|
+
case 6:
|
|
101
|
+
i = o[e].Sat;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
return i;
|
|
105
|
+
}, X = (n) => {
|
|
106
|
+
const e = P(n.state.visibleRange.start, n.locale), { gridProps: i, headerProps: r, weekDays: E } = z({}, n.state), { prevButtonProps: T, nextButtonProps: S, title: l } = F(n, n.state);
|
|
107
|
+
return /* @__PURE__ */ f("div", { children: [
|
|
108
|
+
!n.hiddenHeader && /* @__PURE__ */ f("div", { className: c["header-calendar"], children: [
|
|
109
|
+
/* @__PURE__ */ a(A, { ...T, children: typeof n?.prevIcon == "function" || k(n?.prevIcon) ? k(n.prevIcon) ? n.prevIcon : n.prevIcon() : /* @__PURE__ */ a(q, { className: "iru-rotate-90" }) }),
|
|
110
|
+
/* @__PURE__ */ a("div", { className: c["header-button-calendar"], onClick: () => n.setActiveTypeCalendar("month"), children: l }),
|
|
111
|
+
/* @__PURE__ */ a(A, { ...S, children: typeof n?.nextIcon == "function" || k(n?.nextIcon) ? k(n.nextIcon) ? n.nextIcon : n.nextIcon() : /* @__PURE__ */ a(q, { className: "-iru-rotate-90" }) })
|
|
46
112
|
] }),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ f("table", { ...i, children: [
|
|
114
|
+
/* @__PURE__ */ a("thead", { ...r, children: /* @__PURE__ */ a("tr", { children: E.map((g, d) => /* @__PURE__ */ a("th", { className: c["days-calendar"], children: Q(d, n.locale) }, d)) }) }),
|
|
115
|
+
/* @__PURE__ */ a("tbody", { children: [...new Array(e).keys()].map((g) => /* @__PURE__ */ a("tr", { children: n.state.getDatesInWeek(g).map((d, s) => d ? /* @__PURE__ */ a(Z, { state: n.state, date: d }, s) : /* @__PURE__ */ a("td", {}, s)) }, g)) })
|
|
50
116
|
] })
|
|
51
117
|
] });
|
|
52
|
-
},
|
|
53
|
-
minDate:
|
|
54
|
-
maxDate:
|
|
55
|
-
value:
|
|
56
|
-
time:
|
|
57
|
-
hiddenHeader:
|
|
58
|
-
handlerChangeTime:
|
|
59
|
-
timeLabel:
|
|
60
|
-
type:
|
|
118
|
+
}, B = ({
|
|
119
|
+
minDate: n,
|
|
120
|
+
maxDate: e,
|
|
121
|
+
value: i,
|
|
122
|
+
time: r,
|
|
123
|
+
hiddenHeader: E,
|
|
124
|
+
handlerChangeTime: T,
|
|
125
|
+
timeLabel: S,
|
|
126
|
+
type: l,
|
|
127
|
+
locale: g = "id-ID"
|
|
61
128
|
}) => {
|
|
62
|
-
const
|
|
63
|
-
typeof
|
|
64
|
-
},
|
|
65
|
-
const t = document.getElementById(`calendar-hour-${
|
|
66
|
-
t &&
|
|
67
|
-
},
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
|
|
129
|
+
const d = n ? new Date(n) : null, s = e ? new Date(e) : null, D = d?.getHours(), N = s?.getHours(), m = d?.getMinutes(), M = s?.getMinutes(), [v, W] = $.useState(!0), H = (t, h, u) => Array.from({ length: (h - t) / u + 1 }, (y, b) => t + b * u), x = (t, h) => {
|
|
130
|
+
typeof T == "function" && T({ hour: t, minut: h, second: r?.second });
|
|
131
|
+
}, V = () => {
|
|
132
|
+
const t = document.getElementById(`calendar-hour-${r?.hour}-${l}`), h = document.getElementById(`calendar-minut-${r?.minut}-${l}`), u = document.getElementById(`wrapper-calendar-hour-${l}`), y = document.getElementById(`wrapper-calendar-minut-${l}`);
|
|
133
|
+
t && u && u.scrollTo({ behavior: "instant", top: t.offsetTop - 78 }), h && y && y.scrollTo({ behavior: "instant", top: h.offsetTop - 78 });
|
|
134
|
+
}, C = (t, h) => {
|
|
135
|
+
let u = !0;
|
|
136
|
+
if (d && i) {
|
|
137
|
+
const y = i.year === d.getFullYear(), b = i.month === d.getMonth() + 1;
|
|
138
|
+
i.day === d.getDate() && b && y ? (h === "hour" && t < (D ?? 0) || h === "minut" && (r?.hour ?? 0) <= d.getHours() && t < (m ?? 0)) && (u = !1) : i.toDate(R()).getTime() < d.getTime() && (u = !1);
|
|
72
139
|
}
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
140
|
+
if (s && i) {
|
|
141
|
+
const y = i.year === s.getFullYear(), b = i.month === s.getMonth() + 1;
|
|
142
|
+
i.day === s.getDate() && b && y ? (h === "hour" && t > (N ?? 0) || h === "minut" && (r?.hour ?? 0) >= s.getHours() && t > (M ?? 0)) && (u = !1) : i.toDate(R()).getTime() > s.getTime() && (u = !1);
|
|
76
143
|
}
|
|
77
|
-
return
|
|
144
|
+
return u;
|
|
78
145
|
};
|
|
79
146
|
return $.useEffect(() => {
|
|
80
|
-
|
|
81
|
-
}, [JSON.stringify(
|
|
82
|
-
!
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
147
|
+
v && V(), r && W(!1);
|
|
148
|
+
}, [JSON.stringify(i), JSON.stringify(r)]), /* @__PURE__ */ f("div", { className: c["custom-time-calendar"], children: [
|
|
149
|
+
!E && /* @__PURE__ */ a("div", { className: c["header-time"], children: S || o[g]["Set Time"] }),
|
|
150
|
+
/* @__PURE__ */ f("div", { className: c["type-time"], children: [
|
|
151
|
+
/* @__PURE__ */ a("div", { children: o[g].Hour }),
|
|
152
|
+
/* @__PURE__ */ a("div", { children: o[g].Minute })
|
|
86
153
|
] }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ f("div", { className: "iru-flex iru-justify-around", children: [
|
|
155
|
+
/* @__PURE__ */ a("div", { id: `wrapper-calendar-hour-${l}`, className: c["container-cell-time"], children: H(0, 23, 1).map((t) => /* @__PURE__ */ a(
|
|
89
156
|
"div",
|
|
90
157
|
{
|
|
91
|
-
id: `calendar-hour-${t}-${
|
|
92
|
-
className: `${
|
|
158
|
+
id: `calendar-hour-${t}-${l}`,
|
|
159
|
+
className: `${c["cell-time"]} ${r?.hour === t ? C(t, "hour") ? c.selected : c.error : ""} ${C(t, "hour") && r?.hour != t ? c.valid : c.invalid}`,
|
|
93
160
|
onClick: () => {
|
|
94
|
-
|
|
161
|
+
C(t, "hour") && x(t, r?.minut);
|
|
95
162
|
},
|
|
96
163
|
children: t < 10 ? `0${t}` : t
|
|
97
164
|
},
|
|
98
165
|
t
|
|
99
166
|
)) }),
|
|
100
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ a("div", { id: `wrapper-calendar-minut-${l}`, className: c["container-cell-time"], children: H(0, 59, 1).map((t) => /* @__PURE__ */ a(
|
|
101
168
|
"div",
|
|
102
169
|
{
|
|
103
|
-
id: `calendar-minut-${t}-${
|
|
104
|
-
className: `${
|
|
170
|
+
id: `calendar-minut-${t}-${l}`,
|
|
171
|
+
className: `${c["cell-time"]} ${r?.minut === t ? C(t, "minut") ? c.selected : c.error : ""} ${C(t, "minut") && r?.minut != t ? c.valid : c.invalid}`,
|
|
105
172
|
onClick: () => {
|
|
106
|
-
|
|
173
|
+
C(t, "minut") && x(r?.hour, t);
|
|
107
174
|
},
|
|
108
175
|
children: t < 10 ? `0${t}` : t
|
|
109
176
|
},
|
|
@@ -111,87 +178,108 @@ const K = (e) => {
|
|
|
111
178
|
)) })
|
|
112
179
|
] })
|
|
113
180
|
] });
|
|
114
|
-
},
|
|
115
|
-
const
|
|
181
|
+
}, me = ({ variants: n = "laba-blue-10", ...e }) => {
|
|
182
|
+
const i = e.typeTime ?? "SINGLE", r = O({
|
|
116
183
|
...e,
|
|
117
184
|
locale: e.locale,
|
|
118
|
-
createCalendar:
|
|
119
|
-
}), { title:
|
|
120
|
-
const
|
|
121
|
-
...
|
|
122
|
-
[
|
|
185
|
+
createCalendar: G
|
|
186
|
+
}), { title: E } = F(e, r), [T, S] = $.useState(e?.activeType ?? "date"), [l, g] = $.useState({ start: void 0, end: void 0 }), d = l.start?.hour?.toString() && l?.start?.minut?.toString() && e.value?.toDate(R()).setHours(l.start?.hour, l.start?.minut) || e.minDate, s = e.maxDate, D = (m, M) => {
|
|
187
|
+
const v = {
|
|
188
|
+
...l,
|
|
189
|
+
[M]: m
|
|
123
190
|
};
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
191
|
+
g(v), typeof e?.handlerChangeTime == "function" && e.handlerChangeTime(v);
|
|
192
|
+
}, N = (m) => {
|
|
193
|
+
r.setValue(m);
|
|
127
194
|
};
|
|
128
|
-
return
|
|
129
|
-
e?.activeType &&
|
|
130
|
-
}, [e?.activeType]),
|
|
195
|
+
return K(() => {
|
|
196
|
+
e?.activeType && S(e.activeType);
|
|
197
|
+
}, [e?.activeType]), j(() => {
|
|
131
198
|
if (e.time?.start && e.time?.end) {
|
|
132
|
-
const m = e.time.start,
|
|
133
|
-
|
|
199
|
+
const m = e.time.start, M = e.time.end;
|
|
200
|
+
g({ start: m, end: M });
|
|
134
201
|
}
|
|
135
|
-
}, [JSON.stringify(e.time)]), /* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
e?.isCustomTime && /* @__PURE__ */
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
202
|
+
}, [JSON.stringify(e.time)]), /* @__PURE__ */ f("div", { className: "iru-text-laba-base-sr", children: [
|
|
203
|
+
T === "date" && /* @__PURE__ */ a(L, { children: /* @__PURE__ */ f("div", { className: `${I.variants[n]}`, children: [
|
|
204
|
+
/* @__PURE__ */ f("div", { className: "iru-flex iru-gap-2", children: [
|
|
205
|
+
/* @__PURE__ */ a(X, { state: r, setActiveTypeCalendar: S, ...e }),
|
|
206
|
+
e?.isCustomTime && /* @__PURE__ */ f("div", { className: "iru-flex", children: [
|
|
207
|
+
/* @__PURE__ */ a(
|
|
208
|
+
B,
|
|
142
209
|
{
|
|
143
210
|
minDate: e.minDate,
|
|
144
211
|
maxDate: e.maxDate,
|
|
145
212
|
time: e.time?.start,
|
|
146
213
|
value: e.value,
|
|
147
|
-
timeLabel:
|
|
214
|
+
timeLabel: o[e.locale][i === "RANGE" ? "Start" : "Set Time"],
|
|
148
215
|
type: "start",
|
|
149
|
-
|
|
216
|
+
locale: e.locale,
|
|
217
|
+
handlerChangeTime: (m) => D(m, "start")
|
|
150
218
|
}
|
|
151
219
|
),
|
|
152
|
-
|
|
153
|
-
|
|
220
|
+
i === "RANGE" && /* @__PURE__ */ a(
|
|
221
|
+
B,
|
|
154
222
|
{
|
|
155
|
-
minDate:
|
|
156
|
-
maxDate:
|
|
223
|
+
minDate: d,
|
|
224
|
+
maxDate: s,
|
|
157
225
|
time: e.time?.end,
|
|
158
226
|
value: e.value,
|
|
159
|
-
timeLabel:
|
|
227
|
+
timeLabel: o[e.locale].End,
|
|
160
228
|
type: "end",
|
|
161
|
-
handlerChangeTime: (m) =>
|
|
229
|
+
handlerChangeTime: (m) => D(m, "end")
|
|
162
230
|
}
|
|
163
231
|
)
|
|
164
232
|
] })
|
|
165
233
|
] }),
|
|
166
|
-
(e?.withConfirm ?? e?.isCustomTime) && /* @__PURE__ */
|
|
167
|
-
typeof e?.buttonReset == "function" ? /* @__PURE__ */
|
|
168
|
-
|
|
234
|
+
(e?.withConfirm ?? e?.isCustomTime) && /* @__PURE__ */ f("div", { className: `${c["footer-calendar"]}`, children: [
|
|
235
|
+
typeof e?.buttonReset == "function" ? /* @__PURE__ */ a("div", { onClick: () => e.handlerReset(r), children: e.buttonReset() }) : /* @__PURE__ */ a(
|
|
236
|
+
w,
|
|
237
|
+
{
|
|
238
|
+
variants: I.resetButtonVariant[n],
|
|
239
|
+
size: "small",
|
|
240
|
+
onClick: () => e.handlerReset(r),
|
|
241
|
+
children: o[e.locale].Reset
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
typeof e?.buttonSubmit == "function" ? /* @__PURE__ */ a("div", { onClick: e.handlerSubmit, children: e.buttonSubmit() }) : /* @__PURE__ */ a(
|
|
245
|
+
w,
|
|
246
|
+
{
|
|
247
|
+
variants: I.submitButtonVariant[n],
|
|
248
|
+
size: "small",
|
|
249
|
+
onClick: e.handlerSubmit,
|
|
250
|
+
children: o[e.locale].Apply
|
|
251
|
+
}
|
|
252
|
+
)
|
|
169
253
|
] })
|
|
170
254
|
] }) }),
|
|
171
|
-
|
|
172
|
-
|
|
255
|
+
T === "month" && /* @__PURE__ */ a(
|
|
256
|
+
U,
|
|
173
257
|
{
|
|
174
|
-
state:
|
|
175
|
-
setActiveTypeCalendar:
|
|
258
|
+
state: r,
|
|
259
|
+
setActiveTypeCalendar: S,
|
|
176
260
|
type: e.type,
|
|
177
|
-
onChangeMonth:
|
|
261
|
+
onChangeMonth: N,
|
|
262
|
+
variants: n,
|
|
178
263
|
hiddenHeader: e.hiddenHeader
|
|
179
264
|
}
|
|
180
265
|
),
|
|
181
|
-
|
|
182
|
-
|
|
266
|
+
T === "year" && /* @__PURE__ */ a(
|
|
267
|
+
_,
|
|
183
268
|
{
|
|
184
|
-
state:
|
|
269
|
+
state: r,
|
|
185
270
|
type: e.type,
|
|
186
|
-
setActiveTypeCalendar:
|
|
187
|
-
title:
|
|
188
|
-
onChangeYear:
|
|
189
|
-
hiddenHeader: e.hiddenHeader
|
|
271
|
+
setActiveTypeCalendar: S,
|
|
272
|
+
title: E,
|
|
273
|
+
onChangeYear: N,
|
|
274
|
+
hiddenHeader: e.hiddenHeader,
|
|
275
|
+
variants: n
|
|
190
276
|
}
|
|
191
277
|
)
|
|
192
278
|
] });
|
|
193
279
|
};
|
|
194
280
|
export {
|
|
195
|
-
|
|
196
|
-
|
|
281
|
+
B as CustomTimeCalendar,
|
|
282
|
+
me as default,
|
|
283
|
+
Q as getDaysCalendar,
|
|
284
|
+
o as translateCalendar
|
|
197
285
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),j=require("react"),c=require("@internationalized/date"),r=require("react-aria"),l=require("./style.module.scss.cjs"),x=f=>{const o=j.useRef(null),{locale:b}=r.useLocale(),{state:t,date:e}=f,{cellProps:R,buttonProps:v,isSelected:a,isOutsideVisibleRange:$,isDisabled:s,formattedDate:g,isInvalid:d}=r.useCalendarCell({date:e},t,o),{focusProps:m}=r.useFocusRing(),n="highlightedRange"in t?t.highlightedRange?c.isSameDay(e,t.highlightedRange.start):null:a,u="highlightedRange"in t?t.highlightedRange?c.isSameDay(e,t.highlightedRange.end):null:a,h=c.getDayOfWeek(e,b),y=a&&(n||h===0||e.day===1),S=a&&(u||h===6||e.day===e.calendar.getDaysInMonth(e));return i.jsx("td",{...R,children:i.jsx("div",{ref:o,className:`${l.default["cell-calendar"]} ${y?"iru-rounded-l-full":""} ${S?"iru-rounded-r-full":""} ${a?d?l.default.error:l.default.selected:""} ${s?"iru-disabled":""}`,children:$?i.jsx("div",{className:l.default["visible-cell-calendar"],children:g}):i.jsx("div",{...r.mergeProps(v,m),className:`${l.default["active-cell-calendar"]} ${s&&!d?l.default.disabled:""} ${n||u?d?l.default.error:l.default.selected:""} ${a&&!s&&!(n??u)?d?"hover:iru-bg-red-400":"hover:iru-text-laba-blue-05":""} ${!a&&!s?"hover:iru-bg-laba-blue-01":""}`,children:g})})})};exports.default=x;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import y from "react";
|
|
3
|
-
import { isSameDay as
|
|
3
|
+
import { isSameDay as u, getDayOfWeek as D } from "@internationalized/date";
|
|
4
4
|
import { useLocale as S, useCalendarCell as C, useFocusRing as P, mergeProps as x } from "react-aria";
|
|
5
|
-
import
|
|
6
|
-
const W = (
|
|
7
|
-
const o = y.useRef(null), { locale:
|
|
8
|
-
return /* @__PURE__ */ s("td", { ...
|
|
5
|
+
import l from "./style.module.scss.mjs";
|
|
6
|
+
const W = (g) => {
|
|
7
|
+
const o = y.useRef(null), { locale: m } = S(), { state: i, date: e } = g, { cellProps: f, buttonProps: R, isSelected: t, isOutsideVisibleRange: b, isDisabled: a, formattedDate: c, isInvalid: r } = C({ date: e }, i, o), { focusProps: p } = P(), d = "highlightedRange" in i ? i.highlightedRange ? u(e, i.highlightedRange.start) : null : t, n = "highlightedRange" in i ? i.highlightedRange ? u(e, i.highlightedRange.end) : null : t, h = D(e, m), $ = t && (d || h === 0 || e.day === 1), v = t && (n || h === 6 || e.day === e.calendar.getDaysInMonth(e));
|
|
8
|
+
return /* @__PURE__ */ s("td", { ...f, children: /* @__PURE__ */ s(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
11
|
-
...x(f, p),
|
|
12
11
|
ref: o,
|
|
13
|
-
className: `${
|
|
14
|
-
children:
|
|
12
|
+
className: `${l["cell-calendar"]} ${$ ? "iru-rounded-l-full" : ""} ${v ? "iru-rounded-r-full" : ""} ${t ? r ? l.error : l.selected : ""} ${a ? "iru-disabled" : ""}`,
|
|
13
|
+
children: b ? /* @__PURE__ */ s("div", { className: l["visible-cell-calendar"], children: c }) : /* @__PURE__ */ s(
|
|
15
14
|
"div",
|
|
16
15
|
{
|
|
17
|
-
|
|
16
|
+
...x(R, p),
|
|
17
|
+
className: `${l["active-cell-calendar"]} ${a && !r ? l.disabled : ""} ${d || n ? r ? l.error : l.selected : ""} ${t && !a && !(d ?? n) ? r ? "hover:iru-bg-red-400" : "hover:iru-text-laba-blue-05" : ""} ${!t && !a ? "hover:iru-bg-laba-blue-01" : ""}`,
|
|
18
18
|
children: c
|
|
19
19
|
}
|
|
20
20
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime")
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),N=require("react-aria"),o=require("./style.module.scss.cjs"),h=require("./CalendarButton.cjs"),u=require("react"),y=require("./CalendarYear.cjs"),$=require("./Calendar.config.cjs"),M=({prevIcon:l,nextIcon:s,state:e,setActiveTypeCalendar:c,onChangeMonth:m,type:t,hiddenHeader:D,variants:V="laba-blue-10"})=>{const x=new Date().getFullYear(),b=e.focusedDate.calendar.getMonthsInYear(e.focusedDate),j=N.useDateFormatter({month:"short",timeZone:e.timeZone}),g=(n,a)=>{const i=e.focusedDate.set({month:n});a?(c("date"),e.setFocusedDate(i)):!a&&typeof m=="function"&&m(i)},f=n=>{const a=e.focusedDate.set({year:n});e.setFocusedDate(a)};return r.jsxs("div",{className:`iru-w-[296px] ${$.configCalendar.variants[V]}`,children:[!D&&r.jsxs("div",{className:o.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"||u.isValidElement(l)?u.isValidElement(l)?l:l():r.jsx(y.ChevronDownIcon,{className:"iru-rotate-90"})}),r.jsx("div",{className:`${o.default["header-button-calendar"]} ${t.includes("year")?"":o.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"||u.isValidElement(s)?u.isValidElement(s)?s:s():r.jsx(y.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),r.jsx("div",{className:o.default["month-calendar"],children:[...Array(b).keys()].map(n=>{const a=e.focusedDate.set({month:n+1}),i=j.format(a.toDate(e.timeZone)),C=e.value?.year||e.value?.start?.year||x,q=e?.minValue?a.month<e?.minValue?.month&&a.year<=e.minValue.year:!1,v=e?.maxValue?a.month>e.maxValue.month&&a.year>=e.maxValue.year:!1,d=q||v;return r.jsx("div",{onClick:()=>{d||g(a.month,t.includes("date"))},className:`${o.default["cell-month"]} ${e.focusedDate.month===a.month&&!d&&a.year===C?o.default.selected:""} ${e.focusedDate.month!==a.month&&!d?"hover:iru-bg-laba-blue-01":""} ${d?"iru-text-gray-400":"iru-cursor-pointer"}`,children:i},n)})})]})};exports.default=M;
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useDateFormatter as
|
|
3
|
-
import
|
|
2
|
+
import { useDateFormatter as v } from "react-aria";
|
|
3
|
+
import n from "./style.module.scss.mjs";
|
|
4
4
|
import y from "./CalendarButton.mjs";
|
|
5
|
-
import { isValidElement as
|
|
5
|
+
import { isValidElement as d } from "react";
|
|
6
6
|
import { ChevronDownIcon as D } from "./CalendarYear.mjs";
|
|
7
|
-
|
|
7
|
+
import { configCalendar as F } from "./Calendar.config.mjs";
|
|
8
|
+
const A = ({
|
|
8
9
|
prevIcon: l,
|
|
9
10
|
nextIcon: i,
|
|
10
11
|
state: e,
|
|
11
12
|
setActiveTypeCalendar: u,
|
|
12
13
|
onChangeMonth: t,
|
|
13
14
|
type: c,
|
|
14
|
-
hiddenHeader: V
|
|
15
|
+
hiddenHeader: V,
|
|
16
|
+
variants: b = "laba-blue-10"
|
|
15
17
|
}) => {
|
|
16
|
-
const
|
|
18
|
+
const p = (/* @__PURE__ */ new Date()).getFullYear(), N = e.focusedDate.calendar.getMonthsInYear(e.focusedDate), $ = v({
|
|
17
19
|
month: "short",
|
|
18
20
|
timeZone: e.timeZone
|
|
19
|
-
}),
|
|
20
|
-
const s = e.focusedDate.set({ month:
|
|
21
|
+
}), g = (r, a) => {
|
|
22
|
+
const s = e.focusedDate.set({ month: r });
|
|
21
23
|
a ? (u("date"), e.setFocusedDate(s)) : !a && typeof t == "function" && t(s);
|
|
22
|
-
}, f = (
|
|
23
|
-
const a = e.focusedDate.set({ year:
|
|
24
|
+
}, f = (r) => {
|
|
25
|
+
const a = e.focusedDate.set({ year: r });
|
|
24
26
|
e.setFocusedDate(a);
|
|
25
27
|
};
|
|
26
|
-
return /* @__PURE__ */ h("div", { className: `iru-w-[296px] ${
|
|
27
|
-
!V && /* @__PURE__ */ h("div", { className:
|
|
28
|
+
return /* @__PURE__ */ h("div", { className: `iru-w-[296px] ${F.variants[b]}`, children: [
|
|
29
|
+
!V && /* @__PURE__ */ h("div", { className: n["header-calendar"], children: [
|
|
28
30
|
/* @__PURE__ */ o(
|
|
29
31
|
y,
|
|
30
32
|
{
|
|
31
33
|
isDisabled: e?.minValue ? e.focusedDate.year <= e.minValue.year : !1,
|
|
32
34
|
onPress: () => f(e.focusedDate.year - 1),
|
|
33
|
-
children: typeof l == "function" ||
|
|
35
|
+
children: typeof l == "function" || d(l) ? d(l) ? l : l() : /* @__PURE__ */ o(D, { className: "iru-rotate-90" })
|
|
34
36
|
}
|
|
35
37
|
),
|
|
36
38
|
/* @__PURE__ */ o(
|
|
37
39
|
"div",
|
|
38
40
|
{
|
|
39
|
-
className: `${
|
|
41
|
+
className: `${n["header-button-calendar"]} ${c.includes("year") ? "" : n.disabled}`,
|
|
40
42
|
onClick: () => {
|
|
41
43
|
c.includes("year") && u("year");
|
|
42
44
|
},
|
|
@@ -48,26 +50,26 @@ const w = ({
|
|
|
48
50
|
{
|
|
49
51
|
isDisabled: e?.maxValue ? e.focusedDate.year >= e.maxValue.year : !1,
|
|
50
52
|
onPress: () => f(e.focusedDate.year + 1),
|
|
51
|
-
children: typeof i == "function" ||
|
|
53
|
+
children: typeof i == "function" || d(i) ? d(i) ? i : i() : /* @__PURE__ */ o(D, { className: "-iru-rotate-90" })
|
|
52
54
|
}
|
|
53
55
|
)
|
|
54
56
|
] }),
|
|
55
|
-
/* @__PURE__ */ o("div", { className:
|
|
56
|
-
const a = e.focusedDate.set({ month:
|
|
57
|
+
/* @__PURE__ */ o("div", { className: n["month-calendar"], children: [...Array(N).keys()].map((r) => {
|
|
58
|
+
const a = e.focusedDate.set({ month: r + 1 }), s = $.format(a.toDate(e.timeZone)), x = e.value?.year || e.value?.start?.year || p, C = e?.minValue ? a.month < e?.minValue?.month && a.year <= e.minValue.year : !1, Y = e?.maxValue ? a.month > e.maxValue.month && a.year >= e.maxValue.year : !1, m = C || Y;
|
|
57
59
|
return /* @__PURE__ */ o(
|
|
58
60
|
"div",
|
|
59
61
|
{
|
|
60
62
|
onClick: () => {
|
|
61
|
-
|
|
63
|
+
m || g(a.month, c.includes("date"));
|
|
62
64
|
},
|
|
63
|
-
className: `${
|
|
65
|
+
className: `${n["cell-month"]} ${e.focusedDate.month === a.month && !m && a.year === x ? n.selected : ""} ${e.focusedDate.month !== a.month && !m ? "hover:iru-bg-laba-blue-01" : ""} ${m ? "iru-text-gray-400" : "iru-cursor-pointer"}`,
|
|
64
66
|
children: s
|
|
65
67
|
},
|
|
66
|
-
|
|
68
|
+
r
|
|
67
69
|
);
|
|
68
70
|
}) })
|
|
69
71
|
] });
|
|
70
72
|
};
|
|
71
73
|
export {
|
|
72
|
-
|
|
74
|
+
A as default
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),r=require("react"),C=require("@internationalized/date"),j=require("react-aria"),I=require("react-stately"),y=require("./CalendarButton.cjs"),o=require("./style.module.scss.cjs"),V=require("./CalendarCell.cjs"),D=require("../Button/Button.cjs"),M=require("./CalendarMonth.cjs"),f=require("./CalendarYear.cjs"),s=require("./Calendar.cjs"),g=require("./Calendar.config.cjs"),_=({variants:d="laba-blue-10",locale:a="id-ID",...e})=>{const c=r.useRef(null),n=I.useRangeCalendarState({...e,locale:a,createCalendar:C.createCalendar}),{calendarProps:S,prevButtonProps:T,nextButtonProps:q,title:v}=j.useRangeCalendar(e,n,c),{gridProps:N,headerProps:k,weekDays:P}=j.useCalendarGrid({},n),w=C.getWeeksInMonth(n.visibleRange.start,a),[h,x]=r.useState("date"),[u,b]=r.useState({start:void 0,end:void 0}),E=u.start?.hour?.toString()&&u?.start?.minut?.toString()&&e.value?.start?.toDate(C.getLocalTimeZone()).setHours(u.start?.hour,u.start?.minut)||e.minDate,B=e.maxDate,R=(i,l)=>{const m={...u,[l]:i};b(m),typeof e?.handlerChangeTimeRange=="function"&&e.handlerChangeTimeRange(m)};return r.useEffect(()=>{if(e.time?.start&&e.time?.end){const i=e.time.start,l=e.time.end;b({start:i,end:l})}},[JSON.stringify(e.time)]),t.jsxs("div",{className:"iru-text-laba-base-sr",children:[h==="date"&&t.jsx(t.Fragment,{children:t.jsx("div",{...S,ref:c,children:t.jsxs("div",{className:g.configCalendar.variants[d],children:[t.jsxs("div",{className:"iru-flex iru-gap-2",children:[t.jsxs("div",{children:[t.jsxs("div",{className:o.default["header-calendar"],children:[t.jsx(y.default,{...T,children:typeof e?.prevIcon=="function"||r.isValidElement(e?.prevIcon)?r.isValidElement(e.prevIcon)?e.prevIcon:e.prevIcon():t.jsx(f.ChevronDownIcon,{className:"iru-rotate-90"})}),t.jsx("div",{className:o.default["header-button-calendar"],onClick:()=>x("month"),children:v}),t.jsx(y.default,{...q,children:typeof e?.nextIcon=="function"||r.isValidElement(e?.nextIcon)?r.isValidElement(e.nextIcon)?e.nextIcon:e.nextIcon():t.jsx(f.ChevronDownIcon,{className:"-iru-rotate-90"})})]}),t.jsxs("table",{...N,cellPadding:"0",className:"flex-1",children:[t.jsx("thead",{...k,className:"text-gray-600",children:t.jsx("tr",{children:P.map((i,l)=>t.jsx("th",{className:o.default["days-calendar"],children:s.getDaysCalendar(l,a)},l))})}),t.jsx("tbody",{children:[...new Array(w).keys()].map(i=>t.jsx("tr",{children:n.getDatesInWeek(i).map((l,m)=>l?t.jsx(V.default,{state:n,date:l},m):t.jsx("td",{},m))},i))})]})]}),e?.isCustomTime&&t.jsxs("div",{className:"iru-flex",children:[t.jsx(s.CustomTimeCalendar,{minDate:e.minDate,maxDate:e.maxDate,time:e.time?.start,value:e.value?.start,timeLabel:s.translateCalendar[a].Start,type:"start",handlerChangeTime:i=>R(i,"start")}),t.jsx(s.CustomTimeCalendar,{minDate:E,maxDate:B,time:e.time?.end,value:e.value?.end,timeLabel:s.translateCalendar[a].End,type:"end",handlerChangeTime:i=>R(i,"end")})]})]}),e.withConfirm&&t.jsxs("div",{className:o.default["footer-calendar"],children:[typeof e?.buttonReset=="function"?t.jsx("div",{onClick:()=>e.handlerReset(n),children:e.buttonReset()}):t.jsx(D.default,{variants:g.configCalendar.resetButtonVariant[d],size:"small",onClick:()=>e.handlerReset(n),children:s.translateCalendar[a].Reset}),typeof e?.buttonSubmit=="function"?t.jsx("div",{onClick:e.handlerSubmit,children:e.buttonSubmit()}):t.jsx(D.default,{variants:g.configCalendar.submitButtonVariant[d],size:"small",onClick:e.handlerSubmit,children:s.translateCalendar[a].Apply})]})]})})}),h==="month"&&t.jsx(M.default,{state:n,setActiveTypeCalendar:x,type:["date","month","year"],variants:d}),h==="year"&&t.jsx(f.default,{state:n,setActiveTypeCalendar:x,title:v,type:["date","month","year"],variants:d})]})},A=({variants:d,...a})=>{const e=I.useDateRangePickerState(a),c=r.useRef(null),{calendarProps:n}=j.useDateRangePicker(a,e,c);return t.jsx("div",{ref:c,children:t.jsx(_,{handlerReset:a.handlerReset,handlerSubmit:a.handlerSubmit,withConfirm:a.withConfirm,prevIcon:a.prevIcon,nextIcon:a.nextIcon,buttonReset:a.buttonReset,buttonSubmit:a.buttonSubmit,isCustomTime:a.isCustomTime,time:a.time,minDate:a.minDate,maxDate:a.maxDate,handlerChangeTimeRange:a.handlerChangeTimeRange,variants:d,locale:a.locale,...n})})};exports.default=A;
|