import { FocusableOption } from '@angular/cdk/a11y'; import { ElementRef, EventEmitter, OnDestroy } from '@angular/core'; import { Subject } from 'rxjs'; import { CanColor, CanDisable } from 'vdl-angular/core'; /** Represents an event fired on an individual `vdl-chip`. */ export interface VdlChipEvent { /** The chip the event was fired on. */ chip: VdlChip; } /** Event object emitted by VdlChip when selected or deselected. */ export declare class VdlChipSelectionChange { /** Reference to the chip that emitted the event. */ source: VdlChip; /** Whether the chip that emitted the event is selected. */ selected: boolean; /** Whether the selection change was a result of a user interaction. */ isUserInput: boolean; constructor( /** Reference to the chip that emitted the event. */ source: VdlChip, /** Whether the chip that emitted the event is selected. */ selected: boolean, /** Whether the selection change was a result of a user interaction. */ isUserInput?: boolean); } /** @docs-private */ export declare class VdlChipBase { _elementRef: ElementRef; constructor(_elementRef: ElementRef); } export declare const _VdlChipMixinBase: (new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof VdlChipBase; /** * Dummy directive to add CSS class to chip avatar. * @docs-private */ export declare class VdlChipAvatar { } /** * Dummy directive to add CSS class to chip trailing icon. * @docs-private */ export declare class VdlChipTrailingIcon { } /** * VDL design styled Chip component. Used inside the VdlChipList component. */ export declare class VdlChip extends _VdlChipMixinBase implements FocusableOption, OnDestroy, CanColor, CanDisable { _elementRef: ElementRef; /** Whether the chip has focus. */ _hasFocus: boolean; /** Whether the chip list is selectable */ chipListSelectable: boolean; /** The chip avatar */ avatar: VdlChipAvatar; /** The chip's trailing icon. */ trailingIcon: VdlChipTrailingIcon; /** The chip's remove toggler. */ removeIcon: VdlChipRemove; /** * Whether the chip is selected. * Defaults to false. */ selected: boolean; protected _selected: boolean; /** The value of the chip. Defaults to the content inside `` tags. */ value: any; protected _value: any; /** * Whether or not the chip is selectable. When a chip is not selectable, * changes to it's selected state are always ignored. By default a chip is * selectable, and it becomes non-selectable if it's parent chip list is * not selectable. * Defaults to true. */ selectable: boolean; protected _selectable: boolean; /** * Determines whether or not the chip displays the remove styling and emits (removed) events. * Defaults to true. */ removable: boolean; protected _removable: boolean; /** Emits when the chip is focused. */ readonly _onFocus: Subject; /** Emits when the chip is blured. */ readonly _onBlur: Subject; /** Emitted when the chip is selected or deselected. */ readonly selectionChange: EventEmitter; /** Emitted when the chip is destroyed. */ readonly destroyed: EventEmitter; /** Emitted when a chip is to be removed. */ readonly removed: EventEmitter; /** The ARIA selected applied to the chip. */ readonly ariaSelected: string | null; constructor(_elementRef: ElementRef); _addHostClassName(): void; ngOnDestroy(): void; /** Selects the chip. */ select(): void; /** Deselects the chip. */ deselect(): void; /** Select this chip and emit selected event */ selectViaInteraction(): void; /** Toggles the current selected state of this chip. */ toggleSelected(isUserInput?: boolean): boolean; /** Allows for programmatic focusing of the chip. */ focus(): void; /** * Allows for programmatic removal of the chip. Called by the VdlChipList when the DELETE or * BACKSPACE keys are pressed. * * Informs any listeners of the removal request. Does not remove the chip from the DOM. */ remove(): void; /** Ensures events fire properly upon click. */ _handleClick(event: Event): void; /** Handle custom key presses. */ _handleKeydown(event: KeyboardEvent): void; _blur(): void; } /** * Applies proper (click) support and adds styling for use with the Material Design "cancel" icon * available at https://material.io/icons/#ic_cancel. * * Example: * * ` * cancel * ` * * You *may* use a custom icon, but you may need to override the `vdl-chip-remove` positioning * styles to properly center the icon within the chip. */ export declare class VdlChipRemove { protected _parentChip: VdlChip; constructor(_parentChip: VdlChip); /** Calls the parent chip's public `remove()` method if applicable. */ _handleClick(): void; }