import { Ref } from "lit/directives/ref.js"; import { Placement, Middleware } from "@floating-ui/dom"; import SgdsElement from "./sgds-element"; import { PropertyValueMap } from "lit"; export type DropDirection = "left" | "right" | "up" | "down"; /** * @event sgds-show - Emitted event when show instance is called * @event sgds-after-show - Emitted event when dropdown has been made visible to the user and CSS transitions have completed * @event sgds-hide - Emitted event when hide instance is called * @event sgds-after-hide - Emitted event when dropdown has hidden to the user and CSS transitions have completed */ export declare class DropdownElement extends SgdsElement { /** @internal */ protected myDropdown: Ref; /** @internal Unique id generated for the dropdown menu */ protected dropdownMenuId: string; /** @internal Controls auto-flipping of menu */ protected noFlip: boolean; /** @internal When true, aligns right edge of menu with right edge of button */ protected menuAlignRight: boolean; /** @internal The drop position of menu relative to the toggle button */ protected drop: DropDirection; /** Additional configuration to pass to Floating UI. */ floatingOpts: { placement?: Placement; middleware?: Array; }; /** When true, dropdown menu shows on first load */ menuIsOpen: boolean; /** Controls the close behaviour of dropdown menu. By default menu auto-closes when SgdsDropdownItem or area outside dropdown is clicked */ protected close: "outside" | "default" | "inside"; /** Disables the dropdown toggle */ disabled: boolean; /** Makes the input readonly. */ readonly: boolean; private _cleanupAutoUpdate?; /** @internal Reference to the floating menu element */ protected menuRef: Ref; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(changedProperties: PropertyValueMap): void; /** When invoked, opens the dropdown menu */ showMenu(): Promise; /** Starts Floating UI's autoUpdate loop, recomputing menu position on scroll, resize, or ancestor layout changes. Stores the cleanup function to stop tracking when the menu closes. */ private _startAutoUpdate; /** When invoked, hides the dropdown menu */ hideMenu(isOutside?: boolean): void; toggleMenu(): void; protected _handleKeyboardMenuEvent(e: KeyboardEvent): void; private _handleClickOutOfElement; protected mergeMiddleware(defaults: Middleware[], custom: Middleware[]): Middleware[]; protected updateFloatingPosition(): Promise; }