forked from syncfusion/ej2-javascript-ui-controls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-view-model.d.ts
324 lines (283 loc) · 10.1 KB
/
list-view-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
import { Virtualization } from './virtualization';import { merge, formatUnit, isNullOrUndefined, append, detach, ModuleDeclaration, extend } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType, compile, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, rippleEffect, Touch, SwipeEventArgs, animationMode } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { createCheckBox } from '@syncfusion/ej2-buttons';import { ListBase, ListBaseOptions, SortOrder, getFieldValues, FieldsMapping } from '../common/list-base';
import {AnimationSettings,checkBoxPosition,SelectEventArgs,ScrolledEventArgs} from "./list-view";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class FieldSettings
*/
export interface FieldSettingsModel {
/**
* Specifies the id field mapped in dataSource.
*/
id?: string;
/**
* The `text` property is used to map the text value from the data source for each list item.
*/
text?: string;
/**
* The `isChecked` property is used to check whether the list items are in checked state or not.
*/
isChecked?: string;
/**
* The `isVisible` property is used to check whether the list items are in visible state or not.
*/
isVisible?: string;
/**
* Specifies the enabled state of the ListView component.
* And, we can disable the component using this property by setting its value as false.
*/
enabled?: string;
/**
* The `iconCss` is used to customize the icon to the list items dynamically.
* We can add a specific image to the icons using `iconCss` property.
*/
iconCss?: string;
/**
* The `child` property is used for nested navigation of listed items.
*/
child?: string;
/**
* The `tooltip` is used to display the information about the target element while hovering on list items.
*/
tooltip?: string;
/**
* The `groupBy` property is used to wraps the ListView elements into a group.
*/
groupBy?: string;
/**
* The `sortBy` property used to enable the sorting of list items to be ascending or descending order.
*/
sortBy?: string;
/**
* The `htmlAttributes` allows additional attributes such as id, class, etc., and
* accepts n number of attributes in a key-value pair format.
*/
htmlAttributes?: string;
/**
* Specifies the `tableName` used to fetch data from a specific table in the server.
*/
tableName?: string;
}
/**
* Interface for a class ListView
*/
export interface ListViewModel extends ComponentModel{
/**
* The `cssClass` property is used to add a user-preferred class name in the root element of the ListView,
* using which we can customize the component (both CSS and functionality customization)
*
* {% codeBlock src='listview/cssClass/index.md' %}{% endcodeBlock %}
*
* @default ''
*/
cssClass?: string;
/**
* If `enableVirtualization` set to true, which will increase the ListView performance, while loading a large amount of data.
*
* {% codeBlock src='listview/enableVirtualization/index.md' %}{% endcodeBlock %}
*
* @default false
*/
enableVirtualization?: boolean;
/**
* The `htmlAttributes` allows additional attributes such as id, class, etc., and
* accepts n number of attributes in a key-value pair format.
*
* {% codeBlock src='listview/htmlAttributes/index.md' %}{% endcodeBlock %}
*
* @default {}
*/
htmlAttributes?: { [key: string]: string; };
/**
* If `enable` set to true, the list items are enabled.
* And, we can disable the component using this property by setting its value as false.
*
* {% codeBlock src='listview/enable/index.md' %}{% endcodeBlock %}
*
* @default true
*/
enable?: boolean;
/**
* The `dataSource` provides the data to render the ListView component which is mapped with the fields of ListView.
*
* @isGenericType true
*
* {% codeBlock src='listview/dataSource/index.md' %}{% endcodeBlock %}
*
* @default []
*/
dataSource?: { [key: string]: Object }[] | string[] | number[] | DataManager;
/**
* The `query` is used to fetch the specific data from dataSource by using where and select keywords.
*
* {% codeBlock src='listview/query/index.md' %}{% endcodeBlock %}
*
* @default null
*/
query?: Query;
/**
* The `fields` is used to map keys from the dataSource which extracts the appropriate data from the dataSource
* with specified mapped with the column fields to render the ListView.
*
* {% codeBlock src='listview/fields/index.md' %}{% endcodeBlock %}
*
* @default defaultMappedFields
*/
fields?: FieldSettingsModel;
/**
* The `animation` property provides an option to apply the different
* animations on the ListView component.
*
* {% codeBlock src='listview/animation/index.md' %}{% endcodeBlock %}
*
*
* @default { effect: 'SlideLeft', duration: 400, easing: 'ease' }
*/
animation?: AnimationSettings;
/**
* The `sortOrder` is used to sort the data source. The available type of sort orders are,
* * `None` - The data source is not sorting.
* * `Ascending` - The data source is sorting with ascending order.
* * `Descending` - The data source is sorting with descending order.
*
* {% codeBlock src='listview/sortOrder/index.md' %}{% endcodeBlock %}
*
* @default 'None'
*/
sortOrder?: SortOrder;
/**
* If `showIcon` set to true, which will show or hide the icon of the list item.
*
* {% codeBlock src='listview/showIcon/index.md' %}{% endcodeBlock %}
*
* @default false
*/
showIcon?: boolean;
/**
* If `showCheckBox` set to true, which will show or hide the checkbox.
*
* {% codeBlock src='listview/showCheckBox/index.md' %}{% endcodeBlock %}
*
*
* @default false
*/
showCheckBox?: boolean;
/**
* The `checkBoxPosition` is used to set the position of check box in a list item.
* By default, the `checkBoxPosition` is Left, which will appear before the text content in a list item.
*
* {% codeBlock src='listview/checkBoxPosition/index.md' %}{% endcodeBlock %}
*
* @default 'Left'
*/
checkBoxPosition?: checkBoxPosition;
/**
* The `headerTitle` is used to set the title of the ListView component.
*
* {% codeBlock src='listview/headerTitle/index.md' %}{% endcodeBlock %}
*
*
* @default ""
*/
headerTitle?: string;
/**
* If `showHeader` set to true, which will show or hide the header of the ListView component.
*
* {% codeBlock src='listview/showHeader/index.md' %}{% endcodeBlock %}
*
* @default false
*/
showHeader?: boolean;
/**
* Specifies whether HTML content should be sanitized or escaped.
* When set to `true`, any HTML content will be sanitized to remove potentially harmful elements.
*
* {% codeBlock src='listview/enableHtmlSanitizer/index.md' %}{% endcodeBlock %}
*
* @default false
*/
enableHtmlSanitizer?: boolean;
/**
* Defines the height of the ListView component which accepts both string and number values.
*
* {% codeBlock src='listview/height/index.md' %}{% endcodeBlock %}
*
* @default ''
*/
height?: number | string;
/**
* Defines the width of the ListView component which accepts both string and number values.
*
* {% codeBlock src='listview/width/index.md' %}{% endcodeBlock %}
*
* @default ''
*/
width?: number | string;
/**
* The ListView component supports to customize the content of each list items with the help of `template` property.
*
* {% codeBlock src='listview/template/index.md' %}{% endcodeBlock %}
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
template?: string | Function;
/**
* The ListView has an option to custom design the ListView header title with the help of `headerTemplate` property.
*
* {% codeBlock src="listview/headerTemplate/index.md" %}{% endcodeBlock %}
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
headerTemplate?: string | Function;
/**
* The ListView has an option to custom design the group header title with the help of `groupTemplate` property.
*
* {% codeBlock src="listview/groupTemplate/index.md" %}{% endcodeBlock %}
*
* @default null
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
groupTemplate?: string | Function;
/**
* Triggers when we select the list item in the component.
*
* @event 'object'
*/
select?: EmitType<SelectEventArgs>;
/**
* Triggers when every ListView action starts.
*
* @event 'object'
*/
actionBegin?: EmitType<object>;
/**
* Triggers when every ListView actions completed.
*
* @event 'object'
*/
/* es-lint disable */
actionComplete?: EmitType<MouseEvent>;
/**
* Triggers, when the data fetch request from the remote server, fails.
*
* @event 'object'
*
*/
actionFailure?: EmitType<MouseEvent>;
/**
* Triggers when scrollbar of the ListView component reaches to the top or bottom.
*
* @event 'object'
*/
scroll?: EmitType<ScrolledEventArgs>;
}