@umriss-ui/table 0.45.0 → 0.47.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 +36 -2
- package/README.md +1 -0
- package/dist/index.d.ts +97 -5
- package/dist/table.css +1 -1
- package/dist/table.js +2489 -2337
- package/docs/llms-full.md +670 -72
- package/package.json +3 -3
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/table 0.
|
|
1
|
+
# @umriss-ui/table 0.47.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
|
|
|
@@ -1248,11 +1248,11 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
|
|
|
1248
1248
|
| Prop | Type | Default | Description |
|
|
1249
1249
|
|---|---|---|---|
|
|
1250
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 16 more |
|
|
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), [
|
|
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), [Fold groups into a summary (Grouping)](#grouping-1) and 8 more |
|
|
1252
1252
|
| `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
1253
|
| `striped` | `boolean` | — | Discreet zebra stripes.<br>Shown in: [Stripes across a wide table (Row appearance)](#row-appearance) |
|
|
1254
1254
|
| `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 |
|
|
1255
|
-
| `maxHeight` | `string` | — | Height of the scroll area, e.g. "480px". A virtualised table needs it.<br>Shown in: [Keep the header and the names in view (Width and pinning)](#width-and-pinning), [
|
|
1255
|
+
| `maxHeight` | `string` | — | Height of the scroll area, e.g. "480px". A virtualised table needs it.<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), [Fold groups into a summary (Grouping)](#grouping-1) and 7 more |
|
|
1256
1256
|
| `empty` | `ReactNode` | — | What stands in the body when there are no rows. Empty because of a filter the table shows itself – with the way back.<br>Shown in: [Restrict which rows a table has (Pre-filter)](#pre-filter), [Show loading, empty, failed and no match (Row appearance)](#row-appearance) |
|
|
1257
1257
|
| `loading` | `boolean` | — | Shows placeholder rows instead of the rows.<br>Shown in: [Rows from a request (Filter)](#filter), [Show loading, empty, failed and no match (Row appearance)](#row-appearance), [Load pages from a server (Server mode)](#server-mode) |
|
|
1258
1258
|
| `rowProps` | `(row: Z) => ``RowAttributes` | — | Classes and data attributes per row.<br>Shown in: [Mark rows by their state (Row appearance)](#row-appearance) |
|
|
@@ -1262,7 +1262,7 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
|
|
|
1262
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 7 more |
|
|
1263
1263
|
| `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
1264
|
| `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
|
|
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 132 more |
|
|
1266
1266
|
| `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
1267
|
|
|
1268
1268
|
###### Events
|
|
@@ -1280,13 +1280,13 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1280
1280
|
|
|
1281
1281
|
| Prop | Type | Default | Description |
|
|
1282
1282
|
|---|---|---|---|
|
|
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
|
|
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 132 more |
|
|
1284
1284
|
| `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
1285
|
| `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
1286
|
| `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
1287
|
| `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
1288
|
| `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), [Fold groups into a summary (Grouping)](#grouping-1), [Show loading, empty, failed and no match (Row appearance)](#row-appearance) and
|
|
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), [Fold groups into a summary (Grouping)](#grouping-1), [Show loading, empty, failed and no match (Row appearance)](#row-appearance) and 3 more |
|
|
1290
1290
|
| `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
1291
|
| `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) |
|
|
1292
1292
|
|
|
@@ -1294,7 +1294,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1294
1294
|
|
|
1295
1295
|
| Prop | Type | Default | Description |
|
|
1296
1296
|
|---|---|---|---|
|
|
1297
|
-
| `onViewChange` | `(view: ``TableView``) => void` | — | Every change the reader makes, once, always the whole view - the one to keep, or to hand another table's `setView`. Not called for the view the table starts with, nor for one `setView` applies.<br>Shown in: [Keep and restore a view (View)](#view) |
|
|
1297
|
+
| `onViewChange` | `(view: ``TableView``) => void` | — | Every change the reader makes, once, always the whole view - the one to keep, or to hand another table's `setView`. Not called for the view the table starts with, nor for one `setView` applies.<br>Shown in: [Keep and restore a view (View)](#view), [Keep the view in the URL (View)](#view) |
|
|
1298
1298
|
|
|
1299
1299
|
##### `TableSnapshot<Z>`
|
|
1300
1300
|
|
|
@@ -1328,7 +1328,7 @@ Also takes every attribute of `<div>` – without `children`.
|
|
|
1328
1328
|
| `selection` *required* | `TableSelection``<string>` | — | The selection – its own or the one handed in through `selection`.<br>Shown in: [Select rows (Selection)](#selection), [Copy the selection (Export)](#export), [Scroll twenty thousand rows (Virtualisation)](#virtualisation) and 3 more |
|
|
1329
1329
|
| `grouping` *required* | `readonly string[]` | — | The ids the table is grouped by, the outermost first – only those a groupable column or a group key carries, at most three.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
1330
1330
|
| `setGrouping` *required* | `(grouping: readonly string[]) => void` | — | Groups by these columns or group keys; `[]` ungroups. Back to page one.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
1331
|
-
| `setView` *required* | `(view: ``TableView``) => void` | — | Goes to a whole view; what it leaves out goes back to where the table starts, and names no column carries fall out. Not reported through `onViewChange`: two tables kept in step by `onViewChange: (v) => other.setView(v)` in both directions do not answer each other. A view with the content already shown changes nothing.<br>Shown in: [Keep and restore a view (View)](#view) |
|
|
1331
|
+
| `setView` *required* | `(view: ``TableView``) => void` | — | Goes to a whole view; what it leaves out goes back to where the table starts, and names no column carries fall out. Not reported through `onViewChange`: two tables kept in step by `onViewChange: (v) => other.setView(v)` in both directions do not answer each other. A view with the content already shown changes nothing.<br>Shown in: [Keep and restore a view (View)](#view), [Keep the view in the URL (View)](#view) |
|
|
1332
1332
|
| `folded` *required* | `readonly string[]` | — | The paths of the folded groups that still occur.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
1333
1333
|
| `toggleFold` *required* | `(path: string) => void` | — | Folds a group or unfolds it. A group of one row does not fold.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
1334
1334
|
| `foldAll` *required* | `() => void` | — | Folds every group that has more than one row.<br>Shown in: [Fold groups into a summary (Grouping)](#grouping-1) |
|
|
@@ -1425,7 +1425,7 @@ the application.
|
|
|
1425
1425
|
| Prop | Type | Default | Description |
|
|
1426
1426
|
|---|---|---|---|
|
|
1427
1427
|
| `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), [A dispatcher's bar (Toolbar controls)](#toolbar-controls), [
|
|
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), [A dispatcher's bar (Toolbar controls)](#toolbar-controls), [Keep the view in the URL (View)](#view) and 8 more |
|
|
1429
1429
|
| `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
1430
|
| `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
1431
|
| `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 |
|
|
@@ -1448,6 +1448,7 @@ selection.
|
|
|
1448
1448
|
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#work-through-the-alerts) |
|
|
1449
1449
|
| `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#selection), [Hold the selection yourself (Selection)](#selection) |
|
|
1450
1450
|
| `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#selection) |
|
|
1451
|
+
| `set` *required* | `(ids: readonly T[], selected: boolean) => void` | — | Gives every key in `ids` the state `selected`, in one update; keys outside `ids` stay as they are. While `allMatching` it moves the keys in or out of `except` instead. The table calls it for a range of rows. |
|
|
1451
1452
|
| `toggleAll` *required* | `() => void` | — | Selects all the keys passed in - or, when all of them are selected already, deselects them. Keys outside them stay as they are. |
|
|
1452
1453
|
| `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#selection), [Work through the alerts (Scenarios)](#work-through-the-alerts), [Find a late shipment (Scenarios)](#find-a-late-shipment) |
|
|
1453
1454
|
| `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
|
|
@@ -1556,10 +1557,10 @@ type Absent = null | undefined;
|
|
|
1556
1557
|
|
|
1557
1558
|
#### Known limits
|
|
1558
1559
|
|
|
1559
|
-
- 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.
|
|
1560
|
-
- 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.
|
|
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.47.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
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.47.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
1561
1562
|
|
|
1562
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
1563
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
1563
1564
|
|
|
1564
1565
|
### Provider
|
|
1565
1566
|
|
|
@@ -1662,7 +1663,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
1662
1663
|
| Prop | Type | Default | Description |
|
|
1663
1664
|
|---|---|---|---|
|
|
1664
1665
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
1665
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
1666
|
+
| [`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. |
|
|
1666
1667
|
|
|
1667
1668
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
1668
1669
|
|
|
@@ -1871,15 +1872,15 @@ The `label` is the column header's text, and so what a screen reader says for ev
|
|
|
1871
1872
|
|
|
1872
1873
|
| Prop | Type | Default | Description |
|
|
1873
1874
|
|---|---|---|---|
|
|
1874
|
-
| `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
|
|
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 132 more |
|
|
1875
1876
|
| `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) |
|
|
1876
|
-
| `format` | `FormatFor``<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
1877
|
-
| `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
|
|
1877
|
+
| `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 12 more |
|
|
1878
1879
|
| `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) |
|
|
1879
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 6 more |
|
|
1880
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 1 more |
|
|
1881
1882
|
| `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 |
|
|
1882
|
-
| `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
|
|
1883
|
+
| `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 |
|
|
1883
1884
|
|
|
1884
1885
|
Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
|
|
1885
1886
|
|
|
@@ -1887,10 +1888,10 @@ Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
|
|
|
1887
1888
|
|
|
1888
1889
|
| Prop | Type | Default | Description |
|
|
1889
1890
|
|---|---|---|---|
|
|
1890
|
-
| `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
|
|
1891
|
-
| `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
|
|
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 132 more |
|
|
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 131 more |
|
|
1892
1893
|
| `numeric` | `boolean` | decided by the first value present | Right-aligned with tabular figures.<br>Shown in: [Share a column between tables (Presets)](#presets) |
|
|
1893
|
-
| `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Fit long values (Formats)](#formats), [Fit what does not fit (Formats)](#formats), [
|
|
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 17 more |
|
|
1894
1895
|
| `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), [Share a column between tables (Presets)](#presets) and 1 more |
|
|
1895
1896
|
| `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 |
|
|
1896
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 9 more |
|
|
@@ -2000,10 +2001,17 @@ type NumberFormat = "percent" | "count" | NumberOptions;
|
|
|
2000
2001
|
|
|
2001
2002
|
###### `DateFormat`
|
|
2002
2003
|
|
|
2003
|
-
The names of the standard presentations of a point in time
|
|
2004
|
+
The names of the standard presentations of a point in time, with the English
|
|
2005
|
+
text of 17 March 2026 at 09:05:03 for each:
|
|
2006
|
+
- `"date"`: "17/03/2026"
|
|
2007
|
+
- `"time"`: "09:05"
|
|
2008
|
+
- `"dateTime"`: "17/03/2026, 09:05"
|
|
2009
|
+
- `"timeWithSeconds"`: "09:05:03"
|
|
2010
|
+
- `"dateTimeWithSeconds"`: "17/03/2026, 09:05:03"
|
|
2011
|
+
German formats write the same with "17.03.2026".
|
|
2004
2012
|
|
|
2005
2013
|
```ts
|
|
2006
|
-
type DateFormat =
|
|
2014
|
+
type DateFormat = (typeof DATE_FORMATS)[number];
|
|
2007
2015
|
```
|
|
2008
2016
|
|
|
2009
2017
|
###### `IsDisplayable<W>`
|
|
@@ -2098,9 +2106,9 @@ interface Service {
|
|
|
2098
2106
|
}
|
|
2099
2107
|
|
|
2100
2108
|
const SERVICES: Service[] = [
|
|
2101
|
-
{ name: "Checkout", availability: 0.99921, requests: 1_284_310, p95: 412.37, since: 2019, monthly: 18400.5, deployed: new Date(2026, 2, 17, 9, 5) },
|
|
2102
|
-
{ name: "Billing", availability: 0.99958, requests: 402_118, p95: 238.9, since: 2021, monthly: 9250, deployed: new Date(2026, 2, 16, 16, 40) },
|
|
2103
|
-
{ name: "Search", availability: 0.99803, requests: 2_910_455, p95: 186.02, since: 2024, monthly: 31200.75, deployed: new Date(2026, 2, 12, 11, 15) },
|
|
2109
|
+
{ name: "Checkout", availability: 0.99921, requests: 1_284_310, p95: 412.37, since: 2019, monthly: 18400.5, deployed: new Date(2026, 2, 17, 9, 5, 3) },
|
|
2110
|
+
{ name: "Billing", availability: 0.99958, requests: 402_118, p95: 238.9, since: 2021, monthly: 9250, deployed: new Date(2026, 2, 16, 16, 40, 27) },
|
|
2111
|
+
{ name: "Search", availability: 0.99803, requests: 2_910_455, p95: 186.02, since: 2024, monthly: 31200.75, deployed: new Date(2026, 2, 12, 11, 15, 48) },
|
|
2104
2112
|
];
|
|
2105
2113
|
|
|
2106
2114
|
export default function Format() {
|
|
@@ -2117,6 +2125,8 @@ export default function Format() {
|
|
|
2117
2125
|
<Column value="deployed" label="Deployed" format="date" />
|
|
2118
2126
|
{/* A second column over the same field names its own id. */}
|
|
2119
2127
|
<Column id="deployedAt" value="deployed" label="At" format="time" />
|
|
2128
|
+
{/* The two names with seconds: the seconds are shown, the export keeps the timestamp. */}
|
|
2129
|
+
<Column id="deployedSeconds" value="deployed" label="Deployed, to the second" format="dateTimeWithSeconds" />
|
|
2120
2130
|
</Table>
|
|
2121
2131
|
);
|
|
2122
2132
|
}
|
|
@@ -2318,7 +2328,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
2318
2328
|
|---|---|---|---|
|
|
2319
2329
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
2320
2330
|
| [`id`](#column) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
|
|
2321
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
2331
|
+
| [`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. |
|
|
2322
2332
|
| [`children`](#column) | [`Presentation`](#column)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
|
|
2323
2333
|
|
|
2324
2334
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
@@ -2336,6 +2346,136 @@ From `AggregateOptions` — the full table stands on [Aggregate](#aggregate).
|
|
|
2336
2346
|
|---|---|---|---|
|
|
2337
2347
|
| [`aggregate`](#aggregate) | [`AggregateFor`](#aggregate)`<W, Z>` | — | What the column's values come to: in the footer over the filtered set, in a group's header over its rows. `"sum"`, `"avg"` for numbers; `"min"`, `"max"` for numbers and points in time; `"range"` for points in time; `"count"`, `"distinct"` for every value with a text form - or a function of one's own. Always from the values, never from other aggregates; absent values count towards nothing. |
|
|
2338
2348
|
|
|
2349
|
+
### Conditional formatting
|
|
2350
|
+
|
|
2351
|
+
A cell drawn by its value: a bar, a colour scale, an icon or a verdict against a limit, each made of the library's components. Reach for it when a value should stand out by its size or by where it sits against a limit.
|
|
2352
|
+
|
|
2353
|
+
```ts
|
|
2354
|
+
import { useTable } from "@umriss-ui/table";
|
|
2355
|
+
```
|
|
2356
|
+
|
|
2357
|
+
A rule set would be a second way to present a cell beside `children` ([ADR-0017](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0017-columns-are-declared-by-composition.md)), so a presentation is written in its column, where the value and its row arrive typed. A class hook is not offered either: colours come from the tokens ([ADR-0045](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0045-tokens-are-the-styling-api-data-attributes-are-not.md)), and a `color-mix` over them gives a scale.
|
|
2358
|
+
|
|
2359
|
+
The colour is never the only sign. Each column says the value as well, in a word or a number, so a reader who cannot tell the colours apart reads the same thing.
|
|
2360
|
+
|
|
2361
|
+
#### Examples
|
|
2362
|
+
|
|
2363
|
+
##### A bar, a scale, an icon and a limit
|
|
2364
|
+
|
|
2365
|
+
Four presentations of a cell, each in `children` beside the value: a bar, a colour scale, a badge and a verdict. Each one also says the value in a word or a number, so the colour is never the only sign.
|
|
2366
|
+
|
|
2367
|
+
```tsx
|
|
2368
|
+
import { Badge, CrossGlyph, Meter, Text } from "@umriss-ui/core";
|
|
2369
|
+
import type { LimitSet } from "@umriss-ui/core";
|
|
2370
|
+
import { useTable } from "@umriss-ui/table";
|
|
2371
|
+
|
|
2372
|
+
interface Service {
|
|
2373
|
+
name: string;
|
|
2374
|
+
utilisation: number;
|
|
2375
|
+
errorRate: number;
|
|
2376
|
+
state: "Healthy" | "Down";
|
|
2377
|
+
p95: number;
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
const SERVICES: Service[] = [
|
|
2381
|
+
{ name: "Checkout", utilisation: 0.86, errorRate: 0.012, state: "Healthy", p95: 271 },
|
|
2382
|
+
{ name: "Billing", utilisation: 0.34, errorRate: 0.001, state: "Healthy", p95: 118 },
|
|
2383
|
+
{ name: "Webhooks", utilisation: 0.58, errorRate: 0.046, state: "Down", p95: 346 },
|
|
2384
|
+
{ name: "Search", utilisation: 0.91, errorRate: 0.004, state: "Healthy", p95: 205 },
|
|
2385
|
+
];
|
|
2386
|
+
|
|
2387
|
+
const OBJECTIVE: LimitSet = {
|
|
2388
|
+
limits: [
|
|
2389
|
+
{ value: 250, side: "upper", severity: "warning" },
|
|
2390
|
+
{ value: 300, side: "upper", severity: "alarm" },
|
|
2391
|
+
],
|
|
2392
|
+
};
|
|
2393
|
+
|
|
2394
|
+
/* The colour mixes the danger token into the surface: a higher rate, a
|
|
2395
|
+
stronger tone, capped so the figure stays legible on it. */
|
|
2396
|
+
const scale = (rate: number) => `color-mix(in srgb, var(--u-color-danger) ${Math.min(40, rate * 800)}%, var(--u-color-surface))`;
|
|
2397
|
+
|
|
2398
|
+
export default function ConditionalFormatting() {
|
|
2399
|
+
const { Table, Column, VerdictColumn } = useTable(SERVICES, { rowKey: (s) => s.name });
|
|
2400
|
+
|
|
2401
|
+
return (
|
|
2402
|
+
<Table aria-label="Services with their utilisation, error rate, state and latency">
|
|
2403
|
+
<Column value="name" label="Service" rowHeader />
|
|
2404
|
+
<Column value="utilisation" label="Utilisation" width={180}>
|
|
2405
|
+
{(share, service) => (
|
|
2406
|
+
<Meter value={share} tone={share > 0.8 ? "warning" : "accent"} label={`Utilisation, ${service.name}`} />
|
|
2407
|
+
)}
|
|
2408
|
+
</Column>
|
|
2409
|
+
<Column value="errorRate" label="Error rate" width={120}>
|
|
2410
|
+
{(rate) => (
|
|
2411
|
+
<span style={{ display: "inline-block", padding: "0 6px", background: scale(rate) }}>
|
|
2412
|
+
<Text as="span" mono>{`${(rate * 100).toFixed(1)} %`}</Text>
|
|
2413
|
+
</span>
|
|
2414
|
+
)}
|
|
2415
|
+
</Column>
|
|
2416
|
+
<Column value="state" label="State" width={120}>
|
|
2417
|
+
{(state) => (
|
|
2418
|
+
<Badge tone={state === "Down" ? "danger" : "success"}>
|
|
2419
|
+
{state === "Down" && <CrossGlyph size={10} />} {state}
|
|
2420
|
+
</Badge>
|
|
2421
|
+
)}
|
|
2422
|
+
</Column>
|
|
2423
|
+
<VerdictColumn value="p95" label="p95 latency (ms)" limits={OBJECTIVE} />
|
|
2424
|
+
</Table>
|
|
2425
|
+
);
|
|
2426
|
+
}
|
|
2427
|
+
```
|
|
2428
|
+
|
|
2429
|
+
#### When to use something else
|
|
2430
|
+
|
|
2431
|
+
- A measured value read against its limits, as ok, warning or alarm → VerdictColumn
|
|
2432
|
+
|
|
2433
|
+
#### Keyboard
|
|
2434
|
+
|
|
2435
|
+
The keys of [First table](#first-table) apply here.
|
|
2436
|
+
|
|
2437
|
+
#### Accessibility
|
|
2438
|
+
|
|
2439
|
+
A `Meter` in a cell is a `meter` with its value and the `label` it was given, “Utilisation, Checkout” for one, so a screen reader says what the bar measures and how much, row by row. Give each its own label: a bar named only by its column says the same words in every row.
|
|
2440
|
+
|
|
2441
|
+
The colour is never the only sign: the bar, the icon or the verdict stands beside the value as a number or a word, so the cell reads the same to a reader who cannot see the colours.
|
|
2442
|
+
|
|
2443
|
+
#### Props on this page
|
|
2444
|
+
|
|
2445
|
+
From `TableProps` — the full table stands on [First table](#first-table).
|
|
2446
|
+
|
|
2447
|
+
| Prop | Type | Default | Description |
|
|
2448
|
+
|---|---|---|---|
|
|
2449
|
+
| [`children`](#first-table) | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts. |
|
|
2450
|
+
|
|
2451
|
+
From `TableOptions` — the full table stands on [First table](#first-table).
|
|
2452
|
+
|
|
2453
|
+
| Prop | Type | Default | Description |
|
|
2454
|
+
|---|---|---|---|
|
|
2455
|
+
| [`rowKey`](#first-table) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
|
|
2456
|
+
|
|
2457
|
+
From `FieldColumn` — the full table stands on [Column](#column).
|
|
2458
|
+
|
|
2459
|
+
| Prop | Type | Default | Description |
|
|
2460
|
+
|---|---|---|---|
|
|
2461
|
+
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
2462
|
+
| [`children`](#column) | [`Presentation`](#column)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
|
|
2463
|
+
|
|
2464
|
+
From `ColumnBase` — the full table stands on [Column](#column).
|
|
2465
|
+
|
|
2466
|
+
| Prop | Type | Default | Description |
|
|
2467
|
+
|---|---|---|---|
|
|
2468
|
+
| [`label`](#column) *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export. |
|
|
2469
|
+
| [`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. |
|
|
2470
|
+
| [`width`](#column) | `number` | the browser's | Initial width in pixels. |
|
|
2471
|
+
|
|
2472
|
+
From `VerdictBase` — the full table stands on [VerdictColumn](#verdictcolumn).
|
|
2473
|
+
|
|
2474
|
+
| Prop | Type | Default | Description |
|
|
2475
|
+
|---|---|---|---|
|
|
2476
|
+
| [`label`](#verdictcolumn) *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export. |
|
|
2477
|
+
| [`limits`](#verdictcolumn) *required* | [`LimitSet`](#verdictcolumn) | — | The limit set every value is read against. |
|
|
2478
|
+
|
|
2339
2479
|
### Width and pinning
|
|
2340
2480
|
|
|
2341
2481
|
How wide a column stands, which columns stay in view while the table scrolls sideways (frozen or sticky columns), and a header that stays while it scrolls down.
|
|
@@ -2533,6 +2673,91 @@ export default function StickyParts() {
|
|
|
2533
2673
|
}
|
|
2534
2674
|
```
|
|
2535
2675
|
|
|
2676
|
+
##### A head below an app bar
|
|
2677
|
+
|
|
2678
|
+
Make the main area below the bar the table's frame, a parent of definite height, or give the table `maxHeight="calc(100dvh - 64px)"`. No offset can help: the head sticks in the table's own scroll area, which carries the horizontal scroll, the pinned blocks and the virtual window.
|
|
2679
|
+
|
|
2680
|
+
```tsx
|
|
2681
|
+
import { Text } from "@umriss-ui/core";
|
|
2682
|
+
import { useTable } from "@umriss-ui/table";
|
|
2683
|
+
|
|
2684
|
+
/* The bar is the pane's first row; the main area takes the rest, and the
|
|
2685
|
+
table fills it. The table's own scroll area is then the pane's, so the
|
|
2686
|
+
head sticks to the top of the main area and not to the page. */
|
|
2687
|
+
const STYLE = `
|
|
2688
|
+
.app-pane {
|
|
2689
|
+
display: flex;
|
|
2690
|
+
flex-direction: column;
|
|
2691
|
+
height: 320px;
|
|
2692
|
+
}
|
|
2693
|
+
.app-bar {
|
|
2694
|
+
flex: none;
|
|
2695
|
+
display: flex;
|
|
2696
|
+
align-items: center;
|
|
2697
|
+
height: 48px;
|
|
2698
|
+
padding: 0 16px;
|
|
2699
|
+
background: var(--u-color-surface);
|
|
2700
|
+
}
|
|
2701
|
+
.app-main {
|
|
2702
|
+
flex: 1;
|
|
2703
|
+
min-height: 0;
|
|
2704
|
+
display: flex;
|
|
2705
|
+
flex-direction: column;
|
|
2706
|
+
}
|
|
2707
|
+
.app-table {
|
|
2708
|
+
flex: 1;
|
|
2709
|
+
min-height: 0;
|
|
2710
|
+
max-height: 100%;
|
|
2711
|
+
}
|
|
2712
|
+
`;
|
|
2713
|
+
|
|
2714
|
+
const DEPLOYS = [
|
|
2715
|
+
["Checkout", "2.14.0", "Healthy"],
|
|
2716
|
+
["Billing", "1.9.3", "Healthy"],
|
|
2717
|
+
["Webhooks", "3.0.1", "Degraded"],
|
|
2718
|
+
["Search", "5.2.0", "Healthy"],
|
|
2719
|
+
["Catalogue", "4.7.2", "Healthy"],
|
|
2720
|
+
["Accounts", "2.0.8", "Down"],
|
|
2721
|
+
["Notifications", "1.4.0", "Healthy"],
|
|
2722
|
+
["Reports", "0.9.6", "Degraded"],
|
|
2723
|
+
["Exports", "1.1.2", "Healthy"],
|
|
2724
|
+
["Uploads", "2.6.5", "Healthy"],
|
|
2725
|
+
["Pricing", "3.3.0", "Healthy"],
|
|
2726
|
+
["Shipping", "1.8.1", "Healthy"],
|
|
2727
|
+
].map(([service, version, state], i) => ({
|
|
2728
|
+
id: `d${i + 1}`,
|
|
2729
|
+
service: service!,
|
|
2730
|
+
version: version!,
|
|
2731
|
+
state: state!,
|
|
2732
|
+
instances: 2 + (i % 4),
|
|
2733
|
+
}));
|
|
2734
|
+
|
|
2735
|
+
export default function AppBarHead() {
|
|
2736
|
+
const { Table, Column } = useTable(DEPLOYS, { rowKey: (d) => d.id });
|
|
2737
|
+
|
|
2738
|
+
return (
|
|
2739
|
+
<>
|
|
2740
|
+
<style>{STYLE}</style>
|
|
2741
|
+
<div className="app-pane">
|
|
2742
|
+
<div className="app-bar">
|
|
2743
|
+
<Text as="span" weight="semibold">
|
|
2744
|
+
Deployments
|
|
2745
|
+
</Text>
|
|
2746
|
+
</div>
|
|
2747
|
+
<div className="app-main">
|
|
2748
|
+
<Table className="app-table" stickyHeader maxHeight="100%" aria-label="Deployments per service">
|
|
2749
|
+
<Column value="service" label="Service" rowHeader width={160} />
|
|
2750
|
+
<Column value="version" label="Version" width={96} />
|
|
2751
|
+
<Column value="state" label="State" width={120} />
|
|
2752
|
+
<Column value="instances" label="Instances" width={96} />
|
|
2753
|
+
</Table>
|
|
2754
|
+
</div>
|
|
2755
|
+
</div>
|
|
2756
|
+
</>
|
|
2757
|
+
);
|
|
2758
|
+
}
|
|
2759
|
+
```
|
|
2760
|
+
|
|
2536
2761
|
##### Pin and size from controls of your own
|
|
2537
2762
|
|
|
2538
2763
|
`t.setPin` pins a column or, with `null`, unpins it; `t.setWidth` sets a width and `undefined` takes it back. `t.pinned` and `t.widths` say how the columns stand, a dragged grip included.
|
|
@@ -2868,7 +3093,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
2868
3093
|
|---|---|---|---|
|
|
2869
3094
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
2870
3095
|
| [`id`](#column) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
|
|
2871
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
3096
|
+
| [`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. |
|
|
2872
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. |
|
|
2873
3098
|
| [`group`](#column) | [`GroupFor`](#column)`<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`. |
|
|
2874
3099
|
| [`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`. |
|
|
@@ -2903,6 +3128,7 @@ From `AggregateOptions` — the full table stands on [Aggregate](#aggregate).
|
|
|
2903
3128
|
| Prop | Type | Default | Description |
|
|
2904
3129
|
|---|---|---|---|
|
|
2905
3130
|
| [`aggregate`](#aggregate) | [`AggregateFor`](#aggregate)`<W, Z>` | — | What the column's values come to: in the footer over the filtered set, in a group's header over its rows. `"sum"`, `"avg"` for numbers; `"min"`, `"max"` for numbers and points in time; `"range"` for points in time; `"count"`, `"distinct"` for every value with a text form - or a function of one's own. Always from the values, never from other aggregates; absent values count towards nothing. |
|
|
3131
|
+
| [`aggregateLabel`](#aggregate) | `string` | — | The word for an `aggregate` function of one's own: it stands before the value in the footer and is what a screen reader reads. A group header shows no word. A built-in kind keeps its own word, the wording's; a name beside it is ignored. |
|
|
2906
3132
|
| [`share`](#aggregate) | `boolean` | — | The share bar in a group's header – the group's share of the filtered set's sum. It stands under the first column with a sum, one per header; `false` passes it on to the next. |
|
|
2907
3133
|
|
|
2908
3134
|
## Finding rows
|
|
@@ -3040,7 +3266,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
3040
3266
|
| Prop | Type | Default | Description |
|
|
3041
3267
|
|---|---|---|---|
|
|
3042
3268
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
3043
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
3269
|
+
| [`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. |
|
|
3044
3270
|
| [`children`](#column) | [`Presentation`](#column)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
|
|
3045
3271
|
|
|
3046
3272
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
@@ -3075,7 +3301,7 @@ From `ExportProps` — the full table stands on [Export](#export).
|
|
|
3075
3301
|
|
|
3076
3302
|
- In [server mode](#server-mode) the table sorts nothing itself; the sort goes to the server in the request.
|
|
3077
3303
|
|
|
3078
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
3304
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3079
3305
|
|
|
3080
3306
|
### Search
|
|
3081
3307
|
|
|
@@ -3299,7 +3525,7 @@ type TableRef = Omit<TableSnapshot<unknown>, "setFilter" | "conditionOf"> & {
|
|
|
3299
3525
|
|
|
3300
3526
|
- In [server mode](#server-mode) the table searches nothing itself; the term goes to the server in the request.
|
|
3301
3527
|
|
|
3302
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
3528
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
3303
3529
|
|
|
3304
3530
|
### Filter
|
|
3305
3531
|
|
|
@@ -4326,7 +4552,7 @@ type Absent = null | undefined;
|
|
|
4326
4552
|
- No text filter per column: the search covers text.
|
|
4327
4553
|
- In [server mode](#server-mode) a list filter offers what the application names; the table cannot count values it does not hold.
|
|
4328
4554
|
|
|
4329
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
4555
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
4330
4556
|
|
|
4331
4557
|
### Pre-filter
|
|
4332
4558
|
|
|
@@ -5608,11 +5834,11 @@ export default function GroupAndFoldFromControls() {
|
|
|
5608
5834
|
|
|
5609
5835
|
#### Known limits
|
|
5610
5836
|
|
|
5611
|
-
- No pivot and no more than three levels ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
5837
|
+
- No pivot and no more than three levels ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
5612
5838
|
- No bar to drag headers onto: grouping is chosen in the column menu.
|
|
5613
5839
|
- No groups in [server mode](#server-mode): they would be made of one page.
|
|
5614
5840
|
|
|
5615
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
5841
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
5616
5842
|
|
|
5617
5843
|
### Tree rows
|
|
5618
5844
|
|
|
@@ -6210,7 +6436,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
6210
6436
|
- Not in [server mode](#server-mode), and no branches loaded on demand yet.
|
|
6211
6437
|
- One column set for every level; a level without a value shows it as absent.
|
|
6212
6438
|
|
|
6213
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
6439
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6214
6440
|
|
|
6215
6441
|
### Aggregate
|
|
6216
6442
|
|
|
@@ -6222,7 +6448,7 @@ import { useTable } from "@umriss-ui/table";
|
|
|
6222
6448
|
|
|
6223
6449
|
An aggregate is always computed from rows: a group's average is over its rows, not over the averages of the groups inside it. Absent values do not count.
|
|
6224
6450
|
|
|
6225
|
-
A rate or a weighted average is the application's to say, with an aggregate of its own.
|
|
6451
|
+
A rate or a weighted average is the application's to say, with an aggregate of its own; `aggregateLabel` names that function in the footer, while a built-in kind keeps its own word.
|
|
6226
6452
|
|
|
6227
6453
|
#### Examples
|
|
6228
6454
|
|
|
@@ -6558,7 +6784,7 @@ export default function WorstVerdict() {
|
|
|
6558
6784
|
<Column value="zone" label="Zone" />
|
|
6559
6785
|
<Column value="kiln" label="Kiln" />
|
|
6560
6786
|
<Column value="at" label="Hour" rowHeader />
|
|
6561
|
-
<VerdictColumn value="temperature" label="Temperature (°C)" limits={KILN_LIMITS} format={{ decimals: 1 }} aggregate="worst" />
|
|
6787
|
+
<VerdictColumn value="temperature" label="Temperature (°C)" limits={KILN_LIMITS} format={{ decimals: 1 }} aggregate="worst" aggregateLabel="Worst reading" />
|
|
6562
6788
|
</Table>
|
|
6563
6789
|
);
|
|
6564
6790
|
}
|
|
@@ -6620,6 +6846,52 @@ export default function MatrixWithTotals() {
|
|
|
6620
6846
|
}
|
|
6621
6847
|
```
|
|
6622
6848
|
|
|
6849
|
+
##### Name your own aggregate
|
|
6850
|
+
|
|
6851
|
+
A median and a standard deviation are not built in: a function is shorter than two wordings, a sign and their tests. `aggregateLabel` gives each function its word in the footer, where a screen reader reads it too.
|
|
6852
|
+
|
|
6853
|
+
```tsx
|
|
6854
|
+
import { useTable } from "@umriss-ui/table";
|
|
6855
|
+
|
|
6856
|
+
interface Run {
|
|
6857
|
+
id: string;
|
|
6858
|
+
cycleSeconds: number;
|
|
6859
|
+
scrapPercent: number;
|
|
6860
|
+
}
|
|
6861
|
+
|
|
6862
|
+
const RUNS: Run[] = [
|
|
6863
|
+
{ id: "Run 1", cycleSeconds: 41, scrapPercent: 2 },
|
|
6864
|
+
{ id: "Run 2", cycleSeconds: 38, scrapPercent: 3 },
|
|
6865
|
+
{ id: "Run 3", cycleSeconds: 44, scrapPercent: 4 },
|
|
6866
|
+
{ id: "Run 4", cycleSeconds: 40, scrapPercent: 5 },
|
|
6867
|
+
{ id: "Run 5", cycleSeconds: 47, scrapPercent: 6 },
|
|
6868
|
+
{ id: "Run 6", cycleSeconds: 43, scrapPercent: 4 },
|
|
6869
|
+
];
|
|
6870
|
+
|
|
6871
|
+
const median = (values: readonly number[]) => {
|
|
6872
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
6873
|
+
const mid = sorted.length >> 1;
|
|
6874
|
+
return sorted.length % 2 ? sorted[mid] : (sorted[mid - 1]! + sorted[mid]!) / 2;
|
|
6875
|
+
};
|
|
6876
|
+
|
|
6877
|
+
const deviation = (values: readonly number[]) => {
|
|
6878
|
+
if (values.length < 2) return undefined;
|
|
6879
|
+
const mean = values.reduce((s, v) => s + v, 0) / values.length;
|
|
6880
|
+
return Math.sqrt(values.reduce((s, v) => s + (v - mean) ** 2, 0) / (values.length - 1));
|
|
6881
|
+
};
|
|
6882
|
+
|
|
6883
|
+
export default function NameYourOwnAggregate() {
|
|
6884
|
+
const { Table, Column } = useTable(RUNS, { rowKey: (r) => r.id });
|
|
6885
|
+
return (
|
|
6886
|
+
<Table aria-label="Runs of one line">
|
|
6887
|
+
<Column value="id" label="Run" rowHeader />
|
|
6888
|
+
<Column value="cycleSeconds" label="Cycle time (s)" aggregate={median} aggregateLabel="Median" />
|
|
6889
|
+
<Column value="scrapPercent" label="Scrap (%)" format={{ decimals: 2 }} aggregate={deviation} aggregateLabel="Std. deviation" />
|
|
6890
|
+
</Table>
|
|
6891
|
+
);
|
|
6892
|
+
}
|
|
6893
|
+
```
|
|
6894
|
+
|
|
6623
6895
|
#### When to use something else
|
|
6624
6896
|
|
|
6625
6897
|
- A key figure outside the table → `Stat` from @umriss-ui/core
|
|
@@ -6634,7 +6906,8 @@ The keys of [First table](#first-table) and Input apply here.
|
|
|
6634
6906
|
|
|
6635
6907
|
| Prop | Type | Default | Description |
|
|
6636
6908
|
|---|---|---|---|
|
|
6637
|
-
| `aggregate` | `AggregateFor``<W, Z>` | — | What the column's values come to: in the footer over the filtered set, in a group's header over its rows. `"sum"`, `"avg"` for numbers; `"min"`, `"max"` for numbers and points in time; `"range"` for points in time; `"count"`, `"distinct"` for every value with a text form - or a function of one's own. Always from the values, never from other aggregates; absent values count towards nothing.<br>Shown in: [Total a column](#aggregate), [Find the extremes](#aggregate), [Show a range of dates](#aggregate) and
|
|
6909
|
+
| `aggregate` | `AggregateFor``<W, Z>` | — | What the column's values come to: in the footer over the filtered set, in a group's header over its rows. `"sum"`, `"avg"` for numbers; `"min"`, `"max"` for numbers and points in time; `"range"` for points in time; `"count"`, `"distinct"` for every value with a text form - or a function of one's own. Always from the values, never from other aggregates; absent values count towards nothing.<br>Shown in: [Total a column](#aggregate), [Find the extremes](#aggregate), [Show a range of dates](#aggregate) and 37 more |
|
|
6910
|
+
| `aggregateLabel` | `string` | — | The word for an `aggregate` function of one's own: it stands before the value in the footer and is what a screen reader reads. A group header shows no word. A built-in kind keeps its own word, the wording's; a name beside it is ignored.<br>Shown in: [Name your own aggregate](#aggregate), [Share a column between tables (Presets)](#presets) |
|
|
6638
6911
|
| `share` | `boolean` | — | The share bar in a group's header – the group's share of the filtered set's sum. It stands under the first column with a sum, one per header; `false` passes it on to the next.<br>Shown in: [Show each group's share](#aggregate), [Weight a rate by its rows](#aggregate), [Share a column between tables (Presets)](#presets) and 2 more |
|
|
6639
6912
|
|
|
6640
6913
|
##### Types on this page
|
|
@@ -6705,7 +6978,7 @@ type Displayable = string | number | boolean | Date;
|
|
|
6705
6978
|
|
|
6706
6979
|
- 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.
|
|
6707
6980
|
|
|
6708
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
6981
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6709
6982
|
|
|
6710
6983
|
## Rows
|
|
6711
6984
|
|
|
@@ -6725,7 +6998,7 @@ import { useTable } from "@umriss-ui/table";
|
|
|
6725
6998
|
|
|
6726
6999
|
##### Select rows
|
|
6727
7000
|
|
|
6728
|
-
`selectable` adds the selection column; “select all” takes what the search leaves. Search “Oak”, select all, clear the search.
|
|
7001
|
+
`selectable` adds the selection column; “select all” takes what the search leaves. Search “Oak”, select all, clear the search. Shift-click or Shift+Space on a second box selects the rows between.
|
|
6729
7002
|
|
|
6730
7003
|
```tsx
|
|
6731
7004
|
import { Stack, Text } from "@umriss-ui/core";
|
|
@@ -6878,6 +7151,10 @@ export default function TheCurrentRow() {
|
|
|
6878
7151
|
|
|
6879
7152
|
#### Keyboard
|
|
6880
7153
|
|
|
7154
|
+
| Key | Action |
|
|
7155
|
+
|---|---|
|
|
7156
|
+
| `Shift + click, Shift + Space` | On a row's checkbox: ticks the rows from the one toggled last to this one, or clears them when this row is ticked. |
|
|
7157
|
+
|
|
6881
7158
|
The keys of [First table](#first-table), Checkbox and Input apply here.
|
|
6882
7159
|
|
|
6883
7160
|
#### Props on this page
|
|
@@ -6934,7 +7211,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
6934
7211
|
|
|
6935
7212
|
- 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.
|
|
6936
7213
|
|
|
6937
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
7214
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
6938
7215
|
|
|
6939
7216
|
### Row appearance
|
|
6940
7217
|
|
|
@@ -7185,7 +7462,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
7185
7462
|
| Prop | Type | Default | Description |
|
|
7186
7463
|
|---|---|---|---|
|
|
7187
7464
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
7188
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
7465
|
+
| [`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. |
|
|
7189
7466
|
|
|
7190
7467
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
7191
7468
|
|
|
@@ -8697,7 +8974,7 @@ A menu in which the user shows, hides, reorders and pins the table's columns and
|
|
|
8697
8974
|
import { ColumnMenu } from "@umriss-ui/table";
|
|
8698
8975
|
```
|
|
8699
8976
|
|
|
8700
|
-
Every change applies to header, body and footer together. The row header cannot be hidden. A column moves only within its block – pinned at the start, unpinned, pinned at the end – and after a move the focus stays on the button that was pressed.
|
|
8977
|
+
Every change applies to header, body and footer together. The row header cannot be hidden. A column moves only within its block – pinned at the start, unpinned, pinned at the end – and after a move the focus stays on the button that was pressed. With a mouse, a pen or a finger an entry is dragged by its grip at the start of its line; the move buttons are the keyboard's route.
|
|
8701
8978
|
|
|
8702
8979
|
Where the table can be grouped, the menu offers its groupable columns too, up to three levels ([Grouping](#grouping-1)).
|
|
8703
8980
|
|
|
@@ -8705,7 +8982,7 @@ Where the table can be grouped, the menu offers its groupable columns too, up to
|
|
|
8705
8982
|
|
|
8706
8983
|
##### Show, hide and arrange
|
|
8707
8984
|
|
|
8708
|
-
Put a `ColumnMenu` into the toolbar; hiding or moving a column changes header, body and footer together.
|
|
8985
|
+
Put a `ColumnMenu` into the toolbar; hiding or moving a column changes header, body and footer together. An entry is dragged by its grip; the move buttons are the keyboard's route.
|
|
8709
8986
|
|
|
8710
8987
|
```tsx
|
|
8711
8988
|
import { ColumnMenu, Toolbar, useTable } from "@umriss-ui/table";
|
|
@@ -8788,7 +9065,7 @@ export default function PinAColumn() {
|
|
|
8788
9065
|
|---|---|
|
|
8789
9066
|
| `Enter / Space` | On “Columns”: open or close the menu. Inside: tick a column, move it or pin it. |
|
|
8790
9067
|
| `Tab` | Move through the columns' boxes and buttons. |
|
|
8791
|
-
| `Escape` | Close the menu; the focus returns to “Columns”. |
|
|
9068
|
+
| `Escape` | Close the menu; the focus returns to “Columns”. While an entry is dragged, cancel the drag only. |
|
|
8792
9069
|
|
|
8793
9070
|
#### API
|
|
8794
9071
|
|
|
@@ -9309,6 +9586,7 @@ Everything the library puts out as text.
|
|
|
9309
9586
|
| `filterColumn` *required* | `(column: string) => string` | — | The filter button of a column: "Filter Region". |
|
|
9310
9587
|
| `filterHint` *required* | `string` | — | The tooltip over that button. |
|
|
9311
9588
|
| `selectRow` *required* | `(row: string) => string` | — | The selection of one row, named after its row header. |
|
|
9589
|
+
| `tableSelectedCount` *required* | `(count: number) => string` | — | Said after the user changes the selection of a table in grid mode: the count. |
|
|
9312
9590
|
| `selectAllRows` *required* | `string` | — | The selection of every row in the filtered set. |
|
|
9313
9591
|
| `selectAllOnPage` *required* | `string` | — | The same checkbox in server mode, where the table holds one page of a server's. |
|
|
9314
9592
|
| `expandRowNamed` *required* | `(row: string) => string` | — | The expand button, named after the row header. |
|
|
@@ -9439,7 +9717,18 @@ Everything the library puts out as text.
|
|
|
9439
9717
|
| `scheduleLaneCount` *required* | `(count: number) => string` | — | How many lanes a group holds, beside its name in the header. |
|
|
9440
9718
|
| `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
|
|
9441
9719
|
| `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
|
+
| `scheduleVisibleRange` *required* | `(from: string, to: string) => string` | — | The span in view, said after a zoom key. |
|
|
9442
9721
|
| `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
|
|
9722
|
+
| `scheduleShowData` *required* | `string` | — | The disclosure key of the plan's table. |
|
|
9723
|
+
| `scheduleHideData` *required* | `string` | — | |
|
|
9724
|
+
| `scheduleTableCaption` *required* | `(from: string, to: string) => string` | — | The open table's caption: the span it lists, both ends formatted. |
|
|
9725
|
+
| `scheduleColumnLane` *required* | `string` | — | The table's column heads. |
|
|
9726
|
+
| `scheduleColumnTask` *required* | `string` | — | |
|
|
9727
|
+
| `scheduleColumnSubtask` *required* | `string` | — | |
|
|
9728
|
+
| `scheduleColumnFrom` *required* | `string` | — | |
|
|
9729
|
+
| `scheduleColumnTo` *required* | `string` | — | |
|
|
9730
|
+
| `scheduleColumnDuration` *required* | `string` | — | |
|
|
9731
|
+
| `scheduleColumnFindings` *required* | `string` | — | |
|
|
9443
9732
|
| `dashboardEdit` *required* | `string` | — | The editing bar's buttons and the label that says the mode is on. |
|
|
9444
9733
|
| `dashboardEditing` *required* | `string` | — | |
|
|
9445
9734
|
| `dashboardCancel` *required* | `string` | — | |
|
|
@@ -9450,6 +9739,9 @@ Everything the library puts out as text.
|
|
|
9450
9739
|
| `dashboardMenu` *required* | `(title: string) => string` | — | The name of a widget's menu button: the widget's title is the thing. |
|
|
9451
9740
|
| `dashboardPlace` *required* | `(place: number, of: number) => string` | — | At the top of the menu, and in the name of a head the arrow keys move. |
|
|
9452
9741
|
| `dashboardHead` *required* | `(title: string, place: number, of: number) => string` | — | |
|
|
9742
|
+
| `dashboardHeadLocked` *required* | `(title: string, place: number, of: number) => string` | — | The name of the head of a locked widget in the editing mode. |
|
|
9743
|
+
| `dashboardLocked` *required* | `string` | — | The word beside a locked widget's size in the mode. |
|
|
9744
|
+
| `dashboardLockedLine` *required* | `string` | — | The disabled line in a locked widget's menu, where the sizes, the options and "Remove" would stand. |
|
|
9453
9745
|
| `dashboardMoveStart` *required* | `string` | — | |
|
|
9454
9746
|
| `dashboardMoveEarlier` *required* | `string` | — | |
|
|
9455
9747
|
| `dashboardMoveLater` *required* | `string` | — | |
|
|
@@ -9506,12 +9798,63 @@ Everything the library puts out as text.
|
|
|
9506
9798
|
| `calculationHideDerivation` *required* | `(label: string) => string` | — | |
|
|
9507
9799
|
| `calculationOperandCount` *required* | `(count: number) => string` | — | On a folded line whose operator has more operands than are written out beneath it ([ADR-0028](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0028-a-calculation-is-a-tree-or-a-chain.md)): how many there are. |
|
|
9508
9800
|
| `calculationNoOperands` *required* | `string` | — | On the line of a sum with no operands, where its formula would stand ([ADR-0049](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0049-a-sum-takes-rows-from-data.md)). |
|
|
9801
|
+
| `alarmList` *required* | `string` | — | |
|
|
9802
|
+
| `alarmNone` *required* | `string` | — | |
|
|
9803
|
+
| `alarmNoneDisconnected` *required* | `string` | — | Empty, but the line is down - that is something other than quiet. |
|
|
9804
|
+
| `alarmAcknowledge` *required* | `string` | — | |
|
|
9805
|
+
| `alarmAcknowledgeMany` *required* | `(count: number) => string` | — | Bulk acknowledgement; the number stands in the text on purpose. |
|
|
9806
|
+
| `alarmAcknowledgeInView` *required* | `(count: number) => string` | — | The question of the acknowledge-all dialog: what the list sees (umriss's own rule - the rows in its visible area) or what is selected, and its two buttons. |
|
|
9807
|
+
| `alarmAcknowledgeSelected` *required* | `(count: number) => string` | — | |
|
|
9808
|
+
| `alarmAcknowledgeConfirm` *required* | `string` | — | |
|
|
9809
|
+
| `alarmAcknowledgeCancel` *required* | `string` | — | |
|
|
9810
|
+
| `alarmSnooze` *required* | `string` | — | The alarm list's snooze menu, beside "Acknowledge": the word on its button, and the sentence with the number of alarms it acts on. |
|
|
9811
|
+
| `alarmSnoozeMany` *required* | `(count: number) => string` | — | |
|
|
9812
|
+
| `alarmSnoozeDuration` *required* | `string` | — | The labels in the panel that opens with `snoozeReason`: the duration to choose and the reason to give. The panel's own button is `snoozeAlarm`. |
|
|
9813
|
+
| `alarmSnoozeReason` *required* | `string` | — | |
|
|
9814
|
+
| `alarmSnoozeOtherReason` *required* | `string` | — | The free-text field beside the application's reasons: a reason not on the list. |
|
|
9815
|
+
| `alarmUnsnooze` *required* | `string` | — | Ends the snooze of the ticked alarms before its time. |
|
|
9816
|
+
| `alarmUnsnoozeMany` *required* | `(count: number) => string` | — | |
|
|
9817
|
+
| `alarmPriorityCritical` *required* | `string` | — | |
|
|
9818
|
+
| `alarmPriorityHigh` *required* | `string` | — | |
|
|
9819
|
+
| `alarmPriorityMedium` *required* | `string` | — | |
|
|
9820
|
+
| `alarmPriorityLow` *required* | `string` | — | |
|
|
9821
|
+
| `alarmPriorityName` *required* | `(level: number, word: string) => string` | — | The name of a priority mark: its number, 1 for the most urgent, and its word. |
|
|
9822
|
+
| `alarmLifecycleActiveUnacknowledged` *required* | `string` | — | The four lifecycle states, written out. |
|
|
9823
|
+
| `alarmLifecycleActiveAcknowledged` *required* | `string` | — | |
|
|
9824
|
+
| `alarmLifecycleResolvedUnacknowledged` *required* | `string` | — | |
|
|
9825
|
+
| `alarmLifecycleResolvedAcknowledged` *required* | `string` | — | |
|
|
9826
|
+
| `alarmFloodHint` *required* | `(count: number, minutes: number) => string` | — | "Alarm flood: 40 in 10 min" - a flood is marked, never suppressed. |
|
|
9827
|
+
| `alarmFirstOut` *required* | `string` | — | The badge on the first alarm of a group or trip (ISA-18.2 first-out), and the badge on the first alarm of a flood - umriss's own mark, worded apart. |
|
|
9828
|
+
| `alarmFirstInFlood` *required* | `string` | — | |
|
|
9829
|
+
| `alarmChatterHint` *required* | `(count: number) => string` | — | "40×" on a chattering alarm type. |
|
|
9830
|
+
| `alarmActiveUnacknowledged` *required* | `(count: number) => string` | — | The text of the live region: the number of active unacknowledged alarms. |
|
|
9831
|
+
| `alarmBanner` *required* | `string` | — | The banner's name as a landmark, its sentence for no unacknowledged alarm and for a lost source, the "n more" after the worst alarm, the button that opens the list, and the text of its alert: the new alarm's priority and label. |
|
|
9832
|
+
| `alarmBannerNone` *required* | `string` | — | |
|
|
9833
|
+
| `alarmBannerDisconnected` *required* | `string` | — | |
|
|
9834
|
+
| `alarmBannerMore` *required* | `(count: number) => string` | — | |
|
|
9835
|
+
| `alarmBannerOpen` *required* | `string` | — | |
|
|
9836
|
+
| `alarmBannerAlert` *required* | `(priority: string, label: string) => string` | — | |
|
|
9837
|
+
| `alarmColumnAlarm` *required* | `string` | — | |
|
|
9838
|
+
| `alarmColumnLifecycleState` *required* | `string` | — | |
|
|
9839
|
+
| `alarmColumnPriority` *required* | `string` | — | |
|
|
9840
|
+
| `alarmColumnRaised` *required* | `string` | — | |
|
|
9841
|
+
| `alarmColumnDuration` *required* | `string` | — | |
|
|
9842
|
+
| `alarmColumnFrequency` *required* | `string` | — | |
|
|
9843
|
+
| `alarmColumnAcknowledgement` *required* | `string` | — | The two columns of the alarm model the list does not show, but which do land in the column menu and the CSV header (`alarmColumns`). |
|
|
9844
|
+
| `alarmColumnAge` *required* | `string` | — | |
|
|
9845
|
+
| `alarmAvailabilitySnoozed` *required* | `(until: string, by: string, reason?: string) => string` | — | The availability of an alarm (ISA-18.2's special states), written out. A snooze names its end and who snoozed it - a snooze is tracked, not anonymous; the time comes from the formats. The reason, when the snooze has one, comes last and is optional: a wording of two parameters fits. |
|
|
9846
|
+
| `alarmAvailabilitySnoozedShort` *required* | `string` | — | A snooze as one word - the alarm list's badge; the sentence above stands in its tooltip and in what is spoken. |
|
|
9847
|
+
| `alarmAvailabilitySnoozedUntil` *required* | `(until: string) => string` | — | The shelve badge of an alarm still in alarm: the word and its return time. |
|
|
9848
|
+
| `alarmAvailabilitySuppressed` *required* | `string` | — | |
|
|
9849
|
+
| `alarmAvailabilityDisabled` *required* | `string` | — | |
|
|
9850
|
+
| `alarmHidden` *required* | `(count: number) => string` | — | "Hidden: 3" - the count of the view of snoozed, suppressed and disabled alarms, and its name where the list offers the view as a switch. |
|
|
9851
|
+
| `alarmColumnAvailability` *required* | `string` | — | The availability column of the alarm model: the column menu and the CSV header, like the two above. |
|
|
9509
9852
|
|
|
9510
9853
|
#### Known limits
|
|
9511
9854
|
|
|
9512
9855
|
- 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.
|
|
9513
9856
|
|
|
9514
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
9857
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9515
9858
|
|
|
9516
9859
|
### View
|
|
9517
9860
|
|
|
@@ -9523,6 +9866,8 @@ import { useTable } from "@umriss-ui/table";
|
|
|
9523
9866
|
|
|
9524
9867
|
The table remembers nothing, not in the address and not in any storage. Everything stands in `t.view`, and `onViewChange` reports every change of it; keep it where the application keeps things. `initialView` is read once; `t.setView(view)` goes to another view later and is not reported through `onViewChange`, so two tables stay in step by `onViewChange: (v) => other.setView(v)` in both directions.
|
|
9525
9868
|
|
|
9869
|
+
A view survives JSON: stored with `JSON.stringify` and handed back to `initialView` or `setView`, it filters the same rows, and `t.view` holds `Date`s again. Read back as a `Date` is a string in the form `toISOString` writes - as a bound of a range condition on any column, and as a value of a list condition on a column of points in time. Any other string, a day-only `"2026-03-17"` among them, stays text.
|
|
9870
|
+
|
|
9526
9871
|
#### Examples
|
|
9527
9872
|
|
|
9528
9873
|
##### Keep and restore a view
|
|
@@ -9599,9 +9944,91 @@ export default function InitialView() {
|
|
|
9599
9944
|
}
|
|
9600
9945
|
```
|
|
9601
9946
|
|
|
9947
|
+
##### Keep the view in the URL
|
|
9948
|
+
|
|
9949
|
+
`onViewChange` writes `t.view` as JSON into a query parameter, `initialView` reads it at mount and `popstate` calls `setView`; the date range comes back as a `Date`, and no JSON compare is needed, because `setView` compares by content. A query parameter and not the hash, since the demo's hash is its router. Set a filter and reload.
|
|
9950
|
+
|
|
9951
|
+
```tsx
|
|
9952
|
+
import { useEffect, useState } from "react";
|
|
9953
|
+
import { Stack, Text } from "@umriss-ui/core";
|
|
9954
|
+
import { useTable } from "@umriss-ui/table";
|
|
9955
|
+
import type { TableView } from "@umriss-ui/table";
|
|
9956
|
+
|
|
9957
|
+
const PARAM = "view";
|
|
9958
|
+
|
|
9959
|
+
const START_VIEW: TableView = {
|
|
9960
|
+
conditions: { due: { from: new Date(2026, 2, 10), to: new Date(2026, 3, 10) } },
|
|
9961
|
+
};
|
|
9962
|
+
|
|
9963
|
+
interface Invoice {
|
|
9964
|
+
id: string;
|
|
9965
|
+
supplier: string;
|
|
9966
|
+
due: Date;
|
|
9967
|
+
}
|
|
9968
|
+
|
|
9969
|
+
const INVOICES: Invoice[] = [
|
|
9970
|
+
{ id: "INV-26-0318", supplier: "Brandlow Office Supply", due: new Date(2026, 3, 15) },
|
|
9971
|
+
{ id: "INV-26-0317", supplier: "Kettering & Shaw Events", due: new Date(2026, 3, 12) },
|
|
9972
|
+
{ id: "INV-26-0309", supplier: "Nimbrel Software", due: new Date(2026, 3, 8) },
|
|
9973
|
+
{ id: "INV-26-0302", supplier: "Fenwright Legal", due: new Date(2026, 2, 16) },
|
|
9974
|
+
{ id: "INV-26-0226", supplier: "Corrin Travel", due: new Date(2026, 2, 12) },
|
|
9975
|
+
{ id: "INV-26-0221", supplier: "Stellbrook Consulting", due: new Date(2026, 2, 3) },
|
|
9976
|
+
];
|
|
9977
|
+
|
|
9978
|
+
const stored = (): TableView => {
|
|
9979
|
+
try {
|
|
9980
|
+
const raw = new URL(window.location.href).searchParams.get(PARAM);
|
|
9981
|
+
return raw ? (JSON.parse(raw) as TableView) : START_VIEW;
|
|
9982
|
+
} catch {
|
|
9983
|
+
return START_VIEW;
|
|
9984
|
+
}
|
|
9985
|
+
};
|
|
9986
|
+
|
|
9987
|
+
export default function ViewInTheUrl() {
|
|
9988
|
+
const [start] = useState(stored);
|
|
9989
|
+
const [written, setWritten] = useState(() => new URL(window.location.href).searchParams.get(PARAM) ?? "");
|
|
9990
|
+
const t = useTable(INVOICES, {
|
|
9991
|
+
rowKey: (i) => i.id,
|
|
9992
|
+
initialView: start,
|
|
9993
|
+
onViewChange: (view) => {
|
|
9994
|
+
const url = new URL(window.location.href);
|
|
9995
|
+
const json = JSON.stringify(view);
|
|
9996
|
+
url.searchParams.set(PARAM, json);
|
|
9997
|
+
window.history.replaceState(window.history.state, "", url);
|
|
9998
|
+
setWritten(json);
|
|
9999
|
+
},
|
|
10000
|
+
});
|
|
10001
|
+
const { Table, Column, setView } = t;
|
|
10002
|
+
|
|
10003
|
+
useEffect(() => {
|
|
10004
|
+
const onPop = () => setView(stored());
|
|
10005
|
+
window.addEventListener("popstate", onPop);
|
|
10006
|
+
return () => window.removeEventListener("popstate", onPop);
|
|
10007
|
+
});
|
|
10008
|
+
|
|
10009
|
+
return (
|
|
10010
|
+
<Stack gap={3}>
|
|
10011
|
+
<Table aria-label="Invoices">
|
|
10012
|
+
<Column value="id" label="Invoice" rowHeader />
|
|
10013
|
+
<Column value="supplier" label="Supplier" />
|
|
10014
|
+
<Column value="due" label="Due" filter="range" format="date" />
|
|
10015
|
+
</Table>
|
|
10016
|
+
<Stack gap={1}>
|
|
10017
|
+
<Text as="span" size="sm" tone="secondary">
|
|
10018
|
+
The query parameter {PARAM}
|
|
10019
|
+
</Text>
|
|
10020
|
+
<Text as="code" size="sm" mono data-role="url-view" style={{ overflowWrap: "anywhere" }}>
|
|
10021
|
+
{written || "(not written yet)"}
|
|
10022
|
+
</Text>
|
|
10023
|
+
</Stack>
|
|
10024
|
+
</Stack>
|
|
10025
|
+
);
|
|
10026
|
+
}
|
|
10027
|
+
```
|
|
10028
|
+
|
|
9602
10029
|
#### Keyboard
|
|
9603
10030
|
|
|
9604
|
-
The keys of [First table](#first-table), Input, [ColumnMenu](#columnmenu) and
|
|
10031
|
+
The keys of [First table](#first-table), Input, [ColumnMenu](#columnmenu), Button and Popover apply here.
|
|
9605
10032
|
|
|
9606
10033
|
#### Props on this page
|
|
9607
10034
|
|
|
@@ -9636,7 +10063,8 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
9636
10063
|
| Prop | Type | Default | Description |
|
|
9637
10064
|
|---|---|---|---|
|
|
9638
10065
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
9639
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
10066
|
+
| [`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. |
|
|
9640
10068
|
|
|
9641
10069
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
9642
10070
|
|
|
@@ -9924,7 +10352,7 @@ type TableRef = Omit<TableSnapshot<unknown>, "setFilter" | "conditionOf"> & {
|
|
|
9924
10352
|
|
|
9925
10353
|
- In [server mode](#server-mode) the page goes to the server in the request, and `rowCount` decides how many pages there are.
|
|
9926
10354
|
|
|
9927
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
10355
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
9928
10356
|
|
|
9929
10357
|
### Virtualisation
|
|
9930
10358
|
|
|
@@ -10207,7 +10635,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
10207
10635
|
| Prop | Type | Default | Description |
|
|
10208
10636
|
|---|---|---|---|
|
|
10209
10637
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
10210
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
10638
|
+
| [`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. |
|
|
10211
10639
|
| [`children`](#column) | [`Presentation`](#column)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
|
|
10212
10640
|
|
|
10213
10641
|
From `ColumnBase` — the full table stands on [Column](#column).
|
|
@@ -10235,7 +10663,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
10235
10663
|
- Paging and virtualisation do not combine; one table does one or the other.
|
|
10236
10664
|
- No loading more rows while scrolling: a table on a server pages ([Server mode](#server-mode)).
|
|
10237
10665
|
|
|
10238
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
10666
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
10239
10667
|
|
|
10240
10668
|
### Benchmark
|
|
10241
10669
|
|
|
@@ -11831,7 +12259,7 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
11831
12259
|
- A list filter offers what `filterOptions` names; the table cannot count values it does not hold.
|
|
11832
12260
|
- No loading more rows while scrolling: paging and virtualisation do not combine.
|
|
11833
12261
|
|
|
11834
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
12262
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
11835
12263
|
|
|
11836
12264
|
## Editing
|
|
11837
12265
|
|
|
@@ -11975,6 +12403,7 @@ export default function TheWholeGrid() {
|
|
|
11975
12403
|
| `Escape` | Cancels an edit, or goes back from a control to its cell. |
|
|
11976
12404
|
| `Ctrl / Cmd + C` | Copies the selected rows, or the active cell; its cell flashes. In an open editor with nothing marked it copies the field's value. |
|
|
11977
12405
|
| `Space` | Selects the row of the active cell. |
|
|
12406
|
+
| `Shift + Space` | Selects the rows from the one toggled last to the row of the active cell. |
|
|
11978
12407
|
|
|
11979
12408
|
#### Props on this page
|
|
11980
12409
|
|
|
@@ -12008,7 +12437,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
12008
12437
|
| Prop | Type | Default | Description |
|
|
12009
12438
|
|---|---|---|---|
|
|
12010
12439
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
12011
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
12440
|
+
| [`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. |
|
|
12012
12441
|
| [`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`. |
|
|
12013
12442
|
| [`validate`](#column) | `(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`. |
|
|
12014
12443
|
|
|
@@ -12397,7 +12826,7 @@ From `FieldColumn` — the full table stands on [Column](#column).
|
|
|
12397
12826
|
| Prop | Type | Default | Description |
|
|
12398
12827
|
|---|---|---|---|
|
|
12399
12828
|
| [`value`](#column) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
12400
|
-
| [`format`](#column) | [`FormatFor`](#column)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"
|
|
12829
|
+
| [`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. |
|
|
12401
12830
|
| [`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`. |
|
|
12402
12831
|
| [`editOptions`](#column) | `readonly `[`Present`](#column)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`. |
|
|
12403
12832
|
| [`validate`](#column) | `(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`. |
|
|
@@ -12418,9 +12847,9 @@ From `ToolbarProps` — the full table stands on [Toolbar](#toolbar).
|
|
|
12418
12847
|
|
|
12419
12848
|
#### Known limits
|
|
12420
12849
|
|
|
12421
|
-
- No cell range selection and no undo ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
12850
|
+
- No cell range selection and no undo ([ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md)).
|
|
12422
12851
|
|
|
12423
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
12852
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12424
12853
|
|
|
12425
12854
|
## Limits and alarms
|
|
12426
12855
|
|
|
@@ -12665,14 +13094,15 @@ The keys of [First table](#first-table) apply here.
|
|
|
12665
13094
|
|
|
12666
13095
|
| Prop | Type | Default | Description |
|
|
12667
13096
|
|---|---|---|---|
|
|
12668
|
-
| `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 latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
12669
|
-
| `limits` *required* | `LimitSet` | — | The limit set every value is read against.<br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
13097
|
+
| `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 latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
13098
|
+
| `limits` *required* | `LimitSet` | — | The limit set every value is read against.<br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
12670
13099
|
| `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 |
|
|
12671
13100
|
| `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) |
|
|
12672
13101
|
| `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning) |
|
|
12673
13102
|
| `resizable` | `boolean` | — | Shows the drag grip on the header cell. |
|
|
12674
13103
|
| `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) |
|
|
12675
13104
|
| `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 |
|
|
13105
|
+
| `aggregateLabel` | `string` | — | The word for the aggregate in the footer, read by a screen reader.<br>Shown in: [Carry the worst verdict up (Aggregate)](#aggregate) |
|
|
12676
13106
|
|
|
12677
13107
|
##### Types on this page
|
|
12678
13108
|
|
|
@@ -12687,7 +13117,7 @@ violated, and it is never the edge of a region.
|
|
|
12687
13117
|
|
|
12688
13118
|
| Prop | Type | Default | Description |
|
|
12689
13119
|
|---|---|---|---|
|
|
12690
|
-
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
13120
|
+
| `limits` | `readonly ``Limit``[]` | — | In any order; none, one or several.<br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
12691
13121
|
| `target` | `number` | — | <br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Carry the worst verdict up (Aggregate)](#aggregate), [Review cost centres against budget (Scenarios)](#review-cost-centres-against-budget) |
|
|
12692
13122
|
|
|
12693
13123
|
###### `NumberFormat`
|
|
@@ -12719,9 +13149,9 @@ force a `null` on one edge in the one-sided case.
|
|
|
12719
13149
|
|
|
12720
13150
|
| Prop | Type | Default | Description |
|
|
12721
13151
|
|---|---|---|---|
|
|
12722
|
-
| `value` *required* | `number` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
12723
|
-
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
12724
|
-
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and
|
|
13152
|
+
| `value` *required* | `number` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
13153
|
+
| `side` *required* | `Side`<br>`"upper" \| "lower"` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
13154
|
+
| `severity` *required* | `Severity`<br>`"warning" \| "alarm"` | — | <br>Shown in: [Read latency against its objective](#verdictcolumn), [Sort by verdict or by value](#verdictcolumn), [Judge a computed share](#verdictcolumn) and 6 more |
|
|
12725
13155
|
|
|
12726
13156
|
###### `NumberOptions`
|
|
12727
13157
|
|
|
@@ -12761,7 +13191,7 @@ type Severity = "warning" | "alarm";
|
|
|
12761
13191
|
- No list filter: four verdicts are sorted, not filtered.
|
|
12762
13192
|
- 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)).
|
|
12763
13193
|
|
|
12764
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.
|
|
13194
|
+
What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/table-v0.47.0/docs/adr/0032-what-umriss-is-not.md).
|
|
12765
13195
|
|
|
12766
13196
|
## API index
|
|
12767
13197
|
|
|
@@ -12795,7 +13225,7 @@ Used on [Scenarios](#scenarios), [First table](#first-table), [Filter](#filter),
|
|
|
12795
13225
|
|
|
12796
13226
|
[Search](#search) – A text field that narrows the table to the rows containing what the user types (also called a quick filter or global filter). Put it in the toolbar, or anywhere on the page.
|
|
12797
13227
|
|
|
12798
|
-
Used on [Scenarios](#scenarios), [First table](#first-table), [Provider](#provider), [Formats](#formats), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode) and [Edits](#edits).
|
|
13228
|
+
Used on [Scenarios](#scenarios), [First table](#first-table), [Provider](#provider), [Formats](#formats), [Conditional formatting](#conditional-formatting), [Width and pinning](#width-and-pinning), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode) and [Edits](#edits).
|
|
12799
13229
|
|
|
12800
13230
|
##### `Toolbar`
|
|
12801
13231
|
|
|
@@ -12825,7 +13255,7 @@ function useTable<Z>(rows: readonly Z[], options: Extract<TableOptions<Z>, {
|
|
|
12825
13255
|
function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
|
|
12826
13256
|
```
|
|
12827
13257
|
|
|
12828
|
-
Used on [Scenarios](#scenarios), [Installation](#installation), [First table](#first-table), [Provider](#provider), [Column](#column), [Formats](#formats), [Width and pinning](#width-and-pinning), [Presets](#presets), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [RowActions](#rowactions), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [ColumnMenu](#columnmenu), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode), [Edits](#edits) and [VerdictColumn](#verdictcolumn).
|
|
13258
|
+
Used on [Scenarios](#scenarios), [Installation](#installation), [First table](#first-table), [Provider](#provider), [Column](#column), [Formats](#formats), [Conditional formatting](#conditional-formatting), [Width and pinning](#width-and-pinning), [Presets](#presets), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [RowActions](#rowactions), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [ColumnMenu](#columnmenu), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode), [Edits](#edits) and [VerdictColumn](#verdictcolumn).
|
|
12829
13259
|
|
|
12830
13260
|
##### `useTableSelection`
|
|
12831
13261
|
|
|
@@ -12876,6 +13306,14 @@ function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
|
|
|
12876
13306
|
|
|
12877
13307
|
Used on [Filter](#filter) and [Toolbar controls](#toolbar-controls).
|
|
12878
13308
|
|
|
13309
|
+
##### `tableModel`
|
|
13310
|
+
|
|
13311
|
+
The table's pipeline as a pure function - filter, sort, page over rows and model columns.
|
|
13312
|
+
|
|
13313
|
+
```ts
|
|
13314
|
+
function tableModel<Z, K extends string = string>(rows: readonly Z[], columns: readonly ModelColumn<Z, K>[], input: TableInput<Z, K>): TableProjection<Z, K>;
|
|
13315
|
+
```
|
|
13316
|
+
|
|
12879
13317
|
#### Constants
|
|
12880
13318
|
|
|
12881
13319
|
##### `csv`
|
|
@@ -13082,6 +13520,11 @@ type Computed<Z, W> = ColumnBase &
|
|
|
13082
13520
|
/** The id is required where the value is a function. */
|
|
13083
13521
|
id: string;
|
|
13084
13522
|
value: (row: Z) => W;
|
|
13523
|
+
/** The word for an `aggregate` function of one's own: it stands before the
|
|
13524
|
+
value in the footer and is what a screen reader reads. A group header
|
|
13525
|
+
shows no word. A built-in kind keeps its own word, the wording's; a name
|
|
13526
|
+
beside it is ignored. */
|
|
13527
|
+
aggregateLabel?: string;
|
|
13085
13528
|
/* The two names stand here without a condition on the value type, unlike on
|
|
13086
13529
|
a field column: the value of a computed column is derived from `value`,
|
|
13087
13530
|
and a condition over this W is not yet resolved when the overload is
|
|
@@ -13104,10 +13547,17 @@ type Computed<Z, W> = ColumnBase &
|
|
|
13104
13547
|
|
|
13105
13548
|
##### `DateFormat`
|
|
13106
13549
|
|
|
13107
|
-
The names of the standard presentations of a point in time
|
|
13550
|
+
The names of the standard presentations of a point in time, with the English
|
|
13551
|
+
text of 17 March 2026 at 09:05:03 for each:
|
|
13552
|
+
- `"date"`: "17/03/2026"
|
|
13553
|
+
- `"time"`: "09:05"
|
|
13554
|
+
- `"dateTime"`: "17/03/2026, 09:05"
|
|
13555
|
+
- `"timeWithSeconds"`: "09:05:03"
|
|
13556
|
+
- `"dateTimeWithSeconds"`: "17/03/2026, 09:05:03"
|
|
13557
|
+
German formats write the same with "17.03.2026".
|
|
13108
13558
|
|
|
13109
13559
|
```ts
|
|
13110
|
-
type DateFormat =
|
|
13560
|
+
type DateFormat = (typeof DATE_FORMATS)[number];
|
|
13111
13561
|
```
|
|
13112
13562
|
|
|
13113
13563
|
##### `DatePeriod`
|
|
@@ -13326,6 +13776,39 @@ type IsDisplayable<W> = [Present<W>] extends [never]
|
|
|
13326
13776
|
: false;
|
|
13327
13777
|
```
|
|
13328
13778
|
|
|
13779
|
+
##### `Line<Z>`
|
|
13780
|
+
|
|
13781
|
+
One line of a grouped table. A header heads a group of an outer level; a row
|
|
13782
|
+
of the innermost level stands in its span; a folded span is one line.
|
|
13783
|
+
|
|
13784
|
+
```ts
|
|
13785
|
+
type Line<Z> =
|
|
13786
|
+
| {
|
|
13787
|
+
kind: "header";
|
|
13788
|
+
group: RowGroup<Z>;
|
|
13789
|
+
/** The headers around it. */
|
|
13790
|
+
parents: readonly RowGroup<Z>[];
|
|
13791
|
+
/** Repeated at the top of a page that begins inside the group. */
|
|
13792
|
+
continued: boolean;
|
|
13793
|
+
}
|
|
13794
|
+
| {
|
|
13795
|
+
kind: "row";
|
|
13796
|
+
row: Z;
|
|
13797
|
+
parents: readonly RowGroup<Z>[];
|
|
13798
|
+
/** The span the row stands in - the innermost group, when there are
|
|
13799
|
+
several levels; a single level has no span, its rows stand under
|
|
13800
|
+
their group header. */
|
|
13801
|
+
span: RowGroup<Z> | undefined;
|
|
13802
|
+
/** The span shows its value on this line: the group's first row, or the
|
|
13803
|
+
first of a page that begins inside it. */
|
|
13804
|
+
first: boolean;
|
|
13805
|
+
continued: boolean;
|
|
13806
|
+
}
|
|
13807
|
+
| { kind: "folded"; group: RowGroup<Z>; parents: readonly RowGroup<Z>[] };
|
|
13808
|
+
```
|
|
13809
|
+
|
|
13810
|
+
Used on [Column](#column), [Tree rows](#tree-rows), [Aggregate](#aggregate) and [Selection](#selection).
|
|
13811
|
+
|
|
13329
13812
|
##### `ListCondition<W>`
|
|
13330
13813
|
|
|
13331
13814
|
The condition of a list filter: the chosen values, an absent one as `null`.
|
|
@@ -13528,9 +14011,9 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13528
14011
|
|
|
13529
14012
|
| Prop | Type | Default | Description |
|
|
13530
14013
|
|---|---|---|---|
|
|
13531
|
-
| `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
|
|
13532
|
-
| `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
|
|
13533
|
-
| `VerdictColumn` *required* | `VerdictColumnComponent``<Z>` | — | <br>Shown in: [Pin columns to both sides (Width and pinning)](#width-and-pinning), [Read a day's deliveries by depot (Grouping)](#grouping-1)
|
|
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 132 more |
|
|
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 132 more |
|
|
14016
|
+
| `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 |
|
|
13534
14017
|
| `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 |
|
|
13535
14018
|
| `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 |
|
|
13536
14019
|
| `Action` *required* | `(props: `[`ActionProps`](#rowactions)`<Z, S>) => 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 |
|
|
@@ -13565,7 +14048,7 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13565
14048
|
| `selection` *required* | `TableSelection``<string>` | — | The selection – its own or the one handed in through `selection`. From `TableSnapshot`.<br>Shown in: [Select rows (Selection)](#selection), [Copy the selection (Export)](#export), [Scroll twenty thousand rows (Virtualisation)](#virtualisation) and 3 more |
|
|
13566
14049
|
| `grouping` *required* | `readonly string[]` | — | The ids the table is grouped by, the outermost first – only those a groupable column or a group key carries, at most three. From `TableSnapshot`.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
13567
14050
|
| `setGrouping` *required* | `(grouping: readonly string[]) => void` | — | Groups by these columns or group keys; `[]` ungroups. Back to page one. From `TableSnapshot`.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
13568
|
-
| `setView` *required* | `(view: ``TableView``) => void` | — | Goes to a whole view; what it leaves out goes back to where the table starts, and names no column carries fall out. Not reported through `onViewChange`: two tables kept in step by `onViewChange: (v) => other.setView(v)` in both directions do not answer each other. A view with the content already shown changes nothing. From `TableSnapshot`.<br>Shown in: [Keep and restore a view (View)](#view) |
|
|
14051
|
+
| `setView` *required* | `(view: ``TableView``) => void` | — | Goes to a whole view; what it leaves out goes back to where the table starts, and names no column carries fall out. Not reported through `onViewChange`: two tables kept in step by `onViewChange: (v) => other.setView(v)` in both directions do not answer each other. A view with the content already shown changes nothing. From `TableSnapshot`.<br>Shown in: [Keep and restore a view (View)](#view), [Keep the view in the URL (View)](#view) |
|
|
13569
14052
|
| `folded` *required* | `readonly string[]` | — | The paths of the folded groups that still occur. From `TableSnapshot`.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
13570
14053
|
| `toggleFold` *required* | `(path: string) => void` | — | Folds a group or unfolds it. A group of one row does not fold. From `TableSnapshot`.<br>Shown in: [Group and fold from controls of your own (Grouping)](#grouping-1) |
|
|
13571
14054
|
| `foldAll` *required* | `() => void` | — | Folds every group that has more than one row. From `TableSnapshot`.<br>Shown in: [Fold groups into a summary (Grouping)](#grouping-1) |
|
|
@@ -13582,7 +14065,7 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13582
14065
|
| `server` *required* | `boolean` | — | Whether it is in server mode: the rows are one page of a server's. From `TableSnapshot`.<br>Shown in: [Sort, arrange and export from controls of your own (First table)](#first-table) |
|
|
13583
14066
|
| `request` *required* | `TableRequest`` \| null` | — | Server mode: the request `onRequest` last received, or is about to; `null` outside it. From `TableSnapshot`.<br>Shown in: [Show loading, and hold a late answer (Server mode)](#server-mode) |
|
|
13584
14067
|
|
|
13585
|
-
Used on [Scenarios](#scenarios), [Installation](#installation), [First table](#first-table), [Provider](#provider), [Column](#column), [Formats](#formats), [Width and pinning](#width-and-pinning), [Presets](#presets), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [RowActions](#rowactions), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [ColumnMenu](#columnmenu), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode), [Edits](#edits) and [VerdictColumn](#verdictcolumn).
|
|
14068
|
+
Used on [Scenarios](#scenarios), [Installation](#installation), [First table](#first-table), [Provider](#provider), [Column](#column), [Formats](#formats), [Conditional formatting](#conditional-formatting), [Width and pinning](#width-and-pinning), [Presets](#presets), [Sorting](#sorting), [Search](#search), [Filter](#filter), [Pre-filter](#pre-filter), [Grouping](#grouping-1), [Tree rows](#tree-rows), [Aggregate](#aggregate), [Selection](#selection), [Row appearance](#row-appearance), [RowDetail](#rowdetail), [RowActions](#rowactions), [Toolbar](#toolbar), [Toolbar controls](#toolbar-controls), [ColumnMenu](#columnmenu), [Export](#export), [View](#view), [Pagination](#pagination), [Virtualisation](#virtualisation), [Benchmark](#benchmark), [Server mode](#server-mode), [Grid mode](#grid-mode), [Edits](#edits) and [VerdictColumn](#verdictcolumn).
|
|
13586
14069
|
|
|
13587
14070
|
##### `TableInput<Z = unknown, K extends string = string>`
|
|
13588
14071
|
|
|
@@ -13606,6 +14089,27 @@ columns: search, filter, sort, page, hidden columns, order, grouping, tree.
|
|
|
13606
14089
|
|
|
13607
14090
|
Its table stands on [First table](#first-table).
|
|
13608
14091
|
|
|
14092
|
+
##### `TableProjection<Z, K extends string = string>`
|
|
14093
|
+
|
|
14094
|
+
The table's pipeline as a pure function - filter, sort, page over rows and model columns.
|
|
14095
|
+
|
|
14096
|
+
| Prop | Type | Default | Description |
|
|
14097
|
+
|---|---|---|---|
|
|
14098
|
+
| `columns` *required* | `readonly ``ModelColumn``<Z, K>[]` | — | The visible columns in their order – the basis for the header row, the column menu and the CSV export. |
|
|
14099
|
+
| `filtered` *required* | `Z[]` | — | Everything the filter leaves – the basis for figures and the selection. |
|
|
14100
|
+
| `visible` *required* | `Z[]` | — | Only the current page - with a grouping, the rows among its lines. |
|
|
14101
|
+
| `groups` | `RowGroup``<Z>[]` | — | With a grouping: the groups, outermost first. |
|
|
14102
|
+
| `lines` | `Line``<Z>[]` | — | With a grouping: every line of the filtered set. |
|
|
14103
|
+
| `visibleLines` | `Line``<Z>[]` | — | With a grouping: the lines of the current page, with what it repeats. |
|
|
14104
|
+
| `entries` | `readonly ``FlatteningEntry``<Z>[]` | — | Tree rows: the flattening - the rows shown, in reading order, with their level and state. `visible` holds their rows. |
|
|
14105
|
+
| `shown` | `Z[]` | — | Tree rows: every row the flattening shows, before a virtual window. |
|
|
14106
|
+
| `roots` | `Z[]` | — | Tree rows: the roots that match or lead to a match - what a footer sums, since a parent already holds its children. |
|
|
14107
|
+
| `exported` | `readonly ``FlatteningEntry``<Z>[]` | — | Tree rows: every row of the filtered tree in reading order, open or not, path rows included - what the export writes. |
|
|
14108
|
+
| `total` | `number` | — | Tree rows: how many rows the tree has on every level - what "of 1,204" counts, as the rows the pre-filter admits do for a flat table. |
|
|
14109
|
+
| `page` *required* | `number` | — | The clamped page actually shown. |
|
|
14110
|
+
| `pageCount` *required* | `number` | — | |
|
|
14111
|
+
| `columnCount` *required* | `number` | — | |
|
|
14112
|
+
|
|
13609
14113
|
##### `TableProps`
|
|
13610
14114
|
|
|
13611
14115
|
Its table stands on [First table](#first-table).
|
|
@@ -13649,6 +14153,7 @@ selection.
|
|
|
13649
14153
|
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#work-through-the-alerts) |
|
|
13650
14154
|
| `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#selection), [Hold the selection yourself (Selection)](#selection) |
|
|
13651
14155
|
| `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#selection) |
|
|
14156
|
+
| `set` *required* | `(ids: readonly T[], selected: boolean) => void` | — | Gives every key in `ids` the state `selected`, in one update; keys outside `ids` stay as they are. While `allMatching` it moves the keys in or out of `except` instead. The table calls it for a range of rows. |
|
|
13652
14157
|
| `toggleAll` *required* | `() => void` | — | Selects all the keys passed in - or, when all of them are selected already, deselects them. Keys outside them stay as they are. |
|
|
13653
14158
|
| `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#selection), [Work through the alerts (Scenarios)](#work-through-the-alerts), [Find a late shipment (Scenarios)](#find-a-late-shipment) |
|
|
13654
14159
|
| `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
|
|
@@ -13672,7 +14177,7 @@ the application.
|
|
|
13672
14177
|
| Prop | Type | Default | Description |
|
|
13673
14178
|
|---|---|---|---|
|
|
13674
14179
|
| `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 |
|
|
13675
|
-
| `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), [A dispatcher's bar (Toolbar controls)](#toolbar-controls), [
|
|
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), [A dispatcher's bar (Toolbar controls)](#toolbar-controls), [Keep the view in the URL (View)](#view) and 8 more |
|
|
13676
14181
|
| `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 |
|
|
13677
14182
|
| `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 |
|
|
13678
14183
|
| `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 |
|
|
@@ -13900,6 +14405,7 @@ Everything the library puts out as text.
|
|
|
13900
14405
|
| `filterColumn` *required* | `(column: string) => string` | — | The filter button of a column: "Filter Region". |
|
|
13901
14406
|
| `filterHint` *required* | `string` | — | The tooltip over that button. |
|
|
13902
14407
|
| `selectRow` *required* | `(row: string) => string` | — | The selection of one row, named after its row header. |
|
|
14408
|
+
| `tableSelectedCount` *required* | `(count: number) => string` | — | Said after the user changes the selection of a table in grid mode: the count. |
|
|
13903
14409
|
| `selectAllRows` *required* | `string` | — | The selection of every row in the filtered set. |
|
|
13904
14410
|
| `selectAllOnPage` *required* | `string` | — | The same checkbox in server mode, where the table holds one page of a server's. |
|
|
13905
14411
|
| `expandRowNamed` *required* | `(row: string) => string` | — | The expand button, named after the row header. |
|
|
@@ -14030,7 +14536,18 @@ Everything the library puts out as text.
|
|
|
14030
14536
|
| `scheduleLaneCount` *required* | `(count: number) => string` | — | How many lanes a group holds, beside its name in the header. |
|
|
14031
14537
|
| `scheduleRoleDescription` *required* | `string` | — | What a screen reader calls the plot that takes the keys (`aria-roledescription`, schedule-a11y S1). |
|
|
14032
14538
|
| `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
|
+
| `scheduleVisibleRange` *required* | `(from: string, to: string) => string` | — | The span in view, said after a zoom key. |
|
|
14033
14540
|
| `scheduleKeyHelp` *required* | `string` | — | The keys that walk the plot, select and edit - read after the summary. |
|
|
14541
|
+
| `scheduleShowData` *required* | `string` | — | The disclosure key of the plan's table. |
|
|
14542
|
+
| `scheduleHideData` *required* | `string` | — | |
|
|
14543
|
+
| `scheduleTableCaption` *required* | `(from: string, to: string) => string` | — | The open table's caption: the span it lists, both ends formatted. |
|
|
14544
|
+
| `scheduleColumnLane` *required* | `string` | — | The table's column heads. |
|
|
14545
|
+
| `scheduleColumnTask` *required* | `string` | — | |
|
|
14546
|
+
| `scheduleColumnSubtask` *required* | `string` | — | |
|
|
14547
|
+
| `scheduleColumnFrom` *required* | `string` | — | |
|
|
14548
|
+
| `scheduleColumnTo` *required* | `string` | — | |
|
|
14549
|
+
| `scheduleColumnDuration` *required* | `string` | — | |
|
|
14550
|
+
| `scheduleColumnFindings` *required* | `string` | — | |
|
|
14034
14551
|
| `dashboardEdit` *required* | `string` | — | The editing bar's buttons and the label that says the mode is on. |
|
|
14035
14552
|
| `dashboardEditing` *required* | `string` | — | |
|
|
14036
14553
|
| `dashboardCancel` *required* | `string` | — | |
|
|
@@ -14041,6 +14558,9 @@ Everything the library puts out as text.
|
|
|
14041
14558
|
| `dashboardMenu` *required* | `(title: string) => string` | — | The name of a widget's menu button: the widget's title is the thing. |
|
|
14042
14559
|
| `dashboardPlace` *required* | `(place: number, of: number) => string` | — | At the top of the menu, and in the name of a head the arrow keys move. |
|
|
14043
14560
|
| `dashboardHead` *required* | `(title: string, place: number, of: number) => string` | — | |
|
|
14561
|
+
| `dashboardHeadLocked` *required* | `(title: string, place: number, of: number) => string` | — | The name of the head of a locked widget in the editing mode. |
|
|
14562
|
+
| `dashboardLocked` *required* | `string` | — | The word beside a locked widget's size in the mode. |
|
|
14563
|
+
| `dashboardLockedLine` *required* | `string` | — | The disabled line in a locked widget's menu, where the sizes, the options and "Remove" would stand. |
|
|
14044
14564
|
| `dashboardMoveStart` *required* | `string` | — | |
|
|
14045
14565
|
| `dashboardMoveEarlier` *required* | `string` | — | |
|
|
14046
14566
|
| `dashboardMoveLater` *required* | `string` | — | |
|
|
@@ -14097,6 +14617,57 @@ Everything the library puts out as text.
|
|
|
14097
14617
|
| `calculationHideDerivation` *required* | `(label: string) => string` | — | |
|
|
14098
14618
|
| `calculationOperandCount` *required* | `(count: number) => string` | — | On a folded line whose operator has more operands than are written out beneath it ([ADR-0028](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0028-a-calculation-is-a-tree-or-a-chain.md)): how many there are. |
|
|
14099
14619
|
| `calculationNoOperands` *required* | `string` | — | On the line of a sum with no operands, where its formula would stand ([ADR-0049](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0049-a-sum-takes-rows-from-data.md)). |
|
|
14620
|
+
| `alarmList` *required* | `string` | — | |
|
|
14621
|
+
| `alarmNone` *required* | `string` | — | |
|
|
14622
|
+
| `alarmNoneDisconnected` *required* | `string` | — | Empty, but the line is down - that is something other than quiet. |
|
|
14623
|
+
| `alarmAcknowledge` *required* | `string` | — | |
|
|
14624
|
+
| `alarmAcknowledgeMany` *required* | `(count: number) => string` | — | Bulk acknowledgement; the number stands in the text on purpose. |
|
|
14625
|
+
| `alarmAcknowledgeInView` *required* | `(count: number) => string` | — | The question of the acknowledge-all dialog: what the list sees (umriss's own rule - the rows in its visible area) or what is selected, and its two buttons. |
|
|
14626
|
+
| `alarmAcknowledgeSelected` *required* | `(count: number) => string` | — | |
|
|
14627
|
+
| `alarmAcknowledgeConfirm` *required* | `string` | — | |
|
|
14628
|
+
| `alarmAcknowledgeCancel` *required* | `string` | — | |
|
|
14629
|
+
| `alarmSnooze` *required* | `string` | — | The alarm list's snooze menu, beside "Acknowledge": the word on its button, and the sentence with the number of alarms it acts on. |
|
|
14630
|
+
| `alarmSnoozeMany` *required* | `(count: number) => string` | — | |
|
|
14631
|
+
| `alarmSnoozeDuration` *required* | `string` | — | The labels in the panel that opens with `snoozeReason`: the duration to choose and the reason to give. The panel's own button is `snoozeAlarm`. |
|
|
14632
|
+
| `alarmSnoozeReason` *required* | `string` | — | |
|
|
14633
|
+
| `alarmSnoozeOtherReason` *required* | `string` | — | The free-text field beside the application's reasons: a reason not on the list. |
|
|
14634
|
+
| `alarmUnsnooze` *required* | `string` | — | Ends the snooze of the ticked alarms before its time. |
|
|
14635
|
+
| `alarmUnsnoozeMany` *required* | `(count: number) => string` | — | |
|
|
14636
|
+
| `alarmPriorityCritical` *required* | `string` | — | |
|
|
14637
|
+
| `alarmPriorityHigh` *required* | `string` | — | |
|
|
14638
|
+
| `alarmPriorityMedium` *required* | `string` | — | |
|
|
14639
|
+
| `alarmPriorityLow` *required* | `string` | — | |
|
|
14640
|
+
| `alarmPriorityName` *required* | `(level: number, word: string) => string` | — | The name of a priority mark: its number, 1 for the most urgent, and its word. |
|
|
14641
|
+
| `alarmLifecycleActiveUnacknowledged` *required* | `string` | — | The four lifecycle states, written out. |
|
|
14642
|
+
| `alarmLifecycleActiveAcknowledged` *required* | `string` | — | |
|
|
14643
|
+
| `alarmLifecycleResolvedUnacknowledged` *required* | `string` | — | |
|
|
14644
|
+
| `alarmLifecycleResolvedAcknowledged` *required* | `string` | — | |
|
|
14645
|
+
| `alarmFloodHint` *required* | `(count: number, minutes: number) => string` | — | "Alarm flood: 40 in 10 min" - a flood is marked, never suppressed. |
|
|
14646
|
+
| `alarmFirstOut` *required* | `string` | — | The badge on the first alarm of a group or trip (ISA-18.2 first-out), and the badge on the first alarm of a flood - umriss's own mark, worded apart. |
|
|
14647
|
+
| `alarmFirstInFlood` *required* | `string` | — | |
|
|
14648
|
+
| `alarmChatterHint` *required* | `(count: number) => string` | — | "40×" on a chattering alarm type. |
|
|
14649
|
+
| `alarmActiveUnacknowledged` *required* | `(count: number) => string` | — | The text of the live region: the number of active unacknowledged alarms. |
|
|
14650
|
+
| `alarmBanner` *required* | `string` | — | The banner's name as a landmark, its sentence for no unacknowledged alarm and for a lost source, the "n more" after the worst alarm, the button that opens the list, and the text of its alert: the new alarm's priority and label. |
|
|
14651
|
+
| `alarmBannerNone` *required* | `string` | — | |
|
|
14652
|
+
| `alarmBannerDisconnected` *required* | `string` | — | |
|
|
14653
|
+
| `alarmBannerMore` *required* | `(count: number) => string` | — | |
|
|
14654
|
+
| `alarmBannerOpen` *required* | `string` | — | |
|
|
14655
|
+
| `alarmBannerAlert` *required* | `(priority: string, label: string) => string` | — | |
|
|
14656
|
+
| `alarmColumnAlarm` *required* | `string` | — | |
|
|
14657
|
+
| `alarmColumnLifecycleState` *required* | `string` | — | |
|
|
14658
|
+
| `alarmColumnPriority` *required* | `string` | — | |
|
|
14659
|
+
| `alarmColumnRaised` *required* | `string` | — | |
|
|
14660
|
+
| `alarmColumnDuration` *required* | `string` | — | |
|
|
14661
|
+
| `alarmColumnFrequency` *required* | `string` | — | |
|
|
14662
|
+
| `alarmColumnAcknowledgement` *required* | `string` | — | The two columns of the alarm model the list does not show, but which do land in the column menu and the CSV header (`alarmColumns`). |
|
|
14663
|
+
| `alarmColumnAge` *required* | `string` | — | |
|
|
14664
|
+
| `alarmAvailabilitySnoozed` *required* | `(until: string, by: string, reason?: string) => string` | — | The availability of an alarm (ISA-18.2's special states), written out. A snooze names its end and who snoozed it - a snooze is tracked, not anonymous; the time comes from the formats. The reason, when the snooze has one, comes last and is optional: a wording of two parameters fits. |
|
|
14665
|
+
| `alarmAvailabilitySnoozedShort` *required* | `string` | — | A snooze as one word - the alarm list's badge; the sentence above stands in its tooltip and in what is spoken. |
|
|
14666
|
+
| `alarmAvailabilitySnoozedUntil` *required* | `(until: string) => string` | — | The shelve badge of an alarm still in alarm: the word and its return time. |
|
|
14667
|
+
| `alarmAvailabilitySuppressed` *required* | `string` | — | |
|
|
14668
|
+
| `alarmAvailabilityDisabled` *required* | `string` | — | |
|
|
14669
|
+
| `alarmHidden` *required* | `(count: number) => string` | — | "Hidden: 3" - the count of the view of snoozed, suppressed and disabled alarms, and its name where the list offers the view as a switch. |
|
|
14670
|
+
| `alarmColumnAvailability` *required* | `string` | — | The availability column of the alarm model: the column menu and the CSV header, like the two above. |
|
|
14100
14671
|
|
|
14101
14672
|
##### `NumberOptions`
|
|
14102
14673
|
|
|
@@ -14108,3 +14679,30 @@ maximum fraction digits. An Intl digit option given beside it wins.
|
|
|
14108
14679
|
```ts
|
|
14109
14680
|
type NumberOptions = Intl.NumberFormatOptions & { decimals?: number };
|
|
14110
14681
|
```
|
|
14682
|
+
|
|
14683
|
+
##### `FlatteningEntry<K, S extends Key = string>`
|
|
14684
|
+
|
|
14685
|
+
From `@umriss-ui/core`.
|
|
14686
|
+
|
|
14687
|
+
One visible node of a tree, with everything a row needs to be drawn and
|
|
14688
|
+
read out: level, branch or leaf, check state, search state and position
|
|
14689
|
+
among its siblings.
|
|
14690
|
+
|
|
14691
|
+
| Prop | Type | Default | Description |
|
|
14692
|
+
|---|---|---|---|
|
|
14693
|
+
| `node` *required* | `K` | — | |
|
|
14694
|
+
| `key` *required* | `S` | — | |
|
|
14695
|
+
| `level` *required* | `number` | — | Roots stand at 0. Drives the indentation and what is read out. |
|
|
14696
|
+
| `label` *required* | `string` | — | The node's text; here, so that typeahead can be a pure function over the flattening and needs no reader. |
|
|
14697
|
+
| `branch` *required* | `boolean` | — | |
|
|
14698
|
+
| `empty` *required* | `boolean` | — | Branch without content: expanding it showed nothing. An unloaded branch is not empty - it could have children. |
|
|
14699
|
+
| `disabled` *required* | `boolean` | — | May not be checked ([ADR-0005](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0005-what-cannot-be-checked.md)). It stays navigable. |
|
|
14700
|
+
| `unloaded` *required* | `boolean` | — | Could have children that are not present. For checking exactly the same as disabled: whatever has to reach its descendants may not act on it. |
|
|
14701
|
+
| `expanded` *required* | `boolean` | — | |
|
|
14702
|
+
| `checked` *required* | `boolean` | — | |
|
|
14703
|
+
| `indeterminate` *required* | `boolean` | — | Derived: not checked itself, but at least one descendant is. |
|
|
14704
|
+
| `active` *required* | `boolean` | — | |
|
|
14705
|
+
| `matches` *required* | `boolean` | — | Matched the search itself. Without a search text every entry matches, so that the surface needs no special case. |
|
|
14706
|
+
| `pathOnly` *required* | `boolean` | — | Stands there only because a descendant matches - a signpost. The surface dims these and only these. A child under a matching branch is neither a match nor a signpost but context: it stays normal. |
|
|
14707
|
+
| `position` *required* | `number` | — | 1-based, among the siblings that survive the filter. |
|
|
14708
|
+
| `siblings` *required* | `number` | — | |
|