1mpacto-react-ui 2.0.30 → 2.0.31
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/style.css +1 -1
- package/dist/components/Calendar/CalendarButton.cjs +1 -1
- package/dist/components/Calendar/CalendarButton.mjs +12 -11
- package/dist/components/Calendar/CalendarCell.cjs +1 -1
- package/dist/components/Calendar/CalendarCell.mjs +8 -8
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +28 -28
- package/dist/components/Calendar/CalendarYear.cjs +2 -2
- package/dist/components/Calendar/CalendarYear.mjs +36 -36
- package/dist/components/Calendar/style.module.scss.cjs +1 -1
- package/dist/components/Calendar/style.module.scss.mjs +36 -34
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +45 -44
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +54 -53
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +27 -26
- package/dist/components/Modal/ModalDialog.cjs +9 -9
- package/dist/components/Modal/ModalDialog.config.cjs +1 -1
- package/dist/components/Modal/ModalDialog.config.mjs +4 -2
- package/dist/components/Modal/ModalDialog.mjs +25 -22
- package/dist/components/Modal/style.module.scss.cjs +1 -1
- package/dist/components/Modal/style.module.scss.mjs +19 -17
- package/dist/components/RadioCheckbox/RadioCheckbox.module.scss.cjs +1 -1
- package/dist/components/RadioCheckbox/RadioCheckbox.module.scss.mjs +21 -21
- package/dist/components/Tabs/style.module.scss.cjs +1 -1
- package/dist/components/Tabs/style.module.scss.mjs +29 -29
- package/dist/components/fin/Chat/BubbleChat.cjs +1 -1
- package/dist/components/fin/Chat/BubbleChat.mjs +17 -7
- package/dist/components/fin/Chat/BubbleChatOption.cjs +1 -1
- package/dist/components/fin/Chat/BubbleChatOption.mjs +17 -16
- package/dist/components/fin/Chat/BubbleChatUser.cjs +1 -1
- package/dist/components/fin/Chat/BubbleChatUser.mjs +11 -4
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.mjs +21 -19
- 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/Input/InputReguler.stories.d.ts +20 -0
- package/dist/src/components/Modal/ModalDialog.config.d.ts +14 -0
- package/dist/src/components/Modal/ModalDialog.d.ts +1 -1
- package/dist/src/components/Modal/ModalDialog.stories.d.ts +17 -1
- package/dist/src/components/Popover/Popover.stories.d.ts +16 -0
- package/dist/src/components/Textarea/TextareaFloatingInner.stories.d.ts +16 -0
- package/dist/src/components/Upload/UploadMultipleFile.stories.d.ts +13 -0
- package/dist/src/components/fin/Chat/BubbleChat.d.ts +1 -1
- package/dist/src/components/fin/Chat/BubbleChat.stories.d.ts +99 -0
- package/dist/src/components/fin/Chat/BubbleChatOption.d.ts +1 -1
- package/dist/src/components/fin/Chat/BubbleChatOption.stories.d.ts +152 -0
- package/dist/src/components/fin/Chat/BubbleChatUser.d.ts +1 -1
- package/dist/src/components/fin/Chat/BubbleChatUser.stories.d.ts +65 -0
- package/dist/src/interfaces/components/Input/index.d.ts +1 -1
- package/dist/src/interfaces/components/Modal/index.d.ts +4 -1
- package/dist/src/interfaces/components/fin/Chat/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("react"),Z=require("./DateRangePicker.cjs"),ee=require("../Popover/Popover.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("react"),Z=require("./DateRangePicker.cjs"),ee=require("../Popover/Popover.cjs"),w=require("../Calendar/style.module.scss.cjs"),g=require("../../utils/common.cjs"),te=require("../Button/Button.cjs"),b=require("../Calendar/Calendar.config.cjs"),n={"en-US":{Today:"Today","This week":"This week","This month":"This month","This year":"This year",Yesterday:"Yesterday","Last week":"Last week","Last month":"Last month","Last year":"Last year",Custom:"Custom",Reset:"Reset"},"id-ID":{Today:"Hari ini","This week":"Minggu ini","This month":"Bulan ini","This year":"Tahun ini",Yesterday:"Kemarin","Last week":"Minggu lalu","Last month":"Bulan lalu","Last year":"Tahun lalu",Custom:"Kustom",Reset:"Reset"},"zh-CN":{Today:"今天","This week":"本周","This month":"本月","This year":"今年",Yesterday:"昨天","Last week":"上周","Last month":"上个月","Last year":"去年",Custom:"自定义",Reset:"重置"},"nl-NL":{Today:"Vandaag","This week":"Deze week","This month":"Deze maand","This year":"Dit jaar",Yesterday:"Gisteren","Last week":"Vorige week","Last month":"Vorige maand","Last year":"Vorig jaar",Custom:"Aangepast",Reset:"Reset"}},ae=({value:i,prevIcon:F,nextIcon:v,buttonReset:T,buttonSubmit:N,className:q,classNameButton:V,buttonClick:D,buttonList:Y,typePicker:H="RANGE",onChange:p,idPopover:W="filter-date-popover",id:z="filter-date",floatingOptions:B={},offsetPopover:P=5,zIndexPopper:E=0,defaultValueLabel:c,isCustomTime:O=!1,mountedExecuteChange:_=!0,formatingDate:h,variants:y="laba-blue-10",locale:s="id-ID"})=>{const S=[{key:"thisDay",value:n[s].Today},{key:"thisWeek",value:n[s]["This week"]},{key:"thisMonth",value:n[s]["This month"]},{key:"thisYear",value:n[s]["This year"]},{key:"yesterday",value:n[s].Yesterday},{key:"lastWeek",value:n[s]["Last week"]},{key:"lastMonth",value:n[s]["Last month"]},{key:"lastYear",value:n[s]["Last year"]},{key:"custom",value:n[s].Custom}],L=o.useRef(null),[M,j]=o.useState(),[$,d]=o.useState(),[C,x]=o.useState(),l=(e,t)=>{const a=new Date(e??new Date);return t==="start"?new Date(a.setHours(0,0,0)):new Date(a.setHours(23,59,59))},I=()=>{const e=new Date;return{startDate:e,endDate:e}},K=()=>{const e=new Date;e.setDate(e.getDate()-e.getDay());const t=new Date;return t.setDate(t.getDate()+(6-t.getDay())),{startDate:e,endDate:t}},A=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return{startDate:t,endDate:a}},G=()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear(),11,31);return{startDate:e,endDate:t}},J=()=>{const e=new Date(new Date().setDate(new Date().getDate()-1));return{startDate:e,endDate:e}},U=()=>{const e=new Date;e.setDate(e.getDate()-(7+e.getDay()));const t=new Date;return t.setDate(t.getDate()-(t.getDay()+1)),{startDate:e,endDate:t}},Q=()=>{const e=new Date,t=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return{startDate:t,endDate:a}},X=()=>{const e=new Date(new Date().getFullYear()-1,0,1),t=new Date(new Date().getFullYear()-1,11,31);return{startDate:e,endDate:t}},m=(e,t,a)=>{if(x(e),typeof p=="function"){let u=e;h==="string"&&e?u={startDate:g.formatDate(e.startDate,h),endDate:g.formatDate(e.endDate,h)}:typeof h=="boolean"&&e&&(u={startDate:g.formatDate(e.startDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),endDate:g.formatDate(e.endDate,"yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}),L.current?.setShow(!1),p(u,t??"",a)}},f=(e,t)=>{j(e);let a;if(e?.key!=="custom"){switch(d(e),e?.key){case"thisDay":a=I();break;case"thisWeek":a=K();break;case"thisMonth":a=A();break;case"thisYear":a=G();break;case"yesterday":a=J();break;case"lastWeek":a=U();break;case"lastMonth":a=Q();break;case"lastYear":a=X();break}a&&t&&m({startDate:l(a.startDate,"start"),endDate:l(a.endDate,"end")},e?.value,e)}},k=(e,t)=>{const a=(Y??S).find(u=>u.key===e);!e&&!a?(t&&m(),f(void 0,t),d(void 0)):typeof e=="object"?(t&&m({startDate:l(e.startDate,"start"),endDate:l(e.endDate,"end")},"Kustom",{key:"custom",value:n[s].Custom}),f({key:"custom",value:n[s].Custom},t),d({key:"custom",value:n[s].Custom})):(f(a,t),d(a))},R=()=>{if(i){x(i);const e=(Y??S)?.find(t=>t.key===i.label||t.value===i.label);Object.keys(e||{}).length>0&&j(e)}else j(void 0),d(void 0)};return o.useEffect(()=>{R()},[JSON.stringify(i)]),o.useEffect(()=>{k(c??i,_)},[]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{onClick:e=>{L.current?.handlerShow(e),R()},className:V,id:z,children:[o.isValidElement(D)&&D,typeof D=="function"?D(C,$):"Pilih Filter"]}),r.jsx(ee.default,{zIndex:E,ref:L,offset:P,id:W,variant:y==="fin-primary-500"?"white-fin":"white",floatingOptions:{placement:"bottom-end",...B},children:r.jsxs("div",{className:`${b.configCalendar.selectedVariants[y]} ${q}`,children:[r.jsxs("div",{children:[(Y??S).map((e,t)=>r.jsx("div",{className:`${w.default["button-filter-date"]} ${M?.key===e.key?w.default.selected:""}`,onClick:()=>f(e,!0),children:e.value},t)),M?.key!=="custom"&&r.jsx(r.Fragment,{children:typeof T=="function"?r.jsx("div",{className:w.default["button-filter-date-custome"],onClick:()=>k(c,!0),children:T()}):r.jsx(te.default,{className:w.default["button-reset-filter-date"],variants:b.configCalendar.resetButtonVariant[y],size:"small",onClick:()=>k(c,!0),children:n[s].Reset})})]}),M?.key==="custom"&&r.jsx("div",{children:r.jsx(Z.default,{defaultValue:C,value:C,prevIcon:F,nextIcon:v,buttonReset:T,buttonSubmit:N,isCustomTime:O,variants:y,onChange:e=>{m(e,n[s].Custom,{key:"custom",value:n[s].Custom}),d({key:"custom",value:n[s].Custom})},onReset:()=>{k(c,!0)},typePicker:H,locale:s,withConfirm:!0})})]})})]})};exports.default=ae;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, Fragment as v, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import d, { isValidElement as te } from "react";
|
|
3
3
|
import ae from "./DateRangePicker.mjs";
|
|
4
4
|
import se from "../Popover/Popover.mjs";
|
|
5
|
-
import
|
|
6
|
-
import { formatDate as
|
|
5
|
+
import g from "../Calendar/style.module.scss.mjs";
|
|
6
|
+
import { formatDate as T } from "../../utils/common.mjs";
|
|
7
7
|
import ne from "../Button/Button.mjs";
|
|
8
8
|
import { configCalendar as V } from "../Calendar/Calendar.config.mjs";
|
|
9
9
|
const n = {
|
|
@@ -59,14 +59,14 @@ const n = {
|
|
|
59
59
|
value: o,
|
|
60
60
|
prevIcon: H,
|
|
61
61
|
nextIcon: j,
|
|
62
|
-
buttonReset:
|
|
62
|
+
buttonReset: p,
|
|
63
63
|
buttonSubmit: x,
|
|
64
64
|
className: W,
|
|
65
65
|
classNameButton: z,
|
|
66
66
|
buttonClick: c,
|
|
67
|
-
buttonList:
|
|
67
|
+
buttonList: Y,
|
|
68
68
|
typePicker: B = "RANGE",
|
|
69
|
-
onChange:
|
|
69
|
+
onChange: b,
|
|
70
70
|
idPopover: E = "filter-date-popover",
|
|
71
71
|
id: P = "filter-date",
|
|
72
72
|
floatingOptions: $ = {},
|
|
@@ -76,7 +76,7 @@ const n = {
|
|
|
76
76
|
isCustomTime: O = !1,
|
|
77
77
|
mountedExecuteChange: A = !0,
|
|
78
78
|
formatingDate: y,
|
|
79
|
-
variants:
|
|
79
|
+
variants: m = "laba-blue-10",
|
|
80
80
|
locale: s = "id-ID"
|
|
81
81
|
}) => {
|
|
82
82
|
const L = [
|
|
@@ -89,7 +89,7 @@ const n = {
|
|
|
89
89
|
{ key: "lastMonth", value: n[s]["Last month"] },
|
|
90
90
|
{ key: "lastYear", value: n[s]["Last year"] },
|
|
91
91
|
{ key: "custom", value: n[s].Custom }
|
|
92
|
-
], S = d.useRef(null), [M,
|
|
92
|
+
], S = d.useRef(null), [M, C] = d.useState(), [G, i] = d.useState(), [R, F] = d.useState(), u = (e, t) => {
|
|
93
93
|
const a = new Date(e ?? /* @__PURE__ */ new Date());
|
|
94
94
|
return t === "start" ? new Date(a.setHours(0, 0, 0)) : new Date(a.setHours(23, 59, 59));
|
|
95
95
|
}, J = () => {
|
|
@@ -144,19 +144,19 @@ const n = {
|
|
|
144
144
|
startDate: e,
|
|
145
145
|
endDate: t
|
|
146
146
|
};
|
|
147
|
-
},
|
|
148
|
-
if (F(e), typeof
|
|
147
|
+
}, l = (e, t, a) => {
|
|
148
|
+
if (F(e), typeof b == "function") {
|
|
149
149
|
let D = e;
|
|
150
150
|
y === "string" && e ? D = {
|
|
151
|
-
startDate:
|
|
152
|
-
endDate:
|
|
151
|
+
startDate: T(e.startDate, y),
|
|
152
|
+
endDate: T(e.endDate, y)
|
|
153
153
|
} : typeof y == "boolean" && e && (D = {
|
|
154
|
-
startDate:
|
|
155
|
-
endDate:
|
|
156
|
-
}), S.current?.setShow(!1),
|
|
154
|
+
startDate: T(e.startDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx"),
|
|
155
|
+
endDate: T(e.endDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
|
|
156
|
+
}), S.current?.setShow(!1), b(D, t ?? "", a);
|
|
157
157
|
}
|
|
158
|
-
},
|
|
159
|
-
|
|
158
|
+
}, k = (e, t) => {
|
|
159
|
+
C(e);
|
|
160
160
|
let a;
|
|
161
161
|
if (e?.key !== "custom") {
|
|
162
162
|
switch (i(e), e?.key) {
|
|
@@ -185,48 +185,48 @@ const n = {
|
|
|
185
185
|
a = ee();
|
|
186
186
|
break;
|
|
187
187
|
}
|
|
188
|
-
a && t &&
|
|
189
|
-
{ startDate:
|
|
188
|
+
a && t && l(
|
|
189
|
+
{ startDate: u(a.startDate, "start"), endDate: u(a.endDate, "end") },
|
|
190
190
|
e?.value,
|
|
191
191
|
e
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
-
},
|
|
195
|
-
const a = (
|
|
196
|
-
!e && !a ? (t &&
|
|
194
|
+
}, w = (e, t) => {
|
|
195
|
+
const a = (Y ?? L).find((D) => D.key === e);
|
|
196
|
+
!e && !a ? (t && l(), k(void 0, t), i(void 0)) : typeof e == "object" ? (t && l(
|
|
197
197
|
{
|
|
198
|
-
startDate:
|
|
199
|
-
endDate:
|
|
198
|
+
startDate: u(e.startDate, "start"),
|
|
199
|
+
endDate: u(e.endDate, "end")
|
|
200
200
|
},
|
|
201
201
|
"Kustom",
|
|
202
202
|
{ key: "custom", value: n[s].Custom }
|
|
203
|
-
),
|
|
204
|
-
},
|
|
203
|
+
), k({ key: "custom", value: n[s].Custom }, t), i({ key: "custom", value: n[s].Custom })) : (k(a, t), i(a));
|
|
204
|
+
}, N = () => {
|
|
205
205
|
if (o) {
|
|
206
206
|
F(o);
|
|
207
|
-
const e = (
|
|
207
|
+
const e = (Y ?? L)?.find(
|
|
208
208
|
(t) => t.key === o.label || t.value === o.label
|
|
209
209
|
);
|
|
210
|
-
Object.keys(e || {}).length > 0 &&
|
|
210
|
+
Object.keys(e || {}).length > 0 && C(e);
|
|
211
211
|
} else
|
|
212
|
-
|
|
212
|
+
C(void 0), i(void 0);
|
|
213
213
|
};
|
|
214
214
|
return d.useEffect(() => {
|
|
215
|
-
|
|
215
|
+
N();
|
|
216
216
|
}, [JSON.stringify(o)]), d.useEffect(() => {
|
|
217
|
-
|
|
218
|
-
}, []), /* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
217
|
+
w(h ?? o, A);
|
|
218
|
+
}, []), /* @__PURE__ */ f(v, { children: [
|
|
219
|
+
/* @__PURE__ */ f(
|
|
220
220
|
"div",
|
|
221
221
|
{
|
|
222
222
|
onClick: (e) => {
|
|
223
|
-
S.current?.handlerShow(e),
|
|
223
|
+
S.current?.handlerShow(e), N();
|
|
224
224
|
},
|
|
225
225
|
className: z,
|
|
226
226
|
id: P,
|
|
227
227
|
children: [
|
|
228
228
|
te(c) && c,
|
|
229
|
-
typeof c == "function" ? c(
|
|
229
|
+
typeof c == "function" ? c(R, G) : "Pilih Filter"
|
|
230
230
|
]
|
|
231
231
|
}
|
|
232
232
|
),
|
|
@@ -237,32 +237,33 @@ const n = {
|
|
|
237
237
|
ref: S,
|
|
238
238
|
offset: I,
|
|
239
239
|
id: E,
|
|
240
|
+
variant: m === "fin-primary-500" ? "white-fin" : "white",
|
|
240
241
|
floatingOptions: { placement: "bottom-end", ...$ },
|
|
241
|
-
children: /* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
(
|
|
242
|
+
children: /* @__PURE__ */ f("div", { className: `${V.selectedVariants[m]} ${W}`, children: [
|
|
243
|
+
/* @__PURE__ */ f("div", { children: [
|
|
244
|
+
(Y ?? L).map((e, t) => /* @__PURE__ */ r(
|
|
244
245
|
"div",
|
|
245
246
|
{
|
|
246
|
-
className: `${
|
|
247
|
-
onClick: () =>
|
|
247
|
+
className: `${g["button-filter-date"]} ${M?.key === e.key ? g.selected : ""}`,
|
|
248
|
+
onClick: () => k(e, !0),
|
|
248
249
|
children: e.value
|
|
249
250
|
},
|
|
250
251
|
t
|
|
251
252
|
)),
|
|
252
|
-
M?.key !== "custom" && /* @__PURE__ */ r(
|
|
253
|
+
M?.key !== "custom" && /* @__PURE__ */ r(v, { children: typeof p == "function" ? /* @__PURE__ */ r(
|
|
253
254
|
"div",
|
|
254
255
|
{
|
|
255
|
-
className:
|
|
256
|
-
onClick: () =>
|
|
257
|
-
children:
|
|
256
|
+
className: g["button-filter-date-custome"],
|
|
257
|
+
onClick: () => w(h, !0),
|
|
258
|
+
children: p()
|
|
258
259
|
}
|
|
259
260
|
) : /* @__PURE__ */ r(
|
|
260
261
|
ne,
|
|
261
262
|
{
|
|
262
|
-
className:
|
|
263
|
-
variants: V.resetButtonVariant[
|
|
263
|
+
className: g["button-reset-filter-date"],
|
|
264
|
+
variants: V.resetButtonVariant[m],
|
|
264
265
|
size: "small",
|
|
265
|
-
onClick: () =>
|
|
266
|
+
onClick: () => w(h, !0),
|
|
266
267
|
children: n[s].Reset
|
|
267
268
|
}
|
|
268
269
|
) })
|
|
@@ -270,19 +271,19 @@ const n = {
|
|
|
270
271
|
M?.key === "custom" && /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
271
272
|
ae,
|
|
272
273
|
{
|
|
273
|
-
defaultValue:
|
|
274
|
-
value:
|
|
274
|
+
defaultValue: R,
|
|
275
|
+
value: R,
|
|
275
276
|
prevIcon: H,
|
|
276
277
|
nextIcon: j,
|
|
277
|
-
buttonReset:
|
|
278
|
+
buttonReset: p,
|
|
278
279
|
buttonSubmit: x,
|
|
279
280
|
isCustomTime: O,
|
|
280
|
-
variants:
|
|
281
|
+
variants: m,
|
|
281
282
|
onChange: (e) => {
|
|
282
|
-
|
|
283
|
+
l(e, n[s].Custom, { key: "custom", value: n[s].Custom }), i({ key: "custom", value: n[s].Custom });
|
|
283
284
|
},
|
|
284
285
|
onReset: () => {
|
|
285
|
-
|
|
286
|
+
w(h, !0);
|
|
286
287
|
},
|
|
287
288
|
typePicker: B,
|
|
288
289
|
locale: s,
|
|
@@ -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"),b=require("react"),C=require("react-aria"),y=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=y.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:P={},offsetPopover:j=5,zIndexPopper:x=1,hiddenHeader:w,variants:p="laba-blue-10",locale:i="id-ID"})=>{const f=b.useRef(null),$=c(o,i),q=c(d,i),S=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:x,ref:f,offset:j,id:v,variant:p==="fin-primary-500"?"white-fin":"white",floatingOptions:{placement:"bottom-end",...P},onClick:t=>t.stopPropagation(),children:r.jsx(C.I18nProvider,{locale:i,children:r.jsx(T.default,{minValue:$,maxValue:q,minDate:o,maxDate:d,activeType:a.length===1?a[0]:h,locale:i,value:c(`${s}/${n}/1`,i),createCalendar:y.createCalendar,defaultValue:c(`${s}/${n}/1`,i),onChange:S,handlerReset:()=>{},handlerSubmit:()=>{},withDateSelect:!1,type:a,hiddenHeader:w,variants:p})})})})]})};exports.default=k;
|
|
@@ -5,43 +5,43 @@ import { createCalendar as b, parseDate as R } from "@internationalized/date";
|
|
|
5
5
|
import V from "../Popover/Popover.mjs";
|
|
6
6
|
import j from "../Calendar/Calendar.mjs";
|
|
7
7
|
const m = (r, i) => {
|
|
8
|
-
let
|
|
8
|
+
let n;
|
|
9
9
|
if (r) {
|
|
10
|
-
const
|
|
10
|
+
const o = new Intl.DateTimeFormat(i, {
|
|
11
11
|
year: "numeric",
|
|
12
12
|
month: "2-digit",
|
|
13
13
|
day: "2-digit"
|
|
14
|
-
}).formatToParts(new Date(r)),
|
|
15
|
-
return
|
|
14
|
+
}).formatToParts(new Date(r)), f = o.find((e) => e.type === "year")?.value, s = o.find((e) => e.type === "month")?.value, c = o.find((e) => e.type === "day")?.value;
|
|
15
|
+
return n = R(`${f}-${s}-${c}`), n;
|
|
16
16
|
}
|
|
17
17
|
}, q = ({
|
|
18
18
|
month: r,
|
|
19
19
|
year: i,
|
|
20
|
-
type:
|
|
20
|
+
type: n = ["month", "year"],
|
|
21
21
|
activeType: p = "month",
|
|
22
|
-
minDate:
|
|
23
|
-
maxDate:
|
|
24
|
-
className:
|
|
22
|
+
minDate: o,
|
|
23
|
+
maxDate: f,
|
|
24
|
+
className: s,
|
|
25
25
|
classNameButton: c,
|
|
26
26
|
onChange: e,
|
|
27
27
|
buttonClick: h,
|
|
28
|
-
id:
|
|
29
|
-
idPopover:
|
|
30
|
-
floatingOptions:
|
|
31
|
-
offsetPopover:
|
|
32
|
-
zIndexPopper:
|
|
28
|
+
id: y = "date-picker",
|
|
29
|
+
idPopover: g = "date-picker-popover",
|
|
30
|
+
floatingOptions: v = {},
|
|
31
|
+
offsetPopover: P = 5,
|
|
32
|
+
zIndexPopper: w = 1,
|
|
33
33
|
hiddenHeader: $,
|
|
34
|
-
variants:
|
|
34
|
+
variants: u = "laba-blue-10",
|
|
35
35
|
locale: a = "id-ID"
|
|
36
36
|
}) => {
|
|
37
|
-
const l = S.useRef(null), D = m(
|
|
37
|
+
const l = S.useRef(null), D = m(o, a), k = m(f, a), x = (t) => {
|
|
38
38
|
typeof e == "function" && (e({ month: t.month, year: t.year }), l.current?.setShow(!1));
|
|
39
39
|
};
|
|
40
40
|
return /* @__PURE__ */ C(I, { children: [
|
|
41
41
|
/* @__PURE__ */ d(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
|
-
id:
|
|
44
|
+
id: y,
|
|
45
45
|
onClick: (t) => {
|
|
46
46
|
t.stopPropagation(), l.current?.handlerShow(t);
|
|
47
47
|
},
|
|
@@ -49,23 +49,24 @@ const m = (r, i) => {
|
|
|
49
49
|
children: typeof h == "function" ? h({ month: r, year: i }) : "Pilih Tanggal"
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */ d("div", { className:
|
|
52
|
+
/* @__PURE__ */ d("div", { className: s ?? "", children: /* @__PURE__ */ d(
|
|
53
53
|
V,
|
|
54
54
|
{
|
|
55
|
-
zIndex:
|
|
55
|
+
zIndex: w,
|
|
56
56
|
ref: l,
|
|
57
|
-
offset:
|
|
58
|
-
id:
|
|
59
|
-
|
|
57
|
+
offset: P,
|
|
58
|
+
id: g,
|
|
59
|
+
variant: u === "fin-primary-500" ? "white-fin" : "white",
|
|
60
|
+
floatingOptions: { placement: "bottom-end", ...v },
|
|
60
61
|
onClick: (t) => t.stopPropagation(),
|
|
61
62
|
children: /* @__PURE__ */ d(T, { locale: a, children: /* @__PURE__ */ d(
|
|
62
63
|
j,
|
|
63
64
|
{
|
|
64
65
|
minValue: D,
|
|
65
66
|
maxValue: k,
|
|
66
|
-
minDate:
|
|
67
|
-
maxDate:
|
|
68
|
-
activeType:
|
|
67
|
+
minDate: o,
|
|
68
|
+
maxDate: f,
|
|
69
|
+
activeType: n.length === 1 ? n[0] : p,
|
|
69
70
|
locale: a,
|
|
70
71
|
value: m(`${i}/${r}/1`, a),
|
|
71
72
|
createCalendar: b,
|
|
@@ -76,9 +77,9 @@ const m = (r, i) => {
|
|
|
76
77
|
handlerSubmit: () => {
|
|
77
78
|
},
|
|
78
79
|
withDateSelect: !1,
|
|
79
|
-
type:
|
|
80
|
+
type: n,
|
|
80
81
|
hiddenHeader: $,
|
|
81
|
-
variants:
|
|
82
|
+
variants: u
|
|
82
83
|
}
|
|
83
84
|
) })
|
|
84
85
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
-
${a.configModal.brand[
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),r=require("react"),_=require("react-dom"),e=require("./style.module.scss.cjs"),a=require("./ModalDialog.config.cjs"),h=({as:c,children:f,id:m="modal",idModal:g="iru-modal",withOverlay:$=!0,show:t,size:p="regular",position:M="center",className:y,classNameContainer:q,onClose:i,brand:v="",offset:b,borderRadius:j,...C})=>{const R=c??"div",[o,s]=r.useState(t),[S,n]=r.useState(!1);r.useEffect(()=>{if(t)s(!0),n(!1);else if(o){n(!0);const l=setTimeout(()=>{s(!1)},400);return()=>clearTimeout(l)}},[t,o]);const T=()=>{typeof i=="function"&&i()};if(!o)return null;const u=document.getElementById(g);return u?_.createPortal(d.jsx("div",{id:m,onClick:T,className:`
|
|
2
|
+
${a.configModal.brand[v]||""}
|
|
3
3
|
${$?e.default["with-overlay"]:""}
|
|
4
|
-
${
|
|
5
|
-
${
|
|
6
|
-
`.trim(),children:
|
|
4
|
+
${S?e.default["modal-hide"]:e.default["modal-show"]}
|
|
5
|
+
${q??""}
|
|
6
|
+
`.trim(),children:d.jsx(R,{onClick:l=>l.stopPropagation(),className:`
|
|
7
7
|
${e.default["modal-content"]}
|
|
8
|
-
${a.configModal.position[
|
|
9
|
-
${a.configModal.size[
|
|
10
|
-
${
|
|
11
|
-
`.trim(),...
|
|
8
|
+
${a.configModal.position[M]||""}
|
|
9
|
+
${a.configModal.size[p]||""}
|
|
10
|
+
${y??""}
|
|
11
|
+
`.trim(),style:{"--imp-modal-offset":b,"--imp-modal-border-radius":j},...C,children:f})}),u):null};exports.default=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.module.scss.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.module.scss.cjs"),e={size:{small:t.default["modal-small"],medium:t.default["modal-medium"],regular:t.default["modal-regular"],large:t.default["modal-large"]},brand:{"":t.default["brand-general"],fin:t.default["brand-fin"]},position:{center:t.default["modal-center"],"center-top":t.default["modal-center-top"],"center-bottom":t.default["modal-center-bottom"],"right-top":t.default["modal-right-top"],"right-bottom":t.default["modal-right-bottom"],"left-top":t.default["modal-left-top"],"left-bottom":t.default["modal-left-bottom"]}};exports.configModal=e;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import o from "./style.module.scss.mjs";
|
|
2
|
-
const
|
|
2
|
+
const e = {
|
|
3
3
|
size: {
|
|
4
4
|
small: o["modal-small"],
|
|
5
5
|
medium: o["modal-medium"],
|
|
@@ -12,6 +12,8 @@ const l = {
|
|
|
12
12
|
},
|
|
13
13
|
position: {
|
|
14
14
|
center: o["modal-center"],
|
|
15
|
+
"center-top": o["modal-center-top"],
|
|
16
|
+
"center-bottom": o["modal-center-bottom"],
|
|
15
17
|
"right-top": o["modal-right-top"],
|
|
16
18
|
"right-bottom": o["modal-right-bottom"],
|
|
17
19
|
"left-top": o["modal-left-top"],
|
|
@@ -19,5 +21,5 @@ const l = {
|
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
export {
|
|
22
|
-
|
|
24
|
+
e as configModal
|
|
23
25
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
2
|
+
import { useState as d, useEffect as M } from "react";
|
|
3
|
+
import { createPortal as N } from "react-dom";
|
|
4
4
|
import e from "./style.module.scss.mjs";
|
|
5
5
|
import { configModal as i } from "./ModalDialog.config.mjs";
|
|
6
|
-
const
|
|
7
|
-
as:
|
|
8
|
-
children:
|
|
6
|
+
const D = ({
|
|
7
|
+
as: f,
|
|
8
|
+
children: c,
|
|
9
9
|
id: u = "modal",
|
|
10
10
|
idModal: p = "iru-modal",
|
|
11
11
|
withOverlay: g = !0,
|
|
@@ -16,56 +16,59 @@ const z = ({
|
|
|
16
16
|
classNameContainer: h,
|
|
17
17
|
onClose: l,
|
|
18
18
|
brand: v = "",
|
|
19
|
-
|
|
19
|
+
offset: T,
|
|
20
|
+
borderRadius: b,
|
|
21
|
+
...k
|
|
20
22
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
+
const x = f ?? "div", [o, a] = d(t), [E, s] = d(!1);
|
|
24
|
+
M(() => {
|
|
23
25
|
if (t)
|
|
24
|
-
|
|
26
|
+
a(!0), s(!1);
|
|
25
27
|
else if (o) {
|
|
26
|
-
|
|
28
|
+
s(!0);
|
|
27
29
|
const r = setTimeout(() => {
|
|
28
|
-
|
|
30
|
+
a(!1);
|
|
29
31
|
}, 400);
|
|
30
32
|
return () => clearTimeout(r);
|
|
31
33
|
}
|
|
32
34
|
}, [t, o]);
|
|
33
|
-
const
|
|
35
|
+
const I = () => {
|
|
34
36
|
typeof l == "function" && l();
|
|
35
37
|
};
|
|
36
38
|
if (!o) return null;
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
+
const n = document.getElementById(p);
|
|
40
|
+
return n ? N(
|
|
39
41
|
/* @__PURE__ */ m(
|
|
40
42
|
"div",
|
|
41
43
|
{
|
|
42
44
|
id: u,
|
|
43
|
-
onClick:
|
|
45
|
+
onClick: I,
|
|
44
46
|
className: `
|
|
45
47
|
${i.brand[v] || ""}
|
|
46
48
|
${g ? e["with-overlay"] : ""}
|
|
47
|
-
${
|
|
49
|
+
${E ? e["modal-hide"] : e["modal-show"]}
|
|
48
50
|
${h ?? ""}
|
|
49
51
|
`.trim(),
|
|
50
52
|
children: /* @__PURE__ */ m(
|
|
51
|
-
|
|
53
|
+
x,
|
|
52
54
|
{
|
|
53
55
|
onClick: (r) => r.stopPropagation(),
|
|
54
56
|
className: `
|
|
55
57
|
${e["modal-content"]}
|
|
56
58
|
${i.position[y] || ""}
|
|
57
|
-
${i.size[$] || ""}
|
|
59
|
+
${i.size[$] || ""}
|
|
58
60
|
${C ?? ""}
|
|
59
61
|
`.trim(),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
style: { "--imp-modal-offset": T, "--imp-modal-border-radius": b },
|
|
63
|
+
...k,
|
|
64
|
+
children: c
|
|
62
65
|
}
|
|
63
66
|
)
|
|
64
67
|
}
|
|
65
68
|
),
|
|
66
|
-
|
|
69
|
+
n
|
|
67
70
|
) : null;
|
|
68
71
|
};
|
|
69
72
|
export {
|
|
70
|
-
|
|
73
|
+
D as default
|
|
71
74
|
};
|
|
@@ -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 m={"modal-content":"_modal-content_1mykb_117","modal-small":"_modal-small_1mykb_117","modal-medium":"_modal-medium_1mykb_121","modal-regular":"_modal-regular_1mykb_125","modal-large":"_modal-large_1mykb_129","modal-center":"_modal-center_1mykb_133","modal-center-top":"_modal-center-top_1mykb_139","modal-center-bottom":"_modal-center-bottom_1mykb_145","modal-right-top":"_modal-right-top_1mykb_151","modal-right-bottom":"_modal-right-bottom_1mykb_156","modal-left-top":"_modal-left-top_1mykb_161","modal-left-bottom":"_modal-left-bottom_1mykb_166","brand-general":"_brand-general_1mykb_172","with-overlay":"_with-overlay_1mykb_184","modal-show":"_modal-show_1mykb_198","modal-hide":"_modal-hide_1mykb_222","brand-fin":"_brand-fin_1mykb_245"};exports.default=m;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
const
|
|
2
|
-
"modal-content": "_modal-
|
|
3
|
-
"modal-small": "_modal-
|
|
4
|
-
"modal-medium": "_modal-
|
|
5
|
-
"modal-regular": "_modal-
|
|
6
|
-
"modal-large": "_modal-
|
|
7
|
-
"modal-center": "_modal-
|
|
8
|
-
"modal-
|
|
9
|
-
"modal-
|
|
10
|
-
"modal-
|
|
11
|
-
"modal-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
1
|
+
const m = {
|
|
2
|
+
"modal-content": "_modal-content_1mykb_117",
|
|
3
|
+
"modal-small": "_modal-small_1mykb_117",
|
|
4
|
+
"modal-medium": "_modal-medium_1mykb_121",
|
|
5
|
+
"modal-regular": "_modal-regular_1mykb_125",
|
|
6
|
+
"modal-large": "_modal-large_1mykb_129",
|
|
7
|
+
"modal-center": "_modal-center_1mykb_133",
|
|
8
|
+
"modal-center-top": "_modal-center-top_1mykb_139",
|
|
9
|
+
"modal-center-bottom": "_modal-center-bottom_1mykb_145",
|
|
10
|
+
"modal-right-top": "_modal-right-top_1mykb_151",
|
|
11
|
+
"modal-right-bottom": "_modal-right-bottom_1mykb_156",
|
|
12
|
+
"modal-left-top": "_modal-left-top_1mykb_161",
|
|
13
|
+
"modal-left-bottom": "_modal-left-bottom_1mykb_166",
|
|
14
|
+
"brand-general": "_brand-general_1mykb_172",
|
|
15
|
+
"with-overlay": "_with-overlay_1mykb_184",
|
|
16
|
+
"modal-show": "_modal-show_1mykb_198",
|
|
17
|
+
"modal-hide": "_modal-hide_1mykb_222",
|
|
18
|
+
"brand-fin": "_brand-fin_1mykb_245"
|
|
17
19
|
};
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
m as default
|
|
20
22
|
};
|
|
@@ -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 _="_container_qcm17_1",a="_label_qcm17_239",e="_disabled_qcm17_243",r={container:_,"container-input":"_container-input_qcm17_1","input-radio-checkbox-s":"_input-radio-checkbox-s_qcm17_1","input-radio-checkbox-m":"_input-radio-checkbox-m_qcm17_1","input-radio-checkbox-small":"_input-radio-checkbox-small_qcm17_1","input-radio-checkbox-reguler":"_input-radio-checkbox-reguler_qcm17_1","checked-icon":"_checked-icon_qcm17_11","default-disabled-radio":"_default-disabled-radio_qcm17_48","default-disabled-checkbox":"_default-disabled-checkbox_qcm17_58","laba-blue-10":"_laba-blue-10_qcm17_66","laba-blue-10-hv_bg_transparent":"_laba-blue-10-hv_bg_transparent_qcm17_78","blue-700":"_blue-700_qcm17_90","blue-700-hv_bg_transparent":"_blue-700-hv_bg_transparent_qcm17_102","bill-primary-500":"_bill-primary-500_qcm17_114","bill-primary-600-hv_bg_transparent":"_bill-primary-600-hv_bg_transparent_qcm17_126","bill-secondary-800-hv_bg_transparent":"_bill-secondary-800-hv_bg_transparent_qcm17_138","fin-primary-500":"_fin-primary-500_qcm17_150","fin-primary-500-hv_bg_transparent":"_fin-primary-500-hv_bg_transparent_qcm17_188",label:a,disabled:e};exports.container=_;exports.default=r;exports.disabled=e;exports.label=a;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
const _ = "
|
|
1
|
+
const _ = "_container_qcm17_1", a = "_label_qcm17_239", e = "_disabled_qcm17_243", r = {
|
|
2
2
|
container: _,
|
|
3
|
-
"container-input": "_container-
|
|
4
|
-
"input-radio-checkbox-s": "_input-radio-checkbox-
|
|
5
|
-
"input-radio-checkbox-m": "_input-radio-checkbox-
|
|
6
|
-
"input-radio-checkbox-small": "_input-radio-checkbox-
|
|
7
|
-
"input-radio-checkbox-reguler": "_input-radio-checkbox-
|
|
8
|
-
"checked-icon": "_checked-
|
|
9
|
-
"default-disabled-radio": "_default-disabled-
|
|
10
|
-
"default-disabled-checkbox": "_default-disabled-
|
|
11
|
-
"laba-blue-10": "_laba-blue-
|
|
12
|
-
"laba-blue-10-hv_bg_transparent": "_laba-blue-10-
|
|
13
|
-
"blue-700": "_blue-
|
|
14
|
-
"blue-700-hv_bg_transparent": "_blue-700-
|
|
15
|
-
"bill-primary-500": "_bill-primary-
|
|
16
|
-
"bill-primary-600-hv_bg_transparent": "_bill-primary-600-
|
|
17
|
-
"bill-secondary-800-hv_bg_transparent": "_bill-secondary-800-
|
|
18
|
-
"fin-primary-500": "_fin-primary-
|
|
19
|
-
"fin-primary-500-hv_bg_transparent": "_fin-primary-500-
|
|
3
|
+
"container-input": "_container-input_qcm17_1",
|
|
4
|
+
"input-radio-checkbox-s": "_input-radio-checkbox-s_qcm17_1",
|
|
5
|
+
"input-radio-checkbox-m": "_input-radio-checkbox-m_qcm17_1",
|
|
6
|
+
"input-radio-checkbox-small": "_input-radio-checkbox-small_qcm17_1",
|
|
7
|
+
"input-radio-checkbox-reguler": "_input-radio-checkbox-reguler_qcm17_1",
|
|
8
|
+
"checked-icon": "_checked-icon_qcm17_11",
|
|
9
|
+
"default-disabled-radio": "_default-disabled-radio_qcm17_48",
|
|
10
|
+
"default-disabled-checkbox": "_default-disabled-checkbox_qcm17_58",
|
|
11
|
+
"laba-blue-10": "_laba-blue-10_qcm17_66",
|
|
12
|
+
"laba-blue-10-hv_bg_transparent": "_laba-blue-10-hv_bg_transparent_qcm17_78",
|
|
13
|
+
"blue-700": "_blue-700_qcm17_90",
|
|
14
|
+
"blue-700-hv_bg_transparent": "_blue-700-hv_bg_transparent_qcm17_102",
|
|
15
|
+
"bill-primary-500": "_bill-primary-500_qcm17_114",
|
|
16
|
+
"bill-primary-600-hv_bg_transparent": "_bill-primary-600-hv_bg_transparent_qcm17_126",
|
|
17
|
+
"bill-secondary-800-hv_bg_transparent": "_bill-secondary-800-hv_bg_transparent_qcm17_138",
|
|
18
|
+
"fin-primary-500": "_fin-primary-500_qcm17_150",
|
|
19
|
+
"fin-primary-500-hv_bg_transparent": "_fin-primary-500-hv_bg_transparent_qcm17_188",
|
|
20
20
|
label: a,
|
|
21
|
-
disabled:
|
|
21
|
+
disabled: e
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
24
|
_ as container,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
r as default,
|
|
26
|
+
e as disabled,
|
|
27
27
|
a as label
|
|
28
28
|
};
|