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, MatSelectChange } from '@angular/material/select'; import { RelationalOperator } from '@mtna/data-core-ts'; import { MtnaPopoverConfig } from '@mtna/core-angular'; import { VariableSummary } from '@mtna/variable-service-core-ts'; import { ReplaySubject } from 'rxjs'; import { RdsChip } from '../chips/chips.component'; import { BaseFilter } from '../core/models/filter/base-filter.model'; import { RdsFilterType } from '../core/models/filter/filter-type.model'; import * as i0 from "@angular/core"; export declare class RdsFilterSelectComponent implements ControlValueAccessor, OnDestroy, OnInit { private dialog; ngControl: NgControl; private _changeDetectorRef; private _focusMonitor; static ngAcceptInputType_supportedOperators: RelationalOperator[] | null | undefined; /** 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(): boolean | string; set disabled(value: boolean | string); private _disabled; /** The selected filter and value for this control, if it exists */ set filters(filters: Array> | undefined); get filters(): BaseFilter[] | undefined; 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; /** The supported `RelationalOperator`s. i.e. what operaters does the current data product support. */ set supportedOperators(operators: RelationalOperator[] | undefined); get supportedOperators(): RelationalOperator[] | undefined; private _supportedOperators; /** 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; /** `View -> model callback called when value changes` */ _onChange: (value: unknown) => void; /** `View -> model callback called when select has been touched` */ _onTouched: () => void; /** Placeholder for the matTooltip for the buttons in filters*/ _modifyFilterForPlaceholder: string; _TEXT_filter: string; 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; clearFilters(): void; /** * Handles that MatSelect change when `multiVariableSelect` is true * @param variables All selected variables(options) of the MatSelect */ handleMultiVariableSelectChange(variables: VariableSummary[]): void; handleSelectChange(change: MatSelectChange): 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 | undefined): void; removeFilter(baseFilter: BaseFilter, filterType: RdsFilterType, rdsChip: RdsChip): void; /** * Saves a callback function to be invoked when the select's value * changes from user input. Part of the ControlValueAccessor interface * required to integrate with Angular's core forms API. * * @param fn Callback to be triggered when the value changes. */ registerOnChange(fn: (value: unknown) => void): void; /** * Saves a callback function to be invoked when the select is blurred * by the user. Part of the ControlValueAccessor interface required * to integrate with Angular's core forms API. * * @param fn Callback to be triggered when the component has been touched. */ registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; writeValue(obj: BaseFilter[] | undefined): void; private _resetSelectOptions; /** * Comparison function for use with `compareWith` */ _compareVariable(v1: VariableSummary, v2: VariableSummary): boolean; _emitChangeEvent(): void; _trackByVariable(index: number, variable: VariableSummary): string | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }