Refactored #150
parent
ba4121afae
commit
0cebea6aed
|
@ -19,6 +19,8 @@ export declare class Dropdown extends Vue {
|
||||||
appendTo?: string;
|
appendTo?: string;
|
||||||
$emit(eventName: 'input', value: string): this;
|
$emit(eventName: 'input', value: string): this;
|
||||||
$emit(eventName: 'change', e: { originalEvent: Event, value: string }): this;
|
$emit(eventName: 'change', e: { originalEvent: Event, value: string }): this;
|
||||||
|
$emit(eventName: 'before-show'): this;
|
||||||
|
$emit(eventName: 'before-leave'): this;
|
||||||
$emit(eventName: 'show'): this;
|
$emit(eventName: 'show'): this;
|
||||||
$emit(eventName: 'hide'): this;
|
$emit(eventName: 'hide'): this;
|
||||||
$slot: {
|
$slot: {
|
||||||
|
|
|
@ -124,12 +124,12 @@ export default {
|
||||||
return selectedOptionIndex;
|
return selectedOptionIndex;
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
|
this.$emit('before-show');
|
||||||
this.overlayVisible = true;
|
this.overlayVisible = true;
|
||||||
this.$emit('show');
|
|
||||||
},
|
},
|
||||||
hide() {
|
hide() {
|
||||||
|
this.$emit('before-hide');
|
||||||
this.overlayVisible = false;
|
this.overlayVisible = false;
|
||||||
this.$emit('hide');
|
|
||||||
},
|
},
|
||||||
onFocus() {
|
onFocus() {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
|
@ -291,9 +291,12 @@ export default {
|
||||||
if (this.filter) {
|
if (this.filter) {
|
||||||
this.$refs.filterInput.focus();
|
this.$refs.filterInput.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$emit('show');
|
||||||
},
|
},
|
||||||
onOverlayLeave() {
|
onOverlayLeave() {
|
||||||
this.unbindOutsideClickListener();
|
this.unbindOutsideClickListener();
|
||||||
|
this.$emit('hide');
|
||||||
},
|
},
|
||||||
alignOverlay() {
|
alignOverlay() {
|
||||||
if (this.appendTo) {
|
if (this.appendTo) {
|
||||||
|
|
|
@ -16,6 +16,8 @@ export declare class MultiSelect extends Vue {
|
||||||
ariaLabelledBy?: string;
|
ariaLabelledBy?: string;
|
||||||
$emit(eventName: 'input', value: any): this;
|
$emit(eventName: 'input', value: any): this;
|
||||||
$emit(eventName: 'change', e: {originalEvent: Event, value: any}): this;
|
$emit(eventName: 'change', e: {originalEvent: Event, value: any}): this;
|
||||||
|
$emit(eventName: 'before-show'): this;
|
||||||
|
$emit(eventName: 'before-leave'): this;
|
||||||
$emit(eventName: 'show'): this;
|
$emit(eventName: 'show'): this;
|
||||||
$emit(eventName: 'hide'): this;
|
$emit(eventName: 'hide'): this;
|
||||||
$slots: {
|
$slots: {
|
||||||
|
|
|
@ -119,12 +119,12 @@ export default {
|
||||||
return selected;
|
return selected;
|
||||||
},
|
},
|
||||||
show() {
|
show() {
|
||||||
|
this.$emit('before-show');
|
||||||
this.overlayVisible = true;
|
this.overlayVisible = true;
|
||||||
this.$emit('show');
|
|
||||||
},
|
},
|
||||||
hide() {
|
hide() {
|
||||||
|
this.$emit('before-hide');
|
||||||
this.overlayVisible = false;
|
this.overlayVisible = false;
|
||||||
this.$emit('hide');
|
|
||||||
},
|
},
|
||||||
onFocus() {
|
onFocus() {
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
|
@ -255,9 +255,11 @@ export default {
|
||||||
onOverlayEnter() {
|
onOverlayEnter() {
|
||||||
this.alignOverlay();
|
this.alignOverlay();
|
||||||
this.bindOutsideClickListener();
|
this.bindOutsideClickListener();
|
||||||
|
this.$emit('show');
|
||||||
},
|
},
|
||||||
onOverlayLeave() {
|
onOverlayLeave() {
|
||||||
this.unbindOutsideClickListener();
|
this.unbindOutsideClickListener();
|
||||||
|
this.$emit('hide');
|
||||||
},
|
},
|
||||||
alignOverlay() {
|
alignOverlay() {
|
||||||
DomHandler.relativePosition(this.$refs.overlay, this.$refs.container);
|
DomHandler.relativePosition(this.$refs.overlay, this.$refs.container);
|
||||||
|
|
|
@ -188,15 +188,25 @@ data() {
|
||||||
<td>value: New value</td>
|
<td>value: New value</td>
|
||||||
<td>Callback to invoke on value change.</td>
|
<td>Callback to invoke on value change.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>before-show</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>Callback to invoke before the overlay is shown.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>before-hide</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>Callback to invoke before the overlay is hidden.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>show</td>
|
<td>show</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Callback to invoke when the dropdown overlay is shown.</td>
|
<td>Callback to invoke when the overlay is shown.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>hide</td>
|
<td>hide</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Callback to invoke when the dropdown overlay is hidden.</td>
|
<td>Callback to invoke when the overlay is hidden.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -180,15 +180,25 @@ data() {
|
||||||
<td>value: New value</td>
|
<td>value: New value</td>
|
||||||
<td>Callback to invoke on value change.</td>
|
<td>Callback to invoke on value change.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>before-show</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>Callback to invoke before the overlay is shown.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>before-hide</td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>Callback to invoke before the overlay is hidden.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>show</td>
|
<td>show</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Callback to invoke when the dropdown overlay is shown.</td>
|
<td>Callback to invoke when the overlay is shown.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>hide</td>
|
<td>hide</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>Callback to invoke when the dropdown overlay is hidden.</td>
|
<td>Callback to invoke when the overlay is hidden.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue