1
0
forked from test/crm

fix: update mandatory field indicator color and replace FormControl with FormattedInput for various field types

(cherry picked from commit afe828f01206c22c1f3679f9ab7663b5b9887653)
This commit is contained in:
Shariq Ansari 2025-05-14 16:55:19 +05:30 committed by Mergify
parent 5f32db7f1d
commit 7b69dbbfb1
3 changed files with 21 additions and 11 deletions

View File

@ -42,6 +42,14 @@
:title="field.label"
>
{{ __(field.label) }}
<span
v-if="
field.reqd ||
(field.mandatory_depends_on && field.mandatory_via_depends_on)
"
class="text-ink-red-2"
>*</span
>
</div>
</div>
<div class="w-12">

View File

@ -7,7 +7,7 @@
field.reqd ||
(field.mandatory_depends_on && field.mandatory_via_depends_on)
"
class="text-ink-red-3"
class="text-ink-red-2"
>*</span
>
</div>
@ -161,7 +161,7 @@
:description="field.description"
@change="fieldChange($event.target.value, field)"
/>
<FormControl
<FormattedInput
v-else-if="['Int'].includes(field.fieldtype)"
type="number"
:placeholder="getPlaceholder(field)"
@ -170,7 +170,7 @@
:description="field.description"
@change="fieldChange($event.target.value, field)"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Percent'"
type="text"
:value="getFormattedPercent(field.fieldname, data)"
@ -179,7 +179,7 @@
:description="field.description"
@change="fieldChange(flt($event.target.value), field)"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Float'"
type="text"
:value="getFormattedFloat(field.fieldname, data)"
@ -188,7 +188,7 @@
:description="field.description"
@change="fieldChange(flt($event.target.value), field)"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Currency'"
type="text"
:value="getFormattedCurrency(field.fieldname, data, parentDoc)"
@ -209,6 +209,7 @@
</div>
</template>
<script setup>
import FormattedInput from '@/components/Controls/FormattedInput.vue'
import EditIcon from '@/components/Icons/EditIcon.vue'
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
import UserAvatar from '@/components/UserAvatar.vue'

View File

@ -53,7 +53,7 @@
(field.mandatory_depends_on &&
field.mandatory_via_depends_on)
"
class="text-ink-red-3"
class="text-ink-red-2"
>*</span
>
</div>
@ -254,7 +254,7 @@
@change="(v) => fieldChange(v, field)"
/>
</div>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Percent'"
class="form-control"
type="text"
@ -267,16 +267,16 @@
fieldChange(flt($event.target.value), field)
"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Int'"
class="form-control"
type="number"
type="text"
v-model="document.doc[field.fieldname]"
:placeholder="field.placeholder"
:debounce="500"
@change.stop="fieldChange($event.target.value, field)"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Float'"
class="form-control"
type="text"
@ -289,7 +289,7 @@
fieldChange(flt($event.target.value), field)
"
/>
<FormControl
<FormattedInput
v-else-if="field.fieldtype === 'Currency'"
class="form-control"
type="text"
@ -355,6 +355,7 @@
</template>
<script setup>
import FormattedInput from '@/components/Controls/FormattedInput.vue'
import Section from '@/components/Section.vue'
import NestedPopover from '@/components/NestedPopover.vue'
import DropdownItem from '@/components/DropdownItem.vue'