-
Notifications
You must be signed in to change notification settings - Fork 152
/
toolbar-model.d.ts
293 lines (258 loc) · 9.66 KB
/
toolbar-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
import { Component, EventHandler, Property, Event, EmitType, BaseEventArgs } from '@syncfusion/ej2-base';import { addClass, removeClass, isVisible, closest, attributes, detach, classList, KeyboardEvents } from '@syncfusion/ej2-base';import { selectAll, setStyleAttribute as setStyle, KeyboardEventArgs, select } from '@syncfusion/ej2-base';import { isNullOrUndefined as isNOU, getUniqueID, formatUnit, Collection, compile as templateCompiler } from '@syncfusion/ej2-base';import { INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, Browser, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { Popup } from '@syncfusion/ej2-popups';import { calculatePosition } from '@syncfusion/ej2-popups';import { Button, IconPosition } from '@syncfusion/ej2-buttons';import { HScroll } from '../common/h-scroll';import { VScroll } from '../common/v-scroll';
import {OverflowOption,ItemType,DisplayMode,ItemAlign,ClickEventArgs,OverflowMode,BeforeCreateArgs} from "./toolbar";
import {ComponentModel} from '@syncfusion/ej2-base';
/**
* Interface for a class Item
*/
export interface ItemModel {
/**
* Specifies the unique ID to be used with button or input element of Toolbar items.
*
* @default ""
*/
id?: string;
/**
* Specifies the text to be displayed on the Toolbar button.
*
* @default ""
*/
text?: string;
/**
* Specifies the width of the Toolbar button commands.
*
* @default 'auto'
*/
width?: number | string;
/**
* Defines single/multiple classes (separated by space) to be used for customization of commands.
*
* @default ""
*/
cssClass?: string;
/**
* Defines the priority of items to display it in popup always.
* It allows to maintain toolbar item on popup always but it does not work for toolbar priority items.
*
* @default false
*/
showAlwaysInPopup?: boolean;
/**
* Specifies whether an item should be disabled or not.
*
* @default false
*/
disabled?: boolean;
/**
* Defines single/multiple classes separated by space used to specify an icon for the button.
* The icon will be positioned before the text content if text is available, otherwise the icon alone will be rendered.
*
* @default ""
*/
prefixIcon?: string;
/**
* Defines single/multiple classes separated by space used to specify an icon for the button.
* The icon will be positioned after the text content if text is available.
*
* @default ""
*/
suffixIcon?: string;
/**
* Specifies whether an item should be hidden or not.
*
* @default true
*/
visible?: boolean;
/**
* Specifies the Toolbar command display area when an element's content is too large to fit available space.
* This is applicable only to `popup` mode. The possible values for this property as follows
* * `Show`: Always shows the item as the primary priority on the *Toolbar*.
* * `Hide`: Always shows the item as the secondary priority on the *popup*.
* * `None`: No priority for display, and as per normal order moves to popup when content exceeds.
*
* @default 'None'
*/
overflow?: OverflowOption;
/**
* Specifies the HTML element/element ID as a string that can be added as a Toolbar command.
* ```
* E.g - items: [{ template: '<input placeholder="Search"/>' },{ template: '#checkbox1' }]
* ```
*
* @default ""
* @angularType string | object
* @reactType string | function | JSX.Element
* @vueType string | function
* @aspType string
*/
template?: string | Object | Function;
/**
* Specifies the types of command to be rendered in the Toolbar.
* Supported types are:
* * `Button`: Creates the Button control with its given properties like text, prefixIcon, etc.
* * `Separator`: Adds a horizontal line that separates the Toolbar commands.
* * `Input`: Creates an input element that is applicable to template rendering with Syncfusion controls like DropDownList,
* AutoComplete, etc.
*
* @default 'Button'
*/
type?: ItemType;
/**
* Specifies where the button text will be displayed on *popup mode* of the Toolbar.
* The possible values for this property as follows
* * `Toolbar`: Text will be displayed on *Toolbar* only.
* * `Overflow`: Text will be displayed only when content overflows to *popup*.
* * `Both`: Text will be displayed on *popup* and *Toolbar*.
*
* @default 'Both'
*/
showTextOn?: DisplayMode;
/**
* Defines htmlAttributes used to add custom attributes to Toolbar command.
* Supports HTML attributes such as style, class, etc.
*
* @default null
*/
htmlAttributes?: { [key: string]: string };
/**
* Specifies the text to be displayed on hovering the Toolbar button.
*
* @default ""
*/
tooltipText?: string;
/**
* Specifies the location for aligning Toolbar items on the Toolbar. Each command will be aligned according to the `align` property.
* The possible values for this property as follows
* * `Left`: To align commands to the left side of the Toolbar.
* * `Center`: To align commands at the center of the Toolbar.
* * `Right`: To align commands to the right side of the Toolbar.
* ```html
* <div id="element"> </div>
* ```
* ```typescript
* let toolbar: Toolbar = new Toolbar({
* items: [
* { text: "Home" },
* { text: "My Home Page" , align: 'Center' },
* { text: "Search", align: 'Right' }
* { text: "Settings", align: 'Right' }
* ]
* });
* toolbar.appendTo('#element');
* ```
*
* @default "Left"
* @aspPopulateDefaultValue
*/
align?: ItemAlign;
/**
* Event triggers when `click` the toolbar item.
*
* @event click
*/
click?: EmitType<ClickEventArgs>;
/**
* Specifies the tab order of the Toolbar items. When positive values assigned, it allows to switch focus to the next/previous toolbar items with Tab/ShiftTab keys.
* By default, user can able to switch between items only via arrow keys.
* If the value is set to 0 for all tool bar items, then tab switches based on element order.
*
* @default -1
*/
tabIndex?: number;
}
/**
* Interface for a class Toolbar
*/
export interface ToolbarModel extends ComponentModel{
/**
* An array of items that is used to configure Toolbar commands.
*
* @default []
*/
items?: ItemModel[];
/**
* Specifies the width of the Toolbar in pixels/numbers/percentage. Number value is considered as pixels.
*
* @default 'auto'
*/
width?: string | number;
/**
* Specifies the height of the Toolbar in pixels/number/percentage. Number value is considered as pixels.
*
* @default 'auto'
*/
height?: string | number;
/**
* Sets the CSS classes to root element of the Tab that helps to customize component styles.
*
* @default ''
*/
cssClass?: string;
/**
* Specifies the Toolbar display mode when Toolbar content exceeds the viewing area.
* The possible values for this property as follows
* - Scrollable: All the elements are displayed in a single line with horizontal scrolling enabled.
* - Popup: Prioritized elements are displayed on the Toolbar and the rest of elements are moved to the *popup*.
* - MultiRow: Displays the overflow toolbar items as an in-line of a toolbar.
* - Extended: Hide the overflowing toolbar items in the next row. Show the overflowing toolbar items when you click the expand icons.
* If the popup content overflows the height of the page, the rest of the elements will be hidden.
*
* @default 'Scrollable'
*/
overflowMode?: OverflowMode;
/**
* Specifies the scrolling distance in scroller.
* The possible values for this property as follows
* * Scrollable - All the elements are displayed in a single line with horizontal scrolling enabled.
* * Popup - Prioritized elements are displayed on the Toolbar and the rest of elements are moved to the *popup*.
* * MultiRow - Displays the overflow toolbar items as an in-line of a toolbar.
* * Extended - Hide the overflowing toolbar items in the next row. Show the overflowing toolbar items when you click the expand icons.
* * If the popup content overflows the height of the page, the rest of the elements will be hidden.
*
* {% codeBlock src='toolbar/scrollStep/index.md' %}{% endcodeBlock %}
*
* @default null
*/
scrollStep?: number;
/**
* Enable or disable the popup collision.
*
* @default true
*/
enableCollision?: boolean;
/**
* Defines whether to allow the cross-scripting site or not.
*
* @default true
*/
enableHtmlSanitizer?: boolean;
/**
* When this property is set to true, it allows the keyboard interaction in toolbar.
*
* @default true
*/
allowKeyboard?: boolean;
/**
* The event will be fired on clicking the Toolbar elements.
*
* @event clicked
*/
clicked?: EmitType<ClickEventArgs>;
/**
* The event will be fired when the control is rendered.
*
* @event created
*/
created?: EmitType<Event>;
/**
* The event will be fired when the control gets destroyed.
*
* @event destroyed
*/
destroyed?: EmitType<Event>;
/**
* The event will be fired before the control is rendered on a page.
*
* @event beforeCreate
*/
beforeCreate?: EmitType<BeforeCreateArgs>;
}