This commit is contained in:
Eugene Pankov
2020-03-01 16:10:45 +01:00
parent fda4d2dcef
commit 04a0a0cc64
81 changed files with 284 additions and 295 deletions

View File

@@ -17,11 +17,11 @@ export class SelectorModalComponent<T> {
public modalInstance: NgbActiveModal,
) { }
ngOnInit () {
ngOnInit (): void {
this.onFilterChange()
}
onFilterChange () {
onFilterChange (): void {
const f = this.filter.trim().toLowerCase()
if (!f) {
this.filteredOptions = this.options
@@ -31,17 +31,17 @@ export class SelectorModalComponent<T> {
}
}
onFilterEnter () {
onFilterEnter (): void {
if (this.filteredOptions.length === 1) {
this.selectOption(this.filteredOptions[0])
}
}
selectOption (option: SelectorOption<T>) {
selectOption (option: SelectorOption<T>): void {
this.modalInstance.close(option.result)
}
close () {
close (): void {
this.modalInstance.dismiss()
}
}