@jielga/tmdatagrid 2.0.0-beta.13 → 2.0.0-beta.15

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.
Files changed (139) hide show
  1. package/README.md +5 -212
  2. package/dist/index.d.ts +967 -610
  3. package/dist/index.js +2944 -2327
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +1 -1
  6. package/docs/anatomy.md +102 -0
  7. package/docs/cell-selection.md +154 -0
  8. package/docs/column-layout.md +204 -0
  9. package/docs/columns.md +262 -0
  10. package/docs/components.md +303 -0
  11. package/docs/editing.md +572 -0
  12. package/docs/editors.md +248 -0
  13. package/docs/export.md +326 -0
  14. package/docs/filtering.md +358 -0
  15. package/docs/getting-started.md +123 -0
  16. package/docs/grouping.md +165 -0
  17. package/docs/loading-and-empty.md +92 -0
  18. package/docs/localization.md +79 -0
  19. package/docs/menu.md +143 -0
  20. package/docs/pagination.md +144 -0
  21. package/docs/persistence.md +111 -0
  22. package/docs/portfolio-rebalancer.md +94 -0
  23. package/docs/query-builder.md +175 -0
  24. package/docs/quick-search.md +83 -0
  25. package/docs/row-details.md +111 -0
  26. package/docs/row-interaction.md +148 -0
  27. package/docs/row-pinning.md +132 -0
  28. package/docs/row-selection.md +134 -0
  29. package/docs/row-styling.md +133 -0
  30. package/docs/scrolling.md +111 -0
  31. package/docs/server-query.md +246 -0
  32. package/docs/server-side.md +206 -0
  33. package/docs/sorting.md +101 -0
  34. package/docs/styling.md +126 -0
  35. package/docs/summary-row.md +76 -0
  36. package/docs/testing.md +309 -0
  37. package/docs/toolbar.md +161 -0
  38. package/docs/use-tm-data-grid.md +361 -0
  39. package/package.json +21 -45
  40. package/skills/appearance/SKILL.md +31 -15
  41. package/skills/cell-selection/SKILL.md +44 -41
  42. package/skills/columns/SKILL.md +33 -32
  43. package/skills/data/SKILL.md +85 -15
  44. package/skills/editing/SKILL.md +6 -6
  45. package/skills/editing/references/common-mistakes.md +12 -12
  46. package/skills/filtering/SKILL.md +40 -18
  47. package/skills/getting-started/SKILL.md +5 -5
  48. package/skills/grouping/SKILL.md +11 -11
  49. package/skills/options/SKILL.md +5 -5
  50. package/skills/rows/SKILL.md +15 -15
  51. package/skills/server-side/SKILL.md +131 -7
  52. package/skills/testing/SKILL.md +4 -4
  53. package/src/{tmdatagrid/components → components}/TMDataGrid.tsx +28 -20
  54. package/src/{tmdatagrid/components → components}/TMDataGridCellEditor.tsx +5 -4
  55. package/src/{tmdatagrid/components → components}/TMDataGridColumnsPanel.module.css +5 -1
  56. package/src/{tmdatagrid/components → components}/TMDataGridColumnsPanel.tsx +40 -15
  57. package/src/components/TMDataGridExportPicker.module.css +77 -0
  58. package/src/components/TMDataGridExportPicker.tsx +234 -0
  59. package/src/{tmdatagrid/components → components}/TMDataGridFilterPanel.tsx +22 -6
  60. package/src/{tmdatagrid/components → components}/TMDataGridFilterPills.tsx +7 -5
  61. package/src/{tmdatagrid/components → components}/TMDataGridFilterSurface.tsx +8 -3
  62. package/src/{tmdatagrid/components → components}/TMDataGridFooter.tsx +20 -7
  63. package/src/{tmdatagrid/components → components}/TMDataGridHeaderCell.tsx +16 -5
  64. package/src/{tmdatagrid/components → components}/TMDataGridHeaderFilterRow.tsx +2 -4
  65. package/src/{tmdatagrid/components → components}/TMDataGridMenu.tsx +115 -16
  66. package/src/{tmdatagrid/components → components}/TMDataGridSelectColumn.tsx +2 -1
  67. package/src/{tmdatagrid/components → components}/TMDataGridTable.tsx +74 -55
  68. package/src/{tmdatagrid/components → components}/TMDataGridToolbar.module.css +5 -0
  69. package/src/{tmdatagrid/components → components}/TMDataGridToolbar.tsx +44 -8
  70. package/src/{tmdatagrid/components → components}/editors/editorShared.ts +2 -1
  71. package/src/{tmdatagrid/components → components}/icons.ts +1 -0
  72. package/src/{tmdatagrid/core → core}/autosize.ts +5 -2
  73. package/src/{tmdatagrid/core → core}/columnOrdering.ts +33 -14
  74. package/src/{tmdatagrid/core → core}/columnUtils.ts +44 -5
  75. package/src/core/dom.ts +74 -0
  76. package/src/core/export.ts +840 -0
  77. package/src/{tmdatagrid/core → core}/filterControls.ts +10 -1
  78. package/src/{tmdatagrid/core → core}/labels.ts +40 -2
  79. package/src/{tmdatagrid/core → core}/labelsSv.ts +17 -1
  80. package/src/{tmdatagrid/core → core}/persistence.ts +22 -5
  81. package/src/{tmdatagrid/core → core}/summary.ts +20 -4
  82. package/src/{tmdatagrid/index.ts → index.ts} +43 -4
  83. package/src/{tmdatagrid/useTMDataGrid.tsx → useTMDataGrid.tsx} +100 -45
  84. package/src/useTMDataGridExport.ts +78 -0
  85. package/src/tmdatagrid/core/cellExport.ts +0 -320
  86. /package/src/{tmdatagrid/TMDataGridContext.ts → TMDataGridContext.ts} +0 -0
  87. /package/src/{tmdatagrid/components → components}/TMDataGrid.module.css +0 -0
  88. /package/src/{tmdatagrid/components → components}/TMDataGridDetailsColumn.module.css +0 -0
  89. /package/src/{tmdatagrid/components → components}/TMDataGridDetailsColumn.tsx +0 -0
  90. /package/src/{tmdatagrid/components → components}/TMDataGridDraftActions.tsx +0 -0
  91. /package/src/{tmdatagrid/components → components}/TMDataGridEditColumn.tsx +0 -0
  92. /package/src/{tmdatagrid/components → components}/TMDataGridEntryRows.tsx +0 -0
  93. /package/src/{tmdatagrid/components → components}/TMDataGridFilterPanel.module.css +0 -0
  94. /package/src/{tmdatagrid/components → components}/TMDataGridFilterPills.module.css +0 -0
  95. /package/src/{tmdatagrid/components → components}/TMDataGridFilterSurface.module.css +0 -0
  96. /package/src/{tmdatagrid/components → components}/TMDataGridFooter.module.css +0 -0
  97. /package/src/{tmdatagrid/components → components}/TMDataGridGroupColumn.module.css +0 -0
  98. /package/src/{tmdatagrid/components → components}/TMDataGridGroupColumn.tsx +0 -0
  99. /package/src/{tmdatagrid/components → components}/TMDataGridHeaderCell.module.css +0 -0
  100. /package/src/{tmdatagrid/components → components}/TMDataGridHeaderFilterRow.module.css +0 -0
  101. /package/src/{tmdatagrid/components → components}/TMDataGridRowNumberColumn.tsx +0 -0
  102. /package/src/{tmdatagrid/components → components}/TMDataGridSearch.tsx +0 -0
  103. /package/src/{tmdatagrid/components → components}/TMDataGridTable.module.css +0 -0
  104. /package/src/{tmdatagrid/components → components}/editors/TMDataGridBooleanEditor.tsx +0 -0
  105. /package/src/{tmdatagrid/components → components}/editors/TMDataGridDateEditor.tsx +0 -0
  106. /package/src/{tmdatagrid/components → components}/editors/TMDataGridMultiSelectEditor.tsx +0 -0
  107. /package/src/{tmdatagrid/components → components}/editors/TMDataGridNumberEditor.tsx +0 -0
  108. /package/src/{tmdatagrid/components → components}/editors/TMDataGridSelectEditor.tsx +0 -0
  109. /package/src/{tmdatagrid/components → components}/editors/TMDataGridStringEditor.tsx +0 -0
  110. /package/src/{tmdatagrid/components → components}/filters/DgAutocompleteFilter.tsx +0 -0
  111. /package/src/{tmdatagrid/components → components}/filters/DgDateRangeFilter.tsx +0 -0
  112. /package/src/{tmdatagrid/components → components}/filters/DgRangeSliderFilter.tsx +0 -0
  113. /package/src/{tmdatagrid/components → components}/filters/DgTriStateFilter.tsx +0 -0
  114. /package/src/{tmdatagrid/components → components}/filters/TMDataGridFilterValueInput.tsx +0 -0
  115. /package/src/{tmdatagrid/components → components}/filters/controlLayout.ts +0 -0
  116. /package/src/{tmdatagrid/components → components}/filters/filterControlFor.ts +0 -0
  117. /package/src/{tmdatagrid/components → components}/sticky.module.css +0 -0
  118. /package/src/{tmdatagrid/components → components}/useHideableColumns.ts +0 -0
  119. /package/src/{tmdatagrid/core → core}/capabilities.ts +0 -0
  120. /package/src/{tmdatagrid/core → core}/cellNavigation.ts +0 -0
  121. /package/src/{tmdatagrid/core → core}/cellRange.ts +0 -0
  122. /package/src/{tmdatagrid/core → core}/columnOptions.ts +0 -0
  123. /package/src/{tmdatagrid/core → core}/controlledState.ts +0 -0
  124. /package/src/{tmdatagrid/core → core}/controlledStateSync.ts +0 -0
  125. /package/src/{tmdatagrid/core → core}/draftCellContext.ts +0 -0
  126. /package/src/{tmdatagrid/core → core}/editEngine.ts +0 -0
  127. /package/src/{tmdatagrid/core → core}/editorFocus.ts +0 -0
  128. /package/src/{tmdatagrid/core → core}/expanding.ts +0 -0
  129. /package/src/{tmdatagrid/core → core}/filterOperators.ts +0 -0
  130. /package/src/{tmdatagrid/core → core}/filterSurface.ts +0 -0
  131. /package/src/{tmdatagrid/core → core}/grouping.ts +0 -0
  132. /package/src/{tmdatagrid/core → core}/matchHighlight.ts +0 -0
  133. /package/src/{tmdatagrid/core → core}/pageReset.ts +0 -0
  134. /package/src/{tmdatagrid/core → core}/quickSearch.ts +0 -0
  135. /package/src/{tmdatagrid/core → core}/resizePreview.ts +0 -0
  136. /package/src/{tmdatagrid/core → core}/rowPinning.ts +0 -0
  137. /package/src/{tmdatagrid/core → core}/rowSelection.ts +0 -0
  138. /package/src/{tmdatagrid/core → core}/sizes.ts +0 -0
  139. /package/src/{tmdatagrid/core → core}/useSettledTableState.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,62 +1,9 @@
1
- import { MantineSize, MenuProps } from "@mantine/core";
1
+ import { BoxProps, MantineSize, MenuProps } from "@mantine/core";
2
2
  import { CSSProperties, ComponentType, MouseEvent, MutableRefObject, ReactNode } from "react";
3
3
  import { Cell, Column, ColumnFiltersState, ColumnPinningState, ExpandedState, Header, Row, RowData, RowSelectionState, Table, TableFeatures, TableOptions, TableState, aggregationFns } from "@tanstack/react-table";
4
4
  import { Store } from "@tanstack/store";
5
5
  import { AnyFieldApi, AnyFormApi, StandardSchemaV1 } from "@tanstack/react-form";
6
6
  import { RankingInfo } from "@tanstack/match-sorter-utils";
7
- //#region .types-tmp/components/TMDataGridMenu.d.ts
8
- type TMDataGridMenuProps = Omit<MenuProps, "children"> & {
9
- /** The dropdown's content: Mantine `Menu.Item`s and the `TMDataGrid.Menu.*` items. */
10
- children: ReactNode;
11
- /** Replaces the burger icon on the trigger. */
12
- icon?: ReactNode;
13
- /** Tooltip and `aria-label` of the trigger. Default `labels.menuButton`. */
14
- label?: string;
15
- };
16
- type TMDataGridMenuColumnsProps = {
17
- /** Renders a `Menu.Search` above the toggles. Default `true`. Use `false` inside a `Menu.Sub`. */
18
- searchable?: boolean;
19
- };
20
- /**
21
- * The whole column chooser as menu items: a search box, one checkbox item per
22
- * hideable column, show/hide all, and Reset layout. Renders nothing when no
23
- * column can be hidden.
24
- *
25
- * `searchable` is only for a block at the top level of a dropdown.
26
- * `Menu.Search` registers on the root menu context (`hasSearch`), which
27
- * switches off type-ahead and the arrow-key handling of every dropdown of that
28
- * menu, so a search inside a `Menu.Sub` breaks the parent menu's keyboard
29
- * behaviour.
30
- */
31
- declare function TMDataGridMenuColumns({ searchable }: TMDataGridMenuColumnsProps): import("react").JSX.Element | null;
32
- /**
33
- * One checkbox item per hideable column, narrowed to `search` when one is
34
- * given. Renders nothing when no column can be hidden.
35
- */
36
- declare function TMDataGridMenuColumnToggles({ search }: {
37
- search?: string;
38
- }): import("react").JSX.Element | null;
39
- /**
40
- * Shows or hides every listed column at once. Renders nothing when no column
41
- * can be hidden.
42
- */
43
- declare function TMDataGridMenuShowHideAll(): import("react").JSX.Element | null;
44
- /**
45
- * Resets the whole layout, not only visibility: order, widths, pinning and
46
- * grouping go back too. Not `table.resetColumnVisibility()`, which resets to
47
- * `initialState` - and under persistence the mount built that *from* the
48
- * persisted payload.
49
- */
50
- declare function TMDataGridMenuResetLayout(): import("react").JSX.Element;
51
- //#endregion
52
- //#region .types-tmp/components/TMDataGridColumnsPanel.d.ts
53
- /**
54
- * The "Manage columns" surface as plain controls, for a host that is not a
55
- * menu - a Popover, a Drawer, an inline layout. `TMDataGrid.Menu.Columns` is
56
- * the same chooser as menu items.
57
- */
58
- declare function TMDataGridColumnsPanel(): import("react").JSX.Element;
59
- //#endregion
60
7
  //#region .types-tmp/core/sizes.d.ts
61
8
  type TMDataGridSize = MantineSize;
62
9
  declare const DEFAULT_TMDATAGRID_SIZE: TMDataGridSize;
@@ -150,100 +97,6 @@ type ComboboxData = Array<ComboboxItem | {
150
97
  */
151
98
  declare function optionsToComboboxData(options: ReadonlyArray<TMDataGridOption>): ComboboxData;
152
99
  //#endregion
153
- //#region .types-tmp/core/filterOperators.d.ts
154
- /**
155
- * The value shape stored in `columnFilters` for every TMDataGrid column.
156
- *
157
- * TanStack resolves `filterFn` statically per column, so the operator travels
158
- * inside the filter *value* instead. That keeps the filter model plain,
159
- * serialisable JSON, so a server-side `manualFiltering` table can forward
160
- * `columnFilters` to the API unchanged.
161
- *
162
- * `value` is a string array under `isAnyOf` / `isNoneOf` (the set the cell is
163
- * tested against), a `[min, max]` pair under `between` (an empty string means
164
- * that end is open), and a single string everywhere else - dates travel as
165
- * ISO `YYYY-MM-DD` strings, booleans as `"true"` / `"false"`. Still plain
166
- * JSON.
167
- */
168
- type TMDataGridFilterValue = {
169
- operator: TMDataGridFilterOperator;
170
- value: string | ReadonlyArray<string>;
171
- };
172
- type TMDataGridColumnType = "string" | "number" | "boolean" | "date" | "select" | "multiSelect";
173
- type TMDataGridFilterOperator = "contains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "greaterThan" | "greaterThanOrEqual" | "lessThan" | "lessThanOrEqual" | "between" | "before" | "after" | "onOrBefore" | "onOrAfter" | "isAnyOf" | "isNoneOf" | "isEmpty" | "isNotEmpty";
174
- declare const FILTER_OPERATOR_LABELS: Record<TMDataGridFilterOperator, string>;
175
- declare function getOperatorsForType(type: TMDataGridColumnType): readonly TMDataGridFilterOperator[];
176
- declare function getDefaultOperator(type: TMDataGridColumnType): TMDataGridFilterOperator;
177
- declare function operatorNeedsValue(operator: TMDataGridFilterOperator): boolean;
178
- /** Whether the operator's value is a string array - `isAnyOf` / `isNoneOf`. */
179
- declare function operatorTakesArrayValue(operator: TMDataGridFilterOperator): boolean;
180
- /** Whether the operator's value is a `[min, max]` pair - `between`. */
181
- declare function operatorTakesRangeValue(operator: TMDataGridFilterOperator): boolean;
182
- /** The untouched value a fresh filter starts with - the operator's shape, empty. */
183
- declare function emptyValueForOperator(operator: TMDataGridFilterOperator): string | ReadonlyArray<string>;
184
- /**
185
- * The three value shapes an operator can take. A set is not a range, even
186
- * though both are arrays.
187
- */
188
- type TMDataGridFilterValueShape = "scalar" | "set" | "range";
189
- /**
190
- * Which shape an operator's value takes. A typed value survives an operator or
191
- * column change only within its shape, which is the rule both the panel and
192
- * the header controls use when the operator changes.
193
- */
194
- declare function filterValueShape(operator: TMDataGridFilterOperator): TMDataGridFilterValueShape;
195
- /**
196
- * A filter only narrows the row set once it has something to compare against.
197
- * Half-typed filters stay in state (so the panel keeps rendering their row) but
198
- * are treated as inactive for the funnel indicator and for row matching.
199
- */
200
- declare function isFilterActive(value: unknown): boolean;
201
- /** One column's filter, typed - what `columnFilters` holds per entry. */
202
- type TMDataGridColumnFilter = {
203
- id: string;
204
- value: TMDataGridFilterValue;
205
- };
206
- /**
207
- * The column filters that are actually narrowing the grid, typed.
208
- *
209
- * `ColumnFiltersState` types `value` as `unknown`, so the first line of a
210
- * server-side mapping layer is otherwise a cast back to the shape the grid
211
- * itself wrote, wrapped in the same "drop the half-typed ones" filter every
212
- * consumer writes:
213
- *
214
- * ```ts
215
- * const predicates = activeColumnFilters(table).map((filter) =>
216
- * toPredicate(filter.id, filter.value),
217
- * );
218
- * ```
219
- *
220
- * Takes the table, or a `columnFilters` array where the consumer owns the
221
- * slice. Reading it from the table reads the current value and does not
222
- * subscribe; inside a component, subscribe to `columnFilters` the way the
223
- * grid's own chrome does.
224
- */
225
- declare function activeColumnFilters<TData extends RowData>(source: TMDataGridTable<TData> | ColumnFiltersState): Array<TMDataGridColumnFilter>;
226
- /**
227
- * One-line description of a single filter, as shown on a filter pill.
228
- *
229
- * The type's default operator is left implicit - "First name: Sofia" reads the
230
- * way a person would say it - while any other operator is spelled out, since
231
- * that is the part a reader cannot guess.
232
- */
233
- declare function formatFilterLabel({ label, type, filter, operatorLabels }: {
234
- label: string;
235
- type: TMDataGridColumnType;
236
- filter: TMDataGridFilterValue;
237
- /** Localized operator names - `labels.operators`. Defaults to English. */
238
- operatorLabels?: Record<TMDataGridFilterOperator, string>;
239
- }): string;
240
- /**
241
- * The single filter function every TMDataGrid column uses. It dispatches on the
242
- * operator carried by the filter value, which is what lets one column offer
243
- * "contains" / "does not equal" / "is empty" without redefining the column.
244
- */
245
- declare function tmDataGridFilterFn<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown): boolean;
246
- //#endregion
247
100
  //#region .types-tmp/core/editEngine.d.ts
248
101
  /**
249
102
  * What counts as a commit - one axis, each mode a thin policy over the same
@@ -451,8 +304,8 @@ type TMDataGridEditState = {
451
304
  /** The draft store's delete slice: rows marked deleted, awaiting the save. */
452
305
  deletedRowIds: ReadonlyArray<string>;
453
306
  };
454
- type ErasedRow = Row<TMDataGridFeatures, TMDataGridRowData>;
455
- type ErasedColumn = Column<TMDataGridFeatures, TMDataGridRowData, unknown>;
307
+ type ErasedRow$1 = Row<TMDataGridFeatures, TMDataGridRowData>;
308
+ type ErasedColumn$1 = Column<TMDataGridFeatures, TMDataGridRowData, unknown>;
456
309
  /**
457
310
  * What a cell editor is handed - deliberately both vocabularies at once. The
458
311
  * form side is TanStack Form's real `field` API (`field.state.value`,
@@ -470,8 +323,8 @@ type TMDataGridEditorArgs = {
470
323
  /** The whole row form, for the rare editor that reads sibling fields. */
471
324
  form: TMDataGridRowEditForm;
472
325
  cell: Cell<TMDataGridFeatures, TMDataGridRowData, unknown>;
473
- row: ErasedRow;
474
- column: ErasedColumn;
326
+ row: ErasedRow$1;
327
+ column: ErasedColumn$1;
475
328
  table: TMDataGridTable<TMDataGridRowData>;
476
329
  /** What Enter would do - commit the edit. For the editor's own UI. */
477
330
  commit: () => Promise<boolean>;
@@ -496,8 +349,8 @@ type TMDataGridEditValueMapArgs = {
496
349
  value: unknown;
497
350
  /** What the field held before this write - for length-aware masks. */
498
351
  previous: unknown;
499
- row: ErasedRow;
500
- column: ErasedColumn;
352
+ row: ErasedRow$1;
353
+ column: ErasedColumn$1;
501
354
  table: TMDataGridTable<TMDataGridRowData>;
502
355
  };
503
356
  /**
@@ -696,16 +549,16 @@ type TMDataGridEditApi<TData extends RowData = TMDataGridRowData> = {
696
549
  * Whether this cell may open an editor: the column maps to a field, nothing
697
550
  * switched it off, and the row takes edits at all.
698
551
  */
699
- canEditCell: (row: ErasedRow, column: ErasedColumn) => boolean;
552
+ canEditCell: (row: ErasedRow$1, column: ErasedColumn$1) => boolean;
700
553
  /** Whether the row takes edits at all - the edit lane's pencil gate. */
701
- canEditRow: (row: ErasedRow) => boolean;
554
+ canEditRow: (row: ErasedRow$1) => boolean;
702
555
  /**
703
556
  * Whether the column takes edits at all, with no row in hand: it maps to a
704
557
  * field, `editing.columns` lists it if that option is set, and
705
558
  * `meta.edit.enabled` is not `false`. A per-row `enabled` predicate is the
706
559
  * row's half of the question - `canEditCell` asks both.
707
560
  */
708
- isColumnEditable: (column: ErasedColumn) => boolean;
561
+ isColumnEditable: (column: ErasedColumn$1) => boolean;
709
562
  /**
710
563
  * Opens an editor. In row mode the whole row opens either way and `columnId`
711
564
  * only says which cell takes the caret; `null` (the lane's pencil) leaves it
@@ -964,8 +817,24 @@ type TMDataGridLabels = {
964
817
  rowStateDeleted: string;
965
818
  cellCount: (count: number) => string;
966
819
  copy: string;
967
- exportCsv: string;
820
+ exportCells: string;
821
+ /** @deprecated Use `exportCells`. Read as its fallback for one beta. */
822
+ exportCsv?: string;
968
823
  includeHeaders: string;
824
+ exportAll: string;
825
+ exportSelected: (count: number) => string;
826
+ /** Title of the column picker `columns="custom"` opens; `format` is the file extension in upper case, "CSV". */
827
+ exportPickerTitle: (format: string) => string;
828
+ /** The line under the title; `selected` is the selected row count, or `null` for an export of all rows. */
829
+ exportPickerHint: (selected: number | null) => string;
830
+ exportPickerConfirm: string;
831
+ exportPickerCancel: string;
832
+ /** The select-all row over the picker's list. */
833
+ exportPickerSelectAll: string;
834
+ /** The "3 of 12" count beside it. */
835
+ exportPickerCount: (checked: number, total: number) => string;
836
+ /** Marks a column the grid hides at the moment. */
837
+ exportPickerHidden: string;
969
838
  selectColumnLabel: string;
970
839
  selectAllRows: string;
971
840
  selectRow: string;
@@ -1064,10 +933,19 @@ type TMDataGridFilterControlComponent = ComponentType<TMDataGridFilterControlArg
1064
933
  * declaration of each feeds the filter panel and the cell editor alike.
1065
934
  */
1066
935
  type TMDataGridColumnFilterOptions = {
936
+ /**
937
+ * The operators this column offers, a subset of the type's own. For a
938
+ * column backed by an endpoint that answers only some of them - `contains`
939
+ * and `equals`, say - so the panel and the header funnel never offer an
940
+ * operator the query cannot express. Kept in the type's order; one the type
941
+ * does not offer is ignored, and a list that leaves nothing falls back to
942
+ * the type's full set.
943
+ */
944
+ operators?: readonly TMDataGridFilterOperator[];
1067
945
  /**
1068
946
  * The operator a fresh filter on this column starts with, instead of the
1069
947
  * type's default - a salary column can open on `"between"`. Must be one of
1070
- * the type's own operators.
948
+ * the operators the column offers.
1071
949
  */
1072
950
  defaultOperator?: TMDataGridFilterOperator;
1073
951
  /**
@@ -1528,174 +1406,513 @@ declare function boundsEdges(bounds: TMDataGridRangeBounds | null, rowIndex: num
1528
1406
  right: boolean;
1529
1407
  } | null;
1530
1408
  //#endregion
1531
- //#region .types-tmp/useTMDataGrid.d.ts
1409
+ //#region .types-tmp/core/export.d.ts
1410
+ type ErasedRow = Row<TMDataGridFeatures, TMDataGridRowData>;
1411
+ type ErasedColumn = Column<TMDataGridFeatures, TMDataGridRowData, unknown>;
1532
1412
  /**
1533
- * Per-column configuration the grid's own components read.
1413
+ * What an export writes: the exported columns in render order, their labels,
1414
+ * and one array of raw values per row.
1534
1415
  *
1535
- * The filter and edit stages each get a namespace, `filter` and `edit`,
1536
- * mirroring the feature's runtime API. What the column *is* stays flat:
1537
- * `label`, `type`, `options`, `align`, `flex`, `autoSize`, `enableOrdering`.
1538
- * `type` and `options` are read by both stages, so one declaration of each
1539
- * feeds the filter panel and the cell editor, which is why they sit outside
1540
- * both namespaces.
1416
+ * Raw values rather than text, so a format decides how a number, a date or an
1417
+ * array is written - JSON keeps a number a number, and a spreadsheet format
1418
+ * can write a typed cell.
1541
1419
  */
1542
- type TMDataGridColumnMeta = {
1543
- /** Name shown in menus and the column manager. Falls back to a string header. */
1544
- label?: string;
1545
- /**
1546
- * Drives which filter operators are offered and, once editing is on, which
1547
- * editor the cell opens. Defaults to `"string"`.
1548
- */
1549
- type?: TMDataGridColumnType;
1550
- /**
1551
- * The choices of a `select` / `multiSelect` column - one declaration feeding
1552
- * the filter panel's value control and the cell editor alike. A static
1553
- * array, `"faceted"` (the distinct values present in the data), or a
1554
- * function of the table, column and, for editors, the row. See
1555
- * {@link TMDataGridOptionsSource}.
1556
- */
1557
- options?: TMDataGridOptionsSource;
1558
- /** Share of the leftover width this column claims. Defaults to `1`. */
1559
- flex?: number;
1560
- align?: "left" | "right" | "center";
1561
- /**
1562
- * Size the column to its widest mounted content once, after the first rows
1563
- * render - unless a persisted or user-set width already covers it. The same
1564
- * measurement as double-clicking the resize divider; see `autosizeColumn`.
1565
- */
1566
- autoSize?: boolean;
1567
- /**
1568
- * `false` keeps the column where it is: no header dragging, no move items.
1569
- * Column ordering is the one feature TanStack defines no column option for,
1570
- * so its switch lives here rather than on the column definition.
1571
- */
1572
- enableOrdering?: boolean;
1573
- /**
1574
- * How this column filters: the operator a fresh filter starts with, and the
1575
- * value control the filter panel renders for it.
1576
- *
1577
- * ```tsx
1578
- * meta: {
1579
- * type: "number",
1580
- * filter: { defaultOperator: "between", control: DgRangeSliderFilter },
1581
- * }
1582
- * ```
1583
- *
1584
- * See {@link TMDataGridColumnFilterOptions}.
1585
- */
1586
- filter?: TMDataGridColumnFilterOptions;
1587
- /**
1588
- * How this column is edited: whether it takes edits, which field they write
1589
- * to, which editor opens, what validates the field and what maps the value
1590
- * on its way in.
1591
- *
1592
- * ```tsx
1593
- * meta: {
1594
- * type: "string",
1595
- * edit: { validate: z.string().min(2, "Too short") },
1596
- * }
1597
- * ```
1598
- *
1599
- * See {@link TMDataGridColumnEditOptions}.
1600
- */
1601
- edit?: TMDataGridColumnEditOptions;
1420
+ type TMDataGridExportData = {
1421
+ columnIds: Array<string>;
1422
+ /** `getColumnLabel` per column: `meta.label`, a string header, or the id. */
1423
+ headers: Array<string>;
1424
+ rows: Array<Array<unknown>>;
1602
1425
  };
1603
- /** Grid-wide configuration passed through `options.meta`. */
1604
- type TMDataGridTableMeta = {
1605
- loading?: boolean;
1606
- noResultsLabel?: string;
1607
- /** Row height used by the virtualizer. Defaults to `52`. */
1608
- rowHeight?: number;
1426
+ type TMDataGridExportWriteOptions = {
1427
+ /** Whether the format writes the column labels as its first row. */
1428
+ includeHeaders: boolean;
1429
+ };
1430
+ /**
1431
+ * A file format an export can be written in.
1432
+ *
1433
+ * The grid ships `csvExcelFormat`, `csvFormat`, `tsvFormat` and `jsonFormat`;
1434
+ * an addon package or your own code adds one by implementing this shape.
1435
+ * `write` may be async and may answer a `Blob`, which is what a binary format
1436
+ * such as xlsx needs.
1437
+ */
1438
+ type TMDataGridExportFormat = {
1439
+ /** Identifies the format, for a menu or a test. */
1440
+ id: string;
1441
+ /** File extension without the dot, appended to the file name. */
1442
+ extension: string;
1443
+ /** The `Blob` type the download is served under. */
1444
+ mimeType: string;
1609
1445
  /**
1610
- * Unfiltered row total. Only needed for server-driven grids, where the client
1611
- * never holds the full data set - `TMDataGrid.SummaryCount` uses it as denominator.
1446
+ * The decimal mark this format writes, when it writes text. Ctrl+C follows
1447
+ * it, so what is copied matches what is exported. Unset means the Nordic
1448
+ * default, a comma.
1612
1449
  */
1613
- totalRowCount?: number;
1450
+ decimalComma?: boolean;
1451
+ write: (data: TMDataGridExportData, options: TMDataGridExportWriteOptions) => string | Blob | Promise<string | Blob>;
1614
1452
  };
1615
1453
  /**
1616
- * Every feature the TMDataGrid chrome can drive. Defined at module scope so the
1617
- * reference stays stable across renders (see the TanStack table-state skill).
1454
+ * Which columns an export takes: the visible ones, every exportable column
1455
+ * hidden or not, or a list of column ids. The generated lanes and columns
1456
+ * with `meta.enableExport: false` are never taken, whatever is asked for.
1618
1457
  */
1619
- declare const tmDataGridFeatures: {
1620
- columnFilteringFeature: import("@tanstack/table-core").TableFeature;
1621
- globalFilteringFeature: import("@tanstack/table-core").TableFeature;
1622
- rowSortingFeature: import("@tanstack/table-core").TableFeature;
1623
- rowPaginationFeature: import("@tanstack/table-core").TableFeature;
1624
- rowSelectionFeature: import("@tanstack/table-core").TableFeature;
1625
- columnPinningFeature: import("@tanstack/table-core").TableFeature;
1626
- columnVisibilityFeature: import("@tanstack/table-core").TableFeature;
1627
- columnOrderingFeature: import("@tanstack/table-core").TableFeature;
1628
- columnSizingFeature: import("@tanstack/table-core").TableFeature;
1629
- columnResizingFeature: import("@tanstack/table-core").TableFeature;
1630
- columnFacetingFeature: import("@tanstack/table-core").TableFeature;
1631
- columnGroupingFeature: import("@tanstack/table-core").TableFeature;
1632
- rowExpandingFeature: import("@tanstack/table-core").TableFeature;
1633
- rowPinningFeature: import("@tanstack/table-core").TableFeature;
1634
- filteredRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1635
- groupedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1636
- sortedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1458
+ type TMDataGridExportColumns = "visible" | "all" | ReadonlyArray<string>;
1459
+ /** How the grid exports: the format, the file name and whether headers go in. */
1460
+ type TMDataGridExportOptions = {
1461
+ /** Defaults to `csvExcelFormat()`. */
1462
+ format?: TMDataGridExportFormat;
1463
+ /** Without extension. Defaults to `"export"`. */
1464
+ fileName?: string;
1465
+ /** Column labels as the first row. Defaults to `true`. */
1466
+ includeHeaders?: boolean;
1467
+ /** Defaults to `"visible"`. See {@link TMDataGridExportColumns}. */
1468
+ columns?: TMDataGridExportColumns;
1469
+ };
1470
+ /**
1471
+ * What the column picker was opened for: which rows, and the options of the
1472
+ * item that opened it. Held in `ui.state.exportPicker` while it is open.
1473
+ */
1474
+ type TMDataGridExportPickerRequest = {
1475
+ rows: "all" | "selected";
1476
+ options: TMDataGridExportOptions;
1477
+ };
1478
+ /** `TMDataGridExportOptions` with every default filled in. */
1479
+ type TMDataGridExportSettings = Required<TMDataGridExportOptions>;
1480
+ /**
1481
+ * The value written for a cell, in place of `row.getValue(column.id)`. See
1482
+ * `meta.exportValue`.
1483
+ */
1484
+ type TMDataGridExportValueGetter = (args: {
1485
+ value: unknown;
1486
+ row: ErasedRow;
1487
+ column: ErasedColumn;
1488
+ }) => unknown;
1489
+ /**
1490
+ * Which rows an export takes: every filtered and sorted row across all pages,
1491
+ * the selected ones among those, or a list of your own.
1492
+ */
1493
+ type TMDataGridExportRows<TData extends RowData> = "all" | "selected" | ReadonlyArray<Row<TMDataGridFeatures, TData>>;
1494
+ /**
1495
+ * One value as text.
1496
+ *
1497
+ * Deliberately not the rendered cell: what a cell renders is React, and often a
1498
+ * badge, a link or an icon rather than the value. The value is what a
1499
+ * spreadsheet wants, and it is the one thing every column is guaranteed to
1500
+ * have. `meta.exportValue` is where a column substitutes something else.
1501
+ */
1502
+ declare function formatExportValue(value: unknown, { decimalComma }: {
1503
+ decimalComma: boolean;
1504
+ }): string;
1505
+ /**
1506
+ * Keeps a spreadsheet from running a cell as a formula.
1507
+ *
1508
+ * Excel and Sheets evaluate a cell that starts with `=`, `+`, `-` or `@`, so a
1509
+ * value one user typed into the grid would run in another user's spreadsheet
1510
+ * when the file is opened. The defence is the standard one: a leading
1511
+ * apostrophe, which every spreadsheet reads as "text follows".
1512
+ *
1513
+ * Text that parses as a number is left alone - `-5` and `+4670123456` are
1514
+ * numbers to the spreadsheet too, and an apostrophe would turn them into text.
1515
+ * A phone number written with spaces (`+46 70 123 45 67`) does not parse and
1516
+ * is prefixed; `escapeFormulas: false` on the format is the way out for a grid
1517
+ * whose data is trusted.
1518
+ */
1519
+ declare function guardFormula(text: string): string;
1520
+ type TMDataGridCsvFormatOptions = {
1521
+ /** Between fields. `csvExcelFormat` defaults to `";"`, `csvFormat` to `","`. */
1522
+ separator?: string;
1523
+ /** Write numbers as `1,5` rather than `1.5`. `csvExcelFormat` defaults to `true`, `csvFormat` to `false`. */
1524
+ decimalComma?: boolean;
1525
+ /** Prefix text that a spreadsheet would run as a formula. Defaults to `true`. See {@link guardFormula}. */
1526
+ escapeFormulas?: boolean;
1527
+ };
1528
+ /**
1529
+ * A CSV that opens straight into columns in Excel.
1530
+ *
1531
+ * Three things make that true, and all three are needed:
1532
+ *
1533
+ * | Part | Why |
1534
+ * | ---- | --- |
1535
+ * | `sep=;` first line | Excel's own directive - it stops guessing and uses this |
1536
+ * | UTF-8 BOM | without it Excel reads the file as ANSI, and å ä ö arrive broken |
1537
+ * | CRLF line endings | what Excel writes, and what its importer is happiest with |
1538
+ *
1539
+ * The defaults are the Nordic ones, because they are the ones that need
1540
+ * choosing: an Excel running a Swedish, Norwegian, Danish or Finnish locale
1541
+ * reads `;` as its list separator and `,` as its decimal mark, and a file
1542
+ * written the other way opens as one column of text.
1543
+ *
1544
+ * The `sep=` line is Excel's alone; Sheets and Numbers show it as a first row.
1545
+ * `csvFormat` is the one for them.
1546
+ */
1547
+ declare function csvExcelFormat({ separator, decimalComma, escapeFormulas }?: TMDataGridCsvFormatOptions): TMDataGridExportFormat;
1548
+ /**
1549
+ * Plain CSV as RFC 4180 has it: commas, a dot as the decimal mark, CRLF, and a
1550
+ * UTF-8 BOM so that Excel too reads it as UTF-8. No `sep=` line, so Google
1551
+ * Sheets, Numbers and every tool that reads CSV take it as is.
1552
+ */
1553
+ declare function csvFormat({ separator, decimalComma, escapeFormulas }?: TMDataGridCsvFormatOptions): TMDataGridExportFormat;
1554
+ type TMDataGridTsvFormatOptions = Omit<TMDataGridCsvFormatOptions, "separator">;
1555
+ /**
1556
+ * Tab-separated text, the clipboard shape as a file: tabs between fields, CRLF
1557
+ * between rows, a UTF-8 BOM. Every spreadsheet opens it into columns without
1558
+ * a separator to guess.
1559
+ */
1560
+ declare function tsvFormat({ decimalComma, escapeFormulas }?: TMDataGridTsvFormatOptions): TMDataGridExportFormat;
1561
+ type TMDataGridJsonFormatOptions = {
1562
+ /** Indentation passed to `JSON.stringify`. Defaults to `2`. */
1563
+ space?: number;
1564
+ };
1565
+ /**
1566
+ * An array with one object per row, keyed by the column labels, values as the
1567
+ * data holds them. Two columns with the same label collapse into one key, the
1568
+ * later column winning. `includeHeaders` has no meaning here and is ignored.
1569
+ */
1570
+ declare function jsonFormat({ space }?: TMDataGridJsonFormatOptions): TMDataGridExportFormat;
1571
+ declare const DEFAULT_EXPORT_OPTIONS: TMDataGridExportSettings;
1572
+ /**
1573
+ * The defaults with each override folded over them in turn. Field by field,
1574
+ * so an override that spells a field as `undefined` leaves the earlier value
1575
+ * rather than blanking it.
1576
+ */
1577
+ declare function resolveExportOptions(...overrides: Array<TMDataGridExportOptions | undefined>): TMDataGridExportSettings;
1578
+ /**
1579
+ * Every column an export could take, in render order: the data columns minus
1580
+ * the generated lanes and `meta.enableExport: false`, hidden ones included.
1581
+ * What the column picker lists; `column.getIsVisible()` says which of them a
1582
+ * `"visible"` export would take.
1583
+ */
1584
+ declare function getExportableColumns<TData extends RowData>(table: TMDataGridTable<TData>): Array<Column<TMDataGridFeatures, TData, unknown>>;
1585
+ /**
1586
+ * How many rows `rows: "selected"` would export: the ticked rows of the
1587
+ * current view. Not the size of the selection map, which keeps rows the
1588
+ * filters have since hidden. Free while nothing is selected.
1589
+ */
1590
+ declare function countSelectedExportRows<TData extends RowData>(table: TMDataGridTable<TData>): number;
1591
+ type BuildExportDataArgs<TData extends RowData> = {
1592
+ table: TMDataGridTable<TData>;
1593
+ /** Defaults to `"all"`. */
1594
+ rows?: TMDataGridExportRows<TData>;
1595
+ /** Defaults to `"visible"`. Ignored under `bounds`. */
1596
+ columns?: TMDataGridExportColumns;
1597
+ /**
1598
+ * A rectangle over `rows` and the visible columns, both by index - the
1599
+ * cell-range path. `rows` is then the list the indices refer to, usually
1600
+ * the displayed rows.
1601
+ */
1602
+ bounds?: TMDataGridRangeBounds;
1603
+ };
1604
+ /**
1605
+ * What an export writes, before any format touches it.
1606
+ *
1607
+ * Columns are `"visible"` (the data columns on screen, in render order),
1608
+ * `"all"` (every exportable column, hidden or not) or a list of ids; the
1609
+ * generated lanes and any column with `meta.enableExport: false` are left out
1610
+ * whichever is asked for. Rows are `"all"` (every filtered and sorted row
1611
+ * across every page, group rows flattened to their records), `"selected"`
1612
+ * (those of them the user has ticked, in the same order - the selection map
1613
+ * is walked through the row list rather than the other way round, because
1614
+ * TanStack's selected row models ignore filtering and sorting), or a list of
1615
+ * your own.
1616
+ */
1617
+ declare function buildExportData<TData extends RowData>({ table, rows, columns: which, bounds }: BuildExportDataArgs<TData>): TMDataGridExportData;
1618
+ /**
1619
+ * Writes `data` in the format and downloads it. Awaits the format, since a
1620
+ * binary format builds its file asynchronously.
1621
+ */
1622
+ declare function writeExportFile(data: TMDataGridExportData, { format, fileName, includeHeaders }: TMDataGridExportSettings): Promise<void>;
1623
+ type ExportGridArgs<TData extends RowData> = {
1624
+ table: TMDataGridTable<TData>;
1625
+ /** Defaults to `"all"`. See {@link TMDataGridExportRows}. */
1626
+ rows?: TMDataGridExportRows<TData>;
1627
+ /** Merged over `DEFAULT_EXPORT_OPTIONS`. */
1628
+ options?: TMDataGridExportOptions;
1629
+ };
1630
+ /**
1631
+ * Downloads the grid as a file: {@link buildExportData} through the format's
1632
+ * `write` and a download.
1633
+ *
1634
+ * Inside the grid, `useTMDataGridExport` and the `TMDataGrid.Menu.Export*`
1635
+ * items call this with the grid's own `exportOptions`; this is the entry point
1636
+ * for code that holds the table and nothing else.
1637
+ *
1638
+ * Nothing is downloaded when no column is exportable. A grid with no rows
1639
+ * still downloads its header row, since an empty file is the honest answer to
1640
+ * an empty view.
1641
+ *
1642
+ * Async because a format may be. Safari refuses a download that starts after
1643
+ * the click gesture has ended, which a format that takes long enough to build
1644
+ * can run into; the text formats resolve synchronously and never do.
1645
+ */
1646
+ declare function exportGrid<TData extends RowData>({ table, rows, options }: ExportGridArgs<TData>): Promise<void>;
1647
+ type TMDataGridClipboardTextOptions = {
1648
+ /** Defaults to `true`, the Nordic mark. */
1649
+ decimalComma?: boolean;
1650
+ /** Defaults to `true`. See {@link guardFormula}. */
1651
+ escapeFormulas?: boolean;
1652
+ };
1653
+ /**
1654
+ * The clipboard format spreadsheets read: tab between cells, CRLF between rows,
1655
+ * values only.
1656
+ *
1657
+ * Tabs rather than commas because that is what Excel, Sheets and Numbers all
1658
+ * put on the clipboard themselves - paste it and the cells land in cells. A
1659
+ * comma-separated string pastes into a single column, which is the thing this
1660
+ * exists to avoid. No header row: Excel's own copy carries none either, and a
1661
+ * header pasted into the middle of a sheet is a row of text where numbers
1662
+ * were expected.
1663
+ *
1664
+ * Also accepts an already-formatted string matrix, for callers of the
1665
+ * deprecated `buildCellMatrix`.
1666
+ */
1667
+ declare function toClipboardText(data: TMDataGridExportData | TMDataGridCellMatrix, { decimalComma, escapeFormulas }?: TMDataGridClipboardTextOptions): string;
1668
+ /**
1669
+ * Puts text on the clipboard, reporting whether it landed.
1670
+ *
1671
+ * The async clipboard API only resolves for a document that has the focus and a
1672
+ * user gesture behind it - both true when this runs off Ctrl+C or a menu item.
1673
+ * It is still allowed to reject (a permissions policy, a page that lost focus
1674
+ * mid-copy), so the result is a boolean the caller can act on.
1675
+ */
1676
+ declare function writeClipboardText(text: string): Promise<boolean>;
1677
+ /**
1678
+ * Downloads a file, through the one mechanism a library can use: an anchor
1679
+ * with an object URL behind it, clicked. Revoked on the next frame -
1680
+ * immediately would race the browser's own read of it.
1681
+ */
1682
+ declare function downloadFile({ fileName, content, mimeType }: {
1683
+ fileName: string;
1684
+ content: string | Blob;
1685
+ mimeType: string;
1686
+ }): void;
1687
+ /** @deprecated Use {@link TMDataGridExportData}; the matrix is text, the data holds values. */
1688
+ type TMDataGridCellMatrix = Array<Array<string>>;
1689
+ /** @deprecated Use {@link TMDataGridExportOptions} with `csvExcelFormat({ separator, decimalComma })`. */
1690
+ type TMDataGridCellExportOptions = {
1691
+ /** CSV field separator. Defaults to `";"`. */
1692
+ separator?: string;
1693
+ /** Write numbers as `1,5` rather than `1.5`. Defaults to `true`. */
1694
+ decimalComma?: boolean;
1695
+ /** Column labels as the first row. Defaults to `true`. */
1696
+ includeHeaders?: boolean;
1697
+ /** Without extension. Defaults to `"export"`. */
1698
+ fileName?: string;
1699
+ };
1700
+ /** @deprecated Use {@link DEFAULT_EXPORT_OPTIONS}. */
1701
+ declare const DEFAULT_CELL_EXPORT_OPTIONS: Required<TMDataGridCellExportOptions>;
1702
+ /**
1703
+ * The old options as the new: separator and decimal mark become a
1704
+ * `csvExcelFormat`, the rest carries over. Shared by the deprecated
1705
+ * `cellExport` Table prop and {@link exportGridToCsv}.
1706
+ *
1707
+ * @deprecated Write {@link TMDataGridExportOptions} directly.
1708
+ */
1709
+ declare function fromCellExportOptions(options: TMDataGridCellExportOptions): TMDataGridExportOptions;
1710
+ /** @deprecated Use {@link BuildExportDataArgs}. */
1711
+ type BuildCellMatrixArgs = {
1712
+ rows: ReadonlyArray<ErasedRow>;
1713
+ /** Every visible column, in render order - the same list the bounds index into. */
1714
+ columns: ReadonlyArray<ErasedColumn>;
1715
+ bounds: TMDataGridRangeBounds;
1716
+ includeHeaders: boolean;
1717
+ decimalComma: boolean;
1718
+ };
1719
+ /** @deprecated Use {@link buildExportData} with `bounds`, and a format to write it. */
1720
+ declare function buildCellMatrix({ rows, columns, bounds, includeHeaders, decimalComma }: BuildCellMatrixArgs): TMDataGridCellMatrix;
1721
+ /** @deprecated Use {@link buildExportData}. */
1722
+ declare function buildGridCellMatrix<TData extends RowData>({ table, includeHeaders, decimalComma }: {
1723
+ table: TMDataGridTable<TData>;
1724
+ includeHeaders?: boolean;
1725
+ decimalComma?: boolean;
1726
+ }): TMDataGridCellMatrix;
1727
+ /** @deprecated Use {@link csvExcelFormat} - its `write` is this over export data. */
1728
+ declare function toExcelCsv(matrix: TMDataGridCellMatrix, { separator }: {
1729
+ separator: string;
1730
+ }): string;
1731
+ /** @deprecated Use {@link exportGrid}. */
1732
+ declare function exportGridToCsv<TData extends RowData>({ table, options }: {
1733
+ table: TMDataGridTable<TData>;
1734
+ options?: TMDataGridCellExportOptions;
1735
+ }): void;
1736
+ /** @deprecated Use {@link downloadFile}. */
1737
+ declare function downloadTextFile({ fileName, text, mimeType }: {
1738
+ fileName: string;
1739
+ text: string;
1740
+ mimeType?: string;
1741
+ }): void;
1742
+ //#endregion
1743
+ //#region .types-tmp/useTMDataGrid.d.ts
1744
+ /**
1745
+ * Per-column configuration the grid's own components read.
1746
+ *
1747
+ * The filter and edit stages each get a namespace, `filter` and `edit`,
1748
+ * mirroring the feature's runtime API. What the column *is* stays flat:
1749
+ * `label`, `type`, `options`, `align`, `flex`, `autoSize`, `enableOrdering`.
1750
+ * `type` and `options` are read by both stages, so one declaration of each
1751
+ * feeds the filter panel and the cell editor, which is why they sit outside
1752
+ * both namespaces.
1753
+ */
1754
+ type TMDataGridColumnMeta = {
1755
+ /** Name shown in menus and the column manager. Falls back to a string header. */
1756
+ label?: string;
1757
+ /**
1758
+ * Drives which filter operators are offered and, once editing is on, which
1759
+ * editor the cell opens. Defaults to `"string"`.
1760
+ */
1761
+ type?: TMDataGridColumnType;
1762
+ /**
1763
+ * The choices of a `select` / `multiSelect` column - one declaration feeding
1764
+ * the filter panel's value control and the cell editor alike. A static
1765
+ * array, `"faceted"` (the distinct values present in the data), or a
1766
+ * function of the table, column and, for editors, the row. See
1767
+ * {@link TMDataGridOptionsSource}.
1768
+ */
1769
+ options?: TMDataGridOptionsSource;
1770
+ /** Share of the leftover width this column claims. Defaults to `1`. */
1771
+ flex?: number;
1772
+ align?: "left" | "right" | "center";
1773
+ /**
1774
+ * Size the column to its widest mounted content once, after the first rows
1775
+ * render - unless a persisted or user-set width already covers it. The same
1776
+ * measurement as double-clicking the resize divider; see `autosizeColumn`.
1777
+ */
1778
+ autoSize?: boolean;
1779
+ /**
1780
+ * `false` keeps the column where it is: no header dragging, no move items.
1781
+ * Column ordering is the one feature TanStack defines no column option for,
1782
+ * so its switch lives here rather than on the column definition.
1783
+ */
1784
+ enableOrdering?: boolean;
1785
+ /**
1786
+ * How this column filters: which operators it offers, the operator a fresh
1787
+ * filter starts with, and the value control the filter panel renders for it.
1788
+ *
1789
+ * ```tsx
1790
+ * meta: {
1791
+ * type: "number",
1792
+ * filter: { defaultOperator: "between", control: DgRangeSliderFilter },
1793
+ * }
1794
+ * ```
1795
+ *
1796
+ * See {@link TMDataGridColumnFilterOptions}.
1797
+ */
1798
+ filter?: TMDataGridColumnFilterOptions;
1799
+ /**
1800
+ * How this column is edited: whether it takes edits, which field they write
1801
+ * to, which editor opens, what validates the field and what maps the value
1802
+ * on its way in.
1803
+ *
1804
+ * ```tsx
1805
+ * meta: {
1806
+ * type: "string",
1807
+ * edit: { validate: z.string().min(2, "Too short") },
1808
+ * }
1809
+ * ```
1810
+ *
1811
+ * See {@link TMDataGridColumnEditOptions}.
1812
+ */
1813
+ edit?: TMDataGridColumnEditOptions;
1814
+ /**
1815
+ * `false` leaves the column out of every export and out of Ctrl+C - for a
1816
+ * column of buttons, or one whose value means nothing outside the grid.
1817
+ * Defaults to `true`.
1818
+ */
1819
+ enableExport?: boolean;
1820
+ /**
1821
+ * The value an export writes for this column, in place of
1822
+ * `row.getValue(column.id)`. The export otherwise writes the value, never
1823
+ * what the cell renders, so this is where a status code becomes its label
1824
+ * or a nested object becomes one field.
1825
+ *
1826
+ * ```tsx
1827
+ * meta: {
1828
+ * exportValue: ({ value }) => STATUS_LABELS[value as Status],
1829
+ * }
1830
+ * ```
1831
+ */
1832
+ exportValue?: TMDataGridExportValueGetter;
1833
+ };
1834
+ /** Grid-wide configuration passed through `options.meta`. */
1835
+ type TMDataGridTableMeta = {
1836
+ loading?: boolean;
1837
+ noResultsLabel?: string;
1838
+ /** Row height used by the virtualizer. Defaults to `52`. */
1839
+ rowHeight?: number;
1840
+ /**
1841
+ * Unfiltered row total. Only needed for server-driven grids, where the client
1842
+ * never holds the full data set - `TMDataGrid.SummaryCount` uses it as denominator.
1843
+ */
1844
+ totalRowCount?: number;
1845
+ };
1846
+ /**
1847
+ * Every feature the TMDataGrid chrome can drive. Defined at module scope so the
1848
+ * reference stays stable across renders (see the TanStack table-state skill).
1849
+ */
1850
+ declare const tmDataGridFeatures: {
1851
+ columnFilteringFeature: import("@tanstack/table-core").TableFeature;
1852
+ globalFilteringFeature: import("@tanstack/table-core").TableFeature;
1853
+ rowSortingFeature: import("@tanstack/table-core").TableFeature;
1854
+ rowPaginationFeature: import("@tanstack/table-core").TableFeature;
1855
+ rowSelectionFeature: import("@tanstack/table-core").TableFeature;
1856
+ columnPinningFeature: import("@tanstack/table-core").TableFeature;
1857
+ columnVisibilityFeature: import("@tanstack/table-core").TableFeature;
1858
+ columnOrderingFeature: import("@tanstack/table-core").TableFeature;
1859
+ columnSizingFeature: import("@tanstack/table-core").TableFeature;
1860
+ columnResizingFeature: import("@tanstack/table-core").TableFeature;
1861
+ columnFacetingFeature: import("@tanstack/table-core").TableFeature;
1862
+ columnGroupingFeature: import("@tanstack/table-core").TableFeature;
1863
+ rowAggregationFeature: import("@tanstack/table-core").TableFeature;
1864
+ rowExpandingFeature: import("@tanstack/table-core").TableFeature;
1865
+ rowPinningFeature: import("@tanstack/table-core").TableFeature;
1866
+ filteredRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1867
+ groupedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1868
+ sortedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1637
1869
  expandedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1638
1870
  paginatedRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
1639
1871
  facetedRowModel: (table: Table<any, any>, columnId: string) => () => import("@tanstack/table-core").RowModel<any, any>;
1640
1872
  facetedMinMaxValues: (table: Table<import("@tanstack/table-core").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
1641
1873
  facetedUniqueValues: (table: Table<import("@tanstack/table-core").TableFeatures, any>, columnId: string) => () => Map<any, number>;
1642
1874
  filterFns: {
1643
- arrIncludes: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1644
- autoRemove: (val: any) => boolean;
1645
- };
1646
- arrIncludesAll: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1647
- autoRemove: (val: any) => boolean;
1648
- };
1649
- arrHas: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: Array<unknown>) => boolean;
1650
- arrIncludesSome: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1651
- autoRemove: (val: any) => boolean;
1652
- };
1653
- between: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValues: [unknown, unknown]) => boolean) & {
1654
- autoRemove: (val: any) => boolean;
1655
- };
1656
- betweenInclusive: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValues: [unknown, unknown]) => boolean) & {
1657
- autoRemove: (val: any) => boolean;
1658
- };
1659
- equals: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
1660
- autoRemove: (val: any) => boolean;
1661
- };
1662
- equalsString: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
1663
- autoRemove: (val: any) => boolean;
1664
- };
1665
- inNumberRange: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: [number, number]) => boolean) & {
1666
- resolveFilterValue: (val: [any, any]) => readonly [number, number];
1667
- autoRemove: (val: any) => boolean;
1668
- };
1669
- includesString: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
1670
- autoRemove: (val: any) => boolean;
1671
- };
1672
- includesStringSensitive: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
1673
- autoRemove: (val: any) => boolean;
1674
- };
1675
- weakEquals: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown) => boolean) & {
1676
- autoRemove: (val: any) => boolean;
1677
- };
1875
+ arrIncludes: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1876
+ arrIncludesAll: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1877
+ arrHas: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1878
+ arrIncludesSome: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1879
+ between: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1880
+ betweenInclusive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1881
+ empty: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1882
+ endsWith: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1883
+ equals: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1884
+ equalsString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1885
+ equalsStringSensitive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1886
+ inDateRange: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1887
+ inNumberRange: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1888
+ includesString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1889
+ includesStringSensitive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1890
+ notEmpty: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1891
+ startsWith: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1892
+ weakEquals: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1678
1893
  tmDataGrid: typeof tmDataGridFilterFn;
1679
1894
  tmDataGridFuzzy: typeof fuzzyGlobalFilterFn;
1680
1895
  };
1681
1896
  sortFns: {
1682
- alphanumeric: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
1683
- alphanumericCaseSensitive: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => number;
1684
- basic: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
1685
- datetime: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
1686
- text: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
1687
- textCaseSensitive: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData extends RowData>(rowA: Row<TFeatures, TData>, rowB: Row<TFeatures, TData>, columnId: string) => 0 | 1 | -1;
1897
+ alphanumeric: import("@tanstack/table-core").CreatedSortFn<any, any>;
1898
+ alphanumericCaseSensitive: import("@tanstack/table-core").CreatedSortFn<any, any>;
1899
+ basic: import("@tanstack/table-core").CreatedSortFn<any, any>;
1900
+ datetime: import("@tanstack/table-core").CreatedSortFn<any, any>;
1901
+ text: import("@tanstack/table-core").CreatedSortFn<any, any>;
1902
+ textCaseSensitive: import("@tanstack/table-core").CreatedSortFn<any, any>;
1688
1903
  };
1689
1904
  aggregationFns: {
1690
- sum: typeof import("@tanstack/table-core").aggregationFn_sum;
1691
- min: typeof import("@tanstack/table-core").aggregationFn_min;
1692
- max: typeof import("@tanstack/table-core").aggregationFn_max;
1693
- extent: typeof import("@tanstack/table-core").aggregationFn_extent;
1694
- mean: typeof import("@tanstack/table-core").aggregationFn_mean;
1695
- median: typeof import("@tanstack/table-core").aggregationFn_median;
1696
- unique: typeof import("@tanstack/table-core").aggregationFn_unique;
1697
- uniqueCount: typeof import("@tanstack/table-core").aggregationFn_uniqueCount;
1698
- count: typeof import("@tanstack/table-core").aggregationFn_count;
1905
+ sum: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1906
+ min: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
1907
+ max: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
1908
+ extent: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
1909
+ mean: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number | undefined>;
1910
+ median: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number | undefined>;
1911
+ unique: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown[]>;
1912
+ uniqueCount: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1913
+ count: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1914
+ first: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown>;
1915
+ last: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown>;
1699
1916
  };
1700
1917
  tableMeta: TMDataGridTableMeta;
1701
1918
  columnMeta: TMDataGridColumnMeta;
@@ -1715,6 +1932,7 @@ declare function createTMDataGridColumnHelper<TData extends RowData>(): import("
1715
1932
  columnResizingFeature: import("@tanstack/table-core").TableFeature;
1716
1933
  columnFacetingFeature: import("@tanstack/table-core").TableFeature;
1717
1934
  columnGroupingFeature: import("@tanstack/table-core").TableFeature;
1935
+ rowAggregationFeature: import("@tanstack/table-core").TableFeature;
1718
1936
  rowExpandingFeature: import("@tanstack/table-core").TableFeature;
1719
1937
  rowPinningFeature: import("@tanstack/table-core").TableFeature;
1720
1938
  filteredRowModel: (table: Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
@@ -1726,62 +1944,47 @@ declare function createTMDataGridColumnHelper<TData extends RowData>(): import("
1726
1944
  facetedMinMaxValues: (table: Table<import("@tanstack/table-core").TableFeatures, any>, columnId: string) => () => undefined | [number, number];
1727
1945
  facetedUniqueValues: (table: Table<import("@tanstack/table-core").TableFeatures, any>, columnId: string) => () => Map<any, number>;
1728
1946
  filterFns: {
1729
- arrIncludes: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1730
- autoRemove: (val: any) => boolean;
1731
- };
1732
- arrIncludesAll: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1733
- autoRemove: (val: any) => boolean;
1734
- };
1735
- arrHas: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: Array<unknown>) => boolean;
1736
- arrIncludesSome: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: Array<unknown>) => boolean) & {
1737
- autoRemove: (val: any) => boolean;
1738
- };
1739
- between: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValues: [unknown, unknown]) => boolean) & {
1740
- autoRemove: (val: any) => boolean;
1741
- };
1742
- betweenInclusive: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValues: [unknown, unknown]) => boolean) & {
1743
- autoRemove: (val: any) => boolean;
1744
- };
1745
- equals: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: unknown) => boolean) & {
1746
- autoRemove: (val: any) => boolean;
1747
- };
1748
- equalsString: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: unknown) => boolean) & {
1749
- autoRemove: (val: any) => boolean;
1750
- };
1751
- inNumberRange: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: [number, number]) => boolean) & {
1752
- resolveFilterValue: (val: [any, any]) => readonly [number, number];
1753
- autoRemove: (val: any) => boolean;
1754
- };
1755
- includesString: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: unknown) => boolean) & {
1756
- autoRemove: (val: any) => boolean;
1757
- };
1758
- includesStringSensitive: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: unknown) => boolean) & {
1759
- autoRemove: (val: any) => boolean;
1760
- };
1761
- weakEquals: (<TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(row: Row<TFeatures, TData_1>, columnId: string, filterValue: unknown) => boolean) & {
1762
- autoRemove: (val: any) => boolean;
1763
- };
1947
+ arrIncludes: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1948
+ arrIncludesAll: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1949
+ arrHas: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1950
+ arrIncludesSome: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1951
+ between: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1952
+ betweenInclusive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1953
+ empty: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1954
+ endsWith: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1955
+ equals: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1956
+ equalsString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1957
+ equalsStringSensitive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1958
+ inDateRange: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1959
+ inNumberRange: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1960
+ includesString: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1961
+ includesStringSensitive: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1962
+ notEmpty: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1963
+ startsWith: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1964
+ weakEquals: import("@tanstack/table-core").CreatedFilterFn<any, any>;
1764
1965
  tmDataGrid: typeof tmDataGridFilterFn;
1765
1966
  tmDataGridFuzzy: typeof fuzzyGlobalFilterFn;
1766
1967
  };
1767
1968
  sortFns: {
1768
- alphanumeric: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => number;
1769
- alphanumericCaseSensitive: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => number;
1770
- basic: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => 0 | 1 | -1;
1771
- datetime: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => 0 | 1 | -1;
1772
- text: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => 0 | 1 | -1;
1773
- textCaseSensitive: <TFeatures extends import("@tanstack/table-core").TableFeatures, TData_1 extends RowData>(rowA: Row<TFeatures, TData_1>, rowB: Row<TFeatures, TData_1>, columnId: string) => 0 | 1 | -1;
1969
+ alphanumeric: import("@tanstack/table-core").CreatedSortFn<any, any>;
1970
+ alphanumericCaseSensitive: import("@tanstack/table-core").CreatedSortFn<any, any>;
1971
+ basic: import("@tanstack/table-core").CreatedSortFn<any, any>;
1972
+ datetime: import("@tanstack/table-core").CreatedSortFn<any, any>;
1973
+ text: import("@tanstack/table-core").CreatedSortFn<any, any>;
1974
+ textCaseSensitive: import("@tanstack/table-core").CreatedSortFn<any, any>;
1774
1975
  };
1775
1976
  aggregationFns: {
1776
- sum: typeof import("@tanstack/table-core").aggregationFn_sum;
1777
- min: typeof import("@tanstack/table-core").aggregationFn_min;
1778
- max: typeof import("@tanstack/table-core").aggregationFn_max;
1779
- extent: typeof import("@tanstack/table-core").aggregationFn_extent;
1780
- mean: typeof import("@tanstack/table-core").aggregationFn_mean;
1781
- median: typeof import("@tanstack/table-core").aggregationFn_median;
1782
- unique: typeof import("@tanstack/table-core").aggregationFn_unique;
1783
- uniqueCount: typeof import("@tanstack/table-core").aggregationFn_uniqueCount;
1784
- count: typeof import("@tanstack/table-core").aggregationFn_count;
1977
+ sum: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1978
+ min: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
1979
+ max: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, (number | Date) | undefined>;
1980
+ extent: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, [(number | Date) | undefined, (number | Date) | undefined]>;
1981
+ mean: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number | undefined>;
1982
+ median: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number | undefined>;
1983
+ unique: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown[]>;
1984
+ uniqueCount: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1985
+ count: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, number>;
1986
+ first: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown>;
1987
+ last: import("@tanstack/table-core").AggregationFnDef<any, any, unknown, unknown>;
1785
1988
  };
1786
1989
  tableMeta: TMDataGridTableMeta;
1787
1990
  columnMeta: TMDataGridColumnMeta;
@@ -1852,10 +2055,20 @@ type TMDataGridUiState = {
1852
2055
  * describe different places.
1853
2056
  */
1854
2057
  cellRange: TMDataGridCellRange | null;
2058
+ /**
2059
+ * The export column picker, while it is open: which rows it exports and the
2060
+ * options of the item that opened it. `null` while closed. Held here rather
2061
+ * than in the menu item, which unmounts with the dropdown the moment it is
2062
+ * clicked.
2063
+ */
2064
+ exportPicker: TMDataGridExportPickerRequest | null;
1855
2065
  };
1856
2066
  type TMDataGridUiActions = {
1857
2067
  openFilterPanel: (columnId?: string | null) => void;
1858
2068
  closeFilterPanel: () => void;
2069
+ /** Opens the export column picker for `request`. See `TMDataGrid.Menu.Export`'s `columns="custom"`. */
2070
+ openExportPicker: (request: TMDataGridExportPickerRequest) => void;
2071
+ closeExportPicker: () => void;
1859
2072
  /**
1860
2073
  * Points at a column's row in the filter panel without opening anything.
1861
2074
  * `openFilterPanel` does this as well as opening; this is the half a panel
@@ -1921,6 +2134,12 @@ type TMDataGridApi<TData extends RowData> = {
1921
2134
  * table about which surface is on.
1922
2135
  */
1923
2136
  filters: TMDataGridFiltersSettings;
2137
+ /**
2138
+ * How the grid exports, the `exportOptions` option with its defaults filled
2139
+ * in. Read by `useTMDataGridExport`, the `TMDataGrid.Menu.Export*` items and
2140
+ * the cell-range menu, so every export of the grid agrees on the format.
2141
+ */
2142
+ exportOptions: TMDataGridExportSettings;
1924
2143
  /** Every string the chrome renders, `labels` merged over the English defaults. */
1925
2144
  labels: TMDataGridLabels;
1926
2145
  /** The detail renderer, when row details are on. See `renderDetails`. */
@@ -2220,6 +2439,20 @@ type UseTMDataGridOptions<TData extends RowData> = Omit<TableOptions<TMDataGridF
2220
2439
  * `persist`, this one does not have to be referentially stable.
2221
2440
  */
2222
2441
  filters?: TMDataGridFiltersOptions;
2442
+ /**
2443
+ * How the grid exports: the file format, the file name and whether the
2444
+ * column labels go in as the first row. Defaults to `csvExcelFormat()`,
2445
+ * `"export"` and `true`. See {@link TMDataGridExportOptions}.
2446
+ *
2447
+ * ```tsx
2448
+ * useTMDataGrid({ data, columns, exportOptions: { format: csvFormat(), fileName: "employees" } });
2449
+ * ```
2450
+ *
2451
+ * Read field by field like `filters`, so a literal is fine. A `format`
2452
+ * built inline is rebuilt every render, which costs nothing but a small
2453
+ * object; keep it at module scope when that bothers you.
2454
+ */
2455
+ exportOptions?: TMDataGridExportOptions;
2223
2456
  /**
2224
2457
  * How the quick search (`TMDataGrid.Search`) matches. `"fuzzy"` - the
2225
2458
  * default - forgives typos and skipped characters, and while it is the
@@ -2388,48 +2621,317 @@ type UseTMDataGridOptions<TData extends RowData> = Omit<TableOptions<TMDataGridF
2388
2621
  */
2389
2622
  renderDetails?: TMDataGridDetailsRenderer<TData>;
2390
2623
  /**
2391
- * What the virtualizer assumes an unmeasured detail panel is worth, in px.
2392
- * Defaults to 160.
2393
- *
2394
- * An estimate, not a height: every mounted row is measured, so the real one
2395
- * takes over as soon as the panel is on screen. It keeps the scrollbar
2396
- * accurate for panels that open off screen, such as restored `expanded`
2397
- * state. An approximate value is enough.
2624
+ * What the virtualizer assumes an unmeasured detail panel is worth, in px.
2625
+ * Defaults to 160.
2626
+ *
2627
+ * An estimate, not a height: every mounted row is measured, so the real one
2628
+ * takes over as soon as the panel is on screen. It keeps the scrollbar
2629
+ * accurate for panels that open off screen, such as restored `expanded`
2630
+ * state. An approximate value is enough.
2631
+ */
2632
+ renderDetailsEstHeight?: number;
2633
+ /**
2634
+ * Rows the virtualizer keeps mounted above and below the viewport. Defaults
2635
+ * to 6.
2636
+ *
2637
+ * Raise it to trade memory for a scroll that stays painted - fast wheel or
2638
+ * touch flings can outrun the virtualizer and flash blank rows, and a larger
2639
+ * buffer covers the gap. Lower it when rows are expensive to render.
2640
+ */
2641
+ overscan?: number;
2642
+ };
2643
+ /**
2644
+ * Builds a TMDataGrid table plus its chrome store.
2645
+ *
2646
+ * Every `TableOptions` field passes straight through, so a server-driven grid
2647
+ * only needs `manualPagination` / `manualFiltering` / `manualSorting`,
2648
+ * `rowCount` and the matching `onXChange` callbacks - the chrome reads
2649
+ * `getRowCount()` / `getPageCount()` / `getPaginatedRowModel()`, all of which
2650
+ * already respect manual mode. `manualPagination` also switches the pagination
2651
+ * flag on, so `<TMDataGrid.Footer />` renders its pager without further
2652
+ * options.
2653
+ */
2654
+ declare function useTMDataGrid<TData extends RowData>({ persist, labels: labelsOverride, enableColumnOrdering, enablePagination, resetPageOnQueryChange, enableRowNumbers, selectionMode, showSelectedBackground, defaultHighlightedRowId, onHighlightedRowChange, cellSelection, onFocusedCellChange, filters: filterOptions, exportOptions: exportOptionsOverride, editing, renderDetails, renderDetailsEstHeight, overscan, ...options }: UseTMDataGridOptions<TData>): TMDataGridApi<TData>;
2655
+ /**
2656
+ * Sends the user to a column's filter control, seeding an empty filter when
2657
+ * the column has none yet - what "Filter" in the column menu and a click on a
2658
+ * filter pill both do.
2659
+ *
2660
+ * Which control that is follows the grid's `filters` option. Under
2661
+ * `inHeader` it is the column's header control, which is already on screen, so
2662
+ * the call focuses it and leaves the popup or sidebar closed. Otherwise it is
2663
+ * the panel's row for that column, and the call opens the surface on it.
2664
+ */
2665
+ declare function openColumnFilter<TData extends RowData>(api: TMDataGridApi<TData>, columnId: string): void;
2666
+ //#endregion
2667
+ //#region .types-tmp/core/filterOperators.d.ts
2668
+ /**
2669
+ * The value shape stored in `columnFilters` for every TMDataGrid column.
2670
+ *
2671
+ * TanStack resolves `filterFn` statically per column, so the operator travels
2672
+ * inside the filter *value* instead. That keeps the filter model plain,
2673
+ * serialisable JSON, so a server-side `manualFiltering` table can forward
2674
+ * `columnFilters` to the API unchanged.
2675
+ *
2676
+ * `value` is a string array under `isAnyOf` / `isNoneOf` (the set the cell is
2677
+ * tested against), a `[min, max]` pair under `between` (an empty string means
2678
+ * that end is open), and a single string everywhere else - dates travel as
2679
+ * ISO `YYYY-MM-DD` strings, booleans as `"true"` / `"false"`. Still plain
2680
+ * JSON.
2681
+ */
2682
+ type TMDataGridFilterValue = {
2683
+ operator: TMDataGridFilterOperator;
2684
+ value: string | ReadonlyArray<string>;
2685
+ };
2686
+ type TMDataGridColumnType = "string" | "number" | "boolean" | "date" | "select" | "multiSelect";
2687
+ type TMDataGridFilterOperator = "contains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "greaterThan" | "greaterThanOrEqual" | "lessThan" | "lessThanOrEqual" | "between" | "before" | "after" | "onOrBefore" | "onOrAfter" | "isAnyOf" | "isNoneOf" | "isEmpty" | "isNotEmpty";
2688
+ declare const FILTER_OPERATOR_LABELS: Record<TMDataGridFilterOperator, string>;
2689
+ declare function getOperatorsForType(type: TMDataGridColumnType): readonly TMDataGridFilterOperator[];
2690
+ declare function getDefaultOperator(type: TMDataGridColumnType): TMDataGridFilterOperator;
2691
+ declare function operatorNeedsValue(operator: TMDataGridFilterOperator): boolean;
2692
+ /** Whether the operator's value is a string array - `isAnyOf` / `isNoneOf`. */
2693
+ declare function operatorTakesArrayValue(operator: TMDataGridFilterOperator): boolean;
2694
+ /** Whether the operator's value is a `[min, max]` pair - `between`. */
2695
+ declare function operatorTakesRangeValue(operator: TMDataGridFilterOperator): boolean;
2696
+ /** The untouched value a fresh filter starts with - the operator's shape, empty. */
2697
+ declare function emptyValueForOperator(operator: TMDataGridFilterOperator): string | ReadonlyArray<string>;
2698
+ /**
2699
+ * The three value shapes an operator can take. A set is not a range, even
2700
+ * though both are arrays.
2701
+ */
2702
+ type TMDataGridFilterValueShape = "scalar" | "set" | "range";
2703
+ /**
2704
+ * Which shape an operator's value takes. A typed value survives an operator or
2705
+ * column change only within its shape, which is the rule both the panel and
2706
+ * the header controls use when the operator changes.
2707
+ */
2708
+ declare function filterValueShape(operator: TMDataGridFilterOperator): TMDataGridFilterValueShape;
2709
+ /**
2710
+ * A filter only narrows the row set once it has something to compare against.
2711
+ * Half-typed filters stay in state (so the panel keeps rendering their row) but
2712
+ * are treated as inactive for the funnel indicator and for row matching.
2713
+ */
2714
+ declare function isFilterActive(value: unknown): boolean;
2715
+ /** One column's filter, typed - what `columnFilters` holds per entry. */
2716
+ type TMDataGridColumnFilter = {
2717
+ id: string;
2718
+ value: TMDataGridFilterValue;
2719
+ };
2720
+ /**
2721
+ * The column filters that are actually narrowing the grid, typed.
2722
+ *
2723
+ * `ColumnFiltersState` types `value` as `unknown`, so the first line of a
2724
+ * server-side mapping layer is otherwise a cast back to the shape the grid
2725
+ * itself wrote, wrapped in the same "drop the half-typed ones" filter every
2726
+ * consumer writes:
2727
+ *
2728
+ * ```ts
2729
+ * const predicates = activeColumnFilters(table).map((filter) =>
2730
+ * toPredicate(filter.id, filter.value),
2731
+ * );
2732
+ * ```
2733
+ *
2734
+ * Takes the table, or a `columnFilters` array where the consumer owns the
2735
+ * slice. Reading it from the table reads the current value and does not
2736
+ * subscribe; inside a component, subscribe to `columnFilters` the way the
2737
+ * grid's own chrome does.
2738
+ */
2739
+ declare function activeColumnFilters<TData extends RowData>(source: TMDataGridTable<TData> | ColumnFiltersState): Array<TMDataGridColumnFilter>;
2740
+ /**
2741
+ * One-line description of a single filter, as shown on a filter pill.
2742
+ *
2743
+ * The type's default operator is left implicit - "First name: Sofia" reads the
2744
+ * way a person would say it - while any other operator is spelled out, since
2745
+ * that is the part a reader cannot guess.
2746
+ */
2747
+ declare function formatFilterLabel({ label, type, filter, operatorLabels }: {
2748
+ label: string;
2749
+ type: TMDataGridColumnType;
2750
+ filter: TMDataGridFilterValue;
2751
+ /** Localized operator names - `labels.operators`. Defaults to English. */
2752
+ operatorLabels?: Record<TMDataGridFilterOperator, string>;
2753
+ }): string;
2754
+ /**
2755
+ * The single filter function every TMDataGrid column uses. It dispatches on the
2756
+ * operator carried by the filter value, which is what lets one column offer
2757
+ * "contains" / "does not equal" / "is empty" without redefining the column.
2758
+ */
2759
+ declare function tmDataGridFilterFn<TFeatures extends TableFeatures, TData extends RowData>(row: Row<TFeatures, TData>, columnId: string, filterValue: unknown): boolean;
2760
+ //#endregion
2761
+ //#region .types-tmp/core/columnUtils.d.ts
2762
+ /**
2763
+ * Structural shape of the column bits the chrome reads. Kept minimal so these
2764
+ * helpers work with any `Column`/`Header` instance without dragging generics
2765
+ * through every call site.
2766
+ */
2767
+ type ColumnLike = {
2768
+ id: string;
2769
+ columnDef: {
2770
+ header?: unknown;
2771
+ meta?: TMDataGridColumnMeta;
2772
+ };
2773
+ /** Set on a leaf that sits inside a header group. */
2774
+ parent?: unknown;
2775
+ };
2776
+ /** Menu- and panel-facing column name. */
2777
+ declare function getColumnLabel(column: ColumnLike): string;
2778
+ declare function getColumnType(column: ColumnLike): TMDataGridColumnType;
2779
+ /**
2780
+ * The operators this column offers: the type's list, narrowed to
2781
+ * `meta.filter.operators` when the column declares one. The type's order is
2782
+ * kept so the menu reads the same on every column; an operator the type does
2783
+ * not offer is dropped, and an allowlist that leaves nothing falls back to the
2784
+ * type's full list rather than an empty menu.
2785
+ */
2786
+ declare function getColumnOperators(column: ColumnLike): readonly TMDataGridFilterOperator[];
2787
+ /**
2788
+ * The operator a fresh filter on this column starts with -
2789
+ * `meta.filter.defaultOperator`, else the type's default where the column
2790
+ * offers it, else the first operator it does offer.
2791
+ */
2792
+ declare function getColumnDefaultOperator(column: ColumnLike): TMDataGridFilterOperator;
2793
+ /**
2794
+ * This column's filter-panel value control - `meta.filter.control`, or
2795
+ * `undefined` for the built-in shape-by-operator input.
2796
+ */
2797
+ declare function getColumnFilterControl(column: ColumnLike): TMDataGridFilterControlComponent | undefined;
2798
+ /**
2799
+ * Whether `meta.edit.enabled` lets this column's cell on this row be edited -
2800
+ * the switch, then the predicate.
2801
+ *
2802
+ * This is only the column's half of the rule. A cell also needs the column to
2803
+ * map to a field (`getEditFieldName`) and the row to take edits at all
2804
+ * (`isRowEditable`); `edit.canEditCell` is the whole question.
2805
+ */
2806
+ declare function isColumnEditableForRow(column: ColumnLike, row: Row<TMDataGridFeatures, TMDataGridRowData>): boolean;
2807
+ /**
2808
+ * A generated lane holding one fixed-width thing - the checkbox, the details
2809
+ * chevron, the row number.
2810
+ *
2811
+ * They are laid out differently from every other column: cell padding is sized
2812
+ * for text and grows with the scale, which at `xl` squeezed a 16px checkbox out
2813
+ * of its track, so these lanes centre their content in an unpadded cell.
2814
+ * Their headers carry no column menu, and none of them is ever exported -
2815
+ * they hold chrome, not values.
2816
+ *
2817
+ * The tree column is deliberately not one of them: it holds a label as well as a
2818
+ * chevron, and wants the padding.
2819
+ */
2820
+ declare function isControlColumn(columnId: string): boolean;
2821
+ /**
2822
+ * Whether the grid generated this column rather than the consumer declaring it
2823
+ * - the four control lanes plus the tree column.
2824
+ *
2825
+ * These hold the grid's own chrome, and they keep the edges of the row: the
2826
+ * generated left lanes before every consumer column, the edit lane after all of
2827
+ * them. `isControlColumn` answers a narrower question about layout, and leaves
2828
+ * the tree column out because it is padded like a data column.
2829
+ */
2830
+ declare function isGeneratedColumn(columnId: string): boolean;
2831
+ /**
2832
+ * Whether a column may be moved. Ordering is the one column feature TanStack
2833
+ * has no column option for, so the switch lives in `meta.enableOrdering`.
2834
+ *
2835
+ * A leaf inside a header group is never movable: `columnOrder` sequences leaf
2836
+ * columns, so moving one out of its group would leave the group header spanning
2837
+ * columns that no longer belong to it.
2838
+ */
2839
+ declare function isColumnReorderable(column: ColumnLike): boolean;
2840
+ /** `"auto"` shows the search box from `COLUMN_SEARCH_MIN` columns. */
2841
+ type TMDataGridColumnSearchable = boolean | "auto";
2842
+ //#endregion
2843
+ //#region .types-tmp/components/TMDataGridMenu.d.ts
2844
+ type TMDataGridMenuProps = Omit<MenuProps, "children"> & {
2845
+ /** The dropdown's content: Mantine `Menu.Item`s and the `TMDataGrid.Menu.*` items. */
2846
+ children: ReactNode;
2847
+ /** Replaces the burger icon on the trigger. */
2848
+ icon?: ReactNode;
2849
+ /** Tooltip and `aria-label` of the trigger. Default `labels.menuButton`. */
2850
+ label?: string;
2851
+ };
2852
+ type TMDataGridMenuColumnsProps = {
2853
+ /**
2854
+ * Renders a `Menu.Search` above the toggles: `"auto"` (the default) from
2855
+ * six hideable columns, `true` always, `false` never. Use `false` inside a
2856
+ * `Menu.Sub`.
2857
+ */
2858
+ searchable?: TMDataGridColumnSearchable;
2859
+ };
2860
+ /**
2861
+ * The whole column chooser as menu items: a search box, one checkbox item per
2862
+ * hideable column, show/hide all, and Reset layout. Renders nothing when no
2863
+ * column can be hidden.
2864
+ *
2865
+ * `searchable` is only for a block at the top level of a dropdown.
2866
+ * `Menu.Search` registers on the root menu context (`hasSearch`), which
2867
+ * switches off type-ahead and the arrow-key handling of every dropdown of that
2868
+ * menu, so a search inside a `Menu.Sub` breaks the parent menu's keyboard
2869
+ * behaviour.
2870
+ */
2871
+ declare function TMDataGridMenuColumns({ searchable }: TMDataGridMenuColumnsProps): import("react").JSX.Element | null;
2872
+ /**
2873
+ * One checkbox item per hideable column, narrowed to `search` when one is
2874
+ * given. Renders nothing when no column can be hidden.
2875
+ */
2876
+ declare function TMDataGridMenuColumnToggles({ search }: {
2877
+ search?: string;
2878
+ }): import("react").JSX.Element | null;
2879
+ /**
2880
+ * Shows or hides every listed column at once. Renders nothing when no column
2881
+ * can be hidden.
2882
+ */
2883
+ declare function TMDataGridMenuShowHideAll(): import("react").JSX.Element | null;
2884
+ /**
2885
+ * Resets the whole layout, not only visibility: order, widths, pinning and
2886
+ * grouping go back too. Not `table.resetColumnVisibility()`, which resets to
2887
+ * `initialState` - and under persistence the mount built that *from* the
2888
+ * persisted payload.
2889
+ */
2890
+ declare function TMDataGridMenuResetLayout(): import("react").JSX.Element;
2891
+ /** Per-item overrides of the grid's `exportOptions`, and the item's text. */
2892
+ type TMDataGridMenuExportProps = Omit<TMDataGridExportOptions, "columns"> & {
2893
+ /**
2894
+ * Which columns the item writes: `"visible"`, `"all"`, a list of ids, or
2895
+ * `"custom"` - a picker listing every exportable column with the visible
2896
+ * ones ticked, and the download on its Export button. Defaults to the grid's
2897
+ * `exportOptions.columns`.
2398
2898
  */
2399
- renderDetailsEstHeight?: number;
2899
+ columns?: TMDataGridExportColumns | "custom";
2400
2900
  /**
2401
- * Rows the virtualizer keeps mounted above and below the viewport. Defaults
2402
- * to 6.
2403
- *
2404
- * Raise it to trade memory for a scroll that stays painted - fast wheel or
2405
- * touch flings can outrun the virtualizer and flash blank rows, and a larger
2406
- * buffer covers the gap. Lower it when rows are expensive to render.
2901
+ * The item's text. Defaults to `labels.exportAll`, or for the selected-rows
2902
+ * item `labels.exportSelected(count)`. Two items offering two formats need
2903
+ * two texts, which is what this is for.
2407
2904
  */
2408
- overscan?: number;
2905
+ label?: ReactNode;
2409
2906
  };
2410
2907
  /**
2411
- * Builds a TMDataGrid table plus its chrome store.
2412
- *
2413
- * Every `TableOptions` field passes straight through, so a server-driven grid
2414
- * only needs `manualPagination` / `manualFiltering` / `manualSorting`,
2415
- * `rowCount` and the matching `onXChange` callbacks - the chrome reads
2416
- * `getRowCount()` / `getPageCount()` / `getPaginatedRowModel()`, all of which
2417
- * already respect manual mode. `manualPagination` also switches the pagination
2418
- * flag on, so `<TMDataGrid.Footer />` renders its pager without further
2419
- * options.
2908
+ * Downloads every filtered and sorted row, all pages, in the grid's export
2909
+ * format. Props override `exportOptions` for this item alone, which is how one
2910
+ * menu offers two formats.
2420
2911
  */
2421
- declare function useTMDataGrid<TData extends RowData>({ persist, labels: labelsOverride, enableColumnOrdering, enablePagination, resetPageOnQueryChange, enableRowNumbers, selectionMode, showSelectedBackground, defaultHighlightedRowId, onHighlightedRowChange, cellSelection, onFocusedCellChange, filters: filterOptions, editing, renderDetails, renderDetailsEstHeight, overscan, ...options }: UseTMDataGridOptions<TData>): TMDataGridApi<TData>;
2912
+ declare function TMDataGridMenuExport(props: TMDataGridMenuExportProps): import("react").JSX.Element;
2422
2913
  /**
2423
- * Sends the user to a column's filter control, seeding an empty filter when
2424
- * the column has none yet - what "Filter" in the column menu and a click on a
2425
- * filter pill both do.
2426
- *
2427
- * Which control that is follows the grid's `filters` option. Under
2428
- * `inHeader` it is the column's header control, which is already on screen, so
2429
- * the call focuses it and leaves the popup or sidebar closed. Otherwise it is
2430
- * the panel's row for that column, and the call opens the surface on it.
2914
+ * Downloads the selected rows, in grid order. Disabled while nothing is
2915
+ * selected; renders nothing when row selection is off, since then there is
2916
+ * never anything for it to do.
2431
2917
  */
2432
- declare function openColumnFilter<TData extends RowData>(api: TMDataGridApi<TData>, columnId: string): void;
2918
+ declare function TMDataGridMenuExportSelected(props: TMDataGridMenuExportProps): import("react").JSX.Element | null;
2919
+ //#endregion
2920
+ //#region .types-tmp/components/TMDataGridColumnsPanel.d.ts
2921
+ /**
2922
+ * The "Manage columns" surface as plain controls, for a host that is not a
2923
+ * menu - a Popover, a Drawer, an inline layout. `TMDataGrid.Menu.Columns` is
2924
+ * the same chooser as menu items.
2925
+ */
2926
+ /** Mantine's style props (`w={320}`, `p="sm"`) are set on the panel block. */
2927
+ type TMDataGridColumnsPanelProps = BoxProps & {
2928
+ /**
2929
+ * The search box over the list: `"auto"` (the default) from six hideable
2930
+ * columns, `true` always, `false` never.
2931
+ */
2932
+ searchable?: TMDataGridColumnSearchable;
2933
+ };
2934
+ declare function TMDataGridColumnsPanel({ className, searchable, ...others }?: TMDataGridColumnsPanelProps): import("react").JSX.Element;
2433
2935
  //#endregion
2434
2936
  //#region .types-tmp/components/TMDataGridDraftActions.d.ts
2435
2937
  /** What the edit chrome is showing. */
@@ -2547,7 +3049,8 @@ type TMDataGridDraftActionsProps = {
2547
3049
  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;
2548
3050
  //#endregion
2549
3051
  //#region .types-tmp/components/TMDataGridFilterPanel.d.ts
2550
- type TMDataGridFilterPanelProps = {
3052
+ /** Mantine's style props (`p="md"`, `w={320}`) are set on the panel block. */
3053
+ type TMDataGridFilterPanelProps = BoxProps & {
2551
3054
  /**
2552
3055
  * How one filter row is laid out.
2553
3056
  *
@@ -2575,10 +3078,11 @@ type TMDataGridFilterPanelProps = {
2575
3078
  * `manualFiltering` grid gets the same panel for free - the state is forwarded
2576
3079
  * to the server instead of a row model.
2577
3080
  */
2578
- declare function TMDataGridFilterPanel({ layout }?: TMDataGridFilterPanelProps): import("react").JSX.Element;
3081
+ declare function TMDataGridFilterPanel({ layout, className, ...others }?: TMDataGridFilterPanelProps): import("react").JSX.Element;
2579
3082
  //#endregion
2580
3083
  //#region .types-tmp/components/TMDataGridFilterPills.d.ts
2581
- type TMDataGridFilterPillsProps<TData extends RowData> = {
3084
+ /** Mantine's style props (`mb="sm"`, `hiddenFrom="sm"`) are set on the wrapper. */
3085
+ type TMDataGridFilterPillsProps<TData extends RowData> = BoxProps & {
2582
3086
  /** The object returned by `useTMDataGrid`. */
2583
3087
  api: TMDataGridApi<TData>;
2584
3088
  /** Mantine size of the pills. Defaults to `"sm"`. */
@@ -2590,7 +3094,6 @@ type TMDataGridFilterPillsProps<TData extends RowData> = {
2590
3094
  * filter panel on that column.
2591
3095
  */
2592
3096
  onPillClick?: (columnId: string) => void;
2593
- className?: string;
2594
3097
  };
2595
3098
  /**
2596
3099
  * One pill per active filter (`First name: Sofia ✕`), with the ✕ clearing that
@@ -2612,7 +3115,7 @@ type TMDataGridFilterPillsProps<TData extends RowData> = {
2612
3115
  * Half-typed filters are left out: a filter that is not narrowing the rows yet
2613
3116
  * has nothing to report, which is the same rule the funnel indicator uses.
2614
3117
  */
2615
- declare function TMDataGridFilterPills<TData extends RowData>({ api, size, showClearAll, onPillClick, className }: TMDataGridFilterPillsProps<TData>): import("react").JSX.Element | null;
3118
+ declare function TMDataGridFilterPills<TData extends RowData>({ api, size, showClearAll, onPillClick, className, ...others }: TMDataGridFilterPillsProps<TData>): import("react").JSX.Element | null;
2616
3119
  //#endregion
2617
3120
  //#region .types-tmp/components/TMDataGridFooter.d.ts
2618
3121
  /** What the pager is showing. The read half of {@link TMDataGridPaginationApi}. */
@@ -2688,7 +3191,8 @@ type TMDataGridPaginationSlotArgs = TMDataGridPaginationApi & {
2688
3191
  * this function takes only a table.
2689
3192
  */
2690
3193
  declare function getTMDataGridPaginationApi<TData extends RowData>(table: TMDataGridTable<TData>, isPaging?: boolean): TMDataGridPaginationApi;
2691
- type TMDataGridFooterProps = {
3194
+ /** Mantine's style props (`mt="sm"`, `px="md"`) are set on the footer bar. */
3195
+ type TMDataGridFooterProps = BoxProps & {
2692
3196
  pageSizeOptions?: ReadonlyArray<number>;
2693
3197
  /**
2694
3198
  * Replaces the built-in pager, and is handed the pieces of it.
@@ -2717,7 +3221,7 @@ type TMDataGridFooterProps = {
2717
3221
  * Row totals come from `table.getRowCount()`, which prefers `options.rowCount`
2718
3222
  * - so a server-paged grid shows the server's total without changes here.
2719
3223
  */
2720
- declare function TMDataGridFooter({ pageSizeOptions, renderPagination }: TMDataGridFooterProps): import("react").JSX.Element | null;
3224
+ declare function TMDataGridFooter({ pageSizeOptions, renderPagination, className, ...others }: TMDataGridFooterProps): import("react").JSX.Element | null;
2721
3225
  //#endregion
2722
3226
  //#region .types-tmp/components/TMDataGridSearch.d.ts
2723
3227
  type TMDataGridSearchProps = {
@@ -2776,135 +3280,6 @@ type TMDataGridColumnMenuItemsArgs = {
2776
3280
  */
2777
3281
  type TMDataGridColumnMenuItemsRenderer = (args: TMDataGridColumnMenuItemsArgs) => Array<ReactNode>;
2778
3282
  //#endregion
2779
- //#region .types-tmp/core/cellExport.d.ts
2780
- /** The selected block, flattened to text. One inner array per row. */
2781
- type TMDataGridCellMatrix = Array<Array<string>>;
2782
- /**
2783
- * How values are written out.
2784
- *
2785
- * The defaults are the Nordic ones, because they are the ones that need
2786
- * choosing: an Excel running a Swedish, Norwegian, Danish or Finnish locale
2787
- * reads `;` as its list separator and `,` as its decimal mark, and a file
2788
- * written the other way opens as one column of text. Both are settable for a
2789
- * grid whose users run something else.
2790
- */
2791
- type TMDataGridCellExportOptions = {
2792
- /** CSV field separator. Defaults to `";"`. */
2793
- separator?: string;
2794
- /** Write numbers as `1,5` rather than `1.5`. Defaults to `true`. */
2795
- decimalComma?: boolean;
2796
- /** Column labels as the first row. Defaults to `true`. */
2797
- includeHeaders?: boolean;
2798
- /** Without extension. Defaults to `"export"`. */
2799
- fileName?: string;
2800
- };
2801
- type ResolvedExportOptions = Required<TMDataGridCellExportOptions>;
2802
- declare const DEFAULT_CELL_EXPORT_OPTIONS: ResolvedExportOptions;
2803
- /**
2804
- * One value as text.
2805
- *
2806
- * Deliberately not the rendered cell: what a cell renders is React, and often a
2807
- * badge, a link or an icon rather than the value. The value is what a
2808
- * spreadsheet wants, and it is the one thing every column is guaranteed to
2809
- * have.
2810
- */
2811
- declare function formatExportValue(value: unknown, { decimalComma }: {
2812
- decimalComma: boolean;
2813
- }): string;
2814
- type BuildCellMatrixArgs = {
2815
- rows: ReadonlyArray<Row<TMDataGridFeatures, TMDataGridRowData>>;
2816
- /** Every visible column, in render order - the same list the bounds index into. */
2817
- columns: ReadonlyArray<Column<TMDataGridFeatures, TMDataGridRowData, unknown>>;
2818
- bounds: TMDataGridRangeBounds;
2819
- includeHeaders: boolean;
2820
- decimalComma: boolean;
2821
- };
2822
- /**
2823
- * The selected rectangle as rows of text.
2824
- *
2825
- * The generated lanes - the checkbox, the tree chevron, the details chevron -
2826
- * are dropped even when the rectangle covers them. They hold controls rather
2827
- * than data, so a column of empty strings is all they could contribute, and
2828
- * pasting one into a spreadsheet only shifts everything to its right.
2829
- */
2830
- declare function buildCellMatrix({ rows, columns, bounds, includeHeaders, decimalComma }: BuildCellMatrixArgs): TMDataGridCellMatrix;
2831
- /**
2832
- * The whole grid as rows of text: every filtered and sorted data row - all
2833
- * pages, not the one on screen - by every visible non-control column, in
2834
- * render order.
2835
- *
2836
- * The values are the same ones a cell-range export writes; only the bounds
2837
- * differ. Group rows are left out (their records are the rows themselves),
2838
- * and hidden columns are not exported - what you see is what you get, minus
2839
- * paging.
2840
- */
2841
- declare function buildGridCellMatrix<TData extends RowData>({ table, includeHeaders, decimalComma }: {
2842
- table: TMDataGridTable<TData>;
2843
- includeHeaders?: boolean;
2844
- decimalComma?: boolean;
2845
- }): TMDataGridCellMatrix;
2846
- /**
2847
- * Downloads the whole grid as a CSV for Excel - {@link buildGridCellMatrix}
2848
- * through {@link toExcelCsv}, with the same Nordic defaults and overrides as
2849
- * the cell-range export.
2850
- *
2851
- * No built-in button: wire it to your own toolbar.
2852
- *
2853
- * ```tsx
2854
- * <Button onClick={() => exportGridToCsv({ table: grid.table })}>Export</Button>
2855
- * ```
2856
- */
2857
- declare function exportGridToCsv<TData extends RowData>({ table, options }: {
2858
- table: TMDataGridTable<TData>;
2859
- options?: TMDataGridCellExportOptions;
2860
- }): void;
2861
- /**
2862
- * The clipboard format spreadsheets read: tab between cells, CRLF between rows.
2863
- *
2864
- * Tabs rather than commas because that is what Excel, Sheets and Numbers all
2865
- * put on the clipboard themselves - paste it and the cells land in cells. A
2866
- * comma-separated string pastes into a single column, which is the thing this
2867
- * exists to avoid.
2868
- */
2869
- declare function toClipboardText(matrix: TMDataGridCellMatrix): string;
2870
- /**
2871
- * A CSV that opens straight into columns in Excel.
2872
- *
2873
- * Three things make that true, and all three are needed:
2874
- *
2875
- * | Part | Why |
2876
- * | ---- | --- |
2877
- * | `sep=;` first line | Excel's own directive - it stops guessing and uses this |
2878
- * | UTF-8 BOM | without it Excel reads the file as ANSI, and å ä ö arrive broken |
2879
- * | CRLF line endings | what Excel writes, and what its importer is happiest with |
2880
- *
2881
- * The `sep=` line is Excel's alone; other readers show it as a first row. This
2882
- * export targets Excel, so opening correctly there takes priority over strict
2883
- * CSV.
2884
- */
2885
- declare function toExcelCsv(matrix: TMDataGridCellMatrix, { separator }: {
2886
- separator: string;
2887
- }): string;
2888
- /**
2889
- * Puts text on the clipboard, reporting whether it landed.
2890
- *
2891
- * The async clipboard API only resolves for a document that has the focus and a
2892
- * user gesture behind it - both true when this runs off Ctrl+C or a menu item.
2893
- * It is still allowed to reject (a permissions policy, a page that lost focus
2894
- * mid-copy), so the result is a boolean the caller can act on.
2895
- */
2896
- declare function writeClipboardText(text: string): Promise<boolean>;
2897
- /**
2898
- * Downloads text as a file, through the one mechanism a library can use: an
2899
- * anchor with an object URL behind it, clicked. Revoked on the next frame -
2900
- * immediately would race the browser's own read of it.
2901
- */
2902
- declare function downloadTextFile({ fileName, text, mimeType }: {
2903
- fileName: string;
2904
- text: string;
2905
- mimeType?: string;
2906
- }): void;
2907
- //#endregion
2908
3283
  //#region .types-tmp/components/TMDataGridTable.d.ts
2909
3284
  /** Where a column sits relative to the pinned regions, resolved once per render. */
2910
3285
  type TMDataGridColumnLayout = {
@@ -3113,9 +3488,10 @@ type TMDataGridTableProps<TData extends RowData> = {
3113
3488
  */
3114
3489
  rowContextMenuProps?: Omit<MenuProps, "opened" | "onChange" | "children">;
3115
3490
  /**
3116
- * How Ctrl+C and the export item write values, under
3117
- * `cellSelection: "range"`. Defaults to the Nordic Excel conventions - see
3118
- * {@link TMDataGridCellExportOptions}.
3491
+ * @deprecated Set `exportOptions` on `useTMDataGrid` instead; it covers the
3492
+ * cell-range menu and every other export alike. Until it goes, this is
3493
+ * converted (`separator` and `decimalComma` become a `csvExcelFormat`) and
3494
+ * merged over `exportOptions` for the cell-range menu only.
3119
3495
  */
3120
3496
  cellExport?: TMDataGridCellExportOptions;
3121
3497
  /**
@@ -3155,12 +3531,22 @@ type TMDataGridTableProps<TData extends RowData> = {
3155
3531
  declare function TMDataGridTable$1<TData extends RowData = TMDataGridRowData>({ onRowClick, onCellClick, onCellDoubleClick, onCellContextMenu, rowClassName, rowStyle, striped, onScrollToTop, onScrollToBottom, onScrollToLeft, onScrollToRight, renderEmptyState, renderRowContextMenu, renderColumnMenuItems, rowContextMenuProps, cellExport, onReachEnd, reachEndThreshold, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }: TMDataGridTableProps<TData>): import("react").JSX.Element;
3156
3532
  //#endregion
3157
3533
  //#region .types-tmp/components/TMDataGridToolbar.d.ts
3158
- /** Row above the grid. Compose it from the pieces below, or anything else. */
3159
- declare function TMDataGridToolbar({ children }: {
3534
+ type TMDataGridToolbarProps = BoxProps & {
3160
3535
  children?: ReactNode;
3161
- }): import("react").JSX.Element;
3162
- /** Pushes the following toolbar items to the right. */
3163
- declare function TMDataGridToolbarSpacer(): import("react").JSX.Element;
3536
+ /**
3537
+ * Draws a 1px line under the toolbar in the theme's default border colour -
3538
+ * the same line the header draws under itself. Defaults to `false`.
3539
+ */
3540
+ withBottomBorder?: boolean;
3541
+ };
3542
+ /**
3543
+ * Row above the grid. Compose it from the pieces below, or anything else.
3544
+ * Takes Mantine's style props (`mb="sm"`, `px="md"`, `hiddenFrom="sm"`) and
3545
+ * sets them on the row.
3546
+ */
3547
+ declare function TMDataGridToolbar({ children, withBottomBorder, className, mod, ...others }: TMDataGridToolbarProps): import("react").JSX.Element;
3548
+ /** Pushes the following toolbar items to the right. Takes Mantine's style props. */
3549
+ declare function TMDataGridToolbarSpacer({ className, ...others }: BoxProps): import("react").JSX.Element;
3164
3550
  /**
3165
3551
  * A small spinner shown while `meta.loading` is true, and nothing otherwise.
3166
3552
  *
@@ -3231,6 +3617,7 @@ type TMDataGridProps<TData extends RowData> = TMDataGridApi<TData> & {
3231
3617
  */
3232
3618
  "data-testid"?: string;
3233
3619
  };
3620
+ declare function TMDataGridRoot<TData extends RowData>({ table, ui, edit, features, filters, exportOptions, labels, renderDetails, renderDetailsEstHeight, overscan, resetSettings, scrollToRow, scrollerRef, size, children, className, style, id, "data-testid": testId }: TMDataGridProps<TData>): import("react").JSX.Element;
3234
3621
  /**
3235
3622
  * Root of the grid. Takes the object returned by `useTMDataGrid` - spread it -
3236
3623
  * and publishes it to the compound components below it:
@@ -3251,7 +3638,6 @@ type TMDataGridProps<TData extends RowData> = TMDataGridApi<TData> & {
3251
3638
  * </TMDataGrid>
3252
3639
  * ```
3253
3640
  */
3254
- declare function TMDataGridRoot<TData extends RowData>({ table, ui, edit, features, filters, labels, renderDetails, renderDetailsEstHeight, overscan, resetSettings, scrollToRow, scrollerRef, size, children, className, style, id, "data-testid": testId }: TMDataGridProps<TData>): import("react").JSX.Element;
3255
3641
  declare const TMDataGrid: typeof TMDataGridRoot & {
3256
3642
  Toolbar: typeof TMDataGridToolbar;
3257
3643
  Spacer: typeof TMDataGridToolbarSpacer;
@@ -3264,6 +3650,8 @@ declare const TMDataGrid: typeof TMDataGridRoot & {
3264
3650
  ColumnToggles: typeof TMDataGridMenuColumnToggles;
3265
3651
  ShowHideAll: typeof TMDataGridMenuShowHideAll;
3266
3652
  ResetLayout: typeof TMDataGridMenuResetLayout;
3653
+ Export: typeof TMDataGridMenuExport;
3654
+ ExportSelected: typeof TMDataGridMenuExportSelected;
3267
3655
  };
3268
3656
  FilterButton: typeof TMDataGridFilterButton;
3269
3657
  Table: typeof TMDataGridTable$1;
@@ -3305,6 +3693,46 @@ declare const GROUP_COLUMN_ID = "__group__";
3305
3693
  */
3306
3694
  declare function formatGroupValue(value: unknown, blankLabel?: string): string;
3307
3695
  //#endregion
3696
+ //#region .types-tmp/useTMDataGridExport.d.ts
3697
+ /** What {@link useTMDataGridExport} returns. */
3698
+ type TMDataGridExportApi = {
3699
+ /**
3700
+ * Downloads every filtered and sorted row, all pages. `overrides` are folded
3701
+ * over the hook's options for this one call - the column picker's chosen
3702
+ * columns, for instance.
3703
+ */
3704
+ exportAll: (overrides?: TMDataGridExportOptions) => Promise<void>;
3705
+ /**
3706
+ * Downloads the selected rows of the current view, in grid order. Resolves
3707
+ * without a download when none is selected.
3708
+ */
3709
+ exportSelected: (overrides?: TMDataGridExportOptions) => Promise<void>;
3710
+ /** How many rows `exportSelected` would write. Subscribes to the selection. */
3711
+ selectedCount: number;
3712
+ /**
3713
+ * Whether row selection is on at all - `false` under
3714
+ * `selectionMode: "highlight"` or `enableRowSelection: false`, where a
3715
+ * "selected rows" control has nothing to offer.
3716
+ */
3717
+ canExportSelected: boolean;
3718
+ };
3719
+ /**
3720
+ * The export as click handlers, for a button of your own anywhere inside the
3721
+ * grid. The `TMDataGrid.Menu.Export*` items are this hook behind a
3722
+ * `Menu.Item`.
3723
+ *
3724
+ * ```tsx
3725
+ * function ExportButton() {
3726
+ * const { exportAll } = useTMDataGridExport();
3727
+ * return <Button onClick={() => void exportAll()}>Export</Button>;
3728
+ * }
3729
+ * ```
3730
+ *
3731
+ * `overrides` are folded over the grid's `exportOptions` for this caller:
3732
+ * another format, another file name, another set of columns.
3733
+ */
3734
+ declare function useTMDataGridExport(overrides?: TMDataGridExportOptions): TMDataGridExportApi;
3735
+ //#endregion
3308
3736
  //#region .types-tmp/components/filters/TMDataGridFilterValueInput.d.ts
3309
3737
  /**
3310
3738
  * The built-in value control of a filter row - what renders when a column
@@ -3406,77 +3834,6 @@ declare function TMDataGridMultiSelectEditor({ field, column, row, table, size }
3406
3834
  */
3407
3835
  declare const TMDATAGRID_LABELS_SV: TMDataGridLabels;
3408
3836
  //#endregion
3409
- //#region .types-tmp/core/columnUtils.d.ts
3410
- /**
3411
- * Structural shape of the column bits the chrome reads. Kept minimal so these
3412
- * helpers work with any `Column`/`Header` instance without dragging generics
3413
- * through every call site.
3414
- */
3415
- type ColumnLike = {
3416
- id: string;
3417
- columnDef: {
3418
- header?: unknown;
3419
- meta?: TMDataGridColumnMeta;
3420
- };
3421
- /** Set on a leaf that sits inside a header group. */
3422
- parent?: unknown;
3423
- };
3424
- /** Menu- and panel-facing column name. */
3425
- declare function getColumnLabel(column: ColumnLike): string;
3426
- declare function getColumnType(column: ColumnLike): TMDataGridColumnType;
3427
- /**
3428
- * The operator a fresh filter on this column starts with -
3429
- * `meta.filter.defaultOperator`, else the type's default.
3430
- */
3431
- declare function getColumnDefaultOperator(column: ColumnLike): TMDataGridFilterOperator;
3432
- /**
3433
- * This column's filter-panel value control - `meta.filter.control`, or
3434
- * `undefined` for the built-in shape-by-operator input.
3435
- */
3436
- declare function getColumnFilterControl(column: ColumnLike): TMDataGridFilterControlComponent | undefined;
3437
- /**
3438
- * Whether `meta.edit.enabled` lets this column's cell on this row be edited -
3439
- * the switch, then the predicate.
3440
- *
3441
- * This is only the column's half of the rule. A cell also needs the column to
3442
- * map to a field (`getEditFieldName`) and the row to take edits at all
3443
- * (`isRowEditable`); `edit.canEditCell` is the whole question.
3444
- */
3445
- declare function isColumnEditableForRow(column: ColumnLike, row: Row<TMDataGridFeatures, TMDataGridRowData>): boolean;
3446
- /**
3447
- * A generated lane holding one fixed-width thing - the checkbox, the details
3448
- * chevron, the row number.
3449
- *
3450
- * They are laid out differently from every other column: cell padding is sized
3451
- * for text and grows with the scale, which at `xl` squeezed a 16px checkbox out
3452
- * of its track, so these lanes centre their content in an unpadded cell.
3453
- * Their headers carry no column menu, and none of them is ever exported -
3454
- * they hold chrome, not values.
3455
- *
3456
- * The tree column is deliberately not one of them: it holds a label as well as a
3457
- * chevron, and wants the padding.
3458
- */
3459
- declare function isControlColumn(columnId: string): boolean;
3460
- /**
3461
- * Whether the grid generated this column rather than the consumer declaring it
3462
- * - the four control lanes plus the tree column.
3463
- *
3464
- * These hold the grid's own chrome, and they keep the edges of the row: the
3465
- * generated left lanes before every consumer column, the edit lane after all of
3466
- * them. `isControlColumn` answers a narrower question about layout, and leaves
3467
- * the tree column out because it is padded like a data column.
3468
- */
3469
- declare function isGeneratedColumn(columnId: string): boolean;
3470
- /**
3471
- * Whether a column may be moved. Ordering is the one column feature TanStack
3472
- * has no column option for, so the switch lives in `meta.enableOrdering`.
3473
- *
3474
- * A leaf inside a header group is never movable: `columnOrder` sequences leaf
3475
- * columns, so moving one out of its group would leave the group header spanning
3476
- * columns that no longer belong to it.
3477
- */
3478
- declare function isColumnReorderable(column: ColumnLike): boolean;
3479
- //#endregion
3480
3837
  //#region .types-tmp/core/grouping.d.ts
3481
3838
  /**
3482
3839
  * The data rows under a group row, at any depth.
@@ -3600,11 +3957,11 @@ type GridTable = TMDataGridTable<TMDataGridRowData>;
3600
3957
  * The lane a column renders in.
3601
3958
  *
3602
3959
  * Pinning splits the grid into three, and TanStack sequences them from two
3603
- * different state slices: `columnPinning.left` / `.right` order the pinned
3960
+ * different state slices: `columnPinning.start` / `.end` order the pinned
3604
3961
  * lanes, `columnOrder` orders the centre. A move therefore always stays inside
3605
3962
  * one lane - moving a column into another one would be a pin, not a reorder.
3606
3963
  */
3607
- type TMDataGridColumnRegion = "left" | "center" | "right";
3964
+ type TMDataGridColumnRegion = "start" | "center" | "end";
3608
3965
  /** Which edge of the column under the pointer a dragged column lands on. */
3609
3966
  type TMDataGridDropSide = "before" | "after";
3610
3967
  declare function getColumnRegion(columnPinning: ColumnPinningState, columnId: string): TMDataGridColumnRegion;
@@ -3630,7 +3987,7 @@ declare function moveColumn({ table, columnId, targetId, side }: MoveColumnArgs)
3630
3987
  * Puts the generated lanes back on the outside of both pinned lanes: the ones
3631
3988
  * on the left before every consumer column, the edit lane after all of them.
3632
3989
  *
3633
- * `column.pin("right")` appends, so pinning a column right would otherwise drop
3990
+ * `column.pin("end")` appends, so pinning a column right would otherwise drop
3634
3991
  * it outside the edit lane, so the row's Save and Delete would no longer be
3635
3992
  * last in the row. Pinning left appends too, which is already correct there,
3636
3993
  * but the same pass keeps both lanes in place whatever a consumer writes into
@@ -3756,4 +4113,4 @@ declare function getSelectableRowIds<TData extends RowData>(row: Row<TMDataGridF
3756
4113
  */
3757
4114
  declare function resolveRowSelectionClick<TData extends RowData>({ rows, rowId, anchorRowId, modifiers, selection, canReplaceSelection }: ResolveRowSelectionClickArgs<TData>): ResolvedRowSelection;
3758
4115
  //#endregion
3759
- 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 TMDataGridColumnFilter, 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 TMDataGridEditRowSnapshot, 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 TMDataGridFilterControlLayout, type TMDataGridFilterOperator, type TMDataGridFilterPanelLayout, type TMDataGridFilterPanelProps, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterSidebarSide, type TMDataGridFilterSurface, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFilterValueShape, type TMDataGridFiltersOptions, type TMDataGridFiltersSettings, type TMDataGridFooterProps, type TMDataGridLabels, type TMDataGridLabelsOverride, type TMDataGridMenuColumnsProps, type TMDataGridMenuProps, 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, activeColumnFilters, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildGridCellMatrix, clearedValueForType, createTMDataGridColumnHelper, downloadTextFile, emptyValueForOperator, exportGridToCsv, filterValueShape, 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, useTMDataGrid, useTMDataGridContext, writeClipboardText };
4116
+ export { type BuildCellMatrixArgs, type BuildExportDataArgs, type ColumnStepArgs, DATA_STATE_SLICES, DEFAULT_CELL_EXPORT_OPTIONS, DEFAULT_EXPORT_OPTIONS, DEFAULT_TMDATAGRID_SIZE, DETAILS_COLUMN_ID, DgAutocompleteFilter, DgDateRangeFilter, DgRangeSliderFilter, DgTriStateFilter, EDIT_COLUMN_ID, type ExportGridArgs, 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 TMDataGridClipboardTextOptions, type TMDataGridColumnCapabilities, type TMDataGridColumnEditOptions, type TMDataGridColumnFilter, type TMDataGridColumnFilterOptions, type TMDataGridColumnLayout, type TMDataGridColumnMenuItemsArgs, type TMDataGridColumnMenuItemsRenderer, type TMDataGridColumnMeta, type TMDataGridColumnRegion, type TMDataGridColumnSearchable, type TMDataGridColumnType, type TMDataGridColumnsPanelProps, type TMDataGridContextValue, type TMDataGridCsvFormatOptions, 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 TMDataGridEditRowSnapshot, type TMDataGridEditState, type TMDataGridEditValueMap, type TMDataGridEditValueMapArgs, type TMDataGridEditingOptions, type TMDataGridEditorArgs, type TMDataGridEditorComponent, type TMDataGridExpandAllArgs, type TMDataGridExpandTarget, type TMDataGridExportApi, type TMDataGridExportColumns, type TMDataGridExportData, type TMDataGridExportFormat, type TMDataGridExportOptions, type TMDataGridExportPickerRequest, type TMDataGridExportRows, type TMDataGridExportSettings, type TMDataGridExportValueGetter, type TMDataGridExportWriteOptions, type TMDataGridFeatureFlags, type TMDataGridFeatures, type TMDataGridFieldValidate, type TMDataGridFilterControlArgs, type TMDataGridFilterControlComponent, type TMDataGridFilterControlLayout, type TMDataGridFilterOperator, type TMDataGridFilterPanelLayout, type TMDataGridFilterPanelProps, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterSidebarSide, type TMDataGridFilterSurface, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFilterValueShape, type TMDataGridFiltersOptions, type TMDataGridFiltersSettings, type TMDataGridFooterProps, type TMDataGridJsonFormatOptions, type TMDataGridLabels, type TMDataGridLabelsOverride, type TMDataGridMenuColumnsProps, type TMDataGridMenuExportProps, type TMDataGridMenuProps, 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 TMDataGridToolbarProps, type TMDataGridTsvFormatOptions, type TMDataGridUiActions, type TMDataGridUiState, type TMDataGridUiStore, type UseTMDataGridOptions, activeColumnFilters, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildExportData, buildGridCellMatrix, clearedValueForType, countSelectedExportRows, createTMDataGridColumnHelper, csvExcelFormat, csvFormat, downloadFile, downloadTextFile, emptyValueForOperator, exportGrid, exportGridToCsv, filterValueShape, formatExportValue, formatFilterLabel, formatGroupValue, fromCellExportOptions, fuzzyGlobalFilterFn, getColumnCapabilities, getColumnDefaultOperator, getColumnFilterControl, getColumnLabel, getColumnOperators, getColumnRegion, getColumnType, getDefaultOperator, getDisplayedRows, getEditFieldName, getExportableColumns, getGridCapabilities, getGroupDataRows, getOperatorsForType, getSelectableRowIds, getStepTargetColumn, getTMDataGridPaginationApi, guardFormula, isColumnEditableForRow, isColumnReorderable, isControlColumn, isFilterActive, isGeneratedColumn, isPagingActive, isSameCell, isWithinBounds, jsonFormat, keepGeneratedColumnsOutermost, measureColumnContentWidth, mergeLabels, moveColumn, moveColumnByStep, normalizeFieldValidate, openColumnFilter, operatorNeedsValue, operatorTakesArrayValue, operatorTakesRangeValue, optionsToComboboxData, readFeatureFlags, resolveCellMove, resolveColumnOptions, resolveExpandAll, resolveExportOptions, resolveRangeBounds, resolveRowSelectionClick, tmDataGridFeatures, toClipboardText, toExcelCsv, tsvFormat, useTMDataGrid, useTMDataGridContext, useTMDataGridExport, writeClipboardText, writeExportFile };