Skip to content

Commit

Permalink
Fixed #148 - Rename select event with *-select
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 20, 2020
1 parent 97d7441 commit 8298fc0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/components/autocomplete/AutoComplete.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export declare class AutoComplete extends Vue {
delay?: number;
ariaLabelledBy?: string;
$emit(eventName: 'input', value: any): this;
$emit(eventName: 'select', e: {originalEvent: Event, value: any}): this;
$emit(eventName: 'unselect', e: {originalEvent: Event, value: any}): this;
$emit(eventName: 'item-select', e: {originalEvent: Event, value: any}): this;
$emit(eventName: 'item-unselect', e: {originalEvent: Event, value: any}): this;
$emit(eventName: 'dropdown-click', e: {originalEvent: Event, query: string}): this;
$emit(eventName: 'complete', e: {originalEvent: Event, query: string}): this;
$emit(eventName: 'clear'): this;
Expand Down
6 changes: 3 additions & 3 deletions src/components/autocomplete/AutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export default {
this.$emit('input', item);
}
this.$emit('select', {
this.$emit('item-select', {
originalEvent: event,
value: item
});
Expand All @@ -167,7 +167,7 @@ export default {
let removedValue = this.value[index];
let newValue = this.value.filter((val, i) => (index !== i));
this.$emit('input', newValue);
this.$emit('unselect', {
this.$emit('item-unselect', {
originalEvent: event,
value: removedValue
});
Expand Down Expand Up @@ -323,7 +323,7 @@ export default {
let newValue = this.value.slice(0, -1);
this.$emit('input', newValue);
this.$emit('unselect', {
this.$emit('item-unselect', {
originalEvent: event,
value: removedValue
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/calendar/Calendar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export declare class Calendar extends Vue {
$emit(eventName: 'hide'): this;
$emit(eventName: 'month-change', e: { month: number, year: number }): this;
$emit(eventName: 'year-change', e: { month: number, year: number }): this;
$emit(eventName: 'select', value: Date): this;
$emit(eventName: 'date-select', value: Date): this;
$emit(eventName: 'input', value: Date): this;
$emit(eventName: 'today-click', value: Date): this;
$emit(eventName: 'clear-click', event: Event): this;
Expand Down
4 changes: 2 additions & 2 deletions src/components/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ export default {
this.updateModel(modelVal);
this.updateInputFieldValue(modelVal);
}
this.$emit('select', date);
this.$emit('date-select', date);
},
updateModel(value) {
this.$emit('input', value);
Expand Down Expand Up @@ -1221,7 +1221,7 @@ export default {
this.updateModel(value);
this.updateInputFieldValue(value);
this.$emit('select', value);
this.$emit('date-select', value);
},
toggleAMPM(event) {
this.pm = !this.pm;
Expand Down
4 changes: 2 additions & 2 deletions src/views/autocomplete/AutoCompleteDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ export default {
<td>Callback to invoke to search for suggestions.</td>
</tr>
<tr>
<td>select</td>
<td>item-select</td>
<td>event.originalEvent: Browser event <br />
event.value: Selected item</td>
<td>Callback to invoke when a suggestion is selected.</td>
</tr>
<tr>
<td>unselect</td>
<td>item-unselect</td>
<td>event.originalEvent: Browser event <br />
event.value: Unselected item</td>
<td>Callback to invoke when a selected value is removed.</td>
Expand Down
5 changes: 2 additions & 3 deletions src/views/calendar/CalendarDoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,9 @@ export default {
</thead>
<tbody>
<tr>
<td>select</td>
<td>date-select</td>
<td>value: Selected value</td>
<td>Callback to invoke when a date is selected.
</td>
<td>Callback to invoke when a date is selected.</td>
</tr>
<tr>
<td>show</td>
Expand Down

0 comments on commit 8298fc0

Please sign in to comment.