1mpacto-react-ui 2.0.20 → 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 -1
- package/dist/hooks/useDebounce.mjs +19 -19
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +5 -4
- package/dist/package.json.mjs +1 -1
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react"),V=require("../utils/common.cjs"),w=({id:k,numInputs:e,onComplete:f,disableFocusOnEdit:h=!1,blurOnComplete:p=!1,disableOnComplete:v=!1})=>{const[c,g]=l.useState(()=>Array(e).fill("")),r=l.useRef([]),[y]=l.useState(()=>`otp-${Math.random().toString(36).slice(2,9)}`),O=k||y;l.useEffect(()=>{r.current=r.current.slice(0,e)},[e]);const S=l.useCallback((t,a)=>{const o=t.target.value,s=o.length>1?o.slice(-1):o,n=c[a]!=="",u=[...c];u[a]=s,g(u);const b=u.join(""),i=!u.slice(0,e).includes("");s!==""&&a<e-1&&(h&&n&&i||r.current[a+1]?.focus()),i&&(typeof f=="function"&&f(b),p&&r.current[a]?.blur())},[c,e,f,h,p]),d=l.useCallback((t,a)=>{switch(t.key){case"Backspace":if(c[a]===""&&a>0){t.preventDefault();const o=[...c];o[a-1]="",g(o),r.current[a-1]?.focus()}break;case"ArrowLeft":a>0&&(t.preventDefault(),r.current[a-1]?.focus());break;case"ArrowRight":a<e-1&&(t.preventDefault(),r.current[a+1]?.focus());break;case"Home":t.preventDefault(),r.current[0]?.focus();break;case"End":t.preventDefault(),r.current[e-1]?.focus();break}},[c,e]),F=l.useCallback((t,a)=>{t.preventDefault();const o=t.clipboardData.getData("text").trim();if(!o)return;const s=[...c];let n=a;for(const P of o){if(n>=e)break;s[n]=P,n++}g(s);const u=s.join(""),b=!s.includes(""),i=Math.min(n,e-1);r.current[i]?.focus(),b&&(typeof f=="function"&&f(u),p&&r.current[i]?.blur())},[c,e,f,p]),$=t=>{t.target.select()},j=()=>{g(Array(e).fill("")),r.current[0]?.focus()},D=t=>{if(t<0||t>=e)throw new Error(`useOtpInput: index ${t} is out of bounds for numInputs ${e}.`);const a=c.join("").length===e;return{id:`${O}-${t}`,"aria-label":`OTP digit ${t+1} of ${e}`,ref:o=>{r.current[t]=o},value:c[t],onChange:o=>S(o,t),onKeyDown:o=>d(o,t),onPaste:o=>F(o,t),onFocus:$,disabled:v&&a,type:"text",inputMode:"numeric",autoComplete:"one-time-code"}};return{getInputProps:D,getInputData:t=>({...V.deleteKeysImmutable(D(t),["onChange","onKeyDown","onPaste","onFocus","aria-label","autoComplete"]),isOtpFilled:c[t]!==""}),otpValues:c,otpString:c.join(""),clearOtp:j,isOtpComplete:c.join("").length===e}};exports.default=w;exports.useOtpInput=w;
|
|
@@ -1,99 +1,95 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { deleteKeysImmutable as
|
|
3
|
-
const
|
|
4
|
-
id:
|
|
1
|
+
import l from "react";
|
|
2
|
+
import { deleteKeysImmutable as P } from "../utils/common.mjs";
|
|
3
|
+
const R = ({
|
|
4
|
+
id: w,
|
|
5
5
|
numInputs: e,
|
|
6
|
-
onComplete:
|
|
7
|
-
disableFocusOnEdit:
|
|
8
|
-
blurOnComplete:
|
|
9
|
-
disableOnComplete:
|
|
6
|
+
onComplete: f,
|
|
7
|
+
disableFocusOnEdit: b = !1,
|
|
8
|
+
blurOnComplete: p = !1,
|
|
9
|
+
disableOnComplete: k = !1
|
|
10
10
|
}) => {
|
|
11
|
-
const [r,
|
|
12
|
-
|
|
11
|
+
const [r, g] = l.useState(() => Array(e).fill("")), c = l.useRef([]), [y] = l.useState(() => `otp-${Math.random().toString(36).slice(2, 9)}`), v = w || y;
|
|
12
|
+
l.useEffect(() => {
|
|
13
13
|
c.current = c.current.slice(0, e);
|
|
14
14
|
}, [e]);
|
|
15
|
-
const
|
|
15
|
+
const O = l.useCallback(
|
|
16
16
|
(t, a) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
s !== "" && a < e - 1 && (w && l && n || (g = c.current[a + 1]) == null || g.focus()), n && (typeof i == "function" && i(p), b && ((h = c.current[a]) == null || h.blur()));
|
|
17
|
+
const o = t.target.value, s = o.length > 1 ? o.slice(-1) : o, n = r[a] !== "", u = [...r];
|
|
18
|
+
u[a] = s, g(u);
|
|
19
|
+
const h = u.join(""), i = !u.slice(0, e).includes("");
|
|
20
|
+
s !== "" && a < e - 1 && (b && n && i || c.current[a + 1]?.focus()), i && (typeof f == "function" && f(h), p && c.current[a]?.blur());
|
|
22
21
|
},
|
|
23
|
-
[r, e,
|
|
24
|
-
),
|
|
22
|
+
[r, e, f, b, p]
|
|
23
|
+
), F = l.useCallback(
|
|
25
24
|
(t, a) => {
|
|
26
|
-
var o, s, l, f, p;
|
|
27
25
|
switch (t.key) {
|
|
28
26
|
case "Backspace":
|
|
29
27
|
if (r[a] === "" && a > 0) {
|
|
30
28
|
t.preventDefault();
|
|
31
|
-
const
|
|
32
|
-
|
|
29
|
+
const o = [...r];
|
|
30
|
+
o[a - 1] = "", g(o), c.current[a - 1]?.focus();
|
|
33
31
|
}
|
|
34
32
|
break;
|
|
35
33
|
case "ArrowLeft":
|
|
36
|
-
a > 0 && (t.preventDefault(),
|
|
34
|
+
a > 0 && (t.preventDefault(), c.current[a - 1]?.focus());
|
|
37
35
|
break;
|
|
38
36
|
case "ArrowRight":
|
|
39
|
-
a < e - 1 && (t.preventDefault(),
|
|
37
|
+
a < e - 1 && (t.preventDefault(), c.current[a + 1]?.focus());
|
|
40
38
|
break;
|
|
41
39
|
case "Home":
|
|
42
|
-
t.preventDefault(),
|
|
40
|
+
t.preventDefault(), c.current[0]?.focus();
|
|
43
41
|
break;
|
|
44
42
|
case "End":
|
|
45
|
-
t.preventDefault(),
|
|
43
|
+
t.preventDefault(), c.current[e - 1]?.focus();
|
|
46
44
|
break;
|
|
47
45
|
}
|
|
48
46
|
},
|
|
49
47
|
[r, e]
|
|
50
|
-
),
|
|
48
|
+
), $ = l.useCallback(
|
|
51
49
|
(t, a) => {
|
|
52
|
-
var g, h;
|
|
53
50
|
t.preventDefault();
|
|
54
51
|
const o = t.clipboardData.getData("text").trim();
|
|
55
52
|
if (!o) return;
|
|
56
53
|
const s = [...r];
|
|
57
|
-
let
|
|
58
|
-
for (const
|
|
59
|
-
if (
|
|
60
|
-
s[
|
|
54
|
+
let n = a;
|
|
55
|
+
for (const j of o) {
|
|
56
|
+
if (n >= e) break;
|
|
57
|
+
s[n] = j, n++;
|
|
61
58
|
}
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
59
|
+
g(s);
|
|
60
|
+
const u = s.join(""), h = !s.includes(""), i = Math.min(n, e - 1);
|
|
61
|
+
c.current[i]?.focus(), h && (typeof f == "function" && f(u), p && c.current[i]?.blur());
|
|
65
62
|
},
|
|
66
|
-
[r, e,
|
|
67
|
-
),
|
|
63
|
+
[r, e, f, p]
|
|
64
|
+
), S = (t) => {
|
|
68
65
|
t.target.select();
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, k = (t) => {
|
|
66
|
+
}, V = () => {
|
|
67
|
+
g(Array(e).fill("")), c.current[0]?.focus();
|
|
68
|
+
}, D = (t) => {
|
|
73
69
|
if (t < 0 || t >= e)
|
|
74
70
|
throw new Error(`useOtpInput: index ${t} is out of bounds for numInputs ${e}.`);
|
|
75
71
|
const a = r.join("").length === e;
|
|
76
72
|
return {
|
|
77
|
-
id: `${
|
|
73
|
+
id: `${v}-${t}`,
|
|
78
74
|
"aria-label": `OTP digit ${t + 1} of ${e}`,
|
|
79
75
|
ref: (o) => {
|
|
80
76
|
c.current[t] = o;
|
|
81
77
|
},
|
|
82
78
|
value: r[t],
|
|
83
|
-
onChange: (o) =>
|
|
84
|
-
onKeyDown: (o) =>
|
|
85
|
-
onPaste: (o) =>
|
|
86
|
-
onFocus:
|
|
87
|
-
disabled:
|
|
79
|
+
onChange: (o) => O(o, t),
|
|
80
|
+
onKeyDown: (o) => F(o, t),
|
|
81
|
+
onPaste: (o) => $(o, t),
|
|
82
|
+
onFocus: S,
|
|
83
|
+
disabled: k && a,
|
|
88
84
|
type: "text",
|
|
89
85
|
inputMode: "numeric",
|
|
90
86
|
autoComplete: "one-time-code"
|
|
91
87
|
};
|
|
92
88
|
};
|
|
93
89
|
return {
|
|
94
|
-
getInputProps:
|
|
90
|
+
getInputProps: D,
|
|
95
91
|
getInputData: (t) => ({
|
|
96
|
-
...
|
|
92
|
+
...P(D(t), [
|
|
97
93
|
"onChange",
|
|
98
94
|
"onKeyDown",
|
|
99
95
|
"onPaste",
|
|
@@ -105,11 +101,11 @@ const C = ({
|
|
|
105
101
|
}),
|
|
106
102
|
otpValues: r,
|
|
107
103
|
otpString: r.join(""),
|
|
108
|
-
clearOtp:
|
|
104
|
+
clearOtp: V,
|
|
109
105
|
isOtpComplete: r.join("").length === e
|
|
110
106
|
};
|
|
111
107
|
};
|
|
112
108
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
R as default,
|
|
110
|
+
R as useOtpInput
|
|
115
111
|
};
|
package/dist/package.json.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="2.0.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="2.0.21",o={version:e};exports.default=o;exports.version=e;
|
package/dist/package.json.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
"name": "1mpacto-react-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=20.19.4",
|
|
@@ -43,7 +43,7 @@ declare const _default: {
|
|
|
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.
|
|
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 @@ declare const _default: {
|
|
|
64
64
|
"storybook": "10.1.4",
|
|
65
65
|
"ts-node": "^10.9.2",
|
|
66
66
|
"typescript": "~5.9.3",
|
|
67
|
-
"vite": "^
|
|
67
|
+
"vite": "^7.3.2",
|
|
68
68
|
"vite-plugin-dts": "^4.5.4"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
@@ -125,6 +125,7 @@ declare const _default: {
|
|
|
125
125
|
"react-virtuoso": "^4.16.1",
|
|
126
126
|
"tinymce": "^8.2.2"
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
}
|
|
129
|
+
;
|
|
129
130
|
|
|
130
131
|
export default _default;
|
package/dist/package.json.mjs
CHANGED
package/dist/utils/common.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|