@jielga/tmdatagrid 2.0.0-beta.2 → 2.0.0-beta.4
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 +185 -48
- package/dist/index.js +1558 -1341
- package/dist/index.js.map +1 -1
- 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 +59 -25
- package/skills/editing/references/common-mistakes.md +10 -8
- package/skills/editing/references/editing-api.md +20 -13
- 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 +33 -3
- package/skills/rows/SKILL.md +1 -1
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +10 -7
- package/src/tmdatagrid/components/TMDataGridEditActions.tsx +96 -25
- package/src/tmdatagrid/components/TMDataGridEditColumn.tsx +1 -1
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +21 -18
- package/src/tmdatagrid/components/TMDataGridTable.tsx +13 -0
- package/src/tmdatagrid/core/controlledState.ts +179 -0
- package/src/tmdatagrid/core/editEngine.ts +480 -77
- package/src/tmdatagrid/core/labels.ts +8 -1
- package/src/tmdatagrid/core/labelsSv.ts +2 -0
- package/src/tmdatagrid/index.ts +5 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +154 -22
package/dist/index.d.ts
CHANGED
|
@@ -15,24 +15,41 @@ declare function TMDataGridColumnsPanel(): import("react").JSX.Element;
|
|
|
15
15
|
//#region .types-tmp/components/TMDataGridEditActions.d.ts
|
|
16
16
|
/** What the edit chrome is showing. */
|
|
17
17
|
type TMDataGridEditActionsState = {
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Rows in the draft store, which is what Save sends: committed edits,
|
|
20
|
+
* committed entry rows and deletion marks.
|
|
21
|
+
*/
|
|
22
|
+
draftCount: number;
|
|
23
|
+
/**
|
|
24
|
+
* Rows still open - edited or entered but not committed, so not part of
|
|
25
|
+
* the save. They stay open across a save.
|
|
26
|
+
*/
|
|
27
|
+
openCount: number;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Was "everything uncommitted", which Save no longer sends.
|
|
30
|
+
* Reads as `draftCount + openCount`; use whichever you meant.
|
|
31
|
+
*/
|
|
19
32
|
pendingCount: number;
|
|
20
33
|
/** Whether a submit is in flight. */
|
|
21
34
|
isSubmitting: boolean;
|
|
22
35
|
};
|
|
23
36
|
/** What the edit chrome can do. */
|
|
24
37
|
type TMDataGridEditActionsActions = {
|
|
25
|
-
/**
|
|
38
|
+
/** Saves the draft store. Open rows are left alone. */
|
|
26
39
|
save: () => Promise<boolean>;
|
|
27
|
-
/**
|
|
40
|
+
/** Submits every open row, committing the ones that validate. */
|
|
41
|
+
commitAll: () => Promise<boolean>;
|
|
42
|
+
/** Drops everything - open form state and the draft store alike. */
|
|
28
43
|
discard: () => void;
|
|
29
44
|
};
|
|
30
45
|
/** The pre-bound pieces of the built-in edit chrome. */
|
|
31
46
|
type TMDataGridEditActionsControls = {
|
|
32
|
-
/** Save, with the
|
|
47
|
+
/** Save, with the draft count, disabled while the draft store is empty. */
|
|
33
48
|
Save: () => ReactNode;
|
|
34
49
|
/** Discard, disabled while nothing is pending. */
|
|
35
50
|
Discard: () => ReactNode;
|
|
51
|
+
/** The "N rows still being edited" note, or nothing while there are none. */
|
|
52
|
+
OpenRowsNote: () => ReactNode;
|
|
36
53
|
};
|
|
37
54
|
/** What {@link TMDataGridEditActionsProps.renderActions} is handed. */
|
|
38
55
|
type TMDataGridEditActionsSlotArgs = {
|
|
@@ -48,7 +65,8 @@ type TMDataGridEditActionsProps = {
|
|
|
48
65
|
* <TMDataGrid.EditActions
|
|
49
66
|
* renderActions={({ state, Controls }) => (
|
|
50
67
|
* <Group>
|
|
51
|
-
* {state.
|
|
68
|
+
* {state.draftCount > 0 && <Badge>{state.draftCount}</Badge>}
|
|
69
|
+
* <Controls.OpenRowsNote />
|
|
52
70
|
* <Controls.Save />
|
|
53
71
|
* <Controls.Discard />
|
|
54
72
|
* </Group>
|
|
@@ -59,11 +77,11 @@ type TMDataGridEditActionsProps = {
|
|
|
59
77
|
renderActions?: (args: TMDataGridEditActionsSlotArgs) => ReactNode;
|
|
60
78
|
};
|
|
61
79
|
/**
|
|
62
|
-
* Draft mode's toolbar chrome: Save with the
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* nothing while editing is off.
|
|
80
|
+
* Draft mode's toolbar chrome: Save with the draft-store count, Discard, and
|
|
81
|
+
* a note counting rows still open. Save sends the draft store and leaves open
|
|
82
|
+
* rows alone, so it greys out while nothing is committed however much is
|
|
83
|
+
* being typed - the note is what makes those rows visible. Works under any
|
|
84
|
+
* `editing.mode` and renders nothing while editing is off.
|
|
67
85
|
*
|
|
68
86
|
* ```tsx
|
|
69
87
|
* <TMDataGrid.Toolbar>
|
|
@@ -368,22 +386,34 @@ type TMDataGridEditState = {
|
|
|
368
386
|
columnId: string | null;
|
|
369
387
|
} | null;
|
|
370
388
|
/**
|
|
371
|
-
* Rows with a live form
|
|
372
|
-
*
|
|
389
|
+
* Rows with a live form, committed or not - every row the grid is holding
|
|
390
|
+
* work for. A row is *open* (undecided form state) when it is in here and
|
|
391
|
+
* not in {@link committedRowIds}.
|
|
373
392
|
*/
|
|
374
393
|
openRowIds: ReadonlyArray<string>;
|
|
375
394
|
rows: Record<string, TMDataGridEditRowProjection>;
|
|
376
395
|
/**
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* `
|
|
396
|
+
* The draft store's edit slice: existing rows whose form passed its submit
|
|
397
|
+
* and is parked, waiting for `saveDrafts`. A subset of `openRowIds` - the
|
|
398
|
+
* values stay in the row's form, this records which side of the line the
|
|
399
|
+
* row is on. `begin` on one of these takes it back out, into form state.
|
|
400
|
+
*
|
|
401
|
+
* Only draft mode parks; the immediate modes send a commit straight to the
|
|
402
|
+
* consumer and drop the form, so there this stays empty.
|
|
403
|
+
*/
|
|
404
|
+
committedRowIds: ReadonlyArray<string>;
|
|
405
|
+
/**
|
|
406
|
+
* Rows being created, not yet in `data`. `committed` is the draft store's
|
|
407
|
+
* add slice: the entry row passed its submit and renders as a value row
|
|
408
|
+
* until `begin` re-opens it. Under the immediate modes a commit adds
|
|
409
|
+
* through `onRowAdd` and the entry is dropped, so there it never turns
|
|
410
|
+
* `true`.
|
|
381
411
|
*/
|
|
382
412
|
newRows: ReadonlyArray<{
|
|
383
413
|
tempId: string;
|
|
384
|
-
|
|
414
|
+
committed: boolean;
|
|
385
415
|
}>;
|
|
386
|
-
/**
|
|
416
|
+
/** The draft store's delete slice: rows marked deleted under draft mode. */
|
|
387
417
|
deletedRowIds: ReadonlyArray<string>;
|
|
388
418
|
};
|
|
389
419
|
type ErasedRow = Row<TMDataGridFeatures, TMDataGridRowData>;
|
|
@@ -504,15 +534,51 @@ type TMDataGridRowDeleteArgs<TData extends RowData> = {
|
|
|
504
534
|
rowId: string;
|
|
505
535
|
row: Row<TMDataGridFeatures, TData>;
|
|
506
536
|
};
|
|
507
|
-
/**
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
537
|
+
/**
|
|
538
|
+
* The draft store, flushed - what `saveDrafts` hands `onSaveDrafts`. Every
|
|
539
|
+
* committed change at once, so a server can apply it as one transaction.
|
|
540
|
+
* Rows still open (undecided form state) are not in here and stay open.
|
|
541
|
+
*/
|
|
542
|
+
type TMDataGridSaveDraftsArgs<TData extends RowData> = {
|
|
543
|
+
/** Committed edits to existing rows; each entry carries its `rowId`. */
|
|
544
|
+
updated: Array<TMDataGridEditCommitArgs<TData>>;
|
|
545
|
+
/** Committed new rows from the entry block; each entry carries its `tempId`. */
|
|
546
|
+
created: Array<TMDataGridRowAddArgs<TData>>;
|
|
513
547
|
/** Ids marked deleted while the drafts accumulated. */
|
|
514
548
|
deleted: Array<string>;
|
|
549
|
+
/** @deprecated Renamed to {@link updated}. Removed in a later beta. */
|
|
550
|
+
rows: Array<TMDataGridEditCommitArgs<TData>>;
|
|
551
|
+
/** @deprecated Renamed to {@link created}. Removed in a later beta. */
|
|
552
|
+
added: Array<TMDataGridRowAddArgs<TData>>;
|
|
515
553
|
};
|
|
554
|
+
/**
|
|
555
|
+
* Which entries of one bucket saved. `true`, or an id the map does not name,
|
|
556
|
+
* saved and is dropped from the draft store; `false` failed and keeps its
|
|
557
|
+
* draft. A bare boolean answers for the whole bucket.
|
|
558
|
+
*/
|
|
559
|
+
type TMDataGridSaveOutcomes = boolean | Record<string, boolean>;
|
|
560
|
+
/**
|
|
561
|
+
* What `onSaveDrafts` may return to save part of the store.
|
|
562
|
+
*
|
|
563
|
+
* Returning nothing saves everything, and throwing saves nothing. Between
|
|
564
|
+
* those, name the ids that failed: they keep their drafts, committed and
|
|
565
|
+
* ready for the next save, while the rest are dropped. The grid marks them
|
|
566
|
+
* with nothing beyond the state itself - a failed edit keeps `data-draft`,
|
|
567
|
+
* a failed deletion keeps `data-deleted` - so the display is the consumer's.
|
|
568
|
+
*/
|
|
569
|
+
type TMDataGridSaveDraftsResult = {
|
|
570
|
+
/** Keyed by `rowId`. */
|
|
571
|
+
updated?: TMDataGridSaveOutcomes;
|
|
572
|
+
/** Keyed by `tempId`. */
|
|
573
|
+
created?: TMDataGridSaveOutcomes;
|
|
574
|
+
/** Keyed by `rowId`. */
|
|
575
|
+
deleted?: TMDataGridSaveOutcomes;
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* @deprecated Renamed to {@link TMDataGridSaveDraftsArgs} - the payload is
|
|
579
|
+
* the draft store being saved, not a commit. Removed in a later beta.
|
|
580
|
+
*/
|
|
581
|
+
type TMDataGridEditCommitDraftsArgs<TData extends RowData> = TMDataGridSaveDraftsArgs<TData>;
|
|
516
582
|
/**
|
|
517
583
|
* The data path a column edits, or `null` for a column that has none.
|
|
518
584
|
*
|
|
@@ -534,6 +600,24 @@ declare function getEditFieldName(column: {
|
|
|
534
600
|
}): string | null;
|
|
535
601
|
/** What Delete writes into a cell - the type's honest empty value. */
|
|
536
602
|
declare function clearedValueForType(type: TMDataGridColumnType): unknown;
|
|
603
|
+
/** `edit.addRows` options. */
|
|
604
|
+
type TMDataGridAddRowsOptions = {
|
|
605
|
+
/**
|
|
606
|
+
* Submit each row as it is added instead of leaving it open. Defaults to
|
|
607
|
+
* `false` - the rows open as editable entry rows, as `addRow` does.
|
|
608
|
+
*/
|
|
609
|
+
commit?: boolean;
|
|
610
|
+
};
|
|
611
|
+
/** What `edit.addRows` reports back. Every added row is in exactly one list. */
|
|
612
|
+
type TMDataGridAddRowsResult = {
|
|
613
|
+
/** Temp ids that committed - parked as drafts, or added outright. */
|
|
614
|
+
committed: Array<string>;
|
|
615
|
+
/**
|
|
616
|
+
* Temp ids still open in the entry block: everything, when `commit` was
|
|
617
|
+
* not asked for; the rows that failed validation, when it was.
|
|
618
|
+
*/
|
|
619
|
+
open: Array<string>;
|
|
620
|
+
};
|
|
537
621
|
/**
|
|
538
622
|
* The engine plus its store - `api.edit`.
|
|
539
623
|
*
|
|
@@ -541,7 +625,7 @@ declare function clearedValueForType(type: TMDataGridColumnType): unknown;
|
|
|
541
625
|
* editors write through, so a consumer can render it in a drawer or a detail
|
|
542
626
|
* panel and share values, dirty state and errors with the cells.
|
|
543
627
|
*/
|
|
544
|
-
type TMDataGridEditApi = {
|
|
628
|
+
type TMDataGridEditApi<TData extends RowData = TMDataGridRowData> = {
|
|
545
629
|
/** The projection store - subscribe with `useSelector(edit.store, …)`. */
|
|
546
630
|
store: Store<TMDataGridEditState>;
|
|
547
631
|
/** Current snapshot, for reads outside React. */
|
|
@@ -577,19 +661,53 @@ type TMDataGridEditApi = {
|
|
|
577
661
|
* `"cellConfirm"`, where the dirty cell keeps waiting for its ✓.
|
|
578
662
|
*/
|
|
579
663
|
deactivate: () => void;
|
|
580
|
-
/** Drops every draft. */
|
|
664
|
+
/** Drops every draft - open form state and the draft store alike. */
|
|
581
665
|
cancelAll: () => void;
|
|
582
|
-
/**
|
|
666
|
+
/**
|
|
667
|
+
* Submits every open row, as if each had been OK'd: a row that validates
|
|
668
|
+
* commits (into the draft store under draft mode, straight to the consumer
|
|
669
|
+
* under the immediate modes), a row that fails stays open with its errors.
|
|
670
|
+
* `true` when every row committed. Sends nothing to the consumer by itself
|
|
671
|
+
* under draft mode - that is `saveDrafts`.
|
|
672
|
+
*/
|
|
673
|
+
commitAll: () => Promise<boolean>;
|
|
674
|
+
/**
|
|
675
|
+
* Flushes the draft store: every committed edit, added row and deletion
|
|
676
|
+
* mark reaches the consumer, through `onSaveDrafts` in one call when it is
|
|
677
|
+
* set, or row by row through `onCommit` / `onRowAdd` / `onRowDelete`.
|
|
678
|
+
*
|
|
679
|
+
* Rows still open are left alone - they keep their form state and stay
|
|
680
|
+
* open. `true` when everything landed; a rejected save keeps every draft.
|
|
681
|
+
*/
|
|
682
|
+
saveDrafts: () => Promise<boolean>;
|
|
683
|
+
/**
|
|
684
|
+
* @deprecated Split into {@link commitAll} and {@link saveDrafts}, which is
|
|
685
|
+
* exactly what this now does. Removed in a later beta.
|
|
686
|
+
*/
|
|
583
687
|
submitAll: () => Promise<boolean>;
|
|
584
688
|
/** Writes the type's empty value into a cell and commits it - Delete. */
|
|
585
689
|
clearCell: (rowId: string, columnId: string) => Promise<boolean>;
|
|
586
690
|
/**
|
|
587
691
|
* Opens a new entry row (the sticky block under the header) seeded from
|
|
588
|
-
* `newRowDefaults`.
|
|
589
|
-
*
|
|
692
|
+
* `newRowDefaults`. `values` overrides that seed key by key, so
|
|
693
|
+
* `addRow()` opens a blank row and `addRow({ status: "draft" })` opens one
|
|
694
|
+
* that starts filled in. Returns its temporary id - a form with no backing
|
|
695
|
+
* row yet. Committing it calls `onRowAdd` (immediate modes) or joins
|
|
590
696
|
* `submitAll`'s `added` (draft).
|
|
591
697
|
*/
|
|
592
|
-
addRow: () => string;
|
|
698
|
+
addRow: (values?: Partial<TData>) => string;
|
|
699
|
+
/**
|
|
700
|
+
* Opens entry rows for a list of records at once - one state write for the
|
|
701
|
+
* batch, where a loop over `addRow` is one per row. Each row is seeded over
|
|
702
|
+
* `newRowDefaults` exactly as `addRow` does.
|
|
703
|
+
*
|
|
704
|
+
* `commit: true` submits each row as it lands, which is what an import
|
|
705
|
+
* wants: rows that validate commit (parked in the draft store under draft
|
|
706
|
+
* mode, added through `onRowAdd` under the immediate modes - once per row),
|
|
707
|
+
* and rows that fail stay open in the entry block carrying their errors,
|
|
708
|
+
* for the user to fix. The result says which went which way.
|
|
709
|
+
*/
|
|
710
|
+
addRows: (rows: ReadonlyArray<Partial<TData>>, options?: TMDataGridAddRowsOptions) => Promise<TMDataGridAddRowsResult>;
|
|
593
711
|
/**
|
|
594
712
|
* Deletes a row: `onRowDelete` straight away under the immediate modes;
|
|
595
713
|
* under draft it toggles the id in `deletedRowIds` - the row renders
|
|
@@ -703,10 +821,15 @@ type TMDataGridLabels = {
|
|
|
703
821
|
cancelRowEdit: string;
|
|
704
822
|
/** Save tooltip when field errors block the row, with no row message. */
|
|
705
823
|
editRowErrors: string;
|
|
706
|
-
/** `EditActions`' Save, with the
|
|
824
|
+
/** `EditActions`' Save, with the count of rows in the draft store. */
|
|
707
825
|
saveAllEdits: (rows: number) => string;
|
|
708
826
|
/** `EditActions`' Discard. */
|
|
709
827
|
discardAllEdits: string;
|
|
828
|
+
/**
|
|
829
|
+
* `EditActions`' note about rows still open - edited but not committed, so
|
|
830
|
+
* not part of the save. Shown only while there are any.
|
|
831
|
+
*/
|
|
832
|
+
editRowsStillOpen: (rows: number) => string;
|
|
710
833
|
/** The entry row's ✓ - commit the add. */
|
|
711
834
|
confirmNewRow: string;
|
|
712
835
|
/** The entry row's ✕ - drop the entry. */
|
|
@@ -1544,7 +1667,7 @@ type TMDataGridApi<TData extends RowData> = {
|
|
|
1544
1667
|
* out the same TanStack Form the inline editors write through, so a drawer
|
|
1545
1668
|
* or detail panel can share a row's draft. Inert until `editing` is set.
|
|
1546
1669
|
*/
|
|
1547
|
-
edit: TMDataGridEditApi
|
|
1670
|
+
edit: TMDataGridEditApi<TData>;
|
|
1548
1671
|
/** Table-level feature switches, re-read from options on every render. */
|
|
1549
1672
|
features: TMDataGridFeatureFlags;
|
|
1550
1673
|
/** Every string the chrome renders, `labels` merged over the English defaults. */
|
|
@@ -1624,6 +1747,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1624
1747
|
/**
|
|
1625
1748
|
* Seed values for `edit.addRow()` - the entry row's starting point. A
|
|
1626
1749
|
* function is called per added row (fresh timestamps, empty arrays).
|
|
1750
|
+
* `edit.addRow(values)` overrides this key by key for that one row.
|
|
1627
1751
|
*/
|
|
1628
1752
|
newRowDefaults?: TData | (() => TData);
|
|
1629
1753
|
/**
|
|
@@ -1650,12 +1774,12 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1650
1774
|
* | `"cell"` | Enter, Tab, blur - Sheets | Escape |
|
|
1651
1775
|
* | `"cellConfirm"` | ✓ or Enter only; blur keeps the draft | ✕ or Escape |
|
|
1652
1776
|
* | `"row"` | Save in the edit lane, or Ctrl+Enter | Cancel, or Escape |
|
|
1653
|
-
* | `"draft"` | `edit.
|
|
1777
|
+
* | `"draft"` | `edit.commit(rowId)` into the draft store, `edit.saveDrafts()` out | `edit.cancelAll()` |
|
|
1654
1778
|
*
|
|
1655
1779
|
* Setting `editing` makes `getRowId` required - drafts are keyed by row id,
|
|
1656
1780
|
* and the index fallback would name a different record after any sort - and
|
|
1657
|
-
* `
|
|
1658
|
-
*
|
|
1781
|
+
* `onSaveDrafts` exists only under `mode: "draft"`, the one mode with a draft
|
|
1782
|
+
* store to save.
|
|
1659
1783
|
*
|
|
1660
1784
|
* The object may be written inline: the callbacks are read through a ref
|
|
1661
1785
|
* every render, so its identity does not matter.
|
|
@@ -1669,25 +1793,38 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1669
1793
|
type TMDataGridEditingOptions<TData extends RowData> = TMDataGridEditingCallbacks<TData> & ({
|
|
1670
1794
|
mode: "draft";
|
|
1671
1795
|
/**
|
|
1672
|
-
* Draft mode's save
|
|
1673
|
-
*
|
|
1674
|
-
*
|
|
1675
|
-
*
|
|
1796
|
+
* Draft mode's save: called once by `edit.saveDrafts()` with the
|
|
1797
|
+
* whole draft store - committed edits, added rows and deletion
|
|
1798
|
+
* marks - so a server can apply it as one transaction. Without it,
|
|
1799
|
+
* `saveDrafts` falls back to the per-row
|
|
1800
|
+
* {@link TMDataGridEditingCallbacks.onCommit} loop.
|
|
1801
|
+
*
|
|
1802
|
+
* Rows still open are not in the payload and stay open. Returning
|
|
1803
|
+
* nothing saves the whole store and throwing saves none of it;
|
|
1804
|
+
* return a {@link TMDataGridSaveDraftsResult} to save part of it.
|
|
1805
|
+
*/
|
|
1806
|
+
onSaveDrafts?: (args: TMDataGridSaveDraftsArgs<TData>) => void | TMDataGridSaveDraftsResult | Promise<void | TMDataGridSaveDraftsResult>;
|
|
1807
|
+
/**
|
|
1808
|
+
* @deprecated Renamed to {@link onSaveDrafts} - it fires when the
|
|
1809
|
+
* draft store is saved, not when a row commits into it. Still
|
|
1810
|
+
* honoured; removed in a later beta.
|
|
1676
1811
|
*/
|
|
1677
|
-
onCommitDrafts?: (args:
|
|
1812
|
+
onCommitDrafts?: (args: TMDataGridSaveDraftsArgs<TData>) => void | TMDataGridSaveDraftsResult | Promise<void | TMDataGridSaveDraftsResult>;
|
|
1678
1813
|
/**
|
|
1679
|
-
* Keep
|
|
1680
|
-
*
|
|
1681
|
-
* flow above the body rows instead - the block a row
|
|
1682
|
-
* into is always sticky, but
|
|
1683
|
-
* cannot fill the viewport with sticky chrome.
|
|
1814
|
+
* Keep committed entry rows pinned in the sticky entry block until
|
|
1815
|
+
* the draft store is saved. Off by default: a committed row joins
|
|
1816
|
+
* the scrolling flow above the body rows instead - the block a row
|
|
1817
|
+
* is *typed* into is always sticky, but committed rows scroll, so
|
|
1818
|
+
* committing many cannot fill the viewport with sticky chrome.
|
|
1684
1819
|
*/
|
|
1685
1820
|
newRowsSticky?: boolean;
|
|
1686
1821
|
} | {
|
|
1687
1822
|
mode: Exclude<TMDataGridEditMode, "draft">;
|
|
1688
|
-
/** Only `"draft"`
|
|
1823
|
+
/** Only `"draft"` has a draft store to save - see the other branch. */
|
|
1824
|
+
onSaveDrafts?: never;
|
|
1825
|
+
/** @deprecated See {@link onSaveDrafts}. */
|
|
1689
1826
|
onCommitDrafts?: never;
|
|
1690
|
-
/**
|
|
1827
|
+
/** Committed entry rows exist only under `"draft"` - see there. */
|
|
1691
1828
|
newRowsSticky?: never;
|
|
1692
1829
|
});
|
|
1693
1830
|
type UseTMDataGridOptions<TData extends RowData> = Omit<TableOptions<TMDataGridFeatures, TData>, "features"> & ({
|
|
@@ -3106,4 +3243,4 @@ declare function getSelectableRowIds<TData extends RowData>(row: Row<TMDataGridF
|
|
|
3106
3243
|
*/
|
|
3107
3244
|
declare function resolveRowSelectionClick<TData extends RowData>({ rows, rowId, anchorRowId, modifiers, selection, canReplaceSelection }: ResolveRowSelectionClickArgs<TData>): ResolvedRowSelection;
|
|
3108
3245
|
//#endregion
|
|
3109
|
-
export { type BuildCellMatrixArgs, type ColumnStepArgs, DATA_STATE_SLICES, DEFAULT_CELL_EXPORT_OPTIONS, DEFAULT_TMDATAGRID_SIZE, DETAILS_COLUMN_ID, DgAutocompleteFilter, DgDateRangeFilter, DgRangeSliderFilter, DgTriStateFilter, EDIT_COLUMN_ID, FILTER_OPERATOR_LABELS, GROUP_COLUMN_ID, type MoveColumnArgs, PERSIST_PAYLOAD_VERSION, ROW_NUMBER_COLUMN_ID, type ResolveCellMoveArgs, type ResolveRangeBoundsArgs, type ResolveRowSelectionClickArgs, type ResolvedRowSelection, SELECT_COLUMN_ID, SETTINGS_STATE_SLICES, SIZE_CONTROL_SIZE, SIZE_ROW_HEIGHT, TMDATAGRID_LABELS_EN, TMDATAGRID_LABELS_SV, TMDataGrid, type TMDataGridAggregationName, type TMDataGridApi, TMDataGridBooleanEditor, type TMDataGridCapabilities, type TMDataGridCellCoords, type TMDataGridCellEventArgs, type TMDataGridCellExportOptions, type TMDataGridCellMatrix, type TMDataGridCellNav, type TMDataGridCellPosition, type TMDataGridCellRange, type TMDataGridCellSelectionMode, type TMDataGridColumnCapabilities, type TMDataGridColumnEditOptions, type TMDataGridColumnFilterOptions, type TMDataGridColumnLayout, type TMDataGridColumnMenuItemsArgs, type TMDataGridColumnMenuItemsRenderer, type TMDataGridColumnMeta, type TMDataGridColumnRegion, type TMDataGridColumnType, type TMDataGridContextValue, type TMDataGridDataSlice, TMDataGridDateEditor, type TMDataGridDetailsArgs, type TMDataGridDetailsRenderer, type TMDataGridDropSide, TMDataGridEditActions, type TMDataGridEditActionsActions, type TMDataGridEditActionsControls, type TMDataGridEditActionsProps, type TMDataGridEditActionsSlotArgs, type TMDataGridEditActionsState, type TMDataGridEditApi, type TMDataGridEditChange, type TMDataGridEditCommitArgs, type TMDataGridEditCommitDraftsArgs, type TMDataGridEditField, type TMDataGridEditMode, type TMDataGridEditRowProjection, type TMDataGridEditState, type TMDataGridEditValueMap, type TMDataGridEditValueMapArgs, type TMDataGridEditingOptions, type TMDataGridEditorArgs, type TMDataGridEditorComponent, type TMDataGridExpandAllArgs, type TMDataGridExpandTarget, type TMDataGridFeatureFlags, type TMDataGridFeatures, type TMDataGridFieldValidate, type TMDataGridFilterControlArgs, type TMDataGridFilterControlComponent, type TMDataGridFilterOperator, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFooterProps, type TMDataGridLabels, type TMDataGridLabelsOverride, TMDataGridMultiSelectEditor, TMDataGridNumberEditor, type TMDataGridOption, type TMDataGridOptionsArgs, type TMDataGridOptionsSource, type TMDataGridPaginationActions, type TMDataGridPaginationApi, type TMDataGridPaginationControls, type TMDataGridPaginationSlotArgs, type TMDataGridPaginationState, type TMDataGridPersistKey, type TMDataGridPersistence, type TMDataGridProps, type TMDataGridQuickSearchMode, type TMDataGridRangeBounds, type TMDataGridRowAddArgs, type TMDataGridRowClickModifiers, type TMDataGridRowContextMenuArgs, type TMDataGridRowContextMenuRenderer, type TMDataGridRowData, type TMDataGridRowDeleteArgs, type TMDataGridRowEditForm, type TMDataGridRowStyle, type TMDataGridRowValidators, type TMDataGridScrollAlign, type TMDataGridScrollToRowArgs, TMDataGridSearch, type TMDataGridSearchProps, TMDataGridSelectEditor, type TMDataGridSelectionMode, type TMDataGridSettingsSlice, type TMDataGridSize, type TMDataGridStorageMode, TMDataGridStringEditor, type TMDataGridTable, type TMDataGridTableMeta, type TMDataGridTableProps, type TMDataGridUiActions, type TMDataGridUiState, type TMDataGridUiStore, type UseTMDataGridOptions, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildGridCellMatrix, clearedValueForType, createTMDataGridColumnHelper, downloadTextFile, emptyValueForOperator, exportGridToCsv, formatExportValue, formatFilterLabel, formatGroupValue, fuzzyGlobalFilterFn, getColumnCapabilities, getColumnDefaultOperator, getColumnFilterControl, getColumnLabel, getColumnRegion, getColumnType, getDefaultOperator, getDisplayedRows, getEditFieldName, getGridCapabilities, getGroupDataRows, getOperatorsForType, getSelectableRowIds, getStepTargetColumn, getTMDataGridPaginationApi, isColumnEditableForRow, isColumnReorderable, isControlColumn, isFilterActive, isGeneratedColumn, isPagingActive, isSameCell, isWithinBounds, keepGeneratedColumnsOutermost, measureColumnContentWidth, mergeLabels, moveColumn, moveColumnByStep, normalizeFieldValidate, openColumnFilter, operatorNeedsValue, operatorTakesArrayValue, operatorTakesRangeValue, optionsToComboboxData, readFeatureFlags, resolveCellMove, resolveColumnOptions, resolveExpandAll, resolveRangeBounds, resolveRowSelectionClick, tmDataGridFeatures, toClipboardText, toExcelCsv, useCellControlTabIndex, useTMDataGrid, useTMDataGridContext, writeClipboardText };
|
|
3246
|
+
export { type BuildCellMatrixArgs, type ColumnStepArgs, DATA_STATE_SLICES, DEFAULT_CELL_EXPORT_OPTIONS, DEFAULT_TMDATAGRID_SIZE, DETAILS_COLUMN_ID, DgAutocompleteFilter, DgDateRangeFilter, DgRangeSliderFilter, DgTriStateFilter, EDIT_COLUMN_ID, FILTER_OPERATOR_LABELS, GROUP_COLUMN_ID, type MoveColumnArgs, PERSIST_PAYLOAD_VERSION, ROW_NUMBER_COLUMN_ID, type ResolveCellMoveArgs, type ResolveRangeBoundsArgs, type ResolveRowSelectionClickArgs, type ResolvedRowSelection, SELECT_COLUMN_ID, SETTINGS_STATE_SLICES, SIZE_CONTROL_SIZE, SIZE_ROW_HEIGHT, TMDATAGRID_LABELS_EN, TMDATAGRID_LABELS_SV, TMDataGrid, type TMDataGridAddRowsOptions, type TMDataGridAddRowsResult, type TMDataGridAggregationName, type TMDataGridApi, TMDataGridBooleanEditor, type TMDataGridCapabilities, type TMDataGridCellCoords, type TMDataGridCellEventArgs, type TMDataGridCellExportOptions, type TMDataGridCellMatrix, type TMDataGridCellNav, type TMDataGridCellPosition, type TMDataGridCellRange, type TMDataGridCellSelectionMode, type TMDataGridColumnCapabilities, type TMDataGridColumnEditOptions, type TMDataGridColumnFilterOptions, type TMDataGridColumnLayout, type TMDataGridColumnMenuItemsArgs, type TMDataGridColumnMenuItemsRenderer, type TMDataGridColumnMeta, type TMDataGridColumnRegion, type TMDataGridColumnType, type TMDataGridContextValue, type TMDataGridDataSlice, TMDataGridDateEditor, type TMDataGridDetailsArgs, type TMDataGridDetailsRenderer, type TMDataGridDropSide, TMDataGridEditActions, type TMDataGridEditActionsActions, type TMDataGridEditActionsControls, type TMDataGridEditActionsProps, type TMDataGridEditActionsSlotArgs, type TMDataGridEditActionsState, type TMDataGridEditApi, type TMDataGridEditChange, type TMDataGridEditCommitArgs, type TMDataGridEditCommitDraftsArgs, type TMDataGridEditField, type TMDataGridEditMode, type TMDataGridEditRowProjection, type TMDataGridEditState, type TMDataGridEditValueMap, type TMDataGridEditValueMapArgs, type TMDataGridEditingOptions, type TMDataGridEditorArgs, type TMDataGridEditorComponent, type TMDataGridExpandAllArgs, type TMDataGridExpandTarget, type TMDataGridFeatureFlags, type TMDataGridFeatures, type TMDataGridFieldValidate, type TMDataGridFilterControlArgs, type TMDataGridFilterControlComponent, type TMDataGridFilterOperator, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFooterProps, type TMDataGridLabels, type TMDataGridLabelsOverride, TMDataGridMultiSelectEditor, TMDataGridNumberEditor, type TMDataGridOption, type TMDataGridOptionsArgs, type TMDataGridOptionsSource, type TMDataGridPaginationActions, type TMDataGridPaginationApi, type TMDataGridPaginationControls, type TMDataGridPaginationSlotArgs, type TMDataGridPaginationState, type TMDataGridPersistKey, type TMDataGridPersistence, type TMDataGridProps, type TMDataGridQuickSearchMode, type TMDataGridRangeBounds, type TMDataGridRowAddArgs, type TMDataGridRowClickModifiers, type TMDataGridRowContextMenuArgs, type TMDataGridRowContextMenuRenderer, type TMDataGridRowData, type TMDataGridRowDeleteArgs, type TMDataGridRowEditForm, type TMDataGridRowStyle, type TMDataGridRowValidators, type TMDataGridSaveDraftsArgs, type TMDataGridSaveDraftsResult, type TMDataGridSaveOutcomes, type TMDataGridScrollAlign, type TMDataGridScrollToRowArgs, TMDataGridSearch, type TMDataGridSearchProps, TMDataGridSelectEditor, type TMDataGridSelectionMode, type TMDataGridSettingsSlice, type TMDataGridSize, type TMDataGridStorageMode, TMDataGridStringEditor, type TMDataGridTable, type TMDataGridTableMeta, type TMDataGridTableProps, type TMDataGridUiActions, type TMDataGridUiState, type TMDataGridUiStore, type UseTMDataGridOptions, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildGridCellMatrix, clearedValueForType, createTMDataGridColumnHelper, downloadTextFile, emptyValueForOperator, exportGridToCsv, formatExportValue, formatFilterLabel, formatGroupValue, fuzzyGlobalFilterFn, getColumnCapabilities, getColumnDefaultOperator, getColumnFilterControl, getColumnLabel, getColumnRegion, getColumnType, getDefaultOperator, getDisplayedRows, getEditFieldName, getGridCapabilities, getGroupDataRows, getOperatorsForType, getSelectableRowIds, getStepTargetColumn, getTMDataGridPaginationApi, isColumnEditableForRow, isColumnReorderable, isControlColumn, isFilterActive, isGeneratedColumn, isPagingActive, isSameCell, isWithinBounds, keepGeneratedColumnsOutermost, measureColumnContentWidth, mergeLabels, moveColumn, moveColumnByStep, normalizeFieldValidate, openColumnFilter, operatorNeedsValue, operatorTakesArrayValue, operatorTakesRangeValue, optionsToComboboxData, readFeatureFlags, resolveCellMove, resolveColumnOptions, resolveExpandAll, resolveRangeBounds, resolveRowSelectionClick, tmDataGridFeatures, toClipboardText, toExcelCsv, useCellControlTabIndex, useTMDataGrid, useTMDataGridContext, writeClipboardText };
|