This commit is contained in:
Rizky 2024-07-02 01:13:54 -07:00
parent edb153e260
commit d5be85119c
4 changed files with 7 additions and 7 deletions

View File

@ -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)) {

View File

@ -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(
<>
<Loader2 className="c-h-4 c-w-4 c-animate-spin" />

View File

@ -99,7 +99,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
return (
<div
className={cx(
"c-flex-1 c-flex-col c-flex c-w-full c-h-full c-overflow-hidden"
"c-flex-1 c-flex-col c-flex c-w-full c-h-full"
)}
>
{md.props.show_head === "always" && <MDHeader md={md} mdr={mdr} />}

View File

@ -20,7 +20,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
{md.props.show_head === "only-child" && <MDHeader md={md} mdr={mdr} />}
<div
className={cx(
"c-w-full c-h-full c-flex c-flex-1",
"c-w-full c-h-full c-flex c-flex-1 c-overflow-auto c-relative",
md.props.tab_mode === "v-tab" && "c-flex-col"
)}
>
@ -29,7 +29,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
)}
<div
className={cx(
"md-tab " + md.tab.active,
"md-tab c-absolute c-inset-0 " + md.tab.active,
css`
> div {
flex: 1;