import { FocusMonitor } from '@angular/cdk/a11y'; import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core'; import { ControlValueAccessor, NgControl } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSelect } from '@angular/material/select'; import { ReplaySubject } from 'rxjs'; import { MtnaPopoverConfig } from '@mtna/lib-ui'; import { VariableSummary } from '@mtna/pojo-consumer-ui'; import { RdsChip } from '../chips/chips.component'; import { BaseFilter } from '../core/models/filter/base-filter.model'; import { RdsFilterType } from '../core/models/filter/filter-type.model'; export declare class RdsFilterSelectComponent implements ControlValueAccessor, OnDestroy, OnInit { private dialog; ngControl: NgControl; private _changeDetectorRef; private _focusMonitor; /** Popover configuration to describe the filter control */ config: MtnaPopoverConfig; /** * NgStyle config for the dialog content's filter component, defaults to `{ height: '300px' }` * @example * { 'maxHeight': '300px' } */ dialogFilterStyles: { [key: string]: string; }; /** Optional filter dialog min-width */ dialogMinWidth: string; /** Whether the control is disabled */ get disabled(): any; set disabled(value: any); private _disabled; /** The selected filter and value for this control, if it exists */ set filters(filters: Array>); get filters(): Array>; private _filters; /** Whether the use can make multiple variable selections. Default false */ multiVariableSelect: boolean; /** Whether the user can make multiple code selections. Default false */ multiSelect: boolean; /** Variables to choose from in the select. */ get variables(): Array; set variables(vars: Array); private _variables; /** Internal */ matSelect: MatSelect; /** Whether any search results were found */ _noSearchResults: boolean; /** A subset of all the variables, filtered by the search text */ _varFilteredSummaries$: ReplaySubject; private _onDestroy; _onTouched: () => any; private _controlValueAccessorChangeFn; constructor(dialog: MatDialog, elementRef: ElementRef, ngControl: NgControl, _changeDetectorRef: ChangeDetectorRef, _focusMonitor: FocusMonitor); /** * When the mtna-select-search emits search text, filter the visible variables in the select. * * @param text search text to filter the variables */ filterVariables(text: string): void; /** * When the select panel is opened or closed, manipulate the options visible. * When the panel is opened, show the full list of variables. * When the panel is closed, set the selected value on the filtered subject so it will work with the MatSelect's internal selection model. * * @param opened Whether the panel is being opened */ handleOpenedChange(opened: boolean): void; ngOnDestroy(): void; ngOnInit(): void; /** * Opens the filter dialog for adding filters. * Returns the applied filters, or null if cancelled * @param variableUri uri of the selected variable. */ openFilterDialog(variableUri: string): void; /** * When an option is selected, open the dialog * @param v variable from the selected option */ optionSelected(v: VariableSummary): void; removeFilter(baseFilter: BaseFilter, filterType: RdsFilterType, rdsChip: RdsChip): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; writeValue(obj: any): void; private _resetSelectOptions; /** * Comparison function for use with `compareWith` */ _compareVariable(v1: VariableSummary, v2: VariableSummary): boolean; _emitChangeEvent(): void; _trackByVariable(index: number, variable: VariableSummary): string; }