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,52 +1,104 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { formatDate as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { jsxs as w, Fragment as N, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import d, { isValidElement as te } from "react";
|
|
3
|
+
import ae from "./DateRangePicker.mjs";
|
|
4
|
+
import se from "../Popover/Popover.mjs";
|
|
5
|
+
import f from "../Calendar/style.module.scss.mjs";
|
|
6
|
+
import { formatDate as g } from "../../utils/common.mjs";
|
|
7
|
+
import ne from "../Button/Button.mjs";
|
|
8
|
+
import { configCalendar as V } from "../Calendar/Calendar.config.mjs";
|
|
9
|
+
const n = {
|
|
10
|
+
"en-US": {
|
|
11
|
+
Today: "Today",
|
|
12
|
+
"This week": "This week",
|
|
13
|
+
"This month": "This month",
|
|
14
|
+
"This year": "This year",
|
|
15
|
+
Yesterday: "Yesterday",
|
|
16
|
+
"Last week": "Last week",
|
|
17
|
+
"Last month": "Last month",
|
|
18
|
+
"Last year": "Last year",
|
|
19
|
+
Custom: "Custom",
|
|
20
|
+
Reset: "Reset"
|
|
21
|
+
},
|
|
22
|
+
"id-ID": {
|
|
23
|
+
Today: "Hari ini",
|
|
24
|
+
"This week": "Minggu ini",
|
|
25
|
+
"This month": "Bulan ini",
|
|
26
|
+
"This year": "Tahun ini",
|
|
27
|
+
Yesterday: "Kemarin",
|
|
28
|
+
"Last week": "Minggu lalu",
|
|
29
|
+
"Last month": "Bulan lalu",
|
|
30
|
+
"Last year": "Tahun lalu",
|
|
31
|
+
Custom: "Kustom",
|
|
32
|
+
Reset: "Reset"
|
|
33
|
+
},
|
|
34
|
+
"zh-CN": {
|
|
35
|
+
Today: "今天",
|
|
36
|
+
"This week": "本周",
|
|
37
|
+
"This month": "本月",
|
|
38
|
+
"This year": "今年",
|
|
39
|
+
Yesterday: "昨天",
|
|
40
|
+
"Last week": "上周",
|
|
41
|
+
"Last month": "上个月",
|
|
42
|
+
"Last year": "去年",
|
|
43
|
+
Custom: "自定义",
|
|
44
|
+
Reset: "重置"
|
|
45
|
+
},
|
|
46
|
+
"nl-NL": {
|
|
47
|
+
Today: "Vandaag",
|
|
48
|
+
"This week": "Deze week",
|
|
49
|
+
"This month": "Deze maand",
|
|
50
|
+
"This year": "Dit jaar",
|
|
51
|
+
Yesterday: "Gisteren",
|
|
52
|
+
"Last week": "Vorige week",
|
|
53
|
+
"Last month": "Vorige maand",
|
|
54
|
+
"Last year": "Vorig jaar",
|
|
55
|
+
Custom: "Aangepast",
|
|
56
|
+
Reset: "Reset"
|
|
57
|
+
}
|
|
58
|
+
}, me = ({
|
|
59
|
+
value: o,
|
|
60
|
+
prevIcon: H,
|
|
61
|
+
nextIcon: j,
|
|
62
|
+
buttonReset: T,
|
|
63
|
+
buttonSubmit: x,
|
|
64
|
+
className: W,
|
|
65
|
+
classNameButton: z,
|
|
66
|
+
buttonClick: c,
|
|
67
|
+
buttonList: p,
|
|
68
|
+
typePicker: B = "RANGE",
|
|
69
|
+
onChange: R,
|
|
70
|
+
idPopover: E = "filter-date-popover",
|
|
71
|
+
id: P = "filter-date",
|
|
72
|
+
floatingOptions: $ = {},
|
|
73
|
+
offsetPopover: I = 5,
|
|
74
|
+
zIndexPopper: K = 0,
|
|
75
|
+
defaultValueLabel: h,
|
|
76
|
+
isCustomTime: O = !1,
|
|
77
|
+
mountedExecuteChange: A = !0,
|
|
78
|
+
formatingDate: y,
|
|
79
|
+
variants: Y = "laba-blue-10",
|
|
80
|
+
locale: s = "id-ID"
|
|
29
81
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
{ key: "thisDay", value:
|
|
32
|
-
{ key: "thisWeek", value: "
|
|
33
|
-
{ key: "thisMonth", value: "
|
|
34
|
-
{ key: "thisYear", value: "
|
|
35
|
-
{ key: "yesterday", value:
|
|
36
|
-
{ key: "lastWeek", value: "
|
|
37
|
-
{ key: "lastMonth", value: "
|
|
38
|
-
{ key: "lastYear", value: "
|
|
39
|
-
{ key: "custom", value:
|
|
40
|
-
], S =
|
|
82
|
+
const L = [
|
|
83
|
+
{ key: "thisDay", value: n[s].Today },
|
|
84
|
+
{ key: "thisWeek", value: n[s]["This week"] },
|
|
85
|
+
{ key: "thisMonth", value: n[s]["This month"] },
|
|
86
|
+
{ key: "thisYear", value: n[s]["This year"] },
|
|
87
|
+
{ key: "yesterday", value: n[s].Yesterday },
|
|
88
|
+
{ key: "lastWeek", value: n[s]["Last week"] },
|
|
89
|
+
{ key: "lastMonth", value: n[s]["Last month"] },
|
|
90
|
+
{ key: "lastYear", value: n[s]["Last year"] },
|
|
91
|
+
{ key: "custom", value: n[s].Custom }
|
|
92
|
+
], S = d.useRef(null), [M, b] = d.useState(), [G, i] = d.useState(), [C, F] = d.useState(), m = (e, t) => {
|
|
41
93
|
const a = new Date(e ?? /* @__PURE__ */ new Date());
|
|
42
94
|
return t === "start" ? new Date(a.setHours(0, 0, 0)) : new Date(a.setHours(23, 59, 59));
|
|
43
|
-
},
|
|
95
|
+
}, J = () => {
|
|
44
96
|
const e = /* @__PURE__ */ new Date();
|
|
45
97
|
return {
|
|
46
98
|
startDate: e,
|
|
47
99
|
endDate: e
|
|
48
100
|
};
|
|
49
|
-
},
|
|
101
|
+
}, U = () => {
|
|
50
102
|
const e = /* @__PURE__ */ new Date();
|
|
51
103
|
e.setDate(e.getDate() - e.getDay());
|
|
52
104
|
const t = /* @__PURE__ */ new Date();
|
|
@@ -54,25 +106,25 @@ const le = ({
|
|
|
54
106
|
startDate: e,
|
|
55
107
|
endDate: t
|
|
56
108
|
};
|
|
57
|
-
},
|
|
109
|
+
}, q = () => {
|
|
58
110
|
const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth(), 1), a = new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
59
111
|
return {
|
|
60
112
|
startDate: t,
|
|
61
113
|
endDate: a
|
|
62
114
|
};
|
|
63
|
-
},
|
|
115
|
+
}, Q = () => {
|
|
64
116
|
const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear(), 11, 31);
|
|
65
117
|
return {
|
|
66
118
|
startDate: e,
|
|
67
119
|
endDate: t
|
|
68
120
|
};
|
|
69
|
-
},
|
|
121
|
+
}, X = () => {
|
|
70
122
|
const e = new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1));
|
|
71
123
|
return {
|
|
72
124
|
startDate: e,
|
|
73
125
|
endDate: e
|
|
74
126
|
};
|
|
75
|
-
},
|
|
127
|
+
}, Z = () => {
|
|
76
128
|
const e = /* @__PURE__ */ new Date();
|
|
77
129
|
e.setDate(e.getDate() - (7 + e.getDay()));
|
|
78
130
|
const t = /* @__PURE__ */ new Date();
|
|
@@ -80,158 +132,160 @@ const le = ({
|
|
|
80
132
|
startDate: e,
|
|
81
133
|
endDate: t
|
|
82
134
|
};
|
|
83
|
-
},
|
|
135
|
+
}, _ = () => {
|
|
84
136
|
const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth() - 1, 1), a = new Date(e.getFullYear(), e.getMonth(), 0);
|
|
85
137
|
return {
|
|
86
138
|
startDate: t,
|
|
87
139
|
endDate: a
|
|
88
140
|
};
|
|
89
|
-
},
|
|
141
|
+
}, ee = () => {
|
|
90
142
|
const e = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 11, 31);
|
|
91
143
|
return {
|
|
92
144
|
startDate: e,
|
|
93
145
|
endDate: t
|
|
94
146
|
};
|
|
95
147
|
}, u = (e, t, a) => {
|
|
96
|
-
if (F(e), typeof
|
|
97
|
-
let
|
|
98
|
-
|
|
99
|
-
startDate:
|
|
100
|
-
endDate:
|
|
101
|
-
} : typeof
|
|
102
|
-
startDate:
|
|
103
|
-
endDate:
|
|
104
|
-
}), S.current?.setShow(!1),
|
|
148
|
+
if (F(e), typeof R == "function") {
|
|
149
|
+
let D = e;
|
|
150
|
+
y === "string" && e ? D = {
|
|
151
|
+
startDate: g(e.startDate, y),
|
|
152
|
+
endDate: g(e.endDate, y)
|
|
153
|
+
} : typeof y == "boolean" && e && (D = {
|
|
154
|
+
startDate: g(e.startDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),
|
|
155
|
+
endDate: g(e.endDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
156
|
+
}), S.current?.setShow(!1), R(D, t ?? "", a);
|
|
105
157
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
158
|
+
}, l = (e, t) => {
|
|
159
|
+
b(e);
|
|
108
160
|
let a;
|
|
109
161
|
if (e?.key !== "custom") {
|
|
110
|
-
switch (
|
|
162
|
+
switch (i(e), e?.key) {
|
|
111
163
|
case "thisDay":
|
|
112
|
-
a =
|
|
164
|
+
a = J();
|
|
113
165
|
break;
|
|
114
166
|
case "thisWeek":
|
|
115
|
-
a =
|
|
167
|
+
a = U();
|
|
116
168
|
break;
|
|
117
169
|
case "thisMonth":
|
|
118
|
-
a =
|
|
170
|
+
a = q();
|
|
119
171
|
break;
|
|
120
172
|
case "thisYear":
|
|
121
|
-
a =
|
|
173
|
+
a = Q();
|
|
122
174
|
break;
|
|
123
175
|
case "yesterday":
|
|
124
|
-
a =
|
|
176
|
+
a = X();
|
|
125
177
|
break;
|
|
126
178
|
case "lastWeek":
|
|
127
|
-
a =
|
|
179
|
+
a = Z();
|
|
128
180
|
break;
|
|
129
181
|
case "lastMonth":
|
|
130
|
-
a =
|
|
182
|
+
a = _();
|
|
131
183
|
break;
|
|
132
184
|
case "lastYear":
|
|
133
|
-
a =
|
|
185
|
+
a = ee();
|
|
134
186
|
break;
|
|
135
187
|
}
|
|
136
188
|
a && t && u(
|
|
137
|
-
{ startDate:
|
|
189
|
+
{ startDate: m(a.startDate, "start"), endDate: m(a.endDate, "end") },
|
|
138
190
|
e?.value,
|
|
139
191
|
e
|
|
140
192
|
);
|
|
141
193
|
}
|
|
142
|
-
},
|
|
143
|
-
const a = (
|
|
144
|
-
!e && !a ? (t && u(),
|
|
194
|
+
}, k = (e, t) => {
|
|
195
|
+
const a = (p ?? L).find((D) => D.key === e);
|
|
196
|
+
!e && !a ? (t && u(), l(void 0, t), i(void 0)) : typeof e == "object" ? (t && u(
|
|
145
197
|
{
|
|
146
|
-
startDate:
|
|
147
|
-
endDate:
|
|
198
|
+
startDate: m(e.startDate, "start"),
|
|
199
|
+
endDate: m(e.endDate, "end")
|
|
148
200
|
},
|
|
149
201
|
"Kustom",
|
|
150
|
-
{ key: "custom", value:
|
|
151
|
-
),
|
|
152
|
-
},
|
|
153
|
-
if (
|
|
154
|
-
F(
|
|
155
|
-
const e = (
|
|
156
|
-
(t) => t.key ===
|
|
202
|
+
{ key: "custom", value: n[s].Custom }
|
|
203
|
+
), l({ key: "custom", value: n[s].Custom }, t), i({ key: "custom", value: n[s].Custom })) : (l(a, t), i(a));
|
|
204
|
+
}, v = () => {
|
|
205
|
+
if (o) {
|
|
206
|
+
F(o);
|
|
207
|
+
const e = (p ?? L)?.find(
|
|
208
|
+
(t) => t.key === o.label || t.value === o.label
|
|
157
209
|
);
|
|
158
|
-
Object.keys(e || {}).length > 0 &&
|
|
210
|
+
Object.keys(e || {}).length > 0 && b(e);
|
|
159
211
|
} else
|
|
160
|
-
|
|
212
|
+
b(void 0), i(void 0);
|
|
161
213
|
};
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
}, [JSON.stringify(
|
|
165
|
-
|
|
166
|
-
}, []), /* @__PURE__ */
|
|
167
|
-
/* @__PURE__ */
|
|
214
|
+
return d.useEffect(() => {
|
|
215
|
+
v();
|
|
216
|
+
}, [JSON.stringify(o)]), d.useEffect(() => {
|
|
217
|
+
k(h ?? o, A);
|
|
218
|
+
}, []), /* @__PURE__ */ w(N, { children: [
|
|
219
|
+
/* @__PURE__ */ w(
|
|
168
220
|
"div",
|
|
169
221
|
{
|
|
170
222
|
onClick: (e) => {
|
|
171
|
-
S.current?.handlerShow(e),
|
|
223
|
+
S.current?.handlerShow(e), v();
|
|
172
224
|
},
|
|
173
|
-
className:
|
|
174
|
-
id:
|
|
225
|
+
className: z,
|
|
226
|
+
id: P,
|
|
175
227
|
children: [
|
|
176
|
-
|
|
177
|
-
typeof
|
|
228
|
+
te(c) && c,
|
|
229
|
+
typeof c == "function" ? c(C, G) : "Pilih Filter"
|
|
178
230
|
]
|
|
179
231
|
}
|
|
180
232
|
),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
233
|
+
/* @__PURE__ */ r(
|
|
234
|
+
se,
|
|
183
235
|
{
|
|
184
|
-
zIndex:
|
|
236
|
+
zIndex: K,
|
|
185
237
|
ref: S,
|
|
186
|
-
offset:
|
|
187
|
-
id:
|
|
188
|
-
floatingOptions: { placement: "bottom-end",
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
(
|
|
238
|
+
offset: I,
|
|
239
|
+
id: E,
|
|
240
|
+
floatingOptions: { placement: "bottom-end", ...$ },
|
|
241
|
+
children: /* @__PURE__ */ w("div", { className: `${V.selectedVariants[Y]} ${W}`, children: [
|
|
242
|
+
/* @__PURE__ */ w("div", { children: [
|
|
243
|
+
(p ?? L).map((e, t) => /* @__PURE__ */ r(
|
|
192
244
|
"div",
|
|
193
245
|
{
|
|
194
|
-
className: `${
|
|
195
|
-
onClick: () =>
|
|
246
|
+
className: `${f["button-filter-date"]} hover:iru-bg-laba-blue-01 ${M?.key === e.key ? f.selected : ""}`,
|
|
247
|
+
onClick: () => l(e, !0),
|
|
196
248
|
children: e.value
|
|
197
249
|
},
|
|
198
250
|
t
|
|
199
251
|
)),
|
|
200
|
-
|
|
252
|
+
M?.key !== "custom" && /* @__PURE__ */ r(N, { children: typeof T == "function" ? /* @__PURE__ */ r(
|
|
201
253
|
"div",
|
|
202
254
|
{
|
|
203
|
-
className:
|
|
204
|
-
onClick: () =>
|
|
205
|
-
children:
|
|
255
|
+
className: f["button-filter-date-custome"],
|
|
256
|
+
onClick: () => k(h, !0),
|
|
257
|
+
children: T()
|
|
206
258
|
}
|
|
207
|
-
) : /* @__PURE__ */
|
|
208
|
-
|
|
259
|
+
) : /* @__PURE__ */ r(
|
|
260
|
+
ne,
|
|
209
261
|
{
|
|
210
|
-
className:
|
|
211
|
-
variants:
|
|
262
|
+
className: f["button-reset-filter-date"],
|
|
263
|
+
variants: V.resetButtonVariant[Y],
|
|
212
264
|
size: "small",
|
|
213
|
-
onClick: () =>
|
|
214
|
-
children:
|
|
265
|
+
onClick: () => k(h, !0),
|
|
266
|
+
children: n[s].Reset
|
|
215
267
|
}
|
|
216
268
|
) })
|
|
217
269
|
] }),
|
|
218
|
-
|
|
219
|
-
|
|
270
|
+
M?.key === "custom" && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
271
|
+
ae,
|
|
220
272
|
{
|
|
221
|
-
defaultValue:
|
|
222
|
-
value:
|
|
223
|
-
prevIcon:
|
|
224
|
-
nextIcon:
|
|
225
|
-
buttonReset:
|
|
226
|
-
buttonSubmit:
|
|
227
|
-
isCustomTime:
|
|
273
|
+
defaultValue: C,
|
|
274
|
+
value: C,
|
|
275
|
+
prevIcon: H,
|
|
276
|
+
nextIcon: j,
|
|
277
|
+
buttonReset: T,
|
|
278
|
+
buttonSubmit: x,
|
|
279
|
+
isCustomTime: O,
|
|
280
|
+
variants: Y,
|
|
228
281
|
onChange: (e) => {
|
|
229
|
-
u(e,
|
|
282
|
+
u(e, n[s].Custom, { key: "custom", value: n[s].Custom }), i({ key: "custom", value: n[s].Custom });
|
|
230
283
|
},
|
|
231
284
|
onReset: () => {
|
|
232
|
-
|
|
285
|
+
k(h, !0);
|
|
233
286
|
},
|
|
234
|
-
typePicker:
|
|
287
|
+
typePicker: B,
|
|
288
|
+
locale: s,
|
|
235
289
|
withConfirm: !0
|
|
236
290
|
}
|
|
237
291
|
) })
|
|
@@ -241,5 +295,5 @@ const le = ({
|
|
|
241
295
|
] });
|
|
242
296
|
};
|
|
243
297
|
export {
|
|
244
|
-
|
|
298
|
+
me as default
|
|
245
299
|
};
|
|
@@ -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 r=require("react/jsx-runtime"),w=require("react"),C=require("react-aria"),p=require("@internationalized/date"),D=require("../Popover/Popover.cjs"),T=require("../Calendar/Calendar.cjs"),c=(n,s)=>{let a;if(n){const o=new Intl.DateTimeFormat(s,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(n)),d=o.find(e=>e.type==="year")?.value,l=o.find(e=>e.type==="month")?.value,u=o.find(e=>e.type==="day")?.value;return a=p.parseDate(`${d}-${l}-${u}`),a}},k=({month:n,year:s,type:a=["month","year"],activeType:h="month",minDate:o,maxDate:d,className:l,classNameButton:u,onChange:e,buttonClick:m,id:g="date-picker",idPopover:v="date-picker-popover",floatingOptions:y={},offsetPopover:P=5,zIndexPopper:j=1,hiddenHeader:x,variants:$="laba-blue-10",locale:i="id-ID"})=>{const f=w.useRef(null),q=c(o,i),S=c(d,i),b=t=>{typeof e=="function"&&(e({month:t.month,year:t.year}),f.current?.setShow(!1))};return r.jsxs(r.Fragment,{children:[r.jsx("div",{id:g,onClick:t=>{t.stopPropagation(),f.current?.handlerShow(t)},className:u,children:typeof m=="function"?m({month:n,year:s}):"Pilih Tanggal"}),r.jsx("div",{className:l??"",children:r.jsx(D.default,{zIndex:j,ref:f,offset:P,id:v,floatingOptions:{placement:"bottom-end",...y},onClick:t=>t.stopPropagation(),children:r.jsx(C.I18nProvider,{locale:i,children:r.jsx(T.default,{minValue:q,maxValue:S,minDate:o,maxDate:d,activeType:a.length===1?a[0]:h,locale:i,value:c(`${s}/${n}/1`,i),createCalendar:p.createCalendar,defaultValue:c(`${s}/${n}/1`,i),onChange:b,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:a,hiddenHeader:x,variants:$})})})})]})};exports.default=k;
|
|
@@ -1,75 +1,84 @@
|
|
|
1
|
-
import { jsxs as C, Fragment as I, jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { createCalendar as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as C, Fragment as I, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import S from "react";
|
|
3
|
+
import { I18nProvider as T } from "react-aria";
|
|
4
|
+
import { createCalendar as b, parseDate as R } from "@internationalized/date";
|
|
5
|
+
import V from "../Popover/Popover.mjs";
|
|
6
|
+
import j from "../Calendar/Calendar.mjs";
|
|
7
|
+
const m = (r, i) => {
|
|
8
8
|
let o;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
if (r) {
|
|
10
|
+
const n = new Intl.DateTimeFormat(i, {
|
|
11
|
+
year: "numeric",
|
|
12
|
+
month: "2-digit",
|
|
13
|
+
day: "2-digit"
|
|
14
|
+
}).formatToParts(new Date(r)), s = n.find((e) => e.type === "year")?.value, f = n.find((e) => e.type === "month")?.value, c = n.find((e) => e.type === "day")?.value;
|
|
15
|
+
return o = R(`${s}-${f}-${c}`), o;
|
|
16
|
+
}
|
|
17
|
+
}, q = ({
|
|
18
|
+
month: r,
|
|
19
|
+
year: i,
|
|
20
|
+
type: o = ["month", "year"],
|
|
21
|
+
activeType: p = "month",
|
|
22
|
+
minDate: n,
|
|
23
|
+
maxDate: s,
|
|
24
|
+
className: f,
|
|
25
|
+
classNameButton: c,
|
|
26
|
+
onChange: e,
|
|
27
|
+
buttonClick: h,
|
|
28
|
+
id: u = "date-picker",
|
|
29
|
+
idPopover: y = "date-picker-popover",
|
|
24
30
|
floatingOptions: g = {},
|
|
25
31
|
offsetPopover: v = 5,
|
|
26
32
|
zIndexPopper: P = 1,
|
|
27
|
-
hiddenHeader:
|
|
33
|
+
hiddenHeader: $,
|
|
34
|
+
variants: w = "laba-blue-10",
|
|
35
|
+
locale: a = "id-ID"
|
|
28
36
|
}) => {
|
|
29
|
-
const
|
|
30
|
-
typeof
|
|
37
|
+
const l = S.useRef(null), D = m(n, a), k = m(s, a), x = (t) => {
|
|
38
|
+
typeof e == "function" && (e({ month: t.month, year: t.year }), l.current?.setShow(!1));
|
|
31
39
|
};
|
|
32
40
|
return /* @__PURE__ */ C(I, { children: [
|
|
33
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ d(
|
|
34
42
|
"div",
|
|
35
43
|
{
|
|
36
|
-
id:
|
|
37
|
-
onClick: (
|
|
38
|
-
|
|
44
|
+
id: u,
|
|
45
|
+
onClick: (t) => {
|
|
46
|
+
t.stopPropagation(), l.current?.handlerShow(t);
|
|
39
47
|
},
|
|
40
|
-
className:
|
|
41
|
-
children: typeof
|
|
48
|
+
className: c,
|
|
49
|
+
children: typeof h == "function" ? h({ month: r, year: i }) : "Pilih Tanggal"
|
|
42
50
|
}
|
|
43
51
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
52
|
+
/* @__PURE__ */ d("div", { className: f ?? "", children: /* @__PURE__ */ d(
|
|
53
|
+
V,
|
|
46
54
|
{
|
|
47
55
|
zIndex: P,
|
|
48
|
-
ref:
|
|
56
|
+
ref: l,
|
|
49
57
|
offset: v,
|
|
50
|
-
id:
|
|
58
|
+
id: y,
|
|
51
59
|
floatingOptions: { placement: "bottom-end", ...g },
|
|
52
|
-
onClick: (
|
|
53
|
-
children: /* @__PURE__ */
|
|
54
|
-
|
|
60
|
+
onClick: (t) => t.stopPropagation(),
|
|
61
|
+
children: /* @__PURE__ */ d(T, { locale: a, children: /* @__PURE__ */ d(
|
|
62
|
+
j,
|
|
55
63
|
{
|
|
56
|
-
minValue:
|
|
64
|
+
minValue: D,
|
|
57
65
|
maxValue: k,
|
|
58
|
-
minDate:
|
|
59
|
-
maxDate:
|
|
60
|
-
activeType:
|
|
61
|
-
locale:
|
|
62
|
-
value:
|
|
63
|
-
createCalendar:
|
|
64
|
-
defaultValue:
|
|
66
|
+
minDate: n,
|
|
67
|
+
maxDate: s,
|
|
68
|
+
activeType: o.length === 1 ? o[0] : p,
|
|
69
|
+
locale: a,
|
|
70
|
+
value: m(`${i}/${r}/1`, a),
|
|
71
|
+
createCalendar: b,
|
|
72
|
+
defaultValue: m(`${i}/${r}/1`, a),
|
|
65
73
|
onChange: x,
|
|
66
74
|
handlerReset: () => {
|
|
67
75
|
},
|
|
68
76
|
handlerSubmit: () => {
|
|
69
77
|
},
|
|
70
78
|
withDateSelect: !1,
|
|
71
|
-
type:
|
|
72
|
-
hiddenHeader:
|
|
79
|
+
type: o,
|
|
80
|
+
hiddenHeader: $,
|
|
81
|
+
variants: w
|
|
73
82
|
}
|
|
74
83
|
) })
|
|
75
84
|
}
|
|
@@ -77,5 +86,5 @@ const n = (t) => {
|
|
|
77
86
|
] });
|
|
78
87
|
};
|
|
79
88
|
export {
|
|
80
|
-
|
|
89
|
+
q as default
|
|
81
90
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
${r.disabled?e.default.disabled:""} ${
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),t=require("react"),e=require("./InputInnerLabel.module.scss.cjs"),o=require("./InputInnerLabel.config.cjs"),u=t.forwardRef((f,b)=>{const{isRequired:m,classNameContainer:p,className:I,classNameLabel:$,classNameLabelError:N,name:d,id:c,label:s,type:h="text",startIcon:l,endIcon:n,error:i,sizeInput:j="large",variant:x="bill-blue-800",...r}=f,v=()=>typeof l=="function"||t.isValidElement(l),L=()=>typeof n=="function"||t.isValidElement(n);return a.jsxs("div",{className:`${o.configInputInnerLabel.size[j]} ${o.configInputInnerLabel.variant[x]}
|
|
2
|
+
${p??""} ${s?"":e.default["hidden-label"]}`,children:[a.jsxs("div",{className:`${e.default["container-input"]}`,children:[a.jsxs("div",{className:e.default["start-icon"],children:[typeof l=="function"&&l(),t.isValidElement(l)&&l]}),a.jsx("input",{id:c??d,className:`${e.default.input} ${i?e.default.error:""}
|
|
3
|
+
${v()?e.default["isset-left-icon"]:""}
|
|
4
|
+
${L()?e.default["isset-right-icon"]:""}
|
|
5
|
+
${I??""}`,ref:b,type:h,...r}),a.jsxs("div",{className:e.default["end-icon"],children:[typeof n=="function"&&n(),t.isValidElement(n)&&n]}),s&&a.jsxs("label",{htmlFor:c??d,className:`${e.default.label} ${r.disabled?e.default.disabled:""} ${$??""}`,children:[s," ",m&&a.jsx("span",{children:"*"})]})]}),i&&a.jsx("label",{className:`${e.default["label-error"]}
|
|
6
|
+
${r.disabled?e.default.disabled:""} ${N??""}`,children:i})]})});u.displayName="InputInnerLabel";exports.default=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./InputInnerLabel.module.scss.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./InputInnerLabel.module.scss.cjs"),l={size:{large:e.default["container-large"],small:e.default["container-small"]},variant:{"bill-blue-800":e.default["bill-blue-800"],"fin-black":e.default["fin-black"]}};exports.configInputInnerLabel=l;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import l from "./InputInnerLabel.module.scss.mjs";
|
|
2
|
+
const a = {
|
|
3
3
|
size: {
|
|
4
|
-
large:
|
|
5
|
-
small:
|
|
4
|
+
large: l["container-large"],
|
|
5
|
+
small: l["container-small"]
|
|
6
|
+
},
|
|
7
|
+
variant: {
|
|
8
|
+
"bill-blue-800": l["bill-blue-800"],
|
|
9
|
+
"fin-black": l["fin-black"]
|
|
6
10
|
}
|
|
7
11
|
};
|
|
8
12
|
export {
|
|
9
|
-
|
|
13
|
+
a as configInputInnerLabel
|
|
10
14
|
};
|