import { ElementRef, EventEmitter, OnChanges, OnInit, QueryList, Renderer2, SimpleChanges, TemplateRef } from '@angular/core'; import { TranslocoScope } from '@jsverse/transloco'; import { Subscription } from 'rxjs'; import { Option, OptionBase } from '@sebgroup/green-angular/src/v-angular/core'; import * as i0 from "@angular/core"; export declare class NggvDropdownListComponent implements OnInit, OnChanges { protected translocoScope: TranslocoScope; private renderer; private elRef; set expanded(state: boolean); get expanded(): boolean; state: any; /** The additional amount to show when option is scrolled into view. */ scrollOffset: number; optionContentTpl: TemplateRef> | undefined; groupLabelTpl: TemplateRef> | undefined; /** @internal List of references to the option elements. */ optionRefs: QueryList> | undefined; /** Id of the host element and is accessible by the children, automatically generated if not provided. */ id: any; /** Special property used for selecting DOM elements during automated UI testing. */ thook: string | null | undefined; get positionAttr(): "bottom" | "top"; options: any[]; textToHighlight?: string; /** * Used to control if "selectedValueChanged" only should emit distinct changes, or each time a value is selected * When true, value is not emitted if there's no distinct change * When false, value is emitted every time an option is selected * */ onlyEmitDistinctChanges: boolean; /** * Used to control if the dropdown list should select the current active element, when Space is pressed on the keyboard. * Primary usage is for typeahead, where the should be able to write a filter query containing spaces, * but not select the current active element with Space. */ selectWithSpace: boolean; /** * When true, the dropdown will automatically choose to open above or below the input * based on available space in the viewport, and will scale its height to fit if needed. */ dynamicPosition: boolean; selectedValueChanged: EventEmitter; /** * Emitted when the dropdown is closed by user interactions (e.g. Escape or Tab) or other immediate close triggers. * This notifies external consumers that the dropdown was closed as a result of a user action. */ closed: EventEmitter; /** * Emitted after the dropdown has fully closed and internal cleanup has been performed. * Use this for post-close tasks that must run after subscriptions are torn down and resources released. */ afterClose: EventEmitter; /** The current active option based on numeric index. */ activeIndex: number; scope: string | undefined; dropdownPosition: 'bottom' | 'top'; private dropdownUtils; private _expanded; private closed$; selectedValue?: Option; /** Subscribe if dropdown expanded to listen to click outside to close dropdown. */ protected onClickSubscription: Subscription | undefined; /** Subscribe to to keyboard events only when list is open. */ private onKeyDownSubscription; private onKeyUpSubscription; private _flattenedOptions; constructor(translocoScope: TranslocoScope, renderer: Renderer2, elRef: ElementRef); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; /** * Returns true if argument is an {@link OptionGroup}. * @param option the object to check. */ isGroup(option: any): boolean; /** @internal */ updateState(option: any, event: Event): void; /** * @internal */ setExpanded(expanded?: boolean): void; /** * @internal */ refreshSelectedOption(): void; /** * @internal * @returns The active index (number) if option is found, -1 otherwise. * - If a selectedValue exists that's not nullish and that options is found, return that index * - Else, return first non nullish index * - If none of the above criterias are met, -1 are returned */ getActiveIndex(): number; /** * @internal * evaluates wether the HTML element overflows * @param elem The HTMLElement to evaluate * */ isOverflow(elem: HTMLElement): boolean; /** * Typecast anything to an {@link OptionGroup}. * @param group the object to typecast. */ castGroup(group: any): any; /** * @internal * Disables default events. * @param event fired containing which key was pressed. */ onKeyDown(event: KeyboardEvent): boolean; /** * @internal * Enter toggles the dropdown, home, end, and, arrows change the index. * Space selects the currently active option if `selectWithSpace` is true. * @param event fired containing which key was released. */ onKeyUp(event: KeyboardEvent): void; /** @internal */ subscribeToKeyUpEvents(): void; /** @internal */ subscribeToKeyDownEvents(): void; /** * Scrolls focused result into view with a specified offset. * @param key the result index which to scroll to. */ scrollToResult(option: any, focusElement?: boolean): void; /** * Calculates available space above and below the dropdown input, * sets dropdownPosition ('top' or 'bottom') accordingly, * and dynamically sets the max-height of the dropdown list to fit the viewport. */ setDropdownPosition(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; }