@gridkitjs/react 0.17.0 → 0.18.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, Ref, RefObject } from 'react';
3
- import { ExportWriter, GridExportOptions, PrintOptions, CellSelectEvent as CellSelectEvent$1, CellSelectionChangeEvent as CellSelectionChangeEvent$1, ColumnDefinition as ColumnDefinition$1, ColumnSelectEvent as ColumnSelectEvent$1, ColumnSelectionChangeEvent as ColumnSelectionChangeEvent$1, ColumnsSelectEvent as ColumnsSelectEvent$1, DataColumn as DataColumn$1, GridOptions, PaginationState, SelectionCallbacks as SelectionCallbacks$1, ResolvedRow, DisplayRow, ResolvedColumn as ResolvedColumn$1, ColumnSizingState, ColumnOrderState, ColumnVisibilityState, ColumnSortState, FilterState, GroupByState, GroupExpansionState, AggregateResults, SelectionState, CellSelectionState, GridState, SerializedGridState, GridContextMenuTarget, GridCommandTarget, SelectedCell as SelectedCell$1, SelectedColumn as SelectedColumn$1 } from '@gridkitjs/core';
4
- export { Borders, CellSelectionMode, CellSelectionState, CellTemplateContext, ColumnResizeEvent, ColumnSizeDefaults, ColumnSizingState, ColumnVisibilityEvent, ColumnVisibilityState, ContextMenuOpenChangeEvent, ExportFile, ExportOptions, ExportWriter, FilterChangeEvent, FilterEntry, FilterState, GridCommand, GridCommandEvent, GridCommandTarget, GridContextMenuOptions, GridContextMenuRequest, GridContextMenuTarget, GridExportOptions, GridMessages, GridOptions, GridState, GridToolbarOptions, GroupByBarVisibility, HoverableConfig, MenuEntry, PaginationUnit, PrintOptions, ResizeMode, ResolvedRow, RowPointerEvent, RowProps, RowSelectEvent, RowSelectionChangeEvent, RowsSelectEvent, SelectableConfig, SelectedCellRef, SelectionMode, SelectionState, SerializedGridState, ToolbarEntry, ToolbarItemAttributes, excelFilter, serializeGridState } from '@gridkitjs/core';
3
+ import { ExportWriter, GridExportOptions, PrintOptions, CellSelectEvent as CellSelectEvent$1, CellSelectionChangeEvent as CellSelectionChangeEvent$1, ColumnDefinition as ColumnDefinition$1, ColumnSelectEvent as ColumnSelectEvent$1, ColumnSelectionChangeEvent as ColumnSelectionChangeEvent$1, ColumnsSelectEvent as ColumnsSelectEvent$1, DataColumn as DataColumn$1, GridOptions, PaginationState, SelectionCallbacks as SelectionCallbacks$1, ResolvedRow, DisplayRow, ResolvedColumn as ResolvedColumn$1, ColumnSizingState, ColumnOrderState, ColumnVisibilityState, ColumnSortState, FilterState, GroupByState, GroupExpansionState, AggregateResults, SelectionState, CellSelectionState, GridFocus, GridState, SerializedGridState, GridContextMenuTarget, GridCommandTarget, SelectedCell as SelectedCell$1, SelectedColumn as SelectedColumn$1 } from '@gridkitjs/core';
4
+ export { AggregateFn, AggregateResults, AggregateSpec, AggregateState, Borders, BuiltInAggregate, CellSelectionMode, CellSelectionState, CellTemplateContext, ColumnAlignment, ColumnFilterMenuOptions, ColumnOrderEvent, ColumnOrderState, ColumnResizeEvent, ColumnSizeDefaults, ColumnSizingState, ColumnSortEntry, ColumnSortEvent, ColumnSortState, ColumnType, ColumnVisibilityEvent, ColumnVisibilityState, ColumnWrapConfig, ContextMenuOpenChangeEvent, DisplayRow, ExportFile, ExportOptions, ExportScalar, ExportWriter, FieldPath, FilterChangeEvent, FilterEntry, FilterState, FooterTemplateContext, FormatLocale, GridCommand, GridCommandEvent, GridCommandTarget, GridContextMenuOptions, GridContextMenuRequest, GridContextMenuTarget, GridExportOptions, GridFilterMenuOptions, GridFocus, GridMessages, GridOptions, GridState, GridToolbarOptions, GroupAggregateDisplay, GroupByBarVisibility, GroupByEntry, GroupByEvent, GroupByState, GroupExpansionEvent, GroupExpansionState, HoverableConfig, MenuEntry, PaginationChangeEvent, PaginationState, PaginationUnit, PrintOptions, ResizeMode, ResolvedGroupRow, ResolvedGroupSummaryRow, ResolvedRow, RowPointerEvent, RowProps, RowSelectEvent, RowSelectionChangeEvent, RowsSelectEvent, SelectableConfig, SelectedCellRef, SelectionMode, SelectionState, SerializedGridState, SortDirection, ToolbarEntry, ToolbarItemAttributes, excelFilter, serializeGridState } from '@gridkitjs/core';
5
5
 
6
6
  /** What `DataGridApi` carries for exporting. */
7
7
  interface GridExportApi {
@@ -145,13 +145,10 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
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.
148
+ * The cell currently holding the grid's single tab stop, in the shape
149
+ * `focusCell` takes. Returns the same object until the focus moves.
150
150
  */
151
- getFocusedCell(): {
152
- rowIndex: number;
153
- columnIndex: number;
154
- };
151
+ getFocusedCell(): GridFocus;
155
152
  /**
156
153
  * Every slice of state as the grid applies it, in one object — what
157
154
  * `restoreState` takes back. Pass it through `serializeGridState` before
@@ -162,16 +159,17 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
162
159
  * Puts back state saved earlier, whole or in part — from `getState()`, or
163
160
  * from `serializeGridState` and back through JSON. Each slice given is set
164
161
  * as its setter would set it, firing its callback when it changes; the
165
- * grid re-renders once.
162
+ * grid re-renders once. Saved state is read by its `version`; one without
163
+ * a version, saved by an earlier release, still restores, and one newer
164
+ * than this release reads throws.
166
165
  */
167
166
  restoreState(saved: Partial<GridState<Row>> | Partial<SerializedGridState<Row>>): void;
168
167
  /**
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.
168
+ * Moves the grid's tab stop, and the browser's focus, to a cell:
169
+ * `{ area: "body", rowIndex, columnIndex }` or
170
+ * `{ area: "header", columnIndex }`. Either index is held inside the grid.
173
171
  */
174
- focusCell(rowIndex: number, columnIndex: number): void;
172
+ focusCell(focus: GridFocus): void;
175
173
  clearSelection(): void;
176
174
  selectAllRows(): void;
177
175
  /**
@@ -223,7 +221,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
223
221
  setGroupExpansion(expansion: GroupExpansionState): void;
224
222
  /** Replaces the page and page size as given. Reports through `onPaginationChange`. */
225
223
  setPagination(pagination: PaginationState): void;
226
- /** Replaces the column widths. Reports through `onColumnResize`, as the `"end"` of a resize. */
224
+ /** Replaces the column widths. Reports through `onColumnSizingChange`, as the `"end"` of a resize. */
227
225
  setColumnSizing(sizing: ColumnSizingState): void;
228
226
  /** Replaces the column order. Reports through `onColumnOrderChange`. */
229
227
  setColumnOrder(order: ColumnOrderState): void;
@@ -233,11 +231,11 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
233
231
  setRowSelection(selection: SelectionState): void;
234
232
  /** Replaces the selected column ids as given. Fires the column selection callbacks. */
235
233
  setColumnSelection(selection: SelectionState): void;
236
- /** Replaces the selected cell as given, `null` for none. Fires the cell selection callbacks. */
234
+ /** Replaces the cell selection as given, `{ kind: "none" }` for none. Fires the cell selection callbacks. */
237
235
  setCellSelection(selection: CellSelectionState): void;
238
236
  /**
239
237
  * Sizes a shown column to fit its content, as double-clicking its resize
240
- * handle does, reporting through `onColumnResize`. A hidden column, or one
238
+ * handle does, reporting through `onColumnSizingChange`. A hidden column, or one
241
239
  * with no rows to measure, is left as it is.
242
240
  */
243
241
  autoFitColumn(columnId: string): void;
@@ -443,7 +441,7 @@ interface SelectionStateApi {
443
441
  * internally.
444
442
  *
445
443
  * Before the grid mounts, the row/column fields read as empty arrays and
446
- * the cell field reads `null`; the actions are no-ops.
444
+ * the cell field reads `{ kind: "none" }`; the actions are no-ops.
447
445
  */
448
446
  declare function useSelectionState<Row>(gridRef: RefObject<DataGridApi<Row> | null>): SelectionStateApi;
449
447