import * as i0 from '@angular/core'; import { AfterViewInit, OnChanges, OnDestroy, ViewContainerRef, EventEmitter, Injector } from '@angular/core'; import { DynamicContent } from '@odx/angular/cdk/dynamic-view'; import { NgChanges } from '@odx/angular/utils'; import { ConnectedOverlayOptions } from '@odx/angular/cdk/connected-overlay'; import * as i2 from '@odx/angular'; declare class CloseDropdownEvent extends Event { static readonly TYPE = "odxDropdownClose"; constructor(); } type DropdownOptions = Pick; declare const DefaultDropdownOptions: DropdownOptions; declare const DEFAULT_DROPDOWN_OPEN_TRIGGERS: string[]; declare const DEFAULT_DROPDOWN_CLOSE_TRIGGERS: string[]; /** * Represents a directive that enables dropdown functionality in Angular. * This directive handles the opening and closing of a dropdown menu, as well as * managing the associated overlay and event handling. */ declare class DropdownDirective implements AfterViewInit, OnChanges, OnDestroy { private readonly changeDetector; private readonly connectedOverlayService; private readonly eventManager; private readonly viewContainer; private readonly injector; private overlayRef; readonly element: i0.ElementRef; /** * Gets a value indicating whether the dropdown is currently open. * * @returns {boolean} */ get isOpen(): boolean; /** * The content to be displayed in the dropdown. * It can be either a static content or a dynamically loaded content. * * @type {DynamicContent | null} */ content?: DynamicContent | null; /** * Indicates whether the dropdown is disabled or not. * * @type {boolean} * @default false */ disabled: boolean; /** * Indicates whether the loader should be shown. * * @type {boolean} * @default false */ showLoader: boolean; /** * Determines whether the dropdown should close when a click event occurs outside of it. * * @type {boolean} * @default true */ clickOutsideActive: boolean; /** * The options to be used when creating the dropdown overlay. * * @type {Partial | null} */ options?: Partial | null; /** * The reference element to which the dropdown is anchored. * * @type {HTMLElement | null} */ referenceElement?: HTMLElement | null; /** * The trigger element that opens the dropdown. * * @type {HTMLElement | null} */ triggerElement?: HTMLElement | null; /** * The host element to which the dropdown is appended. * * @type {HTMLElement | ViewContainerRef | null} */ host?: HTMLElement | ViewContainerRef | null; /** * The event triggers that open the dropdown. * * @type {string[] | null} * @default DEFAULT_DROPDOWN_OPEN_TRIGGERS */ openTrigger?: string[] | null; /** * The event triggers that close the dropdown. * * @type {string[] | null} * @default DEFAULT_DROPDOWN_CLOSE_TRIGGERS */ closeTrigger?: string[] | null; /** * Event emitter that emits before the dropdown is opened. * * @emits {void} */ beforeOpen: EventEmitter; /** * Event emitter that emits after the dropdown is opened. * * @emits {void} */ afterOpen: EventEmitter; /** * Event emitter that emits before the dropdown is closed. * * @emits {void} */ beforeClose: EventEmitter; /** * Event emitter that emits after the dropdown is closed. * * @emits {void} */ afterClose: EventEmitter; ngAfterViewInit(): void; ngOnDestroy(): void; ngOnChanges(changes: NgChanges): void; /** * Toggles the state of the dropdown. * If the dropdown is open, it will be closed. If it is closed, it will be opened. * * @param {Event | undefined} event - The optional event that triggered the toggle. */ toggle(event?: Event): void; /** * Opens the dropdown. * * @param {Event | undefined} event - The optional event that triggered the open. */ open(event?: Event): void; /** * Closes the dropdown. * * @param {Event | undefined} event - The optional event that triggered the close. */ close(event?: Event): void; private createOverlayOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_showLoader: unknown; static ngAcceptInputType_clickOutsideActive: unknown; } /** * Represents a dropdown component. */ declare class DropdownComponent { protected readonly host: DropdownDirective; protected readonly injector: Injector; readonly element: i0.ElementRef; /** * The content to be displayed in the dropdown. * * @type {DynamicContent | null} */ content?: DynamicContent | null; /** * Indicates whether to show a loader while loading the dropdown content. * * @type {boolean | undefined} */ showLoader?: boolean; /** * Indicates whether clicking outside the dropdown should close it. * * @type {boolean | undefined} */ clickOutsideActive?: boolean; protected onDropdownClose(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class DropdownModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @internal * Dispatches a CloseDropdownEvent for target to close the current dropdown. * * @param {Element} target - The target element to close the dropdown for. */ declare function closeCurrentDropdown(target: Element): void; export { CloseDropdownEvent, DEFAULT_DROPDOWN_CLOSE_TRIGGERS, DEFAULT_DROPDOWN_OPEN_TRIGGERS, DefaultDropdownOptions, DropdownComponent, DropdownDirective, DropdownModule, closeCurrentDropdown }; export type { DropdownOptions };