@umriss-ui/table 0.16.0 → 0.35.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/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/table 0.16.0
1
+ # @umriss-ui/table 0.35.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
 
@@ -10,20 +10,18 @@ Composed, realistic screens built from the package. A numbered mark on the scree
10
10
 
11
11
  ### Work through the alerts
12
12
 
13
- The on-call engineer at Quillmere opens the alert list, takes the worst first, acknowledges what they have seen and snoozes what can wait.
13
+ The on-call engineer at Quillmere opens the alert list, takes the worst first and acknowledges what they have seen.
14
14
 
15
15
  1. Who carries the pager right now, and how many alerts still wait for someone to see them.
16
- 2. The list sorts by priority, then acknowledgement, then time: the unacknowledged search latency stands above the older checkout alert. A resolved alert nobody acknowledged stays until someone does.
17
- 3. Snoozed and disabled alerts stay in the list, drawn neutral with their state; the switch shows only them.
18
- 4. Tick rows and acknowledge them in one go, or snooze them for an hour under the engineer's name.
16
+ 2. The alerts stand worst first: by priority, then what nobody has acknowledged, then the newest. A resolved alert nobody acknowledged stays until someone does.
17
+ 3. Tick rows and acknowledge them in one go.
19
18
 
20
- Built from: AlarmList, Stat, Switch, Button.
19
+ Built from: First table, Stat, Badge, Button.
21
20
 
22
21
  ```tsx
23
- import { useMemo, useState } from "react";
24
- import { Button, Grid, Stack, Stat, Switch, Text } from "@umriss-ui/core";
25
- import { AlarmList, acknowledge, alarmModel, isHidden, snooze, useTableSelection } from "@umriss-ui/table";
26
- import type { Alarm, AlarmType } from "@umriss-ui/table";
22
+ import { useState } from "react";
23
+ import { Badge, Button, Grid, Stack, Stat, Text, useFormats } from "@umriss-ui/core";
24
+ import { useTable } from "@umriss-ui/table";
27
25
 
28
26
  /* Data from the operations world, written out here so the example runs on its own. */
29
27
  const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
@@ -92,50 +90,48 @@ const INCIDENTS: readonly Incident[] = [
92
90
  { id: "INC-1041", title: "Invoices generated twice", service: "billing", severity: "SEV2", opened: at(12, 16, 10), acknowledged: at(12, 16, 18), resolved: at(12, 18, 40), assignee: "priya" },
93
91
  ];
94
92
 
95
- const ALERT_TYPES: readonly AlarmType[] = [
96
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
97
- { id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
98
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
99
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
100
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
101
- { id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
102
- ];
93
+ type Priority = "high" | "medium" | "low";
94
+
95
+ interface Alert {
96
+ id: string;
97
+ raised: number;
98
+ priority: Priority;
99
+ message: string;
100
+ state: "Active" | "Resolved";
101
+ acknowledgedAt?: number;
102
+ }
103
+
104
+ const TONE = { high: "danger", medium: "warning", low: "neutral" } as const;
105
+ const RANK = { high: 0, medium: 1, low: 2 } as const;
106
+
107
+ /** Worst first: by priority, then what nobody has acknowledged, then the newest. */
108
+ const WORST_FIRST = [
109
+ { column: "priority", direction: "asc" },
110
+ { column: "acknowledged", direction: "asc" },
111
+ { column: "raised", direction: "desc" },
112
+ ] as const;
103
113
 
104
114
  /** The alerts as they stand at 10:30. */
105
- const ALERTS: readonly Alarm[] = [
106
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
107
- { id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
108
- { id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
109
- { id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
110
- { id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
111
- { id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
112
- { id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
115
+ const ALERTS: readonly Alert[] = [
116
+ { id: "a-1", raised: at(17, 9, 41), priority: "high", message: "Checkout · p95 latency above 300 ms", state: "Active", acknowledgedAt: at(17, 9, 46) },
117
+ { id: "a-2", raised: at(17, 9, 43), priority: "high", message: "Checkout · error rate above 2\u00a0%", state: "Resolved" },
118
+ { id: "a-3", raised: at(17, 7, 12), priority: "medium", message: "Webhooks · queue older than 5 min", state: "Active", acknowledgedAt: at(17, 8, 2) },
119
+ { id: "a-4", raised: at(17, 10, 24), priority: "medium", message: "Search · p95 latency above 250 ms", state: "Active" },
120
+ { id: "a-5", raised: at(17, 8, 5), priority: "medium", message: "Search · p95 latency above 250 ms", state: "Resolved", acknowledgedAt: at(17, 8, 6) },
113
121
  ];
114
122
 
115
- const MIN = 60_000;
116
- /* The feed's freshness counts from page load, the rest from the world's moment. */
117
- const LOADED = Date.now();
118
-
119
123
  const onCall = (rotation: "primary" | "secondary") => {
120
124
  const turn = ONCALL.find((one) => one.rotation === rotation && one.from <= NOW && NOW < one.to);
121
125
  return ENGINEERS.find((e) => e.id === turn?.engineer)?.name ?? "nobody";
122
126
  };
123
127
 
124
128
  export default function WorkThroughTheAlerts() {
125
- const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
126
- const [hiddenOnly, setHiddenOnly] = useState(false);
127
- const primary = onCall("primary");
128
-
129
- const view = useMemo(
130
- () =>
131
- alarmModel(
132
- { alarms: alerts, types: ALERT_TYPES, asOf: NOW },
133
- hiddenOnly ? { filter: (row) => isHidden(row.availability) } : {},
134
- ),
135
- [alerts, hiddenOnly],
136
- );
137
- const selection = useTableSelection(view.filtered.map((row) => row.id));
138
- const waiting = alerts.filter((a) => a.lifecycle.endsWith("-unacknowledged") && !isHidden(a.availability ?? "in-service")).length;
129
+ const formats = useFormats();
130
+ const [alerts, setAlerts] = useState<readonly Alert[]>(ALERTS);
131
+ const t = useTable(alerts, { rowKey: (a) => a.id, defaultSort: WORST_FIRST });
132
+ const { Table, Column } = t;
133
+ const waiting = alerts.filter((a) => a.acknowledgedAt === undefined).length;
134
+ const time = (instant: number) => formats.time(new Date(instant), false);
139
135
 
140
136
  return (
141
137
  <Stack gap={4}>
@@ -147,7 +143,7 @@ export default function WorkThroughTheAlerts() {
147
143
  <Text size="xs" tone="muted">
148
144
  On call
149
145
  </Text>
150
- <Text size="sm">{primary}, primary</Text>
146
+ <Text size="sm">{onCall("primary")}, primary</Text>
151
147
  <Text size="sm" tone="secondary">
152
148
  {onCall("secondary")}, secondary
153
149
  </Text>
@@ -156,41 +152,35 @@ export default function WorkThroughTheAlerts() {
156
152
  </div>
157
153
 
158
154
  <div data-callout="2">
159
- <AlarmList
160
- view={view}
161
- selection={selection}
162
- asOf={LOADED - 40_000}
163
- freshness={{ stale: 5 * MIN, lost: 30 * MIN }}
164
- hiddenOnly={hiddenOnly}
165
- onAcknowledge={(ids) => {
166
- setAlerts((current) => acknowledge(current, ids, NOW).alarms);
167
- selection.clear();
168
- }}
169
- />
155
+ <Table selectable ariaLabel="Alerts">
156
+ <Column value="raised" label="Raised">
157
+ {(raised) => time(raised)}
158
+ </Column>
159
+ <Column value="priority" label="Priority" sortValue={(priority) => RANK[priority]}>
160
+ {(priority) => <Badge tone={TONE[priority]}>{priority}</Badge>}
161
+ </Column>
162
+ <Column value="message" label="Alert" rowHeader />
163
+ <Column value="state" label="State" />
164
+ <Column id="acknowledged" label="Acknowledged" value={(a) => a.acknowledgedAt ?? 0}>
165
+ {(_, a) => (a.acknowledgedAt === undefined ? "No" : time(a.acknowledgedAt))}
166
+ </Column>
167
+ </Table>
170
168
  </div>
171
169
 
172
- <Stack direction="row" gap={3} align="center" wrap>
173
- <span data-callout="3">
174
- <Switch label="Hidden alerts only" checked={hiddenOnly} onChange={(e) => setHiddenOnly(e.target.checked)} />
175
- </span>
176
- <span data-callout="4">
177
- <Button
178
- size="sm"
179
- disabled={selection.selected.size === 0}
180
- onClick={() => {
181
- setAlerts((current) =>
182
- current.map((a) => (selection.selected.has(a.id) ? snooze(a, NOW + 60 * MIN, primary) : a)),
183
- );
184
- selection.clear();
185
- }}
186
- >
187
- Snooze for an hour
188
- </Button>
189
- </span>
190
- <Text size="xs" tone="muted">
191
- A snooze ends by the clock and comes back with its lifecycle.
192
- </Text>
193
- </Stack>
170
+ <span data-callout="3">
171
+ <Button
172
+ size="sm"
173
+ disabled={t.selection.selected.size === 0}
174
+ onClick={() => {
175
+ setAlerts((current) =>
176
+ current.map((a) => (t.selection.selected.has(a.id) ? { ...a, acknowledgedAt: a.acknowledgedAt ?? NOW } : a)),
177
+ );
178
+ t.selection.clear();
179
+ }}
180
+ >
181
+ Acknowledge
182
+ </Button>
183
+ </span>
194
184
  </Stack>
195
185
  );
196
186
  }
@@ -909,7 +899,7 @@ npm install @umriss-ui/table @umriss-ui/core
909
899
 
910
900
  Demo page: https://romanhaendler.github.io/umriss-ui/table/installation/
911
901
 
912
- The command brings the core package along, a peer dependency: the table reads its provider, its formats and its wording ([ADR-0016](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0016-the-table-is-a-package-that-depends-on-ui.md)). React 18 or 19 is a peer as well and stays the application's own.
902
+ The command brings the core package along, a peer dependency: the table reads its provider, its formats and its wording ([ADR-0016](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0016-the-table-is-a-package-that-depends-on-ui.md)). React 19 or newer is a peer as well and stays the application's own.
913
903
 
914
904
  There is no stylesheet to import. The table loads its own, and the core package loads the tokens it reads; both lie in cascade layers, so the application's CSS wins. `@umriss-ui/table/styles.css` stays exported for setups that link stylesheets by hand.
915
905
 
@@ -1243,7 +1233,6 @@ export default function SortArrangeAndExport() {
1243
1233
 
1244
1234
  #### When to use something else
1245
1235
 
1246
- - Alarms that are raised, acknowledged and resolved → AlarmList
1247
1236
  - Measured values read against their limits → VerdictColumn
1248
1237
  - Three or four key figures side by side → `Stat` from @umriss-ui/core
1249
1238
 
@@ -1268,12 +1257,12 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
1268
1257
 
1269
1258
  | Prop | Type | Default | Description |
1270
1259
  |---|---|---|---|
1271
- | `selectable` | `boolean` | — | Adds the selection column. "All" means: the filtered set.<br>Shown in: [Name the row (Column)](#/column/row-header), [Pin columns to both sides (Width and pinning)](#/width-and-pinning/pinned-both-sides), [Keep the header and the names in view (Width and pinning)](#/width-and-pinning/sticky-parts) and 13 more |
1272
- | `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/sticky-parts), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Group twenty thousand rows (Grouping)](#/grouping/twenty-thousand-rows) and 3 more |
1260
+ | `selectable` | `boolean` | — | Adds the selection column. "All" means: the filtered set.<br>Shown in: [Name the row (Column)](#/column/row-header), [Pin columns to both sides (Width and pinning)](#/width-and-pinning/pinned-both-sides), [Keep the header and the names in view (Width and pinning)](#/width-and-pinning/sticky-parts) and 14 more |
1261
+ | `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/sticky-parts), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Group twenty thousand rows (Grouping)](#/grouping/twenty-thousand-rows) and 4 more |
1273
1262
  | `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/sticky-parts), [Stripes across a wide table (Row appearance)](#/row-appearance/stripes-across-a-wide-table), [Show, hide and arrange (ColumnMenu)](#/columnmenu/show-hide-and-arrange) and 1 more |
1274
1263
  | `striped` | `boolean` | — | Discreet zebra stripes.<br>Shown in: [Stripes across a wide table (Row appearance)](#/row-appearance/stripes-across-a-wide-table) |
1275
1264
  | `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/compact-and-long-values), [Employees in the detail (Tree rows)](#/tree-rows/employees-in-the-detail), [Own staff and teams (Tree rows)](#/tree-rows/own-staff-and-teams) and 4 more |
1276
- | `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/sticky-parts), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Group twenty thousand rows (Grouping)](#/grouping/twenty-thousand-rows) and 3 more |
1265
+ | `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/sticky-parts), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Group twenty thousand rows (Grouping)](#/grouping/twenty-thousand-rows) and 4 more |
1277
1266
  | `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/pre-filter), [Show loading, empty, failed and no match (Row appearance)](#/row-appearance/states) |
1278
1267
  | `loading` | `boolean` | — | Shows placeholder rows instead of the rows.<br>Shown in: [Rows from a request (Filter)](#/filter/rows-from-a-request), [Show loading, empty, failed and no match (Row appearance)](#/row-appearance/states), [Show loading, and drop a late answer (Server mode)](#/server-mode/loading-and-late-answers) and 1 more |
1279
1268
  | `rowProps` | `(row: Z) => `[`RowAttributes`](#type-RowAttributes) | — | Classes and data attributes per row.<br>Shown in: [Mark rows by their state (Row appearance)](#/row-appearance/styling-rows) |
@@ -1281,7 +1270,7 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
1281
1270
  | `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: [Work cell by cell (Grid mode)](#/grid-mode/grid-mode), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid), [Edit a comments column (Edits)](#/edits/comments-column) and 6 more |
1282
1271
  | `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/save-a-row-on-purpose), [Check a whole row before it is saved (Edits)](#/edits/check-a-whole-row), [Keep a list: add, change and delete rows (Edits)](#/edits/keep-a-list) and 1 more |
1283
1272
  | `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/keep-a-list) |
1284
- | `children` | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts.<br>Shown in: [Show a list of services](#/first-table/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 116 more |
1273
+ | `children` | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts.<br>Shown in: [Show a list of services](#/first-table/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 118 more |
1285
1274
 
1286
1275
  ###### Events
1287
1276
 
@@ -1296,7 +1285,7 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
1296
1285
 
1297
1286
  | Prop | Type | Default | Description |
1298
1287
  |---|---|---|---|
1299
- | `ariaLabel` | `string` | — | Accessible name of the table (not of the outer frame).<br>Shown in: [Show a list of services](#/first-table/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 116 more |
1288
+ | `ariaLabel` | `string` | — | Accessible name of the table (not of the outer frame).<br>Shown in: [Show a list of services](#/first-table/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 118 more |
1300
1289
 
1301
1290
  ###### Styling
1302
1291
 
@@ -1308,22 +1297,21 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
1308
1297
 
1309
1298
  | Prop | Type | Default | Description |
1310
1299
  |---|---|---|---|
1311
- | `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/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 116 more |
1312
- | `pageSize` | `number` | `10` | How many rows a page holds.<br>Shown in: [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Ask a question over several fields (Filter)](#/filter/a-question-over-several-fields), [Restrict which rows a table has (Pre-filter)](#/pre-filter/pre-filter) and 6 more |
1313
- | `defaultSort` | [`SortLevel`](#type-SortLevel)` \| readonly `[`SortLevel`](#type-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/sort-arrange-and-export-from-controls-of-your-own), [A label wider than its column (Width and pinning)](#/width-and-pinning/a-label-wider-than-its-column), [Sort by several columns (Sorting)](#/sorting/sort-by-several-columns) and 9 more |
1314
- | `defaultGrouping` | [`GroupingId`](#type-GroupingId)`<Z> \| readonly `[`GroupingId`](#type-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/one-level), [Group on two levels (Grouping)](#/grouping/two-levels), [Group on three levels (Grouping)](#/grouping/three-levels) and 22 more |
1300
+ | `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/first-table), [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) and 118 more |
1301
+ | `pageSize` | `number` | `10` | How many rows a page holds.<br>Shown in: [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own), [Ask a question over several fields (Filter)](#/filter/a-question-over-several-fields), [Restrict which rows a table has (Pre-filter)](#/pre-filter/pre-filter) and 7 more |
1302
+ | `defaultSort` | [`SortLevel`](#type-SortLevel)` \| readonly `[`SortLevel`](#type-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/sort-arrange-and-export-from-controls-of-your-own), [A label wider than its column (Width and pinning)](#/width-and-pinning/a-label-wider-than-its-column), [Sort by several columns (Sorting)](#/sorting/sort-by-several-columns) and 10 more |
1303
+ | `defaultGrouping` | [`GroupingId`](#type-GroupingId)`<Z> \| readonly `[`GroupingId`](#type-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/one-level), [Group on two levels (Grouping)](#/grouping/two-levels), [Group on three levels (Grouping)](#/grouping/three-levels) and 23 more |
1315
1304
  | `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/pre-filter) |
1316
1305
  | `rowFilters` | `readonly `[`RowFilter`](#/filter/type-RowFilter)`<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/a-field-no-column-shows), [Rows from a request (Filter)](#/filter/rows-from-a-request), [Ask a question over several fields (Filter)](#/filter/a-question-over-several-fields) and 3 more |
1317
- | `initialView` | [`TableView`](#type-TableView) | — | The view to start from, and to go to whenever one differing in content from the last is handed in - the same view again changes nothing, and what it leaves out is reset; one the table reported itself, handed back late, is its own state coming back and not gone to. 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/a-question-over-several-fields), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Show loading, empty, failed and no match (Row appearance)](#/row-appearance/states) and 2 more |
1318
- | `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/twenty-thousand-rows), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid) |
1306
+ | `initialView` | [`TableView`](#type-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/a-question-over-several-fields), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Show loading, empty, failed and no match (Row appearance)](#/row-appearance/states) and 2 more |
1307
+ | `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/twenty-thousand-rows), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation), [Measure two hundred thousand rows (Benchmark)](#/benchmark/benchmark) and 1 more |
1319
1308
  | `selection` | [`TableSelection`](#type-TableSelection)`<string>` | — | A selection from outside instead of its own – when the application holds it.<br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
1320
- | `filter` | `(row: Z) => boolean` | — | *Deprecated* Is called `preFilter` now; the old name goes with the next minor version. The old name of `preFilter` – the same filter, the same meaning. |
1321
1309
 
1322
1310
  ###### Events
1323
1311
 
1324
1312
  | Prop | Type | Default | Description |
1325
1313
  |---|---|---|---|
1326
- | `onViewChange` | `(view: `[`TableView`](#type-TableView)`) => void` | — | Every change of the view, once, always the whole view - the one to keep, or to hand another table as its `initialView`. Not called for the view the table starts with.<br>Shown in: [Keep and restore a view (View)](#/view/initial-view) |
1314
+ | `onViewChange` | `(view: `[`TableView`](#type-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/initial-view) |
1327
1315
 
1328
1316
  ##### `TableSnapshot<Z>`
1329
1317
 
@@ -1354,9 +1342,10 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
1354
1342
  | `filter` *required* | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters and row filters by id, in the order in which they were set. Whatever fits no column and no row filter is absent.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside) |
1355
1343
  | `setFilter` *required* | [`SetFilter`](#type-SetFilter)`<Z>` | — | Sets the condition of a column filter or a row filter; `null` clears it. Back to page one. A condition that does not fit the kind of the filter – a range on a list filter, a column without a filter, a row filter not in `rowFilters` – is passed over with a warning in development.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside), [Filter by a field no column shows (Filter)](#/filter/a-field-no-column-shows), [Rows from a request (Filter)](#/filter/rows-from-a-request) and 5 more |
1356
1344
  | `conditionOf` *required* | `<B>(filter: `[`RowFilter`](#/filter/type-RowFilter)`<Z, B>) => B \| null` | — | The condition of a row filter, as its type - `null` while it is lifted.<br>Shown in: [Filter by a field no column shows (Filter)](#/filter/a-field-no-column-shows), [Rows from a request (Filter)](#/filter/rows-from-a-request), [Ask a question over several fields (Filter)](#/filter/a-question-over-several-fields) and 3 more |
1357
- | `selection` *required* | [`TableSelection`](#type-TableSelection)`<string>` | — | The selection – its own or the one handed in through `selection`.<br>Shown in: [Select rows (Selection)](#/selection/selection), [Copy the selection (Export)](#/export/copy-the-selection), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation) and 2 more |
1345
+ | `selection` *required* | [`TableSelection`](#type-TableSelection)`<string>` | — | The selection – its own or the one handed in through `selection`.<br>Shown in: [Select rows (Selection)](#/selection/selection), [Copy the selection (Export)](#/export/copy-the-selection), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation) and 3 more |
1358
1346
  | `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/group-and-fold-from-controls-of-your-own) |
1359
1347
  | `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/group-and-fold-from-controls-of-your-own) |
1348
+ | `setView` *required* | `(view: `[`TableView`](#type-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/initial-view) |
1360
1349
  | `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/group-and-fold-from-controls-of-your-own) |
1361
1350
  | `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/group-and-fold-from-controls-of-your-own) |
1362
1351
  | `foldAll` *required* | `() => void` | — | Folds every group that has more than one row.<br>Shown in: [Fold groups into a summary (Grouping)](#/grouping/the-overview) |
@@ -1472,11 +1461,11 @@ selection.
1472
1461
 
1473
1462
  | Prop | Type | Default | Description |
1474
1463
  |---|---|---|---|
1475
- | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
1464
+ | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
1476
1465
  | `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
1477
1466
  | `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
1478
1467
  | `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. |
1479
- | `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide) and 4 more |
1468
+ | `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts), [Find a late shipment (Scenarios)](#/scenarios/find-a-late-shipment) |
1480
1469
  | `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
1481
1470
  | `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
1482
1471
  | `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Copy the selection (Export)](#/export/copy-the-selection) and 2 more |
@@ -1721,6 +1710,8 @@ Without a presentation the value type decides: text on the left, numbers right-a
1721
1710
 
1722
1711
  A computed value needs an `id`. One column is the row header: it names the row, cannot be hidden, and the row's checkbox and actions are read out with it.
1723
1712
 
1713
+ A computed `value` (like `sortValue`, `groupValue` and `rowKey`) may be written inline: a new function with the same source text counts as the same one, and nothing is recomputed. A closure that reads an outer variable which has changed reads as unchanged; give the function a new text, or carry the variable in the row data.
1714
+
1724
1715
  #### Examples
1725
1716
 
1726
1717
  ##### Read a value from a field
@@ -1887,29 +1878,26 @@ The `label` is the column header's text, and so what a screen reader says for ev
1887
1878
 
1888
1879
  | Prop | Type | Default | Description |
1889
1880
  |---|---|---|---|
1890
- | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 116 more |
1881
+ | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 118 more |
1891
1882
  | `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/format), [Share a column between tables (Presets)](#/presets/presets) |
1892
1883
  | `format` | [`FormatFor`](#type-FormatFor)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"dateTime"` for points in time. Alignment, sorting, export and footer stay with the value.<br>Shown in: [Compute a value from the row](#/column/computed-value), [Set wording and formats once (Provider)](#/provider/provider), [Pick a standard format (Formats)](#/formats/format) and 33 more |
1893
1884
  | `filter` | [`FilterFor`](#type-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/a-label-wider-than-its-column), [Share a column between tables (Presets)](#/presets/presets), [Choose from the values that occur (Filter)](#/filter/list-filter) and 11 more |
1894
1885
  | `group` | [`GroupFor`](#type-GroupFor)`<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Group dates by month (Grouping)](#/grouping/by-month) |
1895
- | `aggregate` | [`AggregateFor`](#type-AggregateFor)`<Z[K], 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. Not together with `footer`, its old name. From `AggregateOptions`.<br>Shown in: [Show absent values (Formats)](#/formats/absent-values), [Share a column between tables (Presets)](#/presets/presets), [Keep values between two bounds (Filter)](#/filter/range-filter) and 33 more |
1896
- | `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. The share bar under a sum in a group's header. From `AggregateOptions`.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Show each group's share (Aggregate)](#/aggregate/share-bar), [Weight a rate by its rows (Aggregate)](#/aggregate/never-an-average-of-averages) and 2 more |
1897
1886
  | `edit` | [`EditFor`](#type-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/presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid), [Edit a comments column (Edits)](#/edits/comments-column) and 6 more |
1898
1887
  | `editOptions` | `readonly `[`Present`](#type-Present)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Check an edit before it is reported (Edits)](#/edits/validated-edits), [Save a row on purpose (Edits)](#/edits/save-a-row-on-purpose) and 1 more |
1899
1888
  | `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/presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid), [Check an edit before it is reported (Edits)](#/edits/validated-edits) and 3 more |
1900
- | `children` | [`Presentation`](#type-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/presentation), [Show absent values (Formats)](#/formats/absent-values), [Fit what does not fit (Formats)](#/formats/values-that-do-not-fit) and 7 more |
1901
- | `footer` | [`FooterFor`](#type-FooterFor)`<Z[K]>` | — | *Deprecated* Is called `aggregate` now – the same values, and in a grouped table the group's as well. The old name goes with the next minor version. The old name of `aggregate` – not together with it.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets) |
1889
+ | `children` | [`Presentation`](#type-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/presentation), [Show absent values (Formats)](#/formats/absent-values), [Fit what does not fit (Formats)](#/formats/values-that-do-not-fit) and 9 more |
1902
1890
 
1903
- Also every prop of `ColumnBase` and `ValuePaths`.
1891
+ Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
1904
1892
 
1905
1893
  ##### `ColumnBase`
1906
1894
 
1907
1895
  | Prop | Type | Default | Description |
1908
1896
  |---|---|---|---|
1909
- | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 116 more |
1910
- | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 115 more |
1897
+ | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 118 more |
1898
+ | `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/value-from-field), [Compute a value from the row](#/column/computed-value), [Let the value type decide](#/column/defaults) and 117 more |
1911
1899
  | `numeric` | `boolean` | decided by the first value present | Right-aligned with tabular figures.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets) |
1912
- | `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Fit long values (Formats)](#/formats/long-values), [Fit what does not fit (Formats)](#/formats/values-that-do-not-fit), [Let people set the width (Width and pinning)](#/width-and-pinning/width) and 14 more |
1900
+ | `width` | `number` | the browser's | Initial width in pixels.<br>Shown in: [Fit long values (Formats)](#/formats/long-values), [Fit what does not fit (Formats)](#/formats/values-that-do-not-fit), [Let people set the width (Width and pinning)](#/width-and-pinning/width) and 15 more |
1913
1901
  | `resizable` | `boolean` | — | Shows the drag grip on the header cell.<br>Shown in: [Let people set the width (Width and pinning)](#/width-and-pinning/width), [Pin and size from controls of your own (Width and pinning)](#/width-and-pinning/pin-and-size-from-controls-of-your-own), [Share a column between tables (Presets)](#/presets/presets) and 1 more |
1914
1902
  | `pin` | [`Pin`](#type-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/pinned-both-sides), [Share a column between tables (Presets)](#/presets/presets), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid) and 1 more |
1915
1903
  | `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/long-values), [Fit what does not fit (Formats)](#/formats/values-that-do-not-fit), [Let people set the width (Width and pinning)](#/width-and-pinning/width) and 6 more |
@@ -1920,7 +1908,7 @@ Also every prop of `ColumnBase` and `ValuePaths`.
1920
1908
 
1921
1909
  | Prop | Type | Default | Description |
1922
1910
  |---|---|---|---|
1923
- | `sortValue` | `(value: `[`Present`](#type-Present)`<W>) => string \| number \| `[`Absent`](#type-Absent) | — | What is sorted by, when not by the value itself.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Sort and export a value that is an object (Sorting)](#/sorting/own-ordering) |
1911
+ | `sortValue` | `(value: `[`Present`](#type-Present)`<W>) => string \| number \| `[`Absent`](#type-Absent) | — | What is sorted by, when not by the value itself.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Sort and export a value that is an object (Sorting)](#/sorting/own-ordering), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
1924
1912
  | `exportValue` | `(value: `[`Present`](#type-Present)`<W>) => string \| number \| `[`Absent`](#type-Absent) | — | What stands in the export, when not the value itself.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Sort and export a value that is an object (Sorting)](#/sorting/own-ordering) |
1925
1913
  | `groupValue` | `(value: `[`Present`](#type-Present)`<W>) => string \| number \| boolean \| Date \| `[`Absent`](#type-Absent) | — | What is grouped by, when not the value itself - a group header of a number, say. Rows whose group value is absent form a group of their own.<br>Shown in: [Share a column between tables (Presets)](#/presets/presets), [Group numbers in bands (Grouping)](#/grouping/in-bands) |
1926
1914
 
@@ -1962,20 +1950,6 @@ year.
1962
1950
  type GroupFor<W> = [Present<W>] extends [Date] ? DatePeriod : never;
1963
1951
  ```
1964
1952
 
1965
- ###### `AggregateFor<W, Z>`
1966
-
1967
- What a column accepts as `aggregate`: sums and averages for numbers, the
1968
- extremes for numbers and points in time, the range for points in time,
1969
- counts for every value with a text form - or a function of one's own.
1970
-
1971
- ```ts
1972
- type AggregateFor<W, Z> =
1973
- | ([Present<W>] extends [number] ? "sum" | "avg" | "min" | "max" : never)
1974
- | ([Present<W>] extends [Date] ? "min" | "max" | "range" : never)
1975
- | (IsDisplayable<W> extends true ? "count" | "distinct" : never)
1976
- | AggregateFunction<W, Z>;
1977
- ```
1978
-
1979
1953
  ###### `EditFor<W, Z>`
1980
1954
 
1981
1955
  What a column accepts as `edit`: the core field for its value - `"text"`
@@ -2006,15 +1980,6 @@ What a column draws in a cell: the value present and its row.
2006
1980
  type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
2007
1981
  ```
2008
1982
 
2009
- ###### `FooterFor<W>`
2010
-
2011
- What the old `footer` accepts: `"sum"` and `"avg"` for numbers, nothing
2012
- for every other value.
2013
-
2014
- ```ts
2015
- type FooterFor<W> = [Present<W>] extends [number] ? "sum" | "avg" : never;
2016
- ```
2017
-
2018
1983
  ###### `Pin`
2019
1984
 
2020
1985
  Where a pinned column stands: in the block before or after the others.
@@ -2069,16 +2034,6 @@ The span a point in time is grouped by.
2069
2034
  type DatePeriod = "day" | "week" | "month" | "year";
2070
2035
  ```
2071
2036
 
2072
- ###### `AggregateFunction<W, Z>`
2073
-
2074
- An aggregate of one's own: the values present and the rows of the group -
2075
- or of the filtered set, in the footer. Its result runs through the column's
2076
- presentation; `undefined` means there is none.
2077
-
2078
- ```ts
2079
- type AggregateFunction<W, Z> = (values: readonly Present<NoInfer<W>>[], rows: readonly Z[]) => Present<NoInfer<W>> | undefined;
2080
- ```
2081
-
2082
2037
  ###### `CellEditorProps<W, Z>`
2083
2038
 
2084
2039
  What an editor of one's own receives. The table holds the draft; Enter,
@@ -2363,7 +2318,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
2363
2318
  | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
2364
2319
  | [`id`](#/column/FieldColumn-id) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
2365
2320
  | [`format`](#/column/FieldColumn-format) | [`FormatFor`](#/column/type-FormatFor)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"dateTime"` for points in time. Alignment, sorting, export and footer stay with the value. |
2366
- | [`aggregate`](#/column/FieldColumn-aggregate) | [`AggregateFor`](#/column/type-AggregateFor)`<Z[K], 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. Not together with `footer`, its old name. From `AggregateOptions`. |
2367
2321
  | [`children`](#/column/FieldColumn-children) | [`Presentation`](#/column/type-Presentation)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
2368
2322
 
2369
2323
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
@@ -2938,13 +2892,10 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
2938
2892
  | [`format`](#/column/FieldColumn-format) | [`FormatFor`](#/column/type-FormatFor)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"dateTime"` for points in time. Alignment, sorting, export and footer stay with the value. |
2939
2893
  | [`filter`](#/column/FieldColumn-filter) | [`FilterFor`](#/column/type-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. |
2940
2894
  | [`group`](#/column/FieldColumn-group) | [`GroupFor`](#/column/type-GroupFor)`<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`. |
2941
- | [`aggregate`](#/column/FieldColumn-aggregate) | [`AggregateFor`](#/column/type-AggregateFor)`<Z[K], 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. Not together with `footer`, its old name. From `AggregateOptions`. |
2942
- | [`share`](#/column/FieldColumn-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. The share bar under a sum in a group's header. From `AggregateOptions`. |
2943
2895
  | [`edit`](#/column/FieldColumn-edit) | [`EditFor`](#/column/type-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`. |
2944
2896
  | [`editOptions`](#/column/FieldColumn-editOptions) | `readonly `[`Present`](#/column/type-Present)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`. |
2945
2897
  | [`validate`](#/column/FieldColumn-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`. |
2946
2898
  | [`children`](#/column/FieldColumn-children) | [`Presentation`](#/column/type-Presentation)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
2947
- | [`footer`](#/column/FieldColumn-footer) | [`FooterFor`](#/column/type-FooterFor)`<Z[K]>` | — | *Deprecated* Is called `aggregate` now – the same values, and in a grouped table the group's as well. The old name goes with the next minor version. The old name of `aggregate` – not together with it. |
2948
2899
 
2949
2900
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
2950
2901
 
@@ -3332,7 +3283,7 @@ The keys of [First table](#/first-table/keyboard-first-table) and [Input](https:
3332
3283
 
3333
3284
  | Prop | Type | Default | Description |
3334
3285
  |---|---|---|---|
3335
- | `placeholder` | `string` | the wording's "Search …" | The placeholder in the field.<br>Shown in: [Find a person](#/search/find-a-person), [Leave a column out](#/search/leave-a-column-out), [Search from a card header](#/search/search-from-a-card-header) and 22 more |
3286
+ | `placeholder` | `string` | the wording's "Search …" | The placeholder in the field.<br>Shown in: [Find a person](#/search/find-a-person), [Leave a column out](#/search/leave-a-column-out), [Search from a card header](#/search/search-from-a-card-header) and 23 more |
3336
3287
  | `size` | [`ToolbarSize`](#type-ToolbarSize)<br>`"sm" \| "md"` | the size of the toolbar it stands in, `"sm"` outside one | The size of the part: `sm` or `md`.<br>Shown in: [Parts outside a toolbar (Toolbar)](#/toolbar/parts-outside-a-toolbar) |
3337
3288
  | `grow` | `boolean` | `false` | Take the rest of the toolbar's line: the parts after the search - column menu, export - stand at its end.<br>Shown in: [Search takes the line](#/search/search-takes-the-line) |
3338
3289
  | `of` | [`TableRef`](#type-TableRef) | — | The table, when the part does not stand inside it: the return value of `useTable`.<br>Shown in: [Search from a card header](#/search/search-from-a-card-header), [Place it outside the table (Toolbar)](#/toolbar/place-it-outside), [Parts outside a toolbar (Toolbar)](#/toolbar/parts-outside-a-toolbar) and 1 more |
@@ -6273,7 +6224,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
6273
6224
  | Prop | Type | Default | Description |
6274
6225
  |---|---|---|---|
6275
6226
  | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
6276
- | [`aggregate`](#/column/FieldColumn-aggregate) | [`AggregateFor`](#/column/type-AggregateFor)`<Z[K], 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. Not together with `footer`, its old name. From `AggregateOptions`. |
6277
6227
 
6278
6228
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
6279
6229
 
@@ -6677,7 +6627,7 @@ The keys of [First table](#/first-table/keyboard-first-table) and [Input](https:
6677
6627
 
6678
6628
  | Prop | Type | Default | Description |
6679
6629
  |---|---|---|---|
6680
- | `aggregate` | [`AggregateFor`](#type-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/sum-and-average), [Find the extremes](#/aggregate/minimum-and-maximum), [Show a range of dates](#/aggregate/range-of-dates) and 33 more |
6630
+ | `aggregate` | [`AggregateFor`](#type-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/sum-and-average), [Find the extremes](#/aggregate/minimum-and-maximum), [Show a range of dates](#/aggregate/range-of-dates) and 34 more |
6681
6631
  | `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/share-bar), [Weight a rate by its rows](#/aggregate/never-an-average-of-averages), [Share a column between tables (Presets)](#/presets/presets) and 2 more |
6682
6632
 
6683
6633
  ##### Types on this page
@@ -7190,7 +7140,7 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
7190
7140
  | Prop | Type | Default | Description |
7191
7141
  |---|---|---|---|
7192
7142
  | [`rowKey`](#/first-table/TableOptions-rowKey) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
7193
- | [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-TableView) | — | The view to start from, and to go to whenever one differing in content from the last is handed in - the same view again changes nothing, and what it leaves out is reset; one the table reported itself, handed back late, is its own state coming back and not gone to. The table remembers none: where a view is kept is the application's decision. Names no column carries fall out. |
7143
+ | [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-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. |
7194
7144
 
7195
7145
  From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
7196
7146
 
@@ -7922,10 +7872,6 @@ export default function PartsOutsideAToolbar() {
7922
7872
  }
7923
7873
  ```
7924
7874
 
7925
- #### When to use something else
7926
-
7927
- - Actions that should stay in view while the page scrolls → `Dock` from @umriss-ui/core
7928
-
7929
7875
  #### Keyboard
7930
7876
 
7931
7877
  The keys of [First table](#/first-table/keyboard-first-table), [Input](https://romanhaendler.github.io/umriss-ui/core/input/#keyboard-input), [ColumnMenu](#/columnmenu/keyboard-columnmenu), [RowActions](#/rowactions/keyboard-rowactions), [Button](https://romanhaendler.github.io/umriss-ui/core/button/#keyboard-button) and [Checkbox](https://romanhaendler.github.io/umriss-ui/core/checkbox/#keyboard-checkbox) apply here.
@@ -7942,7 +7888,7 @@ The parts the table puts in name themselves: the search field “Search table”
7942
7888
 
7943
7889
  | Prop | Type | Default | Description |
7944
7890
  |---|---|---|---|
7945
- | `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Search, arrange and export](#/toolbar/search-arrange-and-export), [Place it outside the table](#/toolbar/place-it-outside), [Set wording and formats once (Provider)](#/provider/provider) and 36 more |
7891
+ | `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Search, arrange and export](#/toolbar/search-arrange-and-export), [Place it outside the table](#/toolbar/place-it-outside), [Set wording and formats once (Provider)](#/provider/provider) and 37 more |
7946
7892
  | `size` | [`ToolbarSize`](#type-ToolbarSize)<br>`"sm" \| "md"` | `"sm"` | The size of every control the table puts into it - search, column menu, export, "reset", the bulk actions -: `sm` or `md`. A control of one's own takes the same size by its own prop.<br>Shown in: [A larger toolbar (Toolbar controls)](#/toolbar-controls/a-larger-toolbar), [A dispatcher's bar (Toolbar controls)](#/toolbar-controls/a-dispatcher-s-bar) |
7947
7893
  | `of` | [`TableRef`](#type-TableRef) | — | The table, when the table toolbar does not stand inside it. If it then stands behind the table in the tree, it registers only after the first frame – until then a table with a search or a column filter shows its own toolbar. Placed before the table, there is no such change.<br>Shown in: [Place it outside the table](#/toolbar/place-it-outside), [Review cost centres against budget (Scenarios)](#/scenarios/review-cost-centres) |
7948
7894
 
@@ -8666,7 +8612,7 @@ The keys of [First table](#/first-table/keyboard-first-table), [Input](https://r
8666
8612
 
8667
8613
  | Prop | Type | Default | Description |
8668
8614
  |---|---|---|---|
8669
- | `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Controls of your own at the toolbar's size](#/toolbar-controls/controls-at-the-toolbars-size), [A larger toolbar](#/toolbar-controls/a-larger-toolbar), [A dispatcher's bar](#/toolbar-controls/a-dispatcher-s-bar) and 36 more |
8615
+ | `children` | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions.<br>Shown in: [Controls of your own at the toolbar's size](#/toolbar-controls/controls-at-the-toolbars-size), [A larger toolbar](#/toolbar-controls/a-larger-toolbar), [A dispatcher's bar](#/toolbar-controls/a-dispatcher-s-bar) and 37 more |
8670
8616
  | `size` | [`ToolbarSize`](#type-ToolbarSize)<br>`"sm" \| "md"` | `"sm"` | The size of every control the table puts into it - search, column menu, export, "reset", the bulk actions -: `sm` or `md`. A control of one's own takes the same size by its own prop.<br>Shown in: [A larger toolbar](#/toolbar-controls/a-larger-toolbar), [A dispatcher's bar](#/toolbar-controls/a-dispatcher-s-bar) |
8671
8617
  | `of` | [`TableRef`](#type-TableRef) | — | The table, when the table toolbar does not stand inside it. If it then stands behind the table in the tree, it registers only after the first frame – until then a table with a search or a column filter shows its own toolbar. Placed before the table, there is no such change.<br>Shown in: [Place it outside the table (Toolbar)](#/toolbar/place-it-outside), [Review cost centres against budget (Scenarios)](#/scenarios/review-cost-centres) |
8672
8618
 
@@ -9044,13 +8990,13 @@ import { useTable } from "@umriss-ui/table";
9044
8990
 
9045
8991
  Demo page: https://romanhaendler.github.io/umriss-ui/table/view/
9046
8992
 
9047
- 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 and hand it back through `initialView`. A view that differs from the last one handed in applies at once, the same one again changes nothing - two tables stay in step by handing each other what they report.
8993
+ 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.
9048
8994
 
9049
8995
  #### Examples
9050
8996
 
9051
8997
  ##### Keep and restore a view
9052
8998
 
9053
- `onViewChange` reports search, sort, hidden columns and widths as one view; hand one back through `initialView` and the table goes to it, no `key` needed. Sort, hide, drag a width, then restore.
8999
+ `t.view` holds search, sort, hidden columns and widths as one value; keep one and go back to it with `t.setView`, no `key` needed. Sort, hide, drag a width, then restore.
9054
9000
 
9055
9001
  ```tsx
9056
9002
  import { useState } from "react";
@@ -9078,12 +9024,12 @@ const INVOICES: Invoice[] = [
9078
9024
  ];
9079
9025
 
9080
9026
  export default function InitialView() {
9081
- /* The application keeps the view the table reports; handing it another one
9082
- is all it takes to restore. */
9083
- const [view, setView] = useState(START_VIEW);
9027
+ /* The table holds its view and starts from `initialView`; `t.view` is what
9028
+ it shows now, and `t.setView` restores a kept one. */
9084
9029
  const [kept, setKept] = useState<TableView | null>(null);
9085
- const t = useTable(INVOICES, { rowKey: (i) => i.id, initialView: view, onViewChange: setView });
9086
- const { Table, Column } = t;
9030
+ const [reports, setReports] = useState(0);
9031
+ const t = useTable(INVOICES, { rowKey: (i) => i.id, initialView: START_VIEW, onViewChange: () => setReports((n) => n + 1) });
9032
+ const { Table, Column, view, setView } = t;
9087
9033
 
9088
9034
  return (
9089
9035
  <Stack gap={3}>
@@ -9099,7 +9045,7 @@ export default function InitialView() {
9099
9045
  </Table>
9100
9046
  <Stack gap={1}>
9101
9047
  <Text as="span" size="sm" tone="secondary">
9102
- What the application would keep
9048
+ What the application would keep - reported {reports} times; a restore is not a report
9103
9049
  </Text>
9104
9050
  {/* JSON has no space to break at: without this it ran past a phone's card. */}
9105
9051
  <Text as="code" size="sm" mono data-role="view" style={{ overflowWrap: "anywhere" }}>
@@ -9145,18 +9091,19 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
9145
9091
  | Prop | Type | Default | Description |
9146
9092
  |---|---|---|---|
9147
9093
  | [`rowKey`](#/first-table/TableOptions-rowKey) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
9148
- | [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-TableView) | — | The view to start from, and to go to whenever one differing in content from the last is handed in - the same view again changes nothing, and what it leaves out is reset; one the table reported itself, handed back late, is its own state coming back and not gone to. The table remembers none: where a view is kept is the application's decision. Names no column carries fall out. |
9094
+ | [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-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. |
9149
9095
 
9150
9096
  ###### Events
9151
9097
 
9152
9098
  | Prop | Type | Default | Description |
9153
9099
  |---|---|---|---|
9154
- | [`onViewChange`](#/first-table/TableOptions-onViewChange) | `(view: `[`TableView`](#/first-table/type-TableView)`) => void` | — | Every change of the view, once, always the whole view - the one to keep, or to hand another table as its `initialView`. Not called for the view the table starts with. |
9100
+ | [`onViewChange`](#/first-table/TableOptions-onViewChange) | `(view: `[`TableView`](#/first-table/type-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. |
9155
9101
 
9156
9102
  From `TableSnapshot` — the full table stands on [First table](#/first-table/type-TableSnapshot).
9157
9103
 
9158
9104
  | Prop | Type | Default | Description |
9159
9105
  |---|---|---|---|
9106
+ | [`setView`](#/first-table/TableSnapshot-setView) *required* | `(view: `[`TableView`](#/first-table/type-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. |
9160
9107
  | [`view`](#/first-table/TableSnapshot-view) *required* | [`TableView`](#/first-table/type-TableView) | — | The part of the state an application can keep; whatever still stands as the options set it up is absent. |
9161
9108
 
9162
9109
  From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
@@ -9642,6 +9589,388 @@ From `ToolbarProps` — the full table stands on [Toolbar](#/toolbar/type-Toolba
9642
9589
 
9643
9590
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
9644
9591
 
9592
+ ### Benchmark
9593
+
9594
+ Up to two hundred thousand rows, measured in this browser rather than claimed: the first render, a scroll step, a sort, a keystroke, a page, a fold, a hidden column and a re-render of the caller.
9595
+
9596
+ ```ts
9597
+ import { useTable } from "@umriss-ui/table";
9598
+ ```
9599
+
9600
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/benchmark/
9601
+
9602
+ The figures come from the clock around each change, with nothing added to the table. The reference figures in `packages/table/docs/capabilities.md` come from here.
9603
+
9604
+ #### Examples
9605
+
9606
+ ##### Measure two hundred thousand rows
9607
+
9608
+ Load up to 200 000 rows and run a change: the times say what rendering, scrolling, sorting, searching, paging, folding and hiding cost here.
9609
+
9610
+ ```tsx
9611
+ /* What the table costs, measured from outside with the clock: the first render,
9612
+ a scroll step, a sort, a search keystroke, a page turned, a group folded, a
9613
+ column hidden and a re-render of the caller with nothing changed. The page
9614
+ adds nothing to the table. Not photographed: it measures the moment it runs.
9615
+
9616
+ A figure is the synchronous time of `flushSync` around the change - render,
9617
+ commit and layout effects, not the paint. Every change but the scroll is the
9618
+ median of five runs; the scroll is the mean over a scripted scroll, timed to
9619
+ the change of the rows in the DOM because the table renders it outside
9620
+ `flushSync`. A
9621
+ production build has no React profiler, so the clock is the only instrument.
9622
+
9623
+ The page is driven by a script as well as by hand: every control and every
9624
+ figure carries a `data-role`, and `status` reads idle, running or done. */
9625
+
9626
+ import { useRef, useState } from "react";
9627
+ import { flushSync } from "react-dom";
9628
+ import { Badge, Button, Stack, Text } from "@umriss-ui/core";
9629
+ import { Pagination, Search, Toolbar, useTable } from "@umriss-ui/table";
9630
+
9631
+ interface Request {
9632
+ id: string;
9633
+ service: string;
9634
+ status: 200 | 404 | 500;
9635
+ duration: number;
9636
+ size: number;
9637
+ region: string;
9638
+ }
9639
+
9640
+ const SERVICES = ["Checkout", "Billing", "Sign-in", "Search", "Image service", "Notifications", "Webhooks", "Reporting"] as const;
9641
+ const REGIONS = ["eu-west", "eu-central", "us-east", "ap-south"] as const;
9642
+ const STATUSES = [200, 200, 200, 200, 200, 200, 404, 500] as const;
9643
+ const TONE = { 200: "success", 404: "warning", 500: "danger" } as const;
9644
+
9645
+ /* A linear congruential generator: the same rows on every run. */
9646
+ function generate(count: number): Request[] {
9647
+ let seed = 20260317;
9648
+ const next = () => {
9649
+ seed = (seed * 1103515245 + 12345) % 2147483648;
9650
+ return seed / 2147483648;
9651
+ };
9652
+ return Array.from({ length: count }, (_, i) => ({
9653
+ id: `REQ-${String(i + 1).padStart(6, "0")}`,
9654
+ service: SERVICES[Math.floor(next() * SERVICES.length)]!,
9655
+ status: STATUSES[Math.floor(next() * STATUSES.length)]!,
9656
+ duration: Math.round(20 + next() * 900),
9657
+ size: Math.round(next() * 5000) / 10,
9658
+ region: REGIONS[Math.floor(next() * REGIONS.length)]!,
9659
+ }));
9660
+ }
9661
+
9662
+ /** `virtual`: a virtualised table with a footer aggregate. `grouped`: the same,
9663
+ grouped by service with share bars. `paged`: pages instead of a window, the
9664
+ only mode in which a page can be turned. */
9665
+ type Mode = "virtual" | "grouped" | "paged";
9666
+
9667
+ const SIZES = [10_000, 50_000, 200_000] as const;
9668
+ const MODES: readonly Mode[] = ["virtual", "grouped", "paged"];
9669
+
9670
+ /* The table under measurement. `tick` is not read: a new value only makes the
9671
+ caller render this component again, with the accessors below written inline
9672
+ as the examples write them. */
9673
+ function Measured({ rows, mode, onTable }: { rows: Request[]; mode: Mode; tick: number; onTable: (t: Handle) => void }) {
9674
+ const t = useTable(rows, {
9675
+ rowKey: (r) => r.id,
9676
+ virtual: mode !== "paged",
9677
+ pageSize: 50,
9678
+ defaultGrouping: mode === "grouped" ? "service" : undefined,
9679
+ });
9680
+ onTable(t);
9681
+ const { Table, Column } = t;
9682
+ return (
9683
+ <Table maxHeight="340px" stickyHeader ariaLabel="Requests">
9684
+ <Toolbar>
9685
+ <Search placeholder="Request or service" />
9686
+ </Toolbar>
9687
+ <Column value="id" label="Request" rowHeader width={130} />
9688
+ <Column value="service" label="Service" width={140} />
9689
+ <Column value="status" label="Status" width={100}>
9690
+ {(status) => <Badge tone={TONE[status]}>{status}</Badge>}
9691
+ </Column>
9692
+ <Column value="duration" label="Duration (ms)" width={130} aggregate="sum" />
9693
+ {/* A computed column, its function written inline: a new one on every
9694
+ render of the caller, which is what the re-render figure is about. */}
9695
+ <Column id="size" value={(r) => r.size} label="Size (kB)" format={{ decimals: 1 }} width={110} aggregate="sum" />
9696
+ <Column value="region" label="Region" width={120} />
9697
+ {mode === "paged" ? <Pagination /> : null}
9698
+ </Table>
9699
+ );
9700
+ }
9701
+
9702
+ /** The calls the measurements make on the table. */
9703
+ interface Handle {
9704
+ toggleSort: (column: string) => void;
9705
+ setSearch: (search: string) => void;
9706
+ setPage: (page: number) => void;
9707
+ foldAll: () => void;
9708
+ unfoldAll: () => void;
9709
+ toggleColumn: (column: string) => void;
9710
+ }
9711
+
9712
+ const FIGURES = ["first-render", "scroll", "sort", "search", "page", "fold", "hide", "rerender"] as const;
9713
+ type Figure = (typeof FIGURES)[number];
9714
+ type Status = "idle" | "running" | "done";
9715
+
9716
+ const REPEATS = 5;
9717
+ const SCROLL_STEPS = 60;
9718
+ const QUERIES = ["eu", "web", "500", "pay", "us-"];
9719
+
9720
+ const timed = (change: () => void): number => {
9721
+ const start = performance.now();
9722
+ flushSync(change);
9723
+ return performance.now() - start;
9724
+ };
9725
+ const median = (values: number[]): number => [...values].sort((a, b) => a - b)[Math.floor(values.length / 2)]!;
9726
+ /* Lets the browser paint "running" before a measurement blocks the thread, and
9727
+ settles what a change left behind. */
9728
+ const settle = () => new Promise<void>((resolve) => setTimeout(resolve, 50));
9729
+
9730
+ export default function Benchmark() {
9731
+ const [load, setLoad] = useState<{ rows: Request[]; mode: Mode; key: number }>({ rows: [], mode: "virtual", key: 0 });
9732
+ const [tick, setTick] = useState(0);
9733
+ const [count, setCount] = useState(String(SIZES[0]));
9734
+ const [status, setStatus] = useState<Status>("idle");
9735
+ const [figures, setFigures] = useState<Partial<Record<Figure, string>>>({});
9736
+ const table = useRef<Handle | null>(null);
9737
+ const host = useRef<HTMLDivElement>(null);
9738
+ const generated = useRef<Request[]>([]);
9739
+
9740
+ /* A figure that does not apply in this mode reads "-". */
9741
+ const show = (figure: Figure, ms: number | null) =>
9742
+ setFigures((f) => ({ ...f, [figure]: ms === null ? "-" : ms.toFixed(1) }));
9743
+
9744
+ const run = async (body: () => Promise<void> | void) => {
9745
+ flushSync(() => setStatus("running"));
9746
+ await settle();
9747
+ try {
9748
+ await body();
9749
+ } finally {
9750
+ setStatus("done");
9751
+ }
9752
+ };
9753
+
9754
+ const open = (n: number, mode: Mode) =>
9755
+ run(async () => {
9756
+ if (generated.current.length !== n) generated.current = generate(n);
9757
+ const rows = generated.current;
9758
+ /* The previous table goes first, so the figure is a mount and no more. */
9759
+ flushSync(() => setLoad({ rows: [], mode, key: load.key + 1 }));
9760
+ await settle();
9761
+ show("first-render", timed(() => setLoad({ rows, mode, key: load.key + 2 })));
9762
+ });
9763
+
9764
+ /* `change` is timed, `restore` is not; both run synchronously. */
9765
+ const repeat = (figure: Figure, applies: boolean, change: (i: number) => void, restore?: () => void) =>
9766
+ run(async () => {
9767
+ if (!applies || table.current === null) return show(figure, null);
9768
+ const times: number[] = [];
9769
+ for (let i = 0; i < REPEATS; i++) {
9770
+ times.push(timed(() => change(i)));
9771
+ if (restore) flushSync(restore);
9772
+ await settle();
9773
+ }
9774
+ show(figure, median(times));
9775
+ });
9776
+
9777
+ /* The scroll area is the table's parent, the element that carries the
9778
+ table's `onScroll`. */
9779
+ const scroller = (): HTMLElement | null => host.current?.querySelector("table")?.parentElement ?? null;
9780
+
9781
+ /* Each step moves the scroll position and then sends the scroll event inside
9782
+ the timing: the event reaches the table's handler the same way the browser's
9783
+ own, which comes a frame later, does. */
9784
+ const measureScroll = () =>
9785
+ run(async () => {
9786
+ const el = scroller();
9787
+ if (el === null || mode === "paged") return show("scroll", null);
9788
+ el.scrollTop = 0;
9789
+ await settle();
9790
+ let total = 0;
9791
+ for (let i = 0; i < SCROLL_STEPS; i++) {
9792
+ const start = performance.now();
9793
+ await new Promise<void>((resolve) => {
9794
+ const rows = new MutationObserver(() => {
9795
+ rows.disconnect();
9796
+ resolve();
9797
+ });
9798
+ rows.observe(el, { childList: true, subtree: true });
9799
+ el.scrollTop += 600;
9800
+ el.dispatchEvent(new Event("scroll"));
9801
+ setTimeout(() => {
9802
+ rows.disconnect();
9803
+ resolve();
9804
+ }, 1000);
9805
+ });
9806
+ total += performance.now() - start;
9807
+ /* The browser's own scroll event follows a frame later and finds the
9808
+ window already in place. */
9809
+ await new Promise((resolve) => setTimeout(resolve, 30));
9810
+ }
9811
+ show("scroll", total / SCROLL_STEPS);
9812
+ });
9813
+
9814
+ const t = () => table.current!;
9815
+ const mode = load.mode;
9816
+
9817
+ return (
9818
+ <Stack gap={3}>
9819
+ <Stack direction="row" gap={2} align="center" wrap>
9820
+ {SIZES.map((n) => (
9821
+ <Button
9822
+ key={n}
9823
+ size="sm"
9824
+ data-role={`rows-${n}`}
9825
+ onClick={() => {
9826
+ setCount(String(n));
9827
+ void open(n, mode);
9828
+ }}
9829
+ >
9830
+ {n.toLocaleString("en-US")} rows
9831
+ </Button>
9832
+ ))}
9833
+ <input
9834
+ type="number"
9835
+ min={1}
9836
+ max={200_000}
9837
+ aria-label="Row count"
9838
+ data-role="rows-input"
9839
+ value={count}
9840
+ onChange={(event) => setCount(event.target.value)}
9841
+ />
9842
+ <Button size="sm" data-role="load" onClick={() => void open(Math.min(200_000, Math.max(1, Number(count) || 1)), mode)}>
9843
+ Load
9844
+ </Button>
9845
+ {MODES.map((m) => (
9846
+ <Button
9847
+ key={m}
9848
+ size="sm"
9849
+ data-role={`mode-${m}`}
9850
+ aria-pressed={mode === m}
9851
+ onClick={() => void open(generated.current.length || SIZES[0], m)}
9852
+ >
9853
+ {m}
9854
+ </Button>
9855
+ ))}
9856
+ </Stack>
9857
+ <Stack direction="row" gap={2} align="center" wrap>
9858
+ <Button size="sm" data-role="measure-scroll" onClick={() => void measureScroll()}>Scroll</Button>
9859
+ <Button size="sm" data-role="measure-sort" onClick={() => void repeat("sort", true, () => t().toggleSort("duration"))}>Sort</Button>
9860
+ <Button
9861
+ size="sm"
9862
+ data-role="measure-search"
9863
+ onClick={() => void repeat("search", true, (i) => t().setSearch(QUERIES[i % QUERIES.length]!), () => t().setSearch(""))}
9864
+ >
9865
+ Search
9866
+ </Button>
9867
+ <Button size="sm" data-role="measure-page" onClick={() => void repeat("page", mode === "paged", (i) => t().setPage(2 + i), () => t().setPage(1))}>
9868
+ Page
9869
+ </Button>
9870
+ <Button size="sm" data-role="measure-fold" onClick={() => void repeat("fold", mode === "grouped", () => t().foldAll(), () => t().unfoldAll())}>
9871
+ Fold
9872
+ </Button>
9873
+ <Button size="sm" data-role="measure-hide" onClick={() => void repeat("hide", true, () => t().toggleColumn("region"), () => t().toggleColumn("region"))}>
9874
+ Hide column
9875
+ </Button>
9876
+ <Button size="sm" data-role="measure-rerender" onClick={() => void repeat("rerender", true, () => setTick((n) => n + 1))}>Re-render</Button>
9877
+ </Stack>
9878
+ <dl style={{ display: "flex", flexWrap: "wrap", gap: "1.5rem", margin: 0 }}>
9879
+ <div>
9880
+ <Text as="dt">Status</Text>
9881
+ <Text as="dd" mono style={{ margin: 0 }} data-role="status">{status}</Text>
9882
+ </div>
9883
+ <div>
9884
+ <Text as="dt">Rows</Text>
9885
+ <Text as="dd" mono style={{ margin: 0 }} data-role="rows">{load.rows.length}</Text>
9886
+ </div>
9887
+ {FIGURES.map((f) => (
9888
+ <div key={f}>
9889
+ <Text as="dt">{f} (ms)</Text>
9890
+ <Text as="dd" mono style={{ margin: 0 }} data-role={f}>{figures[f] ?? "-"}</Text>
9891
+ </div>
9892
+ ))}
9893
+ </dl>
9894
+ <div ref={host}>
9895
+ {load.rows.length > 0 ? (
9896
+ <Measured
9897
+ key={`${mode}-${load.key}`}
9898
+ rows={load.rows}
9899
+ mode={mode}
9900
+ tick={tick}
9901
+ onTable={(handle) => {
9902
+ table.current = handle;
9903
+ }}
9904
+ />
9905
+ ) : null}
9906
+ </div>
9907
+ </Stack>
9908
+ );
9909
+ }
9910
+ ```
9911
+
9912
+ #### Keyboard
9913
+
9914
+ The keys of [First table](#/first-table/keyboard-first-table), [Virtualisation](#/virtualisation/keyboard-virtualisation) and [Button](https://romanhaendler.github.io/umriss-ui/core/button/#keyboard-button) apply here.
9915
+
9916
+ #### Props on this page
9917
+
9918
+ From `TableProps` — the full table stands on [First table](#/first-table/type-TableProps).
9919
+
9920
+ | Prop | Type | Default | Description |
9921
+ |---|---|---|---|
9922
+ | [`stickyHeader`](#/first-table/TableProps-stickyHeader) | `boolean` | — | Keeps the header row visible while scrolling. |
9923
+ | [`maxHeight`](#/first-table/TableProps-maxHeight) | `string` | — | Height of the scroll area, e.g. "480px". A virtualised table needs it. |
9924
+ | [`children`](#/first-table/TableProps-children) | `ReactNode` | — | Columns, `RowDetail`, `RowActions` and the unbound parts. |
9925
+
9926
+ ###### Accessibility
9927
+
9928
+ | Prop | Type | Default | Description |
9929
+ |---|---|---|---|
9930
+ | [`ariaLabel`](#/first-table/TableProps-ariaLabel) | `string` | — | Accessible name of the table (not of the outer frame). |
9931
+
9932
+ From `TableOptions` — the full table stands on [First table](#/first-table/type-TableOptions).
9933
+
9934
+ | Prop | Type | Default | Description |
9935
+ |---|---|---|---|
9936
+ | [`rowKey`](#/first-table/TableOptions-rowKey) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
9937
+ | [`pageSize`](#/first-table/TableOptions-pageSize) | `number` | `10` | How many rows a page holds. |
9938
+ | [`defaultGrouping`](#/first-table/TableOptions-defaultGrouping) | [`GroupingId`](#/first-table/type-GroupingId)`<Z> \| readonly `[`GroupingId`](#/first-table/type-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. |
9939
+ | [`virtual`](#/first-table/TableOptions-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)). |
9940
+
9941
+ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
9942
+
9943
+ | Prop | Type | Default | Description |
9944
+ |---|---|---|---|
9945
+ | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
9946
+ | [`children`](#/column/FieldColumn-children) | [`Presentation`](#/column/type-Presentation)`<Z[K], Z>` | — | How the value appears: `(value, row)`. Never called for an absent value. Required where the value has no text form. |
9947
+
9948
+ From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
9949
+
9950
+ | Prop | Type | Default | Description |
9951
+ |---|---|---|---|
9952
+ | [`label`](#/column/ColumnBase-label) *required* | `string` | — | Names the column in its header, in the column menu and in the header row of the export. |
9953
+ | [`rowHeader`](#/column/ColumnBase-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. |
9954
+ | [`width`](#/column/ColumnBase-width) | `number` | the browser's | Initial width in pixels. |
9955
+
9956
+ From `SearchProps` — the full table stands on [Search](#/search/type-SearchProps).
9957
+
9958
+ | Prop | Type | Default | Description |
9959
+ |---|---|---|---|
9960
+ | [`placeholder`](#/search/SearchProps-placeholder) | `string` | the wording's "Search …" | The placeholder in the field. |
9961
+
9962
+ From `AggregateOptions` — the full table stands on [Aggregate](#/aggregate/type-AggregateOptions).
9963
+
9964
+ | Prop | Type | Default | Description |
9965
+ |---|---|---|---|
9966
+ | [`aggregate`](#/aggregate/AggregateOptions-aggregate) | [`AggregateFor`](#/aggregate/type-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. |
9967
+
9968
+ From `ToolbarProps` — the full table stands on [Toolbar](#/toolbar/type-ToolbarProps).
9969
+
9970
+ | Prop | Type | Default | Description |
9971
+ |---|---|---|---|
9972
+ | [`children`](#/toolbar/ToolbarProps-children) | `ReactNode` | — | Search, column menu, export – on the left in the table toolbar, before the conditions. |
9973
+
9645
9974
  ### Server mode
9646
9975
 
9647
9976
  A table over rows a server holds: the application hands in one page and the server's count, and the table reports what to fetch next (also called server-side paging, sorting and filtering).
@@ -10833,7 +11162,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
10833
11162
  |---|---|---|---|
10834
11163
  | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
10835
11164
  | [`format`](#/column/FieldColumn-format) | [`FormatFor`](#/column/type-FormatFor)`<Z[K]>` | — | A standard presentation by name: `"percent"`, `"count"` or `{ decimals }` for numbers, `"date"`, `"time"` or `"dateTime"` for points in time. Alignment, sorting, export and footer stay with the value. |
10836
- | [`aggregate`](#/column/FieldColumn-aggregate) | [`AggregateFor`](#/column/type-AggregateFor)`<Z[K], 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. Not together with `footer`, its old name. From `AggregateOptions`. |
10837
11165
  | [`edit`](#/column/FieldColumn-edit) | [`EditFor`](#/column/type-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`. |
10838
11166
  | [`validate`](#/column/FieldColumn-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`. |
10839
11167
 
@@ -11257,7 +11585,7 @@ What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendl
11257
11585
 
11258
11586
  ## Limits and alarms
11259
11587
 
11260
- A reading, read against its limits - and alarms with a lifecycle.
11588
+ A reading, read against its limits.
11261
11589
 
11262
11590
  ### VerdictColumn
11263
11591
 
@@ -11489,7 +11817,6 @@ export default function ShowTheWorst() {
11489
11817
  #### When to use something else
11490
11818
 
11491
11819
  - A single reading in a tile or a bar → `Meter` from @umriss-ui/core
11492
- - Alerts with a lifecycle that someone acknowledges → AlarmList
11493
11820
 
11494
11821
  #### Keyboard
11495
11822
 
@@ -11519,8 +11846,7 @@ From `@umriss-ui/core`.
11519
11846
  The set a value is read against.
11520
11847
 
11521
11848
  The target stands beside the limits and is not one: it is missed, never
11522
- violated, and it is never the edge of a region. Conflating the two is how a
11523
- tile turns red for being above target.
11849
+ violated, and it is never the edge of a region.
11524
11850
 
11525
11851
  | Prop | Type | Default | Description |
11526
11852
  |---|---|---|---|
@@ -11551,8 +11877,7 @@ A bound: a value, a side, a severity.
11551
11877
 
11552
11878
  No tolerance band as input. A band is derived - two limits of equal
11553
11879
  severity on opposite sides enclose one - and as an input type it would
11554
- force a `null` on one edge in the one-sided case. One-sided is the common
11555
- case, not the exception.
11880
+ force a `null` on one edge in the one-sided case.
11556
11881
 
11557
11882
  | Prop | Type | Default | Description |
11558
11883
  |---|---|---|---|
@@ -11575,8 +11900,7 @@ type Side = "upper" | "lower";
11575
11900
  From `@umriss-ui/core`.
11576
11901
 
11577
11902
  How seriously a violation weighs: one severity that advises and one that
11578
- calls for action. Exactly two - whoever offers five gets five colours on
11579
- the screen, and five colours are noise. For a third distinction one sets a
11903
+ calls for action. Exactly two; for a third distinction one sets a
11580
11904
  second limit.
11581
11905
 
11582
11906
  ```ts
@@ -11590,673 +11914,9 @@ type Severity = "warning" | "alarm";
11590
11914
 
11591
11915
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
11592
11916
 
11593
- ### AlarmList
11917
+ ## API index
11594
11918
 
11595
- The list of alerts someone has to see and acknowledge, worst first, with their state, age and frequency (also called an alarm or alert console). Reach for it wherever alerts arrive and a person answers for them.
11596
-
11597
- ```ts
11598
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11599
- ```
11600
-
11601
- Demo page: https://romanhaendler.github.io/umriss-ui/table/alarmlist/
11602
-
11603
- The library receives alerts and raises none ([ADR-0009](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0009-the-library-owns-a-lifecycle-not-a-generation.md)). [`alarmModel`](#/api/alarmModel) turns them into a sorted view – priority, then acknowledgement, then time – and the list shows it; your application applies the transitions ([`acknowledge`](#/api/acknowledge), [`snooze`](#/api/snooze), [`unsnooze`](#/api/unsnooze), [`disable`](#/api/disable), [`enable`](#/api/enable)) to its own state. The lifecycle is one field with four values, active or resolved × acknowledged or not, so an alert that came and went unseen stays until someone acknowledges it.
11604
-
11605
- Availability is a second field: snoozed by a person, with an end and a name, and the reason when it has one, all in the badge's tip and in what is spoken; suppressed by the application's logic; or disabled. A hidden alert keeps its lifecycle, stays in the list drawn neutral with its state as a word, and is counted; a snooze ends by the model's clock, with no timer. A flood is marked, never thinned out.
11606
-
11607
- The live region announces one number, the active unacknowledged alerts, not each arrival. With `onSnooze` and `snoozeDurations` the list offers snoozing beside “Acknowledge” (with `snoozeReason`, as a small panel that also asks for a reason, passed on as a third argument), and with `onUnsnooze` the ending of a snooze: it reports what the operator asked for and snoozes nothing - your application calls `snooze()` or refuses. The durations are yours; there is no default list. A filter by state or priority is the projection's `filter`, fed by controls of your own. The terms follow ISA-18.2; `docs/standards.md` maps each to its name here.
11608
-
11609
- #### Examples
11610
-
11611
- ##### Show the alerts
11612
-
11613
- Hand your alerts and their types to [`alarmModel`](#/api/alarmModel) and its projection to `AlarmList` as `view`; the worst stands first.
11614
-
11615
- ```tsx
11616
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11617
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11618
-
11619
- /* Data from the operations world, written out here so the example runs on its own. */
11620
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11621
-
11622
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11623
- const NOW = at(17, 10, 30);
11624
-
11625
- const ALERT_TYPES: readonly AlarmType[] = [
11626
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
11627
- { id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
11628
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
11629
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
11630
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
11631
- { id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
11632
- ];
11633
-
11634
- /** The alerts as they stand at 10:30. */
11635
- const ALERTS: readonly Alarm[] = [
11636
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
11637
- { id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
11638
- { id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
11639
- { id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
11640
- { id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
11641
- { id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
11642
- { id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
11643
- ];
11644
-
11645
- const view = alarmModel({ alarms: ALERTS, types: ALERT_TYPES, asOf: NOW });
11646
-
11647
- export default function ShowTheAlerts() {
11648
- return <AlarmList view={view} />;
11649
- }
11650
- ```
11651
-
11652
- ##### Acknowledge alerts
11653
-
11654
- Pass a `selection` and `onAcknowledge`, then apply [`acknowledge`](#/api/acknowledge) to your own state: the row changes state and stays in the list.
11655
-
11656
- ```tsx
11657
- import { useMemo, useState } from "react";
11658
- import { AlarmList, acknowledge, alarmModel, useTableSelection } from "@umriss-ui/table";
11659
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11660
-
11661
- /* Data from the operations world, written out here so the example runs on its own. */
11662
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11663
-
11664
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11665
- const NOW = at(17, 10, 30);
11666
-
11667
- const ALERT_TYPES: readonly AlarmType[] = [
11668
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
11669
- { id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
11670
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
11671
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
11672
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
11673
- { id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
11674
- ];
11675
-
11676
- /** The alerts as they stand at 10:30. */
11677
- const ALERTS: readonly Alarm[] = [
11678
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
11679
- { id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
11680
- { id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
11681
- { id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
11682
- { id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
11683
- { id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
11684
- { id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
11685
- ];
11686
-
11687
- export default function AcknowledgeAlerts() {
11688
- const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
11689
- const view = useMemo(() => alarmModel({ alarms: alerts, types: ALERT_TYPES, asOf: NOW }), [alerts]);
11690
- const selection = useTableSelection(view.filtered.map((row) => row.id));
11691
-
11692
- return (
11693
- <AlarmList
11694
- view={view}
11695
- selection={selection}
11696
- onAcknowledge={(ids) => {
11697
- setAlerts((current) => acknowledge(current, ids, NOW).alarms);
11698
- selection.clear();
11699
- }}
11700
- />
11701
- );
11702
- }
11703
- ```
11704
-
11705
- ##### Mark a flood
11706
-
11707
- Give [`alarmModel`](#/api/alarmModel) a `flood` and a `chatter` rule: nine alerts in fifteen minutes are marked as a flood, and every one of them stays.
11708
-
11709
- ```tsx
11710
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11711
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11712
-
11713
- const NOW = new Date(2026, 2, 17, 10, 30).getTime();
11714
- const MIN = 60_000;
11715
-
11716
- const TYPES: AlarmType[] = [
11717
- { id: "notifications-retry", label: "Notifications · sends retrying", priority: "low" },
11718
- { id: "webhooks-timeout", label: "Webhooks · endpoint timeouts", priority: "medium" },
11719
- ];
11720
-
11721
- const ALERTS: readonly Alarm[] = [
11722
- ...Array.from({ length: 9 }, (_, i) => ({
11723
- id: `n-${i}`,
11724
- type: "notifications-retry",
11725
- lifecycle: "active-unacknowledged" as const,
11726
- raised: NOW - (4 + i) * MIN,
11727
- })),
11728
- { id: "w-1", type: "webhooks-timeout", lifecycle: "resolved-unacknowledged", raised: NOW - 320 * MIN, resolved: NOW - 300 * MIN },
11729
- ];
11730
-
11731
- const view = alarmModel({
11732
- alarms: ALERTS,
11733
- types: TYPES,
11734
- asOf: NOW,
11735
- // The chatter window covers the period shown, or the frequency column reads zero.
11736
- chatter: { windowMs: 12 * 60 * MIN, atLeast: 5 },
11737
- flood: { windowMs: 15 * MIN, atLeast: 8 },
11738
- });
11739
-
11740
- export default function MarkAFlood() {
11741
- return <AlarmList view={view} density="compact" />;
11742
- }
11743
- ```
11744
-
11745
- ##### Snooze and hide
11746
-
11747
- Snoozed, suppressed and disabled alerts stay in the list, drawn neutral; with `onHiddenOnlyChange` their count becomes a switch.
11748
-
11749
- ```tsx
11750
- import { useMemo, useState } from "react";
11751
- import { Button, Stack } from "@umriss-ui/core";
11752
- import { AlarmList, acknowledge, alarmModel, isHidden, snooze, useTableSelection } from "@umriss-ui/table";
11753
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11754
-
11755
- /* Data from the operations world, written out here so the example runs on its own. */
11756
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11757
-
11758
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11759
- const NOW = at(17, 10, 30);
11760
-
11761
- const ALERT_TYPES: readonly AlarmType[] = [
11762
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
11763
- { id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
11764
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
11765
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
11766
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
11767
- { id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
11768
- ];
11769
-
11770
- /** The alerts as they stand at 10:30. */
11771
- const ALERTS: readonly Alarm[] = [
11772
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
11773
- { id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
11774
- { id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
11775
- { id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
11776
- { id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
11777
- { id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
11778
- { id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
11779
- ];
11780
-
11781
- const MIN = 60_000;
11782
-
11783
- /* During the planned search reindex the application suppresses its latency alert. */
11784
- const START: readonly Alarm[] = [
11785
- ...ALERTS,
11786
- { id: "a-8", type: "search-latency", lifecycle: "active-unacknowledged", raised: NOW - 12 * MIN, availability: "suppressed" },
11787
- ];
11788
-
11789
- export default function SnoozeAndHide() {
11790
- const [alerts, setAlerts] = useState<readonly Alarm[]>(START);
11791
- const [hiddenOnly, setHiddenOnly] = useState(false);
11792
-
11793
- const view = useMemo(
11794
- () =>
11795
- alarmModel(
11796
- { alarms: alerts, types: ALERT_TYPES, asOf: NOW },
11797
- hiddenOnly ? { filter: (row) => isHidden(row.availability) } : {},
11798
- ),
11799
- [alerts, hiddenOnly],
11800
- );
11801
- const selection = useTableSelection(view.filtered.map((row) => row.id));
11802
-
11803
- return (
11804
- <Stack gap={3}>
11805
- <AlarmList
11806
- view={view}
11807
- selection={selection}
11808
- hiddenOnly={hiddenOnly}
11809
- onHiddenOnlyChange={setHiddenOnly}
11810
- onAcknowledge={(ids) => {
11811
- setAlerts((current) => acknowledge(current, ids, NOW).alarms);
11812
- selection.clear();
11813
- }}
11814
- />
11815
- <div>
11816
- <Button
11817
- size="sm"
11818
- disabled={selection.selected.size === 0}
11819
- onClick={() => {
11820
- setAlerts((current) =>
11821
- current.map((a) => (selection.selected.has(a.id) ? snooze(a, NOW + 60 * MIN, "Jonas Keller") : a)),
11822
- );
11823
- selection.clear();
11824
- }}
11825
- >
11826
- Snooze for an hour
11827
- </Button>
11828
- </div>
11829
- </Stack>
11830
- );
11831
- }
11832
- ```
11833
-
11834
- ##### Tell quiet from disconnected
11835
-
11836
- Pass `asOf` and `freshness`: an empty list on a live feed says there are no alerts, on a dead one that nothing is known.
11837
-
11838
- ```tsx
11839
- import { Stack } from "@umriss-ui/core";
11840
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11841
- import type { AlarmType } from "@umriss-ui/table";
11842
-
11843
- /* Taken once at load time; the screenshot suite freezes the clock, so the picture stays the same. */
11844
- const NOW = Date.now();
11845
- const MIN = 60_000;
11846
-
11847
- const TYPES: AlarmType[] = [{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" }];
11848
- const EMPTY = alarmModel({ alarms: [], types: TYPES, asOf: NOW });
11849
- const FRESHNESS = { stale: 5 * MIN, lost: 30 * MIN };
11850
-
11851
- export default function TellQuietFromDisconnected() {
11852
- return (
11853
- <Stack gap={4}>
11854
- <AlarmList view={EMPTY} asOf={NOW - 20_000} freshness={FRESHNESS} aria-label="Alerts, live feed" />
11855
- <AlarmList view={EMPTY} asOf={NOW - 45 * MIN} freshness={FRESHNESS} aria-label="Alerts, feed lost" />
11856
- </Stack>
11857
- );
11858
- }
11859
- ```
11860
-
11861
- ##### Offer snoozing to the operator
11862
-
11863
- Pass `onSnooze` with `snoozeDurations`, and `onUnsnooze`: the list reports which alerts and until when; your application calls `snooze()` or `unsnooze()` on its own state, or refuses.
11864
-
11865
- ```tsx
11866
- import { useMemo, useState } from "react";
11867
- import { AlarmList, alarmModel, snooze, unsnooze, useTableSelection } from "@umriss-ui/table";
11868
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11869
-
11870
- /* Data from the operations world, written out here so the example runs on its own. */
11871
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11872
-
11873
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11874
- const NOW = at(17, 10, 30);
11875
-
11876
- const ALERT_TYPES: readonly AlarmType[] = [
11877
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
11878
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
11879
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
11880
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
11881
- { id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
11882
- ];
11883
-
11884
- const ALERTS: readonly Alarm[] = [
11885
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
11886
- { id: "a-2", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
11887
- { id: "a-3", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
11888
- { id: "a-4", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
11889
- { id: "a-5", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
11890
- ];
11891
-
11892
- const MIN = 60_000;
11893
-
11894
- /* The application's own rule: which durations an operator may choose. */
11895
- const DURATIONS = [15 * MIN, 60 * MIN, 4 * 60 * MIN] as const;
11896
-
11897
- export default function OfferSnoozing() {
11898
- const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
11899
- const view = useMemo(() => alarmModel({ alarms: alerts, types: ALERT_TYPES, asOf: NOW }), [alerts]);
11900
- const selection = useTableSelection(view.filtered.map((row) => row.id));
11901
-
11902
- return (
11903
- <AlarmList
11904
- view={view}
11905
- selection={selection}
11906
- snoozeDurations={DURATIONS}
11907
- onSnooze={(ids, until) => {
11908
- setAlerts((current) => current.map((a) => (ids.includes(a.id) ? snooze(a, until, "Jonas Keller") : a)));
11909
- selection.clear();
11910
- }}
11911
- onUnsnooze={(ids) => {
11912
- setAlerts((current) => current.map((a) => (ids.includes(a.id) ? unsnooze(a) : a)));
11913
- selection.clear();
11914
- }}
11915
- />
11916
- );
11917
- }
11918
- ```
11919
-
11920
- ##### Filter by state and priority
11921
-
11922
- The list does not filter, the projection does: pass `filter` to [`alarmModel`](#/api/alarmModel) with the state and priority your own controls hold.
11923
-
11924
- ```tsx
11925
- import { useMemo, useState } from "react";
11926
- import { Select, Stack } from "@umriss-ui/core";
11927
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11928
- import type { Alarm, AlarmType, LifecycleState, Priority } from "@umriss-ui/table";
11929
-
11930
- /* Data from the operations world, written out here so the example runs on its own. */
11931
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11932
-
11933
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11934
- const NOW = at(17, 10, 30);
11935
-
11936
- const ALERT_TYPES: readonly AlarmType[] = [
11937
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
11938
- { id: "checkout-errors", label: "Checkout · error rate above 2 %", priority: "high" },
11939
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
11940
- { id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
11941
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
11942
- ];
11943
-
11944
- const ALERTS: readonly Alarm[] = [
11945
- { id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
11946
- { id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
11947
- { id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
11948
- { id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
11949
- { id: "a-5", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0) },
11950
- ];
11951
-
11952
- export default function FilterByStateAndPriority() {
11953
- const [state, setState] = useState<LifecycleState | "">("");
11954
- const [priority, setPriority] = useState<Priority | "">("");
11955
- const view = useMemo(
11956
- () =>
11957
- alarmModel(
11958
- { alarms: ALERTS, types: ALERT_TYPES, asOf: NOW },
11959
- { filter: (row) => (state === "" || row.lifecycle === state) && (priority === "" || row.priority === priority) },
11960
- ),
11961
- [state, priority],
11962
- );
11963
-
11964
- return (
11965
- <Stack gap={3}>
11966
- <Select size="sm" aria-label="State" value={state} onChange={(event) => setState(event.target.value as LifecycleState | "")}>
11967
- <option value="">Any state</option>
11968
- <option value="active-unacknowledged">Active, unacknowledged</option>
11969
- <option value="active-acknowledged">Active, acknowledged</option>
11970
- <option value="resolved-unacknowledged">Resolved, unacknowledged</option>
11971
- </Select>
11972
- <Select size="sm" aria-label="Priority" value={priority} onChange={(event) => setPriority(event.target.value as Priority | "")}>
11973
- <option value="">Any priority</option>
11974
- <option value="high">High</option>
11975
- <option value="medium">Medium</option>
11976
- <option value="low">Low</option>
11977
- </Select>
11978
- <AlarmList view={view} />
11979
- </Stack>
11980
- );
11981
- }
11982
- ```
11983
-
11984
- ##### Ask for a reason when snoozing
11985
-
11986
- Pass `snoozeReason` and “Snooze” opens a small panel instead of the menu: the durations, a field for the reason, and a button that reports. With `"required"` the button waits for text; your application stores the reason with `snooze()`, and the list shows it in the snoozed badge's tip and in what is spoken.
11987
-
11988
- ```tsx
11989
- import { useMemo, useState } from "react";
11990
- import { AlarmList, alarmModel, snooze, useTableSelection } from "@umriss-ui/table";
11991
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11992
-
11993
- /* Data from the operations world, written out here so the example runs on its own. */
11994
- const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
11995
-
11996
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11997
- const NOW = at(17, 10, 30);
11998
-
11999
- const ALERT_TYPES: readonly AlarmType[] = [
12000
- { id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
12001
- { id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
12002
- { id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
12003
- ];
12004
-
12005
- const ALERTS: readonly Alarm[] = [
12006
- { id: "a-1", type: "checkout-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 12) },
12007
- { id: "a-2", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
12008
- { id: "a-3", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0) },
12009
- ];
12010
-
12011
- const MIN = 60_000;
12012
-
12013
- /* The application's own rule: which durations an operator may choose. */
12014
- const DURATIONS = [15 * MIN, 60 * MIN, 4 * 60 * MIN] as const;
12015
-
12016
- export default function AskForAReason() {
12017
- const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
12018
- const view = useMemo(() => alarmModel({ alarms: alerts, types: ALERT_TYPES, asOf: NOW }), [alerts]);
12019
- const selection = useTableSelection(view.filtered.map((row) => row.id));
12020
-
12021
- return (
12022
- <AlarmList
12023
- view={view}
12024
- selection={selection}
12025
- snoozeDurations={DURATIONS}
12026
- snoozeReason="required"
12027
- onSnooze={(ids, until, reason) => {
12028
- setAlerts((current) => current.map((a) => (ids.includes(a.id) ? snooze(a, until, "Jonas Keller", reason) : a)));
12029
- selection.clear();
12030
- }}
12031
- />
12032
- );
12033
- }
12034
- ```
12035
-
12036
- #### When to use something else
12037
-
12038
- - Measured values against limits, without a lifecycle → VerdictColumn
12039
-
12040
- #### Keyboard
12041
-
12042
- | Key | Action |
12043
- |---|---|
12044
- | `Tab` | Move through the row boxes, “Acknowledge” and the hidden-alerts switch. |
12045
- | `Space` | On a box: tick or untick the alert. On the switch: show only the hidden alerts, or all. |
12046
- | `Enter` | On “Acknowledge”: hand the ticked alerts to `onAcknowledge`. On “Snooze”: open the durations; on a duration: hand the ticked alerts and the end to `onSnooze`. With `snoozeReason`, “Snooze” opens a panel instead (see Escape and Arrow keys). On “Unsnooze”: hand the ticked snoozed alerts to `onUnsnooze`. |
12047
- | `Arrow keys` | In the durations menu, or among the durations of the reason panel: move between them; Escape closes the menu. |
12048
- | `Escape` | In the reason panel: close it without reporting; the focus returns to “Snooze”. A click outside closes it the same way. |
12049
- | `Enter (in the reason field)` | Report the snooze, as the panel's “Snooze” button does; with `"required"` and no text it does nothing. |
12050
-
12051
- #### Accessibility
12052
-
12053
- A native table named “Alarms”, each alert's type its row header. The state stands as a word in every row, never as a colour alone, and a hidden alert's short badge is spoken whole - snoozed until when, and by whom.
12054
-
12055
- One polite live region says one number: the active alerts nobody has acknowledged, “3 active alarms, unacknowledged”. It speaks when that number changes, never per arrival, so a flood is one sentence and not forty.
12056
-
12057
- Each row's box is named after the alert, and “Acknowledge” names how many it will acknowledge; while there is none it is disabled.
12058
-
12059
- With `snoozeReason`, “Snooze” opens a dialog named after how many alerts it acts on. The focus moves to the chosen duration when it opens and back to “Snooze” when it closes; the durations and the reason field are labelled, and with `"required"` the field is marked and the button disabled until it holds text.
12060
-
12061
- #### API
12062
-
12063
- ##### `AlarmListProps`
12064
-
12065
- | Prop | Type | Default | Description |
12066
- |---|---|---|---|
12067
- | `view` *required* | [`AlarmProjection`](#type-AlarmProjection) | — | The projection from `alarmModel`.<br>Shown in: [Show the alerts](#/alarmlist/show-the-alerts), [Acknowledge alerts](#/alarmlist/acknowledge-alerts), [Mark a flood](#/alarmlist/mark-a-flood) and 6 more |
12068
- | `selection` | [`TableSelection`](#type-TableSelection)`<string>` | — | The caller's selection helper; without it there is no bulk acknowledgement. Deliberately the same one as for any other table: the rules on "everything filtered" versus "this page" are already decided there.<br>Shown in: [Acknowledge alerts](#/alarmlist/acknowledge-alerts), [Snooze and hide](#/alarmlist/snooze-and-hide), [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator) and 2 more |
12069
- | `snoozeReason` | `"optional" \| "required"` | — | Asks for a reason when snoozing: "Snooze" then opens a small panel with the durations and a field for the reason, and its button reports. With `"required"` the button waits for text. Without this prop "Snooze" is the menu of durations and reports at once. The list keeps no draft once the panel closes; Escape and a click outside close it without reporting.<br>Shown in: [Ask for a reason when snoozing](#/alarmlist/ask-for-a-reason-when-snoozing) |
12070
- | `snoozeDurations` | `readonly number[]` | no default | The durations on offer, in milliseconds. Which are permitted is the application's rule, so there is no default list; empty or missing, there is no snooze action.<br>Shown in: [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator), [Ask for a reason when snoozing](#/alarmlist/ask-for-a-reason-when-snoozing) |
12071
- | `asOf` | `Date \| number \| null` | — | When the data was true.<br>Shown in: [Tell quiet from disconnected](#/alarmlist/tell-quiet-from-disconnected), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12072
- | `freshness` | [`FreshnessAges`](#type-FreshnessAges) | — | From when the data counts as stale and from when as disconnected. Without them the list shows no freshness – a time without a rule for when it is too old is no information.<br>Shown in: [Tell quiet from disconnected](#/alarmlist/tell-quiet-from-disconnected), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12073
- | `density` | `"regular" \| "compact"` | the density of the `UmrissProvider`, else `"compact"` | "compact" reduces the row height for very dense views.<br>Shown in: [Mark a flood](#/alarmlist/mark-a-flood) |
12074
- | `hiddenOnly` | `boolean` | — | The view of hidden alarms is on. The list does not filter - the projection does, with the table's own `filter` and `isHidden`; this only says what the switch shows.<br>Shown in: [Snooze and hide](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12075
- | `onHiddenOnlyChange` | `(hiddenOnly: boolean) => void` | — | Offers the view as a switch beside its count. Without it the count stands as text.<br>Shown in: [Snooze and hide](#/alarmlist/snooze-and-hide) |
12076
-
12077
- ###### Events
12078
-
12079
- | Prop | Type | Default | Description |
12080
- |---|---|---|---|
12081
- | `onAcknowledge` | `(ids: readonly string[]) => void` | — | Gets the ids that are to be acknowledged. The component does not acknowledge itself – it does not own the alarms.<br>Shown in: [Acknowledge alerts](#/alarmlist/acknowledge-alerts), [Snooze and hide](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12082
- | `onSnooze` | `(ids: readonly string[], until: number, reason?: string) => void` | — | Gets the ids the operator wants to snooze and the end they chose (`asOf` of the view plus a duration of `snoozeDurations`). The component snoozes nothing – the application calls `snooze()` on its own alarms, or refuses. The action stands beside "Acknowledge", on the selection, and needs `selection`, `snoozeDurations` and this handler. With `snoozeReason` there is a third argument: the reason, trimmed, or `undefined` when it is optional and left empty. Stored with `snooze()`, the reason is shown after the end and the name in the snoozed badge's tip and in what is spoken.<br>Shown in: [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator), [Ask for a reason when snoozing](#/alarmlist/ask-for-a-reason-when-snoozing) |
12083
- | `onUnsnooze` | `(ids: readonly string[]) => void` | — | Gets the ids whose snooze the operator wants to end early. Shown, beside "Acknowledge", only with this handler and a selection.<br>Shown in: [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator) |
12084
-
12085
- Also takes every attribute of `<div>` – without `children`.
12086
-
12087
- ##### Types on this page
12088
-
12089
- ###### `AlarmProjection`
12090
-
12091
- What `alarmModel` returns: the table's projection of the alarm rows -
12092
- filtered, sorted, paged -, and beside it the flood and the counts the list
12093
- announces. Give it to `AlarmList` as `view`.
12094
-
12095
- | Prop | Type | Default | Description |
12096
- |---|---|---|---|
12097
- | `flood` *required* | [`Flood`](#type-Flood)` \| null` | — | The flood that was detected, when a rule was given and it applies. A marking beside the complete list, not a replacement for it. |
12098
- | `activeUnacknowledged` *required* | `number` | — | Active and unacknowledged within the filtered set - the number for the polite screen reader. From the filtered set, not from the visible page, like every figure in this house. Only alarms in service count: the number calls somebody over, and a hidden alarm is one it must not call to. |
12099
- | `hiddenAlarms` *required* | `number` | — | Hidden within the filtered set: snoozed, suppressed, disabled. They are in the list; this is how many. |
12100
- | `columns` *required* | `readonly `[`ModelColumn`](#type-ModelColumn)`<AlarmRow, AlarmColumn>[]` | — | The visible columns in their order – the basis for the header row, the column menu and the CSV export. From `TableProjection`. |
12101
- | `filtered` *required* | `AlarmRow[]` | — | Everything the filter leaves – the basis for figures and the selection. From `TableProjection`.<br>Shown in: [Acknowledge alerts](#/alarmlist/acknowledge-alerts), [Snooze and hide](#/alarmlist/snooze-and-hide), [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator) and 2 more |
12102
- | `visible` *required* | `AlarmRow[]` | — | Only the current page - with a grouping, the rows among its lines. From `TableProjection`. |
12103
- | `groups` | [`RowGroup`](#type-RowGroup)`<AlarmRow>[]` | — | With a grouping: the groups, outermost first. From `TableProjection`. |
12104
- | `lines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: every line of the filtered set. From `TableProjection`. |
12105
- | `visibleLines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: the lines of the current page, with what it repeats. From `TableProjection`. |
12106
- | `entries` | `readonly `[`FlatteningEntry`](#type-FlatteningEntry)`<AlarmRow>[]` | — | Tree rows: the flattening - the rows shown, in reading order, with their level and state. `visible` holds their rows. From `TableProjection`. |
12107
- | `shown` | `AlarmRow[]` | — | Tree rows: every row the flattening shows, before a virtual window. From `TableProjection`. |
12108
- | `roots` | `AlarmRow[]` | — | Tree rows: the roots that match or lead to a match - what a footer sums, since a parent already holds its children. From `TableProjection`. |
12109
- | `exported` | `readonly `[`FlatteningEntry`](#type-FlatteningEntry)`<AlarmRow>[]` | — | Tree rows: every row of the filtered tree in reading order, open or not, path rows included - what the export writes. From `TableProjection`. |
12110
- | `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. From `TableProjection`. |
12111
- | `page` *required* | `number` | — | The clamped page actually shown. From `TableProjection`. |
12112
- | `pageCount` *required* | `number` | — | From `TableProjection`. |
12113
- | `columnCount` *required* | `number` | — | From `TableProjection`. |
12114
-
12115
- ###### `TableSelection<T extends string | number>`
12116
-
12117
- What `useTableSelection` returns: the selected keys and the gestures on
12118
- them. Give it to `useTable` as `selection` when the application holds the
12119
- selection.
12120
-
12121
- | Prop | Type | Default | Description |
12122
- |---|---|---|---|
12123
- | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Snooze and hide](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12124
- | `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
12125
- | `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
12126
- | `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. |
12127
- | `clear` *required* | `() => void` | — | <br>Shown in: [Acknowledge alerts](#/alarmlist/acknowledge-alerts), [Snooze and hide](#/alarmlist/snooze-and-hide), [Offer snoozing to the operator](#/alarmlist/offer-snoozing-to-the-operator) and 4 more |
12128
- | `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
12129
- | `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
12130
- | `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Copy the selection (Export)](#/export/copy-the-selection) and 2 more |
12131
-
12132
- ###### `FreshnessAges`
12133
-
12134
- From `@umriss-ui/core`.
12135
-
12136
- The two ages at which a value changes its state, in milliseconds. Both
12137
- bounds belong to the older state: exactly five minutes old is already
12138
- `stale`.
12139
-
12140
- `alt <= lost` is the sensible order. Stated the other way round, the
12141
- harder statement still wins - the middle state simply falls away.
12142
-
12143
- | Prop | Type | Default | Description |
12144
- |---|---|---|---|
12145
- | `stale` *required* | `number` | — | From this age on the value counts as stale, but keeps its verdict.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12146
- | `lost` *required* | `number` | — | From this age on the connection counts as disconnected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12147
-
12148
- ###### `Flood`
12149
-
12150
- A flood that has been detected. A marking, not a suppression: the alarms all
12151
- stay in the list.
12152
-
12153
- | Prop | Type | Default | Description |
12154
- |---|---|---|---|
12155
- | `from` *required* | `number` | — | Earliest and latest moment of the alarms involved - so that the interface can say "forty alarms in 82 seconds". |
12156
- | `to` *required* | `number` | — | |
12157
- | `count` *required* | `number` | — | |
12158
- | `alarms` *required* | `readonly string[]` | — | Ids of the alarms involved. |
12159
-
12160
- ###### `ModelColumn<Z, K extends string = string>`
12161
-
12162
- A column as the model reads it - what sorting, search, hiding and the
12163
- export need of it, not its presentation. `alarmModel` takes them, and
12164
- `ALARM_COLUMNS` are the alarm list's.
12165
-
12166
- | Prop | Type | Default | Description |
12167
- |---|---|---|---|
12168
- | `id` *required* | `K` | — | |
12169
- | `label` | `string` | — | Human-readable label – for the column menu and the CSV header row. Not for the presentation of the header cell: that stays compositional. |
12170
- | `value` | `(row: Z) => string \| number \| null \| undefined` | — | The value for sorting and searching. `null`, `undefined` and `NaN` are absent: they stand last in both directions and match no search. |
12171
- | `compare` | `(a: Z, b: Z) => number` | — | A comparison of one's own; otherwise by the kind of the value. |
12172
- | `searchable` | `boolean` | `false` | Takes part in the free-text search. |
12173
- | `hideable` | `boolean` | `true` | May the user switch this column away? `false` for columns that identify the row – without them the table is no longer readable. |
12174
- | `resizable` | `boolean` | `false` | May the user drag the width? A column whose content fits anyway needs no grip. |
12175
- | `width` | `number` | — | Initial width in pixels; without it the browser decides. |
12176
-
12177
- ###### `RowGroup<Z>`
12178
-
12179
- The rows of the filtered set that share one grouping value on one level.
12180
-
12181
- | Prop | Type | Default | Description |
12182
- |---|---|---|---|
12183
- | `path` *required* | `string` | — | Identifies the group across renders and in the view: the keys of its path, outermost first. |
12184
- | `value` *required* | `unknown` | — | The grouping value; `undefined` for the group of absent values. |
12185
- | `level` *required* | `number` | — | 0 is the outermost level. |
12186
- | `rows` *required* | `Z[]` | — | |
12187
- | `groups` *required* | [`RowGroup`](#type-RowGroup)`<Z>[]` | — | The groups of the next level; empty on the innermost. |
12188
- | `aggregates` *required* | `Record<string, unknown>` | — | Per column id, what its aggregate comes to over this group's rows. |
12189
-
12190
- ###### `Line<Z>`
12191
-
12192
- One line of a grouped table. A header heads a group of an outer level; a row
12193
- of the innermost level stands in its span; a folded span is one line.
12194
-
12195
- ```ts
12196
- type Line<Z> =
12197
- | {
12198
- kind: "header";
12199
- group: RowGroup<Z>;
12200
- /** The headers around it. */
12201
- parents: readonly RowGroup<Z>[];
12202
- /** Repeated at the top of a page that begins inside the group. */
12203
- continued: boolean;
12204
- }
12205
- | {
12206
- kind: "row";
12207
- row: Z;
12208
- parents: readonly RowGroup<Z>[];
12209
- /** The span the row stands in - the innermost group, when there are
12210
- several levels; a single level has no span, its rows stand under
12211
- their group header. */
12212
- span: RowGroup<Z> | undefined;
12213
- /** The span shows its value on this line: the group's first row, or the
12214
- first of a page that begins inside it. */
12215
- first: boolean;
12216
- continued: boolean;
12217
- }
12218
- | { kind: "folded"; group: RowGroup<Z>; parents: readonly RowGroup<Z>[] };
12219
- ```
12220
-
12221
- ###### `FlatteningEntry<K, S extends Key = string>`
12222
-
12223
- From `@umriss-ui/core`.
12224
-
12225
- One visible node of a tree, with everything a row needs to be drawn and
12226
- read out: level, branch or leaf, check state, search state and position
12227
- among its siblings.
12228
-
12229
- | Prop | Type | Default | Description |
12230
- |---|---|---|---|
12231
- | `node` *required* | `K` | — | |
12232
- | `key` *required* | `S` | — | |
12233
- | `level` *required* | `number` | — | Roots stand at 0. Drives the indentation and what is read out. |
12234
- | `label` *required* | `string` | — | The node's text; here, so that typeahead can be a pure function over the flattening and needs no reader. |
12235
- | `branch` *required* | `boolean` | — | |
12236
- | `empty` *required* | `boolean` | — | Branch without content: expanding it showed nothing. An unloaded branch is not empty - it could have children. |
12237
- | `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. |
12238
- | `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. |
12239
- | `expanded` *required* | `boolean` | — | |
12240
- | `checked` *required* | `boolean` | — | |
12241
- | `indeterminate` *required* | `boolean` | — | Derived: not checked itself, but at least one descendant is. |
12242
- | `active` *required* | `boolean` | — | |
12243
- | `matches` *required* | `boolean` | — | Matched the search itself. Without a search text every entry matches, so that the surface needs no special case. |
12244
- | `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. |
12245
- | `position` *required* | `number` | — | 1-based, among the siblings that survive the filter. |
12246
- | `siblings` *required* | `number` | — | |
12247
-
12248
- #### Known limits
12249
-
12250
- - It raises no alerts: limits, delays and dead bands belong to the application ([ADR-0009](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0009-the-library-owns-a-lifecycle-not-a-generation.md)).
12251
- - It never removes an alert to thin out a flood; deciding that a person should not see one stays with the application.
12252
- - No latched alerts, and no alarm-system figures beyond the frequency per type.
12253
- - The columns do not sort and the list does not page: the model sets the order.
12254
-
12255
- What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
12256
-
12257
- ## API index
12258
-
12259
- Every name the package exports, in one place.
11919
+ Every name the package exports, in one place.
12260
11920
 
12261
11921
  ### API index
12262
11922
 
@@ -12266,12 +11926,6 @@ Demo page: https://romanhaendler.github.io/umriss-ui/table/api/
12266
11926
 
12267
11927
  #### Components
12268
11928
 
12269
- ##### `AlarmList`
12270
-
12271
- [AlarmList](#/alarmlist) – The list of alerts someone has to see and acknowledge, worst first, with their state, age and frequency (also called an alarm or alert console). Reach for it wherever alerts arrive and a person answers for them.
12272
-
12273
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12274
-
12275
11929
  ##### `ColumnMenu`
12276
11930
 
12277
11931
  [ColumnMenu](#/columnmenu) – A menu in which the user shows, hides, reorders and pins the table's columns and picks a grouping (also called a column chooser). Offer it where the table has more columns than everyone needs.
@@ -12288,19 +11942,19 @@ Used on [Scenarios](#/), [Provider](#/provider), [Sorting](#/sorting), [Search](
12288
11942
 
12289
11943
  [Pagination](#/pagination) – The bar under the table that splits long results into pages, with the page size to choose (also called a pager). The table pages only where one stands; without it every filtered row is shown.
12290
11944
 
12291
- Used on [Scenarios](#/), [First table](#/first-table), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [Pagination](#/pagination) and [Server mode](#/server-mode).
11945
+ Used on [Scenarios](#/), [First table](#/first-table), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [Pagination](#/pagination), [Benchmark](#/benchmark) and [Server mode](#/server-mode).
12292
11946
 
12293
11947
  ##### `Search`
12294
11948
 
12295
11949
  [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.
12296
11950
 
12297
- Used on [Scenarios](#/), [First table](#/first-table), [Provider](#/provider), [Formats](#/formats), [Sorting](#/sorting), [Search](#/search), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [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), [Server mode](#/server-mode), [Grid mode](#/grid-mode), [Edits](#/edits) and [AlarmList](#/alarmlist).
11951
+ Used on [Scenarios](#/), [First table](#/first-table), [Provider](#/provider), [Formats](#/formats), [Sorting](#/sorting), [Search](#/search), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [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).
12298
11952
 
12299
11953
  ##### `Toolbar`
12300
11954
 
12301
11955
  [Toolbar](#/toolbar) – The bar above the table that holds its search, column menu and export, shows how many rows match, and carries the bulk actions while rows are ticked (also called a table header bar).
12302
11956
 
12303
- Used on [Scenarios](#/), [First table](#/first-table), [Provider](#/provider), [Column](#/column), [Width and pinning](#/width-and-pinning), [Sorting](#/sorting), [Search](#/search), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [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), [Server mode](#/server-mode) and [Edits](#/edits).
11957
+ Used on [Scenarios](#/), [First table](#/first-table), [Provider](#/provider), [Column](#/column), [Width and pinning](#/width-and-pinning), [Sorting](#/sorting), [Search](#/search), [Filter](#/filter), [Pre-filter](#/pre-filter), [Grouping](#/grouping), [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) and [Edits](#/edits).
12304
11958
 
12305
11959
  #### Hooks
12306
11960
 
@@ -12321,7 +11975,7 @@ as `of` to a part that stands outside the table.
12321
11975
  function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
12322
11976
  ```
12323
11977
 
12324
- Used on [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), [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), [Server mode](#/server-mode), [Grid mode](#/grid-mode), [Edits](#/edits) and [VerdictColumn](#/verdictcolumn).
11978
+ Used on [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), [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).
12325
11979
 
12326
11980
  ##### `useTableSelection`
12327
11981
 
@@ -12333,61 +11987,10 @@ What the selection means in the domain stays the application's business.
12333
11987
  function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;
12334
11988
  ```
12335
11989
 
12336
- Used on [Scenarios](#/), [Selection](#/selection) and [AlarmList](#/alarmlist).
11990
+ Used on [Selection](#/selection).
12337
11991
 
12338
11992
  #### Functions
12339
11993
 
12340
- ##### `acknowledge`
12341
-
12342
- Acknowledges the named alarms at the named time. Unknown ids are passed
12343
- over, what is already acknowledged stays as it is.
12344
-
12345
- ```ts
12346
- function acknowledge(alarms: readonly Alarm[], ids: Iterable<string>, time: number): Acknowledgement;
12347
- ```
12348
-
12349
- Used on [Scenarios](#/), [Aggregate](#/aggregate) and [AlarmList](#/alarmlist).
12350
-
12351
- ##### `alarmColumns`
12352
-
12353
- The columns of the alarm model, labelled from a wording.
12354
-
12355
- Described only for the pipeline - how a value is read and compared - not for
12356
- presentation. The cells stay the caller's, exactly as with the table. The
12357
- label, though, lands in the column menu and the CSV header row, and that is
12358
- why it comes from the wording: the module is pure and can read no context, so
12359
- it is given one - like `standardPresets`.
12360
-
12361
- ```ts
12362
- const alarmColumns: (wording: Wording) => readonly ModelColumn<AlarmRow, AlarmColumn>[];
12363
- ```
12364
-
12365
- ##### `alarmModel`
12366
-
12367
- Alarms, types and an as-of time become rows with derived fields and are then
12368
- handed through the table's pipeline: filter -> sort -> page. Everything the
12369
- table guarantees still holds.
12370
-
12371
- `input.sort` without a statement means the default order; expressly `null`
12372
- means input order.
12373
-
12374
- ```ts
12375
- function alarmModel(input: AlarmInput, state?: TableInput<AlarmRow, AlarmColumn>): AlarmProjection;
12376
- ```
12377
-
12378
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12379
-
12380
- ##### `availabilityAt`
12381
-
12382
- The availability at the as-of time. A snooze that has reached its end is in
12383
- service again - by the model's clock, not by a timer: nothing here reads a
12384
- clock, and a timer in a user-interface library would bring a snoozed alarm
12385
- back only while a browser tab happens to be open.
12386
-
12387
- ```ts
12388
- function availabilityAt(alarm: Alarm, asOf: number): Availability;
12389
- ```
12390
-
12391
11994
  ##### `column`
12392
11995
 
12393
11996
  A column preset that fits every table whose rows carry its field: create it
@@ -12398,7 +12001,7 @@ one field in `P`, name the field as the second type argument.
12398
12001
  function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;
12399
12002
  ```
12400
12003
 
12401
- Used on [Scenarios](#/), [First table](#/first-table), [Formats](#/formats), [Width and pinning](#/width-and-pinning), [Presets](#/presets), [Sorting](#/sorting), [Filter](#/filter), [Grouping](#/grouping), [Tree rows](#/tree-rows), [View](#/view), [Virtualisation](#/virtualisation), [Server mode](#/server-mode), [Grid mode](#/grid-mode), [VerdictColumn](#/verdictcolumn) and [AlarmList](#/alarmlist).
12004
+ Used on [Scenarios](#/), [First table](#/first-table), [Formats](#/formats), [Width and pinning](#/width-and-pinning), [Presets](#/presets), [Sorting](#/sorting), [Filter](#/filter), [Grouping](#/grouping), [Tree rows](#/tree-rows), [View](#/view), [Virtualisation](#/virtualisation), [Benchmark](#/benchmark), [Server mode](#/server-mode), [Grid mode](#/grid-mode) and [VerdictColumn](#/verdictcolumn).
12402
12005
 
12403
12006
  ##### `columnFilter`
12404
12007
 
@@ -12412,141 +12015,6 @@ function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;
12412
12015
 
12413
12016
  Used on [Filter](#/filter).
12414
12017
 
12415
- ##### `countAcknowledgeable`
12416
-
12417
- How many of the named alarms an acknowledgement would actually change. The
12418
- same condition as [`acknowledge`](#/api/acknowledge), so that the number the interface names
12419
- beforehand and what happens afterwards cannot drift apart.
12420
-
12421
- ```ts
12422
- function countAcknowledgeable(alarms: readonly Alarm[], ids: Iterable<string>): number;
12423
- ```
12424
-
12425
- ##### `countInWindow`
12426
-
12427
- How many of the points in time lie within the window. Pure, with the as-of
12428
- time as a parameter.
12429
-
12430
- ```ts
12431
- const countInWindow: (times: readonly number[], windowMs: number, asOf: number) => number;
12432
- ```
12433
-
12434
- ##### `detectFlood`
12435
-
12436
- Is there a flood in the window before the as-of time? Pure calculation over
12437
- timestamps, with window, threshold and as-of time as parameters.
12438
-
12439
- - Returns The flood, or `null` when fewer alarms than the rule's `atLeast`
12440
- were raised in its window.
12441
-
12442
- ```ts
12443
- function detectFlood(alarms: readonly Alarm[], rule: FloodRule, asOf: number): Flood | null;
12444
- ```
12445
-
12446
- ##### `disable`
12447
-
12448
- Disables an alarm - from service or from a snooze. A suppressed alarm
12449
- stays as it is: that field is the application's logic's, and [`enable`](#/api/enable)
12450
- would otherwise hand it back in service with the suppression lost.
12451
-
12452
- ```ts
12453
- function disable(alarm: Alarm): Alarm;
12454
- ```
12455
-
12456
- Used on [AlarmList](#/alarmlist).
12457
-
12458
- ##### `enable`
12459
-
12460
- Returns a disabled alarm to service. Only that one: a snooze ends by
12461
- [`unsnooze`](#/api/unsnooze) or its time, a suppression by the application's logic.
12462
-
12463
- ```ts
12464
- function enable(alarm: Alarm): Alarm;
12465
- ```
12466
-
12467
- Used on [AlarmList](#/alarmlist).
12468
-
12469
- ##### `frequencyByType`
12470
-
12471
- Frequency per alarm type within the window. Grouped by TYPE, not by
12472
- occurrence - a chattering source is one problem, not forty.
12473
-
12474
- ```ts
12475
- function frequencyByType(alarms: readonly Alarm[], windowMs: number, asOf: number): Map<string, number>;
12476
- ```
12477
-
12478
- ##### `hasReturned`
12479
-
12480
- Has the value come back far enough for an active alarm to resolve? The value
12481
- must come back past the return value, not merely past the bound that
12482
- triggered the alarm - which is why `limit` does not appear in this
12483
- calculation.
12484
-
12485
- The condition of resolving, not that of raising: that a measured value raises
12486
- an alarm the caller's process layer decides. It lives here because only this
12487
- module knows what the alarm just was.
12488
-
12489
- The return value itself belongs to the return: reaching it is enough.
12490
-
12491
- ```ts
12492
- const hasReturned: (band: ReturnBand, value: number) => boolean;
12493
- ```
12494
-
12495
- ##### `isAcknowledged`
12496
-
12497
- Whether someone has acknowledged the alarm, active or resolved.
12498
-
12499
- ```ts
12500
- const isAcknowledged: (state: LifecycleState) => boolean;
12501
- ```
12502
-
12503
- ##### `isActive`
12504
-
12505
- Whether the condition still holds: active, acknowledged or not.
12506
-
12507
- ```ts
12508
- const isActive: (state: LifecycleState) => boolean;
12509
- ```
12510
-
12511
- ##### `isDone`
12512
-
12513
- Resolved and acknowledged: the only position that leaves the list.
12514
-
12515
- ```ts
12516
- const isDone: (state: LifecycleState) => boolean;
12517
- ```
12518
-
12519
- ##### `isHidden`
12520
-
12521
- Everything but in service: still in the list, drawn neutrally and counted,
12522
- never removed. "Not absent, only deliberately hidden."
12523
-
12524
- ```ts
12525
- const isHidden: (availability: Availability) => boolean;
12526
- ```
12527
-
12528
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12529
-
12530
- ##### `nextLifecycleState`
12531
-
12532
- The transition as pure calculation.
12533
-
12534
- `raised` always leads to `active-unacknowledged`, even out of an
12535
- acknowledged position: a renewed occurrence of the condition is a new
12536
- event and demands that somebody see it again.
12537
-
12538
- ```ts
12539
- function nextLifecycleState(state: LifecycleState, transition: Transition): LifecycleState;
12540
- ```
12541
-
12542
- ##### `priorityRank`
12543
-
12544
- 0 is the most urgent. Sorted ascending it stands on top.
12545
-
12546
- ```ts
12547
- const priorityRank: (priority: Priority) => number;
12548
- ```
12549
-
12550
12018
  ##### `rowFilter`
12551
12019
 
12552
12020
  A filter over the rows of type `Z` with conditions of type `B`. Create it
@@ -12558,72 +12026,6 @@ function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
12558
12026
 
12559
12027
  Used on [Filter](#/filter) and [Toolbar controls](#/toolbar-controls).
12560
12028
 
12561
- ##### `snooze`
12562
-
12563
- Snoozes an alarm in service, or snoozes anew what is snoozed. A disabled
12564
- or suppressed alarm stays as it is: the stronger removal is not
12565
- overwritten by the weaker one, or the end of the snooze would put an alarm
12566
- disabled for maintenance back in service.
12567
-
12568
- ```ts
12569
- function snooze(alarm: Alarm, until: number, by: string, reason?: string): Alarm;
12570
- ```
12571
-
12572
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12573
-
12574
- ##### `unsnooze`
12575
-
12576
- Ends a snooze before its time.
12577
-
12578
- ```ts
12579
- function unsnooze(alarm: Alarm): Alarm;
12580
- ```
12581
-
12582
- Used on [AlarmList](#/alarmlist).
12583
-
12584
- #### Constants
12585
-
12586
- ##### `ALARM_COLUMNS`
12587
-
12588
- The columns with the default labels - for callers without a wording.
12589
-
12590
- ```ts
12591
- const ALARM_COLUMNS: readonly ModelColumn<AlarmRow, AlarmColumn>[];
12592
- ```
12593
-
12594
- ##### `AVAILABILITIES`
12595
-
12596
- In service first, then by how near each is to coming back: snoozed (a
12597
- person's own decision, with an end), suppressed, disabled. The order of
12598
- the default sort.
12599
-
12600
- ```ts
12601
- const AVAILABILITIES: readonly Availability[];
12602
- ```
12603
-
12604
- ##### `DEFAULT_ORDER`
12605
-
12606
- In service before hidden, then priority, then acknowledgement, then time -
12607
- the worst first, not the newest. As levels of the existing multi-level
12608
- sort, so that a caller replaces one value instead of fighting against a
12609
- hard-wired comparison.
12610
-
12611
- Availability stands first because a snoozed alarm of high priority is a
12612
- decision already taken; above an active one of medium priority it would
12613
- take the first glance from the alarm nobody has decided about.
12614
-
12615
- ```ts
12616
- const DEFAULT_ORDER: readonly SortLevel<AlarmColumn>[];
12617
- ```
12618
-
12619
- ##### `PRIORITIES`
12620
-
12621
- From the most urgent to the last - the order of the scale.
12622
-
12623
- ```ts
12624
- const PRIORITIES: readonly Priority[];
12625
- ```
12626
-
12627
12029
  #### Types
12628
12030
 
12629
12031
  ##### `Absent`
@@ -12636,15 +12038,6 @@ type Absent = null | undefined;
12636
12038
 
12637
12039
  Used on [Column](#/column).
12638
12040
 
12639
- ##### `Acknowledgement`
12640
-
12641
- What `acknowledge` returns: the alarms afterwards, and how many it changed.
12642
-
12643
- | Prop | Type | Default | Description |
12644
- |---|---|---|---|
12645
- | `alarms` *required* | [`Alarm`](#type-Alarm)`[]` | — | <br>Shown in: [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12646
- | `count` *required* | `number` | — | How many alarms the acknowledgement actually changed. Acknowledging twice yields the same set but not the same number - which is why it stands here. |
12647
-
12648
12041
  ##### `ActionProps`
12649
12042
 
12650
12043
  Its table stands on [RowActions](#/rowactions/type-ActionProps).
@@ -12696,177 +12089,6 @@ type AggregateKind = "sum" | "avg" | "min" | "max" | "range" | "count" | "distin
12696
12089
 
12697
12090
  Its table stands on [Aggregate](#/aggregate/type-AggregateOptions).
12698
12091
 
12699
- ##### `Alarm`
12700
-
12701
- One occurrence of a type.
12702
-
12703
- `lifecycle` is the truth about the position; the two points in time are
12704
- trimmings for the display. The other way round it would be a pair of
12705
- booleans in disguise.
12706
-
12707
- `availability` is the second field, and its union with the snooze is why
12708
- this is a type and not an interface: a snoozed alarm without an end cannot
12709
- be written down. A snooze without an end is the snooze ISA-18.2 warns
12710
- against - an alarm switched off that nobody will remember switching off.
12711
-
12712
- ```ts
12713
- type Alarm = AlarmBase & AlarmAvailability;
12714
- ```
12715
-
12716
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12717
-
12718
- ##### `AlarmAvailability`
12719
-
12720
- Whether an alarm is in service, and while it is snoozed until when and by
12721
- whom.
12722
-
12723
- ```ts
12724
- type AlarmAvailability =
12725
- | {
12726
- /** Without a statement: in service. */
12727
- availability?: Exclude<Availability, "snoozed">;
12728
- snooze?: undefined;
12729
- }
12730
- | {
12731
- availability: "snoozed";
12732
- /** Until when, and by whom. */
12733
- snooze: Snooze;
12734
- };
12735
- ```
12736
-
12737
- ##### `AlarmBase`
12738
-
12739
- What every alarm has, whatever its availability: its id, its type, its
12740
- place in the lifecycle and its moments.
12741
-
12742
- | Prop | Type | Default | Description |
12743
- |---|---|---|---|
12744
- | `id` *required* | `string` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 5 more |
12745
- | `type` *required* | `string` | — | Id of the alarm type.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 5 more |
12746
- | `lifecycle` *required* | [`LifecycleState`](#type-LifecycleState)<br>`"active-unacknowledged" \| "active-acknowledged" \| "resolved-unacknowledged" \| "resolved-acknowledged"` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 5 more |
12747
- | `raised` *required* | `number` | — | The moment of coming, in milliseconds.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 5 more |
12748
- | `resolved` | `number` | — | The moment of resolving; while the alarm is active: none.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 3 more |
12749
- | `acknowledgedAt` | `number` | — | The moment of the acknowledgement, as long as unacknowledged: none.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide) and 4 more |
12750
-
12751
- ##### `AlarmColumn`
12752
-
12753
- Ids of the columns that are sorted, searched and ordered in.
12754
-
12755
- ```ts
12756
- type AlarmColumn =
12757
- | "type"
12758
- | "lifecycle"
12759
- | "availability"
12760
- | "priority"
12761
- | "acknowledgement"
12762
- | "raised"
12763
- | "age"
12764
- | "frequency";
12765
- ```
12766
-
12767
- ##### `AlarmInput`
12768
-
12769
- The input of `alarmModel`: the alarms, their types, the as-of time, and
12770
- the rules for chatter and floods.
12771
-
12772
- | Prop | Type | Default | Description |
12773
- |---|---|---|---|
12774
- | `alarms` *required* | `readonly `[`Alarm`](#type-Alarm)`[]` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12775
- | `types` *required* | `readonly `[`AlarmType`](#type-AlarmType)`[]` | — | The catalogue of conditions. An alarm whose type is missing is not thrown away.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12776
- | `asOf` *required* | `number` | — | Milliseconds. The age and every window hang on it; nothing reads a clock.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12777
- | `chatter` | [`ChatterRule`](#type-ChatterRule) | — | Without it `frequency` counts every occurrence up to the as-of time and `chatters` stays false.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
12778
- | `flood` | [`FloodRule`](#type-FloodRule) | — | Without it no flood is detected and nothing is marked.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
12779
- | `keepDone` | `boolean` | `false` | Show the alarms that are done as well (resolved and acknowledged). Default: no - that is the only removal the model performs. |
12780
- | `columns` | `readonly `[`ModelColumn`](#type-ModelColumn)`<`[`AlarmRow`](#type-AlarmRow)`, `[`AlarmColumn`](#type-AlarmColumn)`>[]` | `ALARM_COLUMNS` | The columns of the projection; without a statement `ALARM_COLUMNS`. Whoever changes the label in the column menu or the CSV header row passes `alarmColumns(wording)`. |
12781
-
12782
- ##### `AlarmListProps`
12783
-
12784
- Its table stands on [AlarmList](#/alarmlist/type-AlarmListProps).
12785
-
12786
- ##### `AlarmProjection`
12787
-
12788
- What `alarmModel` returns: the table's projection of the alarm rows -
12789
- filtered, sorted, paged -, and beside it the flood and the counts the list
12790
- announces. Give it to `AlarmList` as `view`.
12791
-
12792
- | Prop | Type | Default | Description |
12793
- |---|---|---|---|
12794
- | `flood` *required* | [`Flood`](#type-Flood)` \| null` | — | The flood that was detected, when a rule was given and it applies. A marking beside the complete list, not a replacement for it. |
12795
- | `activeUnacknowledged` *required* | `number` | — | Active and unacknowledged within the filtered set - the number for the polite screen reader. From the filtered set, not from the visible page, like every figure in this house. Only alarms in service count: the number calls somebody over, and a hidden alarm is one it must not call to. |
12796
- | `hiddenAlarms` *required* | `number` | — | Hidden within the filtered set: snoozed, suppressed, disabled. They are in the list; this is how many. |
12797
- | `columns` *required* | `readonly `[`ModelColumn`](#type-ModelColumn)`<AlarmRow, AlarmColumn>[]` | — | The visible columns in their order – the basis for the header row, the column menu and the CSV export. From `TableProjection`. |
12798
- | `filtered` *required* | `AlarmRow[]` | — | Everything the filter leaves – the basis for figures and the selection. From `TableProjection`.<br>Shown in: [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Offer snoozing to the operator (AlarmList)](#/alarmlist/offer-snoozing-to-the-operator) and 2 more |
12799
- | `visible` *required* | `AlarmRow[]` | — | Only the current page - with a grouping, the rows among its lines. From `TableProjection`. |
12800
- | `groups` | [`RowGroup`](#type-RowGroup)`<AlarmRow>[]` | — | With a grouping: the groups, outermost first. From `TableProjection`. |
12801
- | `lines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: every line of the filtered set. From `TableProjection`. |
12802
- | `visibleLines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: the lines of the current page, with what it repeats. From `TableProjection`. |
12803
- | `entries` | `readonly `[`FlatteningEntry`](#type-FlatteningEntry)`<AlarmRow>[]` | — | Tree rows: the flattening - the rows shown, in reading order, with their level and state. `visible` holds their rows. From `TableProjection`. |
12804
- | `shown` | `AlarmRow[]` | — | Tree rows: every row the flattening shows, before a virtual window. From `TableProjection`. |
12805
- | `roots` | `AlarmRow[]` | — | Tree rows: the roots that match or lead to a match - what a footer sums, since a parent already holds its children. From `TableProjection`. |
12806
- | `exported` | `readonly `[`FlatteningEntry`](#type-FlatteningEntry)`<AlarmRow>[]` | — | Tree rows: every row of the filtered tree in reading order, open or not, path rows included - what the export writes. From `TableProjection`. |
12807
- | `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. From `TableProjection`. |
12808
- | `page` *required* | `number` | — | The clamped page actually shown. From `TableProjection`. |
12809
- | `pageCount` *required* | `number` | — | From `TableProjection`. |
12810
- | `columnCount` *required* | `number` | — | From `TableProjection`. |
12811
-
12812
- ##### `AlarmRow`
12813
-
12814
- An alarm with everything the list and the order need to know about it.
12815
- Derived, never stored.
12816
-
12817
- | Prop | Type | Default | Description |
12818
- |---|---|---|---|
12819
- | `id` *required* | `string` | — | Id of the alarm - the key for selection and acknowledgement.<br>Shown in: [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Offer snoozing to the operator (AlarmList)](#/alarmlist/offer-snoozing-to-the-operator) and 2 more |
12820
- | `alarm` *required* | [`Alarm`](#type-Alarm) | — | |
12821
- | `type` *required* | [`AlarmType`](#type-AlarmType) | — | |
12822
- | `lifecycle` *required* | [`LifecycleState`](#type-LifecycleState)<br>`"active-unacknowledged" \| "active-acknowledged" \| "resolved-unacknowledged" \| "resolved-acknowledged"` | — | <br>Shown in: [Filter by state and priority (AlarmList)](#/alarmlist/filter-by-state-and-priority) |
12823
- | `availability` *required* | [`Availability`](#type-Availability)<br>`"in-service" \| "snoozed" \| "suppressed" \| "disabled"` | — | At the as-of time: an expired snooze is already back in service here.<br>Shown in: [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12824
- | `priority` *required* | [`Priority`](#type-Priority)<br>`"high" \| "medium" \| "low"` | — | <br>Shown in: [Filter by state and priority (AlarmList)](#/alarmlist/filter-by-state-and-priority) |
12825
- | `rank` *required* | `number` | — | 0 is the most urgent. For the sort. |
12826
- | `age` *required* | `number` | — | Since the coming, from the as-of time passed in. |
12827
- | `duration` *required* | `number` | — | How long the condition was true - until the resolving, otherwise until the as-of time. Not the same thing as the age. |
12828
- | `frequency` *required* | `number` | — | Occurrences of this TYPE within the window; without a chatter rule: all of them up to the as-of time. |
12829
- | `chatters` *required* | `boolean` | — | The TYPE chatters. A marking on each of its rows. |
12830
- | `inFlood` *required* | `boolean` | — | This alarm belongs to the flood that was detected. |
12831
-
12832
- ##### `AlarmType`
12833
-
12834
- The condition that can become true. Not the alarm itself.
12835
-
12836
- Frequency, chatter and flood are statements about a TYPE over a window and
12837
- cannot be expressed without it.
12838
-
12839
- | Prop | Type | Default | Description |
12840
- |---|---|---|---|
12841
- | `id` *required* | `string` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12842
- | `label` *required* | `string` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12843
- | `priority` *required* | [`Priority`](#type-Priority)<br>`"high" \| "medium" \| "low"` | — | <br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) and 6 more |
12844
- | `returnBand` | [`ReturnBand`](#type-ReturnBand) | — | The dead band, when the type has one. |
12845
-
12846
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
12847
-
12848
- ##### `Availability`
12849
-
12850
- Whether an alarm is in front of the people watching the list - the second
12851
- field beside the lifecycle (ISA-18.2's special states).
12852
-
12853
- A second field and never a fifth value of the lifecycle, by the same rule
12854
- that made the lifecycle one field: one state, one field. The two answer
12855
- different questions - what happened to the condition, and whether anyone
12856
- is meant to see it now - and a snoozed alarm keeps its lifecycle
12857
- underneath: when the snooze ends it comes back active and unacknowledged
12858
- if that is what it is.
12859
-
12860
- `suppressed` has no transition here. It is the application's logic that
12861
- suppresses (a service that is switched off raises no error-rate alarm),
12862
- and the application writes the field from that logic.
12863
-
12864
- ```ts
12865
- type Availability = "in-service" | "snoozed" | "suppressed" | "disabled";
12866
- ```
12867
-
12868
- Used on [Formats](#/formats).
12869
-
12870
12092
  ##### `CellEdit<Z>`
12871
12093
 
12872
12094
  An edit the user committed - reported, not applied.
@@ -12899,15 +12121,6 @@ Escape and Tab stay the table's, bubbling up from the field.
12899
12121
  |---|---|---|---|
12900
12122
  | `onChange` *required* | `(value: W \| null) => void` | — | Changes the draft. |
12901
12123
 
12902
- ##### `ChatterRule`
12903
-
12904
- From when a type counts as chattering.
12905
-
12906
- | Prop | Type | Default | Description |
12907
- |---|---|---|---|
12908
- | `windowMs` *required* | `number` | — | Length of the window in milliseconds.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
12909
- | `atLeast` *required* | `number` | — | From how many occurrences within the window. Reaching it is enough.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
12910
-
12911
12124
  ##### `ColumnBase`
12912
12125
 
12913
12126
  Its table stands on [Column](#/column/type-ColumnBase).
@@ -13112,36 +12325,6 @@ type FilterFor<W> =
13112
12325
 
13113
12326
  Its table stands on [Filter](#/filter/type-FilterInputProps).
13114
12327
 
13115
- ##### `Flood`
13116
-
13117
- A flood that has been detected. A marking, not a suppression: the alarms all
13118
- stay in the list.
13119
-
13120
- | Prop | Type | Default | Description |
13121
- |---|---|---|---|
13122
- | `from` *required* | `number` | — | Earliest and latest moment of the alarms involved - so that the interface can say "forty alarms in 82 seconds". |
13123
- | `to` *required* | `number` | — | |
13124
- | `count` *required* | `number` | — | |
13125
- | `alarms` *required* | `readonly string[]` | — | Ids of the alarms involved. |
13126
-
13127
- ##### `FloodRule`
13128
-
13129
- From when a set of alarms is a flood.
13130
-
13131
- | Prop | Type | Default | Description |
13132
- |---|---|---|---|
13133
- | `windowMs` *required* | `number` | — | <br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
13134
- | `atLeast` *required* | `number` | — | From how many alarms within the window - across all types, because one fault drags nine others with it. Reaching it is enough.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
13135
-
13136
- ##### `FooterFor<W>`
13137
-
13138
- What the old `footer` accepts: `"sum"` and `"avg"` for numbers, nothing
13139
- for every other value.
13140
-
13141
- ```ts
13142
- type FooterFor<W> = [Present<W>] extends [number] ? "sum" | "avg" : never;
13143
- ```
13144
-
13145
12328
  ##### `FormatFor<W>`
13146
12329
 
13147
12330
  What a column accepts as `format`: a number format for numbers, a date
@@ -13230,21 +12413,6 @@ type IsDisplayable<W> = [Present<W>] extends [never]
13230
12413
  : false;
13231
12414
  ```
13232
12415
 
13233
- ##### `LifecycleState`
13234
-
13235
- One field, four values. `resolved-unacknowledged` is the fleeting alarm and the
13236
- reason why no pair of booleans stands here.
13237
-
13238
- ```ts
13239
- type LifecycleState =
13240
- | "active-unacknowledged"
13241
- | "active-acknowledged"
13242
- | "resolved-unacknowledged"
13243
- | "resolved-acknowledged";
13244
- ```
13245
-
13246
- Used on [AlarmList](#/alarmlist).
13247
-
13248
12416
  ##### `ListCondition<W>`
13249
12417
 
13250
12418
  The condition of a list filter: the chosen values, an absent one as `null`.
@@ -13256,8 +12424,7 @@ type ListCondition<W> = readonly (Present<W> | null)[];
13256
12424
  ##### `ModelColumn<Z, K extends string = string>`
13257
12425
 
13258
12426
  A column as the model reads it - what sorting, search, hiding and the
13259
- export need of it, not its presentation. `alarmModel` takes them, and
13260
- `ALARM_COLUMNS` are the alarm list's.
12427
+ export need of it, not its presentation.
13261
12428
 
13262
12429
  | Prop | Type | Default | Description |
13263
12430
  |---|---|---|---|
@@ -13328,22 +12495,6 @@ type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
13328
12495
 
13329
12496
  Used on [Formats](#/formats).
13330
12497
 
13331
- ##### `Priority`
13332
-
13333
- Three levels. Not two, because an alarm system orders the urgency of acting
13334
- more finely than a limit does; not seven, because every level above about
13335
- four gets used as a synonym of the one below it.
13336
-
13337
- This is a DIFFERENT scale from the severity of a limit (which has two), on a
13338
- different object. The mapping between the two is the caller's, in his code,
13339
- where the application's convention stands.
13340
-
13341
- ```ts
13342
- type Priority = "high" | "medium" | "low";
13343
- ```
13344
-
13345
- Used on [AlarmList](#/alarmlist).
13346
-
13347
12498
  ##### `RangeCondition<W>`
13348
12499
 
13349
12500
  The condition of a range filter: both bounds inclusive, each may be absent.
@@ -13353,20 +12504,6 @@ The condition of a range filter: both bounds inclusive, each may be absent.
13353
12504
  | `from` | `W` | — | |
13354
12505
  | `to` | `W` | — | |
13355
12506
 
13356
- ##### `ReturnBand`
13357
-
13358
- The triggering bound and the return band of an alarm type.
13359
-
13360
- With an upper bound the return value lies below it, with a lower one above
13361
- it. That is the dead band: it keeps the value sitting on the bound from
13362
- producing a hundred alarms.
13363
-
13364
- | Prop | Type | Default | Description |
13365
- |---|---|---|---|
13366
- | `direction` *required* | `"upper" \| "lower"` | — | `upper`: the alarm comes when the value rises above the bound. `lower`: it comes when the value falls below it. |
13367
- | `limit` *required* | `number` | — | The bound that triggered the alarm. Stands here so that the condition is described completely in one place - for the decision about resolving it is expressly not read. |
13368
- | `returnTo` *required* | `number` | — | The value the reading must come back past before the alarm resolves. |
13369
-
13370
12507
  ##### `RowActionsProps`
13371
12508
 
13372
12509
  Its table stands on [RowActions](#/rowactions/type-RowActionsProps).
@@ -13451,19 +12588,6 @@ interface SetFilter<Z> {
13451
12588
  }
13452
12589
  ```
13453
12590
 
13454
- ##### `Snooze`
13455
-
13456
- A snooze: a person's own, time-limited decision to take an alarm out of
13457
- the way.
13458
-
13459
- | Prop | Type | Default | Description |
13460
- |---|---|---|---|
13461
- | `until` *required* | `number` | — | When it ends, in milliseconds. Reaching it is enough.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide) and 2 more |
13462
- | `by` *required* | `string` | — | Who snoozed it - a snooze is tracked, not anonymous.<br>Shown in: [Show the alerts (AlarmList)](#/alarmlist/show-the-alerts), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide) and 2 more |
13463
- | `reason` | `string` | — | Why, when the application asked for one. The list shows it in the badge's tip and in what is spoken. |
13464
-
13465
- Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
13466
-
13467
12591
  ##### `SortDirection`
13468
12592
 
13469
12593
  The direction of one sort level: `asc` puts the smallest value on top,
@@ -13490,8 +12614,8 @@ row. Pass it as `of` to a part that stands outside the table.
13490
12614
 
13491
12615
  | Prop | Type | Default | Description |
13492
12616
  |---|---|---|---|
13493
- | `Table` *required* | `(props: `[`TableProps`](#/first-table/type-TableProps)`<Z>) => ReactNode` | — | <br>Shown in: [A first table (Installation)](#/installation/first-table), [Show a list of services (First table)](#/first-table/first-table), [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) and 116 more |
13494
- | `Column` *required* | [`ColumnComponent`](#type-ColumnComponent)`<Z>` | — | <br>Shown in: [A first table (Installation)](#/installation/first-table), [Show a list of services (First table)](#/first-table/first-table), [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) and 116 more |
12617
+ | `Table` *required* | `(props: `[`TableProps`](#/first-table/type-TableProps)`<Z>) => ReactNode` | — | <br>Shown in: [A first table (Installation)](#/installation/first-table), [Show a list of services (First table)](#/first-table/first-table), [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) and 118 more |
12618
+ | `Column` *required* | [`ColumnComponent`](#type-ColumnComponent)`<Z>` | — | <br>Shown in: [A first table (Installation)](#/installation/first-table), [Show a list of services (First table)](#/first-table/first-table), [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) and 118 more |
13495
12619
  | `VerdictColumn` *required* | [`VerdictColumnComponent`](#type-VerdictColumnComponent)`<Z>` | — | <br>Shown in: [Pin columns to both sides (Width and pinning)](#/width-and-pinning/pinned-both-sides), [Read a day's deliveries by depot (Grouping)](#/grouping/the-dispatch-report), [Carry the worst verdict up (Aggregate)](#/aggregate/worst-verdict) and 5 more |
13496
12620
  | `RowDetail` *required* | `(props: `[`RowDetailProps`](#/rowdetail/type-RowDetailProps)`<Z>) => ReactNode` | — | <br>Shown in: [Keep the header and the names in view (Width and pinning)](#/width-and-pinning/sticky-parts), [Employees in the detail (Tree rows)](#/tree-rows/employees-in-the-detail), [Own staff and teams (Tree rows)](#/tree-rows/own-staff-and-teams) and 5 more |
13497
12621
  | `RowActions` *required* | `(props: `[`RowActionsProps`](#/rowactions/type-RowActionsProps)`) => ReactNode` | — | <br>Shown in: [Name the row (Column)](#/column/row-header), [Pin columns to both sides (Width and pinning)](#/width-and-pinning/pinned-both-sides), [Select a whole group (Grouping)](#/grouping/a-whole-group-selected) and 7 more |
@@ -13522,9 +12646,10 @@ row. Pass it as `of` to a part that stands outside the table.
13522
12646
  | `filter` *required* | `Readonly<Record<string, unknown>>` | — | The conditions of the column filters and row filters by id, in the order in which they were set. Whatever fits no column and no row filter is absent. From `TableSnapshot`.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside) |
13523
12647
  | `setFilter` *required* | [`SetFilter`](#type-SetFilter)`<Z>` | — | Sets the condition of a column filter or a row filter; `null` clears it. Back to page one. A condition that does not fit the kind of the filter – a range on a list filter, a column without a filter, a row filter not in `rowFilters` – is passed over with a warning in development. From `TableSnapshot`.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside), [Filter by a field no column shows (Filter)](#/filter/a-field-no-column-shows), [Rows from a request (Filter)](#/filter/rows-from-a-request) and 5 more |
13524
12648
  | `conditionOf` *required* | `<B>(filter: `[`RowFilter`](#/filter/type-RowFilter)`<Z, B>) => B \| null` | — | The condition of a row filter, as its type - `null` while it is lifted. From `TableSnapshot`.<br>Shown in: [Filter by a field no column shows (Filter)](#/filter/a-field-no-column-shows), [Rows from a request (Filter)](#/filter/rows-from-a-request), [Ask a question over several fields (Filter)](#/filter/a-question-over-several-fields) and 3 more |
13525
- | `selection` *required* | [`TableSelection`](#type-TableSelection)`<string>` | — | The selection – its own or the one handed in through `selection`. From `TableSnapshot`.<br>Shown in: [Select rows (Selection)](#/selection/selection), [Copy the selection (Export)](#/export/copy-the-selection), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation) and 2 more |
12649
+ | `selection` *required* | [`TableSelection`](#type-TableSelection)`<string>` | — | The selection – its own or the one handed in through `selection`. From `TableSnapshot`.<br>Shown in: [Select rows (Selection)](#/selection/selection), [Copy the selection (Export)](#/export/copy-the-selection), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation) and 3 more |
13526
12650
  | `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/group-and-fold-from-controls-of-your-own) |
13527
12651
  | `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/group-and-fold-from-controls-of-your-own) |
12652
+ | `setView` *required* | `(view: `[`TableView`](#type-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/initial-view) |
13528
12653
  | `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/group-and-fold-from-controls-of-your-own) |
13529
12654
  | `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/group-and-fold-from-controls-of-your-own) |
13530
12655
  | `foldAll` *required* | `() => void` | — | Folds every group that has more than one row. From `TableSnapshot`.<br>Shown in: [Fold groups into a summary (Grouping)](#/grouping/the-overview) |
@@ -13540,7 +12665,7 @@ row. Pass it as `of` to a part that stands outside the table.
13540
12665
  | `rowCount` *required* | `number` | — | How many rows the filtered set has - in server mode the server's count. From `TableSnapshot`.<br>Shown in: [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) |
13541
12666
  | `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/sort-arrange-and-export-from-controls-of-your-own) |
13542
12667
 
13543
- Used on [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), [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), [Server mode](#/server-mode), [Grid mode](#/grid-mode), [Edits](#/edits) and [VerdictColumn](#/verdictcolumn).
12668
+ Used on [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), [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).
13544
12669
 
13545
12670
  ##### `TableInput<Z = unknown, K extends string = string>`
13546
12671
 
@@ -13550,15 +12675,15 @@ columns: search, filter, sort, page, hidden columns, order, grouping, tree.
13550
12675
  | Prop | Type | Default | Description |
13551
12676
  |---|---|---|---|
13552
12677
  | `search` | `string` | — | |
13553
- | `filter` | `(row: Z) => boolean` | — | An additional filter beside the free-text search, e.g. a status choice.<br>Shown in: [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Filter by state and priority (AlarmList)](#/alarmlist/filter-by-state-and-priority), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
13554
- | `sort` | [`SortLevel`](#type-SortLevel)`<K> \| readonly `[`SortLevel`](#type-SortLevel)`<K>[] \| null` | — | One level or several. A single level means the same as a list holding only it – which is why callers that still pass a single object remain correct unchanged. |
12678
+ | `filter` | `(row: Z) => boolean` | — | An additional filter beside the free-text search, e.g. a status choice. |
12679
+ | `sort` | [`SortLevel`](#type-SortLevel)`<K> \| readonly `[`SortLevel`](#type-SortLevel)`<K>[] \| null` | — | One level or several. A single level means the same as a list holding only it. |
13555
12680
  | `page` | `number` | — | 1-based; is clamped to the valid range. |
13556
12681
  | `pageSize` | `number` | — | |
13557
12682
  | `hidden` | `readonly K[]` | — | Ids of columns switched away. Columns that are not hideable stay. |
13558
12683
  | `order` | `readonly K[]` | — | The wanted column order. Columns not named follow in their natural order; unknown ids are passed over. |
13559
12684
  | `grouping` | `{ levels: readonly `[`GroupLevel`](#type-GroupLevel)`<Z>[]; aggregates?: readonly `[`AggregateColumn`](#type-AggregateColumn)`<Z>[]; folded: ReadonlySet<string>; /** The collation of text keys; the provider's, where there is one. */ compareText?: (a: string, b: string) => number; }` | — | Groups the sorted filtered set; a page then counts lines, not rows. |
13560
12685
  | `server` | `{ rowCount: number }` | — | Server mode: the rows are the page a server answered, and `rowCount` is its filtered set. The model then searches, filters, sorts, groups and pages nothing - it would do it over one page and call that the whole. |
13561
- | `tree` | [`TreeInput`](#type-TreeInput)`<Z>` | — | Tree rows: the rows are the roots, and these read their children. The model then sorts every level on its own, filters by core's path rule and pages nothing (table-tree-rows). |
12686
+ | `tree` | [`TreeInput`](#type-TreeInput)`<Z>` | — | Tree rows: the rows are the roots, and these read their children. The model then sorts every level on its own, filters by core's path rule and pages nothing. |
13562
12687
 
13563
12688
  ##### `TableOptions`
13564
12689
 
@@ -13604,11 +12729,11 @@ selection.
13604
12729
 
13605
12730
  | Prop | Type | Default | Description |
13606
12731
  |---|---|---|---|
13607
- | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
12732
+ | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
13608
12733
  | `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
13609
12734
  | `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
13610
12735
  | `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. |
13611
- | `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Acknowledge alerts (AlarmList)](#/alarmlist/acknowledge-alerts), [Snooze and hide (AlarmList)](#/alarmlist/snooze-and-hide) and 4 more |
12736
+ | `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts), [Find a late shipment (Scenarios)](#/scenarios/find-a-late-shipment) |
13612
12737
  | `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
13613
12738
  | `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
13614
12739
  | `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Copy the selection (Export)](#/export/copy-the-selection) and 2 more |
@@ -13653,15 +12778,6 @@ The size of a toolbar's controls.
13653
12778
  type ToolbarSize = "sm" | "md";
13654
12779
  ```
13655
12780
 
13656
- ##### `Transition`
13657
-
13658
- What can happen to an alarm. The caller reports the event; what it means the
13659
- model knows.
13660
-
13661
- ```ts
13662
- type Transition = "raised" | "acknowledged" | "resolved";
13663
- ```
13664
-
13665
12781
  ##### `TreeInput<Z>`
13666
12782
 
13667
12783
  Tree rows for the model: how a row is keyed, how its children are read,
@@ -13694,63 +12810,3 @@ interface VerdictColumnComponent<Z> {
13694
12810
  <K extends NumberField<Z>>(props: VerdictBase & { value: K; id?: string }): ReactNode;
13695
12811
  }
13696
12812
  ```
13697
-
13698
- #### Types on this page
13699
-
13700
- ##### `Line<Z>`
13701
-
13702
- One line of a grouped table. A header heads a group of an outer level; a row
13703
- of the innermost level stands in its span; a folded span is one line.
13704
-
13705
- ```ts
13706
- type Line<Z> =
13707
- | {
13708
- kind: "header";
13709
- group: RowGroup<Z>;
13710
- /** The headers around it. */
13711
- parents: readonly RowGroup<Z>[];
13712
- /** Repeated at the top of a page that begins inside the group. */
13713
- continued: boolean;
13714
- }
13715
- | {
13716
- kind: "row";
13717
- row: Z;
13718
- parents: readonly RowGroup<Z>[];
13719
- /** The span the row stands in - the innermost group, when there are
13720
- several levels; a single level has no span, its rows stand under
13721
- their group header. */
13722
- span: RowGroup<Z> | undefined;
13723
- /** The span shows its value on this line: the group's first row, or the
13724
- first of a page that begins inside it. */
13725
- first: boolean;
13726
- continued: boolean;
13727
- }
13728
- | { kind: "folded"; group: RowGroup<Z>; parents: readonly RowGroup<Z>[] };
13729
- ```
13730
-
13731
- ##### `FlatteningEntry<K, S extends Key = string>`
13732
-
13733
- From `@umriss-ui/core`.
13734
-
13735
- One visible node of a tree, with everything a row needs to be drawn and
13736
- read out: level, branch or leaf, check state, search state and position
13737
- among its siblings.
13738
-
13739
- | Prop | Type | Default | Description |
13740
- |---|---|---|---|
13741
- | `node` *required* | `K` | — | |
13742
- | `key` *required* | `S` | — | |
13743
- | `level` *required* | `number` | — | Roots stand at 0. Drives the indentation and what is read out. |
13744
- | `label` *required* | `string` | — | The node's text; here, so that typeahead can be a pure function over the flattening and needs no reader. |
13745
- | `branch` *required* | `boolean` | — | |
13746
- | `empty` *required* | `boolean` | — | Branch without content: expanding it showed nothing. An unloaded branch is not empty - it could have children. |
13747
- | `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. |
13748
- | `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. |
13749
- | `expanded` *required* | `boolean` | — | |
13750
- | `checked` *required* | `boolean` | — | |
13751
- | `indeterminate` *required* | `boolean` | — | Derived: not checked itself, but at least one descendant is. |
13752
- | `active` *required* | `boolean` | — | |
13753
- | `matches` *required* | `boolean` | — | Matched the search itself. Without a search text every entry matches, so that the surface needs no special case. |
13754
- | `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. |
13755
- | `position` *required* | `number` | — | 1-based, among the siblings that survive the filter. |
13756
- | `siblings` *required* | `number` | — | |