@jielga/tmdatagrid 2.0.0-beta.19 → 2.0.0-beta.20
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 +15 -4
- package/dist/index.js +1704 -1648
- package/dist/index.js.map +1 -1
- package/docs/components.md +2 -1
- package/docs/editing.md +24 -11
- package/docs/pagination.md +1 -1
- package/docs/row-details.md +5 -3
- package/docs/server-side.md +3 -3
- package/package.json +1 -1
- package/skills/appearance/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/columns/SKILL.md +1 -1
- package/skills/data/SKILL.md +1 -1
- package/skills/editing/SKILL.md +2 -2
- package/skills/editing/references/editing-api.md +2 -0
- package/skills/filtering/SKILL.md +1 -1
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +1 -1
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/src/components/TMDataGridDraftActions.tsx +22 -11
- package/src/components/TMDataGridSelectColumn.tsx +6 -1
- package/src/core/deletedRows.ts +34 -0
- package/src/core/editEngine.ts +157 -37
- package/src/core/export.ts +4 -1
- package/src/core/pageReset.ts +7 -2
- package/src/useTMDataGrid.tsx +61 -12
package/dist/index.d.ts
CHANGED
|
@@ -307,6 +307,14 @@ type TMDataGridEditState = {
|
|
|
307
307
|
}>;
|
|
308
308
|
/** The draft store's delete slice: rows marked deleted, awaiting the save. */
|
|
309
309
|
deletedRowIds: ReadonlyArray<string>;
|
|
310
|
+
/**
|
|
311
|
+
* `true` while `saveDrafts` is in flight - from the call until the
|
|
312
|
+
* consumer's callbacks (`onSaveDrafts`, or the per-row `onCommit` /
|
|
313
|
+
* `onRowAdd` / `onRowDelete` loop) have settled. Concurrent `saveDrafts`
|
|
314
|
+
* calls join the same run, so it flips once per run. It stays `false` for
|
|
315
|
+
* a save that finds nothing to send.
|
|
316
|
+
*/
|
|
317
|
+
isSaving: boolean;
|
|
310
318
|
};
|
|
311
319
|
type ErasedRow$1 = Row<TMDataGridFeatures, TMDataGridRowData>;
|
|
312
320
|
type ErasedColumn$1 = Column<TMDataGridFeatures, TMDataGridRowData, unknown>;
|
|
@@ -2421,9 +2429,10 @@ type UseTMDataGridOptions<TData extends RowData> = Omit<TableOptions<TMDataGridF
|
|
|
2421
2429
|
enablePagination?: boolean;
|
|
2422
2430
|
/**
|
|
2423
2431
|
* Sends the grid back to the first page whenever the query changes - a
|
|
2424
|
-
* column filter, the quick search or the
|
|
2425
|
-
*
|
|
2426
|
-
* `
|
|
2432
|
+
* column filter, the quick search, the sort or the grouping. On by
|
|
2433
|
+
* default. TanStack's own `autoResetPageIndex` is switched off by the
|
|
2434
|
+
* grid: it fires on any change to the `data` array, which under
|
|
2435
|
+
* `editing.draft` is every commit.
|
|
2427
2436
|
*
|
|
2428
2437
|
* Server-side, `pageIndex` is a position in a result set the grid does not
|
|
2429
2438
|
* own: narrowing the query leaves it pointing past the last page, and the
|
|
@@ -2976,8 +2985,10 @@ type TMDataGridDraftActionsState = {
|
|
|
2976
2985
|
* Reads as `draftCount + openCount`; use whichever you meant.
|
|
2977
2986
|
*/
|
|
2978
2987
|
pendingCount: number;
|
|
2979
|
-
/** Whether a submit is in flight. */
|
|
2988
|
+
/** Whether a submit is in flight - any open row is submitting. */
|
|
2980
2989
|
isSubmitting: boolean;
|
|
2990
|
+
/** `true` while `saveDrafts` is in flight. */
|
|
2991
|
+
isSaving: boolean;
|
|
2981
2992
|
};
|
|
2982
2993
|
/** What the edit chrome can do. */
|
|
2983
2994
|
type TMDataGridDraftActionsActions = {
|