UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

39 lines (38 loc) 2.1 kB
import { SearchInputType } from './category/search-input-type'; import { FormControl } from '@angular/forms'; import { Observable } from 'rxjs'; import { SearchAutocompleteOption } from './category/search-autocomplete-option'; /** * Represents a search category configuration input. * * Should handle all the logic related to autocomplete search configuration inputs. * If this class has its `type` set to `OPERATOR` it works mostly as a placeholder object, because the * operator and operand selection logic is handled by the {@link Category} class. * This behavior might be changed in future releases. */ export declare class ConfigurationInput { type: SearchInputType.AUTOCOMPLETE | SearchInputType.OPERATOR; label: string; displayBold: boolean; protected _autocompleteOptions: Map<string, Array<unknown>>; protected _formControl: FormControl<any>; protected _filteredOptions$: Observable<Array<SearchAutocompleteOption<unknown>>>; /** * @param type the type of the configuration input * @param label the translation path for the label of the input * @param displayBold whether the configuration input should be displayed in bold after selection or not * @param _autocompleteOptions the autocomplete options that are available in this configuration input * @param filterOptions a method that receives the keys of the available options and should return * the appropriately filtered autocomplete options */ constructor(type: SearchInputType.AUTOCOMPLETE | SearchInputType.OPERATOR, label: string, displayBold: boolean, _autocompleteOptions: Map<string, Array<unknown>>, filterOptions: (optionKeys: Array<string>, newValue: string) => Array<SearchAutocompleteOption<unknown>>); get formControl(): FormControl<any>; get isOptionSelected(): boolean; get selectedOptionTranslatePath(): string; get filteredOptions$(): Observable<Array<SearchAutocompleteOption<unknown>>>; /** * Value changes of the encapsulated `FormControl` object */ valueChanges$(): Observable<any>; clear(): void; }