import { Placement } from '@floating-ui/dom'; import { EventEmitter } from '../../stencil-public-runtime'; export type DropdownPlacement = Placement; /** * A dropdown component to display a list of actions in a dropdown menu or to * show additional content on demand. */ export declare class CatDropdown { private static readonly OFFSET; private readonly id; private triggerSlot; private trigger?; private anchorSlot; private anchor?; private content; private trap?; private _isOpen; private cleanupFloatingUi?; private readonly tabbableOptions; /** * Tracking the origin of opening the dropdown and specify if initial focus should be set. * Currently we set it only when the origin is keyboard. * We might not need to track this in future when focus-visible support is improved across browsers */ private isFocusVisible; private readonly boundWindowClickListener; private readonly boundWindowMousedownListener; private readonly boundWindowTouchStartListener; constructor(); /** * The placement of the dropdown. */ placement: Placement; /** * Make the dropdown match the width of the reference regardless of its * contents. Note that this only applies to the minimum width of the * dropdown. The maximum width is still limited by the viewport. */ justify: boolean; /** * Do not close the dropdown on outside clicks. */ noAutoClose: boolean; /** * Do not navigate focus inside the dropdown via vertical arrow keys. * @deprecated use cat-menu */ arrowNavigation: 'horizontal' | 'vertical' | 'none'; /** * Do not change the size of the dropdown to ensure it isn’t too big to fit * in the viewport (or more specifically, its clipping context). */ noResize: boolean; /** * Allow overflow when dropdown is open. */ overflow: boolean; /** * No element in dropdown will receive focus when dropdown is open. * By default, the first element in tab order will receive a focus. * @deprecated * Using noInitialFocus property would be a bad practice from a11y perspective. * We always want visible focus to jump inside the dropdown when user uses keyboard and noInitialFocus allows to turn it off which might introduce a bug. * hasInitialFocus should resolve the cause of the original problem instead. */ noInitialFocus: boolean; /** * Whether the dropdown is open. * @readonly */ get isOpen(): boolean; /** * Trigger element will not receive focus when dropdown is closed. * Please use this property carefully, consider using cat-menu over using this property */ noReturnFocus: boolean; /** * Whether the dropdown trigger should be initialized only before first opening. * Can be useful when trigger is rendered dynamically. */ delayedTriggerInit: boolean; /** * Whether the focus should be trapped inside dropdown popup. * Use it only when the dropdown popup content has role dialog. * @internal */ focusTrap: boolean; /** * Emitted when the dropdown is opened. */ catOpen: EventEmitter; /** * Emitted when the dropdown is closed. */ catClose: EventEmitter; clickHandler(event: CustomEvent): void; keydownHandler(event: KeyboardEvent): void; private windowClickListener; private windowMousedownListener; private windowTouchStartListener; /** * Toggles the dropdown. */ toggle(): Promise; /** * Opens the dropdown. * @param isFocusVisible is dropdown should receive visible focus when it's opened. */ open(isFocusVisible?: boolean): Promise; /** * Closes the dropdown. */ close(shouldReturnFocus?: boolean): Promise; componentDidLoad(): void; disconnectedCallback(): void; render(): any; private addListeners; private removeListeners; private handleClickOutside; private shouldCloseByClickEvent; private get contentId(); private initTrigger; private isEventOriginFromKeyboard; private initAnchor; private findTrigger; private update; private hasAttribute; }