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