import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { MatAutocompleteTrigger } from '@angular/material/autocomplete'; import { FormGroup } from '@angular/forms'; import { Subject } from 'rxjs'; import { MatChipInputEvent } from '@angular/material/chips'; import { FormUtilityService } from '../../services/form-utility.service'; import { AutoCompleteOption } from '../../models/autocomplete-option.model'; import { SelectOption } from '@ieeesa-npm/models'; import { FieldConfig } from '../../models/field-config.model'; import { FormField } from '../../models/form-field.model'; import * as i0 from "@angular/core"; /** * MultiSelectAutocompleteComponent allows to search the option(s) from the list and select the option(s) from the autocomplete search results. * @class MultiSelectAutocompleteComponent * @implements {OnInit} * @implements {FormField} * @implements {OnDestroy} * @implements {AfterViewInit} */ export declare class MultiSelectAutocompleteComponent implements OnInit, FormField, OnDestroy, AfterViewInit { private formUtilityService; private readonly changeDetectorRef; separatorKeysCodes: number[]; config: FieldConfig; group: FormGroup; selectedOptions: SelectOption[]; autoCompleteOptionList: AutoCompleteOption[]; /** * Sets the options for multi select autocomplete. * @memberof MultiSelectAutocompleteComponent */ set multiSelectAutoCompleteOptions(value: AutoCompleteOption[]); /** * Returns the autocomplete options list. * @readonly * @type {AutoCompleteOption[]} * @memberof MultiSelectAutocompleteComponent */ get multiSelectAutoCompleteOptions(): AutoCompleteOption[]; multiSelectAutoCompleteSearchValue: EventEmitter; multiSelectAutoCompleteClearSearchValue: EventEmitter; multiSelectAutoCompleteOptionsSelected: EventEmitter; multiSelectAutoComplete: ElementRef; matACTrigger: MatAutocompleteTrigger; destroy$: Subject; autocompleteConstInfo: any; removeIconURL: any; clearAllIconURL: any; clearAll: any; constructor(formUtilityService: FormUtilityService, changeDetectorRef: ChangeDetectorRef); /** * Implementation of ngOnInit lifecycle hook method to initialize components instance properties. * @memberof MultiSelectAutocompleteComponent */ ngOnInit(): void; /** * Initialize the form control change event once the form control is ready on ngAfterViewInit by calling onValueChanges method. * @memberof MultiSelectAutocompleteComponent */ ngAfterViewInit(): void; /** * Emits an multiSelectAutoCompleteSearchValue change event when the value is changed and value is greater than minCharToSearch or equal to zero. * @memberof MultiSelectAutocompleteComponent */ onValueChanges(): void; /** * Handles field error by setting the appropriate form control errors. * @memberof MultiSelectAutocompleteComponent */ handleFieldError(): void; /** * Adds a newly entered option to the selectedOptions array. * @param {*} event -The event containing the input and value. * @memberof MultiSelectAutocompleteComponent */ add(event: MatChipInputEvent): void; /** * Removes a selected option from the selectedOptions array. * @param {SelectOption} removedOption -The option to remove. * @memberof MultiSelectAutocompleteComponent */ onOptionRemoved(removedOption: SelectOption): void; /** * Handles the selection of an autocomplete option. * @param {AutoCompleteOption} option -The selected autocomplete option. * @return {AutoCompleteOption} * @memberof MultiSelectAutocompleteComponent */ onChange(option: any): AutoCompleteOption; /** * Clears the typeahead search text from both the reactive form control and the * native input element without touching the selected chips. Uses * `emitEvent: false` so the valueChanges search stream is not re-triggered. * @memberof MultiSelectAutocompleteComponent */ private clearSearchInput; /** * Fires when focus leaves the search input (click outside / tab away). If text * was typed but never committed as a chip (i.e. nothing was picked from the * dropdown), clear it so stale search text is not left behind. Deferred with a * short timeout so that if the blur was caused by clicking a dropdown option, * onChange commits the selection first (and has already cleared the text), * making this a no-op in that case. Clicking back into the same field does not * blur it, so the text is preserved while the user is still editing. * @memberof MultiSelectAutocompleteComponent */ onInputBlur(): void; /** * Formats the selected options and emits the multiSelectAutoCompleteOptionSelected event. * @param {SelectOption[]} selectedOptions -Array of selected options. * @memberof MultiSelectAutocompleteComponent */ formatSelectedOption(selectedOptions: SelectOption[]): void; /** * Displays the name of the option * @param {AutoCompleteOption} option * @return {*} {string} * @memberof MultiSelectAutocompleteComponent */ displayOptionName(option: AutoCompleteOption): string; /** * Tracks the option by its index or id. * @param {number} index * @param {SelectOption} option * @return {*} {(number | string)} * @memberof MultiSelectAutocompleteComponent */ trackByFn(index: number, option: SelectOption): number | string; /** * Checks if the checkbox is selected. * @param {AutoCompleteOption} option * @return {*} {boolean} * @memberof MultiSelectAutocompleteComponent */ isCheckboxSelected(option: AutoCompleteOption): boolean; /** * Clears all selected options. * @memberof MultiSelectAutocompleteComponent */ clearSelections(): void; /** * Implementation of ngOnDestroy lifecycle hook method to unsubscribe the open observable subscriptions. * @memberof MultiSelectAutocompleteComponent */ ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }