Add inset_form to options and date picker macros

This commit is contained in:
leigh-mil
2019-08-27 13:14:40 -04:00
parent b7f8152cc1
commit 99e2c84d3c
6 changed files with 30 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ export default {
type: Boolean,
default: true,
},
insetForm: Boolean,
},
data: function() {
@@ -36,6 +37,7 @@ export default {
month: this.initialmonth,
year: this.initialyear,
name: this.nameTag,
showValidation: !this.insetForm,
}
},
@@ -160,6 +162,8 @@ export default {
methods: {
onInput: function(e) {
this.showValidation = true
emitEvent('field-change', this, {
value: this.formattedDate,
name: this.name,

View File

@@ -22,6 +22,7 @@ export default {
type: String,
default: '',
},
insetForm: Boolean,
},
created: function() {
@@ -36,7 +37,7 @@ export default {
const showError = (this.initialErrors && this.initialErrors.length) || false
return {
showError: showError,
showValid: !showError && !!this.initialValue,
showValid: !this.insetForm && (!showError && !!this.initialValue),
validationError: this.initialErrors.join(' '),
value: this.initialValue,
}