1mpacto-react-ui 2.0.20 → 2.0.22
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/_mixins.scss +72 -72
- package/dist/assets/icons/arrow-narrow-down.svg +3 -3
- package/dist/assets/style.css +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.mjs +40 -40
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
- package/dist/components/Button/Button.cjs +12 -12
- package/dist/components/Button/Button.config.cjs +1 -1
- package/dist/components/Button/Button.config.mjs +3 -1
- package/dist/components/Button/Button.mjs +24 -24
- package/dist/components/Button/style.module.scss.cjs +1 -1
- package/dist/components/Button/style.module.scss.mjs +57 -55
- package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -12
- package/dist/components/ButtonIcon/ButtonIcon.mjs +20 -20
- package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
- package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.mjs +98 -100
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +41 -42
- package/dist/components/Calendar/CalendarRange.cjs +1 -1
- package/dist/components/Calendar/CalendarRange.mjs +59 -61
- package/dist/components/Calendar/CalendarYear.cjs +3 -3
- package/dist/components/Calendar/CalendarYear.mjs +39 -40
- package/dist/components/Chart/DoughnutChart.cjs +1 -1
- package/dist/components/Chart/DoughnutChart.mjs +93 -96
- package/dist/components/Chart/GradientBarChart.cjs +1 -1
- package/dist/components/Chart/GradientBarChart.mjs +80 -81
- package/dist/components/Chart/GradientLineChart.cjs +1 -1
- package/dist/components/Chart/GradientLineChart.mjs +50 -51
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.mjs +23 -23
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.mjs +45 -48
- package/dist/components/Collapse/Collapse.cjs +1 -1
- package/dist/components/Collapse/Collapse.mjs +23 -24
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +86 -89
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +107 -110
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
- package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
- package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
- package/dist/components/Input/InputFloatingInner.cjs +5 -5
- package/dist/components/Input/InputFloatingInner.mjs +24 -25
- package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
- package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
- package/dist/components/Pagination/Pagination.cjs +2 -2
- package/dist/components/Pagination/Pagination.mjs +76 -80
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
- package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
- package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.mjs +65 -68
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.mjs +61 -0
- package/dist/components/Slider/style.module.scss.cjs +1 -0
- package/dist/components/Slider/style.module.scss.mjs +14 -0
- package/dist/components/Step/Step.cjs +5 -5
- package/dist/components/Step/Step.mjs +52 -52
- package/dist/components/Table/Table.cjs +3 -3
- package/dist/components/Table/Table.mjs +275 -298
- package/dist/components/Table/TableSubMobile.cjs +1 -1
- package/dist/components/Table/TableSubMobile.mjs +32 -35
- package/dist/components/Tabs/Tabs.cjs +8 -8
- package/dist/components/Tabs/Tabs.mjs +66 -70
- package/dist/components/Textarea/Textarea.cjs +7 -7
- package/dist/components/Textarea/Textarea.mjs +47 -50
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
- package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
- package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
- package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
- package/dist/components/TimeRange/TimeRange.cjs +1 -1
- package/dist/components/TimeRange/TimeRange.mjs +88 -91
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +44 -46
- package/dist/components/Upload/UploadFile.cjs +1 -1
- package/dist/components/Upload/UploadFile.mjs +50 -54
- package/dist/components/Upload/UploadImage.cjs +12 -12
- package/dist/components/Upload/UploadImage.mjs +73 -79
- package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
- package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
- package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
- package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
- package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
- package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
- package/dist/config/components/tinymce.cjs +2 -2
- package/dist/config/components/tinymce.mjs +3 -3
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.mjs +15 -15
- package/dist/hooks/useDebounce.cjs +1 -1
- package/dist/hooks/useDebounce.mjs +19 -19
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +48 -46
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +129 -128
- package/dist/package.json.mjs +1 -1
- package/dist/src/components/Button/Button.config.d.ts +2 -0
- package/dist/src/components/Slider/Slider.d.ts +3 -0
- package/dist/src/components/Slider/Slider.stories.d.ts +6 -0
- package/dist/src/components/index.d.ts +4 -2
- package/dist/src/interfaces/components/Button/index.d.ts +1 -1
- package/dist/src/interfaces/components/Slider/index.d.ts +51 -0
- package/dist/types-external/table.d.ts +15 -15
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +128 -128
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { formatDate as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
value:
|
|
10
|
-
prevIcon:
|
|
11
|
-
nextIcon:
|
|
12
|
-
buttonReset:
|
|
13
|
-
buttonSubmit:
|
|
14
|
-
className:
|
|
15
|
-
classNameButton:
|
|
16
|
-
buttonClick:
|
|
17
|
-
buttonList:
|
|
18
|
-
typePicker:
|
|
19
|
-
onChange:
|
|
20
|
-
idPopover:
|
|
21
|
-
id:
|
|
22
|
-
floatingOptions:
|
|
23
|
-
offsetPopover:
|
|
24
|
-
zIndexPopper:
|
|
25
|
-
defaultValueLabel:
|
|
26
|
-
isCustomTime:
|
|
27
|
-
mountedExecuteChange:
|
|
28
|
-
formatingDate:
|
|
1
|
+
import { jsxs as m, Fragment as T, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import o, { isValidElement as X } from "react";
|
|
3
|
+
import Z from "./DateRangePicker.mjs";
|
|
4
|
+
import _ from "../Popover/Popover.mjs";
|
|
5
|
+
import h from "../Calendar/style.module.scss.mjs";
|
|
6
|
+
import { formatDate as k } from "../../utils/common.mjs";
|
|
7
|
+
import ee from "../Button/Button.mjs";
|
|
8
|
+
const le = ({
|
|
9
|
+
value: n,
|
|
10
|
+
prevIcon: x,
|
|
11
|
+
nextIcon: H,
|
|
12
|
+
buttonReset: w,
|
|
13
|
+
buttonSubmit: N,
|
|
14
|
+
className: R,
|
|
15
|
+
classNameButton: W,
|
|
16
|
+
buttonClick: l,
|
|
17
|
+
buttonList: g,
|
|
18
|
+
typePicker: j = "RANGE",
|
|
19
|
+
onChange: v,
|
|
20
|
+
idPopover: B = "filter-date-popover",
|
|
21
|
+
id: E = "filter-date",
|
|
22
|
+
floatingOptions: P = {},
|
|
23
|
+
offsetPopover: $ = 5,
|
|
24
|
+
zIndexPopper: O = 0,
|
|
25
|
+
defaultValueLabel: c,
|
|
26
|
+
isCustomTime: z = !1,
|
|
27
|
+
mountedExecuteChange: V = !0,
|
|
28
|
+
formatingDate: D
|
|
29
29
|
}) => {
|
|
30
|
-
const
|
|
30
|
+
const p = [
|
|
31
31
|
{ key: "thisDay", value: "Hari ini" },
|
|
32
32
|
{ key: "thisWeek", value: "Minggu ini" },
|
|
33
33
|
{ key: "thisMonth", value: "Bulan ini" },
|
|
@@ -37,16 +37,16 @@ const De = ({
|
|
|
37
37
|
{ key: "lastMonth", value: "Bulan lalu" },
|
|
38
38
|
{ key: "lastYear", value: "Tahun lalu" },
|
|
39
39
|
{ key: "custom", value: "Kustom" }
|
|
40
|
-
],
|
|
40
|
+
], S = o.useRef(null), [b, M] = o.useState(), [A, r] = o.useState(), [Y, F] = o.useState(), d = (e, t) => {
|
|
41
41
|
const a = new Date(e ?? /* @__PURE__ */ new Date());
|
|
42
42
|
return t === "start" ? new Date(a.setHours(0, 0, 0)) : new Date(a.setHours(23, 59, 59));
|
|
43
|
-
},
|
|
43
|
+
}, G = () => {
|
|
44
44
|
const e = /* @__PURE__ */ new Date();
|
|
45
45
|
return {
|
|
46
46
|
startDate: e,
|
|
47
47
|
endDate: e
|
|
48
48
|
};
|
|
49
|
-
},
|
|
49
|
+
}, I = () => {
|
|
50
50
|
const e = /* @__PURE__ */ new Date();
|
|
51
51
|
e.setDate(e.getDate() - e.getDay());
|
|
52
52
|
const t = /* @__PURE__ */ new Date();
|
|
@@ -54,25 +54,25 @@ const De = ({
|
|
|
54
54
|
startDate: e,
|
|
55
55
|
endDate: t
|
|
56
56
|
};
|
|
57
|
-
},
|
|
57
|
+
}, J = () => {
|
|
58
58
|
const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth(), 1), a = new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
59
59
|
return {
|
|
60
60
|
startDate: t,
|
|
61
61
|
endDate: a
|
|
62
62
|
};
|
|
63
|
-
},
|
|
63
|
+
}, q = () => {
|
|
64
64
|
const e = new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear(), 11, 31);
|
|
65
65
|
return {
|
|
66
66
|
startDate: e,
|
|
67
67
|
endDate: t
|
|
68
68
|
};
|
|
69
|
-
},
|
|
69
|
+
}, C = () => {
|
|
70
70
|
const e = new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1));
|
|
71
71
|
return {
|
|
72
72
|
startDate: e,
|
|
73
73
|
endDate: e
|
|
74
74
|
};
|
|
75
|
-
},
|
|
75
|
+
}, L = () => {
|
|
76
76
|
const e = /* @__PURE__ */ new Date();
|
|
77
77
|
e.setDate(e.getDate() - (7 + e.getDay()));
|
|
78
78
|
const t = /* @__PURE__ */ new Date();
|
|
@@ -80,161 +80,158 @@ const De = ({
|
|
|
80
80
|
startDate: e,
|
|
81
81
|
endDate: t
|
|
82
82
|
};
|
|
83
|
-
},
|
|
83
|
+
}, Q = () => {
|
|
84
84
|
const e = /* @__PURE__ */ new Date(), t = new Date(e.getFullYear(), e.getMonth() - 1, 1), a = new Date(e.getFullYear(), e.getMonth(), 0);
|
|
85
85
|
return {
|
|
86
86
|
startDate: t,
|
|
87
87
|
endDate: a
|
|
88
88
|
};
|
|
89
|
-
},
|
|
89
|
+
}, U = () => {
|
|
90
90
|
const e = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 1), t = new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 11, 31);
|
|
91
91
|
return {
|
|
92
92
|
startDate: e,
|
|
93
93
|
endDate: t
|
|
94
94
|
};
|
|
95
95
|
}, u = (e, t, a) => {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}), (m = b.current) == null || m.setShow(!1), K(F, t ?? "", a);
|
|
96
|
+
if (F(e), typeof v == "function") {
|
|
97
|
+
let i = e;
|
|
98
|
+
D === "string" && e ? i = {
|
|
99
|
+
startDate: k(e.startDate, D),
|
|
100
|
+
endDate: k(e.endDate, D)
|
|
101
|
+
} : typeof D == "boolean" && e && (i = {
|
|
102
|
+
startDate: k(e.startDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),
|
|
103
|
+
endDate: k(e.endDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
104
|
+
}), S.current?.setShow(!1), v(i, t ?? "", a);
|
|
106
105
|
}
|
|
107
106
|
}, y = (e, t) => {
|
|
108
107
|
M(e);
|
|
109
108
|
let a;
|
|
110
|
-
if (
|
|
111
|
-
switch (
|
|
109
|
+
if (e?.key !== "custom") {
|
|
110
|
+
switch (r(e), e?.key) {
|
|
112
111
|
case "thisDay":
|
|
113
|
-
a =
|
|
112
|
+
a = G();
|
|
114
113
|
break;
|
|
115
114
|
case "thisWeek":
|
|
116
|
-
a =
|
|
115
|
+
a = I();
|
|
117
116
|
break;
|
|
118
117
|
case "thisMonth":
|
|
119
|
-
a =
|
|
118
|
+
a = J();
|
|
120
119
|
break;
|
|
121
120
|
case "thisYear":
|
|
122
|
-
a =
|
|
121
|
+
a = q();
|
|
123
122
|
break;
|
|
124
123
|
case "yesterday":
|
|
125
|
-
a =
|
|
124
|
+
a = C();
|
|
126
125
|
break;
|
|
127
126
|
case "lastWeek":
|
|
128
|
-
a =
|
|
127
|
+
a = L();
|
|
129
128
|
break;
|
|
130
129
|
case "lastMonth":
|
|
131
|
-
a =
|
|
130
|
+
a = Q();
|
|
132
131
|
break;
|
|
133
132
|
case "lastYear":
|
|
134
|
-
a =
|
|
133
|
+
a = U();
|
|
135
134
|
break;
|
|
136
135
|
}
|
|
137
136
|
a && t && u(
|
|
138
137
|
{ startDate: d(a.startDate, "start"), endDate: d(a.endDate, "end") },
|
|
139
|
-
e
|
|
138
|
+
e?.value,
|
|
140
139
|
e
|
|
141
140
|
);
|
|
142
141
|
}
|
|
143
142
|
}, f = (e, t) => {
|
|
144
|
-
const a = (
|
|
145
|
-
!e && !a ? (t && u(), y(void 0, t),
|
|
143
|
+
const a = (g ?? p).find((i) => i.key === e);
|
|
144
|
+
!e && !a ? (t && u(), y(void 0, t), r(void 0)) : typeof e == "object" ? (t && u(
|
|
146
145
|
{
|
|
147
146
|
startDate: d(e.startDate, "start"),
|
|
148
147
|
endDate: d(e.endDate, "end")
|
|
149
148
|
},
|
|
150
149
|
"Kustom",
|
|
151
150
|
{ key: "custom", value: "Kustom" }
|
|
152
|
-
), y({ key: "custom", value: "Kustom" }, t),
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
(a) => a.key === r.label || a.value === r.label
|
|
151
|
+
), y({ key: "custom", value: "Kustom" }, t), r({ key: "custom", value: "Kustom" })) : (y(a, t), r(a));
|
|
152
|
+
}, K = () => {
|
|
153
|
+
if (n) {
|
|
154
|
+
F(n);
|
|
155
|
+
const e = (g ?? p)?.find(
|
|
156
|
+
(t) => t.key === n.label || t.value === n.label
|
|
159
157
|
);
|
|
160
|
-
Object.keys(
|
|
158
|
+
Object.keys(e || {}).length > 0 && M(e);
|
|
161
159
|
} else
|
|
162
|
-
M(void 0),
|
|
160
|
+
M(void 0), r(void 0);
|
|
163
161
|
};
|
|
164
|
-
return
|
|
165
|
-
|
|
166
|
-
}, [JSON.stringify(
|
|
167
|
-
f(
|
|
168
|
-
}, []), /* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
162
|
+
return o.useEffect(() => {
|
|
163
|
+
K();
|
|
164
|
+
}, [JSON.stringify(n)]), o.useEffect(() => {
|
|
165
|
+
f(c ?? n, V);
|
|
166
|
+
}, []), /* @__PURE__ */ m(T, { children: [
|
|
167
|
+
/* @__PURE__ */ m(
|
|
170
168
|
"div",
|
|
171
169
|
{
|
|
172
170
|
onClick: (e) => {
|
|
173
|
-
|
|
174
|
-
(t = b.current) == null || t.handlerShow(e), x();
|
|
171
|
+
S.current?.handlerShow(e), K();
|
|
175
172
|
},
|
|
176
|
-
className:
|
|
177
|
-
id:
|
|
173
|
+
className: W,
|
|
174
|
+
id: E,
|
|
178
175
|
children: [
|
|
179
|
-
|
|
180
|
-
typeof
|
|
176
|
+
X(l) && l,
|
|
177
|
+
typeof l == "function" ? l(Y, A) : "Pilih Filter"
|
|
181
178
|
]
|
|
182
179
|
}
|
|
183
180
|
),
|
|
184
181
|
/* @__PURE__ */ s(
|
|
185
|
-
|
|
182
|
+
_,
|
|
186
183
|
{
|
|
187
|
-
zIndex:
|
|
188
|
-
ref:
|
|
189
|
-
offset:
|
|
190
|
-
id:
|
|
191
|
-
floatingOptions: { placement: "bottom-end", ...
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
(
|
|
184
|
+
zIndex: O,
|
|
185
|
+
ref: S,
|
|
186
|
+
offset: $,
|
|
187
|
+
id: B,
|
|
188
|
+
floatingOptions: { placement: "bottom-end", ...P },
|
|
189
|
+
children: /* @__PURE__ */ m("div", { className: `${h["container-filter-date"]} ${R}`, children: [
|
|
190
|
+
/* @__PURE__ */ m("div", { children: [
|
|
191
|
+
(g ?? p).map((e, t) => /* @__PURE__ */ s(
|
|
195
192
|
"div",
|
|
196
193
|
{
|
|
197
|
-
className: `${
|
|
194
|
+
className: `${h["button-filter-date"]} hover:iru-bg-laba-blue-01 ${b?.key === e.key ? "iru-text-laba-blue-10" : ""}`,
|
|
198
195
|
onClick: () => y(e, !0),
|
|
199
196
|
children: e.value
|
|
200
197
|
},
|
|
201
198
|
t
|
|
202
199
|
)),
|
|
203
|
-
|
|
200
|
+
b?.key !== "custom" && /* @__PURE__ */ s(T, { children: typeof w == "function" ? /* @__PURE__ */ s(
|
|
204
201
|
"div",
|
|
205
202
|
{
|
|
206
|
-
className:
|
|
207
|
-
onClick: () => f(
|
|
208
|
-
children:
|
|
203
|
+
className: h["button-filter-date-custome"],
|
|
204
|
+
onClick: () => f(c, !0),
|
|
205
|
+
children: w()
|
|
209
206
|
}
|
|
210
207
|
) : /* @__PURE__ */ s(
|
|
211
|
-
|
|
208
|
+
ee,
|
|
212
209
|
{
|
|
213
|
-
className:
|
|
210
|
+
className: h["button-reset-filter-date"],
|
|
214
211
|
variants: "nude-laba-blue-10",
|
|
215
212
|
size: "small",
|
|
216
|
-
onClick: () => f(
|
|
213
|
+
onClick: () => f(c, !0),
|
|
217
214
|
children: "Reset"
|
|
218
215
|
}
|
|
219
216
|
) })
|
|
220
217
|
] }),
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
b?.key === "custom" && /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
219
|
+
Z,
|
|
223
220
|
{
|
|
224
221
|
defaultValue: Y,
|
|
225
222
|
value: Y,
|
|
226
|
-
prevIcon:
|
|
227
|
-
nextIcon:
|
|
228
|
-
buttonReset:
|
|
229
|
-
buttonSubmit:
|
|
230
|
-
isCustomTime:
|
|
223
|
+
prevIcon: x,
|
|
224
|
+
nextIcon: H,
|
|
225
|
+
buttonReset: w,
|
|
226
|
+
buttonSubmit: N,
|
|
227
|
+
isCustomTime: z,
|
|
231
228
|
onChange: (e) => {
|
|
232
|
-
u(e, "Kustom", { key: "custom", value: "Kustom" }),
|
|
229
|
+
u(e, "Kustom", { key: "custom", value: "Kustom" }), r({ key: "custom", value: "Kustom" });
|
|
233
230
|
},
|
|
234
231
|
onReset: () => {
|
|
235
|
-
f(
|
|
232
|
+
f(c, !0);
|
|
236
233
|
},
|
|
237
|
-
typePicker:
|
|
234
|
+
typePicker: j,
|
|
238
235
|
withConfirm: !0
|
|
239
236
|
}
|
|
240
237
|
) })
|
|
@@ -244,5 +241,5 @@ const De = ({
|
|
|
244
241
|
] });
|
|
245
242
|
};
|
|
246
243
|
export {
|
|
247
|
-
|
|
244
|
+
le as default
|
|
248
245
|
};
|
|
@@ -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"),$=require("react"),u=require("react-aria"),f=require("@internationalized/date"),k=require("../Popover/Popover.cjs"),I=require("../Calendar/Calendar.cjs"),o=r=>{let a;const n=new Date(r??new Date);return r&&(a=f.parseDate(new Date(n.setHours(n.getHours()+7)).toISOString().slice(0,10))),a},R=({month:r,year:a,type:n=["month","year"],activeType:h="month",minDate:l,maxDate:i,className:p,classNameButton:g,onChange:c,buttonClick:d,id:m="date-picker",idPopover:v="date-picker-popover",floatingOptions:j={},offsetPopover:x=5,zIndexPopper:P=1,hiddenHeader:S})=>{const{locale:q}=u.useLocale(),s=$.useRef(null),w=o(l),D=o(i),C=e=>{typeof c=="function"&&(c({month:e.month,year:e.year}),s.current?.setShow(!1))};return t.jsxs(t.Fragment,{children:[t.jsx("div",{id:m,onClick:e=>{e.stopPropagation(),s.current?.handlerShow(e)},className:g,children:typeof d=="function"?d({month:r,year:a}):"Pilih Tanggal"}),t.jsx("div",{className:p??"",children:t.jsx(k.default,{zIndex:P,ref:s,offset:x,id:v,floatingOptions:{placement:"bottom-end",...j},onClick:e=>e.stopPropagation(),children:t.jsx(u.I18nProvider,{locale:"id-ID",children:t.jsx(I.default,{minValue:w,maxValue:D,minDate:l,maxDate:i,activeType:n.length===1?n[0]:h,locale:q,value:o(`${a}/${r}/1`),createCalendar:f.createCalendar,defaultValue:o(`${a}/${r}/1`),onChange:C,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:n,hiddenHeader:S})})})})]})};exports.default=R;
|
|
@@ -1,77 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { useLocale as
|
|
4
|
-
import { createCalendar as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as C, Fragment as I, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import $ from "react";
|
|
3
|
+
import { useLocale as R, I18nProvider as V } from "react-aria";
|
|
4
|
+
import { createCalendar as j, parseDate as y } from "@internationalized/date";
|
|
5
|
+
import H from "../Popover/Popover.mjs";
|
|
6
|
+
import N from "../Calendar/Calendar.mjs";
|
|
7
|
+
const n = (t) => {
|
|
8
8
|
let o;
|
|
9
9
|
const r = new Date(t ?? /* @__PURE__ */ new Date());
|
|
10
|
-
return t && (o =
|
|
11
|
-
},
|
|
10
|
+
return t && (o = y(new Date(r.setHours(r.getHours() + 7)).toISOString().slice(0, 10))), o;
|
|
11
|
+
}, M = ({
|
|
12
12
|
month: t,
|
|
13
13
|
year: o,
|
|
14
14
|
type: r = ["month", "year"],
|
|
15
|
-
activeType:
|
|
16
|
-
minDate:
|
|
17
|
-
maxDate:
|
|
18
|
-
className:
|
|
19
|
-
classNameButton:
|
|
20
|
-
onChange:
|
|
21
|
-
buttonClick:
|
|
22
|
-
id:
|
|
23
|
-
idPopover:
|
|
24
|
-
floatingOptions:
|
|
25
|
-
offsetPopover:
|
|
26
|
-
zIndexPopper:
|
|
27
|
-
hiddenHeader:
|
|
15
|
+
activeType: f = "month",
|
|
16
|
+
minDate: l,
|
|
17
|
+
maxDate: c,
|
|
18
|
+
className: m,
|
|
19
|
+
classNameButton: p,
|
|
20
|
+
onChange: s,
|
|
21
|
+
buttonClick: d,
|
|
22
|
+
id: h = "date-picker",
|
|
23
|
+
idPopover: u = "date-picker-popover",
|
|
24
|
+
floatingOptions: g = {},
|
|
25
|
+
offsetPopover: v = 5,
|
|
26
|
+
zIndexPopper: P = 1,
|
|
27
|
+
hiddenHeader: w
|
|
28
28
|
}) => {
|
|
29
|
-
const { locale:
|
|
30
|
-
|
|
31
|
-
typeof d == "function" && (d({ month: e.month, year: e.year }), (a = l.current) == null || a.setShow(!1));
|
|
29
|
+
const { locale: D } = R(), i = $.useRef(null), S = n(l), k = n(c), x = (e) => {
|
|
30
|
+
typeof s == "function" && (s({ month: e.month, year: e.year }), i.current?.setShow(!1));
|
|
32
31
|
};
|
|
33
|
-
return /* @__PURE__ */ I
|
|
34
|
-
/* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ C(I, { children: [
|
|
33
|
+
/* @__PURE__ */ a(
|
|
35
34
|
"div",
|
|
36
35
|
{
|
|
37
|
-
id:
|
|
36
|
+
id: h,
|
|
38
37
|
onClick: (e) => {
|
|
39
|
-
|
|
40
|
-
e.stopPropagation(), (a = l.current) == null || a.handlerShow(e);
|
|
38
|
+
e.stopPropagation(), i.current?.handlerShow(e);
|
|
41
39
|
},
|
|
42
|
-
className:
|
|
43
|
-
children: typeof
|
|
40
|
+
className: p,
|
|
41
|
+
children: typeof d == "function" ? d({ month: t, year: o }) : "Pilih Tanggal"
|
|
44
42
|
}
|
|
45
43
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
44
|
+
/* @__PURE__ */ a("div", { className: m ?? "", children: /* @__PURE__ */ a(
|
|
45
|
+
H,
|
|
48
46
|
{
|
|
49
|
-
zIndex:
|
|
50
|
-
ref:
|
|
51
|
-
offset:
|
|
52
|
-
id:
|
|
53
|
-
floatingOptions: { placement: "bottom-end", ...
|
|
47
|
+
zIndex: P,
|
|
48
|
+
ref: i,
|
|
49
|
+
offset: v,
|
|
50
|
+
id: u,
|
|
51
|
+
floatingOptions: { placement: "bottom-end", ...g },
|
|
54
52
|
onClick: (e) => e.stopPropagation(),
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
|
|
53
|
+
children: /* @__PURE__ */ a(V, { locale: "id-ID", children: /* @__PURE__ */ a(
|
|
54
|
+
N,
|
|
57
55
|
{
|
|
58
|
-
minValue:
|
|
59
|
-
maxValue:
|
|
60
|
-
minDate:
|
|
61
|
-
maxDate:
|
|
62
|
-
activeType: r.length === 1 ? r[0] :
|
|
63
|
-
locale:
|
|
64
|
-
value:
|
|
65
|
-
createCalendar:
|
|
66
|
-
defaultValue:
|
|
67
|
-
onChange:
|
|
56
|
+
minValue: S,
|
|
57
|
+
maxValue: k,
|
|
58
|
+
minDate: l,
|
|
59
|
+
maxDate: c,
|
|
60
|
+
activeType: r.length === 1 ? r[0] : f,
|
|
61
|
+
locale: D,
|
|
62
|
+
value: n(`${o}/${t}/1`),
|
|
63
|
+
createCalendar: j,
|
|
64
|
+
defaultValue: n(`${o}/${t}/1`),
|
|
65
|
+
onChange: x,
|
|
68
66
|
handlerReset: () => {
|
|
69
67
|
},
|
|
70
68
|
handlerSubmit: () => {
|
|
71
69
|
},
|
|
72
70
|
withDateSelect: !1,
|
|
73
71
|
type: r,
|
|
74
|
-
hiddenHeader:
|
|
72
|
+
hiddenHeader: w
|
|
75
73
|
}
|
|
76
74
|
) })
|
|
77
75
|
}
|
|
@@ -79,5 +77,5 @@ const i = (t) => {
|
|
|
79
77
|
] });
|
|
80
78
|
};
|
|
81
79
|
export {
|
|
82
|
-
|
|
80
|
+
M as default
|
|
83
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("react/jsx-runtime"),l=require("react"),m=require("../../utils/common.cjs"),b=require("../../hooks/useDeepCompareEffect.cjs"),V=(i,p,f)=>{if(p?.length>0){const r={};return p.forEach(e=>{i[e]&&(r[e]=i[e]),f&&i[`${f}${e}`]&&(r[`${f}${e}`]=i[`${f}${e}`])}),r}return i},A=l.forwardRef((i,p)=>{const{children:f,onChange:r,prefixNativeValue:e="",defaultNativeValue:y,defaultValue:C,mountedExecuteChange:O=!0,keepKeys:g=[],resetPagination:P=!0,keyPageNumber:q="pageNumber",triggerReset:z={},reset:N}=i,$=P?{[q]:1}:{},[s,d]=l.useState(V(C??{},g,"")),[u,h]=l.useState(m.sanitizeObjectKeyPrefix(e,V(y??{},g,e))),[S,F]=l.useState(!1),x=(t,a)=>{const c={};return Object.keys(a).forEach(o=>{c[`${t}${o}`]=a[o]}),c},D=(t,a,c,o)=>{let n=t;const R=x(e,{[a]:t});Array.isArray(t)&&(c==="array-of-object-to-array"?n=m.transformArrayOfObjectToArray(t,o):c==="array-of-object-to-string"?n=m.transformArrayOfObjectToString(t,o):c==="array-to-string"&&(n=n.toString())),typeof r=="function"&&r({...s,[a]:n,...$},{...u,...R}),d(j=>({...j,[a]:n})),h(j=>({...j,...R}))},E=(t,a)=>{const o=x(e,{...a??t});typeof r=="function"&&r({...s,...t,...$},{...u,...o}),d(n=>({...n,...t})),h(n=>({...n,...o}))};return b.useDeepCompareEffect(()=>{!S&&typeof r=="function"&&O&&(r(s,u),F(!0))},[s,u,S,O]),b.useDeepCompareEffect(()=>{N&&(h(m.sanitizeObjectKeyPrefix(e,V(y??{},g,e))),d(V(C??{},g,"")))},[N,z]),l.useImperativeHandle(p,()=>({nativeValue:u,value:s,handlerOnChange:D,handlerOnChangeNative:E}),[b.useDeepCompareMemoize(s),b.useDeepCompareMemoize(u)]),v.jsx(v.Fragment,{children:f({handlerOnChange:D,handlerOnChangeNative:E,value:s,nativeValue:u})})});A.displayName="FilterContainer";exports.default=A;
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
import { jsx as w, Fragment as z } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import l from "react";
|
|
3
3
|
import { sanitizeObjectKeyPrefix as S, transformArrayOfObjectToArray as H, transformArrayOfObjectToString as I } from "../../utils/common.mjs";
|
|
4
4
|
import { useDeepCompareEffect as E, useDeepCompareMemoize as F } from "../../hooks/useDeepCompareEffect.mjs";
|
|
5
|
-
const g = (i,
|
|
6
|
-
if (
|
|
5
|
+
const g = (i, p, c) => {
|
|
6
|
+
if (p?.length > 0) {
|
|
7
7
|
const r = {};
|
|
8
|
-
return
|
|
9
|
-
i[e] && (r[e] = i[e]),
|
|
8
|
+
return p.forEach((e) => {
|
|
9
|
+
i[e] && (r[e] = i[e]), c && i[`${c}${e}`] && (r[`${c}${e}`] = i[`${c}${e}`]);
|
|
10
10
|
}), r;
|
|
11
11
|
}
|
|
12
12
|
return i;
|
|
13
|
-
}, M =
|
|
13
|
+
}, M = l.forwardRef((i, p) => {
|
|
14
14
|
const {
|
|
15
|
-
children:
|
|
15
|
+
children: c,
|
|
16
16
|
onChange: r,
|
|
17
17
|
prefixNativeValue: e = "",
|
|
18
|
-
defaultNativeValue:
|
|
19
|
-
defaultValue:
|
|
20
|
-
mountedExecuteChange:
|
|
18
|
+
defaultNativeValue: y,
|
|
19
|
+
defaultValue: O,
|
|
20
|
+
mountedExecuteChange: d = !0,
|
|
21
21
|
keepKeys: m = [],
|
|
22
22
|
resetPagination: v = !0,
|
|
23
23
|
keyPageNumber: D = "pageNumber",
|
|
24
24
|
triggerReset: K = {},
|
|
25
|
-
reset:
|
|
26
|
-
} = i,
|
|
27
|
-
S(e, g(
|
|
28
|
-
), [
|
|
25
|
+
reset: j
|
|
26
|
+
} = i, C = v ? { [D]: 1 } : {}, [s, V] = l.useState(g(O ?? {}, m, "")), [f, h] = l.useState(
|
|
27
|
+
S(e, g(y ?? {}, m, e))
|
|
28
|
+
), [N, P] = l.useState(!1), $ = (t, a) => {
|
|
29
29
|
const u = {};
|
|
30
30
|
return Object.keys(a).forEach((o) => {
|
|
31
31
|
u[`${t}${o}`] = a[o];
|
|
32
32
|
}), u;
|
|
33
|
-
},
|
|
33
|
+
}, x = (t, a, u, o) => {
|
|
34
34
|
let n = t;
|
|
35
|
-
const R =
|
|
36
|
-
Array.isArray(t) && (u === "array-of-object-to-array" ? n = H(t, o) : u === "array-of-object-to-string" ? n = I(t, o) : u === "array-to-string" && (n = n.toString())), typeof r == "function" && r({ ...s, [a]: n, ...
|
|
35
|
+
const R = $(e, { [a]: t });
|
|
36
|
+
Array.isArray(t) && (u === "array-of-object-to-array" ? n = H(t, o) : u === "array-of-object-to-string" ? n = I(t, o) : u === "array-to-string" && (n = n.toString())), typeof r == "function" && r({ ...s, [a]: n, ...C }, { ...f, ...R }), V((b) => ({ ...b, [a]: n })), h((b) => ({ ...b, ...R }));
|
|
37
37
|
}, A = (t, a) => {
|
|
38
|
-
const o =
|
|
39
|
-
typeof r == "function" && r({ ...s, ...t, ...
|
|
38
|
+
const o = $(e, { ...a ?? t });
|
|
39
|
+
typeof r == "function" && r({ ...s, ...t, ...C }, { ...f, ...o }), V((n) => ({ ...n, ...t })), h((n) => ({ ...n, ...o }));
|
|
40
40
|
};
|
|
41
41
|
return E(() => {
|
|
42
|
-
|
|
43
|
-
}, [s, f,
|
|
44
|
-
|
|
42
|
+
!N && typeof r == "function" && d && (r(s, f), P(!0));
|
|
43
|
+
}, [s, f, N, d]), E(() => {
|
|
44
|
+
j && (h(
|
|
45
45
|
S(
|
|
46
46
|
e,
|
|
47
|
-
g(
|
|
47
|
+
g(y ?? {}, m, e)
|
|
48
48
|
)
|
|
49
|
-
), V(g(
|
|
50
|
-
}, [
|
|
49
|
+
), V(g(O ?? {}, m, "")));
|
|
50
|
+
}, [j, K]), l.useImperativeHandle(p, () => ({ nativeValue: f, value: s, handlerOnChange: x, handlerOnChangeNative: A }), [
|
|
51
51
|
F(s),
|
|
52
52
|
F(f)
|
|
53
|
-
]), /* @__PURE__ */ w(z, { children:
|
|
54
|
-
handlerOnChange:
|
|
53
|
+
]), /* @__PURE__ */ w(z, { children: c({
|
|
54
|
+
handlerOnChange: x,
|
|
55
55
|
handlerOnChangeNative: A,
|
|
56
56
|
value: s,
|
|
57
57
|
nativeValue: f
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),e=require("./InputFloatingInner.module.scss.cjs"),
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
5
|
-
${o.disabled?e.default.disabled:""} ${
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),e=require("./InputFloatingInner.module.scss.cjs"),j=require("./InputFloatingInner.config.cjs"),c=s.forwardRef((d,u)=>{const{isRequired:f,classNameContainer:m,classNameLabelError:p,classNameLabel:I,className:N,name:i,id:r,label:$,type:b="text",startIcon:n,endIcon:a,error:l,sizeInput:g="large",...o}=d,x=()=>typeof n=="function"||s.isValidElement(n),h=()=>typeof a=="function"||s.isValidElement(a);return t.jsxs("div",{className:`${e.default.container} ${j.configInputFloatingInner.size?.[g]} ${m??""}`,children:[t.jsxs("div",{className:e.default["container-input"],children:[t.jsx("input",{id:r??i,className:`${e.default.input} ${l?e.default.error:""}
|
|
2
|
+
${x()?e.default["isset-left-icon"]:""}
|
|
3
|
+
${h()?e.default["isset-right-icon"]:""}
|
|
4
|
+
${N??""}`,ref:u,type:b,...o}),t.jsxs("div",{className:e.default["start-icon"],children:[typeof n=="function"&&n(),s.isValidElement(n)&&n]}),t.jsxs("label",{className:`${e.default.label} ${I??""}`,htmlFor:r??i,children:[$," ",f&&t.jsx("span",{className:"iru-text-laba-red-08",children:"*"})]}),t.jsxs("div",{className:e.default["end-icon"],children:[typeof a=="function"&&a(),s.isValidElement(a)&&a]})]}),l&&t.jsx("label",{className:`${e.default["label-error"]}
|
|
5
|
+
${o.disabled?e.default.disabled:""} ${p??""}`,children:l})]})});c.displayName="InputFloatingInner";exports.default=c;
|