@gridkitjs/react 0.16.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 +20 -9
- package/dist/index.js +356 -254
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -144,7 +144,10 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
144
144
|
getSelectedRows(): readonly ResolvedRow<Row>[];
|
|
145
145
|
getColumnSelection(): SelectionState;
|
|
146
146
|
getCellSelection(): CellSelectionState;
|
|
147
|
-
/**
|
|
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
|
+
*/
|
|
148
151
|
getFocusedCell(): {
|
|
149
152
|
rowIndex: number;
|
|
150
153
|
columnIndex: number;
|
|
@@ -162,6 +165,12 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
162
165
|
* grid re-renders once.
|
|
163
166
|
*/
|
|
164
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
|
+
*/
|
|
165
174
|
focusCell(rowIndex: number, columnIndex: number): void;
|
|
166
175
|
clearSelection(): void;
|
|
167
176
|
selectAllRows(): void;
|
|
@@ -174,7 +183,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
174
183
|
selectRows(rowIds: readonly string[], intent?: "replace" | "toggle"): void;
|
|
175
184
|
/** Expands every group at once, as the `group.expandAll` command does. */
|
|
176
185
|
expandAllGroups(): void;
|
|
177
|
-
/** 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. */
|
|
178
187
|
collapseAllGroups(): void;
|
|
179
188
|
/** Moves to the given page, clamped into range. */
|
|
180
189
|
goToPage(pageIndex: number): void;
|
|
@@ -210,7 +219,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
210
219
|
setColumnSort(sort: ColumnSortState): void;
|
|
211
220
|
/** Replaces the group-by stack. Reports through `onGroupByChange`. */
|
|
212
221
|
setGroupBy(groupBy: GroupByState): void;
|
|
213
|
-
/** Replaces the
|
|
222
|
+
/** Replaces the group expansion. Reports through `onGroupExpansionChange` with `groupId: null`, and nothing for an equal expansion. */
|
|
214
223
|
setGroupExpansion(expansion: GroupExpansionState): void;
|
|
215
224
|
/** Replaces the page and page size as given. Reports through `onPaginationChange`. */
|
|
216
225
|
setPagination(pagination: PaginationState): void;
|
|
@@ -315,9 +324,11 @@ interface InfiniteScrollConfig {
|
|
|
315
324
|
/** Whether a further `onLoadMore` could still return more rows. `false` removes the sentinel entirely, so no further scrolling can trigger a load. */
|
|
316
325
|
readonly hasMore: boolean;
|
|
317
326
|
/**
|
|
318
|
-
* Called
|
|
319
|
-
*
|
|
320
|
-
*
|
|
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.
|
|
321
332
|
*/
|
|
322
333
|
readonly onLoadMore: () => void;
|
|
323
334
|
/** Whether a load triggered by `onLoadMore` is still in flight. Suppresses further calls to it until this goes back to `false`. */
|
|
@@ -395,14 +406,14 @@ interface GroupByStateApi {
|
|
|
395
406
|
* outside the grid's own DOM.
|
|
396
407
|
*
|
|
397
408
|
* The ref's `setGroupBy` and `setGroupExpansion` change the grouping and the
|
|
398
|
-
*
|
|
409
|
+
* group expansion for a custom group-by UI; this hook carries only the
|
|
399
410
|
* all-at-once expansion actions. A specific
|
|
400
411
|
* group's own computed aggregates are read off `getDisplayRows()`'s
|
|
401
412
|
* per-header `aggregates` field instead of a getter here — see
|
|
402
413
|
* `useAggregateState` for the grand-total equivalent.
|
|
403
414
|
*
|
|
404
|
-
* Before the grid mounts,
|
|
405
|
-
* no-ops.
|
|
415
|
+
* Before the grid mounts, `groupBy` reads as empty, `groupExpansion` as
|
|
416
|
+
* `ALL_EXPANDED`, and the actions are no-ops.
|
|
406
417
|
*/
|
|
407
418
|
declare function useGroupByState<Row>(gridRef: RefObject<DataGridApi<Row> | null>): GroupByStateApi;
|
|
408
419
|
|