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