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.
Files changed (98) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/components/Alert/index.cjs +1 -1
  3. package/dist/components/Alert/index.mjs +40 -40
  4. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
  5. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
  6. package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
  7. package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
  8. package/dist/components/Calendar/Calendar.cjs +1 -1
  9. package/dist/components/Calendar/Calendar.mjs +98 -100
  10. package/dist/components/Calendar/CalendarMonth.cjs +1 -1
  11. package/dist/components/Calendar/CalendarMonth.mjs +41 -42
  12. package/dist/components/Calendar/CalendarRange.cjs +1 -1
  13. package/dist/components/Calendar/CalendarRange.mjs +59 -61
  14. package/dist/components/Calendar/CalendarYear.cjs +2 -2
  15. package/dist/components/Calendar/CalendarYear.mjs +37 -38
  16. package/dist/components/Chart/DoughnutChart.cjs +1 -1
  17. package/dist/components/Chart/DoughnutChart.mjs +93 -96
  18. package/dist/components/Chart/GradientBarChart.cjs +1 -1
  19. package/dist/components/Chart/GradientBarChart.mjs +80 -81
  20. package/dist/components/Chart/GradientLineChart.cjs +1 -1
  21. package/dist/components/Chart/GradientLineChart.mjs +50 -51
  22. package/dist/components/Chart/LineChart.cjs +1 -1
  23. package/dist/components/Chart/LineChart.mjs +23 -23
  24. package/dist/components/Chart/PieChart.cjs +1 -1
  25. package/dist/components/Chart/PieChart.mjs +45 -48
  26. package/dist/components/Collapse/Collapse.cjs +1 -1
  27. package/dist/components/Collapse/Collapse.mjs +23 -24
  28. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  29. package/dist/components/DatePicker/DatePicker.mjs +86 -89
  30. package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
  31. package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
  32. package/dist/components/DatePicker/FilterDate.cjs +1 -1
  33. package/dist/components/DatePicker/FilterDate.mjs +107 -110
  34. package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
  35. package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
  36. package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
  37. package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
  38. package/dist/components/Input/InputFloatingInner.cjs +5 -5
  39. package/dist/components/Input/InputFloatingInner.mjs +24 -25
  40. package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
  41. package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
  42. package/dist/components/Pagination/Pagination.cjs +2 -2
  43. package/dist/components/Pagination/Pagination.mjs +76 -80
  44. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
  45. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
  46. package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
  47. package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
  48. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  49. package/dist/components/Sidebar/Sidebar.mjs +65 -68
  50. package/dist/components/Step/Step.cjs +5 -5
  51. package/dist/components/Step/Step.mjs +52 -52
  52. package/dist/components/Table/Table.cjs +3 -3
  53. package/dist/components/Table/Table.mjs +275 -298
  54. package/dist/components/Table/TableSubMobile.cjs +1 -1
  55. package/dist/components/Table/TableSubMobile.mjs +32 -35
  56. package/dist/components/Tabs/Tabs.cjs +8 -8
  57. package/dist/components/Tabs/Tabs.mjs +66 -70
  58. package/dist/components/Textarea/Textarea.cjs +7 -7
  59. package/dist/components/Textarea/Textarea.mjs +47 -50
  60. package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
  61. package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
  62. package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
  63. package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
  64. package/dist/components/TimeRange/TimeRange.cjs +1 -1
  65. package/dist/components/TimeRange/TimeRange.mjs +88 -91
  66. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  67. package/dist/components/Tooltip/Tooltip.mjs +44 -46
  68. package/dist/components/Upload/UploadFile.cjs +1 -1
  69. package/dist/components/Upload/UploadFile.mjs +50 -54
  70. package/dist/components/Upload/UploadImage.cjs +3 -3
  71. package/dist/components/Upload/UploadImage.mjs +62 -68
  72. package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
  73. package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
  74. package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
  75. package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
  76. package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
  77. package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
  78. package/dist/config/components/tinymce.cjs +2 -2
  79. package/dist/config/components/tinymce.mjs +3 -3
  80. package/dist/hooks/useCountdown.cjs +1 -1
  81. package/dist/hooks/useCountdown.mjs +15 -15
  82. package/dist/hooks/useDebounce.cjs +1 -0
  83. package/dist/hooks/useDebounce.mjs +27 -0
  84. package/dist/hooks/useOtpInput.cjs +1 -1
  85. package/dist/hooks/useOtpInput.mjs +47 -51
  86. package/dist/hooks/usePacked.cjs +1 -0
  87. package/dist/hooks/usePacked.mjs +56 -0
  88. package/dist/index.cjs +1 -1
  89. package/dist/index.mjs +52 -48
  90. package/dist/package.json.cjs +1 -1
  91. package/dist/package.json.d.ts +5 -4
  92. package/dist/package.json.mjs +1 -1
  93. package/dist/src/hooks/index.d.ts +4 -2
  94. package/dist/src/hooks/useDebounce.d.ts +61 -0
  95. package/dist/src/hooks/usePacked.d.ts +84 -0
  96. package/dist/utils/common.cjs +1 -1
  97. package/dist/utils/common.mjs +172 -173
  98. package/package.json +4 -4
@@ -1,77 +1,75 @@
1
- import { jsxs as I, Fragment as $, jsx as n } from "react/jsx-runtime";
2
- import R from "react";
3
- import { useLocale as V, I18nProvider as j } from "react-aria";
4
- import { createCalendar as y, parseDate as H } from "@internationalized/date";
5
- import N from "../Popover/Popover.mjs";
6
- import O from "../Calendar/Calendar.mjs";
7
- const i = (t) => {
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 = H(new Date(r.setHours(r.getHours() + 7)).toISOString().slice(0, 10))), o;
11
- }, Y = ({
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: m = "month",
16
- minDate: c,
17
- maxDate: s,
18
- className: p,
19
- classNameButton: h,
20
- onChange: d,
21
- buttonClick: f,
22
- id: u = "date-picker",
23
- idPopover: g = "date-picker-popover",
24
- floatingOptions: v = {},
25
- offsetPopover: P = 5,
26
- zIndexPopper: w = 1,
27
- hiddenHeader: D
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: S } = V(), l = R.useRef(null), k = i(c), x = i(s), C = (e) => {
30
- var a;
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($, { children: [
34
- /* @__PURE__ */ n(
32
+ return /* @__PURE__ */ C(I, { children: [
33
+ /* @__PURE__ */ a(
35
34
  "div",
36
35
  {
37
- id: u,
36
+ id: h,
38
37
  onClick: (e) => {
39
- var a;
40
- e.stopPropagation(), (a = l.current) == null || a.handlerShow(e);
38
+ e.stopPropagation(), i.current?.handlerShow(e);
41
39
  },
42
- className: h,
43
- children: typeof f == "function" ? f({ month: t, year: o }) : "Pilih Tanggal"
40
+ className: p,
41
+ children: typeof d == "function" ? d({ month: t, year: o }) : "Pilih Tanggal"
44
42
  }
45
43
  ),
46
- /* @__PURE__ */ n("div", { className: p ?? "", children: /* @__PURE__ */ n(
47
- N,
44
+ /* @__PURE__ */ a("div", { className: m ?? "", children: /* @__PURE__ */ a(
45
+ H,
48
46
  {
49
- zIndex: w,
50
- ref: l,
51
- offset: P,
52
- id: g,
53
- floatingOptions: { placement: "bottom-end", ...v },
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__ */ n(j, { locale: "id-ID", children: /* @__PURE__ */ n(
56
- O,
53
+ children: /* @__PURE__ */ a(V, { locale: "id-ID", children: /* @__PURE__ */ a(
54
+ N,
57
55
  {
58
- minValue: k,
59
- maxValue: x,
60
- minDate: c,
61
- maxDate: s,
62
- activeType: r.length === 1 ? r[0] : m,
63
- locale: S,
64
- value: i(`${o}/${t}/1`),
65
- createCalendar: y,
66
- defaultValue: i(`${o}/${t}/1`),
67
- onChange: C,
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: D
72
+ hiddenHeader: w
75
73
  }
76
74
  ) })
77
75
  }
@@ -79,5 +77,5 @@ const i = (t) => {
79
77
  ] });
80
78
  };
81
79
  export {
82
- Y as default
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"),p=require("react"),m=require("../../utils/common.cjs"),b=require("../../hooks/useDeepCompareEffect.cjs"),V=(i,f,l)=>{if((f==null?void 0:f.length)>0){const r={};return f.forEach(e=>{i[e]&&(r[e]=i[e]),l&&i[`${l}${e}`]&&(r[`${l}${e}`]=i[`${l}${e}`])}),r}return i},A=p.forwardRef((i,f)=>{const{children:l,onChange:r,prefixNativeValue:e="",defaultNativeValue:C,defaultValue:O,mountedExecuteChange:N=!0,keepKeys:g=[],resetPagination:P=!0,keyPageNumber:q="pageNumber",triggerReset:z={},reset:$}=i,y=P?{[q]:1}:{},[s,d]=p.useState(V(O??{},g,"")),[u,h]=p.useState(m.sanitizeObjectKeyPrefix(e,V(C??{},g,e))),[S,F]=p.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,...y},{...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,...y},{...u,...o}),d(n=>({...n,...t})),h(n=>({...n,...o}))};return b.useDeepCompareEffect(()=>{!S&&typeof r=="function"&&N&&(r(s,u),F(!0))},[s,u,S,N]),b.useDeepCompareEffect(()=>{$&&(h(m.sanitizeObjectKeyPrefix(e,V(C??{},g,e))),d(V(O??{},g,"")))},[$,z]),p.useImperativeHandle(f,()=>({nativeValue:u,value:s,handlerOnChange:D,handlerOnChangeNative:E}),[b.useDeepCompareMemoize(s),b.useDeepCompareMemoize(u)]),v.jsx(v.Fragment,{children:l({handlerOnChange:D,handlerOnChangeNative:E,value:s,nativeValue:u})})});A.displayName="FilterContainer";exports.default=A;
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 p from "react";
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, c, l) => {
6
- if ((c == null ? void 0 : c.length) > 0) {
5
+ const g = (i, p, c) => {
6
+ if (p?.length > 0) {
7
7
  const r = {};
8
- return c.forEach((e) => {
9
- i[e] && (r[e] = i[e]), l && i[`${l}${e}`] && (r[`${l}${e}`] = i[`${l}${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 = p.forwardRef((i, c) => {
13
+ }, M = l.forwardRef((i, p) => {
14
14
  const {
15
- children: l,
15
+ children: c,
16
16
  onChange: r,
17
17
  prefixNativeValue: e = "",
18
- defaultNativeValue: O,
19
- defaultValue: d,
20
- mountedExecuteChange: j = !0,
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: C
26
- } = i, N = v ? { [D]: 1 } : {}, [s, V] = p.useState(g(d ?? {}, m, "")), [f, h] = p.useState(
27
- S(e, g(O ?? {}, m, e))
28
- ), [$, P] = p.useState(!1), x = (t, a) => {
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
- }, y = (t, a, u, o) => {
33
+ }, x = (t, a, u, o) => {
34
34
  let n = t;
35
- const R = x(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, ...N }, { ...f, ...R }), V((b) => ({ ...b, [a]: n })), h((b) => ({ ...b, ...R }));
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 = x(e, { ...a ?? t });
39
- typeof r == "function" && r({ ...s, ...t, ...N }, { ...f, ...o }), V((n) => ({ ...n, ...t })), h((n) => ({ ...n, ...o }));
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
- !$ && typeof r == "function" && j && (r(s, f), P(!0));
43
- }, [s, f, $, j]), E(() => {
44
- C && (h(
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(O ?? {}, m, e)
47
+ g(y ?? {}, m, e)
48
48
  )
49
- ), V(g(d ?? {}, m, "")));
50
- }, [C, K]), p.useImperativeHandle(c, () => ({ nativeValue: f, value: s, handlerOnChange: y, handlerOnChangeNative: A }), [
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: l({
54
- handlerOnChange: y,
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"),y=require("./InputFloatingInner.config.cjs"),d=s.forwardRef((u,f)=>{var c;const{isRequired:m,classNameContainer:p,classNameLabelError:I,classNameLabel:N,className:$,name:i,id:r,label:b,type:g="text",startIcon:n,endIcon:a,error:l,sizeInput:x="large",...o}=u,h=()=>typeof n=="function"||s.isValidElement(n),j=()=>typeof a=="function"||s.isValidElement(a);return t.jsxs("div",{className:`${e.default.container} ${(c=y.configInputFloatingInner.size)==null?void 0:c[x]} ${p??""}`,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
- ${h()?e.default["isset-left-icon"]:""}
3
- ${j()?e.default["isset-right-icon"]:""}
4
- ${$??""}`,ref:f,type:g,...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} ${N??""}`,htmlFor:r??i,children:[b," ",m&&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:""} ${I??""}`,children:l})]})});d.displayName="InputFloatingInner";exports.default=d;
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 v, isValidElement as s } from "react";
2
+ import { forwardRef as x, isValidElement as s } from "react";
3
3
  import e from "./InputFloatingInner.module.scss.mjs";
4
- import { configInputFloatingInner as F } from "./InputFloatingInner.config.mjs";
5
- const E = v((m, p) => {
6
- var d;
4
+ import { configInputFloatingInner as v } from "./InputFloatingInner.config.mjs";
5
+ const F = x((d, m) => {
7
6
  const {
8
- isRequired: f,
9
- classNameContainer: u,
10
- classNameLabelError: N,
11
- classNameLabel: $,
12
- className: I,
7
+ isRequired: p,
8
+ classNameContainer: f,
9
+ classNameLabelError: u,
10
+ classNameLabel: N,
11
+ className: $,
13
12
  name: l,
14
13
  id: o,
15
- label: b,
16
- type: h = "text",
14
+ label: I,
15
+ type: b = "text",
17
16
  startIcon: n,
18
17
  endIcon: a,
19
18
  error: i,
20
- sizeInput: y = "large",
19
+ sizeInput: h = "large",
21
20
  ...c
22
- } = m, g = () => typeof n == "function" || s(n), x = () => typeof a == "function" || s(a);
23
- return /* @__PURE__ */ t("div", { className: `${e.container} ${(d = F.size) == null ? void 0 : d[y]} ${u ?? ""}`, children: [
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
- ${g() ? e["isset-left-icon"] : ""}
31
- ${x() ? e["isset-right-icon"] : ""}
32
- ${I ?? ""}`,
33
- ref: p,
34
- type: h,
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} ${$ ?? ""}`, htmlFor: o ?? l, children: [
43
- b,
41
+ /* @__PURE__ */ t("label", { className: `${e.label} ${N ?? ""}`, htmlFor: o ?? l, children: [
42
+ I,
44
43
  " ",
45
- f && /* @__PURE__ */ r("span", { className: "iru-text-laba-red-08", children: "*" })
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 : ""} ${N ?? ""}`,
55
+ ${c.disabled ? e.disabled : ""} ${u ?? ""}`,
57
56
  children: i
58
57
  }
59
58
  )
60
59
  ] });
61
60
  });
62
- E.displayName = "InputFloatingInner";
61
+ F.displayName = "InputFloatingInner";
63
62
  export {
64
- E as default
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"),a=require("../../config/bigNumber/index.cjs"),s=require("../../utils/common.cjs"),d=({max:r,min:u,selectedText:l="Rp0",onChange:e,onFocusInput:o,...c})=>f.jsx(n.NumericFormat,{isAllowed:t=>r!==void 0&&s.isAccurateBigNumber(r)&&a.BigNumber(t.value).isGreaterThan(r)?(typeof e=="function"&&e({target:{value:a.BigNumber(r).toString()}}),!1):u!==void 0&&s.isAccurateBigNumber(u)&&a.BigNumber(t.value).isLessThan(u)?(typeof e=="function"&&e({target:{value:a.BigNumber(u).toString()}}),!1):!0,onValueChange:(t,{source:i})=>{typeof e=="function"&&i.includes("event")&&e({target:{value:t.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:t=>{var i;((i=t==null?void 0:t.target)==null?void 0:i.value)===l&&(typeof o=="function"?o(""):typeof e=="function"&&e({target:{value:""}}))},...c});exports.default=d;
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 a } from "../../config/bigNumber/index.mjs";
4
- import { isAccurateBigNumber as f } from "../../utils/common.mjs";
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: l = "Rp0",
9
- onChange: t,
10
- onFocusInput: o,
11
- ...s
8
+ selectedText: f = "Rp0",
9
+ onChange: e,
10
+ onFocusInput: a,
11
+ ...l
12
12
  }) => /* @__PURE__ */ c(
13
13
  p,
14
14
  {
15
- isAllowed: (e) => r !== void 0 && f(r) && a(e.value).isGreaterThan(r) ? (typeof t == "function" && t({ target: { value: a(r).toString() } }), !1) : u !== void 0 && f(u) && a(e.value).isLessThan(u) ? (typeof t == "function" && t({ target: { value: a(u).toString() } }), !1) : !0,
16
- onValueChange: (e, { source: i }) => {
17
- typeof t == "function" && i.includes("event") && t({ target: { value: e.value } });
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: (e) => {
25
- var i;
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
- ...s
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"),r=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,s)=>{const u=s-t+1;return Array.from({length:u},(a,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:s,pageNumber:u,pageSize:a,className:N,id:d="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),[i,C]=l.useState(u),[T,y]=l.useState(u.toString()),f=1,U=(i-1)*a+1,_=a*i,Y=t?`${m.formatNumber(U,"decimal")}-${_>=t?m.formatNumber(t,"decimal"):m.formatNumber(_,"decimal")}`:0,H=l.useMemo(()=>{const e=Math.ceil(t/a);if(f+5>=e)return x(1,e);const c=Math.max(i-f,1),B=Math.min(i+f,e),R=c>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(c,B);return[V,"ml",...b,"mr",Q]}},[t,a,f,i]),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 c=i-5;C(c<1?1:i-5)}else if(e==="mr"){const c=i+5;C(c>s?s:i+5)}}},K=e=>{y(e);const o=Number(e);o>0&&o<=s&&h({pageSize:a,totalData:t,totalPage:s,pageNumber:o})};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{id:d,className:`${q.configPagination.kind[E]} ${q.configPagination.fonts[S].value} ${N}`,children:[n.jsxs("div",{className:r.default["pagination-size"],children:[n.jsx("span",{children:k[$]["Rows per page:"]}),F&&n.jsx(X.default,{id:`${d}-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=>{var o;return(o=w.current)==null?void 0:o.handlerShow(e)},children:m.formatNumber(a,"decimal")}),n.jsxs("span",{children:[Y," ",k[$].of," ",m.formatNumber(t,"decimal")]})]}),n.jsxs("div",{className:r.default["navigation-container"],children:[n.jsx("button",{id:`${d}-button-prev`,className:`${r.default["button-prev"]}`,disabled:i===1,onClick:()=>h({pageSize:a,totalData:t,totalPage:s,pageNumber:u-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,o)=>{if(typeof e!="number"){const c=["ml","mr"].includes(e);return n.jsx("button",{className:r.default["button-container"],disabled:!M,onClick:()=>J(e),children:c?"...":e},o)}return n.jsx("button",{id:`${d}-button-${e}`,className:`${e===u?r.default["pagination-active"]:""} ${r.default["button-container"]}
2
- ${q.configPagination.fonts[S].typographyButtonLabel}`,disabled:e===u,onClick:()=>h({pageSize:a,totalData:t,totalPage:s,pageNumber:e}),children:m.formatNumber(e,"decimal")},o)}),n.jsx("button",{id:`${d}-button-next`,className:`${r.default["button-next"]}`,disabled:i===s||!s,onClick:()=>h({pageSize:a,totalData:t,totalPage:s,pageNumber:u+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:r.default["goto-page"],children:[n.jsx("span",{children:k[$]["Go to:"]}),n.jsx("input",{id:`${d}-goto-page`,type:"number",className:r.default["goto-page-input"],value:T,onChange:e=>K(e.target.value),onBlur:()=>y(i.toString())})]})]})]}),n.jsx(W.default,{floatingOptions:{placement:"bottom-end"},ref:w,className:r.default["options-size"],offset:L,zIndex:O,id:`${d}-popover-options-size`,children:I.map((e,o)=>n.jsx("p",{id:`${d}-option-size-${e}`,className:`${r.default.option} ${e===a?r.default.active:""}`,onClick:()=>{var c;h({totalData:t,totalPage:s,pageSize:e,pageNumber:1}),(c=w.current)==null||c.setShow(!1)},children:m.formatNumber(e,"decimal")},o))})]})};exports.default=Z;
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;