import { FocusMonitor } from '@angular/cdk/a11y'; import { ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, OnDestroy } from '@angular/core'; import { ControlValueAccessor, FormControl, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ErrorStateMatcher, MatOptionSelectionChange } from '@angular/material/core'; import { MatSelect } from '@angular/material/select'; import { MtnaPopoverConfig } from '@mtna/lib-ui'; import { Variable, VariableSummary } from '@mtna/pojo-consumer-ui'; import { MeasureOptionType } from './measure-option.model'; import { MeasureSelection } from './measure-selection.model'; /** Error when invalid control is dirty, touched, or submitted. */ export declare class RdsMeasureSelectErrorStateMatcher implements ErrorStateMatcher { private _control; constructor(_control: NgControl); isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean; } /** * Select control to select a measure, supports reactive forms. * @author Will Davis */ export declare class RdsMeasureSelectComponent implements ControlValueAccessor, DoCheck, OnDestroy { _control: NgControl; private _changeDetectorRef; private _dialog; private _focusMonitor; /** Popover configuration to describe the control */ config: MtnaPopoverConfig; /** Whether the control is disabled */ get disabled(): any; set disabled(value: any); private _disabled; /** * Whether multiple measures can be selected * TODO - implement multi selection */ multiple: boolean; /** Whether the control is required */ required: boolean; /** Label for mat-select, defaults to "Measure" */ selectLabel: string; /** Placeholder for mat-select, defaults to "Choose measure..." */ selectPlaceholder: string; /** Suffix icon for the select, defaults to null */ suffixIcon: string | null; /** Measure types to select from, defaults to all */ types: Array; /** The selected MeasureSelection and value for this control, if it exists */ set value(value: MeasureSelection[]); get value(): MeasureSelection[]; private _value; /** Variables to choose from if a measure requires it. */ variables: Array; /** Changed value of the form control */ readonly selectionChange: EventEmitter[]>; /** Internal */ matSelect: MatSelect; /** Custom error state matcher */ _matcher: RdsMeasureSelectErrorStateMatcher; _measureOptions: Record<"COUNT" | "PERCENT" | "SUM" | "AVG" | "MIN" | "MAX", import("./measure-option.model").MeasureOption>; private _destroyed$; _onTouched: () => any; private _controlValueAccessorChangeFn; constructor(_control: NgControl, elementRef: ElementRef, _changeDetectorRef: ChangeDetectorRef, _dialog: MatDialog, _focusMonitor: FocusMonitor); ngDoCheck(): void; ngOnDestroy(): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; writeValue(obj: any): void; _emitChangeEvent(newValue: MeasureSelection[]): void; /** * Manually handle when options are selected/unselected. * @param event option selection event */ _handleOptionSelectionChange(type: MeasureOptionType): void; _unselect(event: MatOptionSelectionChange): void; }