1 | import * as React from "react";
|
2 | import { AbstractPureComponent2, IRef } from "../../common";
|
3 | import { IPopoverSharedProps } from "./popoverSharedProps";
|
4 | export declare const PopoverInteractionKind: {
|
5 | CLICK: "click";
|
6 | CLICK_TARGET_ONLY: "click-target";
|
7 | HOVER: "hover";
|
8 | HOVER_TARGET_ONLY: "hover-target";
|
9 | };
|
10 | export declare type PopoverInteractionKind = typeof PopoverInteractionKind[keyof typeof PopoverInteractionKind];
|
11 | export interface IPopoverProps extends IPopoverSharedProps {
|
12 | /** HTML props for the backdrop element. Can be combined with `backdropClassName`. */
|
13 | backdropProps?: React.HTMLProps<HTMLDivElement>;
|
14 | /**
|
15 | * The content displayed inside the popover. This can instead be provided as
|
16 | * the _second_ element in `children` (first is `target`).
|
17 | */
|
18 | content?: string | JSX.Element;
|
19 | /**
|
20 | * Whether the wrapper and target should take up the full width of their container.
|
21 | * Note that supplying `true` for this prop will force `targetTagName="div"` and
|
22 | * `wrapperTagName="div"`.
|
23 | */
|
24 | fill?: boolean;
|
25 | /**
|
26 | * The kind of interaction that triggers the display of the popover.
|
27 | *
|
28 | * @default PopoverInteractionKind.CLICK
|
29 | */
|
30 | interactionKind?: PopoverInteractionKind;
|
31 | /**
|
32 | * Enables an invisible overlay beneath the popover that captures clicks and
|
33 | * prevents interaction with the rest of the document until the popover is
|
34 | * closed. This prop is only available when `interactionKind` is
|
35 | * `PopoverInteractionKind.CLICK`. When popovers with backdrop are opened,
|
36 | * they become focused.
|
37 | *
|
38 | * @default false
|
39 | */
|
40 | hasBackdrop?: boolean;
|
41 | /**
|
42 | * Ref supplied to the `Classes.POPOVER` element.
|
43 | */
|
44 | popoverRef?: IRef<HTMLElement>;
|
45 | /**
|
46 | * The target to which the popover content is attached. This can instead be
|
47 | * provided as the _first_ element in `children`.
|
48 | */
|
49 | target?: string | JSX.Element;
|
50 | }
|
51 | export interface IPopoverState {
|
52 | transformOrigin: string;
|
53 | isOpen: boolean;
|
54 | hasDarkParent: boolean;
|
55 | }
|
56 | /** @deprecated use { Popover2 } from "@blueprintjs/popover2" */
|
57 | export declare class Popover extends AbstractPureComponent2<IPopoverProps, IPopoverState> {
|
58 | static displayName: string;
|
59 | private popoverRef;
|
60 | static defaultProps: IPopoverProps;
|
61 | /**
|
62 | * DOM element that contains the popover.
|
63 | * When `usePortal={true}`, this element will be portaled outside the usual DOM flow,
|
64 | * so this reference can be very useful for testing.
|
65 | */
|
66 | popoverElement: HTMLElement | null;
|
67 | /** DOM element that contains the target. */
|
68 | targetElement: HTMLElement | null;
|
69 | state: IPopoverState;
|
70 | private cancelOpenTimeout?;
|
71 | private isMouseInTargetOrPopover;
|
72 | private lostFocusOnSamePage;
|
73 | private popperScheduleUpdate?;
|
74 | private handlePopoverRef;
|
75 | private handleTargetRef;
|
76 | render(): JSX.Element;
|
77 | componentDidMount(): void;
|
78 | componentDidUpdate(prevProps: IPopoverProps, prevState: IPopoverState): void;
|
79 | /**
|
80 | * Instance method to instruct the `Popover` to recompute its position.
|
81 | *
|
82 | * This method should only be used if you are updating the target in a way
|
83 | * that does not cause it to re-render, such as changing its _position_
|
84 | * without changing its _size_ (since `Popover` already repositions when it
|
85 | * detects a resize).
|
86 | */
|
87 | reposition: () => void | undefined;
|
88 | protected validateProps(props: IPopoverProps & {
|
89 | children?: React.ReactNode;
|
90 | }): void;
|
91 | private updateDarkParent;
|
92 | private renderPopover;
|
93 | private renderTarget;
|
94 | private understandChildren;
|
95 | private isControlled;
|
96 | private getIsOpen;
|
97 | private getPopperModifiers;
|
98 | private handleTargetFocus;
|
99 | private handleTargetBlur;
|
100 | private handleMouseEnter;
|
101 | private handleMouseLeave;
|
102 | private handlePopoverClick;
|
103 | private handleOverlayClose;
|
104 | private handleTargetClick;
|
105 | private setOpenState;
|
106 | private isArrowEnabled;
|
107 | private isElementInPopover;
|
108 | private isHoverInteractionKind;
|
109 | /** Popper modifier that updates React state (for style properties) based on latest data. */
|
110 | private updatePopoverState;
|
111 | }
|