import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { ErrorStateMatcher } from '@angular/material/core'; import { AbstractControl, UntypedFormControl } from '@angular/forms'; import { BehaviorSubject, Subject } from 'rxjs'; import { AbstractModel } from '@ngvip/service'; import { FieldConfig } from '../../dynamic-form/field.interface'; import * as i0 from "@angular/core"; export declare class CommonAutocompleteComponent implements OnInit, OnChanges, OnDestroy { config: FieldConfig; data: AbstractModel[] | object[]; name: string; control: AbstractControl; private beforeChangeEvent; private changeEvent; private selectEvent; private blurEvent; private autocompleteInput; _control: UntypedFormControl; selectedObject: AbstractModel | object; autocompleteSearch$: Subject; autocompleteList$: BehaviorSubject; autocompleteErrorStateMatcher: ErrorStateMatcher; autocompleteWaitingForDebounce: boolean; private unsubscribe$; constructor(); /********** ANGULAR METHODS **********/ ngOnInit(): void; /** * A callback method that is invoked immediately after the * default change detector has checked data-bound properties * if at least one has changed, and before the view and content * children are checked. * @param changes */ ngOnChanges(changes: SimpleChanges): void; /** * Unsubscribe to all subscribers on destruction of the component */ ngOnDestroy(): void; /** * When the user selects an item from the dropdown, emit the selection and set the control. * @param data The value from the dropdown. */ onAutocompleteSelect(data: AbstractModel): void; /** * When the user leaves the input close the panel and emit an event to the onBlur emitter * @param event */ onAutocompleteBlur(event: FocusEvent): void; /********** PUBLICLY ACCESSIBLE METHODS **********/ /** * Focuses the input. */ focusInput(): void; /** * Set the value of the input * @param data */ setInput(data: AbstractModel): void; /** * Set the dropdown list to an empty array */ resetAutocompleteList(): void; /** * Determine if a formControl has an error * @param error */ getFormControlErrors(error: string): boolean; /** * Retrive the selected value if there is one */ getSelectedObject(): AbstractModel | object; /********** ALERT METHODS **********/ /** * Notify developer that a config needs to be passed to the autoconfig if one wasn't given. */ private checkRequiredFields; /********** DATA MANIPULATION METHODS **********/ /** * As the user types filter value against the data provided * or use the lookup call to retrieve data using the input as the search value * @param filterValue */ private filterData; /********** INPUT EVENT METHODS **********/ /** * Perform the filter on change events coming from the input * @param filterValue Value from the input */ private onAutocompleteChange; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }