add events for each selector

main v0.3.1
HerrHase 1 month ago
parent 451e380dd7
commit 20fd9baced

@ -1,6 +1,6 @@
{ {
"name": "@tiny-components/datepicker", "name": "@tiny-components/datepicker",
"version": "0.3.0", "version": "0.3.1",
"description": "Datepicker for Desktop and Mobile", "description": "Datepicker for Desktop and Mobile",
"repository": { "repository": {
"type": "git", "type": "git",

@ -150,6 +150,10 @@ export default {
this.state.date = this.state.date.month(event.target.value) this.state.date = this.state.date.month(event.target.value)
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },
@ -163,6 +167,10 @@ export default {
this.state.date = this.state.date.year(event.target.value) this.state.date = this.state.date.year(event.target.value)
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },
@ -177,6 +185,10 @@ export default {
this.state.date = this.state.date.subtract(1, 'month') this.state.date = this.state.date.subtract(1, 'month')
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },
@ -191,6 +203,10 @@ export default {
this.state.date = this.state.date.add(1, 'month') this.state.date = this.state.date.add(1, 'month')
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },
@ -204,6 +220,10 @@ export default {
this.state.date = this.state.date.subtract(1, 'year') this.state.date = this.state.date.subtract(1, 'year')
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },
@ -217,6 +237,10 @@ export default {
this.state.date = this.state.date.add(1, 'year') this.state.date = this.state.date.add(1, 'year')
this.createWeeksAndDays() this.createWeeksAndDays()
store.trigger(this.state.namespace + 'change', {
date: this.state.date.clone()
})
this.update() this.update()
}, },

Loading…
Cancel
Save