import { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, QueryList } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { Observable } from 'rxjs'; import { MDCComponent } from '@shraddhar/web/base'; import { MdcChipInteractionEvent, MdcChipNavigationEvent, MdcChipSelectionEvent, MdcChipRemovalEvent } from './chip-config'; import { MdcChip } from './chip'; import { MDCChipSetFoundation } from '@material/chips'; /** * Provider Expression that allows mdc-chip-set to register as a ControlValueAccessor. This * allows it to support [(ngModel)] and ngControl. */ export declare const MDC_CHIP_SET_CONTROL_VALUE_ACCESSOR: any; export declare class MdcChipSetChange { source: MdcChipSet; value: any; constructor(source: MdcChipSet, value: any); } export declare class MdcChipSet extends MDCComponent implements AfterContentInit, OnDestroy, ControlValueAccessor { private _changeDetectorRef; elementRef: ElementRef; /** Emits whenever the component is destroyed. */ private _destroyed; /** * Indicates that the chips in the set are choice chips, which allow a single selection from a set of options. */ get choice(): boolean; set choice(value: boolean); private _choice; /** * Indicates that the chips in the set are filter chips, which allow multiple selection from a set of options. */ get filter(): boolean; set filter(value: boolean); private _filter; /** * Indicates that the chips in the set are input chips, which enable user input by converting text into chips. */ get input(): boolean; set input(value: boolean); private _input; get value(): string | string[] | undefined; set value(value: string | string[] | undefined); private _value?; /** * A function to compare the option values with the selected values. The first argument * is a value from an option. The second is a value from the selection. A boolean * should be returned. */ private _compareWith; readonly change: EventEmitter; readonly interaction: EventEmitter; chips: QueryList; /** Function when touched */ _onTouched: () => void; /** Function when changed */ _onChange: (value: any) => void; /** Subscription to selection events in chips. */ private _chipSelectionSubscription; /** Subscription to removal changes. */ private _chipRemovalSubscription; /** Subscription to interaction events in chips. */ private _chipInteractionSubscription; /** Subscription to navigation events. */ private _navigationSubscription; /** Combined stream of all of the chip selection events. */ get chipSelections(): Observable; /** Combined stream of all of the chip interaction events. */ get chipInteractions(): Observable; /** Combined stream of all of the chip removal events. */ get chipRemovalChanges(): Observable; /** Combined stream of all of the chip navigation events. */ get chipNavigations(): Observable; getDefaultFoundation(): MDCChipSetFoundation; constructor(_changeDetectorRef: ChangeDetectorRef, elementRef: ElementRef); ngAfterContentInit(): void; ngOnDestroy(): void; writeValue(value: any): void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: () => void): void; getSelectedChipIds(): ReadonlyArray; select(chipId: string): void; selectByValue(value: string | string[] | undefined, shouldIgnore?: boolean): void; /** * Finds and selects the chip based on its value. * @returns Chip that has the corresponding value. */ private _selectValue; private _initializeSelection; private _propagateChanges; private _findChipIndex; private _resetChipSet; private _dropSubscriptions; /** Listens to selected events on each chip. */ private _listenToChipEvents; /** Retrieves the DOM element of the component host. */ private _getHostElement; }