-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathtooltip-model.d.ts
302 lines (267 loc) · 11.1 KB
/
tooltip-model.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
import { Component, Property, ChildProperty, Event, BaseEventArgs, append, compile } from '@syncfusion/ej2-base';import { EventHandler, EmitType, Touch, TapEventArgs, Browser, Animation as PopupAnimation, animationMode } from '@syncfusion/ej2-base';import { isNullOrUndefined, getUniqueID, formatUnit, select, selectAll } from '@syncfusion/ej2-base';import { attributes, closest, removeClass, addClass, remove } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, Complex, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Popup } from '../popup/popup';import { OffsetPosition, calculatePosition } from '../common/position';import { isCollide, fit, destroy as collisionDestroy } from '../common/collision';
import {TooltipAnimationSettings,Position,TipPointerPosition,TooltipEventArgs} from "./tooltip";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class Animation
*/
export interface AnimationModel {
/**
* Animation settings to be applied on the Tooltip, while it is being shown over the target.
*/
open?: TooltipAnimationSettings;
/**
* Animation settings to be applied on the Tooltip, when it is closed.
*/
close?: TooltipAnimationSettings;
}
/**
* Interface for a class Tooltip
*/
export interface TooltipModel extends ComponentModel{
/**
* It is used to set the width of Tooltip component which accepts both string and number values.
* When set to auto, the Tooltip width gets auto adjusted to display its content within the viewable screen.
*
* @default 'auto'
*/
width?: string | number;
/**
* It is used to set the height of Tooltip component which accepts both string and number values.
* When Tooltip content gets overflow due to height value then the scroll mode will be enabled.
* Refer the documentation [here](https://ej2.syncfusion.com/documentation/tooltip/setting-dimension/)
* to know more about this property with demo.
*
* @default 'auto'
*/
height?: string | number;
/**
* It is used to display the content of Tooltip which can be both string and HTML Elements.
* Refer the documentation [here](https://ej2.syncfusion.com/documentation/tooltip/content/)
* to know more about this property with demo.
*
* {% codeBlock src="tooltip/content-api/index.ts" %}{% endcodeBlock %}
*
* @aspType string
*/
content?: string | HTMLElement | Function;
/**
* It is used to set the container element in which the Tooltip’s pop-up will be appended. It accepts value as both string and HTML Element.
* It's default value is `body`, in which the Tooltip’s pop-up will be appended.
*
*/
container?: string | HTMLElement;
/**
* It is used to denote the target selector where the Tooltip need to be displayed.
* The target element is considered as parent container.
*
* {% codeBlock src="tooltip/target-api/index.ts" %}{% endcodeBlock %}
*/
target?: string;
/**
* It is used to set the position of Tooltip element, with respect to Target element.
*
* {% codeBlock src="tooltip/position-api/index.ts" %}{% endcodeBlock %}
*
*/
position?: Position;
/**
* It sets the space between the target and Tooltip element in X axis.
*
* {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/offsetx/index.md" %}{% endcodeBlock %}
*
* @default 0
*/
offsetX?: number;
/**
* It sets the space between the target and Tooltip element in Y axis.
*
* {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/offsety/index.md" %}{% endcodeBlock %}
*
* @default 0
*/
offsetY?: number;
/**
* It is used to show or hide the tip pointer of Tooltip.
*
* {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/showtippointer/index.md" %}{% endcodeBlock %}
*
* @default true
*/
showTipPointer?: boolean;
/**
* It enables or disables the parsing of HTML string content into HTML DOM elements for Tooltip.
* If the value of the property is set to false, the tooltip content will be displayed as HTML string instead of HTML DOM elements.
*
* @default true
*/
enableHtmlParse?: boolean;
/**
* It is used to set the collision target element as page viewport (window) or Tooltip element, when using the target.
* If this property is enabled, tooltip will perform the collision calculation between the target elements
* and viewport(window) instead of Tooltip element.
*
* @default false
*/
windowCollision?: boolean;
/**
* It is used to set the position of tip pointer on tooltip.
* When it sets to auto, the tip pointer auto adjusts within the space of target's length
* and does not point outside.
* Refer the documentation
* [here](https://ej2.syncfusion.com/documentation/tooltip/position.html?lang=typescript#tip-pointer-positioning)
* to know more about this property with demo.
*
* {% codeBlock src="tooltip/tippointerposition/index.md" %}{% endcodeBlock %}
*
* @default 'Auto'
*/
tipPointerPosition?: TipPointerPosition;
/**
* It is used to determine the device mode to display the Tooltip content.
* If it is in desktop, it will show the Tooltip content when hovering on the target element.
* If it is in touch device, it will show the Tooltip content when tap and holding on the target element.
*
* {% codeBlock src="tooltip/openson/index.md" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/opensOn-api/index.ts" %}{% endcodeBlock %}
*
* @default 'Auto'
*/
opensOn?: string;
/**
* It allows the Tooltip to follow the mouse pointer movement over the specified target element.
* Refer the documentation [here](https://ej2.syncfusion.com/documentation/tooltip/position/#mouse-trailing)
* to know more about this property with demo.
*
* {% codeBlock src="tooltip/mousetrail/index.md" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/offsetX-api/index.ts" %}{% endcodeBlock %}
*
* @default false
*/
mouseTrail?: boolean;
/**
* It is used to display the Tooltip in an open state until closed by manually.
* Refer the documentation [here](https://ej2.syncfusion.com/documentation/tooltip/open-mode/#sticky-mode)
* to know more about this property with demo.
*
* {% codeBlock src="tooltip/issticky/index.md" %}{% endcodeBlock %}
*
* @default false
*/
isSticky?: boolean;
/**
* We can set the same or different animation option to Tooltip while it is in open or close state.
* Refer the documentation [here](https://ej2.syncfusion.com/documentation/tooltip/animation/)
* to know more about this property with demo.
*
* {% codeBlock src="tooltip/animation/index.md" %}{% endcodeBlock %}
* {% codeBlock src="tooltip/animation-api/index.ts" %}{% endcodeBlock %}
*
* @default { open: { effect: 'FadeIn', duration: 150, delay: 0 }, close: { effect: 'FadeOut', duration: 150, delay: 0 } }
*/
animation?: AnimationModel;
/**
* It is used to open the Tooltip after the specified delay in milliseconds.
*
* @default 0
*/
openDelay?: number;
/**
* It is used to close the Tooltip after a specified delay in milliseconds.
*
* @default 0
*/
closeDelay?: number;
/**
* It is used to customize the Tooltip which accepts custom CSS class names that
* defines specific user-defined styles and themes to be applied on the Tooltip element.
*
* @default null
*/
cssClass?: string;
/**
* Specifies whether to display or remove the untrusted HTML values in the Tooltip component.
* If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
*
* @default true
*/
enableHtmlSanitizer?: boolean;
/**
* Allows additional HTML attributes such as tabindex, title, name, etc. to root element of the Tooltip popup, and
* accepts n number of attributes in a key-value pair format.
*
* {% codeBlock src='tooltip/htmlAttributes/index.md' %}{% endcodeBlock %}
*
* @default {}
*/
htmlAttributes?: { [key: string]: string };
/**
* We can trigger `beforeRender` event before the Tooltip and its contents are added to the DOM.
* When one of its arguments `cancel` is set to true, the Tooltip can be prevented from rendering on the page.
* This event is mainly used for the purpose of customizing the Tooltip before it shows up on the screen.
* For example, to load the AJAX content or to set new animation effects on the Tooltip, this event can be opted.
* Refer the documentation
* [here](https://ej2.syncfusion.com/documentation/tooltip/content/#dynamic-content-via-ajax)
* to know more about this property with demo.
*
* @event beforeRender
*/
beforeRender?: EmitType<TooltipEventArgs>;
/**
* We can trigger `beforeOpen` event before the Tooltip is displayed over the target element.
* When one of its arguments `cancel` is set to true, the Tooltip display can be prevented.
* This event is mainly used for the purpose of refreshing the Tooltip positions dynamically or to
* set customized styles in it and so on.
*
* {% codeBlock src="tooltip/beforeOpen/index.md" %}{% endcodeBlock %}
*
* @event beforeOpen
*/
beforeOpen?: EmitType<TooltipEventArgs>;
/**
* We can trigger `afterOpen` event after the Tooltip Component gets opened.
*
* {% codeBlock src="tooltip/afterOpen/index.md" %}{% endcodeBlock %}
*
* @event afterOpen
*/
afterOpen?: EmitType<TooltipEventArgs>;
/**
* We can trigger `beforeClose` event before the Tooltip hides from the screen. If returned false, then the Tooltip is no more hidden.
*
* {% codeBlock src="tooltip/beforeClose/index.md" %}{% endcodeBlock %}
*
* @event beforeClose
*/
beforeClose?: EmitType<TooltipEventArgs>;
/**
* We can trigger `afterClose` event when the Tooltip Component gets closed.
*
* {% codeBlock src="tooltip/afterClose/index.md" %}{% endcodeBlock %}
*
* @event afterClose
*/
afterClose?: EmitType<TooltipEventArgs>;
/**
* We can trigger `beforeCollision` event for every collision fit calculation.
*
* {% codeBlock src="tooltip/beforeCollision/index.md" %}{% endcodeBlock %}
*
* @event beforeCollision
*/
beforeCollision?: EmitType<TooltipEventArgs>;
/**
* We can trigger `created` event after the Tooltip component is created.
*
* @event created
*/
created?: EmitType<Object>;
/**
* We can trigger `destroyed` event when the Tooltip component is destroyed.
*
* @event destroyed
*/
destroyed?: EmitType<Object>;
}