-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathtoast-model.d.ts
342 lines (297 loc) · 9.45 KB
/
toast-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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
import { Component, Property, ChildProperty, INotifyPropertyChanged, NotifyPropertyChanges, Animation, createElement, animationMode, initializeCSPTemplate } from '@syncfusion/ej2-base';import { Browser, isNullOrUndefined as isNOU, getUniqueID, formatUnit, EventHandler, KeyboardEventArgs } from '@syncfusion/ej2-base';import { EmitType, Collection, Complex, setStyleAttribute, Event, Effect, detach, AnimationModel, L10n } from '@syncfusion/ej2-base';import { attributes, extend, closest, compile as templateCompiler, classList, BaseEventArgs, isUndefined } from '@syncfusion/ej2-base';import { SwipeEventArgs, Touch, isBlazor, SanitizeHtmlHelper, removeClass } from '@syncfusion/ej2-base';import { ButtonModel, Button } from '@syncfusion/ej2-buttons';import { getZindexPartial } from '@syncfusion/ej2-popups';
import {PositionX,PositionY,ProgressDirectionType,BeforeSanitizeHtmlArgs,ToastOpenArgs,ToastBeforeOpenArgs,ToastBeforeCloseArgs,ToastCloseArgs,ToastClickEventArgs} from "./toast";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class ToastPosition
*/
export interface ToastPositionModel {
/**
* Specifies the position of the Toast notification with respect to the target container's left edge.
*
* @default 'Left'
* @aspType string
* @blazorType string
*/
X?: PositionX | number | string;
/**
* Specifies the position of the Toast notification with respect to the target container's top edge.
*
* @default 'Top'
* @aspType string
* @blazorType string
*/
Y?: PositionY | number | string;
}
/**
* Interface for a class ButtonModelProps
*/
export interface ButtonModelPropsModel {
/**
* Specifies the Button component model properties to render the Toast action buttons.
* ```html
* <div id="element"> </div>
* ```
* ```typescript
* let toast: Toast = new Toast({
* buttons:
* [{
* model: { content:`Button1`, cssClass: `e-success` }
* }]
* });
* toast.appendTo('#element');
* ```
*
* @default null
*/
model?: ButtonModel;
/**
* Specifies the click event binding of action buttons created within Toast.
*
* @event 'event'
* @blazorProperty 'Clicked'
* @blazorType Microsoft.AspNetCore.Components.Web.MouseEventArgs
*/
click?: EmitType<Event>;
}
/**
* Interface for a class ToastAnimations
*/
export interface ToastAnimationsModel {
/**
* Specifies the type of animation.
*
* @default 'FadeIn'
* @aspType string
*/
effect?: Effect;
/**
* Specifies the duration to animate.
*
* @default 600
*/
duration?: number;
/**
* Specifies the animation timing function.
*
* @default 'ease'
*/
easing?: string;
}
/**
* Interface for a class ToastAnimationSettings
*/
export interface ToastAnimationSettingsModel {
/**
* Specifies the animation to appear while showing the Toast.
*
* @default { effect: 'FadeIn', duration: 600, easing: 'ease' }
*/
show?: ToastAnimationsModel;
/**
* Specifies the animation to appear while hiding the Toast.
*
* @default { effect: 'FadeOut', duration: 600, easing: 'ease' }
*/
hide?: ToastAnimationsModel;
}
/**
* Interface for a class Toast
*/
export interface ToastModel extends ComponentModel{
/**
* Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels.
* In mobile devices, default width is considered as `100%`.
*
* @default '300'
* @blazorType string
*/
width?: string | number;
/**
* Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.
*
* @default 'auto'
* @blazorType string
*/
height?: string | number;
/**
* Specifies the title to be displayed on the Toast.
* Accepts selectors, string values and HTML elements.
*
* @default null
* @aspType string
*/
title?: string | Function;
/**
* Specifies the content to be displayed on the Toast.
* Accepts selectors, string values and HTML elements.
*
* @default null
* @blazorType string
* @aspType string
*/
content?: string | HTMLElement | Function;
/**
* Defines whether to allow the cross-scripting site or not.
*
* @default true
*/
enableHtmlSanitizer?: boolean;
/**
* Defines CSS classes to specify an icon for the Toast which is to be displayed at top left corner of the Toast.
*
* @default null
*/
icon?: string;
/**
* Defines single/multiple classes (separated by space) to be used for customization of Toast.
*
* @default null
*/
cssClass?: string;
/**
* Specifies the HTML element/element ID as a string that can be displayed as a Toast.
* The given template is taken as preference to render the Toast, even if the built-in properties such as title and content are defined.
*
* {% codeBlock src='toast/template/index.md' %}{% endcodeBlock %}
*
* @default null
* @aspType string
*/
template?: string | Function;
/**
* Specifies the newly created Toast message display order while multiple toast's are added to page one after another.
* By default, newly added Toast will be added after old Toast's.
*
* @default true
*/
newestOnTop?: boolean;
/**
* Specifies whether to show the close button in Toast message to close the Toast.
*
* @default false
*/
showCloseButton?: boolean;
/**
* Specifies whether to show the progress bar to denote the Toast message display timeout.
*
* @default false
*/
showProgressBar?: boolean;
/**
* Specifies the Toast display time duration on the page in milliseconds.
* - Once the time expires, Toast message will be removed.
* - Setting 0 as a time out value displays the Toast on the page until the user closes it manually.
*
* @default 5000
*/
timeOut?: number;
/**
* Specifies whether to show the progress bar with left to right direction to denote the Toast message display timeout.
*/
progressDirection?: ProgressDirectionType;
/**
* Specifies the Toast display time duration after interacting with the Toast.
*
* @default 1000
*/
extendedTimeout?: number;
/**
* Specifies the animation configuration settings for showing and hiding the Toast.
*
* {% codeBlock src='toast/animation/index.md' %}{% endcodeBlock %}
*
* @blazorType ToastAnimationSettings
* @default { show: { effect: 'FadeIn', duration: 600, easing: 'linear' },
* hide: { effect: 'FadeOut', duration: 600, easing: 'linear' }}
*/
animation?: ToastAnimationSettingsModel;
/**
* Specifies the position of the Toast message to be displayed within target container.
* In the case of multiple Toast display, new Toast position will not update on dynamic change of property values
* until the old Toast messages removed.
* X values are: Left , Right ,Center
* Y values are: Top , Bottom
*
* {% codeBlock src='toast/position/index.md' %}{% endcodeBlock %}
*
* @default { X: "Left", Y: "Top" }
* @blazorType ToastPosition
*/
position?: ToastPositionModel;
/**
* Specifies the collection of Toast action `buttons` to be rendered with the given
* Button model properties and its click action handler.
*
* {% codeBlock src='toast/buttons/index.md' %}{% endcodeBlock %}
*
* @default [{}]
* @deprecated
*/
buttons?: ButtonModelPropsModel[];
/**
* Specifies the target container where the Toast to be displayed.
* Based on the target, the positions such as `Left`, `Top` will be applied to the Toast.
* The default value is null, which refers the `document.body` element.
*
* @default null
* @aspType string
* @blazorType string
*/
target?: HTMLElement | Element | string;
/**
* Triggers the event after the Toast gets created.
*
* @event 'event'
* @blazorProperty 'Created'
*/
created?: EmitType<Event>;
/**
* Event triggers before sanitize the value.
*
* @event 'event'
* @blazorProperty 'OnSanitizeHtml'
*/
beforeSanitizeHtml?: EmitType<BeforeSanitizeHtmlArgs>;
/**
* Triggers the event after the Toast gets destroyed.
*
* @event 'event'
* @blazorProperty 'Destroyed'
*/
destroyed?: EmitType<Event>;
/**
* Triggers the event after the Toast shown on the target container.
*
* @event 'event'
* @blazorProperty 'Opened'
*/
open?: EmitType<ToastOpenArgs>;
/**
* Triggers the event before the toast shown.
*
* @event 'event'
* @blazorProperty 'OnOpen'
*/
beforeOpen?: EmitType<ToastBeforeOpenArgs>;
/**
* Triggers the event before the toast close.
*
* @event 'event'
* @blazorProperty 'OnClose'
*/
beforeClose?: EmitType<ToastBeforeCloseArgs>;
/**
* Trigger the event after the Toast hides.
*
* @event 'event'
* @blazorProperty 'Closed'
*/
close?: EmitType<ToastCloseArgs>;
/**
* The event will be fired while clicking on the Toast.
*
* @event 'event'
* @blazorProperty 'OnClick'
*/
click?: EmitType<ToastClickEventArgs>;
}