mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-12 23:49:59 +00:00
37 lines
859 B
TypeScript
37 lines
859 B
TypeScript
import { Component, Input, ViewChild, ElementRef } from '@angular/core'
|
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
|
|
|
/** @hidden */
|
|
@Component({
|
|
templateUrl: './promptModal.component.pug',
|
|
})
|
|
export class PromptModalComponent {
|
|
@Input() value: string
|
|
@Input() prompt: string|undefined
|
|
@Input() password: boolean
|
|
@Input() remember: boolean
|
|
@Input() showRememberCheckbox: boolean
|
|
@ViewChild('input') input: ElementRef
|
|
|
|
constructor (
|
|
private modalInstance: NgbActiveModal,
|
|
) { }
|
|
|
|
ngOnInit (): void {
|
|
setTimeout(() => {
|
|
this.input.nativeElement.focus()
|
|
})
|
|
}
|
|
|
|
ok (): void {
|
|
this.modalInstance.close({
|
|
value: this.value,
|
|
remember: this.remember,
|
|
})
|
|
}
|
|
|
|
cancel (): void {
|
|
this.modalInstance.close(null)
|
|
}
|
|
}
|