/** @packageDocumentation * @module Popup */ import "./Popup.scss"; import * as React from "react"; import { RelativePosition } from "@bentley/ui-abstract"; import { CommonProps } from "../utils/Props"; /** Properties for the [[Popup]] component * @public */ export interface PopupProps extends CommonProps { /** Show or hide the box shadow (defaults to true) */ showShadow: boolean; /** Show or hide the arrow (defaults to false) */ showArrow: boolean; /** Indicates whether the popup is shown or not (defaults to false) */ isOpen: boolean; /** Direction (relative to the target) to which the popup is expanded (defaults to Bottom) */ position: RelativePosition; /** Top position (absolute positioning - defaults to 0) */ top: number; /** Left position (absolute positioning - defaults to 0) */ left: number; /** Function called when the popup is opened */ onOpen?: () => void; /** Function called when user clicks outside the popup */ onOutsideClick?: (e: MouseEvent) => void; /** Function called when the popup is closed */ onClose?: () => void; /** Function called when the popup is closed on Enter */ onEnter?: () => void; /** Function called when the wheel is used */ onWheel?: (e: WheelEvent) => void; /** Function called when the right mouse button is pressed */ onContextMenu?: (e: MouseEvent) => void; /** Offset from the parent (defaults to 4) */ offset: number; /** Target element to position popup */ target?: HTMLElement | null; /** Role - if not specified "dialog" is used */ role?: "dialog" | "alert" | "alertdialog"; /** accessibility label */ ariaLabel?: string; /** set focus to popup - default to not set focus */ moveFocus?: boolean; /** Element to receive focus, specified by React.RefObject or CSS selector string. If undefined and moveFocus is true then focus is moved to first focusable element. */ focusTarget?: React.RefObject | string; /** Indicates whether the popup is pinned. */ isPinned?: boolean; /** Indicates whether to use animation for open/close (defaults to true) */ animate?: boolean; /** Indicates whether to close the popup when Enter is pressed (defaults to true) */ closeOnEnter?: boolean; /** Indicates whether to close the popup when the wheel is used (defaults to true) */ closeOnWheel?: boolean; /** Indicates whether to close the popup when the right mouse button is pressed (defaults to true) */ closeOnContextMenu?: boolean; /** If false outside click processing and closing are skipped if click occurs in another Popup component, default to false. */ closeOnNestedPopupOutsideClick?: boolean; } /** @internal */ interface PopupState { isOpen: boolean; top: number; left: number; position: RelativePosition; parentDocument: Document; } /** Popup React component displays a popup relative to an optional target element. * @public */ export declare class Popup extends React.Component { private _popup; constructor(props: PopupProps); static defaultProps: Partial; componentDidMount(): void; private getParentWindow; componentDidUpdate(previousProps: PopupProps): void; componentWillUnmount(): void; private _bindWindowEvents; private _unBindWindowEvents; private _handleWheel; private isInCorePopup; private _handleOutsideClick; private _handleContextMenu; private _handleKeyboard; private _hide; private _onShow; private _onClose; private _isPositionAbsolute; private _getClassNameByPosition; private _getPopupDimensions; private _getPosition; private _toggleRelativePosition; private _fitPopup; render(): React.ReactPortal | null; } export {}; //# sourceMappingURL=Popup.d.ts.map