@jielga/tmdatagrid 2.0.0-beta.5 → 2.0.0-beta.7
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 +231 -95
- package/dist/index.js +1093 -979
- package/dist/index.js.map +1 -1
- package/dist/styles.css +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 +43 -1
- package/skills/data/SKILL.md +14 -10
- package/skills/editing/SKILL.md +102 -29
- package/skills/editing/references/common-mistakes.md +91 -2
- package/skills/editing/references/editing-api.md +12 -3
- package/skills/editing/references/editors-and-validation.md +64 -13
- package/skills/filtering/SKILL.md +1 -1
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +5 -3
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +7 -3
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/src/tmdatagrid/components/TMDataGridDraftActions.tsx +77 -17
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +4 -4
- package/src/tmdatagrid/components/TMDataGridTable.tsx +15 -0
- package/src/tmdatagrid/components/TMDataGridToolbar.module.css +4 -0
- package/src/tmdatagrid/components/TMDataGridToolbar.tsx +8 -10
- package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +34 -4
- package/src/tmdatagrid/core/editEngine.ts +317 -45
- package/src/tmdatagrid/core/summary.ts +10 -2
- package/src/tmdatagrid/index.ts +2 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +39 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Cell, Column, ColumnPinningState, ExpandedState, Header, Row, RowData, RowSelectionState, Table, TableFeatures, TableOptions, TableState, aggregationFns } from "@tanstack/react-table";
|
|
2
2
|
import { CSSProperties, ComponentType, MouseEvent, MutableRefObject, ReactNode } from "react";
|
|
3
|
-
import { MantineSize, MenuProps } from "@mantine/core";
|
|
4
3
|
import { Store } from "@tanstack/store";
|
|
4
|
+
import { MantineSize, MenuProps } from "@mantine/core";
|
|
5
5
|
import { AnyFieldApi, AnyFormApi, StandardSchemaV1 } from "@tanstack/react-form";
|
|
6
6
|
import { RankingInfo } from "@tanstack/match-sorter-utils";
|
|
7
7
|
//#region .types-tmp/components/TMDataGridColumnsPanel.d.ts
|
|
@@ -12,99 +12,6 @@ import { RankingInfo } from "@tanstack/match-sorter-utils";
|
|
|
12
12
|
*/
|
|
13
13
|
declare function TMDataGridColumnsPanel(): import("react").JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
|
-
//#region .types-tmp/components/TMDataGridDraftActions.d.ts
|
|
16
|
-
/** What the edit chrome is showing. */
|
|
17
|
-
type TMDataGridDraftActionsState = {
|
|
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
|
-
*/
|
|
32
|
-
pendingCount: number;
|
|
33
|
-
/** Whether a submit is in flight. */
|
|
34
|
-
isSubmitting: boolean;
|
|
35
|
-
};
|
|
36
|
-
/** What the edit chrome can do. */
|
|
37
|
-
type TMDataGridDraftActionsActions = {
|
|
38
|
-
/** Saves the draft store. Open rows are left alone. */
|
|
39
|
-
save: () => Promise<boolean>;
|
|
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. */
|
|
43
|
-
discard: () => void;
|
|
44
|
-
};
|
|
45
|
-
/** The pre-bound pieces of the built-in edit chrome. */
|
|
46
|
-
type TMDataGridDraftActionsControls = {
|
|
47
|
-
/** Save, with the draft count, disabled while the draft store is empty. */
|
|
48
|
-
Save: () => ReactNode;
|
|
49
|
-
/** Discard, disabled while nothing is pending. */
|
|
50
|
-
Discard: () => ReactNode;
|
|
51
|
-
/** The "N rows still being edited" note, or nothing while there are none. */
|
|
52
|
-
OpenRowsNote: () => ReactNode;
|
|
53
|
-
};
|
|
54
|
-
/** What {@link TMDataGridDraftActionsProps.renderActions} is handed. */
|
|
55
|
-
type TMDataGridDraftActionsSlotArgs = {
|
|
56
|
-
state: TMDataGridDraftActionsState;
|
|
57
|
-
actions: TMDataGridDraftActionsActions;
|
|
58
|
-
Controls: TMDataGridDraftActionsControls;
|
|
59
|
-
};
|
|
60
|
-
type TMDataGridDraftActionsProps = {
|
|
61
|
-
/**
|
|
62
|
-
* Replaces the built-in Save/Discard pair, and is handed the pieces of it.
|
|
63
|
-
*
|
|
64
|
-
* ```tsx
|
|
65
|
-
* <TMDataGrid.DraftActions
|
|
66
|
-
* renderActions={({ state, Controls }) => (
|
|
67
|
-
* <Group>
|
|
68
|
-
* {state.draftCount > 0 && <Badge>{state.draftCount}</Badge>}
|
|
69
|
-
* <Controls.OpenRowsNote />
|
|
70
|
-
* <Controls.Save />
|
|
71
|
-
* <Controls.Discard />
|
|
72
|
-
* </Group>
|
|
73
|
-
* )}
|
|
74
|
-
* />
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
renderActions?: (args: TMDataGridDraftActionsSlotArgs) => ReactNode;
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* The draft store's toolbar chrome: Save with the store's count, Discard, and
|
|
81
|
-
* a note counting the rows still open. Save sends the store and leaves open
|
|
82
|
-
* rows alone, so it greys out while nothing is parked however much is being
|
|
83
|
-
* typed - the note is what makes those rows visible.
|
|
84
|
-
*
|
|
85
|
-
* Works under any `editing.mode`. The toolbar is declarative: the grid does
|
|
86
|
-
* not decide for you, so include this only when the grid runs a draft store -
|
|
87
|
-
* without `editing.draft` there is nothing to save and Save stays disabled.
|
|
88
|
-
*
|
|
89
|
-
* ```tsx
|
|
90
|
-
* <TMDataGrid.Toolbar>
|
|
91
|
-
* <TMDataGrid.SummaryCount />
|
|
92
|
-
* <TMDataGrid.Spacer />
|
|
93
|
-
* <TMDataGrid.DraftActions />
|
|
94
|
-
* </TMDataGrid.Toolbar>
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
declare function TMDataGridDraftActions({ renderActions }?: TMDataGridDraftActionsProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region .types-tmp/components/TMDataGridFilterPanel.d.ts
|
|
100
|
-
/**
|
|
101
|
-
* The MUI-style filter surface: one row per active column filter, each row a
|
|
102
|
-
* column / operator / value triple. It only ever reads and writes the table's
|
|
103
|
-
* `columnFilters` state, so a `manualFiltering` grid gets the same panel for
|
|
104
|
-
* free - the state is forwarded to the server instead of a row model.
|
|
105
|
-
*/
|
|
106
|
-
declare function TMDataGridFilterPanel(): import("react").JSX.Element | null;
|
|
107
|
-
//#endregion
|
|
108
15
|
//#region .types-tmp/core/sizes.d.ts
|
|
109
16
|
type TMDataGridSize = MantineSize;
|
|
110
17
|
declare const DEFAULT_TMDATAGRID_SIZE: TMDataGridSize;
|
|
@@ -347,6 +254,40 @@ type TMDataGridRowValidators = {
|
|
|
347
254
|
onSubmitAsync?: TMDataGridValidator;
|
|
348
255
|
onSubmitAsyncDebounceMs?: number;
|
|
349
256
|
};
|
|
257
|
+
/** What `editing.tableValidators` is handed for one commit. */
|
|
258
|
+
type TMDataGridTableValidateArgs<TData extends RowData = TMDataGridRowData> = {
|
|
259
|
+
/** The committing row, as drafted. */
|
|
260
|
+
value: TData;
|
|
261
|
+
/** Its id - `addRow`'s temp id for an entry row. */
|
|
262
|
+
rowId: string;
|
|
263
|
+
/** Whether the row is an entry row, not yet in `data`. */
|
|
264
|
+
isNew: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* The collection as it would stand if this commit landed: every data row
|
|
267
|
+
* overlaid with its draft where one is held (this row's `value` included),
|
|
268
|
+
* entry rows appended, deletion-marked rows removed. Unfiltered - a rule
|
|
269
|
+
* sees the whole collection whatever the view shows.
|
|
270
|
+
*/
|
|
271
|
+
rows: ReadonlyArray<{
|
|
272
|
+
rowId: string;
|
|
273
|
+
value: TData;
|
|
274
|
+
}>;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* `editing.tableValidators` - rules that need the other rows: no duplicate
|
|
278
|
+
* keys, no overlapping ranges, allocations summing to a total. Run at every
|
|
279
|
+
* commit, after the row's own validators, and again per parked row during
|
|
280
|
+
* `saveDrafts` - so a draft invalidated by a later edit blocks the save.
|
|
281
|
+
*
|
|
282
|
+
* Return nothing to pass, a message, or Form's `{ form, fields }` shape;
|
|
283
|
+
* pathed issues land on the committing row's cells, pathless ones on the row.
|
|
284
|
+
* `onSubmit` runs first, and its failure stands without `onSubmitAsync`
|
|
285
|
+
* running.
|
|
286
|
+
*/
|
|
287
|
+
type TMDataGridTableValidators<TData extends RowData = TMDataGridRowData> = {
|
|
288
|
+
onSubmit?: (args: TMDataGridTableValidateArgs<TData>) => unknown;
|
|
289
|
+
onSubmitAsync?: (args: TMDataGridTableValidateArgs<TData>) => unknown | Promise<unknown>;
|
|
290
|
+
};
|
|
350
291
|
/** One field's before/after across a commit. */
|
|
351
292
|
type TMDataGridEditChange = {
|
|
352
293
|
/** Column the field maps back to, for consumers thinking in columns. */
|
|
@@ -664,6 +605,13 @@ type TMDataGridEditApi<TData extends RowData = TMDataGridRowData> = {
|
|
|
664
605
|
canEditCell: (row: ErasedRow, column: ErasedColumn) => boolean;
|
|
665
606
|
/** Whether the row takes edits at all - the edit lane's pencil gate. */
|
|
666
607
|
canEditRow: (row: ErasedRow) => boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Whether the column takes edits at all, with no row in hand: it maps to a
|
|
610
|
+
* field, `editing.columns` lists it if that option is set, and
|
|
611
|
+
* `meta.edit.enabled` is not `false`. A per-row `enabled` predicate is the
|
|
612
|
+
* row's half of the question - `canEditCell` asks both.
|
|
613
|
+
*/
|
|
614
|
+
isColumnEditable: (column: ErasedColumn) => boolean;
|
|
667
615
|
/**
|
|
668
616
|
* Opens an editor. In row mode the whole row opens either way and `columnId`
|
|
669
617
|
* only says which cell takes the caret; `null` (the lane's pencil) leaves it
|
|
@@ -712,6 +660,31 @@ type TMDataGridEditApi<TData extends RowData = TMDataGridRowData> = {
|
|
|
712
660
|
submitAll: () => Promise<boolean>;
|
|
713
661
|
/** Writes the type's empty value into a cell and commits it - Delete. */
|
|
714
662
|
clearCell: (rowId: string, columnId: string) => Promise<boolean>;
|
|
663
|
+
/**
|
|
664
|
+
* Writes one cell and commits the row - a typed edit without the typing,
|
|
665
|
+
* for toolbar actions and bulk fills. Under `editing.draft` the row parks
|
|
666
|
+
* in the draft store exactly as a hand-made edit does, so it carries the
|
|
667
|
+
* same change markers and the same per-row revert.
|
|
668
|
+
*
|
|
669
|
+
* The row need not be mounted; a row inside a collapsed group takes the
|
|
670
|
+
* write. Resolves `false` when the cell takes no edit - no such row or
|
|
671
|
+
* column, `editing.columns` excludes it, `meta.edit.enabled` is off, or the
|
|
672
|
+
* row is not editable - and when validation refuses the value, which leaves
|
|
673
|
+
* the row open carrying its errors.
|
|
674
|
+
*
|
|
675
|
+
* `value` is the stored value: no editor runs, so `meta.edit.mapValue`
|
|
676
|
+
* does not either. `meta.edit.validate` does.
|
|
677
|
+
*/
|
|
678
|
+
setCellValue: (rowId: string, columnId: string, value: unknown) => Promise<boolean>;
|
|
679
|
+
/**
|
|
680
|
+
* {@link setCellValue} for several cells of one row, in a single commit -
|
|
681
|
+
* one consumer call and one draft entry rather than one per column. Keys
|
|
682
|
+
* are column ids.
|
|
683
|
+
*
|
|
684
|
+
* All or nothing: if any named cell takes no edit, nothing is written and
|
|
685
|
+
* this resolves `false`.
|
|
686
|
+
*/
|
|
687
|
+
setRowValues: (rowId: string, values: Record<string, unknown>) => Promise<boolean>;
|
|
715
688
|
/**
|
|
716
689
|
* Opens a new entry row (the sticky block under the header) seeded from
|
|
717
690
|
* `newRowDefaults`. `values` overrides that seed key by key, so
|
|
@@ -1763,6 +1736,27 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1763
1736
|
* Pathed issues land on the matching columns; pathless ones on the row.
|
|
1764
1737
|
*/
|
|
1765
1738
|
rowValidators?: TMDataGridRowValidators;
|
|
1739
|
+
/**
|
|
1740
|
+
* Rules that need the other rows - no duplicate keys, no overlapping
|
|
1741
|
+
* ranges, allocations summing to a total. Handed the committing row and
|
|
1742
|
+
* `rows`, the collection as it would stand if the commit landed: every
|
|
1743
|
+
* draft overlaid, entry rows appended, deletion-marked rows removed.
|
|
1744
|
+
*
|
|
1745
|
+
* ```tsx
|
|
1746
|
+
* tableValidators: {
|
|
1747
|
+
* onSubmit: ({ value, rowId, rows }) =>
|
|
1748
|
+
* rows.some((r) => r.rowId !== rowId && r.value.code === value.code)
|
|
1749
|
+
* ? { fields: { code: "Duplicate code" } }
|
|
1750
|
+
* : undefined,
|
|
1751
|
+
* }
|
|
1752
|
+
* ```
|
|
1753
|
+
*
|
|
1754
|
+
* Runs at every commit, after the row's own validators, and again per
|
|
1755
|
+
* parked row during `saveDrafts` - a draft another edit has invalidated
|
|
1756
|
+
* blocks the save. Pathed issues land on the committing row's cells,
|
|
1757
|
+
* pathless ones on the row.
|
|
1758
|
+
*/
|
|
1759
|
+
tableValidators?: TMDataGridTableValidators<TData>;
|
|
1766
1760
|
/** Rows the pencil skips - `false` keeps a row read-only in every mode. */
|
|
1767
1761
|
isRowEditable?: (row: Row<TMDataGridFeatures, TData>) => boolean;
|
|
1768
1762
|
/**
|
|
@@ -1833,6 +1827,20 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1833
1827
|
type TMDataGridEditingOptions<TData extends RowData> = TMDataGridEditingCallbacks<TData> & {
|
|
1834
1828
|
/** What counts as a commit. See the table above. */
|
|
1835
1829
|
mode: TMDataGridEditMode;
|
|
1830
|
+
/**
|
|
1831
|
+
* The column ids that take edits, by id. Unset - the default - every
|
|
1832
|
+
* column mapping to a data path is editable, which is what a grid whose
|
|
1833
|
+
* columns are mostly the record itself wants.
|
|
1834
|
+
*
|
|
1835
|
+
* Set it for the other shape: a grid of reference data with one or two
|
|
1836
|
+
* columns the user maintains, where naming those is shorter and harder to
|
|
1837
|
+
* get wrong than switching every other column off one by one.
|
|
1838
|
+
*
|
|
1839
|
+
* This gates before `meta.edit`, never past it: a column left out takes no
|
|
1840
|
+
* edits whatever its own meta says, and a column listed here still answers
|
|
1841
|
+
* to its `meta.edit.enabled`.
|
|
1842
|
+
*/
|
|
1843
|
+
columns?: ReadonlyArray<string>;
|
|
1836
1844
|
} & ({
|
|
1837
1845
|
/**
|
|
1838
1846
|
* Commits park in the grid's draft store instead of reaching the
|
|
@@ -2142,6 +2150,130 @@ declare function useTMDataGrid<TData extends RowData>({ persist, labels: labelsO
|
|
|
2142
2150
|
*/
|
|
2143
2151
|
declare function openColumnFilter<TData extends RowData>(api: TMDataGridApi<TData>, columnId: string): void;
|
|
2144
2152
|
//#endregion
|
|
2153
|
+
//#region .types-tmp/components/TMDataGridDraftActions.d.ts
|
|
2154
|
+
/** What the edit chrome is showing. */
|
|
2155
|
+
type TMDataGridDraftActionsState = {
|
|
2156
|
+
/**
|
|
2157
|
+
* Rows in the draft store, which is what Save sends: committed edits,
|
|
2158
|
+
* committed entry rows and deletion marks.
|
|
2159
|
+
*/
|
|
2160
|
+
draftCount: number;
|
|
2161
|
+
/**
|
|
2162
|
+
* Rows still open - edited or entered but not committed, so not part of
|
|
2163
|
+
* the save. They stay open across a save.
|
|
2164
|
+
*/
|
|
2165
|
+
openCount: number;
|
|
2166
|
+
/**
|
|
2167
|
+
* The ids behind {@link openCount}, in the order the grid opened them - a
|
|
2168
|
+
* sort, a filter or a page never moves this list. An entered row appears as
|
|
2169
|
+
* its `tempId`.
|
|
2170
|
+
*
|
|
2171
|
+
* Narrower than `edit.state.openRowIds`, which is every row holding a form,
|
|
2172
|
+
* the parked ones included. And note the ordering:
|
|
2173
|
+
* {@link TMDataGridDraftActionsActions.scrollToFirstOpenRow} takes "first"
|
|
2174
|
+
* in display order, so it need not be `openRowIds[0]`.
|
|
2175
|
+
*/
|
|
2176
|
+
openRowIds: ReadonlyArray<string>;
|
|
2177
|
+
/**
|
|
2178
|
+
* @deprecated Was "everything uncommitted", which Save no longer sends.
|
|
2179
|
+
* Reads as `draftCount + openCount`; use whichever you meant.
|
|
2180
|
+
*/
|
|
2181
|
+
pendingCount: number;
|
|
2182
|
+
/** Whether a submit is in flight. */
|
|
2183
|
+
isSubmitting: boolean;
|
|
2184
|
+
};
|
|
2185
|
+
/** What the edit chrome can do. */
|
|
2186
|
+
type TMDataGridDraftActionsActions = {
|
|
2187
|
+
/** Saves the draft store. Open rows are left alone. */
|
|
2188
|
+
save: () => Promise<boolean>;
|
|
2189
|
+
/** Submits every open row, committing the ones that validate. */
|
|
2190
|
+
commitAll: () => Promise<boolean>;
|
|
2191
|
+
/** Drops everything - open form state and the draft store alike. */
|
|
2192
|
+
discard: () => void;
|
|
2193
|
+
/**
|
|
2194
|
+
* `grid.scrollToRow`, so a control in here can take the user to a row
|
|
2195
|
+
* without the grid being threaded down to it.
|
|
2196
|
+
*/
|
|
2197
|
+
scrollToRow: (args: TMDataGridScrollToRowArgs) => boolean;
|
|
2198
|
+
/**
|
|
2199
|
+
* Scrolls to the first row still open, taking "first" in display order: the
|
|
2200
|
+
* topmost open row under the current sort, filter and page. That need not
|
|
2201
|
+
* be {@link TMDataGridDraftActionsState.openRowIds}`[0]`, which is the
|
|
2202
|
+
* order the grid opened them in.
|
|
2203
|
+
*
|
|
2204
|
+
* Answers whether an open row could be reached. `false` when nothing is
|
|
2205
|
+
* open, and when every open row is filtered out, on another page or
|
|
2206
|
+
* collapsed inside a group. An open entry row answers `true` without
|
|
2207
|
+
* scrolling - it is sticky under the header, so it is on screen already -
|
|
2208
|
+
* and so does an open row pinned to an edge. The scroll goes through
|
|
2209
|
+
* `scrollToRow`, so before `TMDataGrid.Table` has mounted there is nothing
|
|
2210
|
+
* to scroll and the answer is `false`.
|
|
2211
|
+
*/
|
|
2212
|
+
scrollToFirstOpenRow: (align?: TMDataGridScrollAlign) => boolean;
|
|
2213
|
+
};
|
|
2214
|
+
/** The pre-bound pieces of the built-in edit chrome. */
|
|
2215
|
+
type TMDataGridDraftActionsControls = {
|
|
2216
|
+
/** Save, with the draft count, disabled while the draft store is empty. */
|
|
2217
|
+
Save: () => ReactNode;
|
|
2218
|
+
/** Discard, disabled while nothing is pending. */
|
|
2219
|
+
Discard: () => ReactNode;
|
|
2220
|
+
/** The "N rows still being edited" note, or nothing while there are none. */
|
|
2221
|
+
OpenRowsNote: () => ReactNode;
|
|
2222
|
+
};
|
|
2223
|
+
/** What {@link TMDataGridDraftActionsProps.renderActions} is handed. */
|
|
2224
|
+
type TMDataGridDraftActionsSlotArgs = {
|
|
2225
|
+
state: TMDataGridDraftActionsState;
|
|
2226
|
+
actions: TMDataGridDraftActionsActions;
|
|
2227
|
+
Controls: TMDataGridDraftActionsControls;
|
|
2228
|
+
};
|
|
2229
|
+
type TMDataGridDraftActionsProps = {
|
|
2230
|
+
/**
|
|
2231
|
+
* Replaces the built-in Save/Discard pair, and is handed the pieces of it.
|
|
2232
|
+
*
|
|
2233
|
+
* ```tsx
|
|
2234
|
+
* <TMDataGrid.DraftActions
|
|
2235
|
+
* renderActions={({ state, Controls }) => (
|
|
2236
|
+
* <Group>
|
|
2237
|
+
* {state.draftCount > 0 && <Badge>{state.draftCount}</Badge>}
|
|
2238
|
+
* <Controls.OpenRowsNote />
|
|
2239
|
+
* <Controls.Save />
|
|
2240
|
+
* <Controls.Discard />
|
|
2241
|
+
* </Group>
|
|
2242
|
+
* )}
|
|
2243
|
+
* />
|
|
2244
|
+
* ```
|
|
2245
|
+
*/
|
|
2246
|
+
renderActions?: (args: TMDataGridDraftActionsSlotArgs) => ReactNode;
|
|
2247
|
+
};
|
|
2248
|
+
/**
|
|
2249
|
+
* The draft store's toolbar chrome: Save with the store's count, Discard, and
|
|
2250
|
+
* a note counting the rows still open. Save sends the store and leaves open
|
|
2251
|
+
* rows alone, so it greys out while nothing is parked however much is being
|
|
2252
|
+
* typed - the note is what makes those rows visible.
|
|
2253
|
+
*
|
|
2254
|
+
* Works under any `editing.mode`. The toolbar is declarative: the grid does
|
|
2255
|
+
* not decide for you, so include this only when the grid runs a draft store -
|
|
2256
|
+
* without `editing.draft` there is nothing to save and Save stays disabled.
|
|
2257
|
+
*
|
|
2258
|
+
* ```tsx
|
|
2259
|
+
* <TMDataGrid.Toolbar>
|
|
2260
|
+
* <TMDataGrid.SummaryCount />
|
|
2261
|
+
* <TMDataGrid.Spacer />
|
|
2262
|
+
* <TMDataGrid.DraftActions />
|
|
2263
|
+
* </TMDataGrid.Toolbar>
|
|
2264
|
+
* ```
|
|
2265
|
+
*/
|
|
2266
|
+
declare function TMDataGridDraftActions({ renderActions }?: TMDataGridDraftActionsProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
|
|
2267
|
+
//#endregion
|
|
2268
|
+
//#region .types-tmp/components/TMDataGridFilterPanel.d.ts
|
|
2269
|
+
/**
|
|
2270
|
+
* The MUI-style filter surface: one row per active column filter, each row a
|
|
2271
|
+
* column / operator / value triple. It only ever reads and writes the table's
|
|
2272
|
+
* `columnFilters` state, so a `manualFiltering` grid gets the same panel for
|
|
2273
|
+
* free - the state is forwarded to the server instead of a row model.
|
|
2274
|
+
*/
|
|
2275
|
+
declare function TMDataGridFilterPanel(): import("react").JSX.Element | null;
|
|
2276
|
+
//#endregion
|
|
2145
2277
|
//#region .types-tmp/components/TMDataGridFilterPills.d.ts
|
|
2146
2278
|
type TMDataGridFilterPillsProps<TData extends RowData> = {
|
|
2147
2279
|
/** The object returned by `useTMDataGrid`. */
|
|
@@ -3050,6 +3182,10 @@ type TMDataGridAggregationName = keyof typeof aggregationFns;
|
|
|
3050
3182
|
* Filtered rather than paginated rows, so the total covers everything the
|
|
3051
3183
|
* filters left (all pages), and follows the filters as they change. Reuses
|
|
3052
3184
|
* TanStack's registered aggregation functions; `fn` defaults to `"sum"`.
|
|
3185
|
+
*
|
|
3186
|
+
* Every data row counts once. Grouping builds its group rows from this model
|
|
3187
|
+
* rather than into it, so a grouped grid totals its records, not its records
|
|
3188
|
+
* plus their subtotals; a tree counts parents and children alike.
|
|
3053
3189
|
*/
|
|
3054
3190
|
declare function aggregateColumn<TData extends RowData>({ table, columnId, fn }: {
|
|
3055
3191
|
table: TMDataGridTable<TData>;
|
|
@@ -3294,4 +3430,4 @@ declare function getSelectableRowIds<TData extends RowData>(row: Row<TMDataGridF
|
|
|
3294
3430
|
*/
|
|
3295
3431
|
declare function resolveRowSelectionClick<TData extends RowData>({ rows, rowId, anchorRowId, modifiers, selection, canReplaceSelection }: ResolveRowSelectionClickArgs<TData>): ResolvedRowSelection;
|
|
3296
3432
|
//#endregion
|
|
3297
|
-
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, TMDataGridDraftActions, type TMDataGridDraftActionsActions, type TMDataGridDraftActionsControls, type TMDataGridDraftActionsProps, type TMDataGridDraftActionsSlotArgs, type TMDataGridDraftActionsState, type TMDataGridDropSide, 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 };
|
|
3433
|
+
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, TMDataGridDraftActions, type TMDataGridDraftActionsActions, type TMDataGridDraftActionsControls, type TMDataGridDraftActionsProps, type TMDataGridDraftActionsSlotArgs, type TMDataGridDraftActionsState, type TMDataGridDropSide, 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 TMDataGridTableValidateArgs, type TMDataGridTableValidators, 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 };
|