@umriss-ui/table 0.47.1 → 0.49.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/CHANGELOG.md +27 -0
- package/README.md +91 -7
- package/dist/index.d.ts +65 -10
- package/dist/table.css +1 -1
- package/dist/table.js +2403 -2185
- package/docs/llms-full.md +468 -68
- package/package.json +4 -4
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/table 0.
|
|
1
|
+
# @umriss-ui/table 0.49.0
|
|
2
2
|
|
|
3
3
|
> React data table for data-dense applications - sorting, filtering, grouping, aggregates, virtualisation. Declared the way it reads: columns as JSX, typed against their rows.
|
|
4
4
|
|
|
@@ -901,6 +901,8 @@ The command brings the core package along, a peer dependency: the table reads it
|
|
|
901
901
|
|
|
902
902
|
There is no stylesheet to import. The table loads its own, and the core package loads the tokens it reads; both lie in cascade layers, so the application's CSS wins. `@umriss-ui/table/styles.css` stays exported for setups that link stylesheets by hand.
|
|
903
903
|
|
|
904
|
+
Under a finger the toolbar, pagination and row actions are 26 px; `@umriss-ui/core/touch-scale.css` makes them 44 px, in any import order - see core's Installation.
|
|
905
|
+
|
|
904
906
|
A table is read by default: a native table, where every control is one Tab away and a screen reader keeps its table keys. Grid mode makes it one Tab stop whose cells the arrow keys walk, and it is the mode for editing. Switch it on only where people work in the cells ([ADR-0034](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0034-the-table-becomes-a-grid-only-on-request.md)).
|
|
905
907
|
|
|
906
908
|
#### Examples
|
|
@@ -1247,8 +1249,8 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
|
|
|
1247
1249
|
|
|
1248
1250
|
| Prop | Type | Default | Description |
|
|
1249
1251
|
|---|---|---|---|
|
|
1250
|
-
| `selectable` | `boolean` | — | Adds the selection column. "All" means: the filtered set.<br>Shown in: [Name the row (Column)](#column), [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Keep the header and the names in view (Width and pinning)](#width-and-pinning) and
|
|
1251
|
-
| `stickyHeader` | `boolean` | — | Keeps the header row visible while scrolling.<br>Shown in: [Keep the header and the names in view (Width and pinning)](#width-and-pinning), [A head below an app bar (Width and pinning)](#width-and-pinning)
|
|
1252
|
+
| `selectable` | `boolean` | — | Adds the selection column. "All" means: the filtered set.<br>Shown in: [Name the row (Column)](#column), [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Keep the header and the names in view (Width and pinning)](#width-and-pinning) and 17 more |
|
|
1253
|
+
| `stickyHeader` | `boolean` | — | Keeps the header row visible while scrolling.<br>Shown in: [A header over columns (Column)](#column), [Keep the header and the names in view (Width and pinning)](#width-and-pinning), [A head below an app bar (Width and pinning)](#width-and-pinning) and 9 more |
|
|
1252
1254
|
| `stickyRowHeader` | `boolean` | — | Keeps the row header column visible while scrolling sideways - the same as `pin="start"` on the row header.<br>Shown in: [Keep the header and the names in view (Width and pinning)](#width-and-pinning), [Stripes across a wide table (Row appearance)](#row-appearance), [Show, hide and arrange (ColumnMenu)](#columnmenu) and 1 more |
|
|
1253
1255
|
| `striped` | `boolean` | — | Discreet zebra stripes.<br>Shown in: [Stripes across a wide table (Row appearance)](#row-appearance) |
|
|
1254
1256
|
| `density` | `"regular" \| "compact"` | the density of the `UmrissProvider`, else `"regular"` | How tightly the rows stand.<br>Shown in: [Fit long group names in a compact table (Grouping)](#grouping-1), [Employees in the detail (Tree rows)](#tree-rows), [Own staff and teams (Tree rows)](#tree-rows) and 4 more |
|
|
@@ -1259,17 +1261,17 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
|
|
|
1259
1261
|
| `currentRow` | `string \| null` | — | The key of the row the rest of the screen follows - the table marks it with `aria-current` and an accent bar, apart from the selection. The table keeps no copy: pass the key you hold, `null` for none.<br>Shown in: [The current row (Selection)](#selection), [Another view chooses a row (Virtualisation)](#virtualisation) |
|
|
1260
1262
|
| `onCurrentRowChange` | `(key: string, row: Z) => void` | — | A primary click on a row, outside its controls - the checkbox, the expander, the actions and any button of yours in a cell - with the row's key and the row. Also called for the row already current, so that you decide whether a second click clears it. By the keyboard: in a native table the content of the row-header cell becomes a button (Enter and Space), so a control of your own in that cell would stand inside it; in grid mode Enter on a cell with nothing to edit or enter. Without a `rowHeader` column the keyboard cannot choose a row.<br>Shown in: [The current row (Selection)](#selection), [Another view chooses a row (Virtualisation)](#virtualisation) |
|
|
1261
1263
|
| `groupable` | `boolean` | — | `false`: the user cannot group this table - the column menu offers no grouping, and a grouping handed in is passed over.<br>Shown in: [Switch grouping off (Grouping)](#grouping-1) |
|
|
1262
|
-
| `grid` | `boolean` | — | Grid mode: the table is one tab stop, and the arrows walk its cells - Home and End in the row, Ctrl+Home and Ctrl+End to the table's ends, PageUp and PageDown by the rows in view. A cell's own controls are reached with Enter or F2 and left with Escape; a column with `edit` is edited in place. Without it the table stays a native table.<br>Shown in: [Bring a row into view from outside (Virtualisation)](#virtualisation), [Work cell by cell (Grid mode)](#grid-mode), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode) and
|
|
1264
|
+
| `grid` | `boolean` | — | Grid mode: the table is one tab stop, and the arrows walk its cells - Home and End in the row, Ctrl+Home and Ctrl+End to the table's ends, PageUp and PageDown by the rows in view. A cell's own controls are reached with Enter or F2 and left with Escape; a column with `edit` is edited in place. Without it the table stays a native table.<br>Shown in: [Bring a row into view from outside (Virtualisation)](#virtualisation), [Work cell by cell (Grid mode)](#grid-mode), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode) and 8 more |
|
|
1263
1265
|
| `editMode` | `"cell" \| "row"` | — | Grid mode ([ADR-0036](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0036-a-grid-edits-on-the-first-click-and-saves-rows-on-purpose.md)): `"cell"` reports every cell as it is left (`onCellEdit`); `"row"` opens every cell of a row that edits at once, as one **Row draft**, and reports it only when the row is saved on purpose (`onRowSave`) - by its Save button or Enter; Escape or Discard drops it. A row with a draft is left only by saving or discarding it.<br>Shown in: [Save a row on purpose (Edits)](#edits), [Check a whole row before it is saved (Edits)](#edits), [Keep a list: add, change and delete rows (Edits)](#edits) and 1 more |
|
|
1264
1266
|
| `newRow` | `() => Partial<Z>` | — | What a new row starts with - the values the columns read before anything is typed. Without it, nothing.<br>Shown in: [Keep a list: add, change and delete rows (Edits)](#edits) |
|
|
1265
|
-
| `children` | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts.<br>Shown in: [Show a list of services](#first-table), [Search and page from a header of your own](#first-table), [Sort, arrange and export from controls of your own](#first-table) and
|
|
1267
|
+
| `children` | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts.<br>Shown in: [Show a list of services](#first-table), [Search and page from a header of your own](#first-table), [Sort, arrange and export from controls of your own](#first-table) and 137 more |
|
|
1266
1268
|
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [Find a late shipment (Scenarios)](#find-a-late-shipment), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
1267
1269
|
|
|
1268
1270
|
###### Events
|
|
1269
1271
|
|
|
1270
1272
|
| Prop | Type | Default | Description |
|
|
1271
1273
|
|---|---|---|---|
|
|
1272
|
-
| `onCellEdit` | `(edit: ``CellEdit``<Z>) => void` | — | Grid mode: an edit the user committed. The table applies nothing; the cell shows the new value when the rows passed in carry it.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and
|
|
1274
|
+
| `onCellEdit` | `(edit: ``CellEdit``<Z>) => void` | — | Grid mode: an edit the user committed. The table applies nothing; the cell shows the new value when the rows passed in carry it.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and 2 more |
|
|
1273
1275
|
| `onRowSave` | `(save: ``RowSave``<Z>) => void` | — | `editMode="row"`: a saved Row draft, with the columns it changed.<br>Shown in: [Save a row on purpose (Edits)](#edits), [Check a whole row before it is saved (Edits)](#edits), [Keep a list: add, change and delete rows (Edits)](#edits) and 1 more |
|
|
1274
1276
|
| `onRowAdd` | `(add: ``RowAdd``) => void` | — | Grid mode: puts up a "New row" button - in the table toolbar, or beneath the table without one. It opens an empty Row draft above the rows; saved, it is reported whole. The row appears when the rows passed in carry it.<br>Shown in: [Keep a list: add, change and delete rows (Edits)](#edits) |
|
|
1275
1277
|
| `onRowDelete` | `(remove: ``RowDelete``<Z>) => void` | — | Grid mode: a Delete button on every row, which asks inside its row before the delete is reported. The table removes nothing.<br>Shown in: [Keep a list: add, change and delete rows (Edits)](#edits), [Edit a dense table (Edits)](#edits) |
|
|
@@ -1280,15 +1282,16 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1280
1282
|
|
|
1281
1283
|
| Prop | Type | Default | Description |
|
|
1282
1284
|
|---|---|---|---|
|
|
1283
|
-
| `rowKey` *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion.<br>Shown in: [Show a list of services](#first-table), [Search and page from a header of your own](#first-table), [Sort, arrange and export from controls of your own](#first-table) and
|
|
1285
|
+
| `rowKey` *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion.<br>Shown in: [Show a list of services](#first-table), [Search and page from a header of your own](#first-table), [Sort, arrange and export from controls of your own](#first-table) and 137 more |
|
|
1284
1286
|
| `pageSize` | `number` | `10` | How many rows a page holds.<br>Shown in: [Search and page from a header of your own](#first-table), [Ask a question over several fields (Filter)](#filter), [Restrict which rows a table has (Pre-filter)](#pre-filter) and 7 more |
|
|
1285
1287
|
| `defaultSort` | `SortLevel`` \| readonly ``SortLevel``[] \| null` | `null` | The application's sort; it is the default that `view` leaves out.<br>Shown in: [Sort, arrange and export from controls of your own](#first-table), [A label wider than its column (Width and pinning)](#width-and-pinning), [Sort by several columns (Sorting)](#sorting) and 10 more |
|
|
1286
1288
|
| `defaultGrouping` | `GroupingId``<Z> \| readonly ``GroupingId``<Z>[]` | ungrouped, until the user groups | The application's grouping: a column or group key, or up to three, the outermost first. It is the default that `view` leaves out.<br>Shown in: [Group by one column (Grouping)](#grouping-1), [Group on two levels (Grouping)](#grouping-1), [Group on three levels (Grouping)](#grouping-1) and 23 more |
|
|
1287
1289
|
| `preFilter` | `(row: Z) => boolean` | — | Which rows the table has at all – by permission, by tenant, by anything the user is not meant to undo. It is invisible: never a condition, never reset, never part of the view, and "43 of 1,204" counts only the rows it admits. It may stand in the call; a change leaves the page standing, and the model clamps it.<br>Shown in: [Restrict which rows a table has (Pre-filter)](#pre-filter) |
|
|
1288
1290
|
| `rowFilters` | `readonly `[`RowFilter`](#filter)`<Z, any>[]` | — | The row filters the table has: conditions the application defines over the whole row and sets with `t.setFilter(filter, condition)` from a control of its own. Named here so that a condition from `initialView`, which arrives by id, is known in the first render.<br>Shown in: [Filter by a field no column shows (Filter)](#filter), [Rows from a request (Filter)](#filter), [Ask a question over several fields (Filter)](#filter) and 3 more |
|
|
1289
|
-
| `initialView` | `TableView` | — | The view to start from, read once when the hook first runs; a different value on a later render is ignored, as React ignores a changed `defaultValue`. To go to a view later, call `setView`. The table remembers none: where a view is kept is the application's decision. Names no column carries fall out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [
|
|
1291
|
+
| `initialView` | `TableView` | — | The view to start from, read once when the hook first runs; a different value on a later render is ignored, as React ignores a changed `defaultValue`. To go to a view later, call `setView`. The table remembers none: where a view is kept is the application's decision. Names no column carries fall out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [Filter a text with operators (Filter)](#filter), [Fold groups into a summary (Grouping)](#grouping-1) and 4 more |
|
|
1290
1292
|
| `virtual` | `boolean \| { overscan?: number }` | — | Renders only what stands in the scroll area; paging is then off. Every row is one row pitch tall, which the table measures itself ([ADR-0042](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0042-a-rows-height-never-follows-what-it-shows.md)).<br>Shown in: [Group twenty thousand rows (Grouping)](#grouping-1), [Scroll twenty thousand rows (Virtualisation)](#virtualisation), [Inside a pane of fixed height (Virtualisation)](#virtualisation) and 4 more |
|
|
1291
1293
|
| `selection` | `TableSelection``<string>` | — | A selection from outside instead of its own – when the application holds it.<br>Shown in: [Hold the selection yourself (Selection)](#selection) |
|
|
1294
|
+
| `onSelectionChange` | `(keys: string[]) => void` | — | Called with the selected keys after each change – the user's or the API's, its own selection or the one handed in – from an effect, never at mount. Under "all that match" (server mode) the keys are the ones ticked before it; `selection.allMatching` and `selection.except` tell the rest.<br>Shown in: [Hear the selection (Selection)](#selection) |
|
|
1292
1295
|
|
|
1293
1296
|
###### Events
|
|
1294
1297
|
|
|
@@ -1320,6 +1323,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1320
1323
|
| `setPin` *required* | `(column: string, pin: ``Pin`` \| null) => void` | — | Pins a column to the start or the end, or unpins it with `null`.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
1321
1324
|
| `widths` *required* | `Readonly<Record<string, number>>` | — | The widths in pixels: those of the columns, and over them the dragged ones.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
1322
1325
|
| `setWidth` *required* | `(column: string, width: number \| undefined) => void` | — | Sets the width of a column; `undefined` takes it back.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
1326
|
+
| `autoSizeColumns` *required* | `() => void` | — | Sets every column to the width of its content - the measurement of the grip's double click, for all columns at once.<br>Shown in: [Columns that share the width (Width and pinning)](#width-and-pinning) |
|
|
1323
1327
|
| `expanded` *required* | `readonly string[]` | — | The keys of the expanded rows.<br>Shown in: [Open a detail from outside the table (RowDetail)](#rowdetail) |
|
|
1324
1328
|
| `toggleRow` *required* | `(key: string) => void` | — | Expands a row or collapses it.<br>Shown in: [Open a detail from outside the table (RowDetail)](#rowdetail) |
|
|
1325
1329
|
| `filter` *required* | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters and row filters by id, in the order in which they were set. Whatever fits no column and no row filter is absent.<br>Shown in: [Set a condition from outside the table (Filter)](#filter) |
|
|
@@ -1363,10 +1367,10 @@ An edit the user committed - reported, not applied.
|
|
|
1363
1367
|
|
|
1364
1368
|
| Prop | Type | Default | Description |
|
|
1365
1369
|
|---|---|---|---|
|
|
1366
|
-
| `rowKey` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and
|
|
1367
|
-
| `columnId` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits), [
|
|
1368
|
-
| `value` *required* | `unknown` | — | The editor's value: text for `"text"`, a number or null for `"number"`, a day or null for `"date"`, an option for `"select"`.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and
|
|
1369
|
-
| `row` *required* | `Z` | — | <br>Shown in: [Check an edit before it is reported (Edits)](#edits), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
1370
|
+
| `rowKey` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and 2 more |
|
|
1371
|
+
| `columnId` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits), [Undo and redo over the reported edits (Edits)](#edits) and 1 more |
|
|
1372
|
+
| `value` *required* | `unknown` | — | The editor's value: text for `"text"`, a number or null for `"number"`, a day or null for `"date"`, an option for `"select"`.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and 2 more |
|
|
1373
|
+
| `row` *required* | `Z` | — | <br>Shown in: [Check an edit before it is reported (Edits)](#edits), [Undo and redo over the reported edits (Edits)](#edits), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
1370
1374
|
|
|
1371
1375
|
###### `RowSave<Z>`
|
|
1372
1376
|
|
|
@@ -1425,7 +1429,7 @@ the application.
|
|
|
1425
1429
|
| Prop | Type | Default | Description |
|
|
1426
1430
|
|---|---|---|---|
|
|
1427
1431
|
| `search` | `string` | — | <br>Shown in: [Show loading, empty, failed and no match (Row appearance)](#row-appearance), [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode) and 6 more |
|
|
1428
|
-
| `conditions` | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters, per column. A condition for a column that does not exist, or whose filter is of another kind, falls out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [
|
|
1432
|
+
| `conditions` | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters, per column. A condition for a column that does not exist, or whose filter is of another kind, falls out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [Filter a text with operators (Filter)](#filter), [A dispatcher's bar (Toolbar controls)](#toolbar-controls) and 9 more |
|
|
1429
1433
|
| `sort` | `readonly ``SortLevel``<K>[]` | — | <br>Shown in: [Keep and restore a view (View)](#view), [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode) and 6 more |
|
|
1430
1434
|
| `page` | `number` | — | <br>Shown in: [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode), [Name the values a list filter offers (Server mode)](#server-mode) and 5 more |
|
|
1431
1435
|
| `pageSize` | `number` | — | <br>Shown in: [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode), [Name the values a list filter offers (Server mode)](#server-mode) and 5 more |
|
|
@@ -1513,12 +1517,13 @@ type Field<Z> = Extract<keyof Z, string>;
|
|
|
1513
1517
|
|
|
1514
1518
|
###### `FieldCondition<W>`
|
|
1515
1519
|
|
|
1516
|
-
What can be set as a condition on a field: a list of its values,
|
|
1517
|
-
numbers and points in time a range
|
|
1520
|
+
What can be set as a condition on a field: a list of its values, for
|
|
1521
|
+
numbers and points in time a range, and for text a text condition.
|
|
1518
1522
|
|
|
1519
1523
|
```ts
|
|
1520
1524
|
type FieldCondition<W> =
|
|
1521
1525
|
| ListCondition<W>
|
|
1526
|
+
| ([Present<W>] extends [string] ? TextCondition : never)
|
|
1522
1527
|
| ([Present<W>] extends [number] ? RangeCondition<number> : [Present<W>] extends [Date] ? RangeCondition<Date> : never);
|
|
1523
1528
|
```
|
|
1524
1529
|
|
|
@@ -1538,6 +1543,17 @@ The value without the absence - that is what `children` gets.
|
|
|
1538
1543
|
type Present<W> = Exclude<W, Absent>;
|
|
1539
1544
|
```
|
|
1540
1545
|
|
|
1546
|
+
###### `TextCondition`
|
|
1547
|
+
|
|
1548
|
+
The condition of a text filter: one or two terms, joined by `join`
|
|
1549
|
+
(`"and"` unless given). Plain JSON - the view keeps it and a server request
|
|
1550
|
+
carries it as it is, under the column's id.
|
|
1551
|
+
|
|
1552
|
+
| Prop | Type | Default | Description |
|
|
1553
|
+
|---|---|---|---|
|
|
1554
|
+
| `join` | `"and" \| "or"` | — | |
|
|
1555
|
+
| `terms` *required* | `readonly `[`TextTerm``] \| readonly `[`TextTerm``, ``TextTerm``]` | — | |
|
|
1556
|
+
|
|
1541
1557
|
###### `RangeCondition<W>`
|
|
1542
1558
|
|
|
1543
1559
|
The condition of a range filter: both bounds inclusive, each may be absent.
|
|
@@ -1555,12 +1571,31 @@ A value that is not there: `null` or `undefined`.
|
|
|
1555
1571
|
type Absent = null | undefined;
|
|
1556
1572
|
```
|
|
1557
1573
|
|
|
1574
|
+
###### `TextTerm`
|
|
1575
|
+
|
|
1576
|
+
One term of a text condition. A term whose operator needs a value and has
|
|
1577
|
+
none (or "") requires nothing and is left out.
|
|
1578
|
+
|
|
1579
|
+
| Prop | Type | Default | Description |
|
|
1580
|
+
|---|---|---|---|
|
|
1581
|
+
| `operator` *required* | `TextOperator`<br>`"contains" \| "notContains" \| "startsWith" \| "endsWith" \| "equals" \| "isEmpty"` | — | |
|
|
1582
|
+
| `value` | `string` | — | |
|
|
1583
|
+
|
|
1584
|
+
###### `TextOperator`
|
|
1585
|
+
|
|
1586
|
+
How a text filter compares: without regard to case, with the formats' locale.
|
|
1587
|
+
`isEmpty` takes no value and holds for an absent text and for "".
|
|
1588
|
+
|
|
1589
|
+
```ts
|
|
1590
|
+
type TextOperator = "contains" | "notContains" | "startsWith" | "endsWith" | "equals" | "isEmpty";
|
|
1591
|
+
```
|
|
1592
|
+
|
|
1558
1593
|
#### Known limits
|
|
1559
1594
|
|
|
1560
|
-
- No cell range selection and no undo: an edit is reported, never applied, and the application owns the rows ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
1561
|
-
- No pivot: compute the pivoted rows and map one computed column per key from the data, as in [a matrix with row and column totals](#aggregate) ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
1595
|
+
- No cell range selection and no built-in undo: an edit is reported, never applied, and the application owns the rows; undo is a recipe over the reported edits ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
1596
|
+
- No pivot: compute the pivoted rows and map one computed column per key from the data, as in [a matrix with row and column totals](#aggregate) ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
1562
1597
|
|
|
1563
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
1598
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
1564
1599
|
|
|
1565
1600
|
### Provider
|
|
1566
1601
|
|
|
@@ -1852,6 +1887,53 @@ export default function RowHeader() {
|
|
|
1852
1887
|
}
|
|
1853
1888
|
```
|
|
1854
1889
|
|
|
1890
|
+
##### A header over columns
|
|
1891
|
+
|
|
1892
|
+
`ColumnGroup` wraps `Column`s and puts its `label` over them in a second head row: "Q1" over Jan, Feb and Mar. The cell spans the group's visible columns and disappears with the last of them; a column cannot leave its group by reordering, a group split by pinning shows its label over each part, and an export writes "Q1 · Jan".
|
|
1893
|
+
|
|
1894
|
+
```tsx
|
|
1895
|
+
import { ColumnGroup, ColumnMenu, Toolbar, useTable } from "@umriss-ui/table";
|
|
1896
|
+
|
|
1897
|
+
interface Sales {
|
|
1898
|
+
region: string;
|
|
1899
|
+
jan: number;
|
|
1900
|
+
feb: number;
|
|
1901
|
+
mar: number;
|
|
1902
|
+
apr: number;
|
|
1903
|
+
may: number;
|
|
1904
|
+
jun: number;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
const SALES: Sales[] = [
|
|
1908
|
+
{ region: "North", jan: 120, feb: 135, mar: 150, apr: 160, may: 155, jun: 170 },
|
|
1909
|
+
{ region: "South", jan: 90, feb: 95, mar: 110, apr: 105, may: 120, jun: 125 },
|
|
1910
|
+
{ region: "West", jan: 70, feb: 85, mar: 80, apr: 95, may: 100, jun: 98 },
|
|
1911
|
+
];
|
|
1912
|
+
|
|
1913
|
+
export default function HeaderOverColumns() {
|
|
1914
|
+
const { Table, Column } = useTable(SALES, { rowKey: (s) => s.region });
|
|
1915
|
+
|
|
1916
|
+
return (
|
|
1917
|
+
<Table aria-label="Sales by month" stickyHeader>
|
|
1918
|
+
<Toolbar>
|
|
1919
|
+
<ColumnMenu />
|
|
1920
|
+
</Toolbar>
|
|
1921
|
+
<Column value="region" label="Region" rowHeader />
|
|
1922
|
+
<ColumnGroup label="Q1">
|
|
1923
|
+
<Column value="jan" label="Jan" numeric />
|
|
1924
|
+
<Column value="feb" label="Feb" numeric />
|
|
1925
|
+
<Column value="mar" label="Mar" numeric />
|
|
1926
|
+
</ColumnGroup>
|
|
1927
|
+
<ColumnGroup label="Q2">
|
|
1928
|
+
<Column value="apr" label="Apr" numeric />
|
|
1929
|
+
<Column value="may" label="May" numeric />
|
|
1930
|
+
<Column value="jun" label="Jun" numeric />
|
|
1931
|
+
</ColumnGroup>
|
|
1932
|
+
</Table>
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
```
|
|
1936
|
+
|
|
1855
1937
|
#### When to use something else
|
|
1856
1938
|
|
|
1857
1939
|
- Restricting a column to some of its values → Filter
|
|
@@ -1872,13 +1954,13 @@ The `label` is the column header's text, and so what a screen reader says for ev
|
|
|
1872
1954
|
|
|
1873
1955
|
| Prop | Type | Default | Description |
|
|
1874
1956
|
|---|---|---|---|
|
|
1875
|
-
| `value` *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and
|
|
1957
|
+
| `value` *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and 137 more |
|
|
1876
1958
|
| `id` | `string` | — | An id of one's own instead of the field name – for two columns over the same field.<br>Shown in: [Pick a standard format (Formats)](#formats), [Share a column between tables (Presets)](#presets) |
|
|
1877
1959
|
| `format` | `FormatFor``<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"`, `"dateTime"`, `"timeWithSeconds"` or `"dateTimeWithSeconds"` for points in time. Alignment, sorting, export and footer stay with the value.<br>Shown in: [Compute a value from the row](#column), [Set wording and formats once (Provider)](#provider), [Pick a standard format (Formats)](#formats) and 38 more |
|
|
1878
|
-
| `filter` | `FilterFor``<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar.<br>Shown in: [A label wider than its column (Width and pinning)](#width-and-pinning), [Share a column between tables (Presets)](#presets), [Choose from the values that occur (Filter)](#filter) and
|
|
1960
|
+
| `filter` | `FilterFor``<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar.<br>Shown in: [A label wider than its column (Width and pinning)](#width-and-pinning), [Share a column between tables (Presets)](#presets), [Choose from the values that occur (Filter)](#filter) and 13 more |
|
|
1879
1961
|
| `group` | `GroupFor``<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Group dates by month (Grouping)](#grouping-1) |
|
|
1880
|
-
| `edit` | `EditFor``<Z[K], Z>` | — | Edits the column's cells in place in grid mode: Enter, F2 or typing starts it, Enter or Tab commits, Escape cancels. The table applies nothing - the edit is reported through the table's `onCellEdit`. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits) and
|
|
1881
|
-
| `editOptions` | `readonly ``Present``<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Check an edit before it is reported (Edits)](#edits), [Save a row on purpose (Edits)](#edits) and
|
|
1962
|
+
| `edit` | `EditFor``<Z[K], Z>` | — | Edits the column's cells in place in grid mode: Enter, F2 or typing starts it, Enter or Tab commits, Escape cancels. The table applies nothing - the edit is reported through the table's `onCellEdit`. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits) and 7 more |
|
|
1963
|
+
| `editOptions` | `readonly ``Present``<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Check an edit before it is reported (Edits)](#edits), [Save a row on purpose (Edits)](#edits) and 2 more |
|
|
1882
1964
|
| `validate` | `(value: Z[K] \| null, row: Z) => string \| null \| undefined` | — | Checks a draft before it is reported: a message keeps the editor open and stands beneath the field, as in a `FormField`; nothing lets it through. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits) and 3 more |
|
|
1883
1965
|
| `children` | `Presentation``<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form.<br>Shown in: [Draw a value with other components (Formats)](#formats), [Show absent values (Formats)](#formats), [Fit what does not fit (Formats)](#formats) and 10 more |
|
|
1884
1966
|
|
|
@@ -1888,13 +1970,15 @@ Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
|
|
|
1888
1970
|
|
|
1889
1971
|
| Prop | Type | Default | Description |
|
|
1890
1972
|
|---|---|---|---|
|
|
1891
|
-
| `label` *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and
|
|
1892
|
-
| `rowHeader` | `boolean` | — | This column names the row: row header cells, never hideable, the column `stickyRowHeader` pins, and the name by which the row's selection, expander and actions are read out. At most one per table.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and
|
|
1893
|
-
| `numeric` | `boolean` | decided by the first value present | Right-aligned with tabular figures.<br>Shown in: [Share a column between tables (Presets)](#presets) |
|
|
1894
|
-
| `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Fit long values (Formats)](#formats), [Fit what does not fit (Formats)](#formats), [A bar, a scale, an icon and a limit (Conditional formatting)](#conditional-formatting) and
|
|
1895
|
-
| `
|
|
1973
|
+
| `label` *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and 137 more |
|
|
1974
|
+
| `rowHeader` | `boolean` | — | This column names the row: row header cells, never hideable, the column `stickyRowHeader` pins, and the name by which the row's selection, expander and actions are read out. At most one per table.<br>Shown in: [Read a value from a field](#column), [Compute a value from the row](#column), [Let the value type decide](#column) and 136 more |
|
|
1975
|
+
| `numeric` | `boolean` | decided by the first value present | Right-aligned with tabular figures.<br>Shown in: [A header over columns](#column), [Share a column between tables (Presets)](#presets) |
|
|
1976
|
+
| `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Fit long values (Formats)](#formats), [Fit what does not fit (Formats)](#formats), [A bar, a scale, an icon and a limit (Conditional formatting)](#conditional-formatting) and 19 more |
|
|
1977
|
+
| `flex` | `number` | none: the column is as wide as its content | A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. A width, declared or dragged by hand, ends the flex of that column.<br>Shown in: [Columns that share the width (Width and pinning)](#width-and-pinning), [Share a column between tables (Presets)](#presets) |
|
|
1978
|
+
| `minWidth` | `number` | — | The least width of a column with `flex`, in pixels.<br>Shown in: [Columns that share the width (Width and pinning)](#width-and-pinning), [Share a column between tables (Presets)](#presets) |
|
|
1979
|
+
| `resizable` | `boolean` | — | Shows the drag grip on the header cell.<br>Shown in: [Let people set the width (Width and pinning)](#width-and-pinning), [Pin and size from controls of your own (Width and pinning)](#width-and-pinning), [Columns that share the width (Width and pinning)](#width-and-pinning) and 2 more |
|
|
1896
1980
|
| `pin` | `Pin`<br>`"start" \| "end"` | — | Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them. The user can change it in the column menu; the view carries the change. Pinned blocks take at most half of the width the table shows: on a narrower one the end block, then the start block scrolls with the rest, and sticks again when there is room.<br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode) and 1 more |
|
|
1897
|
-
| `sortable` | `boolean` | `true` when the value is text, a number, a point in time or a boolean | Whether the column can be sorted by.<br>Shown in: [Fit long values (Formats)](#formats), [Fit what does not fit (Formats)](#formats), [Let people set the width (Width and pinning)](#width-and-pinning) and
|
|
1981
|
+
| `sortable` | `boolean` | `true` when the value is text, a number, a point in time or a boolean | Whether the column can be sorted by.<br>Shown in: [Fit long values (Formats)](#formats), [Fit what does not fit (Formats)](#formats), [Let people set the width (Width and pinning)](#width-and-pinning) and 10 more |
|
|
1898
1982
|
| `searchable` | `boolean` | `true` for text, `false` otherwise | Takes part in the search.<br>Shown in: [Share a column between tables (Presets)](#presets), [Leave a column out (Search)](#search), [An uneven organisation (Tree rows)](#tree-rows) |
|
|
1899
1983
|
| `groupable` | `boolean` | `true` when its value is text, a number, a point in time or a boolean, or it has a `groupValue` | Can the table be grouped by this column?<br>Shown in: [Share a column between tables (Presets)](#presets), [Switch grouping off (Grouping)](#grouping-1) |
|
|
1900
1984
|
|
|
@@ -1924,12 +2008,13 @@ type FormatFor<W> = [Present<W>] extends [number]
|
|
|
1924
2008
|
###### `FilterFor<W>`
|
|
1925
2009
|
|
|
1926
2010
|
What a column accepts as `filter`: `"list"` for every value with a text
|
|
1927
|
-
form, `"range"` for numbers and points in time, a filter
|
|
1928
|
-
only where its value type fits.
|
|
2011
|
+
form, `"range"` for numbers and points in time, `"text"` for text, a filter
|
|
2012
|
+
from `columnFilter` only where its value type fits.
|
|
1929
2013
|
|
|
1930
2014
|
```ts
|
|
1931
2015
|
type FilterFor<W> =
|
|
1932
2016
|
| (IsDisplayable<W> extends true ? "list" : never)
|
|
2017
|
+
| ([Present<W>] extends [string] ? "text" : never)
|
|
1933
2018
|
| ([Present<W>] extends [number] ? "range" : [Present<W>] extends [Date] ? "range" : never)
|
|
1934
2019
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the condition belongs to the filter; at the column only the value counts
|
|
1935
2020
|
| ColumnFilter<Present<W>, any>;
|
|
@@ -2856,6 +2941,45 @@ export default function ALabelWiderThanItsColumn() {
|
|
|
2856
2941
|
}
|
|
2857
2942
|
```
|
|
2858
2943
|
|
|
2944
|
+
##### Columns that share the width
|
|
2945
|
+
|
|
2946
|
+
`flex` takes a share of the width the other columns leave - two columns with `flex={1}` split it equally - and `minWidth` keeps one readable. A column the reader drags keeps the dragged width. "Fit all columns" in the column menu, or `autoSizeColumns()`, sets every column to its content.
|
|
2947
|
+
|
|
2948
|
+
```tsx
|
|
2949
|
+
import { Button } from "@umriss-ui/core";
|
|
2950
|
+
import { ColumnMenu, Toolbar, useTable } from "@umriss-ui/table";
|
|
2951
|
+
|
|
2952
|
+
interface Shipment {
|
|
2953
|
+
id: string;
|
|
2954
|
+
customer: string;
|
|
2955
|
+
note: string;
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
const SHIPMENTS: Shipment[] = [
|
|
2959
|
+
{ id: "FP-1004210", customer: "Holloway Garden Supplies", note: "Goods entrance at the back, ring twice" },
|
|
2960
|
+
{ id: "FP-1004223", customer: "Oakridge Pharmacy", note: "Cold chain, hand over in person" },
|
|
2961
|
+
{ id: "FP-1004236", customer: "Brixley Cycles", note: "Leave with the neighbour at number 90 if the shop is closed" },
|
|
2962
|
+
];
|
|
2963
|
+
|
|
2964
|
+
export default function SharedWidth() {
|
|
2965
|
+
const { Table, Column, autoSizeColumns } = useTable(SHIPMENTS, { rowKey: (s) => s.id });
|
|
2966
|
+
|
|
2967
|
+
return (
|
|
2968
|
+
<Table aria-label="Shipments filling the frame">
|
|
2969
|
+
<Toolbar>
|
|
2970
|
+
<ColumnMenu />
|
|
2971
|
+
<Button size="sm" onClick={autoSizeColumns}>
|
|
2972
|
+
Fit columns now
|
|
2973
|
+
</Button>
|
|
2974
|
+
</Toolbar>
|
|
2975
|
+
<Column value="id" label="Shipment" rowHeader width={120} />
|
|
2976
|
+
<Column value="customer" label="Customer" resizable flex={1} minWidth={140} />
|
|
2977
|
+
<Column value="note" label="Note" resizable sortable={false} flex={1} minWidth={160} />
|
|
2978
|
+
</Table>
|
|
2979
|
+
);
|
|
2980
|
+
}
|
|
2981
|
+
```
|
|
2982
|
+
|
|
2859
2983
|
#### Keyboard
|
|
2860
2984
|
|
|
2861
2985
|
| Key | Action |
|
|
@@ -2890,13 +3014,14 @@ From `TableSnapshot` — the full table stands on [First table](#first-table).
|
|
|
2890
3014
|
| [`setPin`](#first-table) *required* | `(column: string, pin: `[`Pin`](#first-table)` \| null) => void` | — | Pins a column to the start or the end, or unpins it with `null`. |
|
|
2891
3015
|
| [`widths`](#first-table) *required* | `Readonly<Record<string, number>>` | — | The widths in pixels: those of the columns, and over them the dragged ones. |
|
|
2892
3016
|
| [`setWidth`](#first-table) *required* | `(column: string, width: number \| undefined) => void` | — | Sets the width of a column; `undefined` takes it back. |
|
|
3017
|
+
| [`autoSizeColumns`](#first-table) *required* | `() => void` | — | Sets every column to the width of its content - the measurement of the grip's double click, for all columns at once. |
|
|
2893
3018
|
|
|
2894
3019
|
From `FieldColumn` — the full table stands on [Column](#column).
|
|
2895
3020
|
|
|
2896
3021
|
| Prop | Type | Default | Description |
|
|
2897
3022
|
|---|---|---|---|
|
|
2898
3023
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
2899
|
-
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
3024
|
+
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
2900
3025
|
|
|
2901
3026
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
2902
3027
|
|
|
@@ -2905,6 +3030,8 @@ From `ColumnBase` — the full table stands on [Column](#column).
|
|
|
2905
3030
|
| [`label`](#column) *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export. |
|
|
2906
3031
|
| [`rowHeader`](#column) | `boolean` | — | This column names the row: row header cells, never hideable, the column `stickyRowHeader` pins, and the name by which the row's selection, expander and actions are read out. At most one per table. |
|
|
2907
3032
|
| [`width`](#column) | `number` | the browser's | Initial width in pixels. |
|
|
3033
|
+
| [`flex`](#column) | `number` | none: the column is as wide as its content | A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. A width, declared or dragged by hand, ends the flex of that column. |
|
|
3034
|
+
| [`minWidth`](#column) | `number` | — | The least width of a column with `flex`, in pixels. |
|
|
2908
3035
|
| [`resizable`](#column) | `boolean` | — | Shows the drag grip on the header cell. |
|
|
2909
3036
|
| [`pin`](#column) | [`Pin`](#column)<br>`"start" \| "end"` | — | Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them. The user can change it in the column menu; the view carries the change. Pinned blocks take at most half of the width the table shows: on a narrower one the end block, then the start block scrolls with the rest, and sticks again when there is room. |
|
|
2910
3037
|
| [`sortable`](#column) | `boolean` | `true` when the value is text, a number, a point in time or a boolean | Whether the column can be sorted by. |
|
|
@@ -3094,7 +3221,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
3094
3221
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
3095
3222
|
| [`id`](#column) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
|
|
3096
3223
|
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"`, `"dateTime"`, `"timeWithSeconds"` or `"dateTimeWithSeconds"` for points in time. Alignment, sorting, export and footer stay with the value. |
|
|
3097
|
-
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
3224
|
+
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
3098
3225
|
| [`group`](#column) | [`GroupFor`](#column)`<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`. |
|
|
3099
3226
|
| [`edit`](#column) | [`EditFor`](#column)`<Z[K], Z>` | — | Edits the column's cells in place in grid mode: Enter, F2 or typing starts it, Enter or Tab commits, Escape cancels. The table applies nothing - the edit is reported through the table's `onCellEdit`. From `EditOptions`. |
|
|
3100
3227
|
| [`editOptions`](#column) | `readonly `[`Present`](#column)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`. |
|
|
@@ -3109,6 +3236,8 @@ From `ColumnBase` — the full table stands on [Column](#column).
|
|
|
3109
3236
|
| [`rowHeader`](#column) | `boolean` | — | This column names the row: row header cells, never hideable, the column `stickyRowHeader` pins, and the name by which the row's selection, expander and actions are read out. At most one per table. |
|
|
3110
3237
|
| [`numeric`](#column) | `boolean` | decided by the first value present | Right-aligned with tabular figures. |
|
|
3111
3238
|
| [`width`](#column) | `number` | the browser's | Initial width in pixels. |
|
|
3239
|
+
| [`flex`](#column) | `number` | none: the column is as wide as its content | A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. A width, declared or dragged by hand, ends the flex of that column. |
|
|
3240
|
+
| [`minWidth`](#column) | `number` | — | The least width of a column with `flex`, in pixels. |
|
|
3112
3241
|
| [`resizable`](#column) | `boolean` | — | Shows the drag grip on the header cell. |
|
|
3113
3242
|
| [`pin`](#column) | [`Pin`](#column)<br>`"start" \| "end"` | — | Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them. The user can change it in the column menu; the view carries the change. Pinned blocks take at most half of the width the table shows: on a narrower one the end block, then the start block scrolls with the rest, and sticks again when there is room. |
|
|
3114
3243
|
| [`sortable`](#column) | `boolean` | `true` when the value is text, a number, a point in time or a boolean | Whether the column can be sorted by. |
|
|
@@ -3301,7 +3430,7 @@ From `ExportProps` — the full table stands on [Export](#export).
|
|
|
3301
3430
|
|
|
3302
3431
|
- In [server mode](#server-mode) the table sorts nothing itself; the sort goes to the server in the request.
|
|
3303
3432
|
|
|
3304
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
3433
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3305
3434
|
|
|
3306
3435
|
### Search
|
|
3307
3436
|
|
|
@@ -3525,7 +3654,7 @@ type TableRef = Omit<TableSnapshot<unknown>, "setFilter" | "conditionOf"> & {
|
|
|
3525
3654
|
|
|
3526
3655
|
- In [server mode](#server-mode) the table searches nothing itself; the term goes to the server in the request.
|
|
3527
3656
|
|
|
3528
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
3657
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3529
3658
|
|
|
3530
3659
|
### Filter
|
|
3531
3660
|
|
|
@@ -4492,6 +4621,49 @@ export default function OfferTheValuesThatOccur() {
|
|
|
4492
4621
|
}
|
|
4493
4622
|
```
|
|
4494
4623
|
|
|
4624
|
+
##### Filter a text with operators
|
|
4625
|
+
|
|
4626
|
+
`filter="text"` offers contains, does not contain, starts with, ends with, equals and is empty - up to two terms joined by AND or OR, without regard to case.
|
|
4627
|
+
|
|
4628
|
+
```tsx
|
|
4629
|
+
import { useTable } from "@umriss-ui/table";
|
|
4630
|
+
|
|
4631
|
+
interface Supplier {
|
|
4632
|
+
id: string;
|
|
4633
|
+
name: string;
|
|
4634
|
+
city: string;
|
|
4635
|
+
}
|
|
4636
|
+
|
|
4637
|
+
const SUPPLIERS: Supplier[] = [
|
|
4638
|
+
{ id: "S-01", name: "Brandlow Office Supply", city: "Leeds" },
|
|
4639
|
+
{ id: "S-02", name: "Kettering & Shaw Events", city: "Bristol" },
|
|
4640
|
+
{ id: "S-03", name: "Nimbrel Software", city: "Leeds" },
|
|
4641
|
+
{ id: "S-04", name: "Fenwright Legal", city: "York" },
|
|
4642
|
+
{ id: "S-05", name: "Corrin Travel", city: "Bath" },
|
|
4643
|
+
{ id: "S-06", name: "Stellbrook Consulting", city: "Bristol" },
|
|
4644
|
+
];
|
|
4645
|
+
|
|
4646
|
+
export default function TextFilter() {
|
|
4647
|
+
/* Set from outside, the condition is plain JSON: "name starts with B or ends with g". */
|
|
4648
|
+
const { Table, Column } = useTable(SUPPLIERS, {
|
|
4649
|
+
rowKey: (s) => s.id,
|
|
4650
|
+
initialView: {
|
|
4651
|
+
conditions: {
|
|
4652
|
+
name: { join: "or", terms: [{ operator: "startsWith", value: "b" }, { operator: "endsWith", value: "g" }] },
|
|
4653
|
+
},
|
|
4654
|
+
},
|
|
4655
|
+
});
|
|
4656
|
+
|
|
4657
|
+
return (
|
|
4658
|
+
<Table aria-label="Suppliers">
|
|
4659
|
+
<Column value="id" label="Id" rowHeader />
|
|
4660
|
+
<Column value="name" label="Name" filter="text" />
|
|
4661
|
+
<Column value="city" label="City" filter="list" />
|
|
4662
|
+
</Table>
|
|
4663
|
+
);
|
|
4664
|
+
}
|
|
4665
|
+
```
|
|
4666
|
+
|
|
4495
4667
|
#### When to use something else
|
|
4496
4668
|
|
|
4497
4669
|
- Free text across the columns → Search
|
|
@@ -4552,7 +4724,7 @@ type Absent = null | undefined;
|
|
|
4552
4724
|
- No text filter per column: the search covers text.
|
|
4553
4725
|
- In [server mode](#server-mode) a list filter offers what the application names; the table cannot count values it does not hold.
|
|
4554
4726
|
|
|
4555
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
4727
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
4556
4728
|
|
|
4557
4729
|
### Pre-filter
|
|
4558
4730
|
|
|
@@ -4653,7 +4825,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
4653
4825
|
| Prop | Type | Default | Description |
|
|
4654
4826
|
|---|---|---|---|
|
|
4655
4827
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
4656
|
-
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
4828
|
+
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
4657
4829
|
|
|
4658
4830
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
4659
4831
|
|
|
@@ -5834,11 +6006,11 @@ export default function GroupAndFoldFromControls() {
|
|
|
5834
6006
|
|
|
5835
6007
|
#### Known limits
|
|
5836
6008
|
|
|
5837
|
-
- No pivot and no more than three levels ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
6009
|
+
- No pivot and no more than three levels ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
5838
6010
|
- No bar to drag headers onto: grouping is chosen in the column menu.
|
|
5839
6011
|
- No groups in [server mode](#server-mode): they would be made of one page.
|
|
5840
6012
|
|
|
5841
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
6013
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
5842
6014
|
|
|
5843
6015
|
### Tree rows
|
|
5844
6016
|
|
|
@@ -6436,7 +6608,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
6436
6608
|
- Not in [server mode](#server-mode), and no branches loaded on demand yet.
|
|
6437
6609
|
- One column set for every level; a level without a value shows it as absent.
|
|
6438
6610
|
|
|
6439
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
6611
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6440
6612
|
|
|
6441
6613
|
### Aggregate
|
|
6442
6614
|
|
|
@@ -6978,7 +7150,7 @@ type Displayable = string | number | boolean | Date;
|
|
|
6978
7150
|
|
|
6979
7151
|
- In [server mode](#server-mode) the footer shows the sums the server hands in as `totals`, and nothing without them: a sum over one page would misstate the server's set.
|
|
6980
7152
|
|
|
6981
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
7153
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6982
7154
|
|
|
6983
7155
|
## Rows
|
|
6984
7156
|
|
|
@@ -7145,6 +7317,44 @@ export default function TheCurrentRow() {
|
|
|
7145
7317
|
}
|
|
7146
7318
|
```
|
|
7147
7319
|
|
|
7320
|
+
##### Hear the selection
|
|
7321
|
+
|
|
7322
|
+
`onSelectionChange` hands the application the ticked keys after each change, so it need not hold the selection itself. Tick rows, then “select all”.
|
|
7323
|
+
|
|
7324
|
+
```tsx
|
|
7325
|
+
import { useState } from "react";
|
|
7326
|
+
import { Stack, Text } from "@umriss-ui/core";
|
|
7327
|
+
import { useTable } from "@umriss-ui/table";
|
|
7328
|
+
|
|
7329
|
+
interface Shipment {
|
|
7330
|
+
id: string;
|
|
7331
|
+
customer: string;
|
|
7332
|
+
}
|
|
7333
|
+
|
|
7334
|
+
const SHIPMENTS: Shipment[] = [
|
|
7335
|
+
{ id: "FP-1004210", customer: "Holloway Garden Supplies" },
|
|
7336
|
+
{ id: "FP-1004223", customer: "Oakridge Pharmacy" },
|
|
7337
|
+
{ id: "FP-1004236", customer: "Brixley Cycles" },
|
|
7338
|
+
];
|
|
7339
|
+
|
|
7340
|
+
export default function HearTheSelection() {
|
|
7341
|
+
const [keys, setKeys] = useState<string[]>([]);
|
|
7342
|
+
const { Table, Column } = useTable(SHIPMENTS, { rowKey: (s) => s.id, onSelectionChange: setKeys });
|
|
7343
|
+
|
|
7344
|
+
return (
|
|
7345
|
+
<Stack gap={3}>
|
|
7346
|
+
<Table selectable aria-label="Shipments">
|
|
7347
|
+
<Column value="id" label="Shipment" rowHeader />
|
|
7348
|
+
<Column value="customer" label="Customer" />
|
|
7349
|
+
</Table>
|
|
7350
|
+
<Text size="xs" tone="muted">
|
|
7351
|
+
Heard: {keys.length === 0 ? "nothing ticked" : keys.join(", ")}.
|
|
7352
|
+
</Text>
|
|
7353
|
+
</Stack>
|
|
7354
|
+
);
|
|
7355
|
+
}
|
|
7356
|
+
```
|
|
7357
|
+
|
|
7148
7358
|
#### When to use something else
|
|
7149
7359
|
|
|
7150
7360
|
- Actions that act on the ticked rows → RowActions
|
|
@@ -7174,6 +7384,7 @@ From `TableOptions` — the full table stands on [First table](#first-table).
|
|
|
7174
7384
|
|---|---|---|---|
|
|
7175
7385
|
| [`rowKey`](#first-table) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
|
|
7176
7386
|
| [`selection`](#first-table) | [`TableSelection`](#first-table)`<string>` | — | A selection from outside instead of its own – when the application holds it. |
|
|
7387
|
+
| [`onSelectionChange`](#first-table) | `(keys: string[]) => void` | — | Called with the selected keys after each change – the user's or the API's, its own selection or the one handed in – from an effect, never at mount. Under "all that match" (server mode) the keys are the ones ticked before it; `selection.allMatching` and `selection.except` tell the rest. |
|
|
7177
7388
|
|
|
7178
7389
|
From `TableSnapshot` — the full table stands on [First table](#first-table).
|
|
7179
7390
|
|
|
@@ -7211,7 +7422,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
7211
7422
|
|
|
7212
7423
|
- In [server mode](#server-mode) “select all” selects the page, and with the page ticked the table offers all that match: a state that a bulk action receives as `{ request, except }`, since the table holds no rows for it.
|
|
7213
7424
|
|
|
7214
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
7425
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
7215
7426
|
|
|
7216
7427
|
### Row appearance
|
|
7217
7428
|
|
|
@@ -8197,7 +8408,7 @@ The parts the table puts in name themselves: the search field “Search table”
|
|
|
8197
8408
|
|
|
8198
8409
|
| Prop | Type | Default | Description |
|
|
8199
8410
|
|---|---|---|---|
|
|
8200
|
-
| `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Search, arrange and export](#toolbar), [Place it outside the table](#toolbar), [Set wording and formats once (Provider)](#provider) and
|
|
8411
|
+
| `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Search, arrange and export](#toolbar), [Place it outside the table](#toolbar), [Set wording and formats once (Provider)](#provider) and 42 more |
|
|
8201
8412
|
| `size` | `ToolbarSize`<br>`"sm" \| "md"` | `"sm"` | The size of every control the table puts into it - search, column menu, export, "reset", the bulk actions -: `sm` or `md`. A control of one's own takes the same size by its own prop.<br>Shown in: [A larger toolbar (Toolbar controls)](#toolbar-controls), [A dispatcher's bar (Toolbar controls)](#toolbar-controls) |
|
|
8202
8413
|
| `of` | `TableRef` | — | The table, when the table toolbar does not stand inside it. If it then stands behind the table in the tree, it registers only after the first frame – until then a table with a search or a column filter shows its own toolbar. Placed before the table, there is no such change.<br>Shown in: [Place it outside the table](#toolbar), [Review cost centres against budget (Scenarios)](#review-cost-centres-against-budget) |
|
|
8203
8414
|
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [Find a late shipment (Scenarios)](#find-a-late-shipment), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
@@ -8922,7 +9133,7 @@ The keys of [First table](#first-table), Input, [ColumnMenu](#columnmenu), Selec
|
|
|
8922
9133
|
|
|
8923
9134
|
| Prop | Type | Default | Description |
|
|
8924
9135
|
|---|---|---|---|
|
|
8925
|
-
| `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Controls of your own at the toolbar's size](#toolbar-controls), [A larger toolbar](#toolbar-controls), [A dispatcher's bar](#toolbar-controls) and
|
|
9136
|
+
| `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Controls of your own at the toolbar's size](#toolbar-controls), [A larger toolbar](#toolbar-controls), [A dispatcher's bar](#toolbar-controls) and 42 more |
|
|
8926
9137
|
| `size` | `ToolbarSize`<br>`"sm" \| "md"` | `"sm"` | The size of every control the table puts into it - search, column menu, export, "reset", the bulk actions -: `sm` or `md`. A control of one's own takes the same size by its own prop.<br>Shown in: [A larger toolbar](#toolbar-controls), [A dispatcher's bar](#toolbar-controls) |
|
|
8927
9138
|
| `of` | `TableRef` | — | The table, when the table toolbar does not stand inside it. If it then stands behind the table in the tree, it registers only after the first frame – until then a table with a search or a column filter shows its own toolbar. Placed before the table, there is no such change.<br>Shown in: [Place it outside the table (Toolbar)](#toolbar), [Review cost centres against budget (Scenarios)](#review-cost-centres-against-budget) |
|
|
8928
9139
|
| `ref` | `Ref<HTMLDivElement> \| undefined` | — | Receives the component's root element. From `RefProp`.<br>Shown in: [Find a late shipment (Scenarios)](#find-a-late-shipment), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
@@ -9447,6 +9658,7 @@ Everything the library knows about formatting.
|
|
|
9447
9658
|
| `month` *required* | `(d: Date) => string` | — | The calendar's month header: March 2026 |
|
|
9448
9659
|
| `monthName` *required* | `(d: Date) => string` | — | The month alone, in the calendar head's month list: March |
|
|
9449
9660
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
9661
|
+
| `weekStart` *required* | `number` | — | The first day of the calendars' week, ISO-numbered: 1 = Monday ... 7 = Sunday. |
|
|
9450
9662
|
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03<br>Shown in: [Work through the alerts (Scenarios)](#work-through-the-alerts), [Find a late shipment (Scenarios)](#find-a-late-shipment) |
|
|
9451
9663
|
| `dateTime` *required* | `(d: Date, withSeconds: boolean) => string` | — | Date and time together: 17/03/2026, 09:05 |
|
|
9452
9664
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2 |
|
|
@@ -9565,6 +9777,7 @@ Everything the library puts out as text.
|
|
|
9565
9777
|
| `filterDone` *required* | `string` | — | |
|
|
9566
9778
|
| `columns` *required* | `string` | — | The column menu's button.<br>Shown in: [Set wording and formats once (Provider)](#provider) |
|
|
9567
9779
|
| `arrangeColumns` *required* | `string` | — | Accessible name of the list in the column menu. |
|
|
9780
|
+
| `fitAllColumns` *required* | `string` | — | The column menu's button that sets every column to the width of its content. |
|
|
9568
9781
|
| `columnForward` *required* | `(column: string) => string` | — | The two buttons that move a column in the column menu. |
|
|
9569
9782
|
| `columnBackward` *required* | `(column: string) => string` | — | |
|
|
9570
9783
|
| `pinColumnToStart` *required* | `(column: string) => string` | — | The column menu's pin keys: to a side, and back when it is pinned there. |
|
|
@@ -9654,6 +9867,18 @@ Everything the library puts out as text.
|
|
|
9654
9867
|
| `rangeFrom` *required* | `(from: string) => string` | — | |
|
|
9655
9868
|
| `rangeTo` *required* | `(to: string) => string` | — | |
|
|
9656
9869
|
| `rangeInvalid` *required* | `string` | — | When "From" lies behind "To". The condition stays the last valid one. |
|
|
9870
|
+
| `textContains` *required* | `string` | — | The text filter: its operators, as the choice and in the condition. |
|
|
9871
|
+
| `textNotContains` *required* | `string` | — | |
|
|
9872
|
+
| `textStartsWith` *required* | `string` | — | |
|
|
9873
|
+
| `textEndsWith` *required* | `string` | — | |
|
|
9874
|
+
| `textEquals` *required* | `string` | — | |
|
|
9875
|
+
| `textIsEmpty` *required* | `string` | — | |
|
|
9876
|
+
| `textAnd` *required* | `string` | — | What joins the two terms of a text condition: the choice and the word between them. |
|
|
9877
|
+
| `textOr` *required* | `string` | — | |
|
|
9878
|
+
| `filterOperator` *required* | `string` | — | The labels of the operator and the value fields of a term. |
|
|
9879
|
+
| `filterValue` *required* | `string` | — | |
|
|
9880
|
+
| `filterJoin` *required* | `string` | — | The name of the choice between AND and OR. |
|
|
9881
|
+
| `textTerm` *required* | `(operator: string, value: string) => string` | — | A term with a value in the toolbar: `starts with “foo”`. |
|
|
9657
9882
|
| `resetAll` *required* | `string` | — | Clears search and conditions - in the table toolbar and in the empty body. |
|
|
9658
9883
|
| `tryAgain` *required* | `string` | — | The button under a server-mode table's error that sends the request once more. |
|
|
9659
9884
|
| `filteredOfTotal` *required* | `(matches: string, total: string) => string` | — | "43 of 1.204" - the numbers come from the formats. |
|
|
@@ -9716,6 +9941,7 @@ Everything the library puts out as text.
|
|
|
9716
9941
|
| `scheduleUnfoldGroup` *required* | `string` | — | |
|
|
9717
9942
|
| `scheduleLaneCount` *required* | `(count: number) => string` | — | How many lanes a group holds, beside its name in the header. |
|
|
9718
9943
|
| `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
|
|
9944
|
+
| `schedulePlotName` *required* | `(label: string) => string` | — | The plot's own name, beside the figure that carries the caller's `aria-label`, so the caller's name is not heard twice. |
|
|
9719
9945
|
| `scheduleSummary` *required* | `(summary: { lanes: number; subtasks: number; from: string; to: string; overlaps: number; violated: number; /** Subtasks in blocked time; said only where there are any. */ blocked: number; /** Milestones of the plan; said only where there are any. */ milestones: number; }) => string` | — | The plot's description (S6): the lanes, the subtasks in view, the visible span with both ends formatted, and the findings of the plan by kind. |
|
|
9720
9946
|
| `scheduleVisibleRange` *required* | `(from: string, to: string) => string` | — | The span in view, said after a zoom key. |
|
|
9721
9947
|
| `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
|
|
@@ -9854,7 +10080,7 @@ Everything the library puts out as text.
|
|
|
9854
10080
|
|
|
9855
10081
|
- Two formats: CSV, and the Excel workbook from `@umriss-ui/table/xlsx` - one sheet, no styling, no formulas, no group rows, no compression; no PDF or print layout.
|
|
9856
10082
|
|
|
9857
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
10083
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9858
10084
|
|
|
9859
10085
|
### View
|
|
9860
10086
|
|
|
@@ -10064,7 +10290,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
10064
10290
|
|---|---|---|---|
|
|
10065
10291
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
10066
10292
|
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"`, `"dateTime"`, `"timeWithSeconds"` or `"dateTimeWithSeconds"` for points in time. Alignment, sorting, export and footer stay with the value. |
|
|
10067
|
-
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
10293
|
+
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
10068
10294
|
|
|
10069
10295
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
10070
10296
|
|
|
@@ -10352,7 +10578,7 @@ type TableRef = Omit<TableSnapshot<unknown>, "setFilter" | "conditionOf"> & {
|
|
|
10352
10578
|
|
|
10353
10579
|
- In [server mode](#server-mode) the page goes to the server in the request, and `rowCount` decides how many pages there are.
|
|
10354
10580
|
|
|
10355
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
10581
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10356
10582
|
|
|
10357
10583
|
### Virtualisation
|
|
10358
10584
|
|
|
@@ -10663,7 +10889,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
10663
10889
|
- Paging and virtualisation do not combine; one table does one or the other.
|
|
10664
10890
|
- No loading more rows while scrolling: a table on a server pages ([Server mode](#server-mode)).
|
|
10665
10891
|
|
|
10666
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
10892
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10667
10893
|
|
|
10668
10894
|
### Benchmark
|
|
10669
10895
|
|
|
@@ -12204,7 +12430,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
12204
12430
|
| Prop | Type | Default | Description |
|
|
12205
12431
|
|---|---|---|---|
|
|
12206
12432
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
12207
|
-
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
12433
|
+
| [`filter`](#column) | [`FilterFor`](#column)`<Z[K]>` | — | A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (numbers or points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself. Its condition stands in the table toolbar. |
|
|
12208
12434
|
|
|
12209
12435
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
12210
12436
|
|
|
@@ -12259,7 +12485,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
12259
12485
|
- A list filter offers what `filterOptions` names; the table cannot count values it does not hold.
|
|
12260
12486
|
- No loading more rows while scrolling: paging and virtualisation do not combine.
|
|
12261
12487
|
|
|
12262
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
12488
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12263
12489
|
|
|
12264
12490
|
## Editing
|
|
12265
12491
|
|
|
@@ -12488,6 +12714,8 @@ By default each cell is reported as it is left (`onCellEdit`) - for another cell
|
|
|
12488
12714
|
|
|
12489
12715
|
`onRowAdd` puts up "New row" - in the toolbar, or beneath the table without one - and `onRowDelete` a Delete that asks inside its row. Both work in either mode.
|
|
12490
12716
|
|
|
12717
|
+
Undo and redo are not built in. The last example keeps the history of the reported edits in the application and writes the replaced value back on Ctrl+Z - about twenty lines, and the recipe of the README.
|
|
12718
|
+
|
|
12491
12719
|
#### Examples
|
|
12492
12720
|
|
|
12493
12721
|
##### Edit a comments column
|
|
@@ -12786,6 +13014,107 @@ export default function EditADenseTable() {
|
|
|
12786
13014
|
}
|
|
12787
13015
|
```
|
|
12788
13016
|
|
|
13017
|
+
##### Undo and redo over the reported edits
|
|
13018
|
+
|
|
13019
|
+
The table reports each edit and applies none, so the history is the application's: each reported edit keeps the value it replaced, and Ctrl+Z writes that value back.
|
|
13020
|
+
|
|
13021
|
+
```tsx
|
|
13022
|
+
import { useEffect, useState } from "react";
|
|
13023
|
+
import { Button, Stack } from "@umriss-ui/core";
|
|
13024
|
+
import { useTable } from "@umriss-ui/table";
|
|
13025
|
+
import type { CellEdit } from "@umriss-ui/table";
|
|
13026
|
+
|
|
13027
|
+
interface Task {
|
|
13028
|
+
id: string;
|
|
13029
|
+
title: string;
|
|
13030
|
+
owner: string;
|
|
13031
|
+
hours: number;
|
|
13032
|
+
status: "Open" | "Doing" | "Done";
|
|
13033
|
+
}
|
|
13034
|
+
|
|
13035
|
+
const TASKS: Task[] = [
|
|
13036
|
+
{ id: "t1", title: "Survey the site", owner: "Maya Lindgren", hours: 6, status: "Done" },
|
|
13037
|
+
{ id: "t2", title: "Draft the layout", owner: "Noah Fischer", hours: 14, status: "Doing" },
|
|
13038
|
+
{ id: "t3", title: "Review the layout", owner: "Arjun Mehta", hours: 4, status: "Open" },
|
|
13039
|
+
];
|
|
13040
|
+
|
|
13041
|
+
/** A reported edit, with the value it replaced. */
|
|
13042
|
+
interface Step {
|
|
13043
|
+
rowKey: string;
|
|
13044
|
+
columnId: string;
|
|
13045
|
+
before: unknown;
|
|
13046
|
+
after: unknown;
|
|
13047
|
+
}
|
|
13048
|
+
|
|
13049
|
+
/** The rows with one cell set to a value; a new array, so React sees the change. */
|
|
13050
|
+
function setCell(all: Task[], rowKey: string, columnId: string, value: unknown): Task[] {
|
|
13051
|
+
return all.map((t) => (t.id === rowKey ? { ...t, [columnId]: value } : t));
|
|
13052
|
+
}
|
|
13053
|
+
|
|
13054
|
+
export default function UndoAndRedo() {
|
|
13055
|
+
const [tasks, setTasks] = useState(TASKS);
|
|
13056
|
+
const [undo, setUndo] = useState<Step[]>([]);
|
|
13057
|
+
const [redo, setRedo] = useState<Step[]>([]);
|
|
13058
|
+
const { Table, Column } = useTable(tasks, { rowKey: (t) => t.id });
|
|
13059
|
+
|
|
13060
|
+
const onCellEdit = (edit: CellEdit<Task>) => {
|
|
13061
|
+
const before = (edit.row as unknown as Record<string, unknown>)[edit.columnId];
|
|
13062
|
+
setTasks((all) => setCell(all, edit.rowKey, edit.columnId, edit.value));
|
|
13063
|
+
setUndo((steps) => [...steps, { rowKey: edit.rowKey, columnId: edit.columnId, before, after: edit.value }]);
|
|
13064
|
+
setRedo([]);
|
|
13065
|
+
};
|
|
13066
|
+
|
|
13067
|
+
const undoLast = () => {
|
|
13068
|
+
const step = undo.at(-1);
|
|
13069
|
+
if (!step) return;
|
|
13070
|
+
setUndo(undo.slice(0, -1));
|
|
13071
|
+
setRedo([...redo, step]);
|
|
13072
|
+
setTasks((all) => setCell(all, step.rowKey, step.columnId, step.before));
|
|
13073
|
+
};
|
|
13074
|
+
|
|
13075
|
+
const redoLast = () => {
|
|
13076
|
+
const step = redo.at(-1);
|
|
13077
|
+
if (!step) return;
|
|
13078
|
+
setRedo(redo.slice(0, -1));
|
|
13079
|
+
setUndo([...undo, step]);
|
|
13080
|
+
setTasks((all) => setCell(all, step.rowKey, step.columnId, step.after));
|
|
13081
|
+
};
|
|
13082
|
+
|
|
13083
|
+
/* Ctrl+Z in the grid, not in an open editor, where the field keeps its own undo. */
|
|
13084
|
+
useEffect(() => {
|
|
13085
|
+
const onKey = (event: KeyboardEvent) => {
|
|
13086
|
+
if (!(event.ctrlKey || event.metaKey) || event.key.toLowerCase() !== "z") return;
|
|
13087
|
+
const target = event.target as Element;
|
|
13088
|
+
if (!target.closest('[role="grid"]') || target.closest("input, textarea, select")) return;
|
|
13089
|
+
event.preventDefault();
|
|
13090
|
+
if (event.shiftKey) redoLast();
|
|
13091
|
+
else undoLast();
|
|
13092
|
+
};
|
|
13093
|
+
window.addEventListener("keydown", onKey);
|
|
13094
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
13095
|
+
});
|
|
13096
|
+
|
|
13097
|
+
return (
|
|
13098
|
+
<Stack gap={2}>
|
|
13099
|
+
<Stack direction="row" gap={2}>
|
|
13100
|
+
<Button onClick={undoLast} disabled={undo.length === 0}>
|
|
13101
|
+
Undo
|
|
13102
|
+
</Button>
|
|
13103
|
+
<Button onClick={redoLast} disabled={redo.length === 0}>
|
|
13104
|
+
Redo
|
|
13105
|
+
</Button>
|
|
13106
|
+
</Stack>
|
|
13107
|
+
<Table grid aria-label="Tasks" onCellEdit={onCellEdit}>
|
|
13108
|
+
<Column value="title" label="Task" rowHeader />
|
|
13109
|
+
<Column value="owner" label="Owner" />
|
|
13110
|
+
<Column value="hours" label="Hours" edit="number" width={120} />
|
|
13111
|
+
<Column value="status" label="Status" edit="select" editOptions={["Open", "Doing", "Done"]} width={140} />
|
|
13112
|
+
</Table>
|
|
13113
|
+
</Stack>
|
|
13114
|
+
);
|
|
13115
|
+
}
|
|
13116
|
+
```
|
|
13117
|
+
|
|
12789
13118
|
#### Keyboard
|
|
12790
13119
|
|
|
12791
13120
|
| Key | Action |
|
|
@@ -12847,9 +13176,9 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
12847
13176
|
|
|
12848
13177
|
#### Known limits
|
|
12849
13178
|
|
|
12850
|
-
- No cell range selection and no undo ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
13179
|
+
- No cell range selection and no built-in undo: the history of the reported edits is the application's ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
12851
13180
|
|
|
12852
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
13181
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12853
13182
|
|
|
12854
13183
|
## Limits and alarms
|
|
12855
13184
|
|
|
@@ -13099,6 +13428,8 @@ The keys of [First table](#first-table) apply here.
|
|
|
13099
13428
|
| `format` | `NumberFormat` | — | How the value and its excess are written.<br>Shown in: [Judge a computed share](#verdictcolumn), [Show the worst in the footer](#verdictcolumn), [Carry the worst verdict up (Aggregate)](#aggregate) and 1 more |
|
|
13100
13429
|
| `sortBy` | `"verdict" \| "value"` | `"verdict"` | What the column sorts by: by the weight of the verdict (with equal weight the existing order stays) – or by the value.<br>Shown in: [Sort by verdict or by value](#verdictcolumn) |
|
|
13101
13430
|
| `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning) |
|
|
13431
|
+
| `flex` | `number` | none: the column is as wide as its content | A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. A width, declared or dragged by hand, ends the flex of that column. |
|
|
13432
|
+
| `minWidth` | `number` | — | The least width of a column with `flex`, in pixels. |
|
|
13102
13433
|
| `resizable` | `boolean` | — | Shows the drag grip on the header cell. |
|
|
13103
13434
|
| `pin` | `Pin`<br>`"start" \| "end"` | — | Keeps the column in view while the table scrolls sideways, before or after every other column.<br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning) |
|
|
13104
13435
|
| `aggregate` | `"worst"` | — | `"worst"`: the worst verdict among the rows – in the footer and in a group's header.<br>Shown in: [Show the worst in the footer](#verdictcolumn), [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Read a day's deliveries by depot (Grouping)](#grouping-1) and 2 more |
|
|
@@ -13191,7 +13522,7 @@ type Severity = "warning" | "alarm";
|
|
|
13191
13522
|
- No list filter: four verdicts are sorted, not filtered.
|
|
13192
13523
|
- It does not judge whether a value is stale; a stale value keeps its verdict ([ADR-0010](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0010-a-stale-value-keeps-its-verdict.md)).
|
|
13193
13524
|
|
|
13194
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
13525
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.49.0/docs/adr/0032-what-umriss-is-not.md).
|
|
13195
13526
|
|
|
13196
13527
|
## API index
|
|
13197
13528
|
|
|
@@ -13203,6 +13534,17 @@ Everything `@umriss-ui/table` exports, with its signature. A component's props s
|
|
|
13203
13534
|
|
|
13204
13535
|
#### Components
|
|
13205
13536
|
|
|
13537
|
+
##### `ColumnGroup`
|
|
13538
|
+
|
|
13539
|
+
Puts a second head row over the `Column`s it wraps: one cell, spanning the
|
|
13540
|
+
group's visible columns.
|
|
13541
|
+
|
|
13542
|
+
```ts
|
|
13543
|
+
function ColumnGroup({ label, children }: ColumnGroupProps): ReactNode;
|
|
13544
|
+
```
|
|
13545
|
+
|
|
13546
|
+
Used on [Column](#column).
|
|
13547
|
+
|
|
13206
13548
|
##### `ColumnMenu`
|
|
13207
13549
|
|
|
13208
13550
|
[ColumnMenu](#columnmenu) – A menu in which the user shows, hides, reorders and pins the table's columns and picks a grouping (also called a column chooser). Offer it where the table has more columns than everyone needs.
|
|
@@ -13410,10 +13752,10 @@ An edit the user committed - reported, not applied.
|
|
|
13410
13752
|
|
|
13411
13753
|
| Prop | Type | Default | Description |
|
|
13412
13754
|
|---|---|---|---|
|
|
13413
|
-
| `rowKey` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and
|
|
13414
|
-
| `columnId` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits), [
|
|
13415
|
-
| `value` *required* | `unknown` | — | The editor's value: text for `"text"`, a number or null for `"number"`, a day or null for `"date"`, an option for `"select"`.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and
|
|
13416
|
-
| `row` *required* | `Z` | — | <br>Shown in: [Check an edit before it is reported (Edits)](#edits), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
13755
|
+
| `rowKey` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and 2 more |
|
|
13756
|
+
| `columnId` *required* | `string` | — | <br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits), [Undo and redo over the reported edits (Edits)](#edits) and 1 more |
|
|
13757
|
+
| `value` *required* | `unknown` | — | The editor's value: text for `"text"`, a number or null for `"number"`, a day or null for `"date"`, an option for `"select"`.<br>Shown in: [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits), [Check an edit before it is reported (Edits)](#edits) and 2 more |
|
|
13758
|
+
| `row` *required* | `Z` | — | <br>Shown in: [Check an edit before it is reported (Edits)](#edits), [Undo and redo over the reported edits (Edits)](#edits), [Plan the team's capacity (Scenarios)](#plan-the-teams-capacity) |
|
|
13417
13759
|
|
|
13418
13760
|
Used on [Edits](#edits).
|
|
13419
13761
|
|
|
@@ -13497,6 +13839,15 @@ interface ColumnComponent<Z> {
|
|
|
13497
13839
|
|
|
13498
13840
|
Its table stands on [Filter](#filter).
|
|
13499
13841
|
|
|
13842
|
+
##### `ColumnGroupProps`
|
|
13843
|
+
|
|
13844
|
+
The props of `ColumnGroup`.
|
|
13845
|
+
|
|
13846
|
+
| Prop | Type | Default | Description |
|
|
13847
|
+
|---|---|---|---|
|
|
13848
|
+
| `label` *required* | `string` | — | The text over the group's columns.<br>Shown in: [A header over columns (Column)](#column) |
|
|
13849
|
+
| `children` | `ReactNode` | — | The `Column`s of the group; they stay together when columns are reordered.<br>Shown in: [A header over columns (Column)](#column) |
|
|
13850
|
+
|
|
13500
13851
|
##### `ColumnMenuProps`
|
|
13501
13852
|
|
|
13502
13853
|
Its table stands on [ColumnMenu](#columnmenu).
|
|
@@ -13531,10 +13882,11 @@ type Computed<Z, W> = ColumnBase &
|
|
|
13531
13882
|
chosen - `filter="range"` would then leave the whole column untyped. A
|
|
13532
13883
|
filter of one's own is still checked against the value. */
|
|
13533
13884
|
/** A filter in the column header: `"list"` offers the values that occur,
|
|
13534
|
-
`"range"` two bounds (meaningful only for numbers and points in time),
|
|
13535
|
-
filter from `columnFilter` asks
|
|
13885
|
+
`"range"` two bounds (meaningful only for numbers and points in time),
|
|
13886
|
+
`"text"` operators over a text, a filter from `columnFilter` asks
|
|
13887
|
+
whatever it asks itself. */
|
|
13536
13888
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the condition belongs to the filter
|
|
13537
|
-
filter?: "list" | "range" | ColumnFilter<Present<W>, any>;
|
|
13889
|
+
filter?: "list" | "range" | "text" | ColumnFilter<Present<W>, any>;
|
|
13538
13890
|
/** Edits the column's cells in place in grid mode - see a field column's `edit`. */
|
|
13539
13891
|
edit?: "text" | "number" | "select" | "date" | ((editor: CellEditorProps<W, Z>) => ReactNode);
|
|
13540
13892
|
/** What `edit="select"` offers.
|
|
@@ -13596,8 +13948,8 @@ The props a column carries for editing in grid mode (`<Table grid>`).
|
|
|
13596
13948
|
|
|
13597
13949
|
| Prop | Type | Default | Description |
|
|
13598
13950
|
|---|---|---|---|
|
|
13599
|
-
| `edit` | `EditFor``<W, Z>` | — | Edits the column's cells in place in grid mode: Enter, F2 or typing starts it, Enter or Tab commits, Escape cancels. The table applies nothing - the edit is reported through the table's `onCellEdit`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits) and
|
|
13600
|
-
| `editOptions` | `readonly ``Present``<W>[]` | the values that occur | What `edit="select"` offers.<br>Shown in: [Share a column between tables (Presets)](#presets), [Check an edit before it is reported (Edits)](#edits), [Save a row on purpose (Edits)](#edits) and
|
|
13951
|
+
| `edit` | `EditFor``<W, Z>` | — | Edits the column's cells in place in grid mode: Enter, F2 or typing starts it, Enter or Tab commits, Escape cancels. The table applies nothing - the edit is reported through the table's `onCellEdit`.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Edit a comments column (Edits)](#edits) and 7 more |
|
|
13952
|
+
| `editOptions` | `readonly ``Present``<W>[]` | the values that occur | What `edit="select"` offers.<br>Shown in: [Share a column between tables (Presets)](#presets), [Check an edit before it is reported (Edits)](#edits), [Save a row on purpose (Edits)](#edits) and 2 more |
|
|
13601
13953
|
| `validate` | `(value: W \| null, row: Z) => string \| null \| undefined` | — | Checks a draft before it is reported: a message keeps the editor open and stands beneath the field, as in a `FormField`; nothing lets it through.<br>Shown in: [Share a column between tables (Presets)](#presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#grid-mode), [Check an edit before it is reported (Edits)](#edits) and 3 more |
|
|
13602
13954
|
|
|
13603
13955
|
##### `ExportCell`
|
|
@@ -13661,24 +14013,26 @@ Its table stands on [Column](#column).
|
|
|
13661
14013
|
|
|
13662
14014
|
##### `FieldCondition<W>`
|
|
13663
14015
|
|
|
13664
|
-
What can be set as a condition on a field: a list of its values,
|
|
13665
|
-
numbers and points in time a range
|
|
14016
|
+
What can be set as a condition on a field: a list of its values, for
|
|
14017
|
+
numbers and points in time a range, and for text a text condition.
|
|
13666
14018
|
|
|
13667
14019
|
```ts
|
|
13668
14020
|
type FieldCondition<W> =
|
|
13669
14021
|
| ListCondition<W>
|
|
14022
|
+
| ([Present<W>] extends [string] ? TextCondition : never)
|
|
13670
14023
|
| ([Present<W>] extends [number] ? RangeCondition<number> : [Present<W>] extends [Date] ? RangeCondition<Date> : never);
|
|
13671
14024
|
```
|
|
13672
14025
|
|
|
13673
14026
|
##### `FilterFor<W>`
|
|
13674
14027
|
|
|
13675
14028
|
What a column accepts as `filter`: `"list"` for every value with a text
|
|
13676
|
-
form, `"range"` for numbers and points in time, a filter
|
|
13677
|
-
only where its value type fits.
|
|
14029
|
+
form, `"range"` for numbers and points in time, `"text"` for text, a filter
|
|
14030
|
+
from `columnFilter` only where its value type fits.
|
|
13678
14031
|
|
|
13679
14032
|
```ts
|
|
13680
14033
|
type FilterFor<W> =
|
|
13681
14034
|
| (IsDisplayable<W> extends true ? "list" : never)
|
|
14035
|
+
| ([Present<W>] extends [string] ? "text" : never)
|
|
13682
14036
|
| ([Present<W>] extends [number] ? "range" : [Present<W>] extends [Date] ? "range" : never)
|
|
13683
14037
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the condition belongs to the filter; at the column only the value counts
|
|
13684
14038
|
| ColumnFilter<Present<W>, any>;
|
|
@@ -14011,8 +14365,8 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
14011
14365
|
|
|
14012
14366
|
| Prop | Type | Default | Description |
|
|
14013
14367
|
|---|---|---|---|
|
|
14014
|
-
| `Table` *required* | `(props: `[`TableProps`](#first-table)`<Z>) => ReactNode` | — | <br>Shown in: [A first table (Installation)](#installation), [Show a list of services (First table)](#first-table), [Search and page from a header of your own (First table)](#first-table) and
|
|
14015
|
-
| `Column` *required* | `ColumnComponent``<Z>` | — | <br>Shown in: [A first table (Installation)](#installation), [Show a list of services (First table)](#first-table), [Search and page from a header of your own (First table)](#first-table) and
|
|
14368
|
+
| `Table` *required* | `(props: `[`TableProps`](#first-table)`<Z>) => ReactNode` | — | <br>Shown in: [A first table (Installation)](#installation), [Show a list of services (First table)](#first-table), [Search and page from a header of your own (First table)](#first-table) and 137 more |
|
|
14369
|
+
| `Column` *required* | `ColumnComponent``<Z>` | — | <br>Shown in: [A first table (Installation)](#installation), [Show a list of services (First table)](#first-table), [Search and page from a header of your own (First table)](#first-table) and 137 more |
|
|
14016
14370
|
| `VerdictColumn` *required* | `VerdictColumnComponent``<Z>` | — | <br>Shown in: [A bar, a scale, an icon and a limit (Conditional formatting)](#conditional-formatting), [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Read a day's deliveries by depot (Grouping)](#grouping-1) and 6 more |
|
|
14017
14371
|
| `RowDetail` *required* | `(props: `[`RowDetailProps`](#rowdetail)`<Z>) => ReactNode` | — | <br>Shown in: [Keep the header and the names in view (Width and pinning)](#width-and-pinning), [Employees in the detail (Tree rows)](#tree-rows), [Own staff and teams (Tree rows)](#tree-rows) and 5 more |
|
|
14018
14372
|
| `RowActions` *required* | `(props: `[`RowActionsProps`](#rowactions)`) => ReactNode` | — | <br>Shown in: [Name the row (Column)](#column), [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Select a whole group (Grouping)](#grouping-1) and 8 more |
|
|
@@ -14040,6 +14394,7 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
14040
14394
|
| `setPin` *required* | `(column: string, pin: ``Pin`` \| null) => void` | — | Pins a column to the start or the end, or unpins it with `null`. From `TableSnapshot`.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
14041
14395
|
| `widths` *required* | `Readonly<Record<string, number>>` | — | The widths in pixels: those of the columns, and over them the dragged ones. From `TableSnapshot`.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
14042
14396
|
| `setWidth` *required* | `(column: string, width: number \| undefined) => void` | — | Sets the width of a column; `undefined` takes it back. From `TableSnapshot`.<br>Shown in: [Pin and size from controls of your own (Width and pinning)](#width-and-pinning) |
|
|
14397
|
+
| `autoSizeColumns` *required* | `() => void` | — | Sets every column to the width of its content - the measurement of the grip's double click, for all columns at once. From `TableSnapshot`.<br>Shown in: [Columns that share the width (Width and pinning)](#width-and-pinning) |
|
|
14043
14398
|
| `expanded` *required* | `readonly string[]` | — | The keys of the expanded rows. From `TableSnapshot`.<br>Shown in: [Open a detail from outside the table (RowDetail)](#rowdetail) |
|
|
14044
14399
|
| `toggleRow` *required* | `(key: string) => void` | — | Expands a row or collapses it. From `TableSnapshot`.<br>Shown in: [Open a detail from outside the table (RowDetail)](#rowdetail) |
|
|
14045
14400
|
| `filter` *required* | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters and row filters by id, in the order in which they were set. Whatever fits no column and no row filter is absent. From `TableSnapshot`.<br>Shown in: [Set a condition from outside the table (Filter)](#filter) |
|
|
@@ -14177,7 +14532,7 @@ the application.
|
|
|
14177
14532
|
| Prop | Type | Default | Description |
|
|
14178
14533
|
|---|---|---|---|
|
|
14179
14534
|
| `search` | `string` | — | <br>Shown in: [Show loading, empty, failed and no match (Row appearance)](#row-appearance), [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode) and 6 more |
|
|
14180
|
-
| `conditions` | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters, per column. A condition for a column that does not exist, or whose filter is of another kind, falls out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [
|
|
14535
|
+
| `conditions` | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters, per column. A condition for a column that does not exist, or whose filter is of another kind, falls out.<br>Shown in: [Ask a question over several fields (Filter)](#filter), [Filter a text with operators (Filter)](#filter), [A dispatcher's bar (Toolbar controls)](#toolbar-controls) and 9 more |
|
|
14181
14536
|
| `sort` | `readonly ``SortLevel``<K>[]` | — | <br>Shown in: [Keep and restore a view (View)](#view), [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode) and 6 more |
|
|
14182
14537
|
| `page` | `number` | — | <br>Shown in: [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode), [Name the values a list filter offers (Server mode)](#server-mode) and 5 more |
|
|
14183
14538
|
| `pageSize` | `number` | — | <br>Shown in: [Hand the table one page (Server mode)](#server-mode), [Sort and search on the server (Server mode)](#server-mode), [Name the values a list filter offers (Server mode)](#server-mode) and 5 more |
|
|
@@ -14191,6 +14546,36 @@ the application.
|
|
|
14191
14546
|
|
|
14192
14547
|
Used on [View](#view).
|
|
14193
14548
|
|
|
14549
|
+
##### `TextCondition`
|
|
14550
|
+
|
|
14551
|
+
The condition of a text filter: one or two terms, joined by `join`
|
|
14552
|
+
(`"and"` unless given). Plain JSON - the view keeps it and a server request
|
|
14553
|
+
carries it as it is, under the column's id.
|
|
14554
|
+
|
|
14555
|
+
| Prop | Type | Default | Description |
|
|
14556
|
+
|---|---|---|---|
|
|
14557
|
+
| `join` | `"and" \| "or"` | — | |
|
|
14558
|
+
| `terms` *required* | `readonly `[`TextTerm``] \| readonly `[`TextTerm``, ``TextTerm``]` | — | |
|
|
14559
|
+
|
|
14560
|
+
##### `TextOperator`
|
|
14561
|
+
|
|
14562
|
+
How a text filter compares: without regard to case, with the formats' locale.
|
|
14563
|
+
`isEmpty` takes no value and holds for an absent text and for "".
|
|
14564
|
+
|
|
14565
|
+
```ts
|
|
14566
|
+
type TextOperator = "contains" | "notContains" | "startsWith" | "endsWith" | "equals" | "isEmpty";
|
|
14567
|
+
```
|
|
14568
|
+
|
|
14569
|
+
##### `TextTerm`
|
|
14570
|
+
|
|
14571
|
+
One term of a text condition. A term whose operator needs a value and has
|
|
14572
|
+
none (or "") requires nothing and is left out.
|
|
14573
|
+
|
|
14574
|
+
| Prop | Type | Default | Description |
|
|
14575
|
+
|---|---|---|---|
|
|
14576
|
+
| `operator` *required* | `TextOperator`<br>`"contains" \| "notContains" \| "startsWith" \| "endsWith" \| "equals" \| "isEmpty"` | — | |
|
|
14577
|
+
| `value` | `string` | — | |
|
|
14578
|
+
|
|
14194
14579
|
##### `ToolbarProps`
|
|
14195
14580
|
|
|
14196
14581
|
Its table stands on [Toolbar](#toolbar).
|
|
@@ -14266,6 +14651,7 @@ Everything the library knows about formatting.
|
|
|
14266
14651
|
| `month` *required* | `(d: Date) => string` | — | The calendar's month header: March 2026 |
|
|
14267
14652
|
| `monthName` *required* | `(d: Date) => string` | — | The month alone, in the calendar head's month list: March |
|
|
14268
14653
|
| `dateLong` *required* | `(d: Date) => string` | — | Accessible name of a calendar cell: Tuesday, 17 March 2026 |
|
|
14654
|
+
| `weekStart` *required* | `number` | — | The first day of the calendars' week, ISO-numbered: 1 = Monday ... 7 = Sunday. |
|
|
14269
14655
|
| `time` *required* | `(d: Date, withSeconds: boolean) => string` | — | Time of day, optionally with seconds: 09:05 or 09:05:03<br>Shown in: [Work through the alerts (Scenarios)](#work-through-the-alerts), [Find a late shipment (Scenarios)](#find-a-late-shipment) |
|
|
14270
14656
|
| `dateTime` *required* | `(d: Date, withSeconds: boolean) => string` | — | Date and time together: 17/03/2026, 09:05 |
|
|
14271
14657
|
| `offset` *required* | `(d: Date) => string` | — | Short form of the UTC offset: GMT+2 |
|
|
@@ -14384,6 +14770,7 @@ Everything the library puts out as text.
|
|
|
14384
14770
|
| `filterDone` *required* | `string` | — | |
|
|
14385
14771
|
| `columns` *required* | `string` | — | The column menu's button.<br>Shown in: [Set wording and formats once (Provider)](#provider) |
|
|
14386
14772
|
| `arrangeColumns` *required* | `string` | — | Accessible name of the list in the column menu. |
|
|
14773
|
+
| `fitAllColumns` *required* | `string` | — | The column menu's button that sets every column to the width of its content. |
|
|
14387
14774
|
| `columnForward` *required* | `(column: string) => string` | — | The two buttons that move a column in the column menu. |
|
|
14388
14775
|
| `columnBackward` *required* | `(column: string) => string` | — | |
|
|
14389
14776
|
| `pinColumnToStart` *required* | `(column: string) => string` | — | The column menu's pin keys: to a side, and back when it is pinned there. |
|
|
@@ -14473,6 +14860,18 @@ Everything the library puts out as text.
|
|
|
14473
14860
|
| `rangeFrom` *required* | `(from: string) => string` | — | |
|
|
14474
14861
|
| `rangeTo` *required* | `(to: string) => string` | — | |
|
|
14475
14862
|
| `rangeInvalid` *required* | `string` | — | When "From" lies behind "To". The condition stays the last valid one. |
|
|
14863
|
+
| `textContains` *required* | `string` | — | The text filter: its operators, as the choice and in the condition. |
|
|
14864
|
+
| `textNotContains` *required* | `string` | — | |
|
|
14865
|
+
| `textStartsWith` *required* | `string` | — | |
|
|
14866
|
+
| `textEndsWith` *required* | `string` | — | |
|
|
14867
|
+
| `textEquals` *required* | `string` | — | |
|
|
14868
|
+
| `textIsEmpty` *required* | `string` | — | |
|
|
14869
|
+
| `textAnd` *required* | `string` | — | What joins the two terms of a text condition: the choice and the word between them. |
|
|
14870
|
+
| `textOr` *required* | `string` | — | |
|
|
14871
|
+
| `filterOperator` *required* | `string` | — | The labels of the operator and the value fields of a term. |
|
|
14872
|
+
| `filterValue` *required* | `string` | — | |
|
|
14873
|
+
| `filterJoin` *required* | `string` | — | The name of the choice between AND and OR. |
|
|
14874
|
+
| `textTerm` *required* | `(operator: string, value: string) => string` | — | A term with a value in the toolbar: `starts with “foo”`. |
|
|
14476
14875
|
| `resetAll` *required* | `string` | — | Clears search and conditions - in the table toolbar and in the empty body. |
|
|
14477
14876
|
| `tryAgain` *required* | `string` | — | The button under a server-mode table's error that sends the request once more. |
|
|
14478
14877
|
| `filteredOfTotal` *required* | `(matches: string, total: string) => string` | — | "43 of 1.204" - the numbers come from the formats. |
|
|
@@ -14535,6 +14934,7 @@ Everything the library puts out as text.
|
|
|
14535
14934
|
| `scheduleUnfoldGroup` *required* | `string` | — | |
|
|
14536
14935
|
| `scheduleLaneCount` *required* | `(count: number) => string` | — | How many lanes a group holds, beside its name in the header. |
|
|
14537
14936
|
| `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
|
|
14937
|
+
| `schedulePlotName` *required* | `(label: string) => string` | — | The plot's own name, beside the figure that carries the caller's `aria-label`, so the caller's name is not heard twice. |
|
|
14538
14938
|
| `scheduleSummary` *required* | `(summary: { lanes: number; subtasks: number; from: string; to: string; overlaps: number; violated: number; /** Subtasks in blocked time; said only where there are any. */ blocked: number; /** Milestones of the plan; said only where there are any. */ milestones: number; }) => string` | — | The plot's description (S6): the lanes, the subtasks in view, the visible span with both ends formatted, and the findings of the plan by kind. |
|
|
14539
14939
|
| `scheduleVisibleRange` *required* | `(from: string, to: string) => string` | — | The span in view, said after a zoom key. |
|
|
14540
14940
|
| `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
|