1 | import * as React from 'react';
|
2 | import { Instance, Options, OptionsGeneric, VirtualElement } from '@popperjs/core';
|
3 | import { PortalProps } from '../Portal';
|
4 | import { PolymorphicProps, SlotComponentProps } from '../utils';
|
5 | export type PopperPlacementType = Options['placement'];
|
6 | export interface PopperRootSlotPropsOverrides {
|
7 | }
|
8 | export interface PopperTransitionProps {
|
9 | in: boolean;
|
10 | onEnter: () => void;
|
11 | onExited: () => void;
|
12 | }
|
13 | export interface PopperChildrenProps {
|
14 | placement: PopperPlacementType;
|
15 | TransitionProps?: PopperTransitionProps;
|
16 | }
|
17 | export interface PopperOwnProps {
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | anchorEl?: null | VirtualElement | HTMLElement | (() => HTMLElement) | (() => VirtualElement);
|
25 | /**
|
26 | * Popper render function or node.
|
27 | */
|
28 | children?: React.ReactNode | ((props: PopperChildrenProps) => 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 | * You can also provide a callback, which is called in a React layout effect.
|
34 | * This lets you set the container from a ref, and also makes server-side rendering possible.
|
35 | *
|
36 | * By default, it uses the body of the top-level document object,
|
37 | * so it's simply `document.body` most of the time.
|
38 | */
|
39 | container?: PortalProps['container'];
|
40 | /**
|
41 | * Direction of the text.
|
42 | * @default 'ltr'
|
43 | */
|
44 | direction?: 'ltr' | 'rtl';
|
45 | /**
|
46 | * The `children` will be under the DOM hierarchy of the parent component.
|
47 | * @default false
|
48 | */
|
49 | disablePortal?: PortalProps['disablePortal'];
|
50 | /**
|
51 | * Always keep the children in the DOM.
|
52 | * This prop can be useful in SEO situation or
|
53 | * when you want to maximize the responsiveness of the Popper.
|
54 | * @default false
|
55 | */
|
56 | keepMounted?: boolean;
|
57 | /**
|
58 | * Popper.js is based on a "plugin-like" architecture,
|
59 | * most of its features are fully encapsulated "modifiers".
|
60 | *
|
61 | * A modifier is a function that is called each time Popper.js needs to
|
62 | * compute the position of the popper.
|
63 | * For this reason, modifiers should be very performant to avoid bottlenecks.
|
64 | * To learn how to create a modifier, [read the modifiers documentation](https:
|
65 | */
|
66 | modifiers?: Options['modifiers'];
|
67 | |
68 |
|
69 |
|
70 | open: boolean;
|
71 | |
72 |
|
73 |
|
74 |
|
75 | placement?: PopperPlacementType;
|
76 | |
77 |
|
78 |
|
79 |
|
80 | popperOptions?: Partial<OptionsGeneric<any>>;
|
81 | |
82 |
|
83 |
|
84 | popperRef?: React.Ref<Instance>;
|
85 | |
86 |
|
87 |
|
88 |
|
89 | slotProps?: {
|
90 | root?: SlotComponentProps<'div', PopperRootSlotPropsOverrides, PopperOwnerState>;
|
91 | };
|
92 | |
93 |
|
94 |
|
95 |
|
96 |
|
97 | slots?: PopperSlots;
|
98 | |
99 |
|
100 |
|
101 |
|
102 | transition?: boolean;
|
103 | }
|
104 | export interface PopperSlots {
|
105 | |
106 |
|
107 |
|
108 |
|
109 | root?: React.ElementType;
|
110 | }
|
111 | export type PopperOwnerState = PopperOwnProps;
|
112 | export interface PopperTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
|
113 | props: PopperOwnProps & AdditionalProps;
|
114 | defaultComponent: RootComponentType;
|
115 | }
|
116 | export type PopperProps<RootComponentType extends React.ElementType = PopperTypeMap['defaultComponent']> = PolymorphicProps<PopperTypeMap<{}, RootComponentType>, RootComponentType>;
|
117 | export type PopperTooltipOwnProps = Omit<PopperOwnProps, 'container' | 'keepMounted' | 'transition'> & {
|
118 | TransitionProps?: PopperTransitionProps;
|
119 | };
|
120 | export interface PopperTooltipTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
|
121 | props: PopperTooltipOwnProps & AdditionalProps;
|
122 | defaultComponent: RootComponentType;
|
123 | }
|
124 | export type PopperTooltipProps<RootComponentType extends React.ElementType = PopperTooltipTypeMap['defaultComponent']> = PolymorphicProps<PopperTooltipTypeMap<{}, RootComponentType>, RootComponentType>;
|
125 | export interface PopperRootSlotProps {
|
126 | className?: string;
|
127 | ref: React.Ref<any>;
|
128 | ownerState: PopperOwnerState;
|
129 | }
|
130 |
|
\ | No newline at end of file |