import { Observable } from "rxjs"; import { OnInit, OnChanges, ElementRef, ChangeDetectorRef, NgZone, TemplateRef, EventEmitter } from "@angular/core"; import { MatOptgroup, MatPseudoCheckboxState } from "@angular/material/core"; import { AppMatSelect } from "@angular/material/select"; import { FormControl } from "@angular/forms"; import { MatMenuTrigger } from "@angular/material/menu"; import { CdkVirtualScrollViewport } from "@angular/cdk/scrolling"; import { Field } from "angular-extensions/models"; import { SimpleChanges } from "angular-extensions/core"; import { ActionableControl, ControlBase } from "angular-extensions/controls/base-control"; import * as i0 from "@angular/core"; interface SelectionGroup extends Group { state?: MatPseudoCheckboxState; } export declare class SelectControlComponent extends ControlBase implements OnInit, OnChanges, ActionableControl { private changeDetectorRef; private ngZone; dropdownClass: string; multiple: boolean; searchable: boolean; clearable: boolean; virtualization: boolean; tooltipDisabled: boolean; optionTooltipDisabled: boolean; filter: string; actionButtonVisible: boolean; actionButtonIcon?: string; actionButtonTooltip?: string; optionHeight: number; visibleOptionsCount: number; hideTriggerLabel?: boolean; alwaysShowTriggerLabel?: boolean; actionButton: EventEmitter>; menuClosed: EventEmitter; select: AppMatSelect; scrollViewport?: CdkVirtualScrollViewport; headerTemplate: TemplateRef; optionTemplate: TemplateRef<{ $implicit: string; option: TOption; }>; triggerTemplate: TemplateRef<{ $implicit: string; option: TOption | TOption[]; }>; searchActionTemplate: TemplateRef; dropdownHeight: number; isSelectAllChecked: boolean; get viewportHeight(): number; /** * Selected option(s) based on option comparer, * see {@link Field.optionId} for details */ selectedOption: TOption | TOption[]; groupStates: Map>; /** * Trigger label (text shown when option(s) selected), * based on option label, see {@link Field.optionLabel} for details */ triggerLabel: string; tooltip: string; filterControl: FormControl; private selection; constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef, ngZone: NgZone, matMenuTrigger: MatMenuTrigger); ngOnInit(): void; ngOnChanges(changes: SimpleChanges>): void; optionGroupTracker: (index: number, optionGroup: Group) => TOptionGroup; optionTracker: (index: number, option: TOption) => string | number; optionFilter: (option: TOption) => boolean; optionComparer: (left?: TOption, right?: TOption) => boolean; showClearButton(): boolean; isSearchAvailable(): number | true | ((query: string) => Observable); clear(): void; toggleSelectAll(shouldSelect: boolean): void; toggleOptionGroup(group: SelectionGroup, optionGroup: MatOptgroup): void; /** * Store selected values in separate model to avoid mutations when virtualization applies. * Extend changes propagation with values stored in custom selection model. * Listens to control value changes in order to update selection. */ private addCustomSelectionModel; /** * Delegates "empty" state detection to custom selection model. * Updates select trigger label based on custom selection model. * If "hideTriggerLabel" set to true - trigger label will be ignored completely */ private patchSelectTrigger; /** * Trigger "filter" pipe to refresh options since custom predicate might not be pure. * Recalculates virtualization viewport size. */ private updateOptionsAndViewportOnMenuOpen; /** * Updates "select all" or "group" states on selection changes. */ private updateSelectStatesOnOptionChanges; /** * Hooks up the MatOption and provides filtered field option */ private addOptionsFilteringSupport; static ɵfac: i0.ɵɵFactoryDeclaration, [null, null, null, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration, "select-control", never, { "dropdownClass": "dropdownClass"; "multiple": "multiple"; "searchable": "searchable"; "clearable": "clearable"; "virtualization": "virtualization"; "tooltipDisabled": "tooltipDisabled"; "optionTooltipDisabled": "optionTooltipDisabled"; "filter": "filter"; "actionButtonVisible": "actionButtonVisible"; "actionButtonIcon": "actionButtonIcon"; "actionButtonTooltip": "actionButtonTooltip"; "optionHeight": "optionHeight"; "visibleOptionsCount": "visibleOptionsCount"; "hideTriggerLabel": "hideTriggerLabel"; "alwaysShowTriggerLabel": "alwaysShowTriggerLabel"; }, { "actionButton": "actionButton"; "menuClosed": "menuClosed"; }, ["headerTemplate", "optionTemplate", "triggerTemplate", "searchActionTemplate"], never, false>; } export {};