1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 | import { PopupProps } from '../overlay';
|
6 |
|
7 | export interface TooltipProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
8 | |
9 |
|
10 |
|
11 | prefix?: string;
|
12 |
|
13 | |
14 |
|
15 |
|
16 | className?: string;
|
17 |
|
18 | |
19 |
|
20 |
|
21 | style?: React.CSSProperties;
|
22 |
|
23 | |
24 |
|
25 |
|
26 | children?: any;
|
27 |
|
28 | |
29 |
|
30 |
|
31 | align?: 't' | 'r' | 'b' | 'l' | 'tl' | 'tr' | 'bl' | 'br' | 'lt' | 'lb' | 'rt' | 'rb';
|
32 |
|
33 | |
34 |
|
35 |
|
36 | trigger?: any;
|
37 |
|
38 | |
39 |
|
40 |
|
41 |
|
42 | triggerType?: string | Array<string>;
|
43 |
|
44 | |
45 |
|
46 |
|
47 | popupStyle?: React.CSSProperties;
|
48 |
|
49 | |
50 |
|
51 |
|
52 | popupClassName?: string;
|
53 |
|
54 | |
55 |
|
56 |
|
57 | popupProps?: PopupProps;
|
58 |
|
59 | |
60 |
|
61 |
|
62 | delay?: number;
|
63 |
|
64 | |
65 |
|
66 |
|
67 | pure?: boolean;
|
68 |
|
69 | |
70 |
|
71 |
|
72 | popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
|
73 |
|
74 | /**
|
75 | * 弹层id, 传入值才会支持无障碍
|
76 | */
|
77 | id?: string;
|
78 | followTrigger?: boolean;
|
79 | /**
|
80 | * 开启 v2
|
81 | */
|
82 | v2?: boolean;
|
83 | /**
|
84 | * [v2] 箭头是否指向目标元素的中心
|
85 | */
|
86 | arrowPointToCenter?: boolean;
|
87 | }
|
88 |
|
89 | export class Tooltip extends React.Component<TooltipProps, any> {}
|
90 |
|
91 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
92 | title?: any;
|
93 | }
|
94 | export interface BalloonProps extends HTMLAttributesWeak, CommonProps {
|
95 | /**
|
96 | * 自定义类名
|
97 | */
|
98 | className?: string;
|
99 |
|
100 | /**
|
101 | * 自定义内敛样式
|
102 | */
|
103 | style?: React.CSSProperties;
|
104 |
|
105 | /**
|
106 | * 浮层的内容
|
107 | */
|
108 | children?: any;
|
109 |
|
110 | title?: React.ReactNode;
|
111 |
|
112 | /**
|
113 | * 样式类型
|
114 | */
|
115 | type?: 'normal' | 'primary';
|
116 |
|
117 | /**
|
118 | * 弹层当前显示的状态
|
119 | */
|
120 | visible?: boolean;
|
121 |
|
122 | /**
|
123 | * 弹层默认显示的状态
|
124 | */
|
125 | defaultVisible?: boolean;
|
126 |
|
127 | /**
|
128 | * 弹层在显示和隐藏触发的事件
|
129 | */
|
130 | onVisibleChange?: (visible: boolean,type: string) => void;
|
131 |
|
132 | |
133 |
|
134 |
|
135 | alignEdge?: boolean;
|
136 |
|
137 | |
138 |
|
139 |
|
140 | closable?: boolean;
|
141 |
|
142 | |
143 |
|
144 |
|
145 | align?: 't' | 'r' | 'b' | 'l' | 'tl' | 'tr' | 'bl' | 'br' | 'lt' | 'lb' | 'rt' | 'rb';
|
146 |
|
147 | |
148 |
|
149 |
|
150 | offset?: Array<number>;
|
151 |
|
152 | |
153 |
|
154 |
|
155 | trigger?: any;
|
156 |
|
157 | |
158 |
|
159 |
|
160 |
|
161 | triggerType?: string | Array<string>;
|
162 |
|
163 | |
164 |
|
165 |
|
166 | onClose?: () => void;
|
167 |
|
168 | |
169 |
|
170 |
|
171 | needAdjust?: boolean;
|
172 |
|
173 | |
174 |
|
175 |
|
176 | delay?: number;
|
177 |
|
178 | |
179 |
|
180 |
|
181 | afterClose?: () => void;
|
182 |
|
183 | |
184 |
|
185 |
|
186 | shouldUpdatePosition?: boolean;
|
187 |
|
188 | |
189 |
|
190 |
|
191 | autoFocus?: boolean;
|
192 |
|
193 | |
194 |
|
195 |
|
196 | safeNode?: any;
|
197 |
|
198 | |
199 |
|
200 |
|
201 | safeId?: string;
|
202 |
|
203 | |
204 |
|
205 |
|
206 | animation?: any | boolean;
|
207 |
|
208 | |
209 |
|
210 |
|
211 | cache?: boolean;
|
212 |
|
213 | |
214 |
|
215 |
|
216 | popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);
|
217 |
|
218 | /**
|
219 | * 弹层组件style,透传给Popup
|
220 | */
|
221 | popupStyle?: React.CSSProperties;
|
222 |
|
223 | /**
|
224 | * 弹层组件className,透传给Popup
|
225 | */
|
226 | popupClassName?: string;
|
227 |
|
228 | /**
|
229 | * 弹层组件属性,透传给Popup
|
230 | */
|
231 | popupProps?: PopupProps;
|
232 |
|
233 | /**
|
234 | * 弹层id, 传入值才会支持无障碍
|
235 | */
|
236 | id?: string;
|
237 | followTrigger?: boolean;
|
238 | /**
|
239 | * 开启 v2
|
240 | */
|
241 | v2?: boolean;
|
242 | /**
|
243 | * [v2] 箭头是否指向目标元素的中心
|
244 | */
|
245 | arrowPointToCenter?: boolean;
|
246 | /**
|
247 | * [v2] 是否进行自动位置调整,默认自动开启
|
248 | */
|
249 | autoAdjust?: boolean;
|
250 | }
|
251 |
|
252 | export default class Balloon extends React.Component<BalloonProps, any> {
|
253 | static Tooltip: typeof Tooltip;
|
254 | }
|
255 |
|
\ | No newline at end of file |