-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
gridEvents.ts
364 lines (361 loc) · 10.3 KB
/
gridEvents.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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
import { GridEventLookup } from './gridEventLookup';
enum GridEvents {
/**
* Fired when the grid is resized.
*/
resize = 'resize',
/**
* Fired when the grid is resized with a debounced time of 60ms.
*/
debouncedResize = 'debouncedResize',
/**
* Fired when the inner size of the viewport changes. Called with an [[ElementSize]] object.
*/
viewportInnerSizeChange = 'viewportInnerSizeChange',
/**
* Fired when an exception is thrown in the grid.
*/
componentError = 'componentError',
/**
* Fired when the grid is unmounted.
*/
unmount = 'unmount',
/**
* Fired when the mode of a cell changes.
* @ignore - do not document
*/
cellModeChange = 'cellModeChange',
/**
* Fired when a cell is clicked.
*/
cellClick = 'cellClick',
/**
* Fired when a cell is double-clicked.
*/
cellDoubleClick = 'cellDoubleClick',
/**
* Fired when a `mousedown` event happens in a cell.
*/
cellMouseDown = 'cellMouseDown',
/**
* Fired when a `mouseup` event happens in a cell.
*/
cellMouseUp = 'cellMouseUp',
/**
* Fired when a `keydown` event happens in a cell.
*/
cellKeyDown = 'cellKeyDown',
/**
* Fired when a cell gains focus.
*/
cellFocusIn = 'cellFocusIn',
/**
* Fired when a cell loses focus.
*/
cellFocusOut = 'cellFocusOut',
/**
* Fired when the dragged cell enters a valid drop target. It's mapped to the `dragend` DOM event.
* @ignore - do not document.
*/
cellDragEnter = 'cellDragEnter',
/**
* Fired while an element or text selection is dragged over the cell.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
cellDragOver = 'cellDragOver',
/**
* Fired when the props of the edit cell changes.
*/
editCellPropsChange = 'editCellPropsChange',
/**
* Fired when the props of the edit input are committed.
*/
cellEditCommit = 'cellEditCommit',
/**
* Fired when the cell turns to edit mode.
*/
cellEditStart = 'cellEditStart',
/**
* Fired when the cell turns back to view mode.
*/
cellEditStop = 'cellEditStop',
/**
* Fired when the row turns to edit mode.
*/
rowEditStart = 'rowEditStart',
/**
* Fired when the row turns back to view mode.
*/
rowEditStop = 'rowEditStop',
/**
* Fired when the props of the edit input are committed.
*/
rowEditCommit = 'rowEditCommit',
/**
* Fired when a [navigation key](/x/react-data-grid/accessibility#keyboard-navigation) is pressed in a cell.
* @ignore - do not document.
*/
cellNavigationKeyDown = 'cellNavigationKeyDown',
/**
* Fired when a row is clicked.
* Not fired if the cell clicked is from an interactive column (actions, checkbox, etc).
*/
rowClick = 'rowClick',
/**
* Fired when a row is double-clicked.
*/
rowDoubleClick = 'rowDoubleClick',
/**
* Fired when the mouse enters the row. Called with a [[GridRowParams]] object.
*/
rowMouseEnter = 'rowMouseEnter',
/**
* Fired when the mouse leaves the row. Called with a [[GridRowParams]] object.
*/
rowMouseLeave = 'rowMouseLeave',
/**
* Fired when the row editing model changes.
*/
editRowsModelChange = 'editRowsModelChange',
/**
* Fired when the user starts dragging a row. It's mapped to the `dragstart` DOM event.
* @ignore - do not document.
*/
rowDragStart = 'rowDragStart',
/**
* Fired while an element or text selection is dragged over the row.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
rowDragOver = 'rowDragOver',
/**
* Fired when the dragging of a row ends.
* @ignore - do not document.
*/
rowDragEnd = 'rowDragEnd',
/**
* Fired when a column header loses focus.
* @ignore - do not document.
*/
columnHeaderBlur = 'columnHeaderBlur',
/**
* Fired when a column header gains focus.
* @ignore - do not document.
*/
columnHeaderFocus = 'columnHeaderFocus',
/**
* Fired when a [navigation key](/x/react-data-grid/accessibility#keyboard-navigation) is pressed in a column header.
* @ignore - do not document.
*/
columnHeaderNavigationKeyDown = 'columnHeaderNavigationKeyDown',
/**
* Fired when a key is pressed in a column header. It's mapped do the `keydown` DOM event.
*/
columnHeaderKeyDown = 'columnHeaderKeyDown',
/**
* Fired when a column header is clicked
*/
columnHeaderClick = 'columnHeaderClick',
/**
* Fired when a column header is double-clicked.
*/
columnHeaderDoubleClick = 'columnHeaderDoubleClick',
/**
* Fired when a `mouseover` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderOver = 'columnHeaderOver',
/**
* Fired when a `mouseout` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderOut = 'columnHeaderOut',
/**
* Fired when a `mouseenter` event happens in a column header.
* @ignore - do not document.
*/
columnHeaderEnter = 'columnHeaderEnter',
/**
* Fired when a `mouseleave` event happens in a column header.
* @ignore - do not document.*
*/
columnHeaderLeave = 'columnHeaderLeave',
/**
* Fired when the user starts dragging a column header. It's mapped to the `dragstart` DOM event.
* @ignore - do not document.
*/
columnHeaderDragStart = 'columnHeaderDragStart',
/**
* Fired while an element or text selection is dragged over the column header.
* It's mapped to the `dragover` DOM event.
* @ignore - do not document.
*/
columnHeaderDragOver = 'columnHeaderDragOver',
/**
* Fired when the dragged column header enters a valid drop target.
* It's mapped to the `dragend` DOM event.
* @ignore - do not document.
*/
columnHeaderDragEnter = 'columnHeaderDragEnter',
/**
* Fired when the dragging of a column header ends.
* @ignore - do not document.
*/
columnHeaderDragEnd = 'columnHeaderDragEnd',
/**
* Fired when the selection state of one or multiple rows changes.
*/
selectionChange = 'selectionChange',
/**
* Fired when the value of the selection checkbox of the header is changed
*/
headerSelectionCheckboxChange = 'headerSelectionCheckboxChange',
/**
* Fired when the value of the selection checkbox of a row is changed
*/
rowSelectionCheckboxChange = 'rowSelectionCheckboxChange',
/**
* Fired when the page changes.
*/
pageChange = 'pageChange',
/**
* Fired when the page size changes.
*/
pageSizeChange = 'pageSizeChange',
/**
* Fired when the row grouping model changes.
*/
rowGroupingModelChange = 'rowGroupingModelChange',
/**
* Fired during the scroll of the grid viewport.
*/
rowsScroll = 'rowsScroll',
/**
* Fired when scrolling to the bottom of the grid viewport.
*/
rowsScrollEnd = 'rowsScrollEnd',
/**
* Fired when a `mousedown` DOM event happens in the column header separator.
* @ignore - do not document.
*/
columnSeparatorMouseDown = 'columnSeparatorMouseDown',
/**
* Fired during the resizing of a column.
*/
columnResize = 'columnResize',
/**
* Fired when the width of a column is changed.
*/
columnWidthChange = 'columnWidthChange',
/**
* Fired when the user starts resizing a column.
*/
columnResizeStart = 'columnResizeStart',
/**
* Fired when the user stops resizing a column.
*/
columnResizeStop = 'columnResizeStop',
/**
* Fired when the user ends reordering a column.
*/
columnOrderChange = 'columnOrderChange',
/**
* Fired when the user ends reordering a row.
*/
rowOrderChange = 'rowOrderChange',
/**
* Fired when the rows are updated.
* @ignore - do not document.
*/
rowsSet = 'rowsSet',
/**
* Fired when the expansion of a row is changed. Called with a [[GridRowTreeNodeConfig]] object.
* @ignore - do not document.
*/
rowExpansionChange = 'rowExpansionChange',
/**
* Fired when the sorted rows are updated
* @ignore - do not document
*/
sortedRowsSet = 'sortedRowsSet',
/**
* Fired when the filtered rows are updated
* @ignore - do not document.
*/
filteredRowsSet = 'filteredRowsSet',
/**
* Fired when the columns state is changed.
*/
columnsChange = 'columnsChange',
/**
* Fired when the open detail panels are changed.
* @ignore - do not document.
*/
detailPanelsExpandedRowIdsChange = 'detailPanelsExpandedRowIdsChange',
/**
* Fired when the pinned columns is changed.
* @ignore - do not document.
*/
pinnedColumnsChange = 'pinnedColumnsChange',
/**
* Fired when a processor of the active strategy changes.
* @ignore - do not document.
*/
activeStrategyProcessorChange = 'activeStrategyProcessorChange',
/**
* Fired when the callback to decide if a strategy is available or not changes.
* @ignore - do not document.
*/
strategyAvailabilityChange = 'strategyAvailabilityChange',
/**
* Fired when the sort model changes.
*/
sortModelChange = 'sortModelChange',
/**
* Fired when the filter model changes.
*/
filterModelChange = 'filterModelChange',
/**
* Fired when the column visibility model changes.
*/
columnVisibilityModelChange = 'columnVisibilityModelChange',
/**
* Fired when the state of the grid is updated.
*/
stateChange = 'stateChange',
/**
* Fired when a column visibility changes.
* It is not fired when the `columnVisibilityModel` is controlled or initialized.
* It is not fired when toggling all column's visibility at once.
* @deprecated Use `GridEvents.columnVisibilityModelChange` instead.
*/
columnVisibilityChange = 'columnVisibilityChange',
/**
* Fired when the content size used by the `GridVirtualScroller` changes.
* @ignore - do not document.
*/
virtualScrollerContentSizeChange = 'virtualScrollerContentSizeChange',
/**
* Fired when the content is scrolled by the mouse wheel.
* It's attached to the "mousewheel" event.
* @ignore - do not document.
*/
virtualScrollerWheel = 'virtualScrollerWheel',
/**
* Fired when the content is moved using a touch device.
* It's attached to the "touchmove" event.
* @ignore - do not document.
*/
virtualScrollerTouchMove = 'virtualScrollerTouchMove',
/**
* Fired when the preferences panel is closed.
*/
preferencePanelClose = 'preferencePanelClose',
/**
* Fired when the preferences panel is opened.
*/
preferencePanelOpen = 'preferencePanelOpen',
}
export type GridEventsStr = keyof GridEventLookup;
export { GridEvents };