@gridkitjs/react 0.0.0-dev-20261112200523 → 0.0.0-dev-20261117141506
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 +2 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ interface DataGridApi<Row> extends GridExportApi, GridPrintApi, GridPanelApi {
|
|
|
231
231
|
setRowSelection(selection: SelectionState): void;
|
|
232
232
|
/** Replaces the selected column ids as given. Fires the column selection callbacks. */
|
|
233
233
|
setColumnSelection(selection: SelectionState): void;
|
|
234
|
-
/** Replaces the
|
|
234
|
+
/** Replaces the cell selection as given, `{ kind: "none" }` for none. Fires the cell selection callbacks. */
|
|
235
235
|
setCellSelection(selection: CellSelectionState): void;
|
|
236
236
|
/**
|
|
237
237
|
* Sizes a shown column to fit its content, as double-clicking its resize
|
|
@@ -441,7 +441,7 @@ interface SelectionStateApi {
|
|
|
441
441
|
* internally.
|
|
442
442
|
*
|
|
443
443
|
* Before the grid mounts, the row/column fields read as empty arrays and
|
|
444
|
-
* the cell field reads `
|
|
444
|
+
* the cell field reads `{ kind: "none" }`; the actions are no-ops.
|
|
445
445
|
*/
|
|
446
446
|
declare function useSelectionState<Row>(gridRef: RefObject<DataGridApi<Row> | null>): SelectionStateApi;
|
|
447
447
|
|
package/dist/index.js
CHANGED
|
@@ -1032,7 +1032,7 @@ function GridBody({
|
|
|
1032
1032
|
activeColumnId,
|
|
1033
1033
|
selectedColumnIds: selection.selectedColumnIds,
|
|
1034
1034
|
selected: selection.selectedRowIds.has(entry.rowId),
|
|
1035
|
-
selectedColumnId: selectedCell
|
|
1035
|
+
selectedColumnId: selectedCell.kind === "cell" && selectedCell.rowId === entry.rowId ? selectedCell.columnId : null,
|
|
1036
1036
|
focusedColumnIndex: focusedColumnInRow(
|
|
1037
1037
|
nav.focus,
|
|
1038
1038
|
entry.rowIndex
|
|
@@ -2527,7 +2527,11 @@ function useContextMenu({
|
|
|
2527
2527
|
if (target.area !== "cell") {
|
|
2528
2528
|
return false;
|
|
2529
2529
|
}
|
|
2530
|
-
const cell = {
|
|
2530
|
+
const cell = {
|
|
2531
|
+
kind: "cell",
|
|
2532
|
+
rowId: target.rowId,
|
|
2533
|
+
columnId: target.columnId
|
|
2534
|
+
};
|
|
2531
2535
|
const selectRow = selection.rowMode !== false && !state.rowSelection.includes(target.rowId);
|
|
2532
2536
|
const selectCell = selection.cellMode !== false && !isSameCell(state.cellSelection, cell);
|
|
2533
2537
|
if (selectRow) {
|
|
@@ -5257,7 +5261,7 @@ function useColumnSortState(gridRef) {
|
|
|
5257
5261
|
// src/DataGrid/hooks/useSelectionState.ts
|
|
5258
5262
|
import { useCallback as useCallback8 } from "react";
|
|
5259
5263
|
var FALLBACK_SELECTION = [];
|
|
5260
|
-
var FALLBACK_CELL_SELECTION =
|
|
5264
|
+
var FALLBACK_CELL_SELECTION = { kind: "none" };
|
|
5261
5265
|
function useSelectionState(gridRef) {
|
|
5262
5266
|
const rowSelection = useGridSnapshot(
|
|
5263
5267
|
gridRef,
|