swing-ui 0.1.25 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +5 -4
- package/README.md +144 -7
- package/SwingUI.js +2611 -0
- package/classes/Arc.js +185 -0
- package/classes/Button.js +55 -0
- package/classes/CheckBox.js +33 -0
- package/classes/CheckBoxMenuItem.js +24 -0
- package/classes/ComboBox.js +329 -0
- package/classes/ComponentContainer.js +828 -0
- package/classes/ContextMenu.js +141 -0
- package/classes/DocumentEditor.js +168 -0
- package/classes/Ellipse.js +76 -0
- package/classes/InternalWindow.js +397 -0
- package/classes/InternalWindowContainer.js +93 -0
- package/classes/Label.js +52 -0
- package/classes/Line.js +105 -0
- package/classes/List.js +452 -0
- package/classes/MediaPlayer.js +504 -0
- package/classes/Menu.js +74 -0
- package/classes/MenuBar.js +56 -0
- package/classes/MenuItem.js +92 -0
- package/classes/Panel.js +50 -0
- package/classes/PasswordField.js +47 -0
- package/classes/Polygon.js +236 -0
- package/classes/Polyline.js +240 -0
- package/classes/ProgressBar.js +62 -0
- package/classes/RadioButton.js +110 -0
- package/classes/RadioButtonMenuItem.js +106 -0
- package/classes/Rectangle.js +199 -0
- package/classes/ScrollPane.js +53 -0
- package/classes/ScrollableComponent.js +141 -0
- package/classes/Separator.js +24 -0
- package/classes/Shape.js +584 -0
- package/classes/ShapeContainer.js +231 -0
- package/classes/Slider.js +172 -0
- package/classes/Spinner.js +172 -0
- package/classes/SplitView.js +82 -0
- package/classes/Stroke.js +115 -0
- package/classes/Table.js +982 -0
- package/classes/Tabs.js +228 -0
- package/classes/TextArea.js +125 -0
- package/classes/TextComponent.js +207 -0
- package/classes/TextField.js +128 -0
- package/classes/TextShape.js +123 -0
- package/classes/ToggleButton.js +147 -0
- package/classes/ToolBar.js +120 -0
- package/classes/TrayIcon.js +54 -0
- package/classes/Tree.js +569 -0
- package/classes/UIComponent.js +2113 -0
- package/classes/Window.js +609 -0
- package/enums.js +298 -0
- package/fonts.conf +32 -0
- package/functions.js +254 -0
- package/icon.png +0 -0
- package/index.js +109 -4
- package/jar/gui-11.jar +0 -0
- package/jar/lib/flatlaf.jar +0 -0
- package/jar/lib/jna.jar +0 -0
- package/package.json +58 -33
- package/typedefs.js +973 -0
- package/types/SwingUI.d.ts +727 -0
- package/types/classes/Arc.d.ts +111 -0
- package/types/classes/Button.d.ts +38 -0
- package/types/classes/CheckBox.d.ts +22 -0
- package/types/classes/CheckBoxMenuItem.d.ts +18 -0
- package/types/classes/ComboBox.d.ts +172 -0
- package/types/classes/ComponentContainer.d.ts +131 -0
- package/types/classes/ContextMenu.d.ts +74 -0
- package/types/classes/DocumentEditor.d.ts +95 -0
- package/types/classes/Ellipse.d.ts +34 -0
- package/types/classes/InternalWindow.d.ts +163 -0
- package/types/classes/InternalWindowContainer.d.ts +36 -0
- package/types/classes/Label.d.ts +33 -0
- package/types/classes/Line.d.ts +48 -0
- package/types/classes/List.d.ts +223 -0
- package/types/classes/MediaPlayer.d.ts +381 -0
- package/types/classes/Menu.d.ts +43 -0
- package/types/classes/MenuBar.d.ts +26 -0
- package/types/classes/MenuItem.d.ts +57 -0
- package/types/classes/Panel.d.ts +28 -0
- package/types/classes/PasswordField.d.ts +22 -0
- package/types/classes/Polygon.d.ts +93 -0
- package/types/classes/Polyline.d.ts +96 -0
- package/types/classes/ProgressBar.d.ts +36 -0
- package/types/classes/RadioButton.d.ts +70 -0
- package/types/classes/RadioButtonMenuItem.d.ts +71 -0
- package/types/classes/Rectangle.d.ts +82 -0
- package/types/classes/ScrollPane.d.ts +23 -0
- package/types/classes/ScrollableComponent.d.ts +81 -0
- package/types/classes/Separator.d.ts +14 -0
- package/types/classes/Shape.d.ts +223 -0
- package/types/classes/ShapeContainer.d.ts +92 -0
- package/types/classes/Slider.d.ts +107 -0
- package/types/classes/Spinner.d.ts +129 -0
- package/types/classes/SplitView.d.ts +47 -0
- package/types/classes/Stroke.d.ts +99 -0
- package/types/classes/Table.d.ts +652 -0
- package/types/classes/Tabs.d.ts +118 -0
- package/types/classes/TextArea.d.ts +45 -0
- package/types/classes/TextComponent.d.ts +136 -0
- package/types/classes/TextField.d.ts +94 -0
- package/types/classes/TextShape.d.ts +73 -0
- package/types/classes/ToggleButton.d.ts +84 -0
- package/types/classes/ToolBar.d.ts +82 -0
- package/types/classes/TrayIcon.d.ts +43 -0
- package/types/classes/Tree.d.ts +354 -0
- package/types/classes/UIComponent.d.ts +945 -0
- package/types/classes/Window.d.ts +334 -0
- package/types/enums.d.ts +437 -0
- package/types/functions.d.ts +109 -0
- package/types/index.d.ts +188 -0
- package/types/typedefs.d.ts +1626 -0
- package/ui-process-manager.js +317 -0
- package/video-devices-linux.sh +72 -0
- package/video-devices-mac.sh +33 -0
- package/CHANGES.md +0 -3
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Table UI component displays data in a structured grid of rows and columns, making it easy to read, sort, and interact with.
|
|
3
|
+
* It supports features like column resizing, column reordering, sorting, filtering, multiple data types and more.
|
|
4
|
+
*
|
|
5
|
+
* Column object format is shown in example below. Rows are arrays of values (cells), each value for a corresponding column. Row cell data type must match the data type required for it's column type.
|
|
6
|
+
*
|
|
7
|
+
* // NOTE: When adding a new column, only "text" is required for the column, other properties are optional.
|
|
8
|
+
* @class
|
|
9
|
+
* @global
|
|
10
|
+
* @see TableColumn
|
|
11
|
+
* @see ScrollableComponent
|
|
12
|
+
*/
|
|
13
|
+
export class Table extends ScrollableComponent {
|
|
14
|
+
/**
|
|
15
|
+
* Enum for column sorting modes.
|
|
16
|
+
* Used in column definitions, e.g., `{ sorting: Table.Sorting.Natural }`.
|
|
17
|
+
*
|
|
18
|
+
* @readonly
|
|
19
|
+
* @enum {number}
|
|
20
|
+
* @property {number} None - No sorting applied.
|
|
21
|
+
* @property {number} Natural - (Default) Natural order sorting (alphanumeric).
|
|
22
|
+
* @property {number} CaseInsensitive - Case-insensitive string sorting.
|
|
23
|
+
* @property {number} Integer - Sort values as integers.
|
|
24
|
+
* @property {number} Float - Sort values as floating-point numbers.
|
|
25
|
+
* @see TableColumn
|
|
26
|
+
* @example
|
|
27
|
+
* table.addColumn({
|
|
28
|
+
* text: "New Column",
|
|
29
|
+
* sorting: Table.Sorting.CaseInsensitive
|
|
30
|
+
* });
|
|
31
|
+
*/
|
|
32
|
+
static readonly Sorting: Readonly<{
|
|
33
|
+
None: 0;
|
|
34
|
+
Natural: 1;
|
|
35
|
+
CaseInsensitive: 2;
|
|
36
|
+
Integer: 3;
|
|
37
|
+
Float: 4;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Enum for sort order.
|
|
41
|
+
*
|
|
42
|
+
* @readonly
|
|
43
|
+
* @enum {number}
|
|
44
|
+
* @property {number} None - No sorting order applied.
|
|
45
|
+
* @property {number} Ascending - Values sorted from smallest to largest.
|
|
46
|
+
* @property {number} Descending - Values sorted from largest to smallest.
|
|
47
|
+
* @see Table#sortOrder
|
|
48
|
+
* @example <h2>Sorting rows by column 2 in ascending order:</h2>
|
|
49
|
+
* table.sortOrder(2, false, Table.SortOrder.Ascending);
|
|
50
|
+
*/
|
|
51
|
+
static readonly SortOrder: Readonly<{
|
|
52
|
+
None: 0;
|
|
53
|
+
Ascending: 1;
|
|
54
|
+
Descending: 2;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Enum for table column auto-resizing modes. Used with {@link Table#autoResizeColumns}.
|
|
58
|
+
*
|
|
59
|
+
* @readonly
|
|
60
|
+
* @enum {number}
|
|
61
|
+
* @property {number} None - Do not auto-resize columns when one of the columns is resized.
|
|
62
|
+
* @property {number} NextColumn - Resize the next column when current column changes.
|
|
63
|
+
* @property {number} SubsequentColumns - Resize all columns to the right of the changed column.
|
|
64
|
+
* @property {number} LastColumn - Resize only the last column.
|
|
65
|
+
* @property {number} AllColumns - Resize all other columns equally to adapt to new size of a column that is being resized.
|
|
66
|
+
* @see TableColumn
|
|
67
|
+
* @see Table#autoResizeColumns
|
|
68
|
+
* @example
|
|
69
|
+
* Table.AutoResize.AllColumns
|
|
70
|
+
*/
|
|
71
|
+
static readonly AutoResize: Readonly<{
|
|
72
|
+
None: 0;
|
|
73
|
+
NextColumn: 1;
|
|
74
|
+
SubsequentColumns: 2;
|
|
75
|
+
LastColumn: 3;
|
|
76
|
+
AllColumns: 4;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Enum for table grid line display modes.
|
|
80
|
+
*
|
|
81
|
+
* @readonly
|
|
82
|
+
* @enum {number}
|
|
83
|
+
* @property {number} None - No grid lines.
|
|
84
|
+
* @property {number} Horizontal - Show only horizontal lines.
|
|
85
|
+
* @property {number} Vertical - Show only vertical lines.
|
|
86
|
+
* @property {number} Both - Show both horizontal and vertical lines.
|
|
87
|
+
* @see Table#gridLines
|
|
88
|
+
* @example <h2>Setting to show only horizontal grid lines:</h2>
|
|
89
|
+
* table.gridLines(Table.GridLines.Horizontal);
|
|
90
|
+
*/
|
|
91
|
+
static readonly GridLines: Readonly<{
|
|
92
|
+
None: 0;
|
|
93
|
+
Horizontal: 1;
|
|
94
|
+
Vertical: 2;
|
|
95
|
+
Both: 3;
|
|
96
|
+
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Adds a column to a Table as a last column or at specified index. An empty data will be added at that column index for each row.
|
|
99
|
+
* For detail about column object format and all possible column properties refer to examples in the {@link Table} class description above.
|
|
100
|
+
* See usage example below.
|
|
101
|
+
*
|
|
102
|
+
* @param {string|number|TableColumn} column - A column Object with column properties, such as text, background color, etc.
|
|
103
|
+
* @param {number} [index] - Insert at this position. Index is the original position of columns that were before columns are reordered.
|
|
104
|
+
* @return {number} Returns an index of added column, or -1 if the column was not added for some reason.
|
|
105
|
+
* @see TableColumn
|
|
106
|
+
* @example <h2>Inserting a new column at an index 3:</h2>
|
|
107
|
+
* table.addColumn({text: "Customer Name", headerAlign:"center"}, 3);
|
|
108
|
+
*/
|
|
109
|
+
addColumn(column: string | number | TableColumn, ...args: any[]): number;
|
|
110
|
+
/**
|
|
111
|
+
* Retrieve or updates a column at specified index.
|
|
112
|
+
*
|
|
113
|
+
* @param {number} i - Index of the column to retrieve or update.
|
|
114
|
+
* @param {boolean} [new_order] - Should the index be interpreted as a new sorted order index or original order. Default is `false`.
|
|
115
|
+
* @param {TableColumn} [column] - An object of column properties to update in a column at specified index. To retrieve the column omit this argument.
|
|
116
|
+
* @return {Table|TableColumn} When retrieving the column a column `object` is returned, otherwise `this` Table instance is returned.
|
|
117
|
+
* @see TableColumn
|
|
118
|
+
*/
|
|
119
|
+
column(i: number, new_order?: boolean, ...args: any[]): Table | TableColumn;
|
|
120
|
+
/**
|
|
121
|
+
* Moves a column from one position to another. Uses new column order for column indexes (if columns were reordered).
|
|
122
|
+
*
|
|
123
|
+
* @param {number} from_index - Index of the column to move
|
|
124
|
+
* @param {number} to_index - New position index
|
|
125
|
+
*/
|
|
126
|
+
moveColumn(from_index: number, to_index: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Sets or gets ability to change order of columns by dragging-dropping them by a user.
|
|
129
|
+
*
|
|
130
|
+
* @param {boolean} [enable] - To enable reordering pass `true`, to disable pass `false`.
|
|
131
|
+
* @return {boolean|Table} If setting a value this method returns `this` Table instance, when getting current value a `boolean` is returned.
|
|
132
|
+
*/
|
|
133
|
+
canReorderColumns(...args: any[]): boolean | Table;
|
|
134
|
+
/**
|
|
135
|
+
* Removes a column at specified index. Also data at that column index for each row will also be removed.
|
|
136
|
+
*
|
|
137
|
+
* @param {number} i - Index of the column to remove.
|
|
138
|
+
* @param {boolean} [new_order] - Should the index be interpreted as a new sorted order index or original order. Default is `false`.
|
|
139
|
+
* @return {Table} Returns `this` Table instance for method chaining.
|
|
140
|
+
*/
|
|
141
|
+
removeColumn(i: number, new_order?: boolean): Table;
|
|
142
|
+
/**
|
|
143
|
+
* Sets or get visibility of a column.
|
|
144
|
+
*
|
|
145
|
+
* @param {number} i - Index of the column
|
|
146
|
+
* @param {boolean} [new_order] - Should the index be interpreted as a new sorted order index or original order. Default is `false`.
|
|
147
|
+
* @param {boolean} [visible] - `true` to make the column visible, `false` to hide it.
|
|
148
|
+
* @return {boolean|Table} If `visible` argument is passed, then `this` Table object is returned, otherwise current visibility value is returned.
|
|
149
|
+
*/
|
|
150
|
+
columnVisible(i: number, new_order?: boolean, ...args: any[]): boolean | Table;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the amount of columns currently in the Table.
|
|
153
|
+
* @type {number}
|
|
154
|
+
* @readonly
|
|
155
|
+
*/
|
|
156
|
+
readonly get columnCount(): number;
|
|
157
|
+
/**
|
|
158
|
+
* Gets or sets the list of columns for the table. To simple remove all columns pass `null` or empty Array.
|
|
159
|
+
*
|
|
160
|
+
* - When passing an array of column objects, it replaces the existing columns.
|
|
161
|
+
* - Passing `null` removes all columns.
|
|
162
|
+
* - Passing fewer columns than currently exist will also remove the extra columns from all rows.
|
|
163
|
+
*
|
|
164
|
+
* @param {string[]|number[]|TableColumn[]|boolean} [c] - An array of columns replaces existing ones. To remove all columns just pass an empty Array []. To get an Array of columns pass a `boolean` or nothing:
|
|
165
|
+
* - `true` to get columns in a new order.
|
|
166
|
+
* - `false` (default) to get columns in original order.
|
|
167
|
+
* @return {TableColumn[]|Table}
|
|
168
|
+
* @see TableColumn
|
|
169
|
+
*/
|
|
170
|
+
columns(c?: string[] | number[] | TableColumn[] | boolean): TableColumn[] | Table;
|
|
171
|
+
/**
|
|
172
|
+
* Gets or sets columns' behavior when a single column is resized (usually manually by the user).
|
|
173
|
+
* Check description of each value of {@link Table#AutoResize} on this page.
|
|
174
|
+
* See usage example below.
|
|
175
|
+
*
|
|
176
|
+
* @param {Table.AutoResize} [value] - One of: Table.AutoResize.None (default), Table.AutoResize.NextColumn, Table.AutoResize.SubsequentColumns, Table.AutoResize.LastColumn, Table.AutoResize.AllColumns
|
|
177
|
+
* @return {Table.AutoResize|Table} Returns current auto-resize mode if no argument is passed, otherwise the `Table` instance for chaining.
|
|
178
|
+
* @example
|
|
179
|
+
* // disables resizing of other columns when one column is resized
|
|
180
|
+
* table.autoResizeColumns(Table.AutoResize.None);
|
|
181
|
+
*
|
|
182
|
+
* // last column will be resize to accommodate room for a column being resized
|
|
183
|
+
* table.autoResizeColumns(Table.AutoResize.LastColumn);
|
|
184
|
+
*/
|
|
185
|
+
autoResizeColumns(...args: any[]): Readonly<{
|
|
186
|
+
None: 0;
|
|
187
|
+
NextColumn: 1;
|
|
188
|
+
SubsequentColumns: 2;
|
|
189
|
+
LastColumn: 3;
|
|
190
|
+
AllColumns: 4;
|
|
191
|
+
}> | Table;
|
|
192
|
+
/**
|
|
193
|
+
* Gets or sets current sort state of the table rows by specifying column and order. Does not sort by columns that are set to be not sortable.
|
|
194
|
+
*
|
|
195
|
+
* - When called without arguments, returns the current sort configuration.
|
|
196
|
+
* - When called with arguments, updates the sort state for the specified column.
|
|
197
|
+
* - Columns marked as non-sortable will be ignored.
|
|
198
|
+
*
|
|
199
|
+
* See usage examples below.
|
|
200
|
+
*
|
|
201
|
+
* @param {number|null|undefined} [column] - Column index to sort by, or `null` to clear sorting al onn columns. Omit or leave `undefined` to get current sort state.
|
|
202
|
+
* @param {boolean} [new_column_order=false] - Whether the given column index should be interpreted as a new column order (useful if columns were reordered).
|
|
203
|
+
* @param {Table.SortOrder} [order=Table.SortOrder.None] - One of: Table.SortOrder.None (default), Table.SortOrder.Ascending, Table.SortOrder.Descending.
|
|
204
|
+
* @return {Table|object|null} Returns `this` Table object for method chaining when settings a sort, otherwise returns current sort order as {column:number, order:Table.SortOrder} or `null` when table rows are not sorted.
|
|
205
|
+
* @see Table#SortOrder
|
|
206
|
+
* @example <h2>Setting a sort column and order:</h2>
|
|
207
|
+
* // Sorts rows by column 2 in descending order
|
|
208
|
+
* table.sortOrder(2, false, Table.SortOrder.Descending);
|
|
209
|
+
*
|
|
210
|
+
* // Resets sorting by column 2 while still sorting by previously sorted columns (if any)
|
|
211
|
+
* table.sortOrder(2, false, Table.SortOrder.None);
|
|
212
|
+
*
|
|
213
|
+
* // Resets row sorting for all columns. Rows become unsorted.
|
|
214
|
+
* table.sortOrder(null);
|
|
215
|
+
*
|
|
216
|
+
* @example <h2>Getting current sort state:</h2>
|
|
217
|
+
* let sorting = table.sortOrder();
|
|
218
|
+
* // returns `null` if there was no sorting applied to the table
|
|
219
|
+
* // or object like {column: 2, order: Table.SortOrder.Descending} if column 2 is currently sorted.
|
|
220
|
+
* // Returned `column` index is the original column index (remain same even after after columns were reordered).
|
|
221
|
+
*/
|
|
222
|
+
sortOrder(column?: number | null | undefined, new_column_order?: boolean, order?: Readonly<{
|
|
223
|
+
None: 0;
|
|
224
|
+
Ascending: 1;
|
|
225
|
+
Descending: 2;
|
|
226
|
+
}>): Table | object | null;
|
|
227
|
+
/**
|
|
228
|
+
* Returns a number of rows in the Table.
|
|
229
|
+
*
|
|
230
|
+
* @type {number}
|
|
231
|
+
* @readonly
|
|
232
|
+
*/
|
|
233
|
+
readonly get rowCount(): number;
|
|
234
|
+
/**
|
|
235
|
+
* Gets an array of all selected rows with all data in them.
|
|
236
|
+
*
|
|
237
|
+
* @type {Array.<Array.<(string|number|boolean)>>}
|
|
238
|
+
* @readonly
|
|
239
|
+
* @see Table#selection
|
|
240
|
+
* @see Table#selectedIndex
|
|
241
|
+
* @see Table#selectedCell
|
|
242
|
+
* @see Table#selectedValue
|
|
243
|
+
* @see Table#selectionMode
|
|
244
|
+
*/
|
|
245
|
+
readonly get selectedRows(): Array<Array<(string | number | boolean)>>;
|
|
246
|
+
/**
|
|
247
|
+
* Sets or gets a background color of rows.
|
|
248
|
+
*
|
|
249
|
+
* @param {string} color - Hex style color string (e.g. #004453 or #00445377 with alpha), or `null` to reset background color to default.
|
|
250
|
+
* @return {string|Table} Returns current value when no argument is passed, otherwise returns `this` Table instance for method chaining.
|
|
251
|
+
*/
|
|
252
|
+
rowBackground(...args: any[]): string | Table;
|
|
253
|
+
/**
|
|
254
|
+
* Gets/Sets/Resets the height of all table rows, or one existing row at specified index.
|
|
255
|
+
*
|
|
256
|
+
* @param {number|null|undefined} [height=undefined] - Set `number` to set height to specific number, `null` to reset height to default value, `undefined` to get height.
|
|
257
|
+
* @param {number} [index=-1] - Index of a specific row to apply given height to. Index is the original row position, it doesn't change due to sorting. -1 means that height will be applied to all rows.
|
|
258
|
+
* @return {number|Table} - If no argument is passed or `height` is set to `undefined` then current value is returned, otherwise `this` Table instance is returned for method chaining.
|
|
259
|
+
* @example
|
|
260
|
+
* // To get height of all rows
|
|
261
|
+
* let h = table.rowHeight();
|
|
262
|
+
*
|
|
263
|
+
* // To get a height of a specific row at index 5
|
|
264
|
+
* let h = table.rowHeight(undefined, 5);
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* // To set height to all rows
|
|
268
|
+
* table.rowHeight(40);
|
|
269
|
+
*
|
|
270
|
+
* // To set height to row at index 5
|
|
271
|
+
* table.rowHeight(40, 5);
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* // To reset height of all rows to default height
|
|
275
|
+
* table.rowHeight(null);
|
|
276
|
+
*
|
|
277
|
+
* // To reset height of row at index 5 to default height
|
|
278
|
+
* table.rowHeight(null, 5);
|
|
279
|
+
*/
|
|
280
|
+
rowHeight(height?: number | null | undefined, index?: number): number | Table;
|
|
281
|
+
/**
|
|
282
|
+
* Sets or gets a row style at a specified row index. When the row is removed, the row style is also removed.
|
|
283
|
+
*
|
|
284
|
+
* @param {number} index - The row index.
|
|
285
|
+
* @param {boolean} [new_order=false] - Should the index be interpreted as a new sorted order index or original order. Default is `false`.
|
|
286
|
+
* @param {Object|null} [style=undefined] - An object containing style properties to set, `undefined` to get the row style object, or `null` to clear the styles.
|
|
287
|
+
* For example: {background:"#FF0000", color:"#0000FF", height: 40}.
|
|
288
|
+
* Set to `null` to clear all styles, or set a specific property to `null` to remove only that style (e.g., {background:null}).
|
|
289
|
+
* If omitted, the function returns the current style properties of the row.
|
|
290
|
+
* @return {Object|Table} - When setting the style, an instance of `this` Table is returned, otherwise a current style of specified row is returned.
|
|
291
|
+
* @example
|
|
292
|
+
* // how to set style for a row index 5
|
|
293
|
+
* table.rowStyle(5, false, {background:"#FF0000", color:"#FFAAAA", height: 40});
|
|
294
|
+
*
|
|
295
|
+
* // how to reset one style a row at index 5
|
|
296
|
+
* table.rowStyle(5, false, {color:"#FFAAAA"});
|
|
297
|
+
*
|
|
298
|
+
* // how to remove all styles from a row at index 5
|
|
299
|
+
* table.rowStyle(5, false, null);
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* // How to get style of a row at index 5
|
|
303
|
+
* let style = table.rowStyle(5);
|
|
304
|
+
* console.log(style);
|
|
305
|
+
*/
|
|
306
|
+
rowStyle(index: number, new_order?: boolean, style?: Object | null): Object | Table;
|
|
307
|
+
/**
|
|
308
|
+
* Adds a new row at the end of table or at a specified index.
|
|
309
|
+
*
|
|
310
|
+
* @param {Array.<(string|number|boolean)>} row - An array of cell values of the row according to each column. Missing cells will be filled with empty data.
|
|
311
|
+
* @param {number} [index] - Index at which to insert the row (original indexing, sorting is ignored).
|
|
312
|
+
* @return {number} Returns an index of added row, or -1 if the row was not added for some reason.
|
|
313
|
+
* @example
|
|
314
|
+
* table.addRow(["John Dow", 45, true, "Charlotte, NC", "[View|Remove]"]);
|
|
315
|
+
*/
|
|
316
|
+
addRow(row: Array<(string | number | boolean)>, ...args: any[]): number;
|
|
317
|
+
/**
|
|
318
|
+
* Sets or gets all rows (array of arrays representing rows and cells) of the table. When setting rows, it replaces existing rows. To simply remove all rows pass `null` or empty Array as first argument.
|
|
319
|
+
* When getting rows you can pass "true" to get them in the new sorted order instead of original order.
|
|
320
|
+
* To filter out some rows pass `filter` argument. See {@link Table#filter} function's documentation for details about filter expression.
|
|
321
|
+
*
|
|
322
|
+
* @param {Array|boolean} [rows_or_new_order=false] - Array of rows to set for the table, or boolean `true` to return the rows in the new sorted order or `false` for original order.
|
|
323
|
+
* @param {string} [criteria=undefined] - Filter expression to retrieving only rows that meet the specified criteria. Default is `undefined`, no filter. Only use it for getting rows, NOT setting. Learn more about filter expression in docs from {@link Table#filter} method.
|
|
324
|
+
* @return {Array|Table} When settings rows to the table an instance of `this` this Table is returned. When retrieving rows a two-dimensional Array of rows is returned.
|
|
325
|
+
* @example <h2>Clearing all rows</h2>
|
|
326
|
+
* table.rows([]); // passing empty aray clears all existing rows
|
|
327
|
+
*/
|
|
328
|
+
rows(rows_or_new_order?: any[] | boolean, criteria?: string): any[] | Table;
|
|
329
|
+
/**
|
|
330
|
+
* Gets or updates an existing row at a specified index.
|
|
331
|
+
*
|
|
332
|
+
* @param {number} index - Index of the row.
|
|
333
|
+
* @param {boolean} [new_order=false] - Specifies if the `index` argument is based on a new sorted order (true) or not (false).
|
|
334
|
+
* @param {Array.<(string|number|boolean)>} [row] array - A new row that will replace an existing row at specified index.
|
|
335
|
+
* @return {Array.<(string|number|boolean)>|Table} When retrieving a row an Array is returned. When updating updating a row an instance of `this` Table is returned.
|
|
336
|
+
* @example
|
|
337
|
+
* // To update values of an existing row at index 5
|
|
338
|
+
* table.row(5, false, ["Jane Dow", 40, false, "Charlotte, NC", "[View|Remove]"]);
|
|
339
|
+
*/
|
|
340
|
+
row(index: number, new_order?: boolean, ...args: any[]): Array<(string | number | boolean)> | Table;
|
|
341
|
+
/**
|
|
342
|
+
* Removes one row at a specified index.
|
|
343
|
+
*
|
|
344
|
+
* @param {number} i - Index of the row to remove.
|
|
345
|
+
* @param {boolean} [new_order=false] - Indicates if given index is adjusted the sort order.
|
|
346
|
+
* @return {Table} Returns an instance of `this` Table for method chaining.
|
|
347
|
+
*/
|
|
348
|
+
removeRow(i: number, new_order?: boolean): Table;
|
|
349
|
+
/**
|
|
350
|
+
* Sets/Removes selection of single row, list, or a range of rows, or gets an array of currently selected rows. Without arguments this returns an array of currently selected row indexes.
|
|
351
|
+
*
|
|
352
|
+
* @param {number|number[]|{from:number,to:number}|null} [selection] - One index, an array of indexes, or index range object {from:number, to:number}. Pass `null` to clear current selection. Omit this argument to get current selection.
|
|
353
|
+
* @param {boolean} [new_order=false] - Use new order after the rows were sorted (true) instead of using original order of rows by default (false). Default is false.
|
|
354
|
+
* @param {boolean} [add_remove=undefined] - Instead of setting a new selection use `true` to add, or `false` to remove from existing selection. Default is `undefined`.
|
|
355
|
+
* @returns {Table|number[]} When setting selection, an instance of `this` Table is returned. When getting selection, an array if indexes is returned.
|
|
356
|
+
* @see Table#selectedIndex
|
|
357
|
+
* @see Table#selectAll
|
|
358
|
+
* @example
|
|
359
|
+
* // Example of clearing current selection
|
|
360
|
+
* table.selection(null);
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* // Examples of setting selection using a single index:
|
|
364
|
+
* table.selection(5) - Selects a single row.
|
|
365
|
+
* table.selection(5, true) - Selects a single row based on new sort order.
|
|
366
|
+
* table.selection(5, false, true) - Selects an additional single row (if it wasn't selected yet) based on original order.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* // Examples of selecting a range of rows using an index range object:
|
|
370
|
+
* table.selection({from:5, to:9}) - Selects only a range of rows from index 5 to 9 (Only possible when selection mode is set to SelectionMode.Range or SelectionMode.Multiple).
|
|
371
|
+
* table.selection({from:5, to:9}, true) - Selects only a range of rows from index 5 to 9 based on new sort order (Only possible when selection mode is set to SelectionMode.Range or SelectionMode.Multiple).
|
|
372
|
+
* table.selection({from:5, to:9}, true, true) - Selects a range of rows from index 5 to 9 based on new sort order in addition to previously selected rows (Only possible when selection mode is set to SelectionMode.Range or SelectionMode.Multiple).
|
|
373
|
+
*
|
|
374
|
+
* @example
|
|
375
|
+
* // Examples of selecting/deselecting multiple rows using an array of indexes:
|
|
376
|
+
* table.selection([6, 7, 4, 1]) - Selects only indexes specified in the array (Multiple intervals (ranges) are only possible when selection mode is set to SelectionMode.Multiple).
|
|
377
|
+
* table.selection([6, 7, 4, 1], true) - Selects only indexes specified in the array based on new sort order (Multiple intervals (ranges) are only possible when selection mode is set to SelectionMode.Multiple).
|
|
378
|
+
* table.selection([6, 7], true, false) - Deselects rows at indexes specified in the array based on new sort order from previously selected rows.
|
|
379
|
+
*
|
|
380
|
+
*/
|
|
381
|
+
selection(...args: any[]): Table | number[];
|
|
382
|
+
/**
|
|
383
|
+
* Selects/Deselects all rows in the Table
|
|
384
|
+
*
|
|
385
|
+
* @param {boolean} [selected=true] - `true` to select all rows, `false` to deselect all rows.
|
|
386
|
+
* @return {Table} Returns an instance of `this` Table for method chaining.
|
|
387
|
+
* @see Table#selectedIndex
|
|
388
|
+
* @see Table#selection
|
|
389
|
+
*/
|
|
390
|
+
selectAll(selected?: boolean): Table;
|
|
391
|
+
/**
|
|
392
|
+
* Sets or returns an index of a single selected row. If multiple rows are selected, it returns an index of the first one. Selected index assumes new sorted row order the way it is viewed (not original order).
|
|
393
|
+
* To get/set one or more rows selection indexes and specify new or original sort order, use {@link Table#selection} method.
|
|
394
|
+
*
|
|
395
|
+
* @param {number} [index] - Index of the row to select. If index is not valid, it will have no effect.
|
|
396
|
+
* @returns {number|Table} When setting `index`, an instance of `this` Table is returned, otherwise a currently selected first row's index is returned, or -1 if no row is selected.
|
|
397
|
+
* @see Table#selection
|
|
398
|
+
* @see Table#selectAll
|
|
399
|
+
*/
|
|
400
|
+
selectedIndex(...args: any[]): number | Table;
|
|
401
|
+
/**
|
|
402
|
+
* Sets row filter expression which can be a combination of conditions similar to `if()` condition in JavaScript.
|
|
403
|
+
*
|
|
404
|
+
* Setting the filter hides rows that don't match specified filter criteria. When filter is set to "", filter gets cleared and all rows become visible again.
|
|
405
|
+
*
|
|
406
|
+
* - Filter format is in the form of IF condition: `"column(index) operator comparison_value"`.
|
|
407
|
+
* - Note that a column must be specified on the left side of the condition and comparison value on the right side.
|
|
408
|
+
* - Conditions can be combined using AND "&&", OR "||", and parentheses "( )".
|
|
409
|
+
* - Condition in parentheses can be negated by "!" before parentheses.
|
|
410
|
+
* - Valid operators are: `! ( ) < == != > && || regex`.
|
|
411
|
+
* - `comparison_value` can be a `number`, `string` value, `string` regular expression, or `boolean`.
|
|
412
|
+
*
|
|
413
|
+
* See examples below.
|
|
414
|
+
*
|
|
415
|
+
* @param {string} [filter] - Filter to use to display only rows that meet the specified conditions. Default is "" (no filter).
|
|
416
|
+
* @return {Table|string} Returns `this` Table when setting filter, otherwise returns current filter.
|
|
417
|
+
* @example
|
|
418
|
+
* // Using case-insensitive regular expression
|
|
419
|
+
* table.filter(`column(1) regex "(?i)^Jim.*"`);
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* // Filtering by numeric value
|
|
423
|
+
* table.filter("column(1) < 50");
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* // Filtering by date
|
|
427
|
+
* table.filter(`column(3) > "2023-04-01 00:00:00" && column(3) < "2024-05-30 00:00:00"`);
|
|
428
|
+
*
|
|
429
|
+
* @example
|
|
430
|
+
* // Filtering by a boolean for checkbox
|
|
431
|
+
* table.filter("column(4) != false");
|
|
432
|
+
*/
|
|
433
|
+
filter(...args: any[]): Table | string;
|
|
434
|
+
/**
|
|
435
|
+
* Finds rows by provided criteria and returns their indexes.
|
|
436
|
+
*
|
|
437
|
+
* @param {string} criteria] - Criteria expression to retrieve indexes or rows that meet the specified criteria. Learn more about filter expression in docs from {@link Table#filter} method.
|
|
438
|
+
* @param [new_order=false] - Boolean `true` to return the rows in the new sorted order or `false` for original order.
|
|
439
|
+
* @returns {number[]} Returns row indexes found by provided criteria.
|
|
440
|
+
*/
|
|
441
|
+
findRows(criteria: string, new_order?: boolean | undefined): number[];
|
|
442
|
+
/**
|
|
443
|
+
* Scrolls the vertical scroll bar to make sure the row at specified index is visible (only if the row is not visible). If position is specified, the row will be placed at the specified position between the top and bottom of the Table component.
|
|
444
|
+
*
|
|
445
|
+
* @param {number} index - Index of a table row to make visible.
|
|
446
|
+
* @param {boolean} [new_order=false] - Specifies if the `index` argument is based on a new sorted order (true) or not (false).
|
|
447
|
+
* @param {number} [position] - A decimal number between 0 and 1 indicating vertical position in percentages (0% - 100% of the height of the component). If omitted, the row will only become visible, but not at a specific location.
|
|
448
|
+
*/
|
|
449
|
+
scrollToIndex(index?: number, new_order?: boolean, position?: number): any;
|
|
450
|
+
/**
|
|
451
|
+
* Sets or gets selection mode, how user is able to select rows; only one at a time, any multiple rows, or only a range of rows.
|
|
452
|
+
* Default is "Table.Single".
|
|
453
|
+
*
|
|
454
|
+
* @param {SelectionMode} [mode] - One of: SelectionMode.Single (default), SelectionMode.Range, SelectionMode.Multiple. See {@link SelectionMode}.
|
|
455
|
+
* @return (SelectionMode|Table} When setting mode, an instance of `this` Table is returned, otherwise current mode is returned.
|
|
456
|
+
* @see SelectionMode
|
|
457
|
+
*/
|
|
458
|
+
selectionMode(...args: any[]): any;
|
|
459
|
+
/**
|
|
460
|
+
* Sets or gets a value in currently selected cell (row and column). Has no effect when setting a value but no cells are selected or more than one cell is selected.
|
|
461
|
+
*
|
|
462
|
+
* @param {string|number|boolean} [value] - Value to set to the cell. Omit to get the value instead of setting.
|
|
463
|
+
* @return {string|number|boolean|Table} When setting a value an instance of `this` Table is returned, otherwise a current value is returned.
|
|
464
|
+
*/
|
|
465
|
+
selectedValue(...args: any[]): string | number | boolean | Table;
|
|
466
|
+
/**
|
|
467
|
+
* Sets or gets a row and a column of selected cell.
|
|
468
|
+
*
|
|
469
|
+
* @param {number} [row] - Row of a cell. (Original order is used, sorting is disregarded.)
|
|
470
|
+
* @param {number} [column] - Column of a cell (required if row is specified). (Original order is used, column reordering is disregarded.)
|
|
471
|
+
* @return {number[]|Table} When both `row` and `cell` are passed, an instance of `this` Table is returned, otherwise a currently selected row and column is returned as an array of integers [row, column], or NULL if there is no selection.
|
|
472
|
+
*/
|
|
473
|
+
selectedCell(...args: any[]): number[] | Table;
|
|
474
|
+
/**
|
|
475
|
+
* Gets or sets the cell currently being edited.
|
|
476
|
+
* When `row` and `column` are provided and are valid, the specified cell enters edit mode.
|
|
477
|
+
* Pass `null` as a first argument to stop editing currently edited cell. Do it before reading data from the Table to make sure the cell editor commits it's new value to the Table's data.
|
|
478
|
+
* When called with no arguments, returns the cell currently being edited, or `null` if no cell is being edited.
|
|
479
|
+
*
|
|
480
|
+
* @param {number} [row] - Row index of the cell to edit, or `null` to stop editing currently edited cell (if any).
|
|
481
|
+
* @param {number} [column] - Column index of the cell to edit.
|
|
482
|
+
* @param {boolean} [new_order=false] - Specified if row and column should be interpreted as new index as displayed (after row sorting and column reordering) or not.
|
|
483
|
+
* @return {Cell|null|Table} When row and cell is specified, an instance of `this` Table is returned, otherwise a currently edited cell is retuned of `null` if no cell is being edited.
|
|
484
|
+
* @example <h2>Stop editing before reading Table data</h2>
|
|
485
|
+
* if(table.editingCell() != null) table.editingCell(null); // stop editing a cell to commit its changes
|
|
486
|
+
* const _rows = table.rows(); // read new data
|
|
487
|
+
*/
|
|
488
|
+
editingCell(...args: any[]): Cell | null | Table;
|
|
489
|
+
/**
|
|
490
|
+
* Sets or gets whether sorting can be toggled to unsorted state.
|
|
491
|
+
*
|
|
492
|
+
* @param {boolean} [enabled] - `true` to enable, `false` to disable. Omit to get current value.
|
|
493
|
+
* @return {boolean|Table} When setting, and instance of `this` Table is returned, otherwise a current value is returned.
|
|
494
|
+
*/
|
|
495
|
+
triStateSorting(...args: any[]): boolean | Table;
|
|
496
|
+
/**
|
|
497
|
+
* Enables or disables Table header. When it's disabled, it doesn't respond to user's interaction.
|
|
498
|
+
*
|
|
499
|
+
* @param {boolean} [enable] - `true` to enable, `false` to disable.
|
|
500
|
+
* @return {boolean|Table} When setting, and instance of `this` Table is returned, otherwise a current value is returned.
|
|
501
|
+
*/
|
|
502
|
+
headerEnabled(...args: any[]): boolean | Table;
|
|
503
|
+
/**
|
|
504
|
+
* Sets or gets a size (height) of Table header. Set it to 0 to make it not visible.
|
|
505
|
+
* @param {number} [size] - Height of table to set. Omit this argument to get current height.
|
|
506
|
+
* @return {number|Table} When setting, an instance of `this` Table is returned, otherwise a current value is returned.
|
|
507
|
+
*/
|
|
508
|
+
headerSize(...args: any[]): number | Table;
|
|
509
|
+
/**
|
|
510
|
+
* Gets or sets which grid lines are visible (horizontal, vertical, both, or none).
|
|
511
|
+
*
|
|
512
|
+
* @param {Table.GridLines} [value] - One of: Table.GridLines.None, Table.GridLines.Horizontal, Table.GridLines.Vertical, Table.GridLines.Both (default). See {@link Table#GridLines}.
|
|
513
|
+
* @return {Table.GridLines|Table} Returns the current value if no parameter is provided; otherwise, returns the Table instance for chaining.
|
|
514
|
+
* @see Table#GridLines
|
|
515
|
+
*/
|
|
516
|
+
gridLines(...args: any[]): Readonly<{
|
|
517
|
+
None: 0;
|
|
518
|
+
Horizontal: 1;
|
|
519
|
+
Vertical: 2;
|
|
520
|
+
Both: 3;
|
|
521
|
+
}> | Table;
|
|
522
|
+
/**
|
|
523
|
+
* Gets or sets the color of the table's grid lines.
|
|
524
|
+
* Note: This only has an effect if grid lines are enabled.
|
|
525
|
+
*
|
|
526
|
+
* @param {string} [color] - A valid CSS color string (e.g., "#000000" for black).
|
|
527
|
+
* @return {string|Table} Returns the current value if no parameter is provided; otherwise, returns the Table instance for chaining.
|
|
528
|
+
* @example
|
|
529
|
+
* // Set the grid line color
|
|
530
|
+
* table.gridColor("#000000");
|
|
531
|
+
*
|
|
532
|
+
* // Get the current grid line color
|
|
533
|
+
* alert(table.gridColor());
|
|
534
|
+
*/
|
|
535
|
+
gridColor(...args: any[]): string | Table;
|
|
536
|
+
/**
|
|
537
|
+
* Sets or gets a value at a specified row and column. Returns `undefined` if specified row or column doesn't exist.
|
|
538
|
+
*
|
|
539
|
+
* @param {number} row - Index of the row in question
|
|
540
|
+
* @param {number} column - Index of the column in question
|
|
541
|
+
* @param {boolean} [new_order] - To use the new sorted order of rows and columns or not
|
|
542
|
+
* @param {string|number|boolean} [value] - The value to set the specified cell
|
|
543
|
+
* @return {string|number|boolean|Table} Returns the current cell value if new value is provided by `value` parameter; otherwise, returns the Table instance for chaining.
|
|
544
|
+
*/
|
|
545
|
+
valueAt(row: number, column: number, new_order?: boolean, ...args: any[]): string | number | boolean | Table;
|
|
546
|
+
/**
|
|
547
|
+
* Returns the bounds of a table cell, position relative to the Table, position relative to screen, and the size.
|
|
548
|
+
*
|
|
549
|
+
* @param {number} row Zero-based row index.
|
|
550
|
+
* @param {number} column Zero-based column index.
|
|
551
|
+
* @param {boolean} [new_order=false] If `true`, the row and column indexes are interpreted using the current display order after sorting or column reordering. If `false`, the original model indexes are used.
|
|
552
|
+
* @returns {{x: number, y: number, screenX: number, screenY: number, width: number, height: number}} An object containing the cell's size in pixels, position relative to the table's client area, and position relative to screen.
|
|
553
|
+
* @example <h2>Getting cell bounds</h2>
|
|
554
|
+
* const bound = myTable.cellBounds(0, 0);
|
|
555
|
+
* console.log(bounds);
|
|
556
|
+
*
|
|
557
|
+
* // result is something like this
|
|
558
|
+
* {
|
|
559
|
+
* width: 20,
|
|
560
|
+
* height: 20,
|
|
561
|
+
* x: 1,
|
|
562
|
+
* y: 28,
|
|
563
|
+
* screenX: 437,
|
|
564
|
+
* screenY: 334
|
|
565
|
+
* }
|
|
566
|
+
*/
|
|
567
|
+
cellBounds(row: number, column: number, new_order?: boolean): {
|
|
568
|
+
x: number;
|
|
569
|
+
y: number;
|
|
570
|
+
screenX: number;
|
|
571
|
+
screenY: number;
|
|
572
|
+
width: number;
|
|
573
|
+
height: number;
|
|
574
|
+
};
|
|
575
|
+
/**
|
|
576
|
+
* Gets a cell [row,column] located at specified X and Y coordinates relative to the Table's top-left corner.
|
|
577
|
+
*
|
|
578
|
+
* @param {number} x - X
|
|
579
|
+
* @param {number} y - Y
|
|
580
|
+
* @return {Cell|null} Returns the cell, or `null` if the coordinates are outside any cell.
|
|
581
|
+
*/
|
|
582
|
+
cellAt(x: number, y: number): Cell | null;
|
|
583
|
+
/**
|
|
584
|
+
* Sets or gets how many quick mouse clicks on editable cells are required to change the cell to editing mode.
|
|
585
|
+
*
|
|
586
|
+
* @param {number} [clicks] - Amount of clicks: 1, 2, or 3. Default is 2 (double-click).
|
|
587
|
+
* @return {number|Table} Returns the current value if no parameters are provided; otherwise, and instance of `this` Table is returned.
|
|
588
|
+
*/
|
|
589
|
+
clicksToEdit(...args: any[]): number | Table;
|
|
590
|
+
/**
|
|
591
|
+
* Gets, registers or unregisters a column event handler function. This event handler is called when a column is inserted, removed, resized, or moved (reordered).
|
|
592
|
+
*
|
|
593
|
+
* @param {function(ColumnEvent): any} [callback] - The event handler function. Receives a {@link ColumnEvent} formatted object.
|
|
594
|
+
* @param {boolean} [remove=false] - Set to `true` to unregister the event handler.
|
|
595
|
+
* @returns {Table|function[]} An array of handler functions if no arguments are passed, otherwise `this` component for method chaining.
|
|
596
|
+
* @see ColumnEvent
|
|
597
|
+
* @see Table
|
|
598
|
+
* @example
|
|
599
|
+
* // Example event object:
|
|
600
|
+
* const e = {
|
|
601
|
+
* target: Table, // The Table component that triggered the event.
|
|
602
|
+
* type: string, // "insert", "remove", "move", "resize".
|
|
603
|
+
* index: number // Only when type is "insert", "remove", or "resize". Index of the column.
|
|
604
|
+
* fromIndex: number, // Only when type is "move". Indicates the previous index of the column.
|
|
605
|
+
* toIndex: number, // Only when type is "move". Indicates the new index of the column.
|
|
606
|
+
* fromSize: number, // Only when type is "resize". Indicates the previous size of the column.
|
|
607
|
+
* toSize: number, // Only when type is "resize". Indicates the new size of the column.
|
|
608
|
+
* interactive: boolean // `true` when column was moved by the user interacting with the GUI. `false` when it was made programmatically.
|
|
609
|
+
* };
|
|
610
|
+
*/
|
|
611
|
+
onColumnEvents(callback?: (arg0: ColumnEvent) => any, ...args: any[]): Table | Function[];
|
|
612
|
+
/**
|
|
613
|
+
* Gets, registers or unregisters a row event handler function. This event handler is called when rows are inserted, removed, or cell value was updated (also check out onChange() event handler for to simply detect a cell value change).
|
|
614
|
+
*
|
|
615
|
+
* @param {function(RowEvent): any} [callback] - The event handler function. Receives an {@link RowEvent} formatted object.
|
|
616
|
+
* @param {boolean} [remove=false] - Set to `true` to unregister the event handler.
|
|
617
|
+
* @returns {Table|function[]} An array of handler functions if no arguments are passed, otherwise `this` component for method chaining.
|
|
618
|
+
* @see RowEvent
|
|
619
|
+
* @example
|
|
620
|
+
* // Example event object:
|
|
621
|
+
* const e = {
|
|
622
|
+
* target: object, // The Table component that triggered the event.
|
|
623
|
+
* type: string, // "insert", "remove", "update".
|
|
624
|
+
* row: number, // Only when one row was effected. Index of the row.
|
|
625
|
+
* column: number // Only when type is "update". Column index of effected cell. Value of -1 means that all columns were effected.
|
|
626
|
+
* fromRow: number // Only when multiple rows were effected. Indicates beginning index within the range of effected rows.
|
|
627
|
+
* toRow: number // Only when multiple rows were effected. Indicates the last index within the range of effected rows.
|
|
628
|
+
* interactive: boolean // Only when type is "update". `true` when update was made by the user interacting with the GUI. `false` when update was made programmatically.
|
|
629
|
+
* };
|
|
630
|
+
*/
|
|
631
|
+
onRowEvents(callback?: (arg0: RowEvent) => any, ...args: any[]): Table | Function[];
|
|
632
|
+
/**
|
|
633
|
+
* Gets, registers or unregisters an event handler function for column sorting event. This event handler is called when a column is sorted by user or programmatically.
|
|
634
|
+
*
|
|
635
|
+
* @param {function(Object): any} [callback] - The event handler function. Receives a {@link SortEvent} formatted object.
|
|
636
|
+
* @param {boolean} [remove=false] - Set to `true` to unregister the event handler.
|
|
637
|
+
* @returns {Table|function[]} An array of handler functions if no arguments are passed, otherwise `this` component for method chaining.
|
|
638
|
+
* @see SortEvent
|
|
639
|
+
*
|
|
640
|
+
* @example
|
|
641
|
+
* // Example SortEvent object:
|
|
642
|
+
* const e = {
|
|
643
|
+
* target: Table, // The Table component that triggered the event.
|
|
644
|
+
* type: Table.SortOrder, // Table.SortOrder.None, Table.SortOrder.Ascending, or Table.SortOrder.Descending.
|
|
645
|
+
* column: number // Only when type is not Table.SortOrder.None. Column index.
|
|
646
|
+
* newOrderColumn: number // Only when type is not Table.SortOrder.None. New column index, taking into account that columns may be re-ordered.
|
|
647
|
+
* interactive: boolean // `true` when sorting was made by the user interacting with the GUI. `false` when it was made programmatically.
|
|
648
|
+
* };
|
|
649
|
+
*/
|
|
650
|
+
onSort(callback?: (arg0: Object) => any, ...args: any[]): Table | Function[];
|
|
651
|
+
}
|
|
652
|
+
import { ScrollableComponent } from "./ScrollableComponent.js";
|