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, "") .replace(/[^0-9,-]/g, "")
.toString(); .toString();
const now = Number(value) || 0; const now = Number(value) || 0;
if ( if (
!rawValue.endsWith(",") && !rawValue.endsWith(",") &&
!rawValue.endsWith("-") && !rawValue.endsWith("-") &&
@ -77,6 +76,7 @@ export const FieldMoney: FC<{
input.value = rawValue; input.value = rawValue;
input.render(); input.render();
} }
console.log(fm.data[field.name]);
}} }}
value={formatCurrency(input.value)} value={formatCurrency(input.value)}
disabled={disabled} disabled={disabled}
@ -154,7 +154,7 @@ export const formatMoney = (res: number) => {
}; };
const isNumberOrCurrency = (input: any) => { const isNumberOrCurrency = (input: any) => {
// Pengecekan apakah input adalah angka biasa // Pengecekan apakah input adalah angka biasa
if (typeof input === "string") { if (typeof input === "string") {
let rs = input; let rs = input;
if (input.startsWith("-")) { if (input.startsWith("-")) {
@ -166,9 +166,8 @@ const isNumberOrCurrency = (input: any) => {
} else if (dots && dots.length === 1) { } else if (dots && dots.length === 1) {
if (!hasNonZeroDigitAfterDecimal(rs)) { if (!hasNonZeroDigitAfterDecimal(rs)) {
return "Currency"; return "Currency";
} else {
return "Number";
} }
return "Currency";
} }
} }
if (!isNaN(input)) { if (!isNaN(input)) {

View File

@ -29,6 +29,7 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
fm.internal.reload.timeout = setTimeout(async () => { fm.internal.reload.timeout = setTimeout(async () => {
if (sonar === "on" && !isEditor) { if (sonar === "on" && !isEditor) {
setTimeout(() => { setTimeout(() => {
toast.dismiss();
toast.loading( toast.loading(
<> <>
<Loader2 className="c-h-4 c-w-4 c-animate-spin" /> <Loader2 className="c-h-4 c-w-4 c-animate-spin" />

View File

@ -99,7 +99,7 @@ export const MasterDetail: FC<MDProps> = (arg) => {
return ( return (
<div <div
className={cx( 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} />} {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} />} {md.props.show_head === "only-child" && <MDHeader md={md} mdr={mdr} />}
<div <div
className={cx( 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" md.props.tab_mode === "v-tab" && "c-flex-col"
)} )}
> >
@ -29,7 +29,7 @@ export const MDDetail: FC<{ md: MDLocal; mdr: MDRef }> = ({ md, mdr }) => {
)} )}
<div <div
className={cx( className={cx(
"md-tab " + md.tab.active, "md-tab c-absolute c-inset-0 " + md.tab.active,
css` css`
> div { > div {
flex: 1; flex: 1;