import { ChangeDetectorRef, ElementRef, QueryList, OnInit, OnDestroy, AfterViewInit, EventEmitter } from '@angular/core'; import { IgxToggleDirective } from '../directives/toggle/toggle.directive'; import { IgxDropDownBaseDirective } from './drop-down.base'; import { DropDownActionKey, Navigate } from './drop-down.common'; import { IDropDownBase } from './drop-down.common'; import { CancelableEventArgs, CancelableBrowserEventArgs, IBaseEventArgs } from '../core/utils'; import { IgxSelectionAPIService } from '../core/selection'; import { Subject } from 'rxjs'; import { IgxDropDownItemBaseDirective } from './drop-down-item.base'; import { OverlaySettings } from '../services'; import { IgxForOfDirective } from '../directives/for-of/for_of.directive'; import { IDisplayDensityOptions } from '../core/density'; /** * **Ignite UI for Angular DropDown** - * [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/drop_down.html) * * The Ignite UI for Angular Drop Down displays a scrollable list of items which may be visually grouped and * supports selection of a single item. Clicking or tapping an item selects it and closes the Drop Down * * Example: * ```html * * * {{ item.value }} * * * ``` */ export declare class IgxDropDownComponent extends IgxDropDownBaseDirective implements IDropDownBase, OnInit, OnDestroy, AfterViewInit { protected elementRef: ElementRef; protected cdr: ChangeDetectorRef; protected selection: IgxSelectionAPIService; protected _displayDensityOptions: IDisplayDensityOptions; protected destroy$: Subject; protected _scrollPosition: number; protected virtDir: IgxForOfDirective; protected toggleDirective: IgxToggleDirective; protected scrollContainerRef: ElementRef; /** * @hidden * @internal */ children: QueryList; /** * Emitted before the dropdown is opened * * ```html * * ``` */ onOpening: EventEmitter; /** * Emitted after the dropdown is opened * * ```html * * ``` */ onOpened: EventEmitter; /** * Emitted before the dropdown is closed * * ```html * * ``` */ onClosing: EventEmitter; /** * Emitted after the dropdown is closed * * ```html * * ``` */ onClosed: EventEmitter; /** * Gets/sets whether items take focus. Disabled by default. * When enabled, drop down items gain tab index and are focused when active - * this includes activating the selected item when opening the drop down and moving with keyboard navigation. * * Note: Keep that focus shift in mind when using the igxDropDownItemNavigation directive * and ensure it's placed either on each focusable item or a common ancestor to allow it to handle keyboard events. * * ```typescript * // get * let dropDownAllowsItemFocus = this.dropdown.allowItemsFocus; * ``` * * ```html * * * ``` */ allowItemsFocus: boolean; /** * @hidden @internal */ focusedItem: IgxDropDownItemBaseDirective; id: string; /** Id of the internal listbox of the drop down */ readonly listId: string; /** * Get currently selected item * * ```typescript * let currentItem = this.dropdown.selectedItem; * ``` */ readonly selectedItem: IgxDropDownItemBaseDirective; /** * Gets if the dropdown is collapsed * * ```typescript * let isCollapsed = this.dropdown.collapsed; * ``` */ readonly collapsed: boolean; /** @hidden @internal */ readonly scrollContainer: HTMLElement; protected readonly collectionLength: number; constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, selection: IgxSelectionAPIService, _displayDensityOptions: IDisplayDensityOptions); /** * Opens the dropdown * * ```typescript * this.dropdown.open(); * ``` */ open(overlaySettings?: OverlaySettings): void; /** * Closes the dropdown * * ```typescript * this.dropdown.close(); * ``` */ close(): void; /** * Toggles the dropdown * * ```typescript * this.dropdown.toggle(); * ``` */ toggle(overlaySettings?: OverlaySettings): void; /** * Select an item by index * @param index of the item to select; If the drop down uses *igxFor, pass the index in data */ setSelectedItem(index: number): void; /** * Navigates to the item on the specified index * If the data in the drop-down is virtualized, pass the index of the item in the virtualized data. * @param newIndex number */ navigateItem(index: number): void; private isIndexOutOfBounds; protected skipHeader(direction: Navigate): void; /** * @hidden @internal */ updateScrollPosition(): void; /** * @hidden @internal */ onToggleOpening(e: CancelableEventArgs): void; /** * @hidden @internal */ onToggleOpened(): void; /** * @hidden @internal */ onToggleClosing(e: CancelableBrowserEventArgs): void; /** * @hidden @internal */ onToggleClosed(): void; /** * @hidden @internal */ ngOnDestroy(): void; protected scrollToItem(item: IgxDropDownItemBaseDirective): void; /** @hidden @internal */ calculateScrollPosition(item: IgxDropDownItemBaseDirective): number; /** * @hidden @internal */ ngOnInit(): void; ngAfterViewInit(): void; /** Keydown Handler */ onItemActionKey(key: DropDownActionKey, event?: Event): void; /** * Virtual scroll implementation * @hidden @internal */ navigateFirst(): void; /** * @hidden @internal */ navigateLast(): void; /** * @hidden @internal */ navigateNext(): void; /** * @hidden @internal */ navigatePrev(): void; /** * Handles the `onSelection` emit and the drop down toggle when selection changes * @hidden * @internal * @param newSelection * @param event */ selectItem(newSelection?: IgxDropDownItemBaseDirective, event?: Event): void; /** * Checks whether the selection is valid * `null` - the selection should be emptied * Virtual? - the selection should at least have and `index` and `value` property * Non-virtual? - the selection should be a valid drop-down item and **not** be a header */ protected isSelectionValid(selection: any): boolean; }