UNPKG

igniteui-angular

Version:

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

167 lines (162 loc) 7.91 kB
import * as i3 from 'igniteui-angular/input-group'; import { IgxLabelDirective, IgxPrefixDirective, IgxSuffixDirective, IgxHintDirective } from 'igniteui-angular/input-group'; import * as i0 from '@angular/core'; import { AfterViewInit, DoCheck, EventEmitter } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { CancelableEventArgs, IBaseEventArgs, IBaseCancelableBrowserEventArgs } from 'igniteui-angular/core'; import * as i2 from 'igniteui-angular/combo'; import { IgxComboBaseDirective, IgxComboDropDownComponent, IgxComboAddItemComponent, IgxComboAddItemDirective, IgxComboClearIconDirective, IgxComboEmptyDirective, IgxComboFooterDirective, IgxComboHeaderDirective, IgxComboHeaderItemDirective, IgxComboItemDirective, IgxComboToggleIconDirective } from 'igniteui-angular/combo'; /** Emitted when an igx-simple-combo's selection is changing. */ 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> * ``` */ 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(); /** @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 */ clearInput(event: Event): void; /** @hidden @internal */ handleClear(event: Event): void; /** @hidden @internal */ handleClearKeyDown(event: KeyboardEvent): 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, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IgxSimpleComboComponent, "igx-simple-combo", never, {}, { "selectionChanging": "selectionChanging"; }, never, ["[igxLabel]", "igx-prefix,[igxPrefix]", "igx-hint, [igxHint]", "igx-suffix,[igxSuffix]"], true, never>; } declare const IGX_SIMPLE_COMBO_DIRECTIVES: readonly [typeof IgxSimpleComboComponent, typeof IgxComboAddItemDirective, typeof IgxComboClearIconDirective, typeof IgxComboEmptyDirective, typeof IgxComboFooterDirective, typeof IgxComboHeaderDirective, typeof IgxComboHeaderItemDirective, typeof IgxComboItemDirective, typeof IgxComboToggleIconDirective, typeof IgxLabelDirective, typeof IgxPrefixDirective, typeof IgxSuffixDirective, typeof IgxHintDirective]; /** * @hidden * IMPORTANT: The following is NgModule exported for backwards-compatibility before standalone components */ declare class IgxSimpleComboModule { static ɵfac: i0.ɵɵFactoryDeclaration<IgxSimpleComboModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<IgxSimpleComboModule, never, [typeof IgxSimpleComboComponent, typeof i2.IgxComboAddItemDirective, typeof i2.IgxComboClearIconDirective, typeof i2.IgxComboEmptyDirective, typeof i2.IgxComboFooterDirective, typeof i2.IgxComboHeaderDirective, typeof i2.IgxComboHeaderItemDirective, typeof i2.IgxComboItemDirective, typeof i2.IgxComboToggleIconDirective, typeof i3.IgxLabelDirective, typeof i3.IgxPrefixDirective, typeof i3.IgxSuffixDirective, typeof i3.IgxHintDirective], [typeof IgxSimpleComboComponent, typeof i2.IgxComboAddItemDirective, typeof i2.IgxComboClearIconDirective, typeof i2.IgxComboEmptyDirective, typeof i2.IgxComboFooterDirective, typeof i2.IgxComboHeaderDirective, typeof i2.IgxComboHeaderItemDirective, typeof i2.IgxComboItemDirective, typeof i2.IgxComboToggleIconDirective, typeof i3.IgxLabelDirective, typeof i3.IgxPrefixDirective, typeof i3.IgxSuffixDirective, typeof i3.IgxHintDirective]>; static ɵinj: i0.ɵɵInjectorDeclaration<IgxSimpleComboModule>; } export { IGX_SIMPLE_COMBO_DIRECTIVES, IgxSimpleComboComponent, IgxSimpleComboModule }; export type { ISimpleComboSelectionChangingEventArgs };