@gridkitjs/react 0.15.0 → 0.17.0
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/dist/index.d.ts +28 -16
- package/dist/index.js +864 -555
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -22,14 +22,15 @@ interface GridExportApi {
|
|
|
22
22
|
interface GridPanelApi {
|
|
23
23
|
/**
|
|
24
24
|
* Opens the column chooser at the grid's top-end corner, in place of any
|
|
25
|
-
* panel open; it gives focus back to what had it when it
|
|
25
|
+
* panel or context menu open; it gives focus back to what had it when it
|
|
26
|
+
* closes.
|
|
26
27
|
*/
|
|
27
28
|
openColumnChooser(): void;
|
|
28
29
|
/**
|
|
29
30
|
* Opens the filter menu of the column `columnId` below its header, in
|
|
30
|
-
* place of any panel open, and says whether it opened:
|
|
31
|
-
* with no filter menu, nor one not shown. It gives focus
|
|
32
|
-
* header when it closes.
|
|
31
|
+
* place of any panel or context menu open, and says whether it opened:
|
|
32
|
+
* not for a column with no filter menu, nor one not shown. It gives focus
|
|
33
|
+
* back to the header when it closes.
|
|
33
34
|
*/
|
|
34
35
|
openFilterMenu(columnId: string): boolean;
|
|
35
36
|
/** Closes the filter menu, if one is open, leaving any other panel open. */
|
|
@@ -143,7 +144,10 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
143
144
|
getSelectedRows(): readonly ResolvedRow<Row>[];
|
|
144
145
|
getColumnSelection(): SelectionState;
|
|
145
146
|
getCellSelection(): CellSelectionState;
|
|
146
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* The cell currently holding the grid's single tab stop, numbered as
|
|
149
|
+
* `focusCell` takes it: `rowIndex` is `-1` on the header.
|
|
150
|
+
*/
|
|
147
151
|
getFocusedCell(): {
|
|
148
152
|
rowIndex: number;
|
|
149
153
|
columnIndex: number;
|
|
@@ -161,6 +165,12 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
161
165
|
* grid re-renders once.
|
|
162
166
|
*/
|
|
163
167
|
restoreState(saved: Partial<GridState<Row>> | Partial<SerializedGridState<Row>>): void;
|
|
168
|
+
/**
|
|
169
|
+
* Moves the grid's tab stop, and the browser's focus, to body row
|
|
170
|
+
* `rowIndex`'s cell at `columnIndex`, or to the header's cell at
|
|
171
|
+
* `columnIndex` when `rowIndex` is negative. Either index is held inside
|
|
172
|
+
* the grid.
|
|
173
|
+
*/
|
|
164
174
|
focusCell(rowIndex: number, columnIndex: number): void;
|
|
165
175
|
clearSelection(): void;
|
|
166
176
|
selectAllRows(): void;
|
|
@@ -173,7 +183,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
173
183
|
selectRows(rowIds: readonly string[], intent?: "replace" | "toggle"): void;
|
|
174
184
|
/** Expands every group at once, as the `group.expandAll` command does. */
|
|
175
185
|
expandAllGroups(): void;
|
|
176
|
-
/** Collapses every group
|
|
186
|
+
/** Collapses every group at once, as the `group.collapseAll` command does — one nested under a collapsed group, and one that appears later, too. */
|
|
177
187
|
collapseAllGroups(): void;
|
|
178
188
|
/** Moves to the given page, clamped into range. */
|
|
179
189
|
goToPage(pageIndex: number): void;
|
|
@@ -209,7 +219,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
209
219
|
setColumnSort(sort: ColumnSortState): void;
|
|
210
220
|
/** Replaces the group-by stack. Reports through `onGroupByChange`. */
|
|
211
221
|
setGroupBy(groupBy: GroupByState): void;
|
|
212
|
-
/** Replaces the
|
|
222
|
+
/** Replaces the group expansion. Reports through `onGroupExpansionChange` with `groupId: null`, and nothing for an equal expansion. */
|
|
213
223
|
setGroupExpansion(expansion: GroupExpansionState): void;
|
|
214
224
|
/** Replaces the page and page size as given. Reports through `onPaginationChange`. */
|
|
215
225
|
setPagination(pagination: PaginationState): void;
|
|
@@ -239,9 +249,9 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
239
249
|
/**
|
|
240
250
|
* Opens the context menu `target` has, as a right-click there would —
|
|
241
251
|
* selecting it and focusing its cell first — beside `anchor`, a point in
|
|
242
|
-
* viewport coordinates or an element, or else below its cell
|
|
243
|
-
* it opened: not for a target not on screen,
|
|
244
|
-
* gives no menu.
|
|
252
|
+
* viewport coordinates or an element, or else below its cell, in place of
|
|
253
|
+
* any panel open. Says whether it opened: not for a target not on screen,
|
|
254
|
+
* nor where `contextMenu` gives no menu.
|
|
245
255
|
*/
|
|
246
256
|
openContextMenu(target: GridContextMenuTarget, anchor?: {
|
|
247
257
|
readonly x: number;
|
|
@@ -314,9 +324,11 @@ interface InfiniteScrollConfig {
|
|
|
314
324
|
/** Whether a further `onLoadMore` could still return more rows. `false` removes the sentinel entirely, so no further scrolling can trigger a load. */
|
|
315
325
|
readonly hasMore: boolean;
|
|
316
326
|
/**
|
|
317
|
-
* Called
|
|
318
|
-
*
|
|
319
|
-
*
|
|
327
|
+
* Called when the sentinel comes within `rootMargin` of the body's
|
|
328
|
+
* viewport, then not again until one of these says the request was
|
|
329
|
+
* answered: `isLoadingMore` goes back to `false`, `hasMore` changes, the
|
|
330
|
+
* sentinel leaves range and comes back, or rows appended while
|
|
331
|
+
* `isLoadingMore` never read `true` move the sentinel down.
|
|
320
332
|
*/
|
|
321
333
|
readonly onLoadMore: () => void;
|
|
322
334
|
/** Whether a load triggered by `onLoadMore` is still in flight. Suppresses further calls to it until this goes back to `false`. */
|
|
@@ -394,14 +406,14 @@ interface GroupByStateApi {
|
|
|
394
406
|
* outside the grid's own DOM.
|
|
395
407
|
*
|
|
396
408
|
* The ref's `setGroupBy` and `setGroupExpansion` change the grouping and the
|
|
397
|
-
*
|
|
409
|
+
* group expansion for a custom group-by UI; this hook carries only the
|
|
398
410
|
* all-at-once expansion actions. A specific
|
|
399
411
|
* group's own computed aggregates are read off `getDisplayRows()`'s
|
|
400
412
|
* per-header `aggregates` field instead of a getter here — see
|
|
401
413
|
* `useAggregateState` for the grand-total equivalent.
|
|
402
414
|
*
|
|
403
|
-
* Before the grid mounts,
|
|
404
|
-
* no-ops.
|
|
415
|
+
* Before the grid mounts, `groupBy` reads as empty, `groupExpansion` as
|
|
416
|
+
* `ALL_EXPANDED`, and the actions are no-ops.
|
|
405
417
|
*/
|
|
406
418
|
declare function useGroupByState<Row>(gridRef: RefObject<DataGridApi<Row> | null>): GroupByStateApi;
|
|
407
419
|
|