|
|
@ -16,6 +16,7 @@ import { |
|
|
HostListener, |
|
|
HostListener, |
|
|
Input, |
|
|
Input, |
|
|
OnChanges, |
|
|
OnChanges, |
|
|
|
|
|
OnDestroy, |
|
|
OnInit, |
|
|
OnInit, |
|
|
QueryList, |
|
|
QueryList, |
|
|
ViewChild, |
|
|
ViewChild, |
|
|
@ -84,7 +85,7 @@ import { |
|
|
styleUrls: ['./assistant.scss'], |
|
|
styleUrls: ['./assistant.scss'], |
|
|
templateUrl: './assistant.html' |
|
|
templateUrl: './assistant.html' |
|
|
}) |
|
|
}) |
|
|
export class GfAssistantComponent implements OnChanges, OnInit { |
|
|
export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { |
|
|
public static readonly SEARCH_RESULTS_DEFAULT_LIMIT = 5; |
|
|
public static readonly SEARCH_RESULTS_DEFAULT_LIMIT = 5; |
|
|
|
|
|
|
|
|
@Input() deviceType: string; |
|
|
@Input() deviceType: string; |
|
|
@ -154,11 +155,6 @@ export class GfAssistantComponent implements OnChanges, OnInit { |
|
|
private destroyRef: DestroyRef |
|
|
private destroyRef: DestroyRef |
|
|
) { |
|
|
) { |
|
|
addIcons({ closeCircleOutline, closeOutline, searchOutline }); |
|
|
addIcons({ closeCircleOutline, closeOutline, searchOutline }); |
|
|
this.destroyRef.onDestroy(() => { |
|
|
|
|
|
if (this.preselectionTimeout) { |
|
|
|
|
|
clearTimeout(this.preselectionTimeout); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@HostListener('document:keydown', ['$event']) |
|
|
@HostListener('document:keydown', ['$event']) |
|
|
@ -557,6 +553,12 @@ export class GfAssistantComponent implements OnChanges, OnInit { |
|
|
this.isOpen = aIsOpen; |
|
|
this.isOpen = aIsOpen; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ngOnDestroy() { |
|
|
|
|
|
if (this.preselectionTimeout) { |
|
|
|
|
|
clearTimeout(this.preselectionTimeout); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private getCurrentAssistantListItem() { |
|
|
private getCurrentAssistantListItem() { |
|
|
return this.assistantListItems.find(({ getHasFocus }) => { |
|
|
return this.assistantListItems.find(({ getHasFocus }) => { |
|
|
return getHasFocus; |
|
|
return getHasFocus; |
|
|
|