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 | * 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 | * Direction of the text.
|
39 | * @default 'ltr'
|
40 | */
|
41 | direction?: 'ltr' | 'rtl';
|
42 | /**
|
43 | * The `children` will be under the DOM hierarchy of the parent component.
|
44 | * @default false
|
45 | */
|
46 | disablePortal?: PortalProps['disablePortal'];
|
47 | /**
|
48 | * Always keep the children in the DOM.
|
49 | * This prop can be useful in SEO situation or
|
50 | * when you want to maximize the responsiveness of the Popper.
|
51 | * @default false
|
52 | */
|
53 | keepMounted?: boolean;
|
54 | /**
|
55 | * Popper.js is based on a "plugin-like" architecture,
|
56 | * most of its features are fully encapsulated "modifiers".
|
57 | *
|
58 | * A modifier is a function that is called each time Popper.js needs to
|
59 | * compute the position of the popper.
|
60 | * For this reason, modifiers should be very performant to avoid bottlenecks.
|
61 | * To learn how to create a modifier, [read the modifiers documentation](https:
|
62 | */
|
63 | modifiers?: Options['modifiers'];
|
64 | |
65 |
|
66 |
|
67 | open: boolean;
|
68 | |
69 |
|
70 |
|
71 |
|
72 | placement?: PopperPlacementType;
|
73 | |
74 |
|
75 |
|
76 |
|
77 | popperOptions?: Partial<OptionsGeneric<any>>;
|
78 | |
79 |
|
80 |
|
81 | popperRef?: React.Ref<Instance>;
|
82 | |
83 |
|
84 |
|
85 |
|
86 | slotProps?: {
|
87 | root?: SlotComponentProps<'div', PopperRootSlotPropsOverrides, PopperOwnerState>;
|
88 | };
|
89 | |
90 |
|
91 |
|
92 |
|
93 |
|
94 | slots?: PopperSlots;
|
95 | |
96 |
|
97 |
|
98 |
|
99 | transition?: boolean;
|
100 | }
|
101 | export interface PopperSlots {
|
102 | |
103 |
|
104 |
|
105 |
|
106 | root?: React.ElementType;
|
107 | }
|
108 | export type PopperOwnerState = PopperOwnProps;
|
109 | export interface PopperTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
|
110 | props: PopperOwnProps & AdditionalProps;
|
111 | defaultComponent: RootComponentType;
|
112 | }
|
113 | export type PopperProps<RootComponentType extends React.ElementType = PopperTypeMap['defaultComponent']> = PolymorphicProps<PopperTypeMap<{}, RootComponentType>, RootComponentType>;
|
114 | export type PopperTooltipOwnProps = Omit<PopperOwnProps, 'container' | 'keepMounted' | 'transition'> & {
|
115 | TransitionProps?: PopperTransitionProps;
|
116 | };
|
117 | export interface PopperTooltipTypeMap<AdditionalProps = {}, RootComponentType extends React.ElementType = 'div'> {
|
118 | props: PopperTooltipOwnProps & AdditionalProps;
|
119 | defaultComponent: RootComponentType;
|
120 | }
|
121 | export type PopperTooltipProps<RootComponentType extends React.ElementType = PopperTooltipTypeMap['defaultComponent']> = PolymorphicProps<PopperTooltipTypeMap<{}, RootComponentType>, RootComponentType>;
|
122 | export interface PopperRootSlotProps {
|
123 | className?: string;
|
124 | ref: React.Ref<any>;
|
125 | ownerState: PopperOwnerState;
|
126 | }
|
127 |
|
\ | No newline at end of file |