import Component from 'vue-class-component';
import { BaseInput, InputType } from '../base';

@Component
export default class PasswordInput extends BaseInput {
  inputType: Extract<InputType, 'password' | 'text'> = 'password';

  onMouseUp(): void {
    this.inputType = 'password';
  }

  mounted(): void {
    window.addEventListener('mouseup', this.onMouseUp);
  }

  unmounted(): void {
    window.removeEventListener('mouseup', this.onMouseUp);
  }
}
