Skip to content

Commit

Permalink
fix: hyphenate remaining event names (#7917)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekkarczmarczyk committed Jul 22, 2019
1 parent 6805263 commit 6fac25d
Show file tree
Hide file tree
Showing 32 changed files with 63 additions and 62 deletions.
2 changes: 1 addition & 1 deletion packages/api-generator/src/helpers/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const VSelect = {
value: 'any',
},
{
name: 'update:searchInput',
name: 'update:search-input',
value: 'string',
},
...inputEvents,
Expand Down
28 changes: 14 additions & 14 deletions packages/api-generator/src/maps/v-bottom-navigation.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
'v-bottom-navigation': {
events: [
{
name: 'change',
value: 'any',
},
{
name: 'update:inputValue',
value: 'string | number',
},
],
},
}
module.exports = {
'v-bottom-navigation': {
events: [
{
name: 'change',
value: 'any',
},
{
name: 'update:input-value',
value: 'string | number',
},
],
},
}
2 changes: 1 addition & 1 deletion packages/api-generator/src/maps/v-navigation-drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = {
value: 'object',
},
{
name: 'update:miniVariant',
name: 'update:mini-variant',
value: 'boolean',
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/lang/en/components/Autocompletes.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"click:prepend": "Components.Inputs.events['click:prepend']",
"click:prepend-inner": "Components.TextFields.events['click:prepend-inner']",
"update:error": "Mixins.Validatable.events['update:error']",
"update:searchInput": "The `search-input.sync` event"
"update:search-input": "The `search-input.sync` event"
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/en/components/BottomNavigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
},
"events": {
"change": "The value of currently selected button. If no value is assigne, will be the current index of the button.",
"update:inputValue": "The event used for `input-value.sync`."
"update:input-value": "The event used for `input-value.sync`."
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/en/components/Combobox.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"click:prepend": "Components.Inputs.events['click:prepend']",
"click:prepend-inner": "Components.TextFields.events['click:prepend-inner']",
"update:error": "Mixins.Validatable.events['update:error']",
"update:searchInput": "The `search-input.sync` event"
"update:search-input": "The `search-input.sync` event"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"events": {
"transitionend": "Emits event object when transition is complete.",
"update:miniVariant": "The `mini-variant.sync` event"
"update:mini-variant": "The `mini-variant.sync` event"
},
"slots": {
"append": "A slot at the bottom of the drawer",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/lang/en/components/OverflowBtns.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@
"click:prepend": "Components.Inputs.events['click:prepend']",
"click:prepend-inner": "Components.TextFields.events['click:prepend-inner']",
"update:error": "Mixins.Validatable.events['update:error']",
"update:searchInput": "The `search-input.sync` event"
"update:search-input": "The `search-input.sync` event"
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/en/components/Selects.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@
"click:prepend": "Components.Inputs.events['click:prepend']",
"click:prepend-inner": "Components.TextFields.events['click:prepend-inner']",
"update:error": "Mixins.Validatable.events['update:error']",
"update:searchInput": "The `search-input.sync` event"
"update:search-input": "The `search-input.sync` event"
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/eo-UY/components/Autocompletes.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@
"click:prepend": "crwdns25658:0crwdne25658:0",
"click:prepend-inner": "crwdns25660:0crwdne25660:0",
"update:error": "crwdns25662:0crwdne25662:0",
"update:searchInput": "crwdns25664:0crwdne25664:0"
"update:search-input": "crwdns25664:0crwdne25664:0"
}
}
4 changes: 2 additions & 2 deletions packages/docs/src/lang/eo-UY/components/BottomNavigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"mandatory": "crwdns26224:0crwdne26224:0"
},
"events": {
"update:inputValue": "crwdns26226:0crwdne26226:0"
"update:input-value": "crwdns26226:0crwdne26226:0"
}
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/eo-UY/components/Combobox.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"click:prepend": "crwdns27992:0crwdne27992:0",
"click:prepend-inner": "crwdns27994:0crwdne27994:0",
"update:error": "crwdns27996:0crwdne27996:0",
"update:searchInput": "crwdns27998:0crwdne27998:0"
"update:search-input": "crwdns27998:0crwdne27998:0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"touchless": "crwdns27830:0crwdne27830:0"
},
"events": {
"update:miniVariant": "crwdns27832:0crwdne27832:0"
"update:mini-variant": "crwdns27832:0crwdne27832:0"
},
"slots": {
"append": "crwdns36090:0crwdne36090:0",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/lang/eo-UY/components/Selects.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@
"click:prepend": "crwdns27026:0crwdne27026:0",
"click:prepend-inner": "crwdns27028:0crwdne27028:0",
"update:error": "crwdns27030:0crwdne27030:0",
"update:searchInput": "crwdns27032:0crwdne27032:0"
"update:search-input": "crwdns27032:0crwdne27032:0"
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/fr-FR/components/Autocompletes.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"hideNoData": "Masque le menu lorsqu'il n'y a pas d'options à afficher. Utile pour empêcher le menu de s'ouvrir avant que les résultats ne soient récupérés de manière asynchrone. Il a également l'effet d'ouvrir le menu lorsque le tableau `items` change, s'il n'est pas déjà ouvert."
},
"events": {
"update:searchInput": "L'événement `search-input.sync`"
"update:search-input": "L'événement `search-input.sync`"
}
}
4 changes: 2 additions & 2 deletions packages/docs/src/lang/fr-FR/components/BottomNavigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"inputValue": "Maintient la valeur du bouton actuellement actif. Si le bouton n'a pas de valeur fournie, son index sera utilisé à la place. Ce prop supporte le modificateur **.sync** ."
},
"events": {
"update:inputValue": "L'événement utilisé pour `input-value.sync`"
"update:input-value": "L'événement utilisé pour `input-value.sync`"
}
}
}
4 changes: 2 additions & 2 deletions packages/docs/src/lang/fr-FR/components/Combobox.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"header": "# Menu déroulant",
"events": {
"update:searchInput": "L'événement `search-input.sync`"
"update:search-input": "L'événement `search-input.sync`"
}
}
}
4 changes: 2 additions & 2 deletions packages/docs/src/lang/fr-FR/components/Selects.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"events": {
"update:searchInput": "L'événement `search-input.sync`"
"update:search-input": "L'événement `search-input.sync`"
}
}
}
2 changes: 1 addition & 1 deletion packages/docs/src/lang/ru-RU/components/Selects.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@
"events": {
"change": "Mixins.Input.events.change",
"update:error": "Mixins.Input.events.update:error",
"update:searchInput": "`search-input.sync` событие"
"update:search-input": "`search-input.sync` событие"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default VSelect.extend({
set (val: any) {
this.lazySearch = val

this.$emit('update:searchInput', val)
this.$emit('update:search-input', val)
},
},
isAnyValueAllowed (): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('VAutocomplete.ts', () => {
const element = input.element as HTMLInputElement

const update = jest.fn()
wrapper.vm.$on('update:searchInput', update)
wrapper.vm.$on('update:search-input', update)

element.value = 'test'
input.trigger('input')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default mixins(
methods: {
thresholdMet () {
this.isActive = !this.isScrollingUp
this.$emit('update:inputValue', this.isActive)
this.$emit('update:input-value', this.isActive)
},
updateApplication (): number {
return this.$el
Expand Down
10 changes: 5 additions & 5 deletions packages/vuetify/src/components/VDatePicker/VDatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default mixins(
// compare for example '2000-9' and '2000-10'
const sanitizeType = this.type === 'month' ? 'year' : 'month'
this.isReversing = sanitizeDateString(val, sanitizeType) < sanitizeDateString(prev, sanitizeType)
this.$emit('update:pickerDate', val)
this.$emit('update:picker-date', val)
},
pickerDate (val: string | null) {
if (val) {
Expand Down Expand Up @@ -252,7 +252,7 @@ export default mixins(
this.checkMultipleProp()

if (this.pickerDate !== this.tableDate) {
this.$emit('update:pickerDate', this.tableDate)
this.$emit('update:picker-date', this.tableDate)
}
this.setInputDate()
},
Expand Down Expand Up @@ -329,7 +329,7 @@ export default mixins(
},
slot: 'title',
on: {
'update:selectingYear': (value: boolean) => this.activePicker = value ? 'YEAR' : this.type.toUpperCase(),
'update:selecting-year': (value: boolean) => this.activePicker = value ? 'YEAR' : this.type.toUpperCase(),
},
})
},
Expand Down Expand Up @@ -381,7 +381,7 @@ export default mixins(
ref: 'table',
on: {
input: this.dateClick,
tableDate: (value: string) => this.tableDate = value,
'update:table-date': (value: string) => this.tableDate = value,
'click:date': (value: string) => this.$emit('click:date', value),
'dblclick:date': (value: string) => this.$emit('dblclick:date', value),
},
Expand Down Expand Up @@ -410,7 +410,7 @@ export default mixins(
ref: 'table',
on: {
input: this.monthClick,
tableDate: (value: string) => this.tableDate = value,
'update:table-date': (value: string) => this.tableDate = value,
'click:month': (value: string) => this.$emit('click:month', value),
'dblclick:month': (value: string) => this.$emit('dblclick:month', value),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,15 @@ describe('VDatePicker.ts', () => { // eslint-disable-line max-statements
expect(icons[1].element.textContent).toBe('check')
})

it('should emit update:pickerDate event when tableDate changes', async () => {
it('should emit update:picker-date event when tableDate changes', async () => {
const wrapper = mountFunction({
propsData: {
value: '2017-09',
},
})

const pickerDate = jest.fn()
wrapper.vm.$on('update:pickerDate', pickerDate)
wrapper.vm.$on('update:picker-date', pickerDate)
wrapper.vm.tableDate = '2013-11'
await wrapper.vm.$nextTick()
expect(pickerDate).toHaveBeenCalledWith('2013-11')
Expand All @@ -538,7 +538,7 @@ describe('VDatePicker.ts', () => { // eslint-disable-line max-statements
})

const update = jest.fn()
wrapper.vm.$on('update:pickerDate', update)
wrapper.vm.$on('update:picker-date', update)
await wrapper.vm.$nextTick()

wrapper.setProps({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ describe('VDatePickerDateTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('wheel')
expect(tableDate).toHaveBeenCalledWith('2005-06')
Expand All @@ -245,7 +245,7 @@ describe('VDatePickerDateTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('wheel')
expect(tableDate).not.toHaveBeenCalled()
Expand All @@ -260,7 +260,7 @@ describe('VDatePickerDateTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('touchstart')
wrapper.trigger('touchend')
Expand All @@ -275,7 +275,7 @@ describe('VDatePickerDateTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.vm.touch(1, wrapper.vm.calculateTableDate)
expect(tableDate).toHaveBeenCalledWith('2005-06')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('VDatePickerMonthTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('wheel')
expect(tableDate).toHaveBeenCalledWith('2006')
Expand All @@ -134,7 +134,7 @@ describe('VDatePickerMonthTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('wheel')
expect(tableDate).not.toHaveBeenCalled()
Expand All @@ -149,7 +149,7 @@ describe('VDatePickerMonthTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.trigger('touchstart')
wrapper.trigger('touchend')
Expand All @@ -164,7 +164,7 @@ describe('VDatePickerMonthTable.ts', () => {
})

const tableDate = jest.fn()
wrapper.vm.$on('tableDate', tableDate)
wrapper.vm.$on('update:table-date', tableDate)

wrapper.vm.touch(1, wrapper.vm.calculateTableDate)
expect(tableDate).toHaveBeenCalledWith('2006')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('VDatePickerTitle.ts', () => {
})

const input = jest.fn(value => wrapper.setProps({ selectingYear: value }))
wrapper.vm.$on('update:selectingYear', input)
wrapper.vm.$on('update:selecting-year', input)

wrapper.findAll('.v-date-picker-title__date').at(0).trigger('click')
expect(input).not.toHaveBeenCalled()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ export default mixins(
},
wheel (e: WheelEvent, calculateTableDate: CalculateTableDateFunction) {
e.preventDefault()
this.$emit('tableDate', calculateTableDate(e.deltaY))
this.$emit('update:table-date', calculateTableDate(e.deltaY))
},
touch (value: number, calculateTableDate: CalculateTableDateFunction) {
this.$emit('tableDate', calculateTableDate(value))
this.$emit('update:table-date', calculateTableDate(value))
},
genTable (staticClass: string, children: VNodeChildren, calculateTableDate: CalculateTableDateFunction) {
const transition = this.$createElement('transition', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export default baseMixins.extend({
}

if (this.miniVariant) {
on.click = () => this.$emit('update:miniVariant', false)
on.click = () => this.$emit('update:mini-variant', false)
}

if (this.expandOnHover) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ describe('VNavigationDrawer', () => {
miniVariant: true,
},
listeners: {
'update:miniVariant': update,
'update:mini-variant': update,
},
})

Expand Down
Loading

0 comments on commit 6fac25d

Please sign in to comment.