simple-table-core 4.0.5 → 4.0.6

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.
@@ -1,8 +1,20 @@
1
1
  import { CellValue } from "..";
2
2
  import { Accessor } from "./ColumnDef";
3
- type UpdateDataProps = {
3
+ import type { RowId } from "./RowId";
4
+ type UpdateDataBase = {
4
5
  accessor: Accessor;
5
- rowIndex: number;
6
6
  newValue: CellValue;
7
7
  };
8
+ /**
9
+ * Update a cell by stable `rowId` (from `getRowId`) and/or source `rowIndex`.
10
+ * When both are provided, `rowId` wins. `rowIndex` is the index into the
11
+ * unsorted source `rows` array — not the sorted/visible position.
12
+ */
13
+ type UpdateDataProps = UpdateDataBase & ({
14
+ rowId: RowId;
15
+ rowIndex?: number;
16
+ } | {
17
+ rowIndex: number;
18
+ rowId?: undefined;
19
+ });
8
20
  export default UpdateDataProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",