@jielga/tmdatagrid 1.1.0 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +184 -75
- package/dist/index.js +1821 -1743
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/appearance/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/columns/SKILL.md +42 -17
- package/skills/data/SKILL.md +1 -1
- package/skills/editing/SKILL.md +56 -56
- package/skills/editing/references/editing-api.md +8 -5
- package/skills/editing/references/editors-and-validation.md +55 -7
- package/skills/filtering/SKILL.md +13 -14
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +10 -5
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +2 -2
- package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +49 -16
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +42 -11
- package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +5 -3
- package/src/tmdatagrid/components/TMDataGridTable.tsx +107 -37
- package/src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx +1 -3
- package/src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +13 -11
- package/src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx +13 -9
- package/src/tmdatagrid/components/editors/editorShared.ts +47 -0
- package/src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/DgDateRangeFilter.tsx +2 -2
- package/src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx +2 -2
- package/src/tmdatagrid/components/filters/DgTriStateFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx +1 -1
- package/src/tmdatagrid/core/columnUtils.ts +44 -3
- package/src/tmdatagrid/core/editEngine.ts +112 -37
- package/src/tmdatagrid/core/editorFocus.ts +29 -0
- package/src/tmdatagrid/core/filterControls.ts +28 -1
- package/src/tmdatagrid/index.ts +6 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +37 -48
package/dist/index.d.ts
CHANGED
|
@@ -285,7 +285,7 @@ type TMDataGridValidator = StandardSchemaV1<unknown, unknown> | ((args: {
|
|
|
285
285
|
fieldApi: never;
|
|
286
286
|
}) => unknown);
|
|
287
287
|
/**
|
|
288
|
-
* `meta.validate` - per-column field validators. A bare schema or function is
|
|
288
|
+
* `meta.edit.validate` - per-column field validators. A bare schema or function is
|
|
289
289
|
* shorthand for `{ onChange: it }`; the object form takes every trigger
|
|
290
290
|
* TanStack Form defines, `Async` variants and debounce included.
|
|
291
291
|
*/
|
|
@@ -352,12 +352,19 @@ type TMDataGridEditRowProjection = {
|
|
|
352
352
|
* reads a form's store directly - it is mounted for one cell at a time.
|
|
353
353
|
*/
|
|
354
354
|
type TMDataGridEditState = {
|
|
355
|
-
/**
|
|
355
|
+
/**
|
|
356
|
+
* The cell the last open gesture named - where the caret goes. In row mode
|
|
357
|
+
* the whole row is editing whatever this says, so there it is only the
|
|
358
|
+
* caret's cell, and `null` for the lane's pencil, which names no column.
|
|
359
|
+
*/
|
|
356
360
|
active: {
|
|
357
361
|
rowId: string;
|
|
358
362
|
columnId: string | null;
|
|
359
363
|
} | null;
|
|
360
|
-
/**
|
|
364
|
+
/**
|
|
365
|
+
* Rows with a live form. In cell mode at most one; in row, cellConfirm and
|
|
366
|
+
* batch, as many as the user opened - which rows are editing.
|
|
367
|
+
*/
|
|
361
368
|
openRowIds: ReadonlyArray<string>;
|
|
362
369
|
rows: Record<string, TMDataGridEditRowProjection>;
|
|
363
370
|
/** Phase 4 - rows being created, not yet in `data`. */
|
|
@@ -377,7 +384,7 @@ type ErasedColumn = Column<TMDataGridFeatures, TMDataGridRowData, unknown>;
|
|
|
377
384
|
* inside any TanStack Form. The table side is where the editor is standing.
|
|
378
385
|
*
|
|
379
386
|
* The built-ins are implemented against this same contract, so
|
|
380
|
-
* `meta.editor` is not a special case - it is the slot the defaults
|
|
387
|
+
* `meta.edit.editor` is not a special case - it is the slot the defaults
|
|
381
388
|
* fill, and the exported built-ins can be wrapped instead of replaced.
|
|
382
389
|
*/
|
|
383
390
|
type TMDataGridEditorArgs = {
|
|
@@ -394,11 +401,6 @@ type TMDataGridEditorArgs = {
|
|
|
394
401
|
/** What Escape would do - drop the draft. */
|
|
395
402
|
cancel: () => void;
|
|
396
403
|
size: TMDataGridSize;
|
|
397
|
-
/**
|
|
398
|
-
* Whether this editor should take the focus on mount. True for a single
|
|
399
|
-
* opened cell; in row mode only the row's first editable cell gets it.
|
|
400
|
-
*/
|
|
401
|
-
autoFocus: boolean;
|
|
402
404
|
/**
|
|
403
405
|
* Set when typing opened the editor (the Sheets gesture) - the built-ins
|
|
404
406
|
* replace the value with it and keep typing. A custom editor may ignore it.
|
|
@@ -406,11 +408,79 @@ type TMDataGridEditorArgs = {
|
|
|
406
408
|
seedText?: string;
|
|
407
409
|
};
|
|
408
410
|
/**
|
|
409
|
-
* `meta.editor` - replaces the built-in editor for this column. Rendered
|
|
410
|
-
* JSX, never invoked as a bare function, so hooks are legal inside. Define
|
|
411
|
-
* at module scope: a new identity per render remounts the editor mid-edit.
|
|
411
|
+
* `meta.edit.editor` - replaces the built-in editor for this column. Rendered
|
|
412
|
+
* as JSX, never invoked as a bare function, so hooks are legal inside. Define
|
|
413
|
+
* it at module scope: a new identity per render remounts the editor mid-edit.
|
|
412
414
|
*/
|
|
413
415
|
type TMDataGridEditorComponent = ComponentType<TMDataGridEditorArgs>;
|
|
416
|
+
/** What `meta.edit.mapValue` is handed for one write. */
|
|
417
|
+
type TMDataGridEditValueMapArgs = {
|
|
418
|
+
/** The value the editor just wrote. */
|
|
419
|
+
value: unknown;
|
|
420
|
+
/** What the field held before this write - for length-aware masks. */
|
|
421
|
+
previous: unknown;
|
|
422
|
+
row: ErasedRow;
|
|
423
|
+
column: ErasedColumn;
|
|
424
|
+
table: TMDataGridTable<TMDataGridRowData>;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* `meta.edit.mapValue` - the value on its way into the draft, mapped.
|
|
428
|
+
*
|
|
429
|
+
* Runs on every write an editor makes, which for a text input is every
|
|
430
|
+
* keystroke and for a select is every pick, so the mapped value is what the
|
|
431
|
+
* user sees, what validators judge and what commits.
|
|
432
|
+
*/
|
|
433
|
+
type TMDataGridEditValueMap = (args: TMDataGridEditValueMapArgs) => unknown;
|
|
434
|
+
/**
|
|
435
|
+
* `meta.edit` - everything about how this column is edited, in one place,
|
|
436
|
+
* mirroring the `edit.*` engine the grid exposes at runtime.
|
|
437
|
+
*
|
|
438
|
+
* ```tsx
|
|
439
|
+
* meta: {
|
|
440
|
+
* type: "string",
|
|
441
|
+
* edit: {
|
|
442
|
+
* enabled: (row) => row.original.status !== "Locked",
|
|
443
|
+
* validate: z.string().min(2, "Too short"),
|
|
444
|
+
* mapValue: ({ value }) =>
|
|
445
|
+
* typeof value === "string" ? value.toUpperCase() : value,
|
|
446
|
+
* },
|
|
447
|
+
* }
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* `meta.type` and `meta.options` stay outside this namespace on purpose: one
|
|
451
|
+
* declaration of each feeds the cell editor and the filter panel alike.
|
|
452
|
+
*/
|
|
453
|
+
type TMDataGridColumnEditOptions = {
|
|
454
|
+
/**
|
|
455
|
+
* Whether this column's cells take edits, once `editMode` is on. `false`
|
|
456
|
+
* switches the column off outright; a predicate decides per row. Defaults
|
|
457
|
+
* to editable for any column that maps to a field - see {@link field}.
|
|
458
|
+
*/
|
|
459
|
+
enabled?: boolean | ((row: Row<TMDataGridFeatures, TMDataGridRowData>) => boolean);
|
|
460
|
+
/**
|
|
461
|
+
* The data path this column edits, when it is not the `accessorKey` - the
|
|
462
|
+
* only way a column built on `accessorFn` becomes editable. Dot paths reach
|
|
463
|
+
* into nested records: `"address.city"`.
|
|
464
|
+
*/
|
|
465
|
+
field?: string;
|
|
466
|
+
/**
|
|
467
|
+
* Replaces the built-in editor for this column. See
|
|
468
|
+
* {@link TMDataGridEditorComponent}.
|
|
469
|
+
*/
|
|
470
|
+
editor?: TMDataGridEditorComponent;
|
|
471
|
+
/**
|
|
472
|
+
* Field-level validators, in TanStack Form's own vocabulary. A bare Zod
|
|
473
|
+
* schema (or any Standard Schema, or a plain function) means
|
|
474
|
+
* `{ onChange: it }`; the object form takes every trigger Form defines.
|
|
475
|
+
*/
|
|
476
|
+
validate?: TMDataGridFieldValidate;
|
|
477
|
+
/**
|
|
478
|
+
* Maps every value an editor writes before it reaches the draft - uppercase
|
|
479
|
+
* a code, strip spaces from an IBAN, clamp a number into range. See
|
|
480
|
+
* {@link TMDataGridEditValueMap}.
|
|
481
|
+
*/
|
|
482
|
+
mapValue?: TMDataGridEditValueMap;
|
|
483
|
+
};
|
|
414
484
|
/** A new row being committed - `onRowAdd`, and `submitAll`'s `added`. */
|
|
415
485
|
type TMDataGridRowAddArgs<TData extends RowData> = {
|
|
416
486
|
/** The engine's placeholder id; the real id is the consumer's to mint. */
|
|
@@ -437,14 +507,16 @@ type TMDataGridEditCommitBatchArgs<TData extends RowData> = {
|
|
|
437
507
|
* `accessorKey` is the true path and Form addresses fields by dot-path, so
|
|
438
508
|
* nested rows work for free: `accessorKey: "address.city"` edits
|
|
439
509
|
* `values.address.city`. A column built on `accessorFn` has no path and is
|
|
440
|
-
* not editable unless `meta.
|
|
510
|
+
* not editable unless `meta.edit.field` names one. TanStack's default column
|
|
441
511
|
* id turns dots into underscores - which is why this starts from
|
|
442
512
|
* `accessorKey`, never from `id`.
|
|
443
513
|
*/
|
|
444
514
|
declare function getEditFieldName(column: {
|
|
445
515
|
columnDef: {
|
|
446
516
|
meta?: {
|
|
447
|
-
|
|
517
|
+
edit?: {
|
|
518
|
+
field?: string;
|
|
519
|
+
};
|
|
448
520
|
};
|
|
449
521
|
};
|
|
450
522
|
}): string | null;
|
|
@@ -471,7 +543,11 @@ type TMDataGridEditApi = {
|
|
|
471
543
|
canEditCell: (row: ErasedRow, column: ErasedColumn) => boolean;
|
|
472
544
|
/** Whether the row takes edits at all - the edit lane's pencil gate. */
|
|
473
545
|
canEditRow: (row: ErasedRow) => boolean;
|
|
474
|
-
/**
|
|
546
|
+
/**
|
|
547
|
+
* Opens an editor. In row mode the whole row opens either way and `columnId`
|
|
548
|
+
* only says which cell takes the caret; `null` (the lane's pencil) leaves it
|
|
549
|
+
* to the row's first editable cell.
|
|
550
|
+
*/
|
|
475
551
|
begin: (target: {
|
|
476
552
|
rowId: string;
|
|
477
553
|
columnId: string | null;
|
|
@@ -513,7 +589,7 @@ type TMDataGridEditApi = {
|
|
|
513
589
|
canDeleteRows: () => boolean;
|
|
514
590
|
};
|
|
515
591
|
/**
|
|
516
|
-
* `meta.validate` normalised to the object TanStack Form's `validators`
|
|
592
|
+
* `meta.edit.validate` normalised to the object TanStack Form's `validators`
|
|
517
593
|
* option takes - a bare schema or function is shorthand for `{ onChange }`.
|
|
518
594
|
*/
|
|
519
595
|
declare function normalizeFieldValidate(validate: TMDataGridFieldValidate | undefined): Record<string, unknown> | undefined;
|
|
@@ -687,11 +763,37 @@ type TMDataGridFilterControlArgs = {
|
|
|
687
763
|
labels: TMDataGridLabels;
|
|
688
764
|
};
|
|
689
765
|
/**
|
|
690
|
-
* `meta.
|
|
766
|
+
* `meta.filter.control` - replaces the built-in value control for this column.
|
|
691
767
|
* Rendered as JSX, never invoked as a bare function, so hooks are legal
|
|
692
768
|
* inside. Define it at module scope so its identity is stable across renders.
|
|
693
769
|
*/
|
|
694
770
|
type TMDataGridFilterControlComponent = ComponentType<TMDataGridFilterControlArgs>;
|
|
771
|
+
/**
|
|
772
|
+
* `meta.filter` - everything about how this column filters, in one place.
|
|
773
|
+
*
|
|
774
|
+
* ```tsx
|
|
775
|
+
* meta: {
|
|
776
|
+
* type: "number",
|
|
777
|
+
* filter: { defaultOperator: "between", control: DgRangeSliderFilter },
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*
|
|
781
|
+
* `meta.type` and `meta.options` stay outside this namespace on purpose: one
|
|
782
|
+
* declaration of each feeds the filter panel and the cell editor alike.
|
|
783
|
+
*/
|
|
784
|
+
type TMDataGridColumnFilterOptions = {
|
|
785
|
+
/**
|
|
786
|
+
* The operator a fresh filter on this column starts with, instead of the
|
|
787
|
+
* type's default - a salary column can open on `"between"`. Must be one of
|
|
788
|
+
* the type's own operators.
|
|
789
|
+
*/
|
|
790
|
+
defaultOperator?: TMDataGridFilterOperator;
|
|
791
|
+
/**
|
|
792
|
+
* Replaces the built-in value control in this column's filter-panel row.
|
|
793
|
+
* See {@link TMDataGridFilterControlComponent}.
|
|
794
|
+
*/
|
|
795
|
+
control?: TMDataGridFilterControlComponent;
|
|
796
|
+
};
|
|
695
797
|
//#endregion
|
|
696
798
|
//#region .types-tmp/core/quickSearch.d.ts
|
|
697
799
|
/** How the quick search matches - see `quickSearchMode` on the hook options. */
|
|
@@ -1054,7 +1156,16 @@ declare function boundsEdges(bounds: TMDataGridRangeBounds | null, rowIndex: num
|
|
|
1054
1156
|
} | null;
|
|
1055
1157
|
//#endregion
|
|
1056
1158
|
//#region .types-tmp/useTMDataGrid.d.ts
|
|
1057
|
-
/**
|
|
1159
|
+
/**
|
|
1160
|
+
* Per-column configuration the TMDataGrid chrome reads.
|
|
1161
|
+
*
|
|
1162
|
+
* A stage that owns behaviour gets a namespace - `filter` and `edit`, each
|
|
1163
|
+
* mirroring the feature's runtime API. What the column *is* stays flat:
|
|
1164
|
+
* `label`, `type`, `options`, `align`, `flex`, `autoSize`, `enableOrdering`.
|
|
1165
|
+
* `type` and `options` in particular are shared ground - one declaration of
|
|
1166
|
+
* each feeds the filter panel and the cell editor alike, which is why they sit
|
|
1167
|
+
* outside both namespaces.
|
|
1168
|
+
*/
|
|
1058
1169
|
type TMDataGridColumnMeta = {
|
|
1059
1170
|
/** Name shown in menus and the column manager. Falls back to a string header. */
|
|
1060
1171
|
label?: string;
|
|
@@ -1087,50 +1198,34 @@ type TMDataGridColumnMeta = {
|
|
|
1087
1198
|
*/
|
|
1088
1199
|
enableOrdering?: boolean;
|
|
1089
1200
|
/**
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1092
|
-
* the type's own operators.
|
|
1093
|
-
*/
|
|
1094
|
-
defaultFilterOperator?: TMDataGridFilterOperator;
|
|
1095
|
-
/**
|
|
1096
|
-
* Replaces the built-in value control in this column's filter-panel row. A
|
|
1097
|
-
* component rendered as JSX (hooks are legal inside), receiving the
|
|
1098
|
-
* value-only contract: it reads the current operator, writes the bare
|
|
1099
|
-
* value, and the grid composes the stored filter around it. Define it at
|
|
1100
|
-
* module scope. See {@link TMDataGridFilterControlArgs}.
|
|
1101
|
-
*/
|
|
1102
|
-
filterControl?: TMDataGridFilterControlComponent;
|
|
1103
|
-
/**
|
|
1104
|
-
* Whether this column's cells take edits, once `editMode` is on. `false`
|
|
1105
|
-
* switches the column off outright; a predicate decides per row. Defaults
|
|
1106
|
-
* to editable for any column that maps to a field - see {@link editField}.
|
|
1107
|
-
*/
|
|
1108
|
-
editable?: boolean | ((row: Row<TMDataGridFeatures, TMDataGridRowData>) => boolean);
|
|
1109
|
-
/**
|
|
1110
|
-
* The data path this column edits, when it is not the `accessorKey` - the
|
|
1111
|
-
* only way a column built on `accessorFn` becomes editable. Dot paths reach
|
|
1112
|
-
* into nested records: `"address.city"`.
|
|
1113
|
-
*/
|
|
1114
|
-
editField?: string;
|
|
1115
|
-
/**
|
|
1116
|
-
* Field-level validators, in TanStack Form's own vocabulary. A bare Zod
|
|
1117
|
-
* schema (or any Standard Schema, or a plain function) means
|
|
1118
|
-
* `{ onChange: it }`; the object form takes every trigger Form defines.
|
|
1201
|
+
* How this column filters: the operator a fresh filter starts with, and the
|
|
1202
|
+
* value control the filter panel renders for it.
|
|
1119
1203
|
*
|
|
1120
1204
|
* ```tsx
|
|
1121
|
-
* meta: {
|
|
1122
|
-
*
|
|
1205
|
+
* meta: {
|
|
1206
|
+
* type: "number",
|
|
1207
|
+
* filter: { defaultOperator: "between", control: DgRangeSliderFilter },
|
|
1208
|
+
* }
|
|
1123
1209
|
* ```
|
|
1210
|
+
*
|
|
1211
|
+
* See {@link TMDataGridColumnFilterOptions}.
|
|
1124
1212
|
*/
|
|
1125
|
-
|
|
1213
|
+
filter?: TMDataGridColumnFilterOptions;
|
|
1126
1214
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1215
|
+
* How this column is edited: whether it takes edits, which field they write
|
|
1216
|
+
* to, which editor opens, what validates the field and what maps the value
|
|
1217
|
+
* on its way in.
|
|
1218
|
+
*
|
|
1219
|
+
* ```tsx
|
|
1220
|
+
* meta: {
|
|
1221
|
+
* type: "string",
|
|
1222
|
+
* edit: { validate: z.string().min(2, "Too short") },
|
|
1223
|
+
* }
|
|
1224
|
+
* ```
|
|
1225
|
+
*
|
|
1226
|
+
* See {@link TMDataGridColumnEditOptions}.
|
|
1132
1227
|
*/
|
|
1133
|
-
|
|
1228
|
+
edit?: TMDataGridColumnEditOptions;
|
|
1134
1229
|
};
|
|
1135
1230
|
/** Grid-wide configuration passed through `options.meta`. */
|
|
1136
1231
|
type TMDataGridTableMeta = {
|
|
@@ -1543,9 +1638,9 @@ type TMDataGridEditingCallbacks<TData extends RowData> = {
|
|
|
1543
1638
|
*
|
|
1544
1639
|
* One TanStack Form per editing row; drafts survive scrolling because the
|
|
1545
1640
|
* forms live outside the DOM, keyed by row id. Which columns edit, and with
|
|
1546
|
-
* what, is declared per column
|
|
1547
|
-
* `
|
|
1548
|
-
*
|
|
1641
|
+
* what, is declared per column under `meta.edit`: `meta.type` picks the
|
|
1642
|
+
* built-in editor, and `enabled`, `field`, `editor`, `validate` and `mapValue`
|
|
1643
|
+
* override the rest.
|
|
1549
1644
|
*/
|
|
1550
1645
|
type TMDataGridEditingOptions<TData extends RowData> = (TMDataGridEditingCallbacks<TData> & {
|
|
1551
1646
|
editMode: "batch";
|
|
@@ -2534,7 +2629,7 @@ declare function formatGroupValue(value: unknown, blankLabel?: string): string;
|
|
|
2534
2629
|
//#region .types-tmp/components/filters/TMDataGridFilterValueInput.d.ts
|
|
2535
2630
|
/**
|
|
2536
2631
|
* The built-in value control of a filter-panel row - what renders when a
|
|
2537
|
-
* column declares no `meta.
|
|
2632
|
+
* column declares no `meta.filter.control`. Shaped by the operator: a
|
|
2538
2633
|
* multi-select for the set operators, a From/To pair for `between`, a Yes/No
|
|
2539
2634
|
* dropdown for booleans, a typed input otherwise.
|
|
2540
2635
|
*
|
|
@@ -2545,9 +2640,9 @@ declare function TMDataGridFilterValueInput({ column, operator, value, onChange,
|
|
|
2545
2640
|
//#endregion
|
|
2546
2641
|
//#region .types-tmp/components/filters/DgRangeSliderFilter.d.ts
|
|
2547
2642
|
/**
|
|
2548
|
-
* A built-in `meta.
|
|
2643
|
+
* A built-in `meta.filter.control` for `number` columns: a range slider whose
|
|
2549
2644
|
* bounds are seeded from the values present in the data, writing the
|
|
2550
|
-
* `between` pair. Pair it with `meta.
|
|
2645
|
+
* `between` pair. Pair it with `meta.filter.defaultOperator: "between"` so
|
|
2551
2646
|
* the filter opens on it; any non-range operator falls back to the standard
|
|
2552
2647
|
* input.
|
|
2553
2648
|
*/
|
|
@@ -2555,17 +2650,17 @@ declare function DgRangeSliderFilter(args: TMDataGridFilterControlArgs): import(
|
|
|
2555
2650
|
//#endregion
|
|
2556
2651
|
//#region .types-tmp/components/filters/DgDateRangeFilter.d.ts
|
|
2557
2652
|
/**
|
|
2558
|
-
* A built-in `meta.
|
|
2653
|
+
* A built-in `meta.filter.control` for `date` columns: a From/To pair of
|
|
2559
2654
|
* native date inputs writing the `between` pair - no `@mantine/dates`
|
|
2560
2655
|
* involved, like the built-in date editor. Pair it with
|
|
2561
|
-
* `meta.
|
|
2656
|
+
* `meta.filter.defaultOperator: "between"`; any non-range operator falls back
|
|
2562
2657
|
* to the standard input.
|
|
2563
2658
|
*/
|
|
2564
2659
|
declare function DgDateRangeFilter(args: TMDataGridFilterControlArgs): import("react").JSX.Element;
|
|
2565
2660
|
//#endregion
|
|
2566
2661
|
//#region .types-tmp/components/filters/DgAutocompleteFilter.d.ts
|
|
2567
2662
|
/**
|
|
2568
|
-
* A built-in `meta.
|
|
2663
|
+
* A built-in `meta.filter.control` for text-shaped columns: a free-text input
|
|
2569
2664
|
* that also offers the values present in the data (or the column's declared
|
|
2570
2665
|
* `meta.options`) as suggestions. Set or range operators fall back to the
|
|
2571
2666
|
* standard input.
|
|
@@ -2574,7 +2669,7 @@ declare function DgAutocompleteFilter(args: TMDataGridFilterControlArgs): import
|
|
|
2574
2669
|
//#endregion
|
|
2575
2670
|
//#region .types-tmp/components/filters/DgTriStateFilter.d.ts
|
|
2576
2671
|
/**
|
|
2577
|
-
* A built-in `meta.
|
|
2672
|
+
* A built-in `meta.filter.control` for `boolean` columns: an All / Yes / No
|
|
2578
2673
|
* segmented control - All clears the value, which deactivates the filter.
|
|
2579
2674
|
* Set or range operators fall back to the standard input.
|
|
2580
2675
|
*/
|
|
@@ -2582,23 +2677,23 @@ declare function DgTriStateFilter(args: TMDataGridFilterControlArgs): import("re
|
|
|
2582
2677
|
//#endregion
|
|
2583
2678
|
//#region .types-tmp/components/editors/TMDataGridStringEditor.d.ts
|
|
2584
2679
|
/** The built-in editor for `meta.type: "string"` (and the default). */
|
|
2585
|
-
declare function TMDataGridStringEditor({ field,
|
|
2680
|
+
declare function TMDataGridStringEditor({ field, column, size }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2586
2681
|
//#endregion
|
|
2587
2682
|
//#region .types-tmp/components/editors/TMDataGridNumberEditor.d.ts
|
|
2588
2683
|
/** The built-in editor for `meta.type: "number"`. */
|
|
2589
|
-
declare function TMDataGridNumberEditor({ field,
|
|
2684
|
+
declare function TMDataGridNumberEditor({ field, column, size }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2590
2685
|
//#endregion
|
|
2591
2686
|
//#region .types-tmp/components/editors/TMDataGridBooleanEditor.d.ts
|
|
2592
2687
|
/** The built-in editor for `meta.type: "boolean"` - a focused checkbox. */
|
|
2593
|
-
declare function TMDataGridBooleanEditor({ field,
|
|
2688
|
+
declare function TMDataGridBooleanEditor({ field, column, size }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2594
2689
|
//#endregion
|
|
2595
2690
|
//#region .types-tmp/components/editors/TMDataGridDateEditor.d.ts
|
|
2596
2691
|
/**
|
|
2597
2692
|
* The built-in editor for `meta.type: "date"` - the native
|
|
2598
2693
|
* `<input type="date">` styled by Mantine, no `@mantine/dates` involved. A
|
|
2599
|
-
* consumer wanting a real picker plugs one in through `meta.editor`.
|
|
2694
|
+
* consumer wanting a real picker plugs one in through `meta.edit.editor`.
|
|
2600
2695
|
*/
|
|
2601
|
-
declare function TMDataGridDateEditor({ field,
|
|
2696
|
+
declare function TMDataGridDateEditor({ field, column, size }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2602
2697
|
//#endregion
|
|
2603
2698
|
//#region .types-tmp/components/editors/TMDataGridSelectEditor.d.ts
|
|
2604
2699
|
/**
|
|
@@ -2606,7 +2701,7 @@ declare function TMDataGridDateEditor({ field, autoFocus, column, size }: TMData
|
|
|
2606
2701
|
* `meta.options` the filter panel reads - with the row in hand, so a
|
|
2607
2702
|
* function source can depend on the record being edited.
|
|
2608
2703
|
*/
|
|
2609
|
-
declare function TMDataGridSelectEditor({ field,
|
|
2704
|
+
declare function TMDataGridSelectEditor({ field, column, row, table, size, commit }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2610
2705
|
//#endregion
|
|
2611
2706
|
//#region .types-tmp/components/editors/TMDataGridMultiSelectEditor.d.ts
|
|
2612
2707
|
/**
|
|
@@ -2614,7 +2709,7 @@ declare function TMDataGridSelectEditor({ field, autoFocus, column, row, table,
|
|
|
2614
2709
|
* arrays. Never commits on pick: building a set takes several, so the commit
|
|
2615
2710
|
* stays on Enter/blur like a text edit.
|
|
2616
2711
|
*/
|
|
2617
|
-
declare function TMDataGridMultiSelectEditor({ field,
|
|
2712
|
+
declare function TMDataGridMultiSelectEditor({ field, column, row, table, size }: TMDataGridEditorArgs): import("react").JSX.Element;
|
|
2618
2713
|
//#endregion
|
|
2619
2714
|
//#region .types-tmp/core/labelsSv.d.ts
|
|
2620
2715
|
/**
|
|
@@ -2649,9 +2744,23 @@ declare function getColumnLabel(column: ColumnLike): string;
|
|
|
2649
2744
|
declare function getColumnType(column: ColumnLike): TMDataGridColumnType;
|
|
2650
2745
|
/**
|
|
2651
2746
|
* The operator a fresh filter on this column starts with -
|
|
2652
|
-
* `meta.
|
|
2747
|
+
* `meta.filter.defaultOperator`, else the type's default.
|
|
2653
2748
|
*/
|
|
2654
2749
|
declare function getColumnDefaultOperator(column: ColumnLike): TMDataGridFilterOperator;
|
|
2750
|
+
/**
|
|
2751
|
+
* This column's filter-panel value control - `meta.filter.control`, or
|
|
2752
|
+
* `undefined` for the built-in shape-by-operator input.
|
|
2753
|
+
*/
|
|
2754
|
+
declare function getColumnFilterControl(column: ColumnLike): TMDataGridFilterControlComponent | undefined;
|
|
2755
|
+
/**
|
|
2756
|
+
* Whether `meta.edit.enabled` lets this column's cell on this row be edited -
|
|
2757
|
+
* the switch, then the predicate.
|
|
2758
|
+
*
|
|
2759
|
+
* This is only the column's half of the rule. A cell also needs the column to
|
|
2760
|
+
* map to a field (`getEditFieldName`) and the row to take edits at all
|
|
2761
|
+
* (`isRowEditable`); `edit.canEditCell` is the whole question.
|
|
2762
|
+
*/
|
|
2763
|
+
declare function isColumnEditableForRow(column: ColumnLike, row: Row<TMDataGridFeatures, TMDataGridRowData>): boolean;
|
|
2655
2764
|
/**
|
|
2656
2765
|
* A generated lane holding one fixed-width thing - the checkbox, the details
|
|
2657
2766
|
* chevron, the row number.
|
|
@@ -2935,4 +3044,4 @@ declare function getSelectableRowIds<TData extends RowData>(row: Row<TMDataGridF
|
|
|
2935
3044
|
*/
|
|
2936
3045
|
declare function resolveRowSelectionClick<TData extends RowData>({ rows, rowId, anchorRowId, modifiers, selection, canReplaceSelection }: ResolveRowSelectionClickArgs<TData>): ResolvedRowSelection;
|
|
2937
3046
|
//#endregion
|
|
2938
|
-
export { type BuildCellMatrixArgs, type ColumnStepArgs, DATA_STATE_SLICES, DEFAULT_CELL_EXPORT_OPTIONS, DEFAULT_TMDATAGRID_SIZE, DETAILS_COLUMN_ID, DgAutocompleteFilter, DgDateRangeFilter, DgRangeSliderFilter, DgTriStateFilter, EDIT_COLUMN_ID, FILTER_OPERATOR_LABELS, GROUP_COLUMN_ID, type MoveColumnArgs, PERSIST_PAYLOAD_VERSION, ROW_NUMBER_COLUMN_ID, type ResolveCellMoveArgs, type ResolveRangeBoundsArgs, type ResolveRowSelectionClickArgs, type ResolvedRowSelection, SELECT_COLUMN_ID, SETTINGS_STATE_SLICES, SIZE_CONTROL_SIZE, SIZE_ROW_HEIGHT, TMDATAGRID_LABELS_EN, TMDATAGRID_LABELS_SV, TMDataGrid, type TMDataGridAggregationName, type TMDataGridApi, TMDataGridBooleanEditor, type TMDataGridCapabilities, type TMDataGridCellCoords, type TMDataGridCellEventArgs, type TMDataGridCellExportOptions, type TMDataGridCellMatrix, type TMDataGridCellNav, type TMDataGridCellPosition, type TMDataGridCellRange, type TMDataGridCellSelectionMode, type TMDataGridColumnCapabilities, type TMDataGridColumnLayout, type TMDataGridColumnMenuItemsArgs, type TMDataGridColumnMenuItemsRenderer, type TMDataGridColumnMeta, type TMDataGridColumnRegion, type TMDataGridColumnType, type TMDataGridContextValue, type TMDataGridDataSlice, TMDataGridDateEditor, type TMDataGridDetailsArgs, type TMDataGridDetailsRenderer, type TMDataGridDropSide, TMDataGridEditActions, type TMDataGridEditActionsActions, type TMDataGridEditActionsControls, type TMDataGridEditActionsProps, type TMDataGridEditActionsSlotArgs, type TMDataGridEditActionsState, type TMDataGridEditApi, type TMDataGridEditChange, type TMDataGridEditCommitArgs, type TMDataGridEditCommitBatchArgs, type TMDataGridEditField, type TMDataGridEditMode, type TMDataGridEditRowProjection, type TMDataGridEditState, type TMDataGridEditingOptions, type TMDataGridEditorArgs, type TMDataGridEditorComponent, type TMDataGridExpandAllArgs, type TMDataGridExpandTarget, type TMDataGridFeatureFlags, type TMDataGridFeatures, type TMDataGridFieldValidate, type TMDataGridFilterControlArgs, type TMDataGridFilterControlComponent, type TMDataGridFilterOperator, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFooterProps, type TMDataGridLabels, type TMDataGridLabelsOverride, TMDataGridMultiSelectEditor, TMDataGridNumberEditor, type TMDataGridOption, type TMDataGridOptionsArgs, type TMDataGridOptionsSource, type TMDataGridPaginationActions, type TMDataGridPaginationApi, type TMDataGridPaginationControls, type TMDataGridPaginationSlotArgs, type TMDataGridPaginationState, type TMDataGridPersistKey, type TMDataGridPersistence, type TMDataGridProps, type TMDataGridQuickSearchMode, type TMDataGridRangeBounds, type TMDataGridRowAddArgs, type TMDataGridRowClickModifiers, type TMDataGridRowContextMenuArgs, type TMDataGridRowContextMenuRenderer, type TMDataGridRowData, type TMDataGridRowDeleteArgs, type TMDataGridRowEditForm, type TMDataGridRowStyle, type TMDataGridRowValidators, type TMDataGridScrollAlign, type TMDataGridScrollToRowArgs, TMDataGridSearch, type TMDataGridSearchProps, TMDataGridSelectEditor, type TMDataGridSelectionMode, type TMDataGridSettingsSlice, type TMDataGridSize, type TMDataGridStorageMode, TMDataGridStringEditor, type TMDataGridTable, type TMDataGridTableMeta, type TMDataGridTableProps, type TMDataGridUiActions, type TMDataGridUiState, type TMDataGridUiStore, type UseTMDataGridOptions, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildGridCellMatrix, clearedValueForType, createTMDataGridColumnHelper, downloadTextFile, emptyValueForOperator, exportGridToCsv, formatExportValue, formatFilterLabel, formatGroupValue, fuzzyGlobalFilterFn, getColumnCapabilities, getColumnDefaultOperator, getColumnLabel, getColumnRegion, getColumnType, getDefaultOperator, getDisplayedRows, getEditFieldName, getGridCapabilities, getGroupDataRows, getOperatorsForType, getSelectableRowIds, getStepTargetColumn, getTMDataGridPaginationApi, isColumnReorderable, isControlColumn, isFilterActive, isPagingActive, isSameCell, isWithinBounds, measureColumnContentWidth, mergeLabels, moveColumn, moveColumnByStep, normalizeFieldValidate, openColumnFilter, operatorNeedsValue, operatorTakesArrayValue, operatorTakesRangeValue, optionsToComboboxData, readFeatureFlags, resolveCellMove, resolveColumnOptions, resolveExpandAll, resolveRangeBounds, resolveRowSelectionClick, tmDataGridFeatures, toClipboardText, toExcelCsv, useCellControlTabIndex, useTMDataGrid, useTMDataGridContext, writeClipboardText };
|
|
3047
|
+
export { type BuildCellMatrixArgs, type ColumnStepArgs, DATA_STATE_SLICES, DEFAULT_CELL_EXPORT_OPTIONS, DEFAULT_TMDATAGRID_SIZE, DETAILS_COLUMN_ID, DgAutocompleteFilter, DgDateRangeFilter, DgRangeSliderFilter, DgTriStateFilter, EDIT_COLUMN_ID, FILTER_OPERATOR_LABELS, GROUP_COLUMN_ID, type MoveColumnArgs, PERSIST_PAYLOAD_VERSION, ROW_NUMBER_COLUMN_ID, type ResolveCellMoveArgs, type ResolveRangeBoundsArgs, type ResolveRowSelectionClickArgs, type ResolvedRowSelection, SELECT_COLUMN_ID, SETTINGS_STATE_SLICES, SIZE_CONTROL_SIZE, SIZE_ROW_HEIGHT, TMDATAGRID_LABELS_EN, TMDATAGRID_LABELS_SV, TMDataGrid, type TMDataGridAggregationName, type TMDataGridApi, TMDataGridBooleanEditor, type TMDataGridCapabilities, type TMDataGridCellCoords, type TMDataGridCellEventArgs, type TMDataGridCellExportOptions, type TMDataGridCellMatrix, type TMDataGridCellNav, type TMDataGridCellPosition, type TMDataGridCellRange, type TMDataGridCellSelectionMode, type TMDataGridColumnCapabilities, type TMDataGridColumnEditOptions, type TMDataGridColumnFilterOptions, type TMDataGridColumnLayout, type TMDataGridColumnMenuItemsArgs, type TMDataGridColumnMenuItemsRenderer, type TMDataGridColumnMeta, type TMDataGridColumnRegion, type TMDataGridColumnType, type TMDataGridContextValue, type TMDataGridDataSlice, TMDataGridDateEditor, type TMDataGridDetailsArgs, type TMDataGridDetailsRenderer, type TMDataGridDropSide, TMDataGridEditActions, type TMDataGridEditActionsActions, type TMDataGridEditActionsControls, type TMDataGridEditActionsProps, type TMDataGridEditActionsSlotArgs, type TMDataGridEditActionsState, type TMDataGridEditApi, type TMDataGridEditChange, type TMDataGridEditCommitArgs, type TMDataGridEditCommitBatchArgs, type TMDataGridEditField, type TMDataGridEditMode, type TMDataGridEditRowProjection, type TMDataGridEditState, type TMDataGridEditValueMap, type TMDataGridEditValueMapArgs, type TMDataGridEditingOptions, type TMDataGridEditorArgs, type TMDataGridEditorComponent, type TMDataGridExpandAllArgs, type TMDataGridExpandTarget, type TMDataGridFeatureFlags, type TMDataGridFeatures, type TMDataGridFieldValidate, type TMDataGridFilterControlArgs, type TMDataGridFilterControlComponent, type TMDataGridFilterOperator, TMDataGridFilterPills, type TMDataGridFilterPillsProps, type TMDataGridFilterValue, TMDataGridFilterValueInput, type TMDataGridFooterProps, type TMDataGridLabels, type TMDataGridLabelsOverride, TMDataGridMultiSelectEditor, TMDataGridNumberEditor, type TMDataGridOption, type TMDataGridOptionsArgs, type TMDataGridOptionsSource, type TMDataGridPaginationActions, type TMDataGridPaginationApi, type TMDataGridPaginationControls, type TMDataGridPaginationSlotArgs, type TMDataGridPaginationState, type TMDataGridPersistKey, type TMDataGridPersistence, type TMDataGridProps, type TMDataGridQuickSearchMode, type TMDataGridRangeBounds, type TMDataGridRowAddArgs, type TMDataGridRowClickModifiers, type TMDataGridRowContextMenuArgs, type TMDataGridRowContextMenuRenderer, type TMDataGridRowData, type TMDataGridRowDeleteArgs, type TMDataGridRowEditForm, type TMDataGridRowStyle, type TMDataGridRowValidators, type TMDataGridScrollAlign, type TMDataGridScrollToRowArgs, TMDataGridSearch, type TMDataGridSearchProps, TMDataGridSelectEditor, type TMDataGridSelectionMode, type TMDataGridSettingsSlice, type TMDataGridSize, type TMDataGridStorageMode, TMDataGridStringEditor, type TMDataGridTable, type TMDataGridTableMeta, type TMDataGridTableProps, type TMDataGridUiActions, type TMDataGridUiState, type TMDataGridUiStore, type UseTMDataGridOptions, aggregateColumn, areAllRowsExpanded, autosizeColumn, boundsCellCount, boundsEdges, buildCellMatrix, buildGridCellMatrix, clearedValueForType, createTMDataGridColumnHelper, downloadTextFile, emptyValueForOperator, exportGridToCsv, formatExportValue, formatFilterLabel, formatGroupValue, fuzzyGlobalFilterFn, getColumnCapabilities, getColumnDefaultOperator, getColumnFilterControl, getColumnLabel, getColumnRegion, getColumnType, getDefaultOperator, getDisplayedRows, getEditFieldName, getGridCapabilities, getGroupDataRows, getOperatorsForType, getSelectableRowIds, getStepTargetColumn, getTMDataGridPaginationApi, isColumnEditableForRow, isColumnReorderable, isControlColumn, isFilterActive, isPagingActive, isSameCell, isWithinBounds, measureColumnContentWidth, mergeLabels, moveColumn, moveColumnByStep, normalizeFieldValidate, openColumnFilter, operatorNeedsValue, operatorTakesArrayValue, operatorTakesRangeValue, optionsToComboboxData, readFeatureFlags, resolveCellMove, resolveColumnOptions, resolveExpandAll, resolveRangeBounds, resolveRowSelectionClick, tmDataGridFeatures, toClipboardText, toExcelCsv, useCellControlTabIndex, useTMDataGrid, useTMDataGridContext, writeClipboardText };
|