@umriss-ui/table 0.16.0 → 0.34.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.34.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
  }
@@ -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,7 +1257,7 @@ 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 |
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 |
1272
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 3 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) |
@@ -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 117 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 117 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 |
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 117 more |
1312
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 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 |
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 |
1314
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 22 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 |
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 |
1318
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), [Combine grid mode with groups, pinning and many rows (Grid mode)](#/grid-mode/the-whole-grid) |
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 |
@@ -1887,27 +1876,24 @@ The `label` is the column header's text, and so what a screen reader says for ev
1887
1876
 
1888
1877
  | Prop | Type | Default | Description |
1889
1878
  |---|---|---|---|
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 |
1879
+ | `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 117 more |
1891
1880
  | `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
1881
  | `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
1882
  | `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
1883
  | `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
1884
  | `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
1885
  | `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
1886
  | `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) |
1887
+ | `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 8 more |
1902
1888
 
1903
- Also every prop of `ColumnBase` and `ValuePaths`.
1889
+ Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
1904
1890
 
1905
1891
  ##### `ColumnBase`
1906
1892
 
1907
1893
  | Prop | Type | Default | Description |
1908
1894
  |---|---|---|---|
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 |
1895
+ | `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 117 more |
1896
+ | `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 116 more |
1911
1897
  | `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
1898
  | `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 |
1913
1899
  | `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 |
@@ -1920,7 +1906,7 @@ Also every prop of `ColumnBase` and `ValuePaths`.
1920
1906
 
1921
1907
  | Prop | Type | Default | Description |
1922
1908
  |---|---|---|---|
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) |
1909
+ | `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
1910
  | `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
1911
  | `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
1912
 
@@ -1962,20 +1948,6 @@ year.
1962
1948
  type GroupFor<W> = [Present<W>] extends [Date] ? DatePeriod : never;
1963
1949
  ```
1964
1950
 
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
1951
  ###### `EditFor<W, Z>`
1980
1952
 
1981
1953
  What a column accepts as `edit`: the core field for its value - `"text"`
@@ -2006,15 +1978,6 @@ What a column draws in a cell: the value present and its row.
2006
1978
  type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
2007
1979
  ```
2008
1980
 
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
1981
  ###### `Pin`
2019
1982
 
2020
1983
  Where a pinned column stands: in the block before or after the others.
@@ -2069,16 +2032,6 @@ The span a point in time is grouped by.
2069
2032
  type DatePeriod = "day" | "week" | "month" | "year";
2070
2033
  ```
2071
2034
 
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
2035
  ###### `CellEditorProps<W, Z>`
2083
2036
 
2084
2037
  What an editor of one's own receives. The table holds the draft; Enter,
@@ -2363,7 +2316,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
2363
2316
  | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
2364
2317
  | [`id`](#/column/FieldColumn-id) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
2365
2318
  | [`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
2319
  | [`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
2320
 
2369
2321
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
@@ -2938,13 +2890,10 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
2938
2890
  | [`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
2891
  | [`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
2892
  | [`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
2893
  | [`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
2894
  | [`editOptions`](#/column/FieldColumn-editOptions) | `readonly `[`Present`](#/column/type-Present)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`. |
2945
2895
  | [`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
2896
  | [`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
2897
 
2949
2898
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
2950
2899
 
@@ -6273,7 +6222,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
6273
6222
  | Prop | Type | Default | Description |
6274
6223
  |---|---|---|---|
6275
6224
  | [`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
6225
 
6278
6226
  From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
6279
6227
 
@@ -7190,7 +7138,7 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
7190
7138
  | Prop | Type | Default | Description |
7191
7139
  |---|---|---|---|
7192
7140
  | [`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. |
7141
+ | [`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
7142
 
7195
7143
  From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
7196
7144
 
@@ -7922,10 +7870,6 @@ export default function PartsOutsideAToolbar() {
7922
7870
  }
7923
7871
  ```
7924
7872
 
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
7873
  #### Keyboard
7930
7874
 
7931
7875
  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.
@@ -9044,13 +8988,13 @@ import { useTable } from "@umriss-ui/table";
9044
8988
 
9045
8989
  Demo page: https://romanhaendler.github.io/umriss-ui/table/view/
9046
8990
 
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.
8991
+ 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
8992
 
9049
8993
  #### Examples
9050
8994
 
9051
8995
  ##### Keep and restore a view
9052
8996
 
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.
8997
+ `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
8998
 
9055
8999
  ```tsx
9056
9000
  import { useState } from "react";
@@ -9078,12 +9022,12 @@ const INVOICES: Invoice[] = [
9078
9022
  ];
9079
9023
 
9080
9024
  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);
9025
+ /* The table holds its view and starts from `initialView`; `t.view` is what
9026
+ it shows now, and `t.setView` restores a kept one. */
9084
9027
  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;
9028
+ const [reports, setReports] = useState(0);
9029
+ const t = useTable(INVOICES, { rowKey: (i) => i.id, initialView: START_VIEW, onViewChange: () => setReports((n) => n + 1) });
9030
+ const { Table, Column, view, setView } = t;
9087
9031
 
9088
9032
  return (
9089
9033
  <Stack gap={3}>
@@ -9099,7 +9043,7 @@ export default function InitialView() {
9099
9043
  </Table>
9100
9044
  <Stack gap={1}>
9101
9045
  <Text as="span" size="sm" tone="secondary">
9102
- What the application would keep
9046
+ What the application would keep - reported {reports} times; a restore is not a report
9103
9047
  </Text>
9104
9048
  {/* JSON has no space to break at: without this it ran past a phone's card. */}
9105
9049
  <Text as="code" size="sm" mono data-role="view" style={{ overflowWrap: "anywhere" }}>
@@ -9145,18 +9089,19 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
9145
9089
  | Prop | Type | Default | Description |
9146
9090
  |---|---|---|---|
9147
9091
  | [`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. |
9092
+ | [`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
9093
 
9150
9094
  ###### Events
9151
9095
 
9152
9096
  | Prop | Type | Default | Description |
9153
9097
  |---|---|---|---|
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. |
9098
+ | [`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
9099
 
9156
9100
  From `TableSnapshot` — the full table stands on [First table](#/first-table/type-TableSnapshot).
9157
9101
 
9158
9102
  | Prop | Type | Default | Description |
9159
9103
  |---|---|---|---|
9104
+ | [`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
9105
  | [`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
9106
 
9162
9107
  From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
@@ -10833,7 +10778,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
10833
10778
  |---|---|---|---|
10834
10779
  | [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
10835
10780
  | [`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
10781
  | [`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
10782
  | [`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
10783
 
@@ -11257,7 +11201,7 @@ What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendl
11257
11201
 
11258
11202
  ## Limits and alarms
11259
11203
 
11260
- A reading, read against its limits - and alarms with a lifecycle.
11204
+ A reading, read against its limits.
11261
11205
 
11262
11206
  ### VerdictColumn
11263
11207
 
@@ -11489,7 +11433,6 @@ export default function ShowTheWorst() {
11489
11433
  #### When to use something else
11490
11434
 
11491
11435
  - A single reading in a tile or a bar → `Meter` from @umriss-ui/core
11492
- - Alerts with a lifecycle that someone acknowledges → AlarmList
11493
11436
 
11494
11437
  #### Keyboard
11495
11438
 
@@ -11519,8 +11462,7 @@ From `@umriss-ui/core`.
11519
11462
  The set a value is read against.
11520
11463
 
11521
11464
  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.
11465
+ violated, and it is never the edge of a region.
11524
11466
 
11525
11467
  | Prop | Type | Default | Description |
11526
11468
  |---|---|---|---|
@@ -11551,8 +11493,7 @@ A bound: a value, a side, a severity.
11551
11493
 
11552
11494
  No tolerance band as input. A band is derived - two limits of equal
11553
11495
  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.
11496
+ force a `null` on one edge in the one-sided case.
11556
11497
 
11557
11498
  | Prop | Type | Default | Description |
11558
11499
  |---|---|---|---|
@@ -11575,8 +11516,7 @@ type Side = "upper" | "lower";
11575
11516
  From `@umriss-ui/core`.
11576
11517
 
11577
11518
  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
11519
+ calls for action. Exactly two; for a third distinction one sets a
11580
11520
  second limit.
11581
11521
 
11582
11522
  ```ts
@@ -11590,1283 +11530,181 @@ type Severity = "warning" | "alarm";
11590
11530
 
11591
11531
  What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
11592
11532
 
11593
- ### AlarmList
11533
+ ## API index
11594
11534
 
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.
11535
+ Every name the package exports, in one place.
11596
11536
 
11597
- ```ts
11598
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11599
- ```
11537
+ ### API index
11600
11538
 
11601
- Demo page: https://romanhaendler.github.io/umriss-ui/table/alarmlist/
11539
+ Everything `@umriss-ui/table` exports, with its signature. A component's props stand on its own page.
11602
11540
 
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.
11541
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/api/
11604
11542
 
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.
11543
+ #### Components
11606
11544
 
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.
11545
+ ##### `ColumnMenu`
11608
11546
 
11609
- #### Examples
11547
+ [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.
11610
11548
 
11611
- ##### Show the alerts
11549
+ Used on [Scenarios](#/), [Provider](#/provider), [Column](#/column), [Width and pinning](#/width-and-pinning), [Search](#/search), [Grouping](#/grouping), [Tree rows](#/tree-rows), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [ColumnMenu](#/columnmenu), [View](#/view) and [Server mode](#/server-mode).
11612
11550
 
11613
- Hand your alerts and their types to [`alarmModel`](#/api/alarmModel) and its projection to `AlarmList` as `view`; the worst stands first.
11551
+ ##### `Export`
11614
11552
 
11615
- ```tsx
11616
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11617
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11553
+ [Export](#/export) – A button that writes the rows the user sees into a CSV file for a spreadsheet (also called download or export to Excel). Hand the application the text instead where it wants the clipboard or a file of its own.
11618
11554
 
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();
11555
+ Used on [Scenarios](#/), [Provider](#/provider), [Sorting](#/sorting), [Search](#/search), [Grouping](#/grouping), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [Export](#/export) and [Server mode](#/server-mode).
11621
11556
 
11622
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11623
- const NOW = at(17, 10, 30);
11557
+ ##### `Pagination`
11624
11558
 
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
- ];
11559
+ [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.
11633
11560
 
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
- ];
11561
+ 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).
11644
11562
 
11645
- const view = alarmModel({ alarms: ALERTS, types: ALERT_TYPES, asOf: NOW });
11563
+ ##### `Search`
11646
11564
 
11647
- export default function ShowTheAlerts() {
11648
- return <AlarmList view={view} />;
11649
- }
11650
- ```
11565
+ [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.
11651
11566
 
11652
- ##### Acknowledge alerts
11567
+ 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) and [Edits](#/edits).
11653
11568
 
11654
- Pass a `selection` and `onAcknowledge`, then apply [`acknowledge`](#/api/acknowledge) to your own state: the row changes state and stays in the list.
11569
+ ##### `Toolbar`
11655
11570
 
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";
11571
+ [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).
11660
11572
 
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();
11573
+ 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).
11663
11574
 
11664
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11665
- const NOW = at(17, 10, 30);
11575
+ #### Hooks
11666
11576
 
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
- ];
11577
+ ##### `useTable`
11675
11578
 
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
- ];
11579
+ A table over your rows: the hook holds its state - sort, filters, search,
11580
+ grouping, page, selection, column widths -, and the parts it returns are
11581
+ typed at your row, so that a field name in `Column` is checked by the
11582
+ compiler.
11686
11583
 
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));
11584
+ - `rows` – All rows in automatic mode; in server mode the page a server delivered for the current view.
11585
+ - `options` – How a row is keyed, the view to start from and the handler that hears every change of it, and in server mode the server's count and the handler that hears every request.
11586
+ - Returns The table's state and its parts: `Table`, `Column`,
11587
+ `VerdictColumn`, `RowDetail`, `RowActions`, `Action` and `GroupBy`. Pass it
11588
+ as `of` to a part that stands outside the table.
11691
11589
 
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
- }
11590
+ ```ts
11591
+ function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
11703
11592
  ```
11704
11593
 
11705
- ##### Mark a flood
11594
+ 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).
11595
+
11596
+ ##### `useTableSelection`
11706
11597
 
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.
11598
+ A small headless helper for row selection: it holds the selection as a set
11599
+ and supplies the states for "select all" (including indeterminate).
11600
+ What the selection means in the domain stays the application's business.
11708
11601
 
11709
- ```tsx
11710
- import { AlarmList, alarmModel } from "@umriss-ui/table";
11711
- import type { Alarm, AlarmType } from "@umriss-ui/table";
11602
+ ```ts
11603
+ function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;
11604
+ ```
11712
11605
 
11713
- const NOW = new Date(2026, 2, 17, 10, 30).getTime();
11714
- const MIN = 60_000;
11606
+ Used on [Selection](#/selection).
11715
11607
 
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
- ];
11608
+ #### Functions
11720
11609
 
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
- ];
11610
+ ##### `column`
11730
11611
 
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
- });
11612
+ A column preset that fits every table whose rows carry its field: create it
11613
+ once, outside the component, and spread it into a `Column`. With more than
11614
+ one field in `P`, name the field as the second type argument.
11739
11615
 
11740
- export default function MarkAFlood() {
11741
- return <AlarmList view={view} density="compact" />;
11742
- }
11616
+ ```ts
11617
+ function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;
11743
11618
  ```
11744
11619
 
11745
- ##### Snooze and hide
11620
+ 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) and [VerdictColumn](#/verdictcolumn).
11746
11621
 
11747
- Snoozed, suppressed and disabled alerts stay in the list, drawn neutral; with `onHiddenOnlyChange` their count becomes a switch.
11622
+ ##### `columnFilter`
11748
11623
 
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";
11624
+ A filter for columns with values of type `W` and conditions of type `B`.
11625
+ The compiler accepts it at every column whose value fits, and rejects it
11626
+ otherwise. Create it outside the component, like a preset.
11754
11627
 
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();
11628
+ ```ts
11629
+ function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;
11630
+ ```
11757
11631
 
11758
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11759
- const NOW = at(17, 10, 30);
11632
+ Used on [Filter](#/filter).
11760
11633
 
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
- ];
11634
+ ##### `rowFilter`
11769
11635
 
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
- ];
11636
+ A filter over the rows of type `Z` with conditions of type `B`. Create it
11637
+ outside the component, like a column filter, and name it in `rowFilters`.
11780
11638
 
11781
- const MIN = 60_000;
11639
+ ```ts
11640
+ function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
11641
+ ```
11782
11642
 
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
- ];
11643
+ Used on [Filter](#/filter) and [Toolbar controls](#/toolbar-controls).
11788
11644
 
11789
- export default function SnoozeAndHide() {
11790
- const [alerts, setAlerts] = useState<readonly Alarm[]>(START);
11791
- const [hiddenOnly, setHiddenOnly] = useState(false);
11645
+ #### Types
11792
11646
 
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));
11647
+ ##### `Absent`
11802
11648
 
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
- }
11649
+ A value that is not there: `null` or `undefined`.
11650
+
11651
+ ```ts
11652
+ type Absent = null | undefined;
11832
11653
  ```
11833
11654
 
11834
- ##### Tell quiet from disconnected
11655
+ Used on [Column](#/column).
11835
11656
 
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.
11657
+ ##### `ActionProps`
11837
11658
 
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";
11659
+ Its table stands on [RowActions](#/rowactions/type-ActionProps).
11842
11660
 
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;
11661
+ ##### `AggregateColumn<Z>`
11846
11662
 
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 };
11663
+ A column that carries an aggregate, as the pipeline needs it.
11850
11664
 
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
- ```
11665
+ | Prop | Type | Default | Description |
11666
+ |---|---|---|---|
11667
+ | `id` *required* | `string` | — | |
11668
+ | `read` *required* | `(row: Z) => unknown` | — | |
11669
+ | `aggregate` *required* | [`AggregateKind`](#type-AggregateKind)` \| `[`OwnAggregate`](#type-OwnAggregate)`<Z>` | — | |
11860
11670
 
11861
- ##### Offer snoozing to the operator
11671
+ ##### `AggregateFor<W, Z>`
11862
11672
 
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.
11673
+ What a column accepts as `aggregate`: sums and averages for numbers, the
11674
+ extremes for numbers and points in time, the range for points in time,
11675
+ counts for every value with a text form - or a function of one's own.
11864
11676
 
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";
11677
+ ```ts
11678
+ type AggregateFor<W, Z> =
11679
+ | ([Present<W>] extends [number] ? "sum" | "avg" | "min" | "max" : never)
11680
+ | ([Present<W>] extends [Date] ? "min" | "max" | "range" : never)
11681
+ | (IsDisplayable<W> extends true ? "count" | "distinct" : never)
11682
+ | AggregateFunction<W, Z>;
11683
+ ```
11869
11684
 
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();
11685
+ ##### `AggregateFunction<W, Z>`
11872
11686
 
11873
- /** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
11874
- const NOW = at(17, 10, 30);
11687
+ An aggregate of one's own: the values present and the rows of the group -
11688
+ or of the filtered set, in the footer. Its result runs through the column's
11689
+ presentation; `undefined` means there is none.
11875
11690
 
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
- ];
11691
+ ```ts
11692
+ type AggregateFunction<W, Z> = (values: readonly Present<NoInfer<W>>[], rows: readonly Z[]) => Present<NoInfer<W>> | undefined;
11693
+ ```
11883
11694
 
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
- ];
11695
+ ##### `AggregateKind`
11891
11696
 
11892
- const MIN = 60_000;
11697
+ The built-in aggregates. `range` is for points in time: the earliest and
11698
+ the latest.
11893
11699
 
11894
- /* The application's own rule: which durations an operator may choose. */
11895
- const DURATIONS = [15 * MIN, 60 * MIN, 4 * 60 * MIN] as const;
11700
+ ```ts
11701
+ type AggregateKind = "sum" | "avg" | "min" | "max" | "range" | "count" | "distinct";
11702
+ ```
11896
11703
 
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.
12260
-
12261
- ### API index
12262
-
12263
- Everything `@umriss-ui/table` exports, with its signature. A component's props stand on its own page.
12264
-
12265
- Demo page: https://romanhaendler.github.io/umriss-ui/table/api/
12266
-
12267
- #### Components
12268
-
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
- ##### `ColumnMenu`
12276
-
12277
- [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.
12278
-
12279
- Used on [Scenarios](#/), [Provider](#/provider), [Column](#/column), [Width and pinning](#/width-and-pinning), [Search](#/search), [Grouping](#/grouping), [Tree rows](#/tree-rows), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [ColumnMenu](#/columnmenu), [View](#/view) and [Server mode](#/server-mode).
12280
-
12281
- ##### `Export`
12282
-
12283
- [Export](#/export) – A button that writes the rows the user sees into a CSV file for a spreadsheet (also called download or export to Excel). Hand the application the text instead where it wants the clipboard or a file of its own.
12284
-
12285
- Used on [Scenarios](#/), [Provider](#/provider), [Sorting](#/sorting), [Search](#/search), [Grouping](#/grouping), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [Export](#/export) and [Server mode](#/server-mode).
12286
-
12287
- ##### `Pagination`
12288
-
12289
- [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
-
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).
12292
-
12293
- ##### `Search`
12294
-
12295
- [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
-
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).
12298
-
12299
- ##### `Toolbar`
12300
-
12301
- [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
-
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).
12304
-
12305
- #### Hooks
12306
-
12307
- ##### `useTable`
12308
-
12309
- A table over your rows: the hook holds its state - sort, filters, search,
12310
- grouping, page, selection, column widths -, and the parts it returns are
12311
- typed at your row, so that a field name in `Column` is checked by the
12312
- compiler.
12313
-
12314
- - `rows` – All rows in automatic mode; in server mode the page a server delivered for the current view.
12315
- - `options` – How a row is keyed, the view to start from and the handler that hears every change of it, and in server mode the server's count and the handler that hears every request.
12316
- - Returns The table's state and its parts: `Table`, `Column`,
12317
- `VerdictColumn`, `RowDetail`, `RowActions`, `Action` and `GroupBy`. Pass it
12318
- as `of` to a part that stands outside the table.
12319
-
12320
- ```ts
12321
- function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
12322
- ```
12323
-
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).
12325
-
12326
- ##### `useTableSelection`
12327
-
12328
- A small headless helper for row selection: it holds the selection as a set
12329
- and supplies the states for "select all" (including indeterminate).
12330
- What the selection means in the domain stays the application's business.
12331
-
12332
- ```ts
12333
- function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;
12334
- ```
12335
-
12336
- Used on [Scenarios](#/), [Selection](#/selection) and [AlarmList](#/alarmlist).
12337
-
12338
- #### Functions
12339
-
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
- ##### `column`
12392
-
12393
- A column preset that fits every table whose rows carry its field: create it
12394
- once, outside the component, and spread it into a `Column`. With more than
12395
- one field in `P`, name the field as the second type argument.
12396
-
12397
- ```ts
12398
- function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;
12399
- ```
12400
-
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).
12402
-
12403
- ##### `columnFilter`
12404
-
12405
- A filter for columns with values of type `W` and conditions of type `B`.
12406
- The compiler accepts it at every column whose value fits, and rejects it
12407
- otherwise. Create it outside the component, like a preset.
12408
-
12409
- ```ts
12410
- function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;
12411
- ```
12412
-
12413
- Used on [Filter](#/filter).
12414
-
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
- ##### `rowFilter`
12551
-
12552
- A filter over the rows of type `Z` with conditions of type `B`. Create it
12553
- outside the component, like a column filter, and name it in `rowFilters`.
12554
-
12555
- ```ts
12556
- function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
12557
- ```
12558
-
12559
- Used on [Filter](#/filter) and [Toolbar controls](#/toolbar-controls).
12560
-
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
- #### Types
12628
-
12629
- ##### `Absent`
12630
-
12631
- A value that is not there: `null` or `undefined`.
12632
-
12633
- ```ts
12634
- type Absent = null | undefined;
12635
- ```
12636
-
12637
- Used on [Column](#/column).
12638
-
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
- ##### `ActionProps`
12649
-
12650
- Its table stands on [RowActions](#/rowactions/type-ActionProps).
12651
-
12652
- ##### `AggregateColumn<Z>`
12653
-
12654
- A column that carries an aggregate, as the pipeline needs it.
12655
-
12656
- | Prop | Type | Default | Description |
12657
- |---|---|---|---|
12658
- | `id` *required* | `string` | — | |
12659
- | `read` *required* | `(row: Z) => unknown` | — | |
12660
- | `aggregate` *required* | [`AggregateKind`](#type-AggregateKind)` \| `[`OwnAggregate`](#type-OwnAggregate)`<Z>` | — | |
12661
-
12662
- ##### `AggregateFor<W, Z>`
12663
-
12664
- What a column accepts as `aggregate`: sums and averages for numbers, the
12665
- extremes for numbers and points in time, the range for points in time,
12666
- counts for every value with a text form - or a function of one's own.
12667
-
12668
- ```ts
12669
- type AggregateFor<W, Z> =
12670
- | ([Present<W>] extends [number] ? "sum" | "avg" | "min" | "max" : never)
12671
- | ([Present<W>] extends [Date] ? "min" | "max" | "range" : never)
12672
- | (IsDisplayable<W> extends true ? "count" | "distinct" : never)
12673
- | AggregateFunction<W, Z>;
12674
- ```
12675
-
12676
- ##### `AggregateFunction<W, Z>`
12677
-
12678
- An aggregate of one's own: the values present and the rows of the group -
12679
- or of the filtered set, in the footer. Its result runs through the column's
12680
- presentation; `undefined` means there is none.
12681
-
12682
- ```ts
12683
- type AggregateFunction<W, Z> = (values: readonly Present<NoInfer<W>>[], rows: readonly Z[]) => Present<NoInfer<W>> | undefined;
12684
- ```
12685
-
12686
- ##### `AggregateKind`
12687
-
12688
- The built-in aggregates. `range` is for points in time: the earliest and
12689
- the latest.
12690
-
12691
- ```ts
12692
- type AggregateKind = "sum" | "avg" | "min" | "max" | "range" | "count" | "distinct";
12693
- ```
12694
-
12695
- ##### `AggregateOptions`
11704
+ ##### `AggregateOptions`
12696
11705
 
12697
11706
  Its table stands on [Aggregate](#/aggregate/type-AggregateOptions).
12698
11707
 
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
11708
  ##### `CellEdit<Z>`
12871
11709
 
12872
11710
  An edit the user committed - reported, not applied.
@@ -12899,15 +11737,6 @@ Escape and Tab stay the table's, bubbling up from the field.
12899
11737
  |---|---|---|---|
12900
11738
  | `onChange` *required* | `(value: W \| null) => void` | — | Changes the draft. |
12901
11739
 
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
11740
  ##### `ColumnBase`
12912
11741
 
12913
11742
  Its table stands on [Column](#/column/type-ColumnBase).
@@ -13112,36 +11941,6 @@ type FilterFor<W> =
13112
11941
 
13113
11942
  Its table stands on [Filter](#/filter/type-FilterInputProps).
13114
11943
 
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
11944
  ##### `FormatFor<W>`
13146
11945
 
13147
11946
  What a column accepts as `format`: a number format for numbers, a date
@@ -13230,21 +12029,6 @@ type IsDisplayable<W> = [Present<W>] extends [never]
13230
12029
  : false;
13231
12030
  ```
13232
12031
 
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
12032
  ##### `ListCondition<W>`
13249
12033
 
13250
12034
  The condition of a list filter: the chosen values, an absent one as `null`.
@@ -13256,8 +12040,7 @@ type ListCondition<W> = readonly (Present<W> | null)[];
13256
12040
  ##### `ModelColumn<Z, K extends string = string>`
13257
12041
 
13258
12042
  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.
12043
+ export need of it, not its presentation.
13261
12044
 
13262
12045
  | Prop | Type | Default | Description |
13263
12046
  |---|---|---|---|
@@ -13328,22 +12111,6 @@ type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
13328
12111
 
13329
12112
  Used on [Formats](#/formats).
13330
12113
 
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
12114
  ##### `RangeCondition<W>`
13348
12115
 
13349
12116
  The condition of a range filter: both bounds inclusive, each may be absent.
@@ -13353,20 +12120,6 @@ The condition of a range filter: both bounds inclusive, each may be absent.
13353
12120
  | `from` | `W` | — | |
13354
12121
  | `to` | `W` | — | |
13355
12122
 
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
12123
  ##### `RowActionsProps`
13371
12124
 
13372
12125
  Its table stands on [RowActions](#/rowactions/type-RowActionsProps).
@@ -13451,19 +12204,6 @@ interface SetFilter<Z> {
13451
12204
  }
13452
12205
  ```
13453
12206
 
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
12207
  ##### `SortDirection`
13468
12208
 
13469
12209
  The direction of one sort level: `asc` puts the smallest value on top,
@@ -13490,8 +12230,8 @@ row. Pass it as `of` to a part that stands outside the table.
13490
12230
 
13491
12231
  | Prop | Type | Default | Description |
13492
12232
  |---|---|---|---|
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 |
12233
+ | `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 117 more |
12234
+ | `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 117 more |
13495
12235
  | `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
12236
  | `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
12237
  | `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 +12262,10 @@ row. Pass it as `of` to a part that stands outside the table.
13522
12262
  | `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
12263
  | `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
12264
  | `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 |
12265
+ | `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
12266
  | `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
12267
  | `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) |
12268
+ | `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
12269
  | `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
12270
  | `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
12271
  | `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) |
@@ -13550,15 +12291,15 @@ columns: search, filter, sort, page, hidden columns, order, grouping, tree.
13550
12291
  | Prop | Type | Default | Description |
13551
12292
  |---|---|---|---|
13552
12293
  | `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. |
12294
+ | `filter` | `(row: Z) => boolean` | — | An additional filter beside the free-text search, e.g. a status choice. |
12295
+ | `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
12296
  | `page` | `number` | — | 1-based; is clamped to the valid range. |
13556
12297
  | `pageSize` | `number` | — | |
13557
12298
  | `hidden` | `readonly K[]` | — | Ids of columns switched away. Columns that are not hideable stay. |
13558
12299
  | `order` | `readonly K[]` | — | The wanted column order. Columns not named follow in their natural order; unknown ids are passed over. |
13559
12300
  | `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
12301
  | `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). |
12302
+ | `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
12303
 
13563
12304
  ##### `TableOptions`
13564
12305
 
@@ -13604,11 +12345,11 @@ selection.
13604
12345
 
13605
12346
  | Prop | Type | Default | Description |
13606
12347
  |---|---|---|---|
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) |
12348
+ | `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
13608
12349
  | `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
13609
12350
  | `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
13610
12351
  | `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 |
12352
+ | `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
12353
  | `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
13613
12354
  | `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
13614
12355
  | `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 +12394,6 @@ The size of a toolbar's controls.
13653
12394
  type ToolbarSize = "sm" | "md";
13654
12395
  ```
13655
12396
 
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
12397
  ##### `TreeInput<Z>`
13666
12398
 
13667
12399
  Tree rows for the model: how a row is keyed, how its children are read,
@@ -13694,63 +12426,3 @@ interface VerdictColumnComponent<Z> {
13694
12426
  <K extends NumberField<Z>>(props: VerdictBase & { value: K; id?: string }): ReactNode;
13695
12427
  }
13696
12428
  ```
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` | — | |