2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

fix: Add placeholders for Item fields

This commit is contained in:
Faris Ansari 2019-10-22 18:52:56 +05:30
parent ebc8693c69
commit b9e52917be
3 changed files with 12 additions and 4 deletions

View File

@ -8,6 +8,7 @@ module.exports = {
fieldname: 'name', fieldname: 'name',
label: 'Item Name', label: 'Item Name',
fieldtype: 'Data', fieldtype: 'Data',
placeholder: 'Item Name',
required: 1 required: 1
}, },
{ {
@ -27,6 +28,7 @@ module.exports = {
label: 'Income', label: 'Income',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
placeholder: 'Sales',
required: 1, required: 1,
getFilters: query => { getFilters: query => {
return { return {
@ -40,6 +42,7 @@ module.exports = {
label: 'Expense', label: 'Expense',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Account', target: 'Account',
placeholder: 'Cost of Goods Sold',
required: 1, required: 1,
getFilters: query => { getFilters: query => {
return { return {
@ -59,12 +62,14 @@ module.exports = {
fieldname: 'tax', fieldname: 'tax',
label: 'Tax', label: 'Tax',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Tax' target: 'Tax',
placeholder: 'GST'
}, },
{ {
fieldname: 'rate', fieldname: 'rate',
label: 'Rate', label: 'Rate',
fieldtype: 'Currency' fieldtype: 'Currency',
placeholder: '0.00'
} }
], ],
quickEditFields: [ quickEditFields: [

View File

@ -5,7 +5,7 @@
:class="inputClasses" :class="inputClasses"
type="text" type="text"
:value="linkValue" :value="linkValue"
:placeholder="placeholder" :placeholder="inputPlaceholder"
:readonly="df.readOnly" :readonly="df.readOnly"
@focus="onFocus" @focus="onFocus"
@input="onInput" @input="onInput"

View File

@ -5,7 +5,7 @@
:class="inputClasses" :class="inputClasses"
:type="inputType" :type="inputType"
:value="value" :value="value"
:placeholder="placeholder || df.placeholder" :placeholder="inputPlaceholder"
:readonly="df.readOnly" :readonly="df.readOnly"
@blur="e => triggerChange(e.target.value)" @blur="e => triggerChange(e.target.value)"
/> />
@ -30,6 +30,9 @@ export default {
}, },
'focus:outline-none focus:bg-gray-200 rounded-5px w-full text-gray-900' 'focus:outline-none focus:bg-gray-200 rounded-5px w-full text-gray-900'
]; ];
},
inputPlaceholder() {
return this.placeholder || this.df.placeholder
} }
}, },
methods: { methods: {