fix: update field visibility logic and disable inputs based on read-only status

This commit is contained in:
Shariq Ansari 2025-05-14 19:08:29 +05:30
parent 0047077074
commit 3516e1ff44

View File

@ -65,7 +65,14 @@
<div <div
v-if=" v-if="
field.read_only && field.read_only &&
!['Check', 'Dropdown'].includes(field.fieldtype) ![
'Int',
'Float',
'Currency',
'Percent',
'Check',
'Dropdown',
].includes(field.fieldtype)
" "
class="flex h-7 cursor-pointer items-center px-2 py-1 text-ink-gray-5" class="flex h-7 cursor-pointer items-center px-2 py-1 text-ink-gray-5"
> >
@ -266,6 +273,7 @@
@change.stop=" @change.stop="
fieldChange(flt($event.target.value), field) fieldChange(flt($event.target.value), field)
" "
:disabled="Boolean(field.read_only)"
/> />
<FormattedInput <FormattedInput
v-else-if="field.fieldtype === 'Int'" v-else-if="field.fieldtype === 'Int'"
@ -275,6 +283,7 @@
:placeholder="field.placeholder" :placeholder="field.placeholder"
:debounce="500" :debounce="500"
@change.stop="fieldChange($event.target.value, field)" @change.stop="fieldChange($event.target.value, field)"
:disabled="Boolean(field.read_only)"
/> />
<FormattedInput <FormattedInput
v-else-if="field.fieldtype === 'Float'" v-else-if="field.fieldtype === 'Float'"
@ -288,6 +297,7 @@
@change.stop=" @change.stop="
fieldChange(flt($event.target.value), field) fieldChange(flt($event.target.value), field)
" "
:disabled="Boolean(field.read_only)"
/> />
<FormattedInput <FormattedInput
v-else-if="field.fieldtype === 'Currency'" v-else-if="field.fieldtype === 'Currency'"
@ -301,6 +311,7 @@
@change.stop=" @change.stop="
fieldChange(flt($event.target.value), field) fieldChange(flt($event.target.value), field)
" "
:disabled="Boolean(field.read_only)"
/> />
<FormControl <FormControl
v-else v-else