UNPKG

2.54 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent } from "../../common";
3import type { OverlayProps } from "./overlayProps";
4export interface OverlayState {
5 hasEverOpened?: boolean;
6}
7/**
8 * Overlay component.
9 *
10 * @deprecated use `Overlay2` instead
11 * @see https://blueprintjs.com/docs/#core/components/overlay
12 */
13export declare class Overlay extends AbstractPureComponent<OverlayProps, OverlayState> {
14 static displayName: string;
15 static defaultProps: OverlayProps;
16 static getDerivedStateFromProps({ isOpen: hasEverOpened }: OverlayProps): {
17 hasEverOpened: true;
18 } | null;
19 private static openStack;
20 private static getLastOpened;
21 private isAutoFocusing;
22 private lastActiveElementBeforeOpened;
23 state: OverlayState;
24 /** Ref for container element, containing all children and the backdrop */
25 containerElement: React.RefObject<HTMLDivElement>;
26 private startFocusTrapElement;
27 private endFocusTrapElement;
28 render(): React.JSX.Element | null;
29 componentDidMount(): void;
30 componentDidUpdate(prevProps: OverlayProps): void;
31 componentWillUnmount(): void;
32 private maybeRenderChild;
33 private maybeRenderBackdrop;
34 private renderDummyElement;
35 /**
36 * Ensures repeatedly pressing shift+tab keeps focus inside the Overlay. Moves focus to
37 * the `endFocusTrapElement` or the first keyboard-focusable element in the Overlay (excluding
38 * the `startFocusTrapElement`), depending on whether the element losing focus is inside the
39 * Overlay.
40 */
41 private handleStartFocusTrapElementFocus;
42 /**
43 * Wrap around to the end of the dialog if `enforceFocus` is enabled.
44 */
45 private handleStartFocusTrapElementKeyDown;
46 /**
47 * Ensures repeatedly pressing tab keeps focus inside the Overlay. Moves focus to the
48 * `startFocusTrapElement` or the last keyboard-focusable element in the Overlay (excluding the
49 * `startFocusTrapElement`), depending on whether the element losing focus is inside the
50 * Overlay.
51 */
52 private handleEndFocusTrapElementFocus;
53 private overlayWillClose;
54 private overlayWillOpen;
55 private handleTransitionExited;
56 private handleBackdropMouseDown;
57 private handleDocumentClick;
58 /**
59 * When multiple Overlays are open, this event handler is only active for the most recently
60 * opened one to avoid Overlays competing with each other for focus.
61 */
62 private handleDocumentFocus;
63 private handleKeyDown;
64 private handleTransitionAddEnd;
65}