@jielga/tmdatagrid 1.0.0 → 1.0.2

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 (78) hide show
  1. package/README.md +8 -8
  2. package/dist/index.d.ts +225 -225
  3. package/dist/index.js +58 -50
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +1 -1
  6. package/package.json +3 -2
  7. package/skills/appearance/SKILL.md +322 -0
  8. package/skills/cell-selection/SKILL.md +240 -0
  9. package/skills/columns/SKILL.md +261 -86
  10. package/skills/data/SKILL.md +289 -0
  11. package/skills/editing/SKILL.md +492 -0
  12. package/skills/editing/references/editing-api.md +124 -0
  13. package/skills/editing/references/editors-and-validation.md +198 -0
  14. package/skills/filtering/SKILL.md +344 -0
  15. package/skills/getting-started/SKILL.md +48 -27
  16. package/skills/grouping/SKILL.md +264 -0
  17. package/skills/options/SKILL.md +31 -20
  18. package/skills/rows/SKILL.md +369 -0
  19. package/skills/rows/references/rows-api.md +117 -0
  20. package/skills/server-side/SKILL.md +7 -7
  21. package/skills/testing/SKILL.md +12 -12
  22. package/src/tmdatagrid/TMDataGridContext.ts +2 -2
  23. package/src/tmdatagrid/components/TMDataGrid.module.css +2 -2
  24. package/src/tmdatagrid/components/TMDataGrid.tsx +5 -5
  25. package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +4 -4
  26. package/src/tmdatagrid/components/TMDataGridColumnsPanel.tsx +2 -2
  27. package/src/tmdatagrid/components/TMDataGridDetailsColumn.tsx +6 -6
  28. package/src/tmdatagrid/components/TMDataGridEditActions.tsx +2 -2
  29. package/src/tmdatagrid/components/TMDataGridEditColumn.tsx +4 -4
  30. package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +6 -6
  31. package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +6 -6
  32. package/src/tmdatagrid/components/TMDataGridFilterPills.module.css +2 -2
  33. package/src/tmdatagrid/components/TMDataGridFilterPills.tsx +1 -1
  34. package/src/tmdatagrid/components/TMDataGridFooter.module.css +1 -1
  35. package/src/tmdatagrid/components/TMDataGridFooter.tsx +12 -6
  36. package/src/tmdatagrid/components/TMDataGridGroupColumn.module.css +1 -1
  37. package/src/tmdatagrid/components/TMDataGridGroupColumn.tsx +5 -5
  38. package/src/tmdatagrid/components/TMDataGridHeaderCell.module.css +8 -8
  39. package/src/tmdatagrid/components/TMDataGridHeaderCell.tsx +12 -12
  40. package/src/tmdatagrid/components/TMDataGridRowNumberColumn.tsx +4 -4
  41. package/src/tmdatagrid/components/TMDataGridSearch.tsx +5 -5
  42. package/src/tmdatagrid/components/TMDataGridSelectColumn.tsx +8 -8
  43. package/src/tmdatagrid/components/TMDataGridTable.module.css +18 -18
  44. package/src/tmdatagrid/components/TMDataGridTable.tsx +116 -116
  45. package/src/tmdatagrid/components/TMDataGridToolbar.tsx +5 -5
  46. package/src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx +1 -1
  47. package/src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx +2 -2
  48. package/src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx +1 -1
  49. package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +1 -1
  50. package/src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx +2 -2
  51. package/src/tmdatagrid/components/editors/editorShared.ts +3 -3
  52. package/src/tmdatagrid/components/filters/DgDateRangeFilter.tsx +1 -1
  53. package/src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx +1 -1
  54. package/src/tmdatagrid/components/filters/DgTriStateFilter.tsx +1 -1
  55. package/src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx +2 -2
  56. package/src/tmdatagrid/components/sticky.module.css +8 -8
  57. package/src/tmdatagrid/core/autosize.ts +4 -4
  58. package/src/tmdatagrid/core/capabilities.ts +17 -17
  59. package/src/tmdatagrid/core/cellExport.ts +13 -13
  60. package/src/tmdatagrid/core/cellNavigation.ts +6 -6
  61. package/src/tmdatagrid/core/cellRange.ts +4 -4
  62. package/src/tmdatagrid/core/columnOptions.ts +2 -2
  63. package/src/tmdatagrid/core/columnOrdering.ts +2 -2
  64. package/src/tmdatagrid/core/columnUtils.ts +3 -3
  65. package/src/tmdatagrid/core/editEngine.ts +49 -49
  66. package/src/tmdatagrid/core/expanding.ts +5 -5
  67. package/src/tmdatagrid/core/filterControls.ts +5 -5
  68. package/src/tmdatagrid/core/filterOperators.ts +14 -14
  69. package/src/tmdatagrid/core/labels.ts +8 -8
  70. package/src/tmdatagrid/core/matchHighlight.ts +4 -4
  71. package/src/tmdatagrid/core/persistence.ts +8 -8
  72. package/src/tmdatagrid/core/quickSearch.ts +8 -8
  73. package/src/tmdatagrid/core/rowPinning.ts +3 -3
  74. package/src/tmdatagrid/core/rowSelection.ts +12 -12
  75. package/src/tmdatagrid/core/sizes.ts +1 -1
  76. package/src/tmdatagrid/core/summary.ts +3 -3
  77. package/src/tmdatagrid/useTMDataGrid.tsx +79 -79
  78. package/skills/features/SKILL.md +0 -352
@@ -134,10 +134,10 @@ export type TMDataGridColumnMeta = {
134
134
  */
135
135
  type?: TMDataGridColumnType;
136
136
  /**
137
- * The choices of a `select` / `multiSelect` column — one declaration feeding
137
+ * The choices of a `select` / `multiSelect` column - one declaration feeding
138
138
  * the filter panel's value control and the cell editor alike. A static
139
139
  * array, `"faceted"` (the distinct values present in the data), or a
140
- * function of the table, column and — for editors — the row. See
140
+ * function of the table, column and, for editors, the row. See
141
141
  * {@link TMDataGridOptionsSource}.
142
142
  */
143
143
  options?: TMDataGridOptionsSource;
@@ -146,7 +146,7 @@ export type TMDataGridColumnMeta = {
146
146
  align?: "left" | "right" | "center";
147
147
  /**
148
148
  * Size the column to its widest mounted content once, after the first rows
149
- * render — unless a persisted or user-set width already covers it. The same
149
+ * render - unless a persisted or user-set width already covers it. The same
150
150
  * measurement as double-clicking the resize divider; see `autosizeColumn`.
151
151
  */
152
152
  autoSize?: boolean;
@@ -158,13 +158,13 @@ export type TMDataGridColumnMeta = {
158
158
  enableOrdering?: boolean;
159
159
  /**
160
160
  * The operator a fresh filter on this column starts with, instead of the
161
- * type's default — a salary column can open on `"between"`. Must be one of
161
+ * type's default - a salary column can open on `"between"`. Must be one of
162
162
  * the type's own operators.
163
163
  */
164
164
  defaultFilterOperator?: TMDataGridFilterOperator;
165
165
  /**
166
166
  * Replaces the built-in value control in this column's filter-panel row. A
167
- * component rendered as JSX — hooks are legal inside — receiving the
167
+ * component rendered as JSX (hooks are legal inside), receiving the
168
168
  * value-only contract: it reads the current operator, writes the bare
169
169
  * value, and the grid composes the stored filter around it. Define it at
170
170
  * module scope. See {@link TMDataGridFilterControlArgs}.
@@ -173,13 +173,13 @@ export type TMDataGridColumnMeta = {
173
173
  /**
174
174
  * Whether this column's cells take edits, once `editMode` is on. `false`
175
175
  * switches the column off outright; a predicate decides per row. Defaults
176
- * to editable for any column that maps to a field — see {@link editField}.
176
+ * to editable for any column that maps to a field - see {@link editField}.
177
177
  */
178
178
  editable?:
179
179
  | boolean
180
180
  | ((row: Row<TMDataGridFeatures, TMDataGridRowData>) => boolean);
181
181
  /**
182
- * The data path this column edits, when it is not the `accessorKey` — the
182
+ * The data path this column edits, when it is not the `accessorKey` - the
183
183
  * only way a column built on `accessorFn` becomes editable. Dot paths reach
184
184
  * into nested records: `"address.city"`.
185
185
  */
@@ -197,7 +197,7 @@ export type TMDataGridColumnMeta = {
197
197
  validate?: TMDataGridFieldValidate;
198
198
  /**
199
199
  * Replaces the built-in editor for this column. A component rendered as
200
- * JSX — hooks are legal inside — receiving the live TanStack Form `field`
200
+ * JSX (hooks are legal inside), receiving the live TanStack Form `field`
201
201
  * API plus the table context, the same contract the built-ins fill. Define
202
202
  * it at module scope so its identity is stable across renders. See
203
203
  * {@link TMDataGridEditorArgs}.
@@ -213,7 +213,7 @@ export type TMDataGridTableMeta = {
213
213
  rowHeight?: number;
214
214
  /**
215
215
  * Unfiltered row total. Only needed for server-driven grids, where the client
216
- * never holds the full data set — `TMDataGrid.SummaryCount` uses it as denominator.
216
+ * never holds the full data set - `TMDataGrid.SummaryCount` uses it as denominator.
217
217
  */
218
218
  totalRowCount?: number;
219
219
  };
@@ -243,7 +243,7 @@ export const tmDataGridFeatures = tableFeatures({
243
243
 
244
244
  filteredRowModel: createFilteredRowModel(),
245
245
  groupedRowModel: createGroupedRowModel(),
246
- // The sorted model plus the fuzzy quick search's rank ordering — see
246
+ // The sorted model plus the fuzzy quick search's rank ordering - see
247
247
  // core/quickSearch.ts for when the ordering applies.
248
248
  sortedRowModel: createFuzzyRankedSortedRowModel(),
249
249
  expandedRowModel: createExpandedRowModel(),
@@ -259,7 +259,7 @@ export const tmDataGridFeatures = tableFeatures({
259
259
  },
260
260
  sortFns,
261
261
  // The names `columnDef.aggregationFn` accepts. Only consulted for columns
262
- // that ask for one — a column with no `aggregationFn` reports `undefined` on
262
+ // that ask for one - a column with no `aggregationFn` reports `undefined` on
263
263
  // a group row, which is what keeps a plain "group by" free of aggregates.
264
264
  aggregationFns,
265
265
 
@@ -291,7 +291,7 @@ export type TMDataGridDetailsRenderer<TData extends RowData> = (
291
291
 
292
292
  /**
293
293
  * What the virtualizer assumes a detail panel it has not measured yet is worth.
294
- * Only a seed — every mounted row is measured, so the real height replaces it.
294
+ * Only a seed - every mounted row is measured, so the real height replaces it.
295
295
  */
296
296
  const DEFAULT_DETAILS_EST_HEIGHT = 160;
297
297
 
@@ -314,13 +314,13 @@ export type TMDataGridUiState = {
314
314
  */
315
315
  draggedColumnId: string | null;
316
316
  /**
317
- * The single highlighted row — the one a detail panel would be showing. Its
317
+ * The single highlighted row - the one a detail panel would be showing. Its
318
318
  * own concept, not a slice of `rowSelection`: under
319
319
  * `selectionMode: "checkboxAndHighlight"` the two coexist, and TanStack's one
320
320
  * selection map cannot hold both.
321
321
  *
322
322
  * Not pruned when the row is filtered out, paged away or dropped from `data`,
323
- * matching how TanStack treats `rowSelection` — nothing there resets it
323
+ * matching how TanStack treats `rowSelection` - nothing there resets it
324
324
  * either. The row simply renders unhighlighted, and highlights again if it
325
325
  * comes back.
326
326
  */
@@ -329,17 +329,17 @@ export type TMDataGridUiState = {
329
329
  selectionAnchorRowId: string | null;
330
330
  /**
331
331
  * The cell the keyboard is on, under `enableCellSelection`. `null` until the
332
- * grid is first entered — and again whenever a consumer clears it.
332
+ * grid is first entered - and again whenever a consumer clears it.
333
333
  *
334
334
  * The state is the source of truth and DOM focus follows it, not the other
335
335
  * way around: under virtualization the cell it names is often not mounted,
336
336
  * which is exactly what a coordinate has to survive. Held as ids for the
337
- * same reason — see {@link TMDataGridCellPosition}.
337
+ * same reason - see {@link TMDataGridCellPosition}.
338
338
  */
339
339
  focusedCell: TMDataGridCellPosition | null;
340
340
  /**
341
341
  * The selected rectangle, under `cellSelection: "range"`. Held as the two
342
- * cells that span it — see {@link TMDataGridCellRange}.
342
+ * cells that span it - see {@link TMDataGridCellRange}.
343
343
  *
344
344
  * Always covers the focused cell: every gesture that moves the focus either
345
345
  * extends the rectangle or collapses it onto the new cell, so the two never
@@ -356,21 +356,21 @@ export type TMDataGridUiActions = {
356
356
  startColumnDrag: (columnId: string) => void;
357
357
  endColumnDrag: () => void;
358
358
  /**
359
- * Moves the active row, or clears it with `null` — which is how a consumer
359
+ * Moves the active row, or clears it with `null` - which is how a consumer
360
360
  * closing its detail panel puts the grid back in step.
361
361
  */
362
362
  setHighlightedRow: (rowId: string | null) => void;
363
363
  setSelectionAnchor: (rowId: string | null) => void;
364
364
  /**
365
365
  * Moves the focused cell, or clears it with `null`. DOM focus follows while
366
- * the grid holds it — so this both moves the keyboard and, when the row is
366
+ * the grid holds it - so this both moves the keyboard and, when the row is
367
367
  * off screen, scrolls it into view. Called for every arrow key, and available
368
368
  * for a consumer putting the keyboard somewhere itself.
369
369
  */
370
370
  setFocusedCell: (cell: TMDataGridCellPosition | null) => void;
371
371
  /**
372
372
  * Sets the selected rectangle, or clears it with `null`. Does not move the
373
- * focused cell — the two are set together by the gestures that change both,
373
+ * focused cell - the two are set together by the gestures that change both,
374
374
  * which is what keeps "extend the selection" and "move the cursor" separable.
375
375
  */
376
376
  setCellRange: (range: TMDataGridCellRange | null) => void;
@@ -384,19 +384,19 @@ export type TMDataGridScrollAlign = "auto" | "start" | "center" | "end";
384
384
  export type TMDataGridScrollToRowArgs = {
385
385
  /** The row's id, as `getRowId` produced it. */
386
386
  rowId: string;
387
- /** Defaults to `"auto"` — the nearest edge, leaving a visible row alone. */
387
+ /** Defaults to `"auto"` - the nearest edge, leaving a visible row alone. */
388
388
  align?: TMDataGridScrollAlign;
389
389
  };
390
390
 
391
391
  /** @internal The body's scroll implementation. See `scrollToRow`. */
392
392
  export type TMDataGridScroller = (args: TMDataGridScrollToRowArgs) => boolean;
393
393
 
394
- /** What `useTMDataGrid` returns — spread straight onto `<TMDataGrid />`. */
394
+ /** What `useTMDataGrid` returns - spread straight onto `<TMDataGrid />`. */
395
395
  export type TMDataGridApi<TData extends RowData> = {
396
396
  table: TMDataGridTable<TData>;
397
397
  ui: TMDataGridUiStore;
398
398
  /**
399
- * The edit engine — open forms, dirty/error projections, and the verbs
399
+ * The edit engine - open forms, dirty/error projections, and the verbs
400
400
  * (`begin`, `commit`, `cancel`, `submitAll`). `edit.getForm(rowId)` hands
401
401
  * out the same TanStack Form the inline editors write through, so a drawer
402
402
  * or detail panel can share a row's draft. Inert until `editMode` is set.
@@ -413,20 +413,20 @@ export type TMDataGridApi<TData extends RowData> = {
413
413
  /** Virtualizer overscan: the option, or {@link DEFAULT_OVERSCAN}. */
414
414
  overscan: number;
415
415
  /**
416
- * Puts the settings state — visibility, order, widths, pinning, grouping —
416
+ * Puts the settings state - visibility, order, widths, pinning, grouping -
417
417
  * back to what a first visit with clean storage would have shown: the
418
418
  * consumer's `initialState` plus the structural lanes. With persistence
419
419
  * configured the reset writes through to storage like any other change.
420
420
  *
421
421
  * This, not TanStack's `resetColumnX()` family, is the reset for a
422
422
  * persisted grid: those reset to `initialState`, and the grid bakes the
423
- * restored payload into `initialState` at mount — they would "reset" to
423
+ * restored payload into `initialState` at mount - they would "reset" to
424
424
  * the very layout being discarded.
425
425
  */
426
426
  resetSettings: () => void;
427
427
  /**
428
428
  * Scrolls a row into view. The grid is always virtualized, so a row far down
429
- * the list has no element to scroll to — this moves the virtualizer instead,
429
+ * the list has no element to scroll to - this moves the virtualizer instead,
430
430
  * which is the only thing that can put one there.
431
431
  *
432
432
  * ```ts
@@ -434,8 +434,8 @@ export type TMDataGridApi<TData extends RowData> = {
434
434
  * ```
435
435
  *
436
436
  * Answers whether the row could be reached. `false` means it is not in the
437
- * current view at all — filtered out, on another page, or an id that matches
438
- * no row — and nothing scrolled. A pinned row answers `true` without
437
+ * current view at all - filtered out, on another page, or an id that matches
438
+ * no row - and nothing scrolled. A pinned row answers `true` without
439
439
  * scrolling: it is already parked at an edge.
440
440
  *
441
441
  * Identity is stable, so it is safe in a dependency array.
@@ -457,7 +457,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
457
457
  */
458
458
  getRowId: NonNullable<TableOptions<TMDataGridFeatures, TData>["getRowId"]>;
459
459
  /**
460
- * Form-level validators for the whole editing row — where cross-field
460
+ * Form-level validators for the whole editing row - where cross-field
461
461
  * rules live. TanStack Form's own vocabulary, Standard Schema included:
462
462
  *
463
463
  * ```tsx
@@ -472,13 +472,13 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
472
472
  * Pathed issues land on the matching columns; pathless ones on the row.
473
473
  */
474
474
  rowValidators?: TMDataGridRowValidators;
475
- /** Rows the pencil skips — `false` keeps a row read-only in every mode. */
475
+ /** Rows the pencil skips - `false` keeps a row read-only in every mode. */
476
476
  isRowEditable?: (row: Row<TMDataGridFeatures, TData>) => boolean;
477
477
  /**
478
478
  * Called when an edit commits. The grid never mutates `data`: apply the
479
479
  * change and let the new data arrive back through `data` as always. The
480
- * engine drops the draft only when this resolves — a slow save keeps the
481
- * draft visible with a busy marker — and a rejection keeps the form open
480
+ * engine drops the draft only when this resolves - a slow save keeps the
481
+ * draft visible with a busy marker - and a rejection keeps the form open
482
482
  * with the error on the row.
483
483
  *
484
484
  * `changes` is the per-field diff (one entry in cell mode) for consumers
@@ -488,7 +488,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
488
488
  args: TMDataGridEditCommitArgs<TData>,
489
489
  ) => void | Promise<void>;
490
490
  /**
491
- * Seed values for `edit.addRow()` — the entry row's starting point. A
491
+ * Seed values for `edit.addRow()` - the entry row's starting point. A
492
492
  * function is called per added row (fresh timestamps, empty arrays).
493
493
  */
494
494
  newRowDefaults?: TData | (() => TData);
@@ -499,7 +499,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
499
499
  */
500
500
  onRowAdd?: (args: TMDataGridRowAddArgs<TData>) => void | Promise<void>;
501
501
  /**
502
- * Called by `edit.deleteRow` under the immediate modes — confirmation, if
502
+ * Called by `edit.deleteRow` under the immediate modes - confirmation, if
503
503
  * any, belongs in here. Under batch, deletions accumulate in
504
504
  * `edit.state.deletedRowIds` instead and are reported by `submitAll`.
505
505
  * Setting this also puts the trash can in the edit lane.
@@ -511,7 +511,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
511
511
  * The editing options travel together, and the type states it: without
512
512
  * `editMode` none of them has anything to act on, so passing one is a
513
513
  * compile error rather than a dead option; with it, `getRowId` becomes
514
- * required; and `onEditCommitBatch` exists only under `"batch"` — the one
514
+ * required; and `onEditCommitBatch` exists only under `"batch"` - the one
515
515
  * mode whose `submitAll` calls it.
516
516
  *
517
517
  * `editMode` itself turns cell editing on and picks how commits happen. Off
@@ -519,7 +519,7 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
519
519
  *
520
520
  * | Mode | Commit | Cancel |
521
521
  * | ---- | ------ | ------ |
522
- * | `"cell"` | Enter, Tab, blur — Sheets | Escape |
522
+ * | `"cell"` | Enter, Tab, blur - Sheets | Escape |
523
523
  * | `"cellConfirm"` | ✓ or Enter only; blur keeps the draft | ✕ or Escape |
524
524
  * | `"row"` | Save in the edit lane, or Ctrl+Enter | Cancel, or Escape |
525
525
  * | `"batch"` | `edit.submitAll()` | `edit.cancelAll()` |
@@ -545,7 +545,7 @@ export type TMDataGridEditingOptions<TData extends RowData> =
545
545
  })
546
546
  | (TMDataGridEditingCallbacks<TData> & {
547
547
  editMode: Exclude<TMDataGridEditMode, "batch">;
548
- /** Only `"batch"`'s `submitAll` ever calls it — see the other branch. */
548
+ /** Only `"batch"`'s `submitAll` ever calls it - see the other branch. */
549
549
  onEditCommitBatch?: never;
550
550
  })
551
551
  | {
@@ -566,14 +566,14 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
566
566
  TMDataGridEditingOptions<TData> & {
567
567
  /**
568
568
  * Restore and persist table state across mounts. Two keys, because the two
569
- * kinds of state have different lifetimes — see {@link TMDataGridPersistence}.
569
+ * kinds of state have different lifetimes - see {@link TMDataGridPersistence}.
570
570
  *
571
571
  * Keep the object referentially stable (module scope or `useMemo`); it is a
572
572
  * dependency of the subscription that writes back.
573
573
  */
574
574
  persist?: TMDataGridPersistence;
575
575
  /**
576
- * Overrides for the grid's strings — menu items, panels, the pager, and
576
+ * Overrides for the grid's strings - menu items, panels, the pager, and
577
577
  * every `aria-label`. Any subset, merged over the English defaults; a full
578
578
  * Swedish dictionary ships as `TMDATAGRID_LABELS_SV`.
579
579
  *
@@ -582,7 +582,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
582
582
  * useTMDataGrid({ data, columns, labels: { noResults: "Inga rader" } });
583
583
  * ```
584
584
  *
585
- * Keep the object referentially stable (module scope or `useMemo`) — the
585
+ * Keep the object referentially stable (module scope or `useMemo`) - the
586
586
  * chrome re-renders when its identity changes.
587
587
  */
588
588
  labels?: TMDataGridLabelsOverride;
@@ -601,19 +601,19 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
601
601
  * virtualization.
602
602
  *
603
603
  * The second grid-defined switch (TanStack defines no `enablePagination`
604
- * option). `manualPagination: true` implies it — a server-paged grid needs
604
+ * option). `manualPagination: true` implies it - a server-paged grid needs
605
605
  * no extra flag.
606
606
  */
607
607
  enablePagination?: boolean;
608
608
  /**
609
609
  * The row-number gutter: a generated lane, outermost left, numbering the
610
- * rows of the current view — sorted, filtered, continuing across pages,
610
+ * rows of the current view - sorted, filtered, continuing across pages,
611
611
  * with group rows unnumbered. Off by default.
612
612
  */
613
613
  enableRowNumbers?: boolean;
614
614
  /**
615
- * How the quick search (`TMDataGrid.Search`) matches. `"fuzzy"` — the
616
- * default — forgives typos and skipped characters, and while it is the
615
+ * How the quick search (`TMDataGrid.Search`) matches. `"fuzzy"` - the
616
+ * default - forgives typos and skipped characters, and while it is the
617
617
  * only thing narrowing the grid (no sort, no grouping) the rows order by
618
618
  * match quality, best first. `"contains"` is plain substring matching.
619
619
  * An explicit `globalFilterFn` overrides both.
@@ -621,7 +621,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
621
621
  quickSearchMode?: TMDataGridQuickSearchMode;
622
622
  /**
623
623
  * Highlights the matched text in cells while a contains-family column
624
- * filter or the quick search is active. Default-rendered cells only — a
624
+ * filter or the quick search is active. Default-rendered cells only - a
625
625
  * column with its own `cell` renderer opts out by existing; a fuzzy
626
626
  * typo-match with no contiguous occurrence shows no highlight. Off by
627
627
  * default.
@@ -637,8 +637,8 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
637
637
  * | `"checkboxAndHighlight"` | yes, multi-select | highlights one row |
638
638
  * | `"highlight"` | no | highlights one row, no selection at all |
639
639
  *
640
- * One option rather than two, so the combination that cannot work — a click
641
- * that both toggles a multi-selection and moves the highlight — is not
640
+ * One option rather than two, so the combination that cannot work - a click
641
+ * that both toggles a multi-selection and moves the highlight - is not
642
642
  * expressible.
643
643
  *
644
644
  * The first two write to TanStack's `rowSelection`. The highlight is separate
@@ -671,7 +671,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
671
671
  * highlight. Read once on mount, like `initialState`.
672
672
  *
673
673
  * The grid never persists the highlighted row. Pair this with
674
- * {@link onHighlightedRowChange} and keep it wherever it belongs — for a
674
+ * {@link onHighlightedRowChange} and keep it wherever it belongs - for a
675
675
  * detail panel that is usually the route, which gets you a shareable link and
676
676
  * a working back button as well as surviving a reload:
677
677
  *
@@ -707,7 +707,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
707
707
  * | PageUp / PageDown | one viewport of rows |
708
708
  * | Home / End | first / last cell of the row |
709
709
  * | Ctrl+Home / Ctrl+End | first / last cell of the grid |
710
- * | Enter or F2 | into the cell — the checkbox, link or button it holds |
710
+ * | Enter or F2 | into the cell - the checkbox, link or button it holds |
711
711
  * | Escape | back out to the cell |
712
712
  * | Space | selects the row, as it does in row-selection mode |
713
713
  *
@@ -717,7 +717,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
717
717
  * | ------- | ---- |
718
718
  * | Drag across cells | selects the rectangle they span |
719
719
  * | Shift+click, Shift+arrows | extends the rectangle from its anchor |
720
- * | Ctrl+C | copies it as tab-separated text — paste lands in Excel's cells |
720
+ * | Ctrl+C | copies it as tab-separated text - paste lands in Excel's cells |
721
721
  * | Right-click inside it | offers the CSV export, headers optional |
722
722
  *
723
723
  * Off, nothing about the body changes. On, three things do: the body's tab
@@ -727,7 +727,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
727
727
  * the cells take `data-focused` / `data-selected` for the ring and the tint.
728
728
  *
729
729
  * The state is `ui.state.focusedCell` and `ui.state.cellRange`, and moving it
730
- * is `ui.actions.setFocusedCell` / `setCellRange` — so a consumer can put the
730
+ * is `ui.actions.setFocusedCell` / `setCellRange` - so a consumer can put the
731
731
  * keyboard on a cell, or follow it:
732
732
  *
733
733
  * ```tsx
@@ -754,7 +754,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
754
754
  * it is what turns row details on.
755
755
  *
756
756
  * Which rows are open is TanStack's own `expanded` state, so opening one is
757
- * `row.toggleExpanded()` from wherever suits — a chevron in a cell, a button
757
+ * `row.toggleExpanded()` from wherever suits - a chevron in a cell, a button
758
758
  * in the context menu, a double-click:
759
759
  *
760
760
  * ```tsx
@@ -765,7 +765,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
765
765
  * });
766
766
  * ```
767
767
  *
768
- * The panel is as tall as what it renders — see {@link renderDetailsEstHeight}
768
+ * The panel is as tall as what it renders - see {@link renderDetailsEstHeight}
769
769
  * for what the virtualizer assumes before it has measured one.
770
770
  *
771
771
  * Group rows are left out: expanding one opens its children, and a panel there
@@ -784,7 +784,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
784
784
  *
785
785
  * An estimate, not a height: every mounted row is measured, so the real one
786
786
  * takes over as soon as the panel is on screen. It keeps the scrollbar honest
787
- * for panels that open off screen — restored `expanded` state, say — and being
787
+ * for panels that open off screen (restored `expanded` state, say), and being
788
788
  * roughly right is enough.
789
789
  */
790
790
  renderDetailsEstHeight?: number;
@@ -792,7 +792,7 @@ export type UseTMDataGridOptions<TData extends RowData> = Omit<
792
792
  * Rows the virtualizer keeps mounted above and below the viewport. Defaults
793
793
  * to 6.
794
794
  *
795
- * Raise it to trade memory for a scroll that stays painted — fast wheel or
795
+ * Raise it to trade memory for a scroll that stays painted - fast wheel or
796
796
  * touch flings can outrun the virtualizer and flash blank rows, and a larger
797
797
  * buffer covers the gap. Lower it when rows are expensive to render.
798
798
  */
@@ -808,7 +808,7 @@ type TMDataGridColumnDef<TData extends RowData> = ColumnDef<
808
808
  /**
809
809
  * Point every column at the operator-dispatching filter function, and take
810
810
  * grouping's aggregation defaults back off, unless the column opted into its
811
- * own. Anything the consumer set wins — it is spread over these.
811
+ * own. Anything the consumer set wins - it is spread over these.
812
812
  *
813
813
  * The aggregation pair needs explaining. TanStack's grouping feature hands
814
814
  * every column `aggregationFn: "auto"` and an `aggregatedCell` that stringifies
@@ -816,7 +816,7 @@ type TMDataGridColumnDef<TData extends RowData> = ColumnDef<
816
816
  * numeric column silently sum itself and every date column show a range the
817
817
  * moment anything is grouped. That is a summary table, and "group by" is not a
818
818
  * request for one. Cleared here, so a grouped grid is a tree until a column
819
- * says otherwise — `aggregationFn: "sum"` on the column that wants it.
819
+ * says otherwise - `aggregationFn: "sum"` on the column that wants it.
820
820
  */
821
821
  function withTMDataGridDefaults<TData extends RowData>(
822
822
  columns: ReadonlyArray<TMDataGridColumnDef<TData>>,
@@ -842,7 +842,7 @@ function withTMDataGridDefaults<TData extends RowData>(
842
842
  *
843
843
  * Every `TableOptions` field passes straight through, so a server-driven grid
844
844
  * only needs `manualPagination` / `manualFiltering` / `manualSorting`,
845
- * `rowCount` and the matching `onXChange` callbacks — the chrome reads
845
+ * `rowCount` and the matching `onXChange` callbacks - the chrome reads
846
846
  * `getRowCount()` / `getPageCount()` / `getPaginatedRowModel()`, all of which
847
847
  * already respect manual mode. `manualPagination` also switches the pagination
848
848
  * flag on, so `<TMDataGrid.Footer />` renders its pager without further
@@ -875,7 +875,7 @@ export function useTMDataGrid<TData extends RowData>({
875
875
  ...options
876
876
  }: UseTMDataGridOptions<TData>): TMDataGridApi<TData> {
877
877
  // Derived up here, rather than just before the return, because the rest of the
878
- // hook needs `selectColumn` — one place decides what each mode means.
878
+ // hook needs `selectColumn` - one place decides what each mode means.
879
879
  //
880
880
  // Deliberately not memoized on `table`: the flags must re-derive whenever the
881
881
  // caller passes different options, and `table` keeps the same identity when
@@ -901,7 +901,7 @@ export function useTMDataGrid<TData extends RowData>({
901
901
  // The lane that opens the panels. Nothing to switch on: a grid with no
902
902
  // `renderDetails` has nothing for it to open.
903
903
  const detailsColumnEnabled = renderDetails !== undefined;
904
- // Row mode's Save sits at the end of the row — the lane is its chrome. It
904
+ // Row mode's Save sits at the end of the row - the lane is its chrome. It
905
905
  // also appears wherever the trash can has somewhere to report to.
906
906
  const editColumnEnabled =
907
907
  editMode !== undefined &&
@@ -910,7 +910,7 @@ export function useTMDataGrid<TData extends RowData>({
910
910
  (editMode === "batch" && onEditCommitBatch !== undefined));
911
911
 
912
912
  // The generated lanes bake `meta.label` into their definitions, so the memo
913
- // depends on the strings rather than on the labels object — a fresh
913
+ // depends on the strings rather than on the labels object - a fresh
914
914
  // inline `labels` must not rebuild the table's columns.
915
915
  const selectColumnLabel = labels.selectColumnLabel;
916
916
  const groupColumnLabel = labels.groupColumnLabel;
@@ -927,7 +927,7 @@ export function useTMDataGrid<TData extends RowData>({
927
927
  // tree column hides itself while nothing is grouped. Adding it to the array
928
928
  // only once a column is grouped would make the column list depend on table
929
929
  // state, which is the one thing that cannot be a `useMemo` dependency here
930
- // — the table is built from these columns.
930
+ // - the table is built from these columns.
931
931
  //
932
932
  // The order is the order they are pinned in, and it follows what each one
933
933
  // is about: tick a row, find it in the tree the user grouped it into, then
@@ -946,7 +946,7 @@ export function useTMDataGrid<TData extends RowData>({
946
946
  ? [createDetailsColumn<TData>(detailsColumnLabel)]
947
947
  : []),
948
948
  ...base,
949
- // Last and pinned right — the row's Save belongs at the end of the row.
949
+ // Last and pinned right - the row's Save belongs at the end of the row.
950
950
  ...(editColumnEnabled ? [createEditColumn<TData>(editColumnLabel)] : []),
951
951
  ];
952
952
  }, [
@@ -965,8 +965,8 @@ export function useTMDataGrid<TData extends RowData>({
965
965
 
966
966
  // Read once on mount: `initialState` is only consumed on the first render,
967
967
  // and re-reading later would fight the user's live edits.
968
- // Realigned against the ids this render is about to construct — lanes
969
- // included — so a column removed between deploys does not leave a ghost
968
+ // Realigned against the ids this render is about to construct - lanes
969
+ // included - so a column removed between deploys does not leave a ghost
970
970
  // sort, filter or width behind.
971
971
  const [persistedState] = useState(() =>
972
972
  readPersistedState(persist, collectLeafColumnIds(columns)),
@@ -983,7 +983,7 @@ export function useTMDataGrid<TData extends RowData>({
983
983
  enableColumnResizing: true,
984
984
  // The quick search's matcher. Fuzzy by default (Q4); `"contains"` keeps
985
985
  // plain substring matching, and an explicit `globalFilterFn` in the
986
- // options below overrides both — which also switches the rank ordering
986
+ // options below overrides both - which also switches the rank ordering
987
987
  // off, since it keys off this exact name.
988
988
  globalFilterFn:
989
989
  options.quickSearchMode === "contains"
@@ -991,11 +991,11 @@ export function useTMDataGrid<TData extends RowData>({
991
991
  : "tmDataGridFuzzy",
992
992
  // Grouping by a column takes it out of the grid, the way AG Grid does it:
993
993
  // its values have moved into the tree column, so leaving it in place would
994
- // show every row the same value it was grouped under. Overridable — pass
994
+ // show every row the same value it was grouped under. Overridable - pass
995
995
  // `"reorder"` to keep the column and have it moved to the front instead.
996
996
  groupedColumnMode: "remove",
997
997
  ...options,
998
- // Row details ride on `expanded`, the same state the tree uses — but a data
998
+ // Row details ride on `expanded`, the same state the tree uses - but a data
999
999
  // row answers `getCanExpand()` false, since TanStack's fallback is
1000
1000
  // `subRows.length > 0`. `() => true` is the right answer for a group row
1001
1001
  // too, so nothing here has to tell the two apart, and a consumer passing
@@ -1005,7 +1005,7 @@ export function useTMDataGrid<TData extends RowData>({
1005
1005
  : {}),
1006
1006
  // Always a predicate, never the passthrough: TanStack defaults the option
1007
1007
  // to `true` once the feature is registered, and the grid's default is off.
1008
- // Group rows never pin — TanStack builds one on its first child's record,
1008
+ // Group rows never pin - TanStack builds one on its first child's record,
1009
1009
  // so a pinned group would drag an arbitrary data row's identity to the
1010
1010
  // edge. The consumer's own predicate still decides the data rows.
1011
1011
  enableRowPinning: (row: Row<TMDataGridFeatures, TData>) =>
@@ -1022,7 +1022,7 @@ export function useTMDataGrid<TData extends RowData>({
1022
1022
  ...options.initialState?.columnVisibility,
1023
1023
  ...persistedState.columnVisibility,
1024
1024
  // Last word, because the tree column's visibility is not a user setting
1025
- // — it tracks the grouping state. See the effect below.
1025
+ // - it tracks the grouping state. See the effect below.
1026
1026
  ...(groupColumnEnabled
1027
1027
  ? { [GROUP_COLUMN_ID]: initialGrouping.length > 0 }
1028
1028
  : {}),
@@ -1067,8 +1067,8 @@ export function useTMDataGrid<TData extends RowData>({
1067
1067
  },
1068
1068
  });
1069
1069
 
1070
- // The edit engine. Built once per mount; everything it needs later — the
1071
- // table, the mode, the consumer's callbacks — is read through a ref updated
1070
+ // The edit engine. Built once per mount; everything it needs later - the
1071
+ // table, the mode, the consumer's callbacks - is read through a ref updated
1072
1072
  // every render, so forms created at `begin()` always call the latest
1073
1073
  // `onEditCommit` (the onHighlightedRowChangeRef pattern, applied wholesale).
1074
1074
  const editContextRef = useRef<TMDataGridEditEngineContext>(null as never);
@@ -1105,7 +1105,7 @@ export function useTMDataGrid<TData extends RowData>({
1105
1105
  useEffect(() => {
1106
1106
  if (editMode !== undefined && options.getRowId === undefined) {
1107
1107
  console.error(
1108
- "TMDataGrid: editMode requires getRowId — drafts are keyed by row id, and the index fallback names a different record after any sort or filter.",
1108
+ "TMDataGrid: editMode requires getRowId - drafts are keyed by row id, and the index fallback names a different record after any sort or filter.",
1109
1109
  );
1110
1110
  }
1111
1111
  // The check is a mount-time contract, not something to re-run per render.
@@ -1117,7 +1117,7 @@ export function useTMDataGrid<TData extends RowData>({
1117
1117
  // One: the tree column appears with the first grouped column and goes away
1118
1118
  // with the last, so an ungrouped grid looks exactly as it did before grouping
1119
1119
  // existed. Driven from a subscription rather than by rebuilding the column
1120
- // array, because the array is what the table is built from — deriving it from
1120
+ // array, because the array is what the table is built from - deriving it from
1121
1121
  // table state would close the loop. Visibility is the one column property
1122
1122
  // that can be changed after the fact without touching the definitions.
1123
1123
  //
@@ -1138,8 +1138,8 @@ export function useTMDataGrid<TData extends RowData>({
1138
1138
  // appears to work only because the visibility write above happens to touch a
1139
1139
  // dependency they share.
1140
1140
  //
1141
- // Re-publishing `columnVisibility` and `columnOrder` — same contents, new
1142
- // identity — invalidates all three families. `columnOrder` is the only
1141
+ // Re-publishing `columnVisibility` and `columnOrder` - same contents, new
1142
+ // identity - invalidates all three families. `columnOrder` is the only
1143
1143
  // dependency the header groups declare, and `columnVisibility` the only one
1144
1144
  // the cells do, so both are needed. Remove this once the deps are fixed
1145
1145
  // upstream; the test that fails without it groups two columns and asserts the
@@ -1263,7 +1263,7 @@ export function useTMDataGrid<TData extends RowData>({
1263
1263
  );
1264
1264
 
1265
1265
  // `onHighlightedRowChange` is fired from a subscription rather than from the store
1266
- // action, so it covers every route to a new active row — a row click, and a
1266
+ // action, so it covers every route to a new active row - a row click, and a
1267
1267
  // consumer calling `setHighlightedRow` itself. Held in a ref because the store is
1268
1268
  // built once and its actions would otherwise close over the first render's
1269
1269
  // callback.
@@ -1304,7 +1304,7 @@ export function useTMDataGrid<TData extends RowData>({
1304
1304
  }, [ui]);
1305
1305
 
1306
1306
  // The same recipe the mount uses for `initialState`, minus the persisted
1307
- // layer — see the api's JSDoc for why TanStack's own resets cannot do this.
1307
+ // layer - see the api's JSDoc for why TanStack's own resets cannot do this.
1308
1308
  // Ref-and-stable-wrapper, like the edit engine's context: the recipe reads
1309
1309
  // this render's flags, the callback identity never changes.
1310
1310
  const resetSettingsRef = useRef<() => void>(() => {});
@@ -1369,7 +1369,7 @@ export function useTMDataGrid<TData extends RowData>({
1369
1369
 
1370
1370
  /**
1371
1371
  * Opens the filter panel for a column, seeding an empty filter row when the
1372
- * column has none yet — mirrors "Filter" in the column header menu.
1372
+ * column has none yet - mirrors "Filter" in the column header menu.
1373
1373
  */
1374
1374
  export function openColumnFilter<TData extends RowData>(
1375
1375
  api: TMDataGridApi<TData>,