-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathaccordion-model.d.ts
285 lines (249 loc) · 8.14 KB
/
accordion-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
import { Component, EventHandler, Property, Event, EmitType, AnimationModel, KeyboardEvents, rippleEffect, animationMode } from '@syncfusion/ej2-base';import { KeyboardEventArgs, BaseEventArgs, Effect, getUniqueID, compile as templateCompiler } from '@syncfusion/ej2-base';import { isVisible, closest, attributes, detach, select, addClass, removeClass, append } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, Collection, Animation } from '@syncfusion/ej2-base';import { setStyleAttribute as setStyle, Complex } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, formatUnit, selectAll, SanitizeHtmlHelper, isRippleEnabled } from '@syncfusion/ej2-base';
import {ExpandMode,AccordionClickArgs,ExpandEventArgs,ExpandedEventArgs} from "./accordion";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class AccordionActionSettings
*/
export interface AccordionActionSettingsModel {
/**
* Specifies the type of animation.
*
* @default 'SlideDown'
* @aspType string
*/
effect?: 'None' | Effect;
/**
* Specifies the duration to animate.
*
* @default 400
*/
duration?: number;
/**
* Specifies the animation timing function.
*
* @default 'linear'
*/
easing?: string;
}
/**
* Interface for a class AccordionAnimationSettings
*/
export interface AccordionAnimationSettingsModel {
/**
* Specifies the animation to appear while collapsing the Accordion item.
*
* @default { effect: 'SlideDown', duration: 400, easing: 'linear' }
*/
collapse?: AccordionActionSettingsModel;
/**
* Specifies the animation to appear while expanding the Accordion item.
*
* @default { effect: 'SlideDown', duration: 400, easing: 'linear' }
*/
expand?: AccordionActionSettingsModel;
}
/**
* Interface for a class AccordionItem
*/
export interface AccordionItemModel {
/**
* Sets the text content to be displayed for the Accordion item.
* You can set the content of the Accordion item using `content` property.
* It also supports to include the title as `HTML element`, `string`, or `query selector`.
* ```typescript
* let accordionObj: Accordion = new Accordion( {
* items: [
* { header: 'Accordion Header', content: 'Accordion Content' },
* { header: '<div>Accordion Header</div>', content: '<div>Accordion Content</div>' },
* { header: '#headerContent', content: '#panelContent' }]
* });
* accordionObj.appendTo('#accordion');
* ```
*
* @default null
*/
content?: string;
/**
* Sets the header text to be displayed for the Accordion item.
* You can set the title of the Accordion item using `header` property.
* It also supports to include the title as `HTML element`, `string`, or `query selector`.
* ```typescript
* let accordionObj: Accordion = new Accordion( {
* items: [
* { header: 'Accordion Header', content: 'Accordion Content' },
* { header: '<div>Accordion Header</div>', content: '<div>Accordion Content</div>' },
* { header: '#headerContent', content: '#panelContent' }]
* });
* accordionObj.appendTo('#accordion');
* ```
*
* @default null
*/
header?: string;
/**
* Defines single/multiple classes (separated by a space) are to be used for Accordion item customization.
*
* @default null
*/
cssClass?: string;
/**
* Defines an icon with the given custom CSS class that is to be rendered before the header text.
* Add the css classes to the `iconCss` property and write the css styles to the defined class to set images/icons.
* Adding icon is applicable only to the header.
* ```typescript
* let accordionObj: Accordion = new Accordion( {
* items: [
* { header: 'Accordion Header', iconCss: 'e-app-icon' }]
* });
* accordionObj.appendTo('#accordion');
* ```
* ```css
* .e-app-icon::before {
* content: "\e710";
* }
* ```
*
* @default null
*/
iconCss?: string;
/**
* Sets the expand (true) or collapse (false) state of the Accordion item. By default, all the items are in a collapsed state.
*
* @default false
*/
expanded?: boolean;
/**
* Sets false to hide an accordion item.
*
* @default true
*/
visible?: boolean;
/**
* Sets true to disable an accordion item.
*
* @default false
*/
disabled?: boolean;
/**
* Sets unique ID to accordion item.
*
* @default null
*/
id?: string;
}
/**
* Interface for a class Accordion
*/
export interface AccordionModel extends ComponentModel{
/**
* An array of item that is used to specify Accordion items.
* ```typescript
* let accordionObj: Accordion = new Accordion( {
* items: [
* { header: 'Accordion Header', content: 'Accordion Content' }]
* });
* accordionObj.appendTo('#accordion');
* ```
*
* @default []
*/
items?: AccordionItemModel[];
/**
* Specifies the datasource for the accordion items.
*
* @isdatamanager false
* @default []
*/
dataSource?: Object[];
/**
* Specifies the template option for accordion items.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
itemTemplate?: string | Function;
/**
* Specifies the header title template option for accordion items.
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
headerTemplate?: string | Function;
/**
* Specifies the width of the Accordion in pixels/number/percentage. Number value is considered as pixels.
*
* @default '100%'
*/
width?: string | number;
/**
* Specifies the height of the Accordion in pixels/number/percentage. Number value is considered as pixels.
*
* @default 'auto'
*/
height?: string | number;
/**
* Specifies the expanded items at initial load.
*
* @default []
*/
expandedIndices?: number[];
/**
* Specifies the options to expand single or multiple panel at a time.
* The possible values are:
* * `Single`: Sets to expand only one Accordion item at a time.
* * `Multiple`: Sets to expand more than one Accordion item at a time.
*
* @default 'Multiple'
*/
expandMode?: ExpandMode;
/**
* Specifies whether to enable the rendering of untrusted HTML values in the Accordion component.
* When this property is enabled, the component will sanitize any suspected untrusted strings and scripts before rendering them.
*
* @default true
*/
enableHtmlSanitizer?: boolean;
/**
* Specifies the animation configuration settings for expanding and collapsing the panel.
*
* @default { expand: { effect: 'SlideDown', duration: 400, easing: 'linear' },
* collapse: { effect: 'SlideUp', duration: 400, easing: 'linear' }}
*/
animation?: AccordionAnimationSettingsModel;
/**
* The event will be fired while clicking anywhere within the Accordion.
*
* @event clicked
*/
clicked?: EmitType<AccordionClickArgs>;
/**
* The event will be fired before the item gets collapsed/expanded.
*
* @event expanding
*/
expanding?: EmitType<ExpandEventArgs>;
/**
* The event will be fired after the item gets collapsed/expanded.
*
* @event expanded
*/
expanded?: EmitType<ExpandedEventArgs>;
/**
* The event will be fired once the control rendering is completed.
*
* @event created
*/
created?: EmitType<Event>;
/**
* The event will be fired when the control gets destroyed.
*
* @event destroyed
*/
destroyed?: EmitType<Event>;
}