1 | import * as React from 'react';
|
2 | import { Instance, VirtualElement, Options, OptionsGeneric } from '@popperjs/core';
|
3 | import { PortalProps } from '../Portal';
|
4 |
|
5 | export type PopperPlacementType = Options['placement'];
|
6 |
|
7 | export interface PopperProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
8 | ref?: React.Ref<HTMLDivElement>;
|
9 | |
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | anchorEl?: null | VirtualElement | (() => VirtualElement);
|
16 | /**
|
17 | * Popper render function or node.
|
18 | */
|
19 | children?:
|
20 | | React.ReactNode
|
21 | | ((props: {
|
22 | placement: PopperPlacementType;
|
23 | TransitionProps?: {
|
24 | in: boolean;
|
25 | onEnter: () => {};
|
26 | onExited: () => {};
|
27 | };
|
28 | }) => React.ReactNode);
|
29 | /**
|
30 | * An HTML element or function that returns one.
|
31 | * The `container` will have the portal children appended to it.
|
32 | *
|
33 | * By default, it uses the body of the top-level document object,
|
34 | * so it's simply `document.body` most of the time.
|
35 | */
|
36 | container?: PortalProps['container'];
|
37 | /**
|
38 | * The `children` will be under the DOM hierarchy of the parent component.
|
39 | * @default false
|
40 | */
|
41 | disablePortal?: PortalProps['disablePortal'];
|
42 | /**
|
43 | * Always keep the children in the DOM.
|
44 | * This prop can be useful in SEO situation or
|
45 | * when you want to maximize the responsiveness of the Popper.
|
46 | * @default false
|
47 | */
|
48 | keepMounted?: boolean;
|
49 | /**
|
50 | * Popper.js is based on a "plugin-like" architecture,
|
51 | * most of its features are fully encapsulated "modifiers".
|
52 | *
|
53 | * A modifier is a function that is called each time Popper.js needs to
|
54 | * compute the position of the popper.
|
55 | * For this reason, modifiers should be very performant to avoid bottlenecks.
|
56 | * To learn how to create a modifier, [read the modifiers documentation](https:
|
57 | */
|
58 | modifiers?: Options['modifiers'];
|
59 | |
60 |
|
61 |
|
62 | open: boolean;
|
63 | |
64 |
|
65 |
|
66 |
|
67 | placement?: PopperPlacementType;
|
68 | |
69 |
|
70 |
|
71 |
|
72 | popperOptions?: Partial<OptionsGeneric<any>>;
|
73 | |
74 |
|
75 |
|
76 | popperRef?: React.Ref<Instance>;
|
77 | |
78 |
|
79 |
|
80 |
|
81 | transition?: boolean;
|
82 | }
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | export default function Popper(props: PopperProps): JSX.Element;
|
98 |
|
\ | No newline at end of file |