import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, Renderer2, SimpleChanges, TemplateRef } from '@angular/core'; import * as i0 from "@angular/core"; export declare class UsaComboBoxItemTemplate { templateRef: TemplateRef; constructor(templateRef: TemplateRef); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare class UsaComboboxList implements AfterViewInit, OnDestroy, OnChanges { private el; private cdr; private renderer; private document; dropdownListBox: ElementRef; /** List of items to display in dropdown */ items: any[]; labelField: string; valueField: string; /** Provided custom template for displaying each item. * If none provided, then the label property of each item will be shown */ customItemTemplate: UsaComboBoxItemTemplate; /** * HTML id value to attach to container element */ listId: string; /** * If virtualScroll is enabled, a scrollEnd event * will be fired when user scrolls to last item in the list, * allowing clients to load in more data */ virtualScroll: boolean; /** * Direction to display the dropdown box */ direction: 'top' | 'bottom'; /** Id of label for listbox */ ariaLabelledBy: string; selectedItem: any; /** * Emitted when a value is selected from the dropdown list */ selected: EventEmitter; /** * Emitted when the user presses the up arrow key and focus * is on first item in dropdown list. This indicates to the client * that the dropdown list should close and focus should move * back to the combo box input field */ focusInput: EventEmitter; /** * Emitted when user has scrolled to the end of the dropdown list. * This event only fires if virtual scroll is enabled */ scrollEnd: EventEmitter; _focusedItem: { item: any; index: number; itemHtml: HTMLDataListElement; }; /** * Referenced to currently highlighted item. Highlighted items have a dark * border around to draw attention to it, but do not necessarily have focus. * This can occur if focus is on input and the highlighted item is the item * that best matches input query. */ _highlightedItem: { item: any; index: number; itemHtml: HTMLDataListElement; }; /** List of functions to call to un-bind events registered through renderer.listen call */ _eventListeners: (() => void)[]; constructor(el: ElementRef, cdr: ChangeDetectorRef, renderer: Renderer2, document: any); trackByFn(index: number): number; ngAfterViewInit(): void; ngOnDestroy(): void; ngOnChanges(changes: SimpleChanges): void; selectItem(item: any): void; onFocus(item: any, index: number, itemHtml: HTMLDataListElement): void; /** * Handles keypress on combobox dropdown items * @param $event * @returns */ onKeyDown($event: KeyboardEvent): void; /** * Focus on first element of combo-box dropdown */ focusFirstElement(): void; focusLastElement(): void; focusHighlightedElement(): void; /** * Used by default template for rendering display value. If each item is * an object, get its given value property, otherwise, simply display the item */ getRenderValue(item: any): any; /** * Public interface that allows components to highlight an item in dropdown * without moving focus to it. This simply adds a visible border to the item * and moves it to visible area of the dropdown */ highlightItem(index: number): void; private registerEventHandlers; /** * Attaches mouseover event to each list element in the dropdown. Since the mouseover * event fires quite often, we attach it this way in the ts rather than through HTML * This coupled with changeDetectionStrategy of OnPush minimizes the amount * of necessary change detection triggers */ private bindMouseOverListeners; /** * Adds scroll event binding if virtual scrolling is enabled. * This event listens for whether the user has scrolled to the last * item in the list or not. If so, it will fire an event * indicating that the user has scrolled to the end and more data * should be fetched * @returns */ private bindScrollListener; private setDropdownDirection; private updateFocusedItem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }