Create emitter function for field-change event
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'checkboxinput',
|
||||
|
||||
@@ -15,7 +17,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function() {
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
},
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { emitEvent } from '../lib/emitters'
|
||||
import { emitFieldChange, emitEvent } from '../lib/emitters'
|
||||
import optionsinput from './options_input'
|
||||
import textinput from './text_input'
|
||||
import clindollaramount from './clin_dollar_amount'
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
} else if (event && event.name.includes(NUMBER)) {
|
||||
this.clinNumber = event.value
|
||||
}
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
|
||||
removeClin: function() {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import { getDaysInMonth } from 'date-fns'
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
let paddedNumber = function(number) {
|
||||
if ((number + '').length === 1) {
|
||||
@@ -209,7 +210,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function() {
|
||||
this.$parent.$emit('field-change', {
|
||||
emitFieldChange(this, {
|
||||
value: this.formattedDate,
|
||||
name: this.name,
|
||||
valid: this.isDateValid,
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'multicheckboxinput',
|
||||
|
||||
@@ -32,7 +34,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function(e) {
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
this.showError = false
|
||||
this.showValid = true
|
||||
},
|
||||
|
@@ -1,3 +1,5 @@
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'optionsinput',
|
||||
|
||||
@@ -31,7 +33,7 @@ export default {
|
||||
|
||||
methods: {
|
||||
onInput: function() {
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
|
||||
_isValid: function(value) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { format } from 'date-fns'
|
||||
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
import DateSelector from './date_selector'
|
||||
|
||||
const START_DATE = 'start_date'
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
let date = new Date(event.value)
|
||||
this.maxStartDate = this.calcMaxStartDate(date)
|
||||
}
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
|
||||
calcMaxStartDate: function(date) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { buildUploader } from '../lib/upload'
|
||||
import { emitFieldChange } from '../lib/emitters'
|
||||
|
||||
export default {
|
||||
name: 'uploadinput',
|
||||
@@ -68,7 +69,7 @@ export default {
|
||||
|
||||
this.changed = true
|
||||
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
removeAttachment: function(e) {
|
||||
e.preventDefault()
|
||||
@@ -80,7 +81,7 @@ export default {
|
||||
this.clearErrors()
|
||||
this.changed = true
|
||||
|
||||
this.$parent.$emit('field-change')
|
||||
emitFieldChange(this)
|
||||
},
|
||||
clearErrors: function() {
|
||||
this.uploadError = false
|
||||
|
Reference in New Issue
Block a user