import * as i3 from 'igniteui-angular/input-group'; import { IgxPrefixDirective, IgxSuffixDirective } from 'igniteui-angular/input-group'; import * as i0 from '@angular/core'; import { OnInit, OnDestroy, ChangeDetectorRef, TemplateRef, EventEmitter, ElementRef, DoCheck, AfterViewInit, QueryList } from '@angular/core'; import { IDragBaseEventArgs, IDropBaseEventArgs, IgxDragDirective, IDragStartEventArgs, IDropDroppedEventArgs } from 'igniteui-angular/directives'; import { IBaseEventArgs, IChipResourceStrings, ɵSize as _Size } from 'igniteui-angular/core'; import { Subject } from 'rxjs'; declare const IgxChipTypeVariant: { readonly PRIMARY: "primary"; readonly INFO: "info"; readonly SUCCESS: "success"; readonly WARNING: "warning"; readonly DANGER: "danger"; }; type IgxChipTypeVariant = (typeof IgxChipTypeVariant)[keyof typeof IgxChipTypeVariant]; interface IBaseChipEventArgs extends IBaseEventArgs { originalEvent: IDragBaseEventArgs | IDropBaseEventArgs | KeyboardEvent | MouseEvent | TouchEvent; owner: IgxChipComponent; } interface IChipClickEventArgs extends IBaseChipEventArgs { cancel: boolean; } interface IChipKeyDownEventArgs extends IBaseChipEventArgs { originalEvent: KeyboardEvent; cancel: boolean; } interface IChipEnterDragAreaEventArgs extends IBaseChipEventArgs { dragChip: IgxChipComponent; } interface IChipSelectEventArgs extends IBaseChipEventArgs { cancel: boolean; selected: boolean; } /** * Chip is compact visual component that displays information in an obround. * * @igxModule IgxChipsModule * * @igxTheme igx-chip-theme * * @igxKeywords chip * * @igxGroup display * * @remarks * The Ignite UI Chip can be templated, deleted, and selected. * Multiple chips can be reordered and visually connected to each other. * Chips reside in a container called chips area which is responsible for managing the interactions between the chips. * * @example * ```html * * * * ``` */ declare class IgxChipComponent implements OnInit, OnDestroy { cdr: ChangeDetectorRef; private ref; private renderer; document: Document; /** * Sets/gets the variant of the chip. * * @remarks * Allowed values are `primary`, `info`, `success`, `warning`, `danger`. * Providing no/nullish value leaves the chip in its default state. * * @example * ```html * * ``` */ variant?: IgxChipTypeVariant | null; /** * Sets the value of `id` attribute. If not provided it will be automatically generated. * * @example * ```html * * ``` */ id: string; /** * Returns the `role` attribute of the chip. * * @example * ```typescript * let chipRole = this.chip.role; * ``` */ role: string; /** * Sets the value of `tabindex` attribute. If not provided it will use the element's tabindex if set. * * @example * ```html * * ``` */ set tabIndex(value: number); get tabIndex(): number; /** * Stores data related to the chip. * * @example * ```html * * ``` */ data: any; /** * Defines if the `IgxChipComponent` can be dragged in order to change it's position. * By default it is set to false. * * @example * ```html * * ``` */ draggable: boolean; /** * Enables/disables the draggable element animation when the element is released. * By default it's set to true. * * @example * ```html * * ``` */ animateOnRelease: boolean; /** * Enables/disables the hiding of the base element that has been dragged. * By default it's set to true. * * @example * ```html * * ``` */ hideBaseOnDrag: boolean; /** * Defines if the `IgxChipComponent` should render remove button and throw remove events. * By default it is set to false. * * @example * ```html * * ``` */ removable: boolean; /** * Overrides the default icon that the chip applies to the remove button. * * @example * ```html * * delete * ``` */ removeIcon: TemplateRef; /** * Defines if the `IgxChipComponent` can be selected on click or through navigation, * By default it is set to false. * * @example * ```html * * ``` */ selectable: boolean; /** * Overrides the default icon that the chip applies when it is selected. * * @example * ```html * * done_outline * ``` */ selectIcon: TemplateRef; /** * @hidden * @internal */ class: string; /** * Disables the `IgxChipComponent`. When disabled it restricts user interactions * like focusing on click or tab, selection on click or Space, dragging. * By default it is set to false. * * @example * ```html * * ``` */ disabled: boolean; /** * Sets the `IgxChipComponent` selected state. * * @example * ```html * * ``` * * Two-way data binding: * ```html * * ``` */ set selected(newValue: boolean); /** * Returns if the `IgxChipComponent` is selected. * * @example * ```typescript * @ViewChild('myChip') * public chip: IgxChipComponent; * selectedChip(){ * let selectedChip = this.chip.selected; * } * ``` */ get selected(): boolean; /** * @hidden * @internal */ selectedChange: EventEmitter; /** * Sets the `IgxChipComponent` background color. * The `color` property supports string, rgb, hex. * * @example * ```html * * ``` */ set color(newColor: any); /** * Returns the background color of the `IgxChipComponent`. * * @example * ```typescript * @ViewChild('myChip') * public chip: IgxChipComponent; * ngAfterViewInit(){ * let chipColor = this.chip.color; * } * ``` */ get color(): any; /** * An accessor that sets the resource strings. * By default it uses EN resources. */ set resourceStrings(value: IChipResourceStrings); /** * An accessor that returns the resource strings. */ get resourceStrings(): IChipResourceStrings; /** * Emits an event when the `IgxChipComponent` moving starts. * Returns the moving `IgxChipComponent`. * * @example * ```html * * ``` */ moveStart: EventEmitter; /** * Emits an event when the `IgxChipComponent` moving ends. * Returns the moved `IgxChipComponent`. * * @example * ```html * * ``` */ moveEnd: EventEmitter; /** * Emits an event when the `IgxChipComponent` is removed. * Returns the removed `IgxChipComponent`. * * @example * ```html * * ``` */ remove: EventEmitter; /** * Emits an event when the `IgxChipComponent` is clicked. * Returns the clicked `IgxChipComponent`, whether the event should be canceled. * * @example * ```html * * ``` */ chipClick: EventEmitter; /** * Emits event when the `IgxChipComponent` is selected/deselected. * Returns the selected chip reference, whether the event should be canceled, what is the next selection state and * when the event is triggered by interaction `originalEvent` is provided, otherwise `originalEvent` is `null`. * * @example * ```html * * ``` */ selectedChanging: EventEmitter; /** * Emits event when the `IgxChipComponent` is selected/deselected and any related animations and transitions also end. * * @example * ```html * * ``` */ selectedChanged: EventEmitter; /** * Emits an event when the `IgxChipComponent` keyboard navigation is being used. * Returns the focused/selected `IgxChipComponent`, whether the event should be canceled, * if the `alt`, `shift` or `control` key is pressed and the pressed key name. * * @example * ```html * * ``` */ keyDown: EventEmitter; /** * Emits an event when the `IgxChipComponent` has entered the `IgxChipsAreaComponent`. * Returns the target `IgxChipComponent`, the drag `IgxChipComponent`, as well as * the original drop event arguments. * * @example * ```html * * ``` */ dragEnter: EventEmitter; /** * Emits an event when the `IgxChipComponent` has left the `IgxChipsAreaComponent`. * Returns the target `IgxChipComponent`, the drag `IgxChipComponent`, as well as * the original drop event arguments. * * @example * ```html * * ``` */ dragLeave: EventEmitter; /** * Emits an event when the `IgxChipComponent` is over the `IgxChipsAreaComponent`. * Returns the target `IgxChipComponent`, the drag `IgxChipComponent`, as well as * the original drop event arguments. * * @example * ```html * * ``` */ dragOver: EventEmitter; /** * Emits an event when the `IgxChipComponent` has been dropped in the `IgxChipsAreaComponent`. * Returns the target `IgxChipComponent`, the drag `IgxChipComponent`, as well as * the original drop event arguments. * * @example * ```html * * ``` */ dragDrop: EventEmitter; protected defaultClass: string; protected get isPrimary(): boolean; protected get isInfo(): boolean; protected get isSuccess(): boolean; protected get isWarning(): boolean; protected get isDanger(): boolean; /** * Property that contains a reference to the `IgxDragDirective` the `IgxChipComponent` uses for dragging behavior. * * @example * ```html * * ``` * ```typescript * onMoveStart(event: IBaseChipEventArgs){ * let dragDirective = event.owner.dragDirective; * } * ``` */ dragDirective: IgxDragDirective; /** * @hidden * @internal */ chipArea: ElementRef; /** * @hidden * @internal */ defaultRemoveIcon: TemplateRef; /** * @hidden * @internal */ defaultSelectIcon: TemplateRef; /** * @hidden * @internal */ get removeButtonTemplate(): TemplateRef; /** * @hidden * @internal */ get selectIconTemplate(): TemplateRef; /** * @hidden * @internal */ get ghostStyles(): { '--ig-size': string; }; /** @hidden @internal */ get nativeElement(): HTMLElement; /** * @hidden * @internal */ hideBaseElement: boolean; /** * @hidden * @internal */ destroy$: Subject; protected get chipSize(): _Size; protected _tabIndex: any; protected _selected: boolean; protected _selectedItemClass: string; protected _movedWhileRemoving: boolean; protected computedStyles: any; private _resourceStrings; /** * @hidden * @internal */ keyEvent(event: KeyboardEvent): void; /** * @hidden * @internal */ selectClass(condition: boolean): any; onSelectTransitionDone(event: any): void; /** * @hidden * @internal */ onChipKeyDown(event: KeyboardEvent): void; /** * @hidden * @internal */ onRemoveBtnKeyDown(event: KeyboardEvent): void; onRemoveMouseDown(event: PointerEvent | MouseEvent): void; /** * @hidden * @internal */ onRemoveClick(event: MouseEvent | TouchEvent): void; /** * @hidden * @internal */ onRemoveTouchMove(): void; /** * @hidden * @internal */ onRemoveTouchEnd(event: TouchEvent): void; /** * @hidden * @internal */ onChipDragStart(event: IDragStartEventArgs): void; /** * @hidden * @internal */ onChipDragEnd(): void; /** * @hidden * @internal */ onChipMoveEnd(event: IDragBaseEventArgs): void; /** * @hidden * @internal */ onChipGhostCreate(): void; /** * @hidden * @internal */ onChipGhostDestroy(): void; /** * @hidden * @internal */ onChipDragClicked(event: IDragBaseEventArgs): void; /** * @hidden * @internal */ onChipDragEnterHandler(event: IDropBaseEventArgs): void; /** * @hidden * @internal */ onChipDragLeaveHandler(event: IDropBaseEventArgs): void; /** * @hidden * @internal */ onChipDrop(event: IDropDroppedEventArgs): void; /** * @hidden * @internal */ onChipOverHandler(event: IDropBaseEventArgs): void; protected changeSelection(newValue: boolean, srcEvent?: any): void; ngOnInit(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_draggable: unknown; static ngAcceptInputType_animateOnRelease: unknown; static ngAcceptInputType_hideBaseOnDrag: unknown; static ngAcceptInputType_removable: unknown; static ngAcceptInputType_selectable: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_selected: unknown; } interface IBaseChipsAreaEventArgs { originalEvent: IDragBaseEventArgs | IDropBaseEventArgs | KeyboardEvent | MouseEvent | TouchEvent; owner: IgxChipsAreaComponent; } interface IChipsAreaReorderEventArgs extends IBaseChipsAreaEventArgs { chipsArray: IgxChipComponent[]; } interface IChipsAreaSelectEventArgs extends IBaseChipsAreaEventArgs { newSelection: IgxChipComponent[]; } /** * The chip area allows you to perform more complex scenarios with chips that require interaction, * like dragging, selection, navigation, etc. * * @igxModule IgxChipsModule * * @igxTheme igx-chip-theme * * @igxKeywords chip area, chip * * @igxGroup display * * @example * ```html * * * {{chip.text}} * * * ``` */ declare class IgxChipsAreaComponent implements DoCheck, AfterViewInit, OnDestroy { cdr: ChangeDetectorRef; element: ElementRef; private _iterableDiffers; /** * Returns the `role` attribute of the chips area. * * @example * ```typescript * let chipsAreaRole = this.chipsArea.role; * ``` */ role: string; /** * Returns the `aria-label` attribute of the chips area. * * @example * ```typescript * let ariaLabel = this.chipsArea.ariaLabel; * ``` * */ ariaLabel: string; /** * Sets the width of the `IgxChipsAreaComponent`. * * @example * ```html * * ``` */ width: number; /** @hidden @internal */ get _widthToRem(): number; /** * Sets the height of the `IgxChipsAreaComponent`. * * @example * ```html * * ``` */ height: number; /** @hidden @internal */ get _heightToRem(): number; /** * Emits an event when `IgxChipComponent`s in the `IgxChipsAreaComponent` should be reordered. * Returns an array of `IgxChipComponent`s. * * @example * ```html * * ``` */ reorder: EventEmitter; /** * Emits an event when an `IgxChipComponent` in the `IgxChipsAreaComponent` is selected/deselected. * Fired after the chips area is initialized if there are initially selected chips as well. * Returns an array of selected `IgxChipComponent`s and the `IgxChipAreaComponent`. * * @example * ```html * * ``` */ selectionChange: EventEmitter; /** * Emits an event when an `IgxChipComponent` in the `IgxChipsAreaComponent` is moved. * * @example * ```html * * ``` */ moveStart: EventEmitter; /** * Emits an event after an `IgxChipComponent` in the `IgxChipsAreaComponent` is moved. * * @example * ```html * * ``` */ moveEnd: EventEmitter; /** * Holds the `IgxChipComponent` in the `IgxChipsAreaComponent`. * * @example * ```typescript * ngAfterViewInit(){ * let chips = this.chipsArea.chipsList; * } * ``` */ chipsList: QueryList; protected destroy$: Subject; protected hostClass: string; private modifiedChipsArray; private _differ; constructor(); /** * @hidden * @internal */ ngAfterViewInit(): void; /** * @hidden * @internal */ ngDoCheck(): void; /** * @hidden * @internal */ ngOnDestroy(): void; /** * @hidden * @internal */ protected onChipKeyDown(event: IChipKeyDownEventArgs): void; /** * @hidden * @internal */ protected onChipMoveStart(event: IBaseChipEventArgs): void; /** * @hidden * @internal */ protected onChipMoveEnd(event: IBaseChipEventArgs): void; /** * @hidden * @internal */ protected onChipDragEnter(event: IChipEnterDragAreaEventArgs): void; /** * @hidden * @internal */ protected positionChipAtIndex(chipIndex: any, targetIndex: any, shiftRestLeft: any, originalEvent: any): boolean; /** * @hidden * @internal */ protected onChipSelectionChange(event: IChipSelectEventArgs): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare const IGX_CHIPS_DIRECTIVES: readonly [typeof IgxChipsAreaComponent, typeof IgxChipComponent, typeof IgxPrefixDirective, typeof IgxSuffixDirective]; /** * @hidden * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components */ declare class IgxChipsModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { IGX_CHIPS_DIRECTIVES, IgxChipComponent, IgxChipTypeVariant, IgxChipsAreaComponent, IgxChipsModule }; export type { IBaseChipEventArgs, IBaseChipsAreaEventArgs, IChipClickEventArgs, IChipEnterDragAreaEventArgs, IChipKeyDownEventArgs, IChipSelectEventArgs, IChipsAreaReorderEventArgs, IChipsAreaSelectEventArgs };