import { AnimationEvent } from '@angular/animations'; import { FocusOrigin } from '@angular/cdk/a11y'; import { Direction } from '@angular/cdk/bidi'; import { AfterContentInit, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { KbqDropdownContent } from './dropdown-content.directive'; import { KbqDropdownItem } from './dropdown-item.component'; import { KbqDropdownDefaultOptions, KbqDropdownPanel, KbqDropdownPositionX, KbqDropdownPositionY } from './dropdown.types'; import * as i0 from "@angular/core"; export declare class KbqDropdownStaticContent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare class KbqDropdown implements AfterContentInit, KbqDropdownPanel, OnInit, OnDestroy { private elementRef; private ngZone; private defaultOptions; private search?; navigationWithWrap: boolean; /** Position of the dropdown in the X axis. */ get xPosition(): KbqDropdownPositionX; set xPosition(value: KbqDropdownPositionX); /** Position of the dropdown in the Y axis. */ get yPosition(): KbqDropdownPositionY; set yPosition(value: KbqDropdownPositionY); /** Whether the dropdown should overlap its trigger vertically. */ get overlapTriggerY(): boolean; set overlapTriggerY(value: boolean); /** Whether the dropdown should overlap its trigger horizontally. */ get overlapTriggerX(): boolean; set overlapTriggerX(value: boolean); /** Whether the dropdown has a backdrop. */ get hasBackdrop(): boolean; set hasBackdrop(value: boolean); /** * This method takes classes set on the host kbq-dropdown element and applies them on the * dropdown template that displays in the overlay container. Otherwise, it's difficult * to style the containing dropdown from outside the component. * @param classes list of class names */ set panelClass(classes: string); private _xPosition; private _yPosition; private _overlapTriggerX; private _overlapTriggerY; private _hasBackdrop; triggerWidth: string; /** Config object to be passed into the dropdown's ngClass */ classList: { [key: string]: boolean; }; /** Current state of the panel animation. */ panelAnimationState: 'void' | 'enter'; /** Emits whenever an animation on the dropdown completes. */ animationDone: Subject; /** Whether the dropdown is animating. */ isAnimating: boolean; /** Parent dropdown of the current dropdown panel. */ parent: KbqDropdownPanel | undefined; /** Layout direction of the dropdown. */ direction: Direction; /** Class to be added to the backdrop element. */ backdropClass: string; /** @docs-private */ templateRef: TemplateRef; /** * List of the items inside of a dropdown. */ items: QueryList; /** * Dropdown content that will be rendered lazily. * @docs-private */ lazyContent: KbqDropdownContent; /** Event emitted when the dropdown is closed. */ readonly closed: EventEmitter; private previousPanelClass; private keyManager; /** Only the direct descendant menu items. */ private directDescendantItems; /** Subscription to tab events on the dropdown panel */ private tabSubscription; constructor(elementRef: ElementRef, ngZone: NgZone, defaultOptions: KbqDropdownDefaultOptions); ngOnInit(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** Stream that emits whenever the hovered dropdown item changes. */ hovered(): Observable; /** Handle a keyboard event from the dropdown, delegating to the appropriate action. */ handleKeydown(event: KeyboardEvent): void; /** * Focus the first item in the dropdown. * @param origin Action from which the focus originated. Used to set the correct styling. */ focusFirstItem(origin?: FocusOrigin): void; /** * Applies focus when the dropdown is opened. When opened by mouse or touch, the first item * should not be highlighted, so the panel itself is focused instead — keyboard events still * reach the panel and the first arrow key press will highlight the first item. */ private applyInitialFocus; /** Moves DOM focus onto the dropdown panel so that keydown events keep being handled. */ private focusPanel; /** * Resets the active item in the dropdown. This is used when the dropdown is opened, allowing * the user to start from the first option when pressing the down arrow. */ resetActiveItem(): void; /** * Adds classes to the dropdown panel based on its position. Can be used by * consumers to add specific styling based on the position. * @param posX Position of the dropdown along the x axis. * @param posY Position of the dropdown along the y axis. * @docs-private */ setPositionClasses(posX?: KbqDropdownPositionX, posY?: KbqDropdownPositionY): void; /** Starts the enter animation. */ startAnimation(): void; /** Resets the panel animation to its initial state. */ resetAnimation(): void; /** Callback that is invoked when the panel animation completes. */ onAnimationDone(event: AnimationEvent): void; onAnimationStart(event: AnimationEvent): void; close(): void; /** * Sets up a stream that will keep track of any newly-added menu items and will update the list * of direct descendants. We collect the descendants this way, because `items` can include * items that are part of child menus, and using a custom way of registering items is unreliable * when it comes to maintaining the item order. */ private updateDirectDescendants; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }