From d5be85119c6bf4ab3f6d949b789da5eb14228b51 Mon Sep 17 00:00:00 2001 From: Rizky Date: Tue, 2 Jul 2024 01:13:54 -0700 Subject: [PATCH] fix --- comps/form/field/type/TypeMoney.tsx | 7 +++---- comps/form/utils/init.tsx | 1 + comps/md/MasterDetail.tsx | 2 +- comps/md/parts/MDDetail.tsx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/comps/form/field/type/TypeMoney.tsx b/comps/form/field/type/TypeMoney.tsx index f93b40d..739c793 100755 --- a/comps/form/field/type/TypeMoney.tsx +++ b/comps/form/field/type/TypeMoney.tsx @@ -51,7 +51,6 @@ export const FieldMoney: FC<{ .replace(/[^0-9,-]/g, "") .toString(); const now = Number(value) || 0; - if ( !rawValue.endsWith(",") && !rawValue.endsWith("-") && @@ -77,6 +76,7 @@ export const FieldMoney: FC<{ input.value = rawValue; input.render(); } + console.log(fm.data[field.name]); }} value={formatCurrency(input.value)} disabled={disabled} @@ -154,7 +154,7 @@ export const formatMoney = (res: number) => { }; const isNumberOrCurrency = (input: any) => { // Pengecekan apakah input adalah angka biasa - + if (typeof input === "string") { let rs = input; if (input.startsWith("-")) { @@ -166,9 +166,8 @@ const isNumberOrCurrency = (input: any) => { } else if (dots && dots.length === 1) { if (!hasNonZeroDigitAfterDecimal(rs)) { return "Currency"; - } else { - return "Number"; } + return "Currency"; } } if (!isNaN(input)) { diff --git a/comps/form/utils/init.tsx b/comps/form/utils/init.tsx index 655fb24..bbb8fb6 100755 --- a/comps/form/utils/init.tsx +++ b/comps/form/utils/init.tsx @@ -29,6 +29,7 @@ export const formInit = (fm: FMLocal, props: FMProps) => { fm.internal.reload.timeout = setTimeout(async () => { if (sonar === "on" && !isEditor) { setTimeout(() => { + toast.dismiss(); toast.loading( <> diff --git a/comps/md/MasterDetail.tsx b/comps/md/MasterDetail.tsx index 7252d57..186de4f 100755 --- a/comps/md/MasterDetail.tsx +++ b/comps/md/MasterDetail.tsx @@ -99,7 +99,7 @@ export const MasterDetail: FC = (arg) => { return (
{md.props.show_head === "always" && } diff --git a/comps/md/parts/MDDetail.tsx b/comps/md/parts/MDDetail.tsx index 8f0fcf9..98dde04 100755 --- a/comps/md/parts/MDDetail.tsx +++ b/comps/md/parts/MDDetail.tsx @@ -20,7 +20,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => { {md.props.show_head === "only-child" && }
@@ -29,7 +29,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => { )}
div { flex: 1;