Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
validations() {
return {
gasPrice: {
required: requiredIf(
() => this.step === feeStep && this.session.experimentalMode
),
// we don't use SMALLEST as min gas price because it can be a fraction of uatom
// min is 0 because we support sending 0 fees
between: between(0, atoms(this.balance))
}
}
}
}
computed: {
...mapGetters('modal', [
'modalDataID',
'modalData',
'modalActive'
])
},
validations: {
formData: {
name: {
required,
minLength: minLength(3)
},
percent: {
required,
between: between(0.10, 100)
},
description: {
maxLength: maxLength(255)
}
}
},
// watch: {
// 'modalDataID' (val) {
// if (val) {
// this.isEdit = true
// this.setData()
// } else {
// this.isEdit = false
// }
// },
// 'modalActive' (val) {
validations () {
return {
newEstimate: {
estimate_date: {
required
},
expiry_date: {
required
},
estimate_number: {
required
},
discount_val: {
between: between(0, this.subtotal)
},
notes: {
maxLength: maxLength(255)
},
reference_number: {
maxLength: maxLength(255)
}
},
selectedCustomer: {
required
}
}
},
computed: {
item: {
name: {
required
},
quantity: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
price: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
discount_val: {
between: between(0, this.maxDiscount)
},
description: {
maxLength: maxLength(255)
}
}
}
},
created () {
amount: null,
denom: ''
},
sending: false
}),
validations: {
fields: {
address: {
required,
minLength: minLength(39),
maxLength: maxLength(42),
alphaNum: alphaNum
},
amount: {
required,
between: between(1, 1000000)
},
denom: {
required
}
}
}
}
item: {
name: {
required
},
quantity: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
price: {
required,
minValue: minValue(1),
maxLength: maxLength(20)
},
discount_val: {
between: between(0, this.maxDiscount)
},
description: {
maxLength: maxLength(255)
}
}
}
},
created () {
validations () {
return {
newInvoice: {
invoice_date: {
required
},
due_date: {
required
},
invoice_number: {
required
},
discount_val: {
between: between(0, this.subtotal)
},
notes: {
maxLength: maxLength(255)
},
reference_number: {
maxLength: maxLength(255)
}
},
selectedCustomer: {
required
}
}
},
computed: {
maxLength: maxLength(this.titleMaxLength),
notBlank
},
description: {
required,
minLength: minLength(1),
maxLength: maxLength(this.descriptionMaxLength),
notBlank
},
type: {
isValid
},
amount: {
required: x => !!x && x !== `0`,
decimal,
between: between(SMALLEST, atoms(this.balance))
}
}
},
methods: {
validations() {
return {
amount: {
required: x => !!x && x !== `0`,
decimal,
between: between(SMALLEST, this.balance.amount)
}
}
},
methods: {