/** @packageDocumentation * @module ContextMenu */ import "./ContextMenu.scss"; import * as React from "react"; import type { CommonProps } from "../utils/Props.js"; import { ContextMenuDirection } from "./ContextMenuDirection.js"; import { ContextSubMenu } from "./ContextSubMenu.js"; /** Properties for the [[ContextMenu]] component * @public * @deprecated in 4.16.0. Props of deprecated {@link ContextMenu} component. */ export interface ContextMenuProps extends CommonProps { /** Whether ContextMenu is currently opened. */ opened: boolean; /** Which direction the menu opens. Default: ContextMenuDirection.BottomRight */ direction?: ContextMenuDirection; /** When click is registered outside of ContextMenu. */ onOutsideClick?: (event: MouseEvent) => any; /** When list item or submenu is selected */ onSelect?: (event: any) => any; /** when Escape button is pressed */ onEsc?: (data: any) => any; /** Whether menu flips directions based on screen edge. Default: true */ autoflip?: boolean; /** Whether menu hugs screen edge when autoflip is off. Default: true */ edgeLimit?: boolean; /** Whether Hotkey press selects item, or just highlights item. Default: true */ hotkeySelect?: boolean; /** starting menu item selected index Default: -1 */ selectedIndex?: number; /** whether menu floats on the viewport, or the page. When false, container elements can clip menu with overflow: hidden; Default: true */ floating?: boolean; /** Additional offset to apply. */ offset?: number; /** @internal */ parentMenu?: ContextMenu; /** @internal */ parentSubmenu?: ContextSubMenu; /** @internal */ ignoreNextKeyUp?: boolean; /** Content */ children?: React.ReactNode; } interface ContextMenuState { selectedIndex: number; direction: ContextMenuDirection; ignoreNextKeyUp: boolean; } /** A context menu populated with [[ContextMenuItem]] components. * Can be nested using [[ContextSubMenu]] component. * @public * @deprecated in 4.16.0. Use {@link https://itwinui.bentley.com/docs/dropdownmenu iTwinUI DropdownMenu} component instead. */ export declare class ContextMenu extends React.PureComponent { private _rootElement; private _menuElement; private _selectedElement; private _length; private _hotKeyMap; private _lastChildren; private _lastDirection; private _lastSelectedIndex; private _injectedChildren; private _parentWindowHeight; private _parentWindowWidth; static defaultProps: Partial; readonly state: Readonly; constructor(props: ContextMenuProps); /** @internal */ static autoFlip: (dir: ContextMenuDirection, rect: DOMRectReadOnly, windowWidth: number, windowHeight: number) => ContextMenuDirection; private _handleHotKeyParsed; private _handleOnOutsideClick; render(): React.ReactElement; /** @internal */ static getCSSClassNameFromDirection: (direction?: ContextMenuDirection) => string; private _injectMenuItemProps; private _rootRef; private _menuRef; private getWindow; componentDidMount(): void; componentWillUnmount(): void; private checkRenderDirection; focus: () => void; blur: () => void; getRect: () => DOMRect; private _handleFocusChange; private _handleClick; private _handleKeyUp; /** @internal */ componentDidUpdate(prevProps: ContextMenuProps): void; } export {}; //# sourceMappingURL=ContextMenu.d.ts.map