import Component from '@glimmer/component'; import { EuiPopoverPosition } from 'ember-eui/utils/popover/types'; import { displayMapping } from 'ember-eui/utils/css-mappings/eui-popover'; import { paddingSizeMapping } from 'ember-eui/utils/css-mappings/eui-panel'; import { htmlSafe } from '@ember/template'; declare type PanelPaddingSize = keyof typeof paddingSizeMapping; export declare type PopoverAnchorPosition = 'upCenter' | 'upLeft' | 'upRight' | 'downCenter' | 'downLeft' | 'downRight' | 'leftCenter' | 'leftUp' | 'leftDown' | 'rightCenter' | 'rightUp' | 'rightDown'; export declare type EuiPopoverArgs = { /** * Class name passed to the direct parent of the button */ anchorClassName?: string; /** * Alignment of the popover and arrow relative to the button */ anchorPosition?: PopoverAnchorPosition; /** * Style and position alteration for arrow-less, left-aligned * attachment. Intended for use with inputs as anchors, e.g. * EuiInputPopover */ attachToAnchor?: boolean; /** * Triggering element for which to align the popover to */ button: Component; buttonRef: (e: HTMLDivElement) => unknown; /** * Callback to handle hiding of the popover */ closePopover: () => void; /** * Restrict the popover's position within this element */ container?: HTMLElement; /** * CSS display type for both the popover and anchor */ display?: keyof typeof displayMapping; /** * Show arrow indicating to originating button */ hasArrow?: boolean; /** * Specifies what element should initially have focus; Can be a DOM * node, or a selector string (which will be passed to * document.querySelector() to find the DOM node), or a function that * returns a DOM node */ initialFocus?: FocusTarget; /** * Passed directly to EuiPortal for DOM positioning. Both properties are * required if prop is specified */ insert?: { sibling: HTMLElement; position: 'before' | 'after'; }; /** * Visibility state of the popover */ isOpen?: boolean; /** * Traps tab focus within the popover contents */ ownFocus?: boolean; /** * Custom class added to the EuiPanel containing the popover contents */ panelClassName?: string; /** * EuiPanel padding on all sides */ panelPaddingSize?: PanelPaddingSize; /** * Standard DOM `style` attribute. Passed to the EuiPanel */ panelStyle?: HTMLStyleElement; panelRef?: (e: HTMLElement | null) => unknown; popoverRef?: (e: HTMLElement) => unknown; /** * When `true`, the popover's position is re-calculated when the user * scrolls, this supports having fixed-position popover anchors */ repositionOnScroll?: boolean; /** * By default, popover content inherits the z-index of the anchor * component; pass `zIndex` to override */ zIndex?: number; /** * Function callback for when the focus trap is deactivated */ onTrapDeactivation?: () => void; /** * Distance away from the anchor that the popover will render */ offset?: number; /** * Minimum distance between the popover and the bounding container; * Pass an array of 4 values to adjust each side differently: `[top, right, bottom, left]` * Default is 16 */ buffer?: number | [number, number, number, number]; /** * Element to pass as the child element of the arrow; * Use case is typically limited to an accompanying `EuiBeacon` */ arrowChildren?: Component; /** * Provide a name to the popover panel */ 'aria-label'?: string; /** * Alternative option to `aria-label` that takes an `id`. * Usually takes the `id` of the popover title */ 'aria-labelledby'?: string; }; export declare function getPopoverPositionFromAnchorPosition(anchorPosition: PopoverAnchorPosition): EuiPopoverPosition; export declare function getPopoverAlignFromAnchorPosition(anchorPosition: PopoverAnchorPosition): EuiPopoverPosition; export declare const ANCHOR_POSITIONS: string[]; export declare const DISPLAY: string[]; export declare type FocusTarget = HTMLElement | string | (() => HTMLElement); declare type CssProps = { top?: number; left?: number; right?: number; bottom?: number; zIndex?: number; willChange?: string; }; export default class EuiPopoverComponent extends Component { isOpen: boolean; ownFocus: boolean; anchorPosition: PopoverAnchorPosition; panelPaddingSize: PanelPaddingSize; hasArrow: boolean; display: string; prevIsOpen: boolean | undefined; suppressingPopover: boolean | undefined; isClosing: boolean; isOpening: boolean; popoverStyles: CssProps; arrowStyles: CssProps | undefined; arrowPosition: any; openPosition: any; isOpenStable: boolean; isCurrentlyOpen: boolean | undefined; private respositionTimeout; private closingTransitionTimeout; private closingTransitionAnimationFrame; private updateFocusAnimationFrame; button: HTMLElement | null; panel: HTMLElement | null; constructor(owner: unknown, args: EuiPopoverArgs); closePopover(): void; onEscapeKey(event: Event): void; onKeyDown(event: KeyboardEvent): void; onClickOutside(event: Event): void; updateFocus(): void; onOpenPopover(): void; didInsertPopover(): void; didUpdateRepositionOnScroll(): void; didUpdateIsOpen(): void; willDestroy(): void; onMutation(records: MutationRecord[]): void; positionPopover(allowEnforcePosition: boolean): void; get _arrowStyles(): ReturnType | undefined; get _popoverStyles(): {}; positionPopoverFixed(): void; positionPopoverFluid(): void; registerButton(btn: HTMLDivElement): void; registerPanel(panel: HTMLElement | null): void; } export {};