1mpacto-react-ui 2.0.19 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/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 +2 -2
- package/dist/components/Calendar/CalendarYear.mjs +37 -38
- 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/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 +3 -3
- package/dist/components/Upload/UploadImage.mjs +62 -68
- 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 -0
- package/dist/hooks/useDebounce.mjs +27 -0
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/hooks/usePacked.cjs +1 -0
- package/dist/hooks/usePacked.mjs +56 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +52 -48
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +5 -4
- package/dist/package.json.mjs +1 -1
- package/dist/src/hooks/index.d.ts +4 -2
- package/dist/src/hooks/useDebounce.d.ts +61 -0
- package/dist/src/hooks/usePacked.d.ts +84 -0
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +4 -4
|
@@ -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;
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as x, isValidElement as s } from "react";
|
|
3
3
|
import e from "./InputFloatingInner.module.scss.mjs";
|
|
4
|
-
import { configInputFloatingInner as
|
|
5
|
-
const
|
|
6
|
-
var d;
|
|
4
|
+
import { configInputFloatingInner as v } from "./InputFloatingInner.config.mjs";
|
|
5
|
+
const F = x((d, m) => {
|
|
7
6
|
const {
|
|
8
|
-
isRequired:
|
|
9
|
-
classNameContainer:
|
|
10
|
-
classNameLabelError:
|
|
11
|
-
classNameLabel:
|
|
12
|
-
className:
|
|
7
|
+
isRequired: p,
|
|
8
|
+
classNameContainer: f,
|
|
9
|
+
classNameLabelError: u,
|
|
10
|
+
classNameLabel: N,
|
|
11
|
+
className: $,
|
|
13
12
|
name: l,
|
|
14
13
|
id: o,
|
|
15
|
-
label:
|
|
16
|
-
type:
|
|
14
|
+
label: I,
|
|
15
|
+
type: b = "text",
|
|
17
16
|
startIcon: n,
|
|
18
17
|
endIcon: a,
|
|
19
18
|
error: i,
|
|
20
|
-
sizeInput:
|
|
19
|
+
sizeInput: h = "large",
|
|
21
20
|
...c
|
|
22
|
-
} =
|
|
23
|
-
return /* @__PURE__ */ t("div", { className: `${e.container} ${
|
|
21
|
+
} = d, y = () => typeof n == "function" || s(n), g = () => typeof a == "function" || s(a);
|
|
22
|
+
return /* @__PURE__ */ t("div", { className: `${e.container} ${v.size?.[h]} ${f ?? ""}`, children: [
|
|
24
23
|
/* @__PURE__ */ t("div", { className: e["container-input"], children: [
|
|
25
24
|
/* @__PURE__ */ r(
|
|
26
25
|
"input",
|
|
27
26
|
{
|
|
28
27
|
id: o ?? l,
|
|
29
28
|
className: `${e.input} ${i ? e.error : ""}
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
ref:
|
|
34
|
-
type:
|
|
29
|
+
${y() ? e["isset-left-icon"] : ""}
|
|
30
|
+
${g() ? e["isset-right-icon"] : ""}
|
|
31
|
+
${$ ?? ""}`,
|
|
32
|
+
ref: m,
|
|
33
|
+
type: b,
|
|
35
34
|
...c
|
|
36
35
|
}
|
|
37
36
|
),
|
|
@@ -39,10 +38,10 @@ const E = v((m, p) => {
|
|
|
39
38
|
typeof n == "function" && n(),
|
|
40
39
|
s(n) && n
|
|
41
40
|
] }),
|
|
42
|
-
/* @__PURE__ */ t("label", { className: `${e.label} ${
|
|
43
|
-
|
|
41
|
+
/* @__PURE__ */ t("label", { className: `${e.label} ${N ?? ""}`, htmlFor: o ?? l, children: [
|
|
42
|
+
I,
|
|
44
43
|
" ",
|
|
45
|
-
|
|
44
|
+
p && /* @__PURE__ */ r("span", { className: "iru-text-laba-red-08", children: "*" })
|
|
46
45
|
] }),
|
|
47
46
|
/* @__PURE__ */ t("div", { className: e["end-icon"], children: [
|
|
48
47
|
typeof a == "function" && a(),
|
|
@@ -53,13 +52,13 @@ const E = v((m, p) => {
|
|
|
53
52
|
"label",
|
|
54
53
|
{
|
|
55
54
|
className: `${e["label-error"]}
|
|
56
|
-
${c.disabled ? e.disabled : ""} ${
|
|
55
|
+
${c.disabled ? e.disabled : ""} ${u ?? ""}`,
|
|
57
56
|
children: i
|
|
58
57
|
}
|
|
59
58
|
)
|
|
60
59
|
] });
|
|
61
60
|
});
|
|
62
|
-
|
|
61
|
+
F.displayName = "InputFloatingInner";
|
|
63
62
|
export {
|
|
64
|
-
|
|
63
|
+
F as default
|
|
65
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react/jsx-runtime"),n=require("react-number-format"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react/jsx-runtime"),n=require("react-number-format"),i=require("../../config/bigNumber/index.cjs"),o=require("../../utils/common.cjs"),d=({max:r,min:u,selectedText:s="Rp0",onChange:e,onFocusInput:a,...l})=>f.jsx(n.NumericFormat,{isAllowed:t=>r!==void 0&&o.isAccurateBigNumber(r)&&i.BigNumber(t.value).isGreaterThan(r)?(typeof e=="function"&&e({target:{value:i.BigNumber(r).toString()}}),!1):u!==void 0&&o.isAccurateBigNumber(u)&&i.BigNumber(t.value).isLessThan(u)?(typeof e=="function"&&e({target:{value:i.BigNumber(u).toString()}}),!1):!0,onValueChange:(t,{source:c})=>{typeof e=="function"&&c.includes("event")&&e({target:{value:t.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:t=>{t?.target?.value===s&&(typeof a=="function"?a(""):typeof e=="function"&&e({target:{value:""}}))},...l});exports.default=d;
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { NumericFormat as p } from "react-number-format";
|
|
3
|
-
import { BigNumber as
|
|
4
|
-
import { isAccurateBigNumber as
|
|
3
|
+
import { BigNumber as i } from "../../config/bigNumber/index.mjs";
|
|
4
|
+
import { isAccurateBigNumber as o } from "../../utils/common.mjs";
|
|
5
5
|
const S = ({
|
|
6
6
|
max: r,
|
|
7
7
|
min: u,
|
|
8
|
-
selectedText:
|
|
9
|
-
onChange:
|
|
10
|
-
onFocusInput:
|
|
11
|
-
...
|
|
8
|
+
selectedText: f = "Rp0",
|
|
9
|
+
onChange: e,
|
|
10
|
+
onFocusInput: a,
|
|
11
|
+
...l
|
|
12
12
|
}) => /* @__PURE__ */ c(
|
|
13
13
|
p,
|
|
14
14
|
{
|
|
15
|
-
isAllowed: (
|
|
16
|
-
onValueChange: (
|
|
17
|
-
typeof
|
|
15
|
+
isAllowed: (t) => r !== void 0 && o(r) && i(t.value).isGreaterThan(r) ? (typeof e == "function" && e({ target: { value: i(r).toString() } }), !1) : u !== void 0 && o(u) && i(t.value).isLessThan(u) ? (typeof e == "function" && e({ target: { value: i(u).toString() } }), !1) : !0,
|
|
16
|
+
onValueChange: (t, { source: s }) => {
|
|
17
|
+
typeof e == "function" && s.includes("event") && e({ target: { value: t.value } });
|
|
18
18
|
},
|
|
19
19
|
decimalSeparator: ",",
|
|
20
20
|
thousandSeparator: ".",
|
|
21
21
|
decimalScale: 2,
|
|
22
22
|
valueIsNumericString: !0,
|
|
23
23
|
thousandsGroupStyle: "thousand",
|
|
24
|
-
onFocus: (
|
|
25
|
-
|
|
26
|
-
((i = e == null ? void 0 : e.target) == null ? void 0 : i.value) === l && (typeof o == "function" ? o("") : typeof t == "function" && t({ target: { value: "" } }));
|
|
24
|
+
onFocus: (t) => {
|
|
25
|
+
t?.target?.value === f && (typeof a == "function" ? a("") : typeof e == "function" && e({ target: { value: "" } }));
|
|
27
26
|
},
|
|
28
|
-
...
|
|
27
|
+
...l
|
|
29
28
|
}
|
|
30
29
|
);
|
|
31
30
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("react"),
|
|
2
|
-
${q.configPagination.fonts[S].typographyButtonLabel}`,disabled:e===
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("react"),i=require("./style.module.scss.cjs"),m=require("../../utils/common.cjs"),G=require("../Calendar/CalendarYear.cjs"),W=require("../Popover/Popover.cjs"),X=require("../Button/Button.cjs"),q=require("./Pagination.config.cjs"),x=(t,o)=>{const c=o-t+1;return Array.from({length:c},(r,N)=>N+t)},k={"en-US":{"Rows per page:":"Rows per page:",of:"of","Go to:":"Go to:"},"id-ID":{"Rows per page:":"Baris per halaman:",of:"dari","Go to:":"Go to:"},"zh-CN":{"Rows per page:":"每页行数:",of:"共","Go to:":"跳至:"},"nl-NL":{"Rows per page:":"Rijen per pagina:",of:"van","Go to:":"Ga naar:"}},Z=({totalData:t,totalPage:o,pageNumber:c,pageSize:r,className:N,id:u="1ru-pagination",kind:E="box",prevIcon:g,nextIcon:p,onChange:j,optionPageSize:I=[25,50,75,100],offset:L=1.5,zIndex:O,withGotoPage:A=!1,withMorePage:M=!0,withOptionPageSize:F=!1,locale:$="id-ID",fonts:S="inter"})=>{const w=l.useRef(null),[s,C]=l.useState(c),[T,y]=l.useState(c.toString()),f=1,U=(s-1)*r+1,_=r*s,Y=t?`${m.formatNumber(U,"decimal")}-${_>=t?m.formatNumber(t,"decimal"):m.formatNumber(_,"decimal")}`:0,H=l.useMemo(()=>{const e=Math.ceil(t/r);if(f+5>=e)return x(1,e);const d=Math.max(s-f,1),B=Math.min(s+f,e),R=d>2,P=B<e-2,V=1,Q=e;if(!R&&P){const b=3+2*f;return[...x(1,b),"mr",e]}if(R&&!P){const b=3+2*f,v=x(e-b+1,e);return[V,"ml",...v]}if(R&&P){const b=x(d,B);return[V,"ml",...b,"mr",Q]}},[t,r,f,s]),h=e=>{typeof j=="function"&&(j(e),C(e.pageNumber),y(e.pageNumber.toString()))},J=e=>{if(typeof j=="function"&&M){if(e==="ml"){const d=s-5;C(d<1?1:s-5)}else if(e==="mr"){const d=s+5;C(d>o?o:s+5)}}},K=e=>{y(e);const a=Number(e);a>0&&a<=o&&h({pageSize:r,totalData:t,totalPage:o,pageNumber:a})};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{id:u,className:`${q.configPagination.kind[E]} ${q.configPagination.fonts[S].value} ${N}`,children:[n.jsxs("div",{className:i.default["pagination-size"],children:[n.jsx("span",{children:k[$]["Rows per page:"]}),F&&n.jsx(X.default,{id:`${u}-option-size`,variants:"ghost-blue-gray-100-bg_white",size:"xs",endIcon:n.jsx(G.ChevronDownIcon,{className:"!iru-text-gray-500 !iru-w-[14px] !iru-h-[14px] iru-mx-0.5"}),className:"!iru-rounded-md !iru-min-w-[60px] iru-justify-between",onClick:e=>w.current?.handlerShow(e),children:m.formatNumber(r,"decimal")}),n.jsxs("span",{children:[Y," ",k[$].of," ",m.formatNumber(t,"decimal")]})]}),n.jsxs("div",{className:i.default["navigation-container"],children:[n.jsx("button",{id:`${u}-button-prev`,className:`${i.default["button-prev"]}`,disabled:s===1,onClick:()=>h({pageSize:r,totalData:t,totalPage:o,pageNumber:c-1}),children:typeof g=="function"||l.isValidElement(g)?l.isValidElement(g)?g:g():n.jsx(G.ChevronDownIcon,{className:"iru-rotate-90 !iru-text-gray-500 !iru-w-[14px] !iru-h-[14px]"})}),(H??[]).map((e,a)=>{if(typeof e!="number"){const d=["ml","mr"].includes(e);return n.jsx("button",{className:i.default["button-container"],disabled:!M,onClick:()=>J(e),children:d?"...":e},a)}return n.jsx("button",{id:`${u}-button-${e}`,className:`${e===c?i.default["pagination-active"]:""} ${i.default["button-container"]}
|
|
2
|
+
${q.configPagination.fonts[S].typographyButtonLabel}`,disabled:e===c,onClick:()=>h({pageSize:r,totalData:t,totalPage:o,pageNumber:e}),children:m.formatNumber(e,"decimal")},a)}),n.jsx("button",{id:`${u}-button-next`,className:`${i.default["button-next"]}`,disabled:s===o||!o,onClick:()=>h({pageSize:r,totalData:t,totalPage:o,pageNumber:c+1}),children:typeof p=="function"||l.isValidElement(p)?l.isValidElement(p)?p:p():n.jsx(G.ChevronDownIcon,{className:"-iru-rotate-90 !iru-text-gray-500 !iru-w-[14px] !iru-h-[14px]"})}),A&&n.jsxs("div",{className:i.default["goto-page"],children:[n.jsx("span",{children:k[$]["Go to:"]}),n.jsx("input",{id:`${u}-goto-page`,type:"number",className:i.default["goto-page-input"],value:T,onChange:e=>K(e.target.value),onBlur:()=>y(s.toString())})]})]})]}),n.jsx(W.default,{floatingOptions:{placement:"bottom-end"},ref:w,className:i.default["options-size"],offset:L,zIndex:O,id:`${u}-popover-options-size`,children:I.map((e,a)=>n.jsx("p",{id:`${u}-option-size-${e}`,className:`${i.default.option} ${e===r?i.default.active:""}`,onClick:()=>{h({totalData:t,totalPage:o,pageSize:e,pageNumber:1}),w.current?.setShow(!1)},children:m.formatNumber(e,"decimal")},a))})]})};exports.default=Z;
|