import { ElementRef, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; import { DropDownEventMessagesService } from '../services/drop-down-event-messages/drop-down-event-messages.service'; import * as i0 from "@angular/core"; export declare class DropDownArrowManagerDirective implements OnInit, OnDestroy { private elementRef; renderer: Renderer2; private dropDownEventMessagesService; private readonly ACTIVE_ITEM_CSS_CLASS; private readonly DATA_ITEM_INDEX_ATTRIBUTE; private readonly DATA_SING_TRIGGER_BUTTON_ATTRIBUTE; private readonly ngUnSubscribe; private currentActive; private currentActiveItemIndex; private allowIncrementalOrDecrementIndex; private lockedUpdateHighlightItemOnScroll; private allowFocusForActiveItem; private subscriptionToScrolledIndexChange; _viewport: CdkVirtualScrollViewport; set viewport(viewport: CdkVirtualScrollViewport); get viewport(): CdkVirtualScrollViewport; lastItemIndex: number; constructor(elementRef: ElementRef, renderer: Renderer2, dropDownEventMessagesService: DropDownEventMessagesService); ngOnInit(): void; ngOnDestroy(): void; /** * on arrow down move to the next enable item. * in case nothing active it set the first item as active. * * we are using the preventDefault inorder to prevent from outer scroll * on the viewport to move which will close the dropdown */ onArrowDown(event: KeyboardEvent): void; /** * on arrow up move to the previous enable item. * in case nothing active it set the first item as active. * * we are using the preventDefault inorder to prevent from outer scroll * on the viewport to move which will close the dropdown */ onArrowUp(event: KeyboardEvent): void; /** * Emulate click on the current active item */ onEnter(event: KeyboardEvent): void; /** * unset the current active item. * we use it on search change. */ private unsetCurrentActive; /** * before we active item we check if the item in the dom * and if not scroll to it first */ private preActiveItem; /** * set active item. */ private activeItem; /** * get the item element index as number */ private getItemIndexAsNumber; /** * check if we need to use the scroll to index of the cdk virtual scroll. * this use for a case where the user move to one of the items and then he scroll to a place where our active * item is not in the dom and once the user click on one of the arrow (up | down) we should first scroll to the active item * and only then active the next or previous item */ private useScrollToIndex; /** * listen to scroll index changes in order to decide * if we need to update the highlighted item. * * in case lockedUpdateHighlightItemOnScroll is true it mean * the scroll is not by user scrolling (it programmatically) so on those case * we want to locked this functionality */ private listenToScrolledIndexChange; /** * update the highlighted item on scroll. * we need to add or remove the highlighted item when scroll since the * virtual scroll not change the element item and when user scroll we will see * the wrong highlighted item. in order to fix it we are listening to scroll * and check if the real item is in doom and add back the item to be highlighted * and if it not we remove the highlighted. */ private updateHighlightItemOnScroll; /** * In case we have search input return the focus to the search input */ private backFocusToSearch; /** * select item. * we call this method on enter clicked and there is active item. * in case search input exist we return the focus to it */ private selectItem; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } //# sourceMappingURL=drop-down-arrow-manager.directive.d.ts.map