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
@@ -0,0 +1,84 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * [ID] : Interface untuk opsi konfigurasi hook usePacked.
4
+ * [EN] : Interface for usePacked hook configuration options.
5
+ */
6
+ export interface IUsePackedOptions {
7
+ /**
8
+ * [ID] : Jumlah kolom layout.
9
+ * [EN] : Layout column count.
10
+ */
11
+ columns: number;
12
+ /**
13
+ * [ID] : Jarak horizontal antar item.
14
+ * [EN] : Horizontal gap between items.
15
+ */
16
+ gapX: number;
17
+ /**
18
+ * [ID] : Jarak vertikal antar item.
19
+ * [EN] : Vertical gap between items.
20
+ */
21
+ gapY: number;
22
+ /**
23
+ * [ID] : Aktifkan animasi transisi (opsional).
24
+ * [EN] : Enable transition animation (optional).
25
+ */
26
+ animationEnabled?: boolean;
27
+ /**
28
+ * [ID] : Map nama breakpoint ke lebar minimum (opsional).
29
+ * [EN] : Map of breakpoint name to minimum width (optional).
30
+ */
31
+ breakpoints?: Record<string, number>;
32
+ /**
33
+ * [ID] : Orientasi penempatan item (opsional).
34
+ * [EN] : Item placement orientation (optional).
35
+ */
36
+ orientation?: 'top-bottom' | 'bottom-top';
37
+ /**
38
+ * [ID] : Arah layout (opsional).
39
+ * [EN] : Layout direction (optional).
40
+ */
41
+ direction?: 'ltr' | 'rtl';
42
+ /**
43
+ * [ID] : Waktu debounce untuk resize event dalam milidetik (opsional, default: 150).
44
+ * [EN] : Debounce wait for resize event in milliseconds (optional, default: 150).
45
+ */
46
+ debounceResize?: number;
47
+ }
48
+ /**
49
+ * [ID] : Interface untuk return value hook usePacked.
50
+ * [EN] : Interface for usePacked hook return value.
51
+ */
52
+ export interface IUsePackedReturn {
53
+ /**
54
+ * [ID] : Referensi elemen kontainer DOM.
55
+ * [EN] : DOM container element reference.
56
+ */
57
+ containerRef: React.RefObject<HTMLDivElement | null>;
58
+ /**
59
+ * [ID] : Tinggi kontainer yang dihitung.
60
+ * [EN] : Calculated container height.
61
+ */
62
+ containerHeight: number;
63
+ /**
64
+ * [ID] : Fungsi untuk menghitung ulang layout secara manual.
65
+ * [EN] : Function to manually recalculate layout.
66
+ */
67
+ recalculate: () => void;
68
+ }
69
+ /**
70
+ * [ID] : Type fungsi hook usePacked.
71
+ * [EN] : usePacked hook function type.
72
+ * @param options - [ID] : Opsi konfigurasi layout. [EN] : Layout configuration options.
73
+ * @param dependencies - [ID] : Daftar dependensi untuk memicu hitung ulang.
74
+ * [EN] : Dependency list to trigger recalculation.
75
+ * @returns [ID] : Referensi kontainer, tinggi kontainer, dan fungsi hitung ulang.
76
+ * [EN] : Container ref, container height, and recalculate function.
77
+ */
78
+ export type TUsePacked = (options: IUsePackedOptions, dependencies?: React.DependencyList) => IUsePackedReturn;
79
+ /**
80
+ * [ID] : Hook untuk mengatur layout packed/grid dengan penempatan item otomatis berdasarkan kolom terpendek.
81
+ * [EN] : Hook to manage packed/grid layout with automatic item placement based on shortest column.
82
+ */
83
+ declare const usePacked: TUsePacked;
84
+ export default usePacked;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("date-fns"),g=require("date-fns/locale"),N=require("../config/bigNumber/index.cjs"),b=require("node-forge"),B=e=>{try{return N.BigNumber(e).isFinite()}catch{return!1}},K=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const r=Number(e);return Number.isFinite(r)}return!1};function S(e,r){const{minimumFractionDigits:n,instance:t=!1,ignoreFractionLimit:s=!1}=r||{};let{maximumFractionDigits:i=2}=r||{};B(e)||(e="0"),!s&&n!==void 0&&n>i&&(i=n);let c="";if(s?c=N.BigNumber(e).toString():c=N.BigNumber(e).toFixed(i),c.includes(".")&&!s){const[o,u]=c.split(".");let a=u.replace(/0+$/,"");n!==void 0&&n>=0&&(a=a.padEnd(n,"0")),c=a?`${o}.${a}`:o}return t?N.BigNumber(c):c}const D=(e,r=2)=>{let n=parseFloat(K(e)?e:0);return n=(+(Math.round(n+"e"+r)+"e-"+r)).toFixed(r),n=Number(n),n};function V(e,r="currency",n){const{minimumFractionDigits:t=0,locale:s="id-ID",currency:i="IDR",withSpace:c=!1}=n||{},o=new Intl.NumberFormat(s,{style:r,currency:i,minimumFractionDigits:t}).format(D(e,t>0?t:2));return c?o:o.replace(/\s/g,"")}const w=(e,r,n,t)=>{const s={"id-ID":g.id,"zh-CN":g.zhCN,"en-US":g.enUS,"nl-BE":g.nl};let i=n??"-";return e&&!isNaN(new Date(e).getTime())&&(i=$.format(e,r??"dd/MM/yyyy",{locale:s[t??"id-ID"]})),i},C=(e,r,n,t,s,i)=>{const c={"id-ID":g.id,"zh-CN":g.zhCN,"en-US":g.enUS,"nl-NL":g.nl};if(e&&!isNaN(new Date(e).getTime())){const o=$.format(e,n??"dd/MM/yyyy",{locale:c[i??"id-ID"]});if(r&&!isNaN(new Date(r).getTime())){const u=$.format(r,n??"dd/MM/yyyy",{locale:c[i??"id-ID"]});return o===u?o:`${o}${t??"-"}${u}`}return o}return s??"-"},T=(e,r)=>e.reduce((n,t)=>{const s=String(t[r]);return n[s]||(n[s]=[]),n[s].push(t),n},{}),L=({value:e,keyDate:r="date",keyFormat:n="formatDate",format:t="dd/MM/yyyy"})=>{const s=e.map(i=>({...i,[n]:w(i[r],t)}));return T(s,n)},R=e=>(Object.keys(e).forEach(r=>{["",null,void 0,[],{}].includes(e[r])&&delete e[r]}),e),P=(e,r)=>{var l,d;const n=/^-?\d+[0-9.,]*$/,t=/([.])(?=.*\1)/,s=/([,])(?=.*\1)/,i=((l=e.split(",")[0])==null?void 0:l.trim())||"",c=((d=e.split(",")[1])==null?void 0:d.trim())||"",o=!t.test(i)&&(i==="-"||n.test(i)||!i),u=!t.test(c)&&(c==="-"||n.test(c)||!c),a=(y,p,F)=>{let A=y;const M=y.split(".")[0];return isNaN(parseFloat(M.split(".")[0]))||(parseFloat(M.split(".")[0])<=p?A=`${p}`:parseFloat(M)>=F&&(A=`${F}`)),A},f=a(i,(r==null?void 0:r.latMin)??-85,(r==null?void 0:r.latMax)??85),m=a(c,(r==null?void 0:r.longMin)??-180,(r==null?void 0:r.longMax)??180);return{latitude:f,longitude:m,latlong:`${f}${e.includes(",")?","+m:""}`,isValid:!s.test(e)&&o&&u}},q=(e,r)=>e?Object.fromEntries(Object.entries(r).filter(([t])=>t.startsWith(e))):r,x=(e,r)=>e.map(n=>n[r]).join(","),E=(e,r)=>e.map(n=>n[r]),v=(e,r)=>Array.isArray(e)?e==null?void 0:e.map((n,t,s)=>typeof r=="function"?r(n,t,s):n):[],z=(e,r,n,t,s)=>Array.isArray(e)?{[r]:e==null?void 0:e.map((i,c,o)=>typeof n=="function"?n(i,c,o):i),[`${r}-val-be`]:i=>t==="array-of-object-to-array"?E(i,s):x(i,s)}:{[r]:"",[`${r}-val-be`]:()=>""};function I(e,r){if(e===r)return!0;if(typeof e!="object"||typeof r!="object"||e===null||r===null)return!1;const n=Object.keys(e),t=Object.keys(r);if(n.length!==t.length)return!1;for(const s of n)if(!t.includes(s)||!I(e[s],r[s]))return!1;return!0}function J(e,r={maxTime:"hour"}){const{maxTime:n="hour"}=r,t=u=>u<10?`0${u}`:u;let s=t(0),i=t(0);const c=t(Math.floor(e%3600/60)),o=t(Math.floor(e%60));return n==="hour"?i=t(Math.floor(e/3600)):n==="day"&&(s=t(Math.floor(e/(3600*24))),i=t(Math.floor(e%(3600*24)/3600))),{day:s,hour:i,minute:c,second:o}}function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function j(e,...r){if(!r.length)return e;const n=r.shift();if(h(e)&&h(n))for(const t in n)h(n[t])?(e[t]||Object.assign(e,{[t]:{}}),j(e[t],n[t])):Object.assign(e,{[t]:n[t]});return j(e,...r)}function O(e,r){const n=r.match(/[^.[\]]+/g);if(!n||n.length===0)return;const t=(s,i)=>{if(typeof s!="object"||s===null||i.length===0)return;const c=s,o=i[0],u=i.slice(1);if(u.length===0){delete c[o];return}const a=c[o];if(o==="*"&&Array.isArray(c)){for(const f of c)t(f,u);return}t(a,u)};t(e,n)}function U(e,r){if(!e||!r)return e;if(Array.isArray(r))for(const n of r)O(e,n);else O(e,r);return e}function H(e,r){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(r))for(const t of r)O(n,t);else O(n,r);return n}function W(e,r,n={}){const t=n.arrayMergeStrategy||"combine",s=(n.keepKeys||[]).map(o=>o.match(/[^.[\]]+/g)||[]),i=o=>s.some(u=>u.length!==o.length?!1:u.every((a,f)=>a===o[f]));function c(o,u,a){if(a.length>0&&i(a))return o;if(Array.isArray(u)&&Array.isArray(o)){if(t==="overwrite")return[...u];const f=t==="sync"?u.length:Math.max(o.length,u.length),m=new Array(f);for(let l=0;l<f;l++){const d=[...a,String(l)],y=o[l],p=u[l];if(l>=u.length){m[l]=y;continue}if(l>=o.length){m[l]=p;continue}m[l]=c(y,p,d)}return m}if(h(u)&&h(o)){const f={...o};return Object.keys(u).forEach(m=>{const l=[...a,m],d=u[m],y=o[m];f[m]=c(y,d,l)}),f}return u===void 0?o:u}return c(e,r,[])}const G=e=>D(e||0),Q=e=>S(e||0),X=(e,r)=>S(e||0,r),Y=e=>isNaN(e)?void 0:e,Z=e=>{const r=e.toString().split(""),n=r[1]!=="0"?`,${r[1]}`:"";let[t]=e.toString().split(".");return t=t.replaceAll("-",""),t.length>=15?`${+t.substring(0,3)} T`:t.length===14?`${+t.substring(0,2)} T`:t.length===13?`${+t.substring(0,1)}${n} T`:t.length===12?`${+t.substring(0,3)} M`:t.length===11?`${+t.substring(0,2)} M`:t.length===10?`${+t.substring(0,1)}${n} M`:t.length===9?`${+t.substring(0,3)} JT`:t.length===8?`${+t.substring(0,2)} JT`:t.length===7?`${+t.substring(0,1)}${n} JT`:t.length===6?`${+t.substring(0,3)} RB`:t.length===5?`${+t.substring(0,2)} RB`:t.length===4?`${+t.substring(0,1)}${n} RB`:t.length<=3?+t?`${+t}`:0:null};function _(e){if(typeof e!="string")throw new Error("Input harus berupa string");const r=e.split(".");if(r.length===1)return{filename:e,extension:""};const n="."+r[r.length-1];return{filename:r.slice(0,-1).join("."),extension:n}}const k=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function ee(e,r){const n=typeof e=="string"?e:JSON.stringify(e),t=b.util.decode64(r.replace(/\s+/g,"")),s=b.util.decode64(t),i=b.asn1.fromDer(s),o=b.pki.publicKeyFromAsn1(i).encrypt(n,"RSA-OAEP",{md:b.md.sha256.create(),mgf1:{md:b.md.sha1.create()}});return b.util.encode64(o)}exports.deepCompareEquals=I;exports.deepMerge=W;exports.deleteKeysImmutable=H;exports.deleteKeysMutable=U;exports.encryptRSAOAEP=ee;exports.extractElementStringToOriginalValue=k;exports.formatDate=w;exports.formatDateRange=C;exports.formatNumber=V;exports.groupByKey=T;exports.isAccurateBigNumber=B;exports.isAccurateNumber=K;exports.isObject=h;exports.mergeObjects=j;exports.parseBigDecimal=S;exports.parseDecimal=D;exports.parseFileName=_;exports.removeKeyObjectEmptyValue=R;exports.sanitizeObjectKeyPrefix=q;exports.setDigit=Z;exports.transformArrayMapping=v;exports.transformArrayMappingObjectFC=z;exports.transformArrayOfObjectToArray=E;exports.transformArrayOfObjectToString=x;exports.transformBigNumber=Q;exports.transformBigNumberOpt=X;exports.transformDataHistory=L;exports.transformLatLong=P;exports.transformNumber=G;exports.transformSecondTime=J;exports.transfromIsNan=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("date-fns"),g=require("date-fns/locale"),N=require("../config/bigNumber/index.cjs"),b=require("node-forge"),D=e=>{try{return N.BigNumber(e).isFinite()}catch{return!1}},F=e=>{if(typeof e=="number"&&Number.isFinite(e))return!0;if(typeof e=="string"&&e.trim()!==""&&!isNaN(Number(e))){const r=Number(e);return Number.isFinite(r)}return!1};function j(e,r){const{minimumFractionDigits:n,instance:t=!1,ignoreFractionLimit:o=!1}=r||{};let{maximumFractionDigits:i=2}=r||{};D(e)||(e="0"),!o&&n!==void 0&&n>i&&(i=n);let c="";if(o?c=N.BigNumber(e).toString():c=N.BigNumber(e).toFixed(i),c.includes(".")&&!o){const[s,a]=c.split(".");let u=a.replace(/0+$/,"");n!==void 0&&n>=0&&(u=u.padEnd(n,"0")),c=u?`${s}.${u}`:s}return t?N.BigNumber(c):c}const S=(e,r=2)=>{let n=parseFloat(F(e)?e:0);return n=(+(Math.round(n+"e"+r)+"e-"+r)).toFixed(r),n=Number(n),n};function E(e,r="currency",n){const{minimumFractionDigits:t=0,locale:o="id-ID",currency:i="IDR",withSpace:c=!1}=n||{},s=new Intl.NumberFormat(o,{style:r,currency:i,minimumFractionDigits:t}).format(S(e,t>0?t:2));return c?s:s.replace(/\s/g,"")}const B=(e,r,n,t)=>{const o={"id-ID":g.id,"zh-CN":g.zhCN,"en-US":g.enUS,"nl-BE":g.nl};let i=n??"-";return e&&!isNaN(new Date(e).getTime())&&(i=M.format(e,r??"dd/MM/yyyy",{locale:o[t??"id-ID"]})),i},I=(e,r,n,t,o,i)=>{const c={"id-ID":g.id,"zh-CN":g.zhCN,"en-US":g.enUS,"nl-NL":g.nl};if(e&&!isNaN(new Date(e).getTime())){const s=M.format(e,n??"dd/MM/yyyy",{locale:c[i??"id-ID"]});if(r&&!isNaN(new Date(r).getTime())){const a=M.format(r,n??"dd/MM/yyyy",{locale:c[i??"id-ID"]});return s===a?s:`${s}${t??"-"}${a}`}return s}return o??"-"},K=(e,r)=>e.reduce((n,t)=>{const o=String(t[r]);return n[o]||(n[o]=[]),n[o].push(t),n},{}),V=({value:e,keyDate:r="date",keyFormat:n="formatDate",format:t="dd/MM/yyyy"})=>{const o=e.map(i=>({...i,[n]:B(i[r],t)}));return K(o,n)},C=e=>(Object.keys(e).forEach(r=>{["",null,void 0,[],{}].includes(e[r])&&delete e[r]}),e),L=(e,r)=>{const n=/^-?\d+[0-9.,]*$/,t=/([.])(?=.*\1)/,o=/([,])(?=.*\1)/,i=e.split(",")[0]?.trim()||"",c=e.split(",")[1]?.trim()||"",s=!t.test(i)&&(i==="-"||n.test(i)||!i),a=!t.test(c)&&(c==="-"||n.test(c)||!c),u=(l,p,y)=>{let d=l;const A=l.split(".")[0];return isNaN(parseFloat(A.split(".")[0]))||(parseFloat(A.split(".")[0])<=p?d=`${p}`:parseFloat(A)>=y&&(d=`${y}`)),d},f=u(i,r?.latMin??-85,r?.latMax??85),m=u(c,r?.longMin??-180,r?.longMax??180);return{latitude:f,longitude:m,latlong:`${f}${e.includes(",")?","+m:""}`,isValid:!o.test(e)&&s&&a}},R=(e,r)=>e?Object.fromEntries(Object.entries(r).filter(([t])=>t.startsWith(e))):r,w=(e,r)=>e.map(n=>n[r]).join(","),T=(e,r)=>e.map(n=>n[r]),P=(e,r)=>Array.isArray(e)?e?.map((n,t,o)=>typeof r=="function"?r(n,t,o):n):[],q=(e,r,n,t,o)=>Array.isArray(e)?{[r]:e?.map((i,c,s)=>typeof n=="function"?n(i,c,s):i),[`${r}-val-be`]:i=>t==="array-of-object-to-array"?T(i,o):w(i,o)}:{[r]:"",[`${r}-val-be`]:()=>""};function x(e,r){if(e===r)return!0;if(typeof e!="object"||typeof r!="object"||e===null||r===null)return!1;const n=Object.keys(e),t=Object.keys(r);if(n.length!==t.length)return!1;for(const o of n)if(!t.includes(o)||!x(e[o],r[o]))return!1;return!0}function v(e,r={maxTime:"hour"}){const{maxTime:n="hour"}=r,t=a=>a<10?`0${a}`:a;let o=t(0),i=t(0);const c=t(Math.floor(e%3600/60)),s=t(Math.floor(e%60));return n==="hour"?i=t(Math.floor(e/3600)):n==="day"&&(o=t(Math.floor(e/(3600*24))),i=t(Math.floor(e%(3600*24)/3600))),{day:o,hour:i,minute:c,second:s}}function h(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function $(e,...r){if(!r.length)return e;const n=r.shift();if(h(e)&&h(n))for(const t in n)h(n[t])?(e[t]||Object.assign(e,{[t]:{}}),$(e[t],n[t])):Object.assign(e,{[t]:n[t]});return $(e,...r)}function O(e,r){const n=r.match(/[^.[\]]+/g);if(!n||n.length===0)return;const t=(o,i)=>{if(typeof o!="object"||o===null||i.length===0)return;const c=o,s=i[0],a=i.slice(1);if(a.length===0){delete c[s];return}const u=c[s];if(s==="*"&&Array.isArray(c)){for(const f of c)t(f,a);return}t(u,a)};t(e,n)}function z(e,r){if(!e||!r)return e;if(Array.isArray(r))for(const n of r)O(e,n);else O(e,r);return e}function J(e,r){const n=JSON.parse(JSON.stringify(e));if(Array.isArray(r))for(const t of r)O(n,t);else O(n,r);return n}function U(e,r,n={}){const t=n.arrayMergeStrategy||"combine",o=(n.keepKeys||[]).map(s=>s.match(/[^.[\]]+/g)||[]),i=s=>o.some(a=>a.length!==s.length?!1:a.every((u,f)=>u===s[f]));function c(s,a,u){if(u.length>0&&i(u))return s;if(Array.isArray(a)&&Array.isArray(s)){if(t==="overwrite")return[...a];const f=t==="sync"?a.length:Math.max(s.length,a.length),m=new Array(f);for(let l=0;l<f;l++){const p=[...u,String(l)],y=s[l],d=a[l];if(l>=a.length){m[l]=y;continue}if(l>=s.length){m[l]=d;continue}m[l]=c(y,d,p)}return m}if(h(a)&&h(s)){const f={...s};return Object.keys(a).forEach(m=>{const l=[...u,m],p=a[m],y=s[m];f[m]=c(y,p,l)}),f}return a===void 0?s:a}return c(e,r,[])}const H=e=>S(e||0),W=e=>j(e||0),G=(e,r)=>j(e||0,r),Q=e=>isNaN(e)?void 0:e,X=e=>{const r=e.toString().split(""),n=r[1]!=="0"?`,${r[1]}`:"";let[t]=e.toString().split(".");return t=t.replaceAll("-",""),t.length>=15?`${+t.substring(0,3)} T`:t.length===14?`${+t.substring(0,2)} T`:t.length===13?`${+t.substring(0,1)}${n} T`:t.length===12?`${+t.substring(0,3)} M`:t.length===11?`${+t.substring(0,2)} M`:t.length===10?`${+t.substring(0,1)}${n} M`:t.length===9?`${+t.substring(0,3)} JT`:t.length===8?`${+t.substring(0,2)} JT`:t.length===7?`${+t.substring(0,1)}${n} JT`:t.length===6?`${+t.substring(0,3)} RB`:t.length===5?`${+t.substring(0,2)} RB`:t.length===4?`${+t.substring(0,1)}${n} RB`:t.length<=3?+t?`${+t}`:0:null};function Y(e){if(typeof e!="string")throw new Error("Input harus berupa string");const r=e.split(".");if(r.length===1)return{filename:e,extension:""};const n="."+r[r.length-1];return{filename:r.slice(0,-1).join("."),extension:n}}const Z=e=>(new DOMParser().parseFromString(e||"","text/html").body.textContent??"").toString();function _(e,r){const n=typeof e=="string"?e:JSON.stringify(e),t=b.util.decode64(r.replace(/\s+/g,"")),o=b.util.decode64(t),i=b.asn1.fromDer(o),s=b.pki.publicKeyFromAsn1(i).encrypt(n,"RSA-OAEP",{md:b.md.sha256.create(),mgf1:{md:b.md.sha1.create()}});return b.util.encode64(s)}exports.deepCompareEquals=x;exports.deepMerge=U;exports.deleteKeysImmutable=J;exports.deleteKeysMutable=z;exports.encryptRSAOAEP=_;exports.extractElementStringToOriginalValue=Z;exports.formatDate=B;exports.formatDateRange=I;exports.formatNumber=E;exports.groupByKey=K;exports.isAccurateBigNumber=D;exports.isAccurateNumber=F;exports.isObject=h;exports.mergeObjects=$;exports.parseBigDecimal=j;exports.parseDecimal=S;exports.parseFileName=Y;exports.removeKeyObjectEmptyValue=C;exports.sanitizeObjectKeyPrefix=R;exports.setDigit=X;exports.transformArrayMapping=P;exports.transformArrayMappingObjectFC=q;exports.transformArrayOfObjectToArray=T;exports.transformArrayOfObjectToString=w;exports.transformBigNumber=W;exports.transformBigNumberOpt=G;exports.transformDataHistory=V;exports.transformLatLong=L;exports.transformNumber=H;exports.transformSecondTime=v;exports.transfromIsNan=Q;
@@ -1,264 +1,263 @@
1
- import { format as M } from "date-fns";
2
- import { nl as S, enUS as w, zhCN as D, id as F } from "date-fns/locale";
3
- import { BigNumber as p } from "../config/bigNumber/index.mjs";
1
+ import { format as $ } from "date-fns";
2
+ import { nl as O, enUS as j, zhCN as S, id as w } from "date-fns/locale";
3
+ import { BigNumber as b } from "../config/bigNumber/index.mjs";
4
4
  import y from "node-forge";
5
- const T = (e) => {
5
+ const x = (e) => {
6
6
  try {
7
- return p(e).isFinite();
7
+ return b(e).isFinite();
8
8
  } catch {
9
9
  return !1;
10
10
  }
11
- }, B = (e) => {
11
+ }, K = (e) => {
12
12
  if (typeof e == "number" && Number.isFinite(e))
13
13
  return !0;
14
14
  if (typeof e == "string" && e.trim() !== "" && !isNaN(Number(e))) {
15
- const t = Number(e);
16
- return Number.isFinite(t);
15
+ const r = Number(e);
16
+ return Number.isFinite(r);
17
17
  }
18
18
  return !1;
19
19
  };
20
- function x(e, t) {
21
- const { minimumFractionDigits: n, instance: r = !1, ignoreFractionLimit: s = !1 } = t || {};
22
- let { maximumFractionDigits: i = 2 } = t || {};
23
- T(e) || (e = "0"), !s && n !== void 0 && n > i && (i = n);
20
+ function D(e, r) {
21
+ const { minimumFractionDigits: n, instance: t = !1, ignoreFractionLimit: o = !1 } = r || {};
22
+ let { maximumFractionDigits: i = 2 } = r || {};
23
+ x(e) || (e = "0"), !o && n !== void 0 && n > i && (i = n);
24
24
  let c = "";
25
- if (s ? c = p(e).toString() : c = p(e).toFixed(i), c.includes(".") && !s) {
26
- const [o, u] = c.split(".");
25
+ if (o ? c = b(e).toString() : c = b(e).toFixed(i), c.includes(".") && !o) {
26
+ const [s, u] = c.split(".");
27
27
  let l = u.replace(/0+$/, "");
28
- n !== void 0 && n >= 0 && (l = l.padEnd(n, "0")), c = l ? `${o}.${l}` : o;
28
+ n !== void 0 && n >= 0 && (l = l.padEnd(n, "0")), c = l ? `${s}.${l}` : s;
29
29
  }
30
- return r ? p(c) : c;
30
+ return t ? b(c) : c;
31
31
  }
32
- const K = (e, t = 2) => {
33
- let n = parseFloat(B(e) ? e : 0);
34
- return n = (+(Math.round(n + "e" + t) + "e-" + t)).toFixed(t), n = Number(n), n;
32
+ const F = (e, r = 2) => {
33
+ let n = parseFloat(K(e) ? e : 0);
34
+ return n = (+(Math.round(n + "e" + r) + "e-" + r)).toFixed(r), n = Number(n), n;
35
35
  };
36
- function z(e, t = "currency", n) {
37
- const { minimumFractionDigits: r = 0, locale: s = "id-ID", currency: i = "IDR", withSpace: c = !1 } = n || {}, o = new Intl.NumberFormat(s, {
38
- style: t,
36
+ function J(e, r = "currency", n) {
37
+ const { minimumFractionDigits: t = 0, locale: o = "id-ID", currency: i = "IDR", withSpace: c = !1 } = n || {}, s = new Intl.NumberFormat(o, {
38
+ style: r,
39
39
  currency: i,
40
- minimumFractionDigits: r
41
- }).format(K(e, r > 0 ? r : 2));
42
- return c ? o : o.replace(/\s/g, "");
40
+ minimumFractionDigits: t
41
+ }).format(F(e, t > 0 ? t : 2));
42
+ return c ? s : s.replace(/\s/g, "");
43
43
  }
44
- const I = (e, t, n, r) => {
45
- const s = { "id-ID": F, "zh-CN": D, "en-US": w, "nl-BE": S };
44
+ const T = (e, r, n, t) => {
45
+ const o = { "id-ID": w, "zh-CN": S, "en-US": j, "nl-BE": O };
46
46
  let i = n ?? "-";
47
- return e && !isNaN(new Date(e).getTime()) && (i = M(e, t ?? "dd/MM/yyyy", { locale: s[r ?? "id-ID"] })), i;
48
- }, U = (e, t, n, r, s, i) => {
49
- const c = { "id-ID": F, "zh-CN": D, "en-US": w, "nl-NL": S };
47
+ return e && !isNaN(new Date(e).getTime()) && (i = $(e, r ?? "dd/MM/yyyy", { locale: o[t ?? "id-ID"] })), i;
48
+ }, v = (e, r, n, t, o, i) => {
49
+ const c = { "id-ID": w, "zh-CN": S, "en-US": j, "nl-NL": O };
50
50
  if (e && !isNaN(new Date(e).getTime())) {
51
- const o = M(e, n ?? "dd/MM/yyyy", { locale: c[i ?? "id-ID"] });
52
- if (t && !isNaN(new Date(t).getTime())) {
53
- const u = M(t, n ?? "dd/MM/yyyy", { locale: c[i ?? "id-ID"] });
54
- return o === u ? o : `${o}${r ?? "-"}${u}`;
51
+ const s = $(e, n ?? "dd/MM/yyyy", { locale: c[i ?? "id-ID"] });
52
+ if (r && !isNaN(new Date(r).getTime())) {
53
+ const u = $(r, n ?? "dd/MM/yyyy", { locale: c[i ?? "id-ID"] });
54
+ return s === u ? s : `${s}${t ?? "-"}${u}`;
55
55
  }
56
- return o;
56
+ return s;
57
57
  }
58
- return s ?? "-";
59
- }, V = (e, t) => e.reduce((n, r) => {
60
- const s = String(r[t]);
61
- return n[s] || (n[s] = []), n[s].push(r), n;
62
- }, {}), q = ({
58
+ return o ?? "-";
59
+ }, B = (e, r) => e.reduce((n, t) => {
60
+ const o = String(t[r]);
61
+ return n[o] || (n[o] = []), n[o].push(t), n;
62
+ }, {}), z = ({
63
63
  value: e,
64
- keyDate: t = "date",
64
+ keyDate: r = "date",
65
65
  keyFormat: n = "formatDate",
66
- format: r = "dd/MM/yyyy"
66
+ format: t = "dd/MM/yyyy"
67
67
  }) => {
68
- const s = e.map((i) => ({
68
+ const o = e.map((i) => ({
69
69
  ...i,
70
- [n]: I(i[t], r)
70
+ [n]: T(i[r], t)
71
71
  }));
72
- return V(s, n);
73
- }, H = (e) => (Object.keys(e).forEach((t) => {
74
- ["", null, void 0, [], {}].includes(e[t]) && delete e[t];
75
- }), e), W = (e, t) => {
76
- var f, h;
77
- const n = /^-?\d+[0-9.,]*$/, r = /([.])(?=.*\1)/, s = /([,])(?=.*\1)/, i = ((f = e.split(",")[0]) == null ? void 0 : f.trim()) || "", c = ((h = e.split(",")[1]) == null ? void 0 : h.trim()) || "", o = !r.test(i) && (i === "-" || n.test(i) || !i), u = !r.test(c) && (c === "-" || n.test(c) || !c), l = (m, b, O) => {
78
- let A = m;
79
- const $ = m.split(".")[0];
80
- return isNaN(parseFloat($.split(".")[0])) || (parseFloat($.split(".")[0]) <= b ? A = `${b}` : parseFloat($) >= O && (A = `${O}`)), A;
81
- }, a = l(i, (t == null ? void 0 : t.latMin) ?? -85, (t == null ? void 0 : t.latMax) ?? 85), g = l(c, (t == null ? void 0 : t.longMin) ?? -180, (t == null ? void 0 : t.longMax) ?? 180);
72
+ return B(o, n);
73
+ }, U = (e) => (Object.keys(e).forEach((r) => {
74
+ ["", null, void 0, [], {}].includes(e[r]) && delete e[r];
75
+ }), e), q = (e, r) => {
76
+ const n = /^-?\d+[0-9.,]*$/, t = /([.])(?=.*\1)/, o = /([,])(?=.*\1)/, i = e.split(",")[0]?.trim() || "", c = e.split(",")[1]?.trim() || "", s = !t.test(i) && (i === "-" || n.test(i) || !i), u = !t.test(c) && (c === "-" || n.test(c) || !c), l = (a, p, m) => {
77
+ let d = a;
78
+ const A = a.split(".")[0];
79
+ return isNaN(parseFloat(A.split(".")[0])) || (parseFloat(A.split(".")[0]) <= p ? d = `${p}` : parseFloat(A) >= m && (d = `${m}`)), d;
80
+ }, f = l(i, r?.latMin ?? -85, r?.latMax ?? 85), g = l(c, r?.longMin ?? -180, r?.longMax ?? 180);
82
81
  return {
83
- latitude: a,
82
+ latitude: f,
84
83
  longitude: g,
85
- latlong: `${a}${e.includes(",") ? "," + g : ""}`,
86
- isValid: !s.test(e) && o && u
84
+ latlong: `${f}${e.includes(",") ? "," + g : ""}`,
85
+ isValid: !o.test(e) && s && u
87
86
  };
88
- }, G = (e, t) => e ? Object.fromEntries(Object.entries(t).filter(([r]) => r.startsWith(e))) : t, E = (e, t) => e.map((n) => n[t]).join(","), L = (e, t) => e.map((n) => n[t]), Q = (e, t) => Array.isArray(e) ? e == null ? void 0 : e.map(
89
- (n, r, s) => typeof t == "function" ? t(n, r, s) : n
90
- ) : [], X = (e, t, n, r, s) => Array.isArray(e) ? {
91
- [t]: e == null ? void 0 : e.map(
92
- (i, c, o) => typeof n == "function" ? n(i, c, o) : i
87
+ }, H = (e, r) => e ? Object.fromEntries(Object.entries(r).filter(([t]) => t.startsWith(e))) : r, I = (e, r) => e.map((n) => n[r]).join(","), V = (e, r) => e.map((n) => n[r]), W = (e, r) => Array.isArray(e) ? e?.map(
88
+ (n, t, o) => typeof r == "function" ? r(n, t, o) : n
89
+ ) : [], G = (e, r, n, t, o) => Array.isArray(e) ? {
90
+ [r]: e?.map(
91
+ (i, c, s) => typeof n == "function" ? n(i, c, s) : i
93
92
  ),
94
- [`${t}-val-be`]: (i) => r === "array-of-object-to-array" ? L(i, s) : E(i, s)
95
- } : { [t]: "", [`${t}-val-be`]: () => "" };
96
- function R(e, t) {
97
- if (e === t) return !0;
98
- if (typeof e != "object" || typeof t != "object" || e === null || t === null)
93
+ [`${r}-val-be`]: (i) => t === "array-of-object-to-array" ? V(i, o) : I(i, o)
94
+ } : { [r]: "", [`${r}-val-be`]: () => "" };
95
+ function E(e, r) {
96
+ if (e === r) return !0;
97
+ if (typeof e != "object" || typeof r != "object" || e === null || r === null)
99
98
  return !1;
100
- const n = Object.keys(e), r = Object.keys(t);
101
- if (n.length !== r.length) return !1;
102
- for (const s of n)
103
- if (!r.includes(s) || !R(e[s], t[s]))
99
+ const n = Object.keys(e), t = Object.keys(r);
100
+ if (n.length !== t.length) return !1;
101
+ for (const o of n)
102
+ if (!t.includes(o) || !E(e[o], r[o]))
104
103
  return !1;
105
104
  return !0;
106
105
  }
107
- function Y(e, t = { maxTime: "hour" }) {
108
- const { maxTime: n = "hour" } = t, r = (u) => u < 10 ? `0${u}` : u;
109
- let s = r(0), i = r(0);
110
- const c = r(Math.floor(e % 3600 / 60)), o = r(Math.floor(e % 60));
111
- return n === "hour" ? i = r(Math.floor(e / 3600)) : n === "day" && (s = r(Math.floor(e / (3600 * 24))), i = r(Math.floor(e % (3600 * 24) / 3600))), {
112
- day: s,
106
+ function Q(e, r = { maxTime: "hour" }) {
107
+ const { maxTime: n = "hour" } = r, t = (u) => u < 10 ? `0${u}` : u;
108
+ let o = t(0), i = t(0);
109
+ const c = t(Math.floor(e % 3600 / 60)), s = t(Math.floor(e % 60));
110
+ return n === "hour" ? i = t(Math.floor(e / 3600)) : n === "day" && (o = t(Math.floor(e / (3600 * 24))), i = t(Math.floor(e % (3600 * 24) / 3600))), {
111
+ day: o,
113
112
  hour: i,
114
113
  minute: c,
115
- second: o
114
+ second: s
116
115
  };
117
116
  }
118
- function d(e) {
117
+ function h(e) {
119
118
  return !!e && typeof e == "object" && !Array.isArray(e);
120
119
  }
121
- function j(e, ...t) {
122
- if (!t.length) return e;
123
- const n = t.shift();
124
- if (d(e) && d(n))
125
- for (const r in n)
126
- d(n[r]) ? (e[r] || Object.assign(e, { [r]: {} }), j(e[r], n[r])) : Object.assign(e, { [r]: n[r] });
127
- return j(e, ...t);
120
+ function M(e, ...r) {
121
+ if (!r.length) return e;
122
+ const n = r.shift();
123
+ if (h(e) && h(n))
124
+ for (const t in n)
125
+ h(n[t]) ? (e[t] || Object.assign(e, { [t]: {} }), M(e[t], n[t])) : Object.assign(e, { [t]: n[t] });
126
+ return M(e, ...r);
128
127
  }
129
- function N(e, t) {
130
- const n = t.match(/[^.[\]]+/g);
128
+ function N(e, r) {
129
+ const n = r.match(/[^.[\]]+/g);
131
130
  if (!n || n.length === 0)
132
131
  return;
133
- const r = (s, i) => {
134
- if (typeof s != "object" || s === null || i.length === 0)
132
+ const t = (o, i) => {
133
+ if (typeof o != "object" || o === null || i.length === 0)
135
134
  return;
136
- const c = s, o = i[0], u = i.slice(1);
135
+ const c = o, s = i[0], u = i.slice(1);
137
136
  if (u.length === 0) {
138
- delete c[o];
137
+ delete c[s];
139
138
  return;
140
139
  }
141
- const l = c[o];
142
- if (o === "*" && Array.isArray(c)) {
143
- for (const a of c)
144
- r(a, u);
140
+ const l = c[s];
141
+ if (s === "*" && Array.isArray(c)) {
142
+ for (const f of c)
143
+ t(f, u);
145
144
  return;
146
145
  }
147
- r(l, u);
146
+ t(l, u);
148
147
  };
149
- r(e, n);
148
+ t(e, n);
150
149
  }
151
- function Z(e, t) {
152
- if (!e || !t)
150
+ function X(e, r) {
151
+ if (!e || !r)
153
152
  return e;
154
- if (Array.isArray(t))
155
- for (const n of t)
153
+ if (Array.isArray(r))
154
+ for (const n of r)
156
155
  N(e, n);
157
156
  else
158
- N(e, t);
157
+ N(e, r);
159
158
  return e;
160
159
  }
161
- function _(e, t) {
160
+ function Y(e, r) {
162
161
  const n = JSON.parse(JSON.stringify(e));
163
- if (Array.isArray(t))
164
- for (const r of t)
165
- N(n, r);
162
+ if (Array.isArray(r))
163
+ for (const t of r)
164
+ N(n, t);
166
165
  else
167
- N(n, t);
166
+ N(n, r);
168
167
  return n;
169
168
  }
170
- function k(e, t, n = {}) {
171
- const r = n.arrayMergeStrategy || "combine", s = (n.keepKeys || []).map((o) => o.match(/[^.[\]]+/g) || []), i = (o) => s.some((u) => u.length !== o.length ? !1 : u.every((l, a) => l === o[a]));
172
- function c(o, u, l) {
169
+ function Z(e, r, n = {}) {
170
+ const t = n.arrayMergeStrategy || "combine", o = (n.keepKeys || []).map((s) => s.match(/[^.[\]]+/g) || []), i = (s) => o.some((u) => u.length !== s.length ? !1 : u.every((l, f) => l === s[f]));
171
+ function c(s, u, l) {
173
172
  if (l.length > 0 && i(l))
174
- return o;
175
- if (Array.isArray(u) && Array.isArray(o)) {
176
- if (r === "overwrite")
173
+ return s;
174
+ if (Array.isArray(u) && Array.isArray(s)) {
175
+ if (t === "overwrite")
177
176
  return [...u];
178
- const a = r === "sync" ? u.length : Math.max(o.length, u.length), g = new Array(a);
179
- for (let f = 0; f < a; f++) {
180
- const h = [...l, String(f)], m = o[f], b = u[f];
181
- if (f >= u.length) {
182
- g[f] = m;
177
+ const f = t === "sync" ? u.length : Math.max(s.length, u.length), g = new Array(f);
178
+ for (let a = 0; a < f; a++) {
179
+ const p = [...l, String(a)], m = s[a], d = u[a];
180
+ if (a >= u.length) {
181
+ g[a] = m;
183
182
  continue;
184
183
  }
185
- if (f >= o.length) {
186
- g[f] = b;
184
+ if (a >= s.length) {
185
+ g[a] = d;
187
186
  continue;
188
187
  }
189
- g[f] = c(m, b, h);
188
+ g[a] = c(m, d, p);
190
189
  }
191
190
  return g;
192
191
  }
193
- if (d(u) && d(o)) {
194
- const a = { ...o };
192
+ if (h(u) && h(s)) {
193
+ const f = { ...s };
195
194
  return Object.keys(u).forEach((g) => {
196
- const f = [...l, g], h = u[g], m = o[g];
197
- a[g] = c(m, h, f);
198
- }), a;
195
+ const a = [...l, g], p = u[g], m = s[g];
196
+ f[g] = c(m, p, a);
197
+ }), f;
199
198
  }
200
- return u === void 0 ? o : u;
199
+ return u === void 0 ? s : u;
201
200
  }
202
- return c(e, t, []);
201
+ return c(e, r, []);
203
202
  }
204
- const ee = (e) => K(e || 0), te = (e) => x(e || 0), re = (e, t) => x(e || 0, t), ne = (e) => isNaN(e) ? void 0 : e, ie = (e) => {
205
- const t = e.toString().split(""), n = t[1] !== "0" ? `,${t[1]}` : "";
206
- let [r] = e.toString().split(".");
207
- return r = r.replaceAll("-", ""), r.length >= 15 ? `${+r.substring(0, 3)} T` : r.length === 14 ? `${+r.substring(0, 2)} T` : r.length === 13 ? `${+r.substring(0, 1)}${n} T` : r.length === 12 ? `${+r.substring(0, 3)} M` : r.length === 11 ? `${+r.substring(0, 2)} M` : r.length === 10 ? `${+r.substring(0, 1)}${n} M` : r.length === 9 ? `${+r.substring(0, 3)} JT` : r.length === 8 ? `${+r.substring(0, 2)} JT` : r.length === 7 ? `${+r.substring(0, 1)}${n} JT` : r.length === 6 ? `${+r.substring(0, 3)} RB` : r.length === 5 ? `${+r.substring(0, 2)} RB` : r.length === 4 ? `${+r.substring(0, 1)}${n} RB` : r.length <= 3 ? +r ? `${+r}` : 0 : null;
203
+ const _ = (e) => F(e || 0), k = (e) => D(e || 0), ee = (e, r) => D(e || 0, r), te = (e) => isNaN(e) ? void 0 : e, re = (e) => {
204
+ const r = e.toString().split(""), n = r[1] !== "0" ? `,${r[1]}` : "";
205
+ let [t] = e.toString().split(".");
206
+ return t = t.replaceAll("-", ""), t.length >= 15 ? `${+t.substring(0, 3)} T` : t.length === 14 ? `${+t.substring(0, 2)} T` : t.length === 13 ? `${+t.substring(0, 1)}${n} T` : t.length === 12 ? `${+t.substring(0, 3)} M` : t.length === 11 ? `${+t.substring(0, 2)} M` : t.length === 10 ? `${+t.substring(0, 1)}${n} M` : t.length === 9 ? `${+t.substring(0, 3)} JT` : t.length === 8 ? `${+t.substring(0, 2)} JT` : t.length === 7 ? `${+t.substring(0, 1)}${n} JT` : t.length === 6 ? `${+t.substring(0, 3)} RB` : t.length === 5 ? `${+t.substring(0, 2)} RB` : t.length === 4 ? `${+t.substring(0, 1)}${n} RB` : t.length <= 3 ? +t ? `${+t}` : 0 : null;
208
207
  };
209
- function se(e) {
208
+ function ne(e) {
210
209
  if (typeof e != "string")
211
210
  throw new Error("Input harus berupa string");
212
- const t = e.split(".");
213
- if (t.length === 1)
211
+ const r = e.split(".");
212
+ if (r.length === 1)
214
213
  return {
215
214
  filename: e,
216
215
  extension: ""
217
216
  };
218
- const n = "." + t[t.length - 1];
217
+ const n = "." + r[r.length - 1];
219
218
  return {
220
- filename: t.slice(0, -1).join("."),
219
+ filename: r.slice(0, -1).join("."),
221
220
  extension: n
222
221
  };
223
222
  }
224
- const oe = (e) => (new DOMParser().parseFromString(e || "", "text/html").body.textContent ?? "").toString();
225
- function ce(e, t) {
226
- const n = typeof e == "string" ? e : JSON.stringify(e), r = y.util.decode64(t.replace(/\s+/g, "")), s = y.util.decode64(r), i = y.asn1.fromDer(s), o = y.pki.publicKeyFromAsn1(i).encrypt(n, "RSA-OAEP", {
223
+ const ie = (e) => (new DOMParser().parseFromString(e || "", "text/html").body.textContent ?? "").toString();
224
+ function oe(e, r) {
225
+ const n = typeof e == "string" ? e : JSON.stringify(e), t = y.util.decode64(r.replace(/\s+/g, "")), o = y.util.decode64(t), i = y.asn1.fromDer(o), s = y.pki.publicKeyFromAsn1(i).encrypt(n, "RSA-OAEP", {
227
226
  md: y.md.sha256.create(),
228
227
  mgf1: { md: y.md.sha1.create() }
229
228
  });
230
- return y.util.encode64(o);
229
+ return y.util.encode64(s);
231
230
  }
232
231
  export {
233
- R as deepCompareEquals,
234
- k as deepMerge,
235
- _ as deleteKeysImmutable,
236
- Z as deleteKeysMutable,
237
- ce as encryptRSAOAEP,
238
- oe as extractElementStringToOriginalValue,
239
- I as formatDate,
240
- U as formatDateRange,
241
- z as formatNumber,
242
- V as groupByKey,
243
- T as isAccurateBigNumber,
244
- B as isAccurateNumber,
245
- d as isObject,
246
- j as mergeObjects,
247
- x as parseBigDecimal,
248
- K as parseDecimal,
249
- se as parseFileName,
250
- H as removeKeyObjectEmptyValue,
251
- G as sanitizeObjectKeyPrefix,
252
- ie as setDigit,
253
- Q as transformArrayMapping,
254
- X as transformArrayMappingObjectFC,
255
- L as transformArrayOfObjectToArray,
256
- E as transformArrayOfObjectToString,
257
- te as transformBigNumber,
258
- re as transformBigNumberOpt,
259
- q as transformDataHistory,
260
- W as transformLatLong,
261
- ee as transformNumber,
262
- Y as transformSecondTime,
263
- ne as transfromIsNan
232
+ E as deepCompareEquals,
233
+ Z as deepMerge,
234
+ Y as deleteKeysImmutable,
235
+ X as deleteKeysMutable,
236
+ oe as encryptRSAOAEP,
237
+ ie as extractElementStringToOriginalValue,
238
+ T as formatDate,
239
+ v as formatDateRange,
240
+ J as formatNumber,
241
+ B as groupByKey,
242
+ x as isAccurateBigNumber,
243
+ K as isAccurateNumber,
244
+ h as isObject,
245
+ M as mergeObjects,
246
+ D as parseBigDecimal,
247
+ F as parseDecimal,
248
+ ne as parseFileName,
249
+ U as removeKeyObjectEmptyValue,
250
+ H as sanitizeObjectKeyPrefix,
251
+ re as setDigit,
252
+ W as transformArrayMapping,
253
+ G as transformArrayMappingObjectFC,
254
+ V as transformArrayOfObjectToArray,
255
+ I as transformArrayOfObjectToString,
256
+ k as transformBigNumber,
257
+ ee as transformBigNumberOpt,
258
+ z as transformDataHistory,
259
+ q as transformLatLong,
260
+ _ as transformNumber,
261
+ Q as transformSecondTime,
262
+ te as transfromIsNan
264
263
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "1mpacto-react-ui",
3
3
  "private": false,
4
- "version": "2.0.19",
4
+ "version": "2.0.21",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=20.19.4",
@@ -43,7 +43,7 @@
43
43
  "@types/react-dom": "^19.1.7",
44
44
  "@typescript-eslint/eslint-plugin": "^8.48.1",
45
45
  "@typescript-eslint/parser": "^8.48.1",
46
- "@vitejs/plugin-react-swc": "^3.9.0",
46
+ "@vitejs/plugin-react-swc": "^4.3.0",
47
47
  "1mpacto-sass": "^0.0.6",
48
48
  "eslint": "^9.32.0",
49
49
  "eslint-config-prettier": "^10.1.8",
@@ -64,7 +64,7 @@
64
64
  "storybook": "10.1.4",
65
65
  "ts-node": "^10.9.2",
66
66
  "typescript": "~5.9.3",
67
- "vite": "^6.3.5",
67
+ "vite": "^7.3.2",
68
68
  "vite-plugin-dts": "^4.5.4"
69
69
  },
70
70
  "peerDependencies": {
@@ -125,4 +125,4 @@
125
125
  "react-virtuoso": "^4.16.1",
126
126
  "tinymce": "^8.2.2"
127
127
  }
128
- }
128
+ }