import { FocusMonitor } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import { AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core'; import { ErrorStateMatcher } from '@angular/material/core'; import { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms'; import { MatFormField, MatFormFieldControl } from '@angular/material/form-field'; import { Subject } from 'rxjs'; import { NgSelectComponent } from '@ng-select/ng-select'; import { MtxOptionComponent } from './option.component'; import * as i0 from "@angular/core"; export declare type DropdownPosition = 'bottom' | 'top' | 'auto'; export declare type AddTagFn = (term: string) => any | Promise; export declare type CompareWithFn = (a: any, b: any) => boolean; export declare type GroupValueFn = (key: string | Record, children: any[]) => string | Record; export declare type SearchFn = (term: string, item: any) => boolean; export declare type TrackByFn = (item: any) => any; /** @docs-private */ declare const _MtxSelectMixinBase: import("@angular/material/core")._Constructor & import("@angular/material/core")._AbstractConstructor & { new (_defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl): { /** * Emits whenever the component state changes and should cause the parent * form-field to update. Implemented as part of `MatFormFieldControl`. * @docs-private */ readonly stateChanges: Subject; _defaultErrorStateMatcher: ErrorStateMatcher; _parentForm: NgForm; _parentFormGroup: FormGroupDirective; /** * Form control bound to the component. * Implemented as part of `MatFormFieldControl`. * @docs-private */ ngControl: NgControl; }; }; export declare class MtxSelectComponent extends _MtxSelectMixinBase implements OnInit, OnDestroy, DoCheck, AfterViewInit, ControlValueAccessor, MatFormFieldControl { protected _changeDetectorRef: ChangeDetectorRef; protected _elementRef: ElementRef; protected _focusMonitor: FocusMonitor; private _parentFormField?; ngSelect: NgSelectComponent; optionTemplate: TemplateRef; optgroupTemplate: TemplateRef; labelTemplate: TemplateRef; multiLabelTemplate: TemplateRef; headerTemplate: TemplateRef; footerTemplate: TemplateRef; notFoundTemplate: TemplateRef; typeToSearchTemplate: TemplateRef; loadingTextTemplate: TemplateRef; tagTemplate: TemplateRef; loadingSpinnerTemplate: TemplateRef; mtxOptions: QueryList; addTag: boolean | AddTagFn; addTagText: string; appearance: string; appendTo: string; bindLabel: string; bindValue: string; closeOnSelect: boolean; clearAllText: string; clearable: boolean; clearOnBackspace: boolean; compareWith: CompareWithFn; dropdownPosition: DropdownPosition; groupBy: string | (() => void); groupValue: GroupValueFn; selectableGroup: boolean; selectableGroupAsModel: boolean; hideSelected: boolean; isOpen: boolean; loading: boolean; loadingText: string; labelForId: string | null; markFirst: boolean; maxSelectedItems: number; multiple: boolean; notFoundText: string; searchable: boolean; readonly: boolean; searchFn: SearchFn | null; searchWhileComposing: boolean; selectOnTab: boolean; trackByFn: TrackByFn | null; inputAttrs: { [key: string]: string; }; tabIndex: number; openOnEnter: boolean; minTermLength: number; editableSearchTerm: boolean; keyDownFn: (_: KeyboardEvent) => boolean; virtualScroll: boolean; typeToSearchText: string; typeahead: Subject; blurEvent: EventEmitter; focusEvent: EventEmitter; changeEvent: EventEmitter; openEvent: EventEmitter; closeEvent: EventEmitter; searchEvent: EventEmitter<{ term: string; items: any[]; }>; clearEvent: EventEmitter; addEvent: EventEmitter; removeEvent: EventEmitter; scroll: EventEmitter<{ start: number; end: number; }>; scrollToEnd: EventEmitter; get clearSearchOnAdd(): boolean; set clearSearchOnAdd(value: boolean); private _clearSearchOnAdd?; get items(): any[]; set items(value: any[]); private _items; private _itemsAreUsed; /** Emits whenever the component is destroyed. */ private readonly _destroy$; /** Value of the select control. */ get value(): any; set value(newValue: any); private _value; /** Implemented as part of MatFormFieldControl. */ readonly stateChanges: Subject; /** Unique id of the element. */ get id(): string; set id(value: string); private _id; /** Unique id for this select. */ private _uid; /** Placeholder to be shown if value is empty. */ get placeholder(): string; set placeholder(value: string); private _placeholder; /** Whether the select is focused. */ get focused(): boolean; private _focused; /** Whether the select has a value. */ get empty(): boolean; /** * Implemented as part of MatFormFieldControl. * @docs-private */ get shouldLabelFloat(): boolean; /** Whether the component is required. */ get required(): boolean; set required(value: boolean); private _required; /** Whether the select is disabled. */ get disabled(): boolean; set disabled(value: boolean); private _disabled; /** Object used to control when error messages are shown. */ errorStateMatcher: ErrorStateMatcher; /** Aria label of the select. */ ariaLabel: string; /** Input that can be used to specify the `aria-labelledby` attribute. */ ariaLabelledby: string | null; /** The aria-describedby attribute on the select for improved a11y. */ _ariaDescribedby: string | null; /** A name for this control that can be used by `mat-form-field`. */ controlType: string; /** `View -> model callback called when value changes` */ _onChange: (value: any) => void; /** `View -> model callback called when select has been touched` */ _onTouched: () => void; /** ID for the DOM node containing the select's value. */ _valueId: string; /** Whether or not the overlay panel is open. */ get panelOpen(): boolean; constructor(_changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef, _focusMonitor: FocusMonitor, _defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl, _parentFormField?: MatFormField | undefined); ngOnInit(): void; ngAfterViewInit(): void; ngDoCheck(): void; ngOnDestroy(): void; /** Gets the value for the `aria-labelledby` attribute of the inputs. */ _getAriaLabelledby(): string | null; /** Implemented as part of MatFormFieldControl. */ setDescribedByIds(ids: string[]): void; /** * Disables the select. Part of the ControlValueAccessor interface required * to integrate with Angular's core forms API. * * @param isDisabled Sets whether the component is disabled. */ setDisabledState(isDisabled: boolean): void; /** Implemented as part of MatFormFieldControl. */ onContainerClick(event: MouseEvent): void; /** * Sets the select's value. Part of the ControlValueAccessor interface * required to integrate with Angular's core forms API. * * @param value New value to be written to the model. */ writeValue(value: any): 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: any): 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: any): void; /** NgSelect's `_setItemsFromNgOptions` */ private _setItemsFromMtxOptions; open(): void; close(): void; focus(): void; blur(): void; static ngAcceptInputType_required: BooleanInput; static ngAcceptInputType_disabled: BooleanInput; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};