UNPKG

igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

150 lines (149 loc) 6.27 kB
import { AfterViewInit, ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, Injector } from '@angular/core'; import { ControlValueAccessor, FormGroupDirective } from '@angular/forms'; import { IgxComboAddItemComponent } from '../combo/combo-add-item.component'; import { IgxComboDropDownComponent } from '../combo/combo-dropdown.component'; import { IgxComboAPIService } from '../combo/combo.api'; import { IgxComboBaseDirective } from '../combo/combo.common'; import { IgxSelectionAPIService } from '../core/selection'; import { CancelableEventArgs, IBaseCancelableBrowserEventArgs, IBaseEventArgs, PlatformUtil } from '../core/utils'; import { IgxIconService } from '../icon/icon.service'; import { IgxInputGroupType } from '../input-group/public_api'; import * as i0 from "@angular/core"; /** Emitted when an igx-simple-combo's selection is changing. */ export interface ISimpleComboSelectionChangingEventArgs extends CancelableEventArgs, IBaseEventArgs { /** An object which represents the value that is currently selected */ oldValue: any; /** An object which represents the value that will be selected after this event */ newValue: any; /** An object which represents the item that is currently selected */ oldSelection: any; /** An object which represents the item that will be selected after this event */ newSelection: any; /** The text that will be displayed in the combo text box */ displayText: string; } /** * Represents a drop-down list that provides filtering functionality, allowing users to choose a single option from a predefined list. * * @igxModule IgxSimpleComboModule * @igxTheme igx-combo-theme * @igxKeywords combobox, single combo selection * @igxGroup Grids & Lists * * @remarks * It provides the ability to filter items as well as perform single selection on the provided data. * Additionally, it exposes keyboard navigation and custom styling capabilities. * @example * ```html * <igx-simple-combo [itemsMaxHeight]="250" [data]="locationData" * [displayKey]="'field'" [valueKey]="'field'" * placeholder="Location" searchPlaceholder="Search..."> * </igx-simple-combo> * ``` */ export declare class IgxSimpleComboComponent extends IgxComboBaseDirective implements ControlValueAccessor, AfterViewInit, DoCheck { private platformUtil; private formGroupDirective?; /** @hidden @internal */ dropdown: IgxComboDropDownComponent; /** @hidden @internal */ addItem: IgxComboAddItemComponent; /** * Emitted when item selection is changing, before the selection completes * * ```html * <igx-simple-combo (selectionChanging)='handleSelection()'></igx-simple-combo> * ``` */ selectionChanging: EventEmitter<ISimpleComboSelectionChangingEventArgs>; private textSelection; get value(): any; /** * Get current selection state * * @returns The selected item, if any * ```typescript * let mySelection = this.combo.selection; * ``` */ get selection(): any; /** @hidden @internal */ composing: boolean; private _updateInput; private _collapsing; /** @hidden @internal */ get filteredData(): any[] | null; /** @hidden @internal */ set filteredData(val: any[] | null); /** @hidden @internal */ get searchValue(): string; set searchValue(val: string); private get selectedItem(); protected get hasSelectedItem(): boolean; constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, selectionService: IgxSelectionAPIService, comboAPI: IgxComboAPIService, platformUtil: PlatformUtil, document: any, _inputGroupType: IgxInputGroupType, _injector: Injector, _iconService?: IgxIconService, formGroupDirective?: FormGroupDirective); /** @hidden @internal */ onArrowDown(event: Event): void; /** * Select a defined item * * @param item the item to be selected * ```typescript * this.combo.select("New York"); * ``` */ select(item: any): void; /** * Deselect the currently selected item * * @param item the items to be deselected * ```typescript * this.combo.deselect("New York"); * ``` */ deselect(): void; /** @hidden @internal */ writeValue(value: any): void; /** @hidden @internal */ ngAfterViewInit(): void; /** @hidden @internal */ ngDoCheck(): void; /** @hidden @internal */ handleInputChange(event?: any): void; /** @hidden @internal */ handleInputClick(): void; /** @hidden @internal */ handleKeyDown(event: KeyboardEvent): void; /** @hidden @internal */ handleKeyUp(event: KeyboardEvent): void; /** @hidden @internal */ handleItemKeyDown(event: KeyboardEvent): void; /** @hidden @internal */ handleItemClick(): void; /** @hidden @internal */ onBlur(): void; /** @hidden @internal */ getEditElement(): HTMLElement; /** @hidden @internal */ handleClear(event: Event): void; /** @hidden @internal */ handleOpened(): void; /** @hidden @internal */ handleClosing(e: IBaseCancelableBrowserEventArgs): void; /** @hidden @internal */ focusSearchInput(opening?: boolean): void; /** @hidden @internal */ onClick(event: Event): void; protected findAllMatches: (element: any) => boolean; protected setSelection(newSelection: any): void; protected createDisplayText(newSelection: any[], oldSelection: any[]): string; protected getRemoteSelection(newSelection: any[], oldSelection: any[]): string; /** Contains key-value pairs of the selected valueKeys and their resp. displayKeys */ protected registerRemoteEntries(ids: any[], add?: boolean): void; private clearSelection; private clearOnBlur; private getElementVal; private clear; private isValid; static ɵfac: i0.ɵɵFactoryDeclaration<IgxSimpleComboComponent, [null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>; static ɵcmp: i0.ɵɵComponentDeclaration<IgxSimpleComboComponent, "igx-simple-combo", never, {}, { "selectionChanging": "selectionChanging"; }, never, ["[igxLabel]", "igx-prefix", "igx-hint, [igxHint]", "igx-suffix"], true, never>; }