@umriss-ui/table 0.15.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/CHANGELOG.md +50 -2
- package/README.md +26 -7
- package/dist/index.d.ts +21 -513
- package/dist/table.css +1 -1
- package/dist/table.js +2985 -3217
- package/docs/llms-full.md +238 -1517
- package/package.json +5 -4
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/table 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
|
|
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
|
|
17
|
-
3.
|
|
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:
|
|
19
|
+
Built from: First table, Stat, Badge, Button.
|
|
21
20
|
|
|
22
21
|
```tsx
|
|
23
|
-
import {
|
|
24
|
-
import { Button, Grid, Stack, Stat,
|
|
25
|
-
import {
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
106
|
-
{ id: "a-1",
|
|
107
|
-
{ id: "a-2",
|
|
108
|
-
{ id: "a-3",
|
|
109
|
-
{ id: "a-4",
|
|
110
|
-
{ id: "a-5",
|
|
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
|
|
126
|
-
const [
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const
|
|
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
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
<
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
|
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), [
|
|
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) |
|
|
@@ -1367,6 +1356,7 @@ A value cut short at the edge of its cell shows whole in a tip, under the pointe
|
|
|
1367
1356
|
| `foldAllBranches` *required* | `() => void` | — | Tree rows: closes every branch.<br>Shown in: [Open branches from controls of your own (Tree rows)](#/tree-rows/open-branches-from-controls-of-your-own) |
|
|
1368
1357
|
| `view` *required* | [`TableView`](#type-TableView) | — | The part of the state an application can keep; whatever still stands as the options set it up is absent.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Keep and restore a view (View)](#/view/initial-view) |
|
|
1369
1358
|
| `asCsv` *required* | `() => string` | — | The filtered set in the visible columns as text for a spreadsheet - in server mode the page.<br>Shown in: [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) |
|
|
1359
|
+
| `selectionAsText` *required* | `() => string` | — | The selected rows within the filtered set as tab-separated text under a header line - the text Ctrl+C writes. `""` with nothing selected.<br>Shown in: [Copy the selection (Export)](#/export/copy-the-selection) |
|
|
1370
1360
|
| `virtual` *required* | `boolean` | — | Whether it virtualises.<br>Shown in: [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own) |
|
|
1371
1361
|
| `rowCount` *required* | `number` | — | How many rows the filtered set has - in server mode the server's count.<br>Shown in: [Search and page from a header of your own](#/first-table/search-and-page-from-a-header-of-your-own) |
|
|
1372
1362
|
| `server` *required* | `boolean` | — | Whether it is in server mode: the rows are one page of a server's.<br>Shown in: [Sort, arrange and export from controls of your own](#/first-table/sort-arrange-and-export-from-controls-of-your-own) |
|
|
@@ -1471,14 +1461,14 @@ selection.
|
|
|
1471
1461
|
|
|
1472
1462
|
| Prop | Type | Default | Description |
|
|
1473
1463
|
|---|---|---|---|
|
|
1474
|
-
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [
|
|
1464
|
+
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
|
|
1475
1465
|
| `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
1476
1466
|
| `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
1477
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. |
|
|
1478
|
-
| `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [
|
|
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) |
|
|
1479
1469
|
| `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
|
|
1480
1470
|
| `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
|
|
1481
|
-
| `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [
|
|
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 |
|
|
1482
1472
|
|
|
1483
1473
|
###### `Pin`
|
|
1484
1474
|
|
|
@@ -1886,27 +1876,24 @@ The `label` is the column header's text, and so what a screen reader says for ev
|
|
|
1886
1876
|
|
|
1887
1877
|
| Prop | Type | Default | Description |
|
|
1888
1878
|
|---|---|---|---|
|
|
1889
|
-
| `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
|
|
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 |
|
|
1890
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) |
|
|
1891
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 |
|
|
1892
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 |
|
|
1893
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) |
|
|
1894
|
-
| `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 |
|
|
1895
|
-
| `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 |
|
|
1896
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 |
|
|
1897
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 |
|
|
1898
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 |
|
|
1899
|
-
| `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
|
|
1900
|
-
| `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 |
|
|
1901
1888
|
|
|
1902
|
-
Also every prop of `ColumnBase` and `
|
|
1889
|
+
Also every prop of `ColumnBase`, `ValuePaths` and `AggregateOptions`.
|
|
1903
1890
|
|
|
1904
1891
|
##### `ColumnBase`
|
|
1905
1892
|
|
|
1906
1893
|
| Prop | Type | Default | Description |
|
|
1907
1894
|
|---|---|---|---|
|
|
1908
|
-
| `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
|
|
1909
|
-
| `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
|
|
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 |
|
|
1910
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) |
|
|
1911
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 |
|
|
1912
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 |
|
|
@@ -1919,7 +1906,7 @@ Also every prop of `ColumnBase` and `ValuePaths`.
|
|
|
1919
1906
|
|
|
1920
1907
|
| Prop | Type | Default | Description |
|
|
1921
1908
|
|---|---|---|---|
|
|
1922
|
-
| `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) |
|
|
1923
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) |
|
|
1924
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) |
|
|
1925
1912
|
|
|
@@ -1961,20 +1948,6 @@ year.
|
|
|
1961
1948
|
type GroupFor<W> = [Present<W>] extends [Date] ? DatePeriod : never;
|
|
1962
1949
|
```
|
|
1963
1950
|
|
|
1964
|
-
###### `AggregateFor<W, Z>`
|
|
1965
|
-
|
|
1966
|
-
What a column accepts as `aggregate`: sums and averages for numbers, the
|
|
1967
|
-
extremes for numbers and points in time, the range for points in time,
|
|
1968
|
-
counts for every value with a text form - or a function of one's own.
|
|
1969
|
-
|
|
1970
|
-
```ts
|
|
1971
|
-
type AggregateFor<W, Z> =
|
|
1972
|
-
| ([Present<W>] extends [number] ? "sum" | "avg" | "min" | "max" : never)
|
|
1973
|
-
| ([Present<W>] extends [Date] ? "min" | "max" | "range" : never)
|
|
1974
|
-
| (IsDisplayable<W> extends true ? "count" | "distinct" : never)
|
|
1975
|
-
| AggregateFunction<W, Z>;
|
|
1976
|
-
```
|
|
1977
|
-
|
|
1978
1951
|
###### `EditFor<W, Z>`
|
|
1979
1952
|
|
|
1980
1953
|
What a column accepts as `edit`: the core field for its value - `"text"`
|
|
@@ -2005,15 +1978,6 @@ What a column draws in a cell: the value present and its row.
|
|
|
2005
1978
|
type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
|
|
2006
1979
|
```
|
|
2007
1980
|
|
|
2008
|
-
###### `FooterFor<W>`
|
|
2009
|
-
|
|
2010
|
-
What the old `footer` accepts: `"sum"` and `"avg"` for numbers, nothing
|
|
2011
|
-
for every other value.
|
|
2012
|
-
|
|
2013
|
-
```ts
|
|
2014
|
-
type FooterFor<W> = [Present<W>] extends [number] ? "sum" | "avg" : never;
|
|
2015
|
-
```
|
|
2016
|
-
|
|
2017
1981
|
###### `Pin`
|
|
2018
1982
|
|
|
2019
1983
|
Where a pinned column stands: in the block before or after the others.
|
|
@@ -2068,16 +2032,6 @@ The span a point in time is grouped by.
|
|
|
2068
2032
|
type DatePeriod = "day" | "week" | "month" | "year";
|
|
2069
2033
|
```
|
|
2070
2034
|
|
|
2071
|
-
###### `AggregateFunction<W, Z>`
|
|
2072
|
-
|
|
2073
|
-
An aggregate of one's own: the values present and the rows of the group -
|
|
2074
|
-
or of the filtered set, in the footer. Its result runs through the column's
|
|
2075
|
-
presentation; `undefined` means there is none.
|
|
2076
|
-
|
|
2077
|
-
```ts
|
|
2078
|
-
type AggregateFunction<W, Z> = (values: readonly Present<NoInfer<W>>[], rows: readonly Z[]) => Present<NoInfer<W>> | undefined;
|
|
2079
|
-
```
|
|
2080
|
-
|
|
2081
2035
|
###### `CellEditorProps<W, Z>`
|
|
2082
2036
|
|
|
2083
2037
|
What an editor of one's own receives. The table holds the draft; Enter,
|
|
@@ -2362,7 +2316,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
|
|
|
2362
2316
|
| [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
2363
2317
|
| [`id`](#/column/FieldColumn-id) | `string` | — | An id of one's own instead of the field name – for two columns over the same field. |
|
|
2364
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. |
|
|
2365
|
-
| [`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`. |
|
|
2366
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. |
|
|
2367
2320
|
|
|
2368
2321
|
From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
|
|
@@ -2937,13 +2890,10 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
|
|
|
2937
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. |
|
|
2938
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. |
|
|
2939
2892
|
| [`group`](#/column/FieldColumn-group) | [`GroupFor`](#/column/type-GroupFor)`<Z[K]>` | — | Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`. |
|
|
2940
|
-
| [`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`. |
|
|
2941
|
-
| [`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`. |
|
|
2942
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`. |
|
|
2943
2894
|
| [`editOptions`](#/column/FieldColumn-editOptions) | `readonly `[`Present`](#/column/type-Present)`<Z[K]>[]` | the values that occur | What `edit="select"` offers. From `EditOptions`. |
|
|
2944
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`. |
|
|
2945
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. |
|
|
2946
|
-
| [`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. |
|
|
2947
2897
|
|
|
2948
2898
|
From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
|
|
2949
2899
|
|
|
@@ -6272,7 +6222,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
|
|
|
6272
6222
|
| Prop | Type | Default | Description |
|
|
6273
6223
|
|---|---|---|---|
|
|
6274
6224
|
| [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
6275
|
-
| [`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`. |
|
|
6276
6225
|
|
|
6277
6226
|
From `ColumnBase` — the full table stands on [Column](#/column/type-ColumnBase).
|
|
6278
6227
|
|
|
@@ -7189,7 +7138,7 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
|
|
|
7189
7138
|
| Prop | Type | Default | Description |
|
|
7190
7139
|
|---|---|---|---|
|
|
7191
7140
|
| [`rowKey`](#/first-table/TableOptions-rowKey) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
|
|
7192
|
-
| [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-TableView) | — | The view to start from,
|
|
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. |
|
|
7193
7142
|
|
|
7194
7143
|
From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
|
|
7195
7144
|
|
|
@@ -7921,10 +7870,6 @@ export default function PartsOutsideAToolbar() {
|
|
|
7921
7870
|
}
|
|
7922
7871
|
```
|
|
7923
7872
|
|
|
7924
|
-
#### When to use something else
|
|
7925
|
-
|
|
7926
|
-
- Actions that should stay in view while the page scrolls → `Dock` from @umriss-ui/core
|
|
7927
|
-
|
|
7928
7873
|
#### Keyboard
|
|
7929
7874
|
|
|
7930
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.
|
|
@@ -8850,10 +8795,12 @@ import { Export } from "@umriss-ui/table";
|
|
|
8850
8795
|
|
|
8851
8796
|
Demo page: https://romanhaendler.github.io/umriss-ui/table/export/
|
|
8852
8797
|
|
|
8853
|
-
It writes the filtered set across all pages, in the visible columns, in the order and sorting on screen – and the values, not their presentation: numbers with
|
|
8798
|
+
It writes the filtered set across all pages, in the visible columns, in the order and sorting on screen – and the values, not their presentation: numbers with the decimal mark of the formats, yes and no from the wording, a point in time as a timestamp, an absent value as an empty field. The separator follows the mark – a comma, or a semicolon where the mark is a comma – and a byte order mark tells the spreadsheet it is UTF-8. English gets commas and a point; the German wording and formats from `@umriss-ui/core/wording/de` get the file the table always wrote, and German wording with English formats gets German words with comma and point – take both halves ([ADR-0061](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0061-the-csv-follows-the-language-in-use.md)).
|
|
8854
8799
|
|
|
8855
8800
|
A verdict column exports its value, not the verdict. In [server mode](#/server-mode) the table holds one page of the server's, so it exports that page, and the button says so. The same text is `t.asCsv()`, without a button.
|
|
8856
8801
|
|
|
8802
|
+
Ctrl or Cmd with C copies the selected rows – the visible columns under a header line, tab-separated, with the same values and the formats' decimal mark – and in a grid with no selection the Active cell. What was copied flashes once in an accent tint (shown without the fade under reduced motion), and a screen reader is told how many rows were copied, or that the copy failed. Marked text and a focused field keep the browser's own copy; in an open cell editor with nothing marked the key copies the value that stands in the field. `t.selectionAsText()` is the same text for a button of your own, as in the last example.
|
|
8803
|
+
|
|
8857
8804
|
#### Examples
|
|
8858
8805
|
|
|
8859
8806
|
##### Download a file
|
|
@@ -8939,6 +8886,50 @@ export default function TakeTheText() {
|
|
|
8939
8886
|
}
|
|
8940
8887
|
```
|
|
8941
8888
|
|
|
8889
|
+
##### Copy the selection
|
|
8890
|
+
|
|
8891
|
+
Ctrl or Cmd with C copies the selected rows, tab-separated under a header line, and they flash once; `selectionAsText()` hands the same text to a button of your own.
|
|
8892
|
+
|
|
8893
|
+
```tsx
|
|
8894
|
+
import { Button, Stack, Text } from "@umriss-ui/core";
|
|
8895
|
+
import { useTable } from "@umriss-ui/table";
|
|
8896
|
+
|
|
8897
|
+
interface Shipment {
|
|
8898
|
+
id: string;
|
|
8899
|
+
customer: string;
|
|
8900
|
+
weight: number;
|
|
8901
|
+
}
|
|
8902
|
+
|
|
8903
|
+
const SHIPMENTS: Shipment[] = [
|
|
8904
|
+
{ id: "FP-1004210", customer: "Holloway Garden Supplies", weight: 23.5 },
|
|
8905
|
+
{ id: "FP-1004223", customer: "Northgate Florists", weight: 41.25 },
|
|
8906
|
+
{ id: "FP-1004236", customer: "Pellham Hardware", weight: 4 },
|
|
8907
|
+
];
|
|
8908
|
+
|
|
8909
|
+
export default function CopyTheSelection() {
|
|
8910
|
+
const t = useTable(SHIPMENTS, { rowKey: (s) => s.id });
|
|
8911
|
+
const { Table, Column } = t;
|
|
8912
|
+
|
|
8913
|
+
return (
|
|
8914
|
+
<Stack gap={3}>
|
|
8915
|
+
<Stack direction="row" gap={2} align="center">
|
|
8916
|
+
<Button size="sm" variant="secondary" onClick={() => void navigator.clipboard.writeText(t.selectionAsText())} disabled={t.selection.count === 0}>
|
|
8917
|
+
Copy as table
|
|
8918
|
+
</Button>
|
|
8919
|
+
<Text size="xs" tone="muted">
|
|
8920
|
+
{t.selection.count} selected
|
|
8921
|
+
</Text>
|
|
8922
|
+
</Stack>
|
|
8923
|
+
<Table selectable ariaLabel="Shipments to copy">
|
|
8924
|
+
<Column value="id" label="Shipment" rowHeader />
|
|
8925
|
+
<Column value="customer" label="Customer" />
|
|
8926
|
+
<Column value="weight" label="Weight (kg)" />
|
|
8927
|
+
</Table>
|
|
8928
|
+
</Stack>
|
|
8929
|
+
);
|
|
8930
|
+
}
|
|
8931
|
+
```
|
|
8932
|
+
|
|
8942
8933
|
#### Keyboard
|
|
8943
8934
|
|
|
8944
8935
|
The keys of [First table](#/first-table/keyboard-first-table), [Input](https://romanhaendler.github.io/umriss-ui/core/input/#keyboard-input) and [Button](https://romanhaendler.github.io/umriss-ui/core/button/#keyboard-button) apply here.
|
|
@@ -8997,13 +8988,13 @@ import { useTable } from "@umriss-ui/table";
|
|
|
8997
8988
|
|
|
8998
8989
|
Demo page: https://romanhaendler.github.io/umriss-ui/table/view/
|
|
8999
8990
|
|
|
9000
|
-
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
|
|
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.
|
|
9001
8992
|
|
|
9002
8993
|
#### Examples
|
|
9003
8994
|
|
|
9004
8995
|
##### Keep and restore a view
|
|
9005
8996
|
|
|
9006
|
-
`
|
|
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.
|
|
9007
8998
|
|
|
9008
8999
|
```tsx
|
|
9009
9000
|
import { useState } from "react";
|
|
@@ -9031,12 +9022,12 @@ const INVOICES: Invoice[] = [
|
|
|
9031
9022
|
];
|
|
9032
9023
|
|
|
9033
9024
|
export default function InitialView() {
|
|
9034
|
-
/* The
|
|
9035
|
-
|
|
9036
|
-
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. */
|
|
9037
9027
|
const [kept, setKept] = useState<TableView | null>(null);
|
|
9038
|
-
const
|
|
9039
|
-
const {
|
|
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;
|
|
9040
9031
|
|
|
9041
9032
|
return (
|
|
9042
9033
|
<Stack gap={3}>
|
|
@@ -9052,7 +9043,7 @@ export default function InitialView() {
|
|
|
9052
9043
|
</Table>
|
|
9053
9044
|
<Stack gap={1}>
|
|
9054
9045
|
<Text as="span" size="sm" tone="secondary">
|
|
9055
|
-
What the application would keep
|
|
9046
|
+
What the application would keep - reported {reports} times; a restore is not a report
|
|
9056
9047
|
</Text>
|
|
9057
9048
|
{/* JSON has no space to break at: without this it ran past a phone's card. */}
|
|
9058
9049
|
<Text as="code" size="sm" mono data-role="view" style={{ overflowWrap: "anywhere" }}>
|
|
@@ -9098,18 +9089,19 @@ From `TableOptions` — the full table stands on [First table](#/first-table/typ
|
|
|
9098
9089
|
| Prop | Type | Default | Description |
|
|
9099
9090
|
|---|---|---|---|
|
|
9100
9091
|
| [`rowKey`](#/first-table/TableOptions-rowKey) *required* | `(row: Z) => string` | — | A stable key per row – the basis of selection and expansion. |
|
|
9101
|
-
| [`initialView`](#/first-table/TableOptions-initialView) | [`TableView`](#/first-table/type-TableView) | — | The view to start from,
|
|
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. |
|
|
9102
9093
|
|
|
9103
9094
|
###### Events
|
|
9104
9095
|
|
|
9105
9096
|
| Prop | Type | Default | Description |
|
|
9106
9097
|
|---|---|---|---|
|
|
9107
|
-
| [`onViewChange`](#/first-table/TableOptions-onViewChange) | `(view: `[`TableView`](#/first-table/type-TableView)`) => void` | — | Every change
|
|
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. |
|
|
9108
9099
|
|
|
9109
9100
|
From `TableSnapshot` — the full table stands on [First table](#/first-table/type-TableSnapshot).
|
|
9110
9101
|
|
|
9111
9102
|
| Prop | Type | Default | Description |
|
|
9112
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. |
|
|
9113
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. |
|
|
9114
9106
|
|
|
9115
9107
|
From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColumn).
|
|
@@ -10744,6 +10736,7 @@ export default function TheWholeGrid() {
|
|
|
10744
10736
|
| `Click` | Opens the editor of a cell that edits; a select shows its list, a day its calendar. |
|
|
10745
10737
|
| `Enter / F2` | Starts an edit, or reaches the cell's own controls. |
|
|
10746
10738
|
| `Escape` | Cancels an edit, or goes back from a control to its cell. |
|
|
10739
|
+
| `Ctrl / Cmd + C` | Copies the selected rows, or the active cell; its cell flashes. In an open editor with nothing marked it copies the field's value. |
|
|
10747
10740
|
| `Space` | Selects the row of the active cell. |
|
|
10748
10741
|
|
|
10749
10742
|
#### Props on this page
|
|
@@ -10785,7 +10778,6 @@ From `FieldColumn` — the full table stands on [Column](#/column/type-FieldColu
|
|
|
10785
10778
|
|---|---|---|---|
|
|
10786
10779
|
| [`value`](#/column/FieldColumn-value) *required* | `K` | — | A field of the row. Supplies the column's `id` at the same time. |
|
|
10787
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. |
|
|
10788
|
-
| [`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`. |
|
|
10789
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`. |
|
|
10790
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`. |
|
|
10791
10783
|
|
|
@@ -11209,7 +11201,7 @@ What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendl
|
|
|
11209
11201
|
|
|
11210
11202
|
## Limits and alarms
|
|
11211
11203
|
|
|
11212
|
-
A reading, read against its limits
|
|
11204
|
+
A reading, read against its limits.
|
|
11213
11205
|
|
|
11214
11206
|
### VerdictColumn
|
|
11215
11207
|
|
|
@@ -11441,7 +11433,6 @@ export default function ShowTheWorst() {
|
|
|
11441
11433
|
#### When to use something else
|
|
11442
11434
|
|
|
11443
11435
|
- A single reading in a tile or a bar → `Meter` from @umriss-ui/core
|
|
11444
|
-
- Alerts with a lifecycle that someone acknowledges → AlarmList
|
|
11445
11436
|
|
|
11446
11437
|
#### Keyboard
|
|
11447
11438
|
|
|
@@ -11471,8 +11462,7 @@ From `@umriss-ui/core`.
|
|
|
11471
11462
|
The set a value is read against.
|
|
11472
11463
|
|
|
11473
11464
|
The target stands beside the limits and is not one: it is missed, never
|
|
11474
|
-
violated, and it is never the edge of a region.
|
|
11475
|
-
tile turns red for being above target.
|
|
11465
|
+
violated, and it is never the edge of a region.
|
|
11476
11466
|
|
|
11477
11467
|
| Prop | Type | Default | Description |
|
|
11478
11468
|
|---|---|---|---|
|
|
@@ -11503,8 +11493,7 @@ A bound: a value, a side, a severity.
|
|
|
11503
11493
|
|
|
11504
11494
|
No tolerance band as input. A band is derived - two limits of equal
|
|
11505
11495
|
severity on opposite sides enclose one - and as an input type it would
|
|
11506
|
-
force a `null` on one edge in the one-sided case.
|
|
11507
|
-
case, not the exception.
|
|
11496
|
+
force a `null` on one edge in the one-sided case.
|
|
11508
11497
|
|
|
11509
11498
|
| Prop | Type | Default | Description |
|
|
11510
11499
|
|---|---|---|---|
|
|
@@ -11527,8 +11516,7 @@ type Side = "upper" | "lower";
|
|
|
11527
11516
|
From `@umriss-ui/core`.
|
|
11528
11517
|
|
|
11529
11518
|
How seriously a violation weighs: one severity that advises and one that
|
|
11530
|
-
calls for action. Exactly two
|
|
11531
|
-
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
|
|
11532
11520
|
second limit.
|
|
11533
11521
|
|
|
11534
11522
|
```ts
|
|
@@ -11542,1066 +11530,135 @@ type Severity = "warning" | "alarm";
|
|
|
11542
11530
|
|
|
11543
11531
|
What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
|
|
11544
11532
|
|
|
11545
|
-
|
|
11533
|
+
## API index
|
|
11546
11534
|
|
|
11547
|
-
|
|
11535
|
+
Every name the package exports, in one place.
|
|
11548
11536
|
|
|
11549
|
-
|
|
11550
|
-
import { AlarmList, alarmModel } from "@umriss-ui/table";
|
|
11551
|
-
```
|
|
11537
|
+
### API index
|
|
11552
11538
|
|
|
11553
|
-
|
|
11539
|
+
Everything `@umriss-ui/table` exports, with its signature. A component's props stand on its own page.
|
|
11554
11540
|
|
|
11555
|
-
|
|
11541
|
+
Demo page: https://romanhaendler.github.io/umriss-ui/table/api/
|
|
11556
11542
|
|
|
11557
|
-
|
|
11543
|
+
#### Components
|
|
11558
11544
|
|
|
11559
|
-
|
|
11545
|
+
##### `ColumnMenu`
|
|
11560
11546
|
|
|
11561
|
-
|
|
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.
|
|
11562
11548
|
|
|
11563
|
-
|
|
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).
|
|
11564
11550
|
|
|
11565
|
-
|
|
11551
|
+
##### `Export`
|
|
11566
11552
|
|
|
11567
|
-
|
|
11568
|
-
import { AlarmList, alarmModel } from "@umriss-ui/table";
|
|
11569
|
-
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.
|
|
11570
11554
|
|
|
11571
|
-
|
|
11572
|
-
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).
|
|
11573
11556
|
|
|
11574
|
-
|
|
11575
|
-
const NOW = at(17, 10, 30);
|
|
11557
|
+
##### `Pagination`
|
|
11576
11558
|
|
|
11577
|
-
|
|
11578
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11579
|
-
{ id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
|
|
11580
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11581
|
-
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
11582
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11583
|
-
{ id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
|
|
11584
|
-
];
|
|
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.
|
|
11585
11560
|
|
|
11586
|
-
|
|
11587
|
-
const ALERTS: readonly Alarm[] = [
|
|
11588
|
-
{ id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
|
|
11589
|
-
{ id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
|
|
11590
|
-
{ id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11591
|
-
{ id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
|
|
11592
|
-
{ id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
|
|
11593
|
-
{ id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
|
|
11594
|
-
{ id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
|
|
11595
|
-
];
|
|
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).
|
|
11596
11562
|
|
|
11597
|
-
|
|
11563
|
+
##### `Search`
|
|
11598
11564
|
|
|
11599
|
-
|
|
11600
|
-
return <AlarmList view={view} />;
|
|
11601
|
-
}
|
|
11602
|
-
```
|
|
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.
|
|
11603
11566
|
|
|
11604
|
-
|
|
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).
|
|
11605
11568
|
|
|
11606
|
-
|
|
11569
|
+
##### `Toolbar`
|
|
11607
11570
|
|
|
11608
|
-
|
|
11609
|
-
import { useMemo, useState } from "react";
|
|
11610
|
-
import { AlarmList, acknowledge, alarmModel, useTableSelection } from "@umriss-ui/table";
|
|
11611
|
-
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).
|
|
11612
11572
|
|
|
11613
|
-
|
|
11614
|
-
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).
|
|
11615
11574
|
|
|
11616
|
-
|
|
11617
|
-
const NOW = at(17, 10, 30);
|
|
11575
|
+
#### Hooks
|
|
11618
11576
|
|
|
11619
|
-
|
|
11620
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11621
|
-
{ id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
|
|
11622
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11623
|
-
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
11624
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11625
|
-
{ id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
|
|
11626
|
-
];
|
|
11577
|
+
##### `useTable`
|
|
11627
11578
|
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11632
|
-
{ id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11633
|
-
{ id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
|
|
11634
|
-
{ id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
|
|
11635
|
-
{ id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
|
|
11636
|
-
{ id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
|
|
11637
|
-
];
|
|
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.
|
|
11638
11583
|
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
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.
|
|
11643
11589
|
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
view={view}
|
|
11647
|
-
selection={selection}
|
|
11648
|
-
onAcknowledge={(ids) => {
|
|
11649
|
-
setAlerts((current) => acknowledge(current, ids, NOW).alarms);
|
|
11650
|
-
selection.clear();
|
|
11651
|
-
}}
|
|
11652
|
-
/>
|
|
11653
|
-
);
|
|
11654
|
-
}
|
|
11590
|
+
```ts
|
|
11591
|
+
function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
|
|
11655
11592
|
```
|
|
11656
11593
|
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
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.
|
|
11660
|
-
|
|
11661
|
-
```tsx
|
|
11662
|
-
import { AlarmList, alarmModel } from "@umriss-ui/table";
|
|
11663
|
-
import type { Alarm, AlarmType } from "@umriss-ui/table";
|
|
11664
|
-
|
|
11665
|
-
const NOW = new Date(2026, 2, 17, 10, 30).getTime();
|
|
11666
|
-
const MIN = 60_000;
|
|
11667
|
-
|
|
11668
|
-
const TYPES: AlarmType[] = [
|
|
11669
|
-
{ id: "notifications-retry", label: "Notifications · sends retrying", priority: "low" },
|
|
11670
|
-
{ id: "webhooks-timeout", label: "Webhooks · endpoint timeouts", priority: "medium" },
|
|
11671
|
-
];
|
|
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).
|
|
11672
11595
|
|
|
11673
|
-
|
|
11674
|
-
...Array.from({ length: 9 }, (_, i) => ({
|
|
11675
|
-
id: `n-${i}`,
|
|
11676
|
-
type: "notifications-retry",
|
|
11677
|
-
lifecycle: "active-unacknowledged" as const,
|
|
11678
|
-
raised: NOW - (4 + i) * MIN,
|
|
11679
|
-
})),
|
|
11680
|
-
{ id: "w-1", type: "webhooks-timeout", lifecycle: "resolved-unacknowledged", raised: NOW - 320 * MIN, resolved: NOW - 300 * MIN },
|
|
11681
|
-
];
|
|
11596
|
+
##### `useTableSelection`
|
|
11682
11597
|
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
asOf: NOW,
|
|
11687
|
-
// The chatter window covers the period shown, or the frequency column reads zero.
|
|
11688
|
-
chatter: { windowMs: 12 * 60 * MIN, atLeast: 5 },
|
|
11689
|
-
flood: { windowMs: 15 * MIN, atLeast: 8 },
|
|
11690
|
-
});
|
|
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.
|
|
11691
11601
|
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
}
|
|
11602
|
+
```ts
|
|
11603
|
+
function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;
|
|
11695
11604
|
```
|
|
11696
11605
|
|
|
11697
|
-
|
|
11606
|
+
Used on [Selection](#/selection).
|
|
11698
11607
|
|
|
11699
|
-
|
|
11608
|
+
#### Functions
|
|
11700
11609
|
|
|
11701
|
-
|
|
11702
|
-
import { useMemo, useState } from "react";
|
|
11703
|
-
import { Button, Stack } from "@umriss-ui/core";
|
|
11704
|
-
import { AlarmList, acknowledge, alarmModel, isHidden, snooze, useTableSelection } from "@umriss-ui/table";
|
|
11705
|
-
import type { Alarm, AlarmType } from "@umriss-ui/table";
|
|
11610
|
+
##### `column`
|
|
11706
11611
|
|
|
11707
|
-
|
|
11708
|
-
|
|
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.
|
|
11709
11615
|
|
|
11710
|
-
|
|
11711
|
-
|
|
11616
|
+
```ts
|
|
11617
|
+
function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;
|
|
11618
|
+
```
|
|
11712
11619
|
|
|
11713
|
-
|
|
11714
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11715
|
-
{ id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
|
|
11716
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11717
|
-
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
11718
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11719
|
-
{ id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
|
|
11720
|
-
];
|
|
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).
|
|
11721
11621
|
|
|
11722
|
-
|
|
11723
|
-
const ALERTS: readonly Alarm[] = [
|
|
11724
|
-
{ id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
|
|
11725
|
-
{ id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
|
|
11726
|
-
{ id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11727
|
-
{ id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
|
|
11728
|
-
{ id: "a-5", type: "search-latency", lifecycle: "resolved-acknowledged", raised: at(17, 8, 5), resolved: at(17, 8, 9), acknowledgedAt: at(17, 8, 6) },
|
|
11729
|
-
{ id: "a-6", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
|
|
11730
|
-
{ id: "a-7", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
|
|
11731
|
-
];
|
|
11622
|
+
##### `columnFilter`
|
|
11732
11623
|
|
|
11733
|
-
|
|
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.
|
|
11734
11627
|
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
{ id: "a-8", type: "search-latency", lifecycle: "active-unacknowledged", raised: NOW - 12 * MIN, availability: "suppressed" },
|
|
11739
|
-
];
|
|
11628
|
+
```ts
|
|
11629
|
+
function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;
|
|
11630
|
+
```
|
|
11740
11631
|
|
|
11741
|
-
|
|
11742
|
-
const [alerts, setAlerts] = useState<readonly Alarm[]>(START);
|
|
11743
|
-
const [hiddenOnly, setHiddenOnly] = useState(false);
|
|
11632
|
+
Used on [Filter](#/filter).
|
|
11744
11633
|
|
|
11745
|
-
|
|
11746
|
-
() =>
|
|
11747
|
-
alarmModel(
|
|
11748
|
-
{ alarms: alerts, types: ALERT_TYPES, asOf: NOW },
|
|
11749
|
-
hiddenOnly ? { filter: (row) => isHidden(row.availability) } : {},
|
|
11750
|
-
),
|
|
11751
|
-
[alerts, hiddenOnly],
|
|
11752
|
-
);
|
|
11753
|
-
const selection = useTableSelection(view.filtered.map((row) => row.id));
|
|
11634
|
+
##### `rowFilter`
|
|
11754
11635
|
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
<AlarmList
|
|
11758
|
-
view={view}
|
|
11759
|
-
selection={selection}
|
|
11760
|
-
hiddenOnly={hiddenOnly}
|
|
11761
|
-
onHiddenOnlyChange={setHiddenOnly}
|
|
11762
|
-
onAcknowledge={(ids) => {
|
|
11763
|
-
setAlerts((current) => acknowledge(current, ids, NOW).alarms);
|
|
11764
|
-
selection.clear();
|
|
11765
|
-
}}
|
|
11766
|
-
/>
|
|
11767
|
-
<div>
|
|
11768
|
-
<Button
|
|
11769
|
-
size="sm"
|
|
11770
|
-
disabled={selection.selected.size === 0}
|
|
11771
|
-
onClick={() => {
|
|
11772
|
-
setAlerts((current) =>
|
|
11773
|
-
current.map((a) => (selection.selected.has(a.id) ? snooze(a, NOW + 60 * MIN, "Jonas Keller") : a)),
|
|
11774
|
-
);
|
|
11775
|
-
selection.clear();
|
|
11776
|
-
}}
|
|
11777
|
-
>
|
|
11778
|
-
Snooze for an hour
|
|
11779
|
-
</Button>
|
|
11780
|
-
</div>
|
|
11781
|
-
</Stack>
|
|
11782
|
-
);
|
|
11783
|
-
}
|
|
11784
|
-
```
|
|
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`.
|
|
11785
11638
|
|
|
11786
|
-
|
|
11639
|
+
```ts
|
|
11640
|
+
function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
|
|
11641
|
+
```
|
|
11787
11642
|
|
|
11788
|
-
|
|
11643
|
+
Used on [Filter](#/filter) and [Toolbar controls](#/toolbar-controls).
|
|
11789
11644
|
|
|
11790
|
-
|
|
11791
|
-
import { Stack } from "@umriss-ui/core";
|
|
11792
|
-
import { AlarmList, alarmModel } from "@umriss-ui/table";
|
|
11793
|
-
import type { AlarmType } from "@umriss-ui/table";
|
|
11645
|
+
#### Types
|
|
11794
11646
|
|
|
11795
|
-
|
|
11796
|
-
const NOW = Date.now();
|
|
11797
|
-
const MIN = 60_000;
|
|
11647
|
+
##### `Absent`
|
|
11798
11648
|
|
|
11799
|
-
|
|
11800
|
-
const EMPTY = alarmModel({ alarms: [], types: TYPES, asOf: NOW });
|
|
11801
|
-
const FRESHNESS = { stale: 5 * MIN, lost: 30 * MIN };
|
|
11649
|
+
A value that is not there: `null` or `undefined`.
|
|
11802
11650
|
|
|
11803
|
-
|
|
11804
|
-
|
|
11805
|
-
<Stack gap={4}>
|
|
11806
|
-
<AlarmList view={EMPTY} asOf={NOW - 20_000} freshness={FRESHNESS} aria-label="Alerts, live feed" />
|
|
11807
|
-
<AlarmList view={EMPTY} asOf={NOW - 45 * MIN} freshness={FRESHNESS} aria-label="Alerts, feed lost" />
|
|
11808
|
-
</Stack>
|
|
11809
|
-
);
|
|
11810
|
-
}
|
|
11651
|
+
```ts
|
|
11652
|
+
type Absent = null | undefined;
|
|
11811
11653
|
```
|
|
11812
11654
|
|
|
11813
|
-
|
|
11655
|
+
Used on [Column](#/column).
|
|
11814
11656
|
|
|
11815
|
-
|
|
11657
|
+
##### `ActionProps`
|
|
11816
11658
|
|
|
11817
|
-
|
|
11818
|
-
import { useMemo, useState } from "react";
|
|
11819
|
-
import { AlarmList, alarmModel, snooze, unsnooze, useTableSelection } from "@umriss-ui/table";
|
|
11820
|
-
import type { Alarm, AlarmType } from "@umriss-ui/table";
|
|
11659
|
+
Its table stands on [RowActions](#/rowactions/type-ActionProps).
|
|
11821
11660
|
|
|
11822
|
-
|
|
11823
|
-
const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
|
|
11824
|
-
|
|
11825
|
-
/** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
|
|
11826
|
-
const NOW = at(17, 10, 30);
|
|
11827
|
-
|
|
11828
|
-
const ALERT_TYPES: readonly AlarmType[] = [
|
|
11829
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11830
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11831
|
-
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
11832
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11833
|
-
{ id: "reports-job", label: "Reporting · nightly job late", priority: "low" },
|
|
11834
|
-
];
|
|
11835
|
-
|
|
11836
|
-
const ALERTS: readonly Alarm[] = [
|
|
11837
|
-
{ id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
|
|
11838
|
-
{ id: "a-2", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11839
|
-
{ id: "a-3", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
|
|
11840
|
-
{ id: "a-4", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0), availability: "snoozed", snooze: { until: at(17, 14), by: "Tomasz Nowak" } },
|
|
11841
|
-
{ id: "a-5", type: "reports-job", lifecycle: "active-unacknowledged", raised: at(17, 4, 30), availability: "disabled" },
|
|
11842
|
-
];
|
|
11843
|
-
|
|
11844
|
-
const MIN = 60_000;
|
|
11845
|
-
|
|
11846
|
-
/* The application's own rule: which durations an operator may choose. */
|
|
11847
|
-
const DURATIONS = [15 * MIN, 60 * MIN, 4 * 60 * MIN] as const;
|
|
11848
|
-
|
|
11849
|
-
export default function OfferSnoozing() {
|
|
11850
|
-
const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
|
|
11851
|
-
const view = useMemo(() => alarmModel({ alarms: alerts, types: ALERT_TYPES, asOf: NOW }), [alerts]);
|
|
11852
|
-
const selection = useTableSelection(view.filtered.map((row) => row.id));
|
|
11853
|
-
|
|
11854
|
-
return (
|
|
11855
|
-
<AlarmList
|
|
11856
|
-
view={view}
|
|
11857
|
-
selection={selection}
|
|
11858
|
-
snoozeDurations={DURATIONS}
|
|
11859
|
-
onSnooze={(ids, until) => {
|
|
11860
|
-
setAlerts((current) => current.map((a) => (ids.includes(a.id) ? snooze(a, until, "Jonas Keller") : a)));
|
|
11861
|
-
selection.clear();
|
|
11862
|
-
}}
|
|
11863
|
-
onUnsnooze={(ids) => {
|
|
11864
|
-
setAlerts((current) => current.map((a) => (ids.includes(a.id) ? unsnooze(a) : a)));
|
|
11865
|
-
selection.clear();
|
|
11866
|
-
}}
|
|
11867
|
-
/>
|
|
11868
|
-
);
|
|
11869
|
-
}
|
|
11870
|
-
```
|
|
11871
|
-
|
|
11872
|
-
##### Filter by state and priority
|
|
11873
|
-
|
|
11874
|
-
The list does not filter, the projection does: pass `filter` to [`alarmModel`](#/api/alarmModel) with the state and priority your own controls hold.
|
|
11875
|
-
|
|
11876
|
-
```tsx
|
|
11877
|
-
import { useMemo, useState } from "react";
|
|
11878
|
-
import { Select, Stack } from "@umriss-ui/core";
|
|
11879
|
-
import { AlarmList, alarmModel } from "@umriss-ui/table";
|
|
11880
|
-
import type { Alarm, AlarmType, LifecycleState, Priority } from "@umriss-ui/table";
|
|
11881
|
-
|
|
11882
|
-
/* Data from the operations world, written out here so the example runs on its own. */
|
|
11883
|
-
const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
|
|
11884
|
-
|
|
11885
|
-
/** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
|
|
11886
|
-
const NOW = at(17, 10, 30);
|
|
11887
|
-
|
|
11888
|
-
const ALERT_TYPES: readonly AlarmType[] = [
|
|
11889
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11890
|
-
{ id: "checkout-errors", label: "Checkout · error rate above 2 %", priority: "high" },
|
|
11891
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11892
|
-
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
11893
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11894
|
-
];
|
|
11895
|
-
|
|
11896
|
-
const ALERTS: readonly Alarm[] = [
|
|
11897
|
-
{ id: "a-1", type: "checkout-latency", lifecycle: "active-acknowledged", raised: at(17, 9, 41), acknowledgedAt: at(17, 9, 46) },
|
|
11898
|
-
{ id: "a-2", type: "checkout-errors", lifecycle: "resolved-unacknowledged", raised: at(17, 9, 43), resolved: at(17, 10, 11) },
|
|
11899
|
-
{ id: "a-3", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11900
|
-
{ id: "a-4", type: "search-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 24) },
|
|
11901
|
-
{ id: "a-5", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0) },
|
|
11902
|
-
];
|
|
11903
|
-
|
|
11904
|
-
export default function FilterByStateAndPriority() {
|
|
11905
|
-
const [state, setState] = useState<LifecycleState | "">("");
|
|
11906
|
-
const [priority, setPriority] = useState<Priority | "">("");
|
|
11907
|
-
const view = useMemo(
|
|
11908
|
-
() =>
|
|
11909
|
-
alarmModel(
|
|
11910
|
-
{ alarms: ALERTS, types: ALERT_TYPES, asOf: NOW },
|
|
11911
|
-
{ filter: (row) => (state === "" || row.lifecycle === state) && (priority === "" || row.priority === priority) },
|
|
11912
|
-
),
|
|
11913
|
-
[state, priority],
|
|
11914
|
-
);
|
|
11915
|
-
|
|
11916
|
-
return (
|
|
11917
|
-
<Stack gap={3}>
|
|
11918
|
-
<Select size="sm" aria-label="State" value={state} onChange={(event) => setState(event.target.value as LifecycleState | "")}>
|
|
11919
|
-
<option value="">Any state</option>
|
|
11920
|
-
<option value="active-unacknowledged">Active, unacknowledged</option>
|
|
11921
|
-
<option value="active-acknowledged">Active, acknowledged</option>
|
|
11922
|
-
<option value="resolved-unacknowledged">Resolved, unacknowledged</option>
|
|
11923
|
-
</Select>
|
|
11924
|
-
<Select size="sm" aria-label="Priority" value={priority} onChange={(event) => setPriority(event.target.value as Priority | "")}>
|
|
11925
|
-
<option value="">Any priority</option>
|
|
11926
|
-
<option value="high">High</option>
|
|
11927
|
-
<option value="medium">Medium</option>
|
|
11928
|
-
<option value="low">Low</option>
|
|
11929
|
-
</Select>
|
|
11930
|
-
<AlarmList view={view} />
|
|
11931
|
-
</Stack>
|
|
11932
|
-
);
|
|
11933
|
-
}
|
|
11934
|
-
```
|
|
11935
|
-
|
|
11936
|
-
##### Ask for a reason when snoozing
|
|
11937
|
-
|
|
11938
|
-
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()`.
|
|
11939
|
-
|
|
11940
|
-
```tsx
|
|
11941
|
-
import { useMemo, useState } from "react";
|
|
11942
|
-
import { AlarmList, alarmModel, snooze, useTableSelection } from "@umriss-ui/table";
|
|
11943
|
-
import type { Alarm, AlarmType } from "@umriss-ui/table";
|
|
11944
|
-
|
|
11945
|
-
/* Data from the operations world, written out here so the example runs on its own. */
|
|
11946
|
-
const at = (day: number, hours: number, minutes = 0) => new Date(2026, 2, day, hours, minutes).getTime();
|
|
11947
|
-
|
|
11948
|
-
/** Tuesday, 17 March 2026, 10:30 - the moment the screens are read at. */
|
|
11949
|
-
const NOW = at(17, 10, 30);
|
|
11950
|
-
|
|
11951
|
-
const ALERT_TYPES: readonly AlarmType[] = [
|
|
11952
|
-
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
11953
|
-
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
11954
|
-
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
|
11955
|
-
];
|
|
11956
|
-
|
|
11957
|
-
const ALERTS: readonly Alarm[] = [
|
|
11958
|
-
{ id: "a-1", type: "checkout-latency", lifecycle: "active-unacknowledged", raised: at(17, 10, 12) },
|
|
11959
|
-
{ id: "a-2", type: "webhooks-queue", lifecycle: "active-acknowledged", raised: at(17, 7, 12), acknowledgedAt: at(17, 8, 2) },
|
|
11960
|
-
{ id: "a-3", type: "images-disk", lifecycle: "active-unacknowledged", raised: at(17, 6, 0) },
|
|
11961
|
-
];
|
|
11962
|
-
|
|
11963
|
-
const MIN = 60_000;
|
|
11964
|
-
|
|
11965
|
-
/* The application's own rule: which durations an operator may choose. */
|
|
11966
|
-
const DURATIONS = [15 * MIN, 60 * MIN, 4 * 60 * MIN] as const;
|
|
11967
|
-
|
|
11968
|
-
export default function AskForAReason() {
|
|
11969
|
-
const [alerts, setAlerts] = useState<readonly Alarm[]>(ALERTS);
|
|
11970
|
-
const view = useMemo(() => alarmModel({ alarms: alerts, types: ALERT_TYPES, asOf: NOW }), [alerts]);
|
|
11971
|
-
const selection = useTableSelection(view.filtered.map((row) => row.id));
|
|
11972
|
-
|
|
11973
|
-
return (
|
|
11974
|
-
<AlarmList
|
|
11975
|
-
view={view}
|
|
11976
|
-
selection={selection}
|
|
11977
|
-
snoozeDurations={DURATIONS}
|
|
11978
|
-
snoozeReason="required"
|
|
11979
|
-
onSnooze={(ids, until, reason) => {
|
|
11980
|
-
setAlerts((current) => current.map((a) => (ids.includes(a.id) ? snooze(a, until, "Jonas Keller", reason) : a)));
|
|
11981
|
-
selection.clear();
|
|
11982
|
-
}}
|
|
11983
|
-
/>
|
|
11984
|
-
);
|
|
11985
|
-
}
|
|
11986
|
-
```
|
|
11987
|
-
|
|
11988
|
-
#### When to use something else
|
|
11989
|
-
|
|
11990
|
-
- Measured values against limits, without a lifecycle → VerdictColumn
|
|
11991
|
-
|
|
11992
|
-
#### Keyboard
|
|
11993
|
-
|
|
11994
|
-
| Key | Action |
|
|
11995
|
-
|---|---|
|
|
11996
|
-
| `Tab` | Move through the row boxes, “Acknowledge” and the hidden-alerts switch. |
|
|
11997
|
-
| `Space` | On a box: tick or untick the alert. On the switch: show only the hidden alerts, or all. |
|
|
11998
|
-
| `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`. |
|
|
11999
|
-
| `Arrow keys` | In the durations menu, or among the durations of the reason panel: move between them; Escape closes the menu. |
|
|
12000
|
-
| `Escape` | In the reason panel: close it without reporting; the focus returns to “Snooze”. A click outside closes it the same way. |
|
|
12001
|
-
| `Enter (in the reason field)` | Report the snooze, as the panel's “Snooze” button does; with `"required"` and no text it does nothing. |
|
|
12002
|
-
|
|
12003
|
-
#### Accessibility
|
|
12004
|
-
|
|
12005
|
-
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.
|
|
12006
|
-
|
|
12007
|
-
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.
|
|
12008
|
-
|
|
12009
|
-
Each row's box is named after the alert, and “Acknowledge” names how many it will acknowledge; while there is none it is disabled.
|
|
12010
|
-
|
|
12011
|
-
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.
|
|
12012
|
-
|
|
12013
|
-
#### API
|
|
12014
|
-
|
|
12015
|
-
##### `AlarmListProps`
|
|
12016
|
-
|
|
12017
|
-
| Prop | Type | Default | Description |
|
|
12018
|
-
|---|---|---|---|
|
|
12019
|
-
| `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 |
|
|
12020
|
-
| `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 |
|
|
12021
|
-
| `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) |
|
|
12022
|
-
| `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) |
|
|
12023
|
-
| `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) |
|
|
12024
|
-
| `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) |
|
|
12025
|
-
| `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) |
|
|
12026
|
-
| `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) |
|
|
12027
|
-
| `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) |
|
|
12028
|
-
|
|
12029
|
-
###### Events
|
|
12030
|
-
|
|
12031
|
-
| Prop | Type | Default | Description |
|
|
12032
|
-
|---|---|---|---|
|
|
12033
|
-
| `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) |
|
|
12034
|
-
| `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.<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) |
|
|
12035
|
-
| `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) |
|
|
12036
|
-
|
|
12037
|
-
Also takes every attribute of `<div>` – without `children`.
|
|
12038
|
-
|
|
12039
|
-
##### Types on this page
|
|
12040
|
-
|
|
12041
|
-
###### `AlarmProjection`
|
|
12042
|
-
|
|
12043
|
-
What `alarmModel` returns: the table's projection of the alarm rows -
|
|
12044
|
-
filtered, sorted, paged -, and beside it the flood and the counts the list
|
|
12045
|
-
announces. Give it to `AlarmList` as `view`.
|
|
12046
|
-
|
|
12047
|
-
| Prop | Type | Default | Description |
|
|
12048
|
-
|---|---|---|---|
|
|
12049
|
-
| `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. |
|
|
12050
|
-
| `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. |
|
|
12051
|
-
| `hiddenAlarms` *required* | `number` | — | Hidden within the filtered set: snoozed, suppressed, disabled. They are in the list; this is how many. |
|
|
12052
|
-
| `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`. |
|
|
12053
|
-
| `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 |
|
|
12054
|
-
| `visible` *required* | `AlarmRow[]` | — | Only the current page - with a grouping, the rows among its lines. From `TableProjection`. |
|
|
12055
|
-
| `groups` | [`RowGroup`](#type-RowGroup)`<AlarmRow>[]` | — | With a grouping: the groups, outermost first. From `TableProjection`. |
|
|
12056
|
-
| `lines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: every line of the filtered set. From `TableProjection`. |
|
|
12057
|
-
| `visibleLines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: the lines of the current page, with what it repeats. From `TableProjection`. |
|
|
12058
|
-
| `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`. |
|
|
12059
|
-
| `shown` | `AlarmRow[]` | — | Tree rows: every row the flattening shows, before a virtual window. From `TableProjection`. |
|
|
12060
|
-
| `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`. |
|
|
12061
|
-
| `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`. |
|
|
12062
|
-
| `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`. |
|
|
12063
|
-
| `page` *required* | `number` | — | The clamped page actually shown. From `TableProjection`. |
|
|
12064
|
-
| `pageCount` *required* | `number` | — | From `TableProjection`. |
|
|
12065
|
-
| `columnCount` *required* | `number` | — | From `TableProjection`. |
|
|
12066
|
-
|
|
12067
|
-
###### `TableSelection<T extends string | number>`
|
|
12068
|
-
|
|
12069
|
-
What `useTableSelection` returns: the selected keys and the gestures on
|
|
12070
|
-
them. Give it to `useTable` as `selection` when the application holds the
|
|
12071
|
-
selection.
|
|
12072
|
-
|
|
12073
|
-
| Prop | Type | Default | Description |
|
|
12074
|
-
|---|---|---|---|
|
|
12075
|
-
| `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) |
|
|
12076
|
-
| `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
12077
|
-
| `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
12078
|
-
| `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. |
|
|
12079
|
-
| `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 |
|
|
12080
|
-
| `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
|
|
12081
|
-
| `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
|
|
12082
|
-
| `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [Scroll twenty thousand rows (Virtualisation)](#/virtualisation/virtualisation) and 1 more |
|
|
12083
|
-
|
|
12084
|
-
###### `FreshnessAges`
|
|
12085
|
-
|
|
12086
|
-
From `@umriss-ui/core`.
|
|
12087
|
-
|
|
12088
|
-
The two ages at which a value changes its state, in milliseconds. Both
|
|
12089
|
-
bounds belong to the older state: exactly five minutes old is already
|
|
12090
|
-
`stale`.
|
|
12091
|
-
|
|
12092
|
-
`alt <= lost` is the sensible order. Stated the other way round, the
|
|
12093
|
-
harder statement still wins - the middle state simply falls away.
|
|
12094
|
-
|
|
12095
|
-
| Prop | Type | Default | Description |
|
|
12096
|
-
|---|---|---|---|
|
|
12097
|
-
| `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) |
|
|
12098
|
-
| `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) |
|
|
12099
|
-
|
|
12100
|
-
###### `Flood`
|
|
12101
|
-
|
|
12102
|
-
A flood that has been detected. A marking, not a suppression: the alarms all
|
|
12103
|
-
stay in the list.
|
|
12104
|
-
|
|
12105
|
-
| Prop | Type | Default | Description |
|
|
12106
|
-
|---|---|---|---|
|
|
12107
|
-
| `from` *required* | `number` | — | Earliest and latest moment of the alarms involved - so that the interface can say "forty alarms in 82 seconds". |
|
|
12108
|
-
| `to` *required* | `number` | — | |
|
|
12109
|
-
| `count` *required* | `number` | — | |
|
|
12110
|
-
| `alarms` *required* | `readonly string[]` | — | Ids of the alarms involved. |
|
|
12111
|
-
|
|
12112
|
-
###### `ModelColumn<Z, K extends string = string>`
|
|
12113
|
-
|
|
12114
|
-
A column as the model reads it - what sorting, search, hiding and the
|
|
12115
|
-
export need of it, not its presentation. `alarmModel` takes them, and
|
|
12116
|
-
`ALARM_COLUMNS` are the alarm list's.
|
|
12117
|
-
|
|
12118
|
-
| Prop | Type | Default | Description |
|
|
12119
|
-
|---|---|---|---|
|
|
12120
|
-
| `id` *required* | `K` | — | |
|
|
12121
|
-
| `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. |
|
|
12122
|
-
| `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. |
|
|
12123
|
-
| `compare` | `(a: Z, b: Z) => number` | — | A comparison of one's own; otherwise by the kind of the value. |
|
|
12124
|
-
| `searchable` | `boolean` | `false` | Takes part in the free-text search. |
|
|
12125
|
-
| `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. |
|
|
12126
|
-
| `resizable` | `boolean` | `false` | May the user drag the width? A column whose content fits anyway needs no grip. |
|
|
12127
|
-
| `width` | `number` | — | Initial width in pixels; without it the browser decides. |
|
|
12128
|
-
|
|
12129
|
-
###### `RowGroup<Z>`
|
|
12130
|
-
|
|
12131
|
-
The rows of the filtered set that share one grouping value on one level.
|
|
12132
|
-
|
|
12133
|
-
| Prop | Type | Default | Description |
|
|
12134
|
-
|---|---|---|---|
|
|
12135
|
-
| `path` *required* | `string` | — | Identifies the group across renders and in the view: the keys of its path, outermost first. |
|
|
12136
|
-
| `value` *required* | `unknown` | — | The grouping value; `undefined` for the group of absent values. |
|
|
12137
|
-
| `level` *required* | `number` | — | 0 is the outermost level. |
|
|
12138
|
-
| `rows` *required* | `Z[]` | — | |
|
|
12139
|
-
| `groups` *required* | [`RowGroup`](#type-RowGroup)`<Z>[]` | — | The groups of the next level; empty on the innermost. |
|
|
12140
|
-
| `aggregates` *required* | `Record<string, unknown>` | — | Per column id, what its aggregate comes to over this group's rows. |
|
|
12141
|
-
|
|
12142
|
-
###### `Line<Z>`
|
|
12143
|
-
|
|
12144
|
-
One line of a grouped table. A header heads a group of an outer level; a row
|
|
12145
|
-
of the innermost level stands in its span; a folded span is one line.
|
|
12146
|
-
|
|
12147
|
-
```ts
|
|
12148
|
-
type Line<Z> =
|
|
12149
|
-
| {
|
|
12150
|
-
kind: "header";
|
|
12151
|
-
group: RowGroup<Z>;
|
|
12152
|
-
/** The headers around it. */
|
|
12153
|
-
parents: readonly RowGroup<Z>[];
|
|
12154
|
-
/** Repeated at the top of a page that begins inside the group. */
|
|
12155
|
-
continued: boolean;
|
|
12156
|
-
}
|
|
12157
|
-
| {
|
|
12158
|
-
kind: "row";
|
|
12159
|
-
row: Z;
|
|
12160
|
-
parents: readonly RowGroup<Z>[];
|
|
12161
|
-
/** The span the row stands in - the innermost group, when there are
|
|
12162
|
-
several levels; a single level has no span, its rows stand under
|
|
12163
|
-
their group header. */
|
|
12164
|
-
span: RowGroup<Z> | undefined;
|
|
12165
|
-
/** The span shows its value on this line: the group's first row, or the
|
|
12166
|
-
first of a page that begins inside it. */
|
|
12167
|
-
first: boolean;
|
|
12168
|
-
continued: boolean;
|
|
12169
|
-
}
|
|
12170
|
-
| { kind: "folded"; group: RowGroup<Z>; parents: readonly RowGroup<Z>[] };
|
|
12171
|
-
```
|
|
12172
|
-
|
|
12173
|
-
###### `FlatteningEntry<K, S extends Key = string>`
|
|
12174
|
-
|
|
12175
|
-
From `@umriss-ui/core`.
|
|
12176
|
-
|
|
12177
|
-
One visible node of a tree, with everything a row needs to be drawn and
|
|
12178
|
-
read out: level, branch or leaf, check state, search state and position
|
|
12179
|
-
among its siblings.
|
|
12180
|
-
|
|
12181
|
-
| Prop | Type | Default | Description |
|
|
12182
|
-
|---|---|---|---|
|
|
12183
|
-
| `node` *required* | `K` | — | |
|
|
12184
|
-
| `key` *required* | `S` | — | |
|
|
12185
|
-
| `level` *required* | `number` | — | Roots stand at 0. Drives the indentation and what is read out. |
|
|
12186
|
-
| `label` *required* | `string` | — | The node's text; here, so that typeahead can be a pure function over the flattening and needs no reader. |
|
|
12187
|
-
| `branch` *required* | `boolean` | — | |
|
|
12188
|
-
| `empty` *required* | `boolean` | — | Branch without content: expanding it showed nothing. An unloaded branch is not empty - it could have children. |
|
|
12189
|
-
| `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. |
|
|
12190
|
-
| `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. |
|
|
12191
|
-
| `expanded` *required* | `boolean` | — | |
|
|
12192
|
-
| `checked` *required* | `boolean` | — | |
|
|
12193
|
-
| `indeterminate` *required* | `boolean` | — | Derived: not checked itself, but at least one descendant is. |
|
|
12194
|
-
| `active` *required* | `boolean` | — | |
|
|
12195
|
-
| `matches` *required* | `boolean` | — | Matched the search itself. Without a search text every entry matches, so that the surface needs no special case. |
|
|
12196
|
-
| `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. |
|
|
12197
|
-
| `position` *required* | `number` | — | 1-based, among the siblings that survive the filter. |
|
|
12198
|
-
| `siblings` *required* | `number` | — | |
|
|
12199
|
-
|
|
12200
|
-
#### Known limits
|
|
12201
|
-
|
|
12202
|
-
- 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)).
|
|
12203
|
-
- It never removes an alert to thin out a flood; deciding that a person should not see one stays with the application.
|
|
12204
|
-
- No latched alerts, and no alarm-system figures beyond the frequency per type.
|
|
12205
|
-
- The columns do not sort and the list does not page: the model sets the order.
|
|
12206
|
-
|
|
12207
|
-
What umriss deliberately does not build, and why: [ADR-0032](https://romanhaendler.github.io/umriss-ui/what-umriss-ui-is-not/).
|
|
12208
|
-
|
|
12209
|
-
## API index
|
|
12210
|
-
|
|
12211
|
-
Every name the package exports, in one place.
|
|
12212
|
-
|
|
12213
|
-
### API index
|
|
12214
|
-
|
|
12215
|
-
Everything `@umriss-ui/table` exports, with its signature. A component's props stand on its own page.
|
|
12216
|
-
|
|
12217
|
-
Demo page: https://romanhaendler.github.io/umriss-ui/table/api/
|
|
12218
|
-
|
|
12219
|
-
#### Components
|
|
12220
|
-
|
|
12221
|
-
##### `AlarmList`
|
|
12222
|
-
|
|
12223
|
-
[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.
|
|
12224
|
-
|
|
12225
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12226
|
-
|
|
12227
|
-
##### `ColumnMenu`
|
|
12228
|
-
|
|
12229
|
-
[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.
|
|
12230
|
-
|
|
12231
|
-
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).
|
|
12232
|
-
|
|
12233
|
-
##### `Export`
|
|
12234
|
-
|
|
12235
|
-
[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.
|
|
12236
|
-
|
|
12237
|
-
Used on [Scenarios](#/), [Provider](#/provider), [Sorting](#/sorting), [Search](#/search), [Grouping](#/grouping), [Toolbar](#/toolbar), [Toolbar controls](#/toolbar-controls), [Export](#/export) and [Server mode](#/server-mode).
|
|
12238
|
-
|
|
12239
|
-
##### `Pagination`
|
|
12240
|
-
|
|
12241
|
-
[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.
|
|
12242
|
-
|
|
12243
|
-
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).
|
|
12244
|
-
|
|
12245
|
-
##### `Search`
|
|
12246
|
-
|
|
12247
|
-
[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.
|
|
12248
|
-
|
|
12249
|
-
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).
|
|
12250
|
-
|
|
12251
|
-
##### `Toolbar`
|
|
12252
|
-
|
|
12253
|
-
[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).
|
|
12254
|
-
|
|
12255
|
-
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).
|
|
12256
|
-
|
|
12257
|
-
#### Hooks
|
|
12258
|
-
|
|
12259
|
-
##### `useTable`
|
|
12260
|
-
|
|
12261
|
-
A table over your rows: the hook holds its state - sort, filters, search,
|
|
12262
|
-
grouping, page, selection, column widths -, and the parts it returns are
|
|
12263
|
-
typed at your row, so that a field name in `Column` is checked by the
|
|
12264
|
-
compiler.
|
|
12265
|
-
|
|
12266
|
-
- `rows` – All rows in automatic mode; in server mode the page a server delivered for the current view.
|
|
12267
|
-
- `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.
|
|
12268
|
-
- Returns The table's state and its parts: `Table`, `Column`,
|
|
12269
|
-
`VerdictColumn`, `RowDetail`, `RowActions`, `Action` and `GroupBy`. Pass it
|
|
12270
|
-
as `of` to a part that stands outside the table.
|
|
12271
|
-
|
|
12272
|
-
```ts
|
|
12273
|
-
function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;
|
|
12274
|
-
```
|
|
12275
|
-
|
|
12276
|
-
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).
|
|
12277
|
-
|
|
12278
|
-
##### `useTableSelection`
|
|
12279
|
-
|
|
12280
|
-
A small headless helper for row selection: it holds the selection as a set
|
|
12281
|
-
and supplies the states for "select all" (including indeterminate).
|
|
12282
|
-
What the selection means in the domain stays the application's business.
|
|
12283
|
-
|
|
12284
|
-
```ts
|
|
12285
|
-
function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;
|
|
12286
|
-
```
|
|
12287
|
-
|
|
12288
|
-
Used on [Scenarios](#/), [Selection](#/selection) and [AlarmList](#/alarmlist).
|
|
12289
|
-
|
|
12290
|
-
#### Functions
|
|
12291
|
-
|
|
12292
|
-
##### `acknowledge`
|
|
12293
|
-
|
|
12294
|
-
Acknowledges the named alarms at the named time. Unknown ids are passed
|
|
12295
|
-
over, what is already acknowledged stays as it is.
|
|
12296
|
-
|
|
12297
|
-
```ts
|
|
12298
|
-
function acknowledge(alarms: readonly Alarm[], ids: Iterable<string>, time: number): Acknowledgement;
|
|
12299
|
-
```
|
|
12300
|
-
|
|
12301
|
-
Used on [Scenarios](#/), [Aggregate](#/aggregate) and [AlarmList](#/alarmlist).
|
|
12302
|
-
|
|
12303
|
-
##### `alarmColumns`
|
|
12304
|
-
|
|
12305
|
-
The columns of the alarm model, labelled from a wording.
|
|
12306
|
-
|
|
12307
|
-
Described only for the pipeline - how a value is read and compared - not for
|
|
12308
|
-
presentation. The cells stay the caller's, exactly as with the table. The
|
|
12309
|
-
label, though, lands in the column menu and the CSV header row, and that is
|
|
12310
|
-
why it comes from the wording: the module is pure and can read no context, so
|
|
12311
|
-
it is given one - like `standardPresets`.
|
|
12312
|
-
|
|
12313
|
-
```ts
|
|
12314
|
-
const alarmColumns: (wording: Wording) => readonly ModelColumn<AlarmRow, AlarmColumn>[];
|
|
12315
|
-
```
|
|
12316
|
-
|
|
12317
|
-
##### `alarmModel`
|
|
12318
|
-
|
|
12319
|
-
Alarms, types and an as-of time become rows with derived fields and are then
|
|
12320
|
-
handed through the table's pipeline: filter -> sort -> page. Everything the
|
|
12321
|
-
table guarantees still holds.
|
|
12322
|
-
|
|
12323
|
-
`input.sort` without a statement means the default order; expressly `null`
|
|
12324
|
-
means input order.
|
|
12325
|
-
|
|
12326
|
-
```ts
|
|
12327
|
-
function alarmModel(input: AlarmInput, state?: TableInput<AlarmRow, AlarmColumn>): AlarmProjection;
|
|
12328
|
-
```
|
|
12329
|
-
|
|
12330
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12331
|
-
|
|
12332
|
-
##### `availabilityAt`
|
|
12333
|
-
|
|
12334
|
-
The availability at the as-of time. A snooze that has reached its end is in
|
|
12335
|
-
service again - by the model's clock, not by a timer: nothing here reads a
|
|
12336
|
-
clock, and a timer in a user-interface library would bring a snoozed alarm
|
|
12337
|
-
back only while a browser tab happens to be open.
|
|
12338
|
-
|
|
12339
|
-
```ts
|
|
12340
|
-
function availabilityAt(alarm: Alarm, asOf: number): Availability;
|
|
12341
|
-
```
|
|
12342
|
-
|
|
12343
|
-
##### `column`
|
|
12344
|
-
|
|
12345
|
-
A column preset that fits every table whose rows carry its field: create it
|
|
12346
|
-
once, outside the component, and spread it into a `Column`. With more than
|
|
12347
|
-
one field in `P`, name the field as the second type argument.
|
|
12348
|
-
|
|
12349
|
-
```ts
|
|
12350
|
-
function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;
|
|
12351
|
-
```
|
|
12352
|
-
|
|
12353
|
-
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).
|
|
12354
|
-
|
|
12355
|
-
##### `columnFilter`
|
|
12356
|
-
|
|
12357
|
-
A filter for columns with values of type `W` and conditions of type `B`.
|
|
12358
|
-
The compiler accepts it at every column whose value fits, and rejects it
|
|
12359
|
-
otherwise. Create it outside the component, like a preset.
|
|
12360
|
-
|
|
12361
|
-
```ts
|
|
12362
|
-
function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;
|
|
12363
|
-
```
|
|
12364
|
-
|
|
12365
|
-
Used on [Filter](#/filter).
|
|
12366
|
-
|
|
12367
|
-
##### `countAcknowledgeable`
|
|
12368
|
-
|
|
12369
|
-
How many of the named alarms an acknowledgement would actually change. The
|
|
12370
|
-
same condition as [`acknowledge`](#/api/acknowledge), so that the number the interface names
|
|
12371
|
-
beforehand and what happens afterwards cannot drift apart.
|
|
12372
|
-
|
|
12373
|
-
```ts
|
|
12374
|
-
function countAcknowledgeable(alarms: readonly Alarm[], ids: Iterable<string>): number;
|
|
12375
|
-
```
|
|
12376
|
-
|
|
12377
|
-
##### `countInWindow`
|
|
12378
|
-
|
|
12379
|
-
How many of the points in time lie within the window. Pure, with the as-of
|
|
12380
|
-
time as a parameter.
|
|
12381
|
-
|
|
12382
|
-
```ts
|
|
12383
|
-
const countInWindow: (times: readonly number[], windowMs: number, asOf: number) => number;
|
|
12384
|
-
```
|
|
12385
|
-
|
|
12386
|
-
##### `detectFlood`
|
|
12387
|
-
|
|
12388
|
-
Is there a flood in the window before the as-of time? Pure calculation over
|
|
12389
|
-
timestamps, with window, threshold and as-of time as parameters.
|
|
12390
|
-
|
|
12391
|
-
- Returns The flood, or `null` when fewer alarms than the rule's `atLeast`
|
|
12392
|
-
were raised in its window.
|
|
12393
|
-
|
|
12394
|
-
```ts
|
|
12395
|
-
function detectFlood(alarms: readonly Alarm[], rule: FloodRule, asOf: number): Flood | null;
|
|
12396
|
-
```
|
|
12397
|
-
|
|
12398
|
-
##### `disable`
|
|
12399
|
-
|
|
12400
|
-
Disables an alarm - from service or from a snooze. A suppressed alarm
|
|
12401
|
-
stays as it is: that field is the application's logic's, and [`enable`](#/api/enable)
|
|
12402
|
-
would otherwise hand it back in service with the suppression lost.
|
|
12403
|
-
|
|
12404
|
-
```ts
|
|
12405
|
-
function disable(alarm: Alarm): Alarm;
|
|
12406
|
-
```
|
|
12407
|
-
|
|
12408
|
-
Used on [AlarmList](#/alarmlist).
|
|
12409
|
-
|
|
12410
|
-
##### `enable`
|
|
12411
|
-
|
|
12412
|
-
Returns a disabled alarm to service. Only that one: a snooze ends by
|
|
12413
|
-
[`unsnooze`](#/api/unsnooze) or its time, a suppression by the application's logic.
|
|
12414
|
-
|
|
12415
|
-
```ts
|
|
12416
|
-
function enable(alarm: Alarm): Alarm;
|
|
12417
|
-
```
|
|
12418
|
-
|
|
12419
|
-
Used on [AlarmList](#/alarmlist).
|
|
12420
|
-
|
|
12421
|
-
##### `frequencyByType`
|
|
12422
|
-
|
|
12423
|
-
Frequency per alarm type within the window. Grouped by TYPE, not by
|
|
12424
|
-
occurrence - a chattering source is one problem, not forty.
|
|
12425
|
-
|
|
12426
|
-
```ts
|
|
12427
|
-
function frequencyByType(alarms: readonly Alarm[], windowMs: number, asOf: number): Map<string, number>;
|
|
12428
|
-
```
|
|
12429
|
-
|
|
12430
|
-
##### `hasReturned`
|
|
12431
|
-
|
|
12432
|
-
Has the value come back far enough for an active alarm to resolve? The value
|
|
12433
|
-
must come back past the return value, not merely past the bound that
|
|
12434
|
-
triggered the alarm - which is why `limit` does not appear in this
|
|
12435
|
-
calculation.
|
|
12436
|
-
|
|
12437
|
-
The condition of resolving, not that of raising: that a measured value raises
|
|
12438
|
-
an alarm the caller's process layer decides. It lives here because only this
|
|
12439
|
-
module knows what the alarm just was.
|
|
12440
|
-
|
|
12441
|
-
The return value itself belongs to the return: reaching it is enough.
|
|
12442
|
-
|
|
12443
|
-
```ts
|
|
12444
|
-
const hasReturned: (band: ReturnBand, value: number) => boolean;
|
|
12445
|
-
```
|
|
12446
|
-
|
|
12447
|
-
##### `isAcknowledged`
|
|
12448
|
-
|
|
12449
|
-
Whether someone has acknowledged the alarm, active or resolved.
|
|
12450
|
-
|
|
12451
|
-
```ts
|
|
12452
|
-
const isAcknowledged: (state: LifecycleState) => boolean;
|
|
12453
|
-
```
|
|
12454
|
-
|
|
12455
|
-
##### `isActive`
|
|
12456
|
-
|
|
12457
|
-
Whether the condition still holds: active, acknowledged or not.
|
|
12458
|
-
|
|
12459
|
-
```ts
|
|
12460
|
-
const isActive: (state: LifecycleState) => boolean;
|
|
12461
|
-
```
|
|
12462
|
-
|
|
12463
|
-
##### `isDone`
|
|
12464
|
-
|
|
12465
|
-
Resolved and acknowledged: the only position that leaves the list.
|
|
12466
|
-
|
|
12467
|
-
```ts
|
|
12468
|
-
const isDone: (state: LifecycleState) => boolean;
|
|
12469
|
-
```
|
|
12470
|
-
|
|
12471
|
-
##### `isHidden`
|
|
12472
|
-
|
|
12473
|
-
Everything but in service: still in the list, drawn neutrally and counted,
|
|
12474
|
-
never removed. "Not absent, only deliberately hidden."
|
|
12475
|
-
|
|
12476
|
-
```ts
|
|
12477
|
-
const isHidden: (availability: Availability) => boolean;
|
|
12478
|
-
```
|
|
12479
|
-
|
|
12480
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12481
|
-
|
|
12482
|
-
##### `nextLifecycleState`
|
|
12483
|
-
|
|
12484
|
-
The transition as pure calculation.
|
|
12485
|
-
|
|
12486
|
-
`raised` always leads to `active-unacknowledged`, even out of an
|
|
12487
|
-
acknowledged position: a renewed occurrence of the condition is a new
|
|
12488
|
-
event and demands that somebody see it again.
|
|
12489
|
-
|
|
12490
|
-
```ts
|
|
12491
|
-
function nextLifecycleState(state: LifecycleState, transition: Transition): LifecycleState;
|
|
12492
|
-
```
|
|
12493
|
-
|
|
12494
|
-
##### `priorityRank`
|
|
12495
|
-
|
|
12496
|
-
0 is the most urgent. Sorted ascending it stands on top.
|
|
12497
|
-
|
|
12498
|
-
```ts
|
|
12499
|
-
const priorityRank: (priority: Priority) => number;
|
|
12500
|
-
```
|
|
12501
|
-
|
|
12502
|
-
##### `rowFilter`
|
|
12503
|
-
|
|
12504
|
-
A filter over the rows of type `Z` with conditions of type `B`. Create it
|
|
12505
|
-
outside the component, like a column filter, and name it in `rowFilters`.
|
|
12506
|
-
|
|
12507
|
-
```ts
|
|
12508
|
-
function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;
|
|
12509
|
-
```
|
|
12510
|
-
|
|
12511
|
-
Used on [Filter](#/filter) and [Toolbar controls](#/toolbar-controls).
|
|
12512
|
-
|
|
12513
|
-
##### `snooze`
|
|
12514
|
-
|
|
12515
|
-
Snoozes an alarm in service, or snoozes anew what is snoozed. A disabled
|
|
12516
|
-
or suppressed alarm stays as it is: the stronger removal is not
|
|
12517
|
-
overwritten by the weaker one, or the end of the snooze would put an alarm
|
|
12518
|
-
disabled for maintenance back in service.
|
|
12519
|
-
|
|
12520
|
-
```ts
|
|
12521
|
-
function snooze(alarm: Alarm, until: number, by: string, reason?: string): Alarm;
|
|
12522
|
-
```
|
|
12523
|
-
|
|
12524
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12525
|
-
|
|
12526
|
-
##### `unsnooze`
|
|
12527
|
-
|
|
12528
|
-
Ends a snooze before its time.
|
|
12529
|
-
|
|
12530
|
-
```ts
|
|
12531
|
-
function unsnooze(alarm: Alarm): Alarm;
|
|
12532
|
-
```
|
|
12533
|
-
|
|
12534
|
-
Used on [AlarmList](#/alarmlist).
|
|
12535
|
-
|
|
12536
|
-
#### Constants
|
|
12537
|
-
|
|
12538
|
-
##### `ALARM_COLUMNS`
|
|
12539
|
-
|
|
12540
|
-
The columns with the default labels - for callers without a wording.
|
|
12541
|
-
|
|
12542
|
-
```ts
|
|
12543
|
-
const ALARM_COLUMNS: readonly ModelColumn<AlarmRow, AlarmColumn>[];
|
|
12544
|
-
```
|
|
12545
|
-
|
|
12546
|
-
##### `AVAILABILITIES`
|
|
12547
|
-
|
|
12548
|
-
In service first, then by how near each is to coming back: snoozed (a
|
|
12549
|
-
person's own decision, with an end), suppressed, disabled. The order of
|
|
12550
|
-
the default sort.
|
|
12551
|
-
|
|
12552
|
-
```ts
|
|
12553
|
-
const AVAILABILITIES: readonly Availability[];
|
|
12554
|
-
```
|
|
12555
|
-
|
|
12556
|
-
##### `DEFAULT_ORDER`
|
|
12557
|
-
|
|
12558
|
-
In service before hidden, then priority, then acknowledgement, then time -
|
|
12559
|
-
the worst first, not the newest. As levels of the existing multi-level
|
|
12560
|
-
sort, so that a caller replaces one value instead of fighting against a
|
|
12561
|
-
hard-wired comparison.
|
|
12562
|
-
|
|
12563
|
-
Availability stands first because a snoozed alarm of high priority is a
|
|
12564
|
-
decision already taken; above an active one of medium priority it would
|
|
12565
|
-
take the first glance from the alarm nobody has decided about.
|
|
12566
|
-
|
|
12567
|
-
```ts
|
|
12568
|
-
const DEFAULT_ORDER: readonly SortLevel<AlarmColumn>[];
|
|
12569
|
-
```
|
|
12570
|
-
|
|
12571
|
-
##### `PRIORITIES`
|
|
12572
|
-
|
|
12573
|
-
From the most urgent to the last - the order of the scale.
|
|
12574
|
-
|
|
12575
|
-
```ts
|
|
12576
|
-
const PRIORITIES: readonly Priority[];
|
|
12577
|
-
```
|
|
12578
|
-
|
|
12579
|
-
#### Types
|
|
12580
|
-
|
|
12581
|
-
##### `Absent`
|
|
12582
|
-
|
|
12583
|
-
A value that is not there: `null` or `undefined`.
|
|
12584
|
-
|
|
12585
|
-
```ts
|
|
12586
|
-
type Absent = null | undefined;
|
|
12587
|
-
```
|
|
12588
|
-
|
|
12589
|
-
Used on [Column](#/column).
|
|
12590
|
-
|
|
12591
|
-
##### `Acknowledgement`
|
|
12592
|
-
|
|
12593
|
-
What `acknowledge` returns: the alarms afterwards, and how many it changed.
|
|
12594
|
-
|
|
12595
|
-
| Prop | Type | Default | Description |
|
|
12596
|
-
|---|---|---|---|
|
|
12597
|
-
| `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) |
|
|
12598
|
-
| `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. |
|
|
12599
|
-
|
|
12600
|
-
##### `ActionProps`
|
|
12601
|
-
|
|
12602
|
-
Its table stands on [RowActions](#/rowactions/type-ActionProps).
|
|
12603
|
-
|
|
12604
|
-
##### `AggregateColumn<Z>`
|
|
11661
|
+
##### `AggregateColumn<Z>`
|
|
12605
11662
|
|
|
12606
11663
|
A column that carries an aggregate, as the pipeline needs it.
|
|
12607
11664
|
|
|
@@ -12648,177 +11705,6 @@ type AggregateKind = "sum" | "avg" | "min" | "max" | "range" | "count" | "distin
|
|
|
12648
11705
|
|
|
12649
11706
|
Its table stands on [Aggregate](#/aggregate/type-AggregateOptions).
|
|
12650
11707
|
|
|
12651
|
-
##### `Alarm`
|
|
12652
|
-
|
|
12653
|
-
One occurrence of a type.
|
|
12654
|
-
|
|
12655
|
-
`lifecycle` is the truth about the position; the two points in time are
|
|
12656
|
-
trimmings for the display. The other way round it would be a pair of
|
|
12657
|
-
booleans in disguise.
|
|
12658
|
-
|
|
12659
|
-
`availability` is the second field, and its union with the snooze is why
|
|
12660
|
-
this is a type and not an interface: a snoozed alarm without an end cannot
|
|
12661
|
-
be written down. A snooze without an end is the snooze ISA-18.2 warns
|
|
12662
|
-
against - an alarm switched off that nobody will remember switching off.
|
|
12663
|
-
|
|
12664
|
-
```ts
|
|
12665
|
-
type Alarm = AlarmBase & AlarmAvailability;
|
|
12666
|
-
```
|
|
12667
|
-
|
|
12668
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12669
|
-
|
|
12670
|
-
##### `AlarmAvailability`
|
|
12671
|
-
|
|
12672
|
-
Whether an alarm is in service, and while it is snoozed until when and by
|
|
12673
|
-
whom.
|
|
12674
|
-
|
|
12675
|
-
```ts
|
|
12676
|
-
type AlarmAvailability =
|
|
12677
|
-
| {
|
|
12678
|
-
/** Without a statement: in service. */
|
|
12679
|
-
availability?: Exclude<Availability, "snoozed">;
|
|
12680
|
-
snooze?: undefined;
|
|
12681
|
-
}
|
|
12682
|
-
| {
|
|
12683
|
-
availability: "snoozed";
|
|
12684
|
-
/** Until when, and by whom. */
|
|
12685
|
-
snooze: Snooze;
|
|
12686
|
-
};
|
|
12687
|
-
```
|
|
12688
|
-
|
|
12689
|
-
##### `AlarmBase`
|
|
12690
|
-
|
|
12691
|
-
What every alarm has, whatever its availability: its id, its type, its
|
|
12692
|
-
place in the lifecycle and its moments.
|
|
12693
|
-
|
|
12694
|
-
| Prop | Type | Default | Description |
|
|
12695
|
-
|---|---|---|---|
|
|
12696
|
-
| `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 |
|
|
12697
|
-
| `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 |
|
|
12698
|
-
| `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 |
|
|
12699
|
-
| `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 |
|
|
12700
|
-
| `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 |
|
|
12701
|
-
| `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 |
|
|
12702
|
-
|
|
12703
|
-
##### `AlarmColumn`
|
|
12704
|
-
|
|
12705
|
-
Ids of the columns that are sorted, searched and ordered in.
|
|
12706
|
-
|
|
12707
|
-
```ts
|
|
12708
|
-
type AlarmColumn =
|
|
12709
|
-
| "type"
|
|
12710
|
-
| "lifecycle"
|
|
12711
|
-
| "availability"
|
|
12712
|
-
| "priority"
|
|
12713
|
-
| "acknowledgement"
|
|
12714
|
-
| "raised"
|
|
12715
|
-
| "age"
|
|
12716
|
-
| "frequency";
|
|
12717
|
-
```
|
|
12718
|
-
|
|
12719
|
-
##### `AlarmInput`
|
|
12720
|
-
|
|
12721
|
-
The input of `alarmModel`: the alarms, their types, the as-of time, and
|
|
12722
|
-
the rules for chatter and floods.
|
|
12723
|
-
|
|
12724
|
-
| Prop | Type | Default | Description |
|
|
12725
|
-
|---|---|---|---|
|
|
12726
|
-
| `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 |
|
|
12727
|
-
| `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 |
|
|
12728
|
-
| `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 |
|
|
12729
|
-
| `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) |
|
|
12730
|
-
| `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) |
|
|
12731
|
-
| `keepDone` | `boolean` | `false` | Show the alarms that are done as well (resolved and acknowledged). Default: no - that is the only removal the model performs. |
|
|
12732
|
-
| `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)`. |
|
|
12733
|
-
|
|
12734
|
-
##### `AlarmListProps`
|
|
12735
|
-
|
|
12736
|
-
Its table stands on [AlarmList](#/alarmlist/type-AlarmListProps).
|
|
12737
|
-
|
|
12738
|
-
##### `AlarmProjection`
|
|
12739
|
-
|
|
12740
|
-
What `alarmModel` returns: the table's projection of the alarm rows -
|
|
12741
|
-
filtered, sorted, paged -, and beside it the flood and the counts the list
|
|
12742
|
-
announces. Give it to `AlarmList` as `view`.
|
|
12743
|
-
|
|
12744
|
-
| Prop | Type | Default | Description |
|
|
12745
|
-
|---|---|---|---|
|
|
12746
|
-
| `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. |
|
|
12747
|
-
| `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. |
|
|
12748
|
-
| `hiddenAlarms` *required* | `number` | — | Hidden within the filtered set: snoozed, suppressed, disabled. They are in the list; this is how many. |
|
|
12749
|
-
| `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`. |
|
|
12750
|
-
| `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 |
|
|
12751
|
-
| `visible` *required* | `AlarmRow[]` | — | Only the current page - with a grouping, the rows among its lines. From `TableProjection`. |
|
|
12752
|
-
| `groups` | [`RowGroup`](#type-RowGroup)`<AlarmRow>[]` | — | With a grouping: the groups, outermost first. From `TableProjection`. |
|
|
12753
|
-
| `lines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: every line of the filtered set. From `TableProjection`. |
|
|
12754
|
-
| `visibleLines` | [`Line`](#type-Line)`<AlarmRow>[]` | — | With a grouping: the lines of the current page, with what it repeats. From `TableProjection`. |
|
|
12755
|
-
| `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`. |
|
|
12756
|
-
| `shown` | `AlarmRow[]` | — | Tree rows: every row the flattening shows, before a virtual window. From `TableProjection`. |
|
|
12757
|
-
| `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`. |
|
|
12758
|
-
| `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`. |
|
|
12759
|
-
| `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`. |
|
|
12760
|
-
| `page` *required* | `number` | — | The clamped page actually shown. From `TableProjection`. |
|
|
12761
|
-
| `pageCount` *required* | `number` | — | From `TableProjection`. |
|
|
12762
|
-
| `columnCount` *required* | `number` | — | From `TableProjection`. |
|
|
12763
|
-
|
|
12764
|
-
##### `AlarmRow`
|
|
12765
|
-
|
|
12766
|
-
An alarm with everything the list and the order need to know about it.
|
|
12767
|
-
Derived, never stored.
|
|
12768
|
-
|
|
12769
|
-
| Prop | Type | Default | Description |
|
|
12770
|
-
|---|---|---|---|
|
|
12771
|
-
| `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 |
|
|
12772
|
-
| `alarm` *required* | [`Alarm`](#type-Alarm) | — | |
|
|
12773
|
-
| `type` *required* | [`AlarmType`](#type-AlarmType) | — | |
|
|
12774
|
-
| `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) |
|
|
12775
|
-
| `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) |
|
|
12776
|
-
| `priority` *required* | [`Priority`](#type-Priority)<br>`"high" \| "medium" \| "low"` | — | <br>Shown in: [Filter by state and priority (AlarmList)](#/alarmlist/filter-by-state-and-priority) |
|
|
12777
|
-
| `rank` *required* | `number` | — | 0 is the most urgent. For the sort. |
|
|
12778
|
-
| `age` *required* | `number` | — | Since the coming, from the as-of time passed in. |
|
|
12779
|
-
| `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. |
|
|
12780
|
-
| `frequency` *required* | `number` | — | Occurrences of this TYPE within the window; without a chatter rule: all of them up to the as-of time. |
|
|
12781
|
-
| `chatters` *required* | `boolean` | — | The TYPE chatters. A marking on each of its rows. |
|
|
12782
|
-
| `inFlood` *required* | `boolean` | — | This alarm belongs to the flood that was detected. |
|
|
12783
|
-
|
|
12784
|
-
##### `AlarmType`
|
|
12785
|
-
|
|
12786
|
-
The condition that can become true. Not the alarm itself.
|
|
12787
|
-
|
|
12788
|
-
Frequency, chatter and flood are statements about a TYPE over a window and
|
|
12789
|
-
cannot be expressed without it.
|
|
12790
|
-
|
|
12791
|
-
| Prop | Type | Default | Description |
|
|
12792
|
-
|---|---|---|---|
|
|
12793
|
-
| `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 |
|
|
12794
|
-
| `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 |
|
|
12795
|
-
| `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 |
|
|
12796
|
-
| `returnBand` | [`ReturnBand`](#type-ReturnBand) | — | The dead band, when the type has one. |
|
|
12797
|
-
|
|
12798
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
12799
|
-
|
|
12800
|
-
##### `Availability`
|
|
12801
|
-
|
|
12802
|
-
Whether an alarm is in front of the people watching the list - the second
|
|
12803
|
-
field beside the lifecycle (ISA-18.2's special states).
|
|
12804
|
-
|
|
12805
|
-
A second field and never a fifth value of the lifecycle, by the same rule
|
|
12806
|
-
that made the lifecycle one field: one state, one field. The two answer
|
|
12807
|
-
different questions - what happened to the condition, and whether anyone
|
|
12808
|
-
is meant to see it now - and a snoozed alarm keeps its lifecycle
|
|
12809
|
-
underneath: when the snooze ends it comes back active and unacknowledged
|
|
12810
|
-
if that is what it is.
|
|
12811
|
-
|
|
12812
|
-
`suppressed` has no transition here. It is the application's logic that
|
|
12813
|
-
suppresses (a service that is switched off raises no error-rate alarm),
|
|
12814
|
-
and the application writes the field from that logic.
|
|
12815
|
-
|
|
12816
|
-
```ts
|
|
12817
|
-
type Availability = "in-service" | "snoozed" | "suppressed" | "disabled";
|
|
12818
|
-
```
|
|
12819
|
-
|
|
12820
|
-
Used on [Formats](#/formats).
|
|
12821
|
-
|
|
12822
11708
|
##### `CellEdit<Z>`
|
|
12823
11709
|
|
|
12824
11710
|
An edit the user committed - reported, not applied.
|
|
@@ -12851,15 +11737,6 @@ Escape and Tab stay the table's, bubbling up from the field.
|
|
|
12851
11737
|
|---|---|---|---|
|
|
12852
11738
|
| `onChange` *required* | `(value: W \| null) => void` | — | Changes the draft. |
|
|
12853
11739
|
|
|
12854
|
-
##### `ChatterRule`
|
|
12855
|
-
|
|
12856
|
-
From when a type counts as chattering.
|
|
12857
|
-
|
|
12858
|
-
| Prop | Type | Default | Description |
|
|
12859
|
-
|---|---|---|---|
|
|
12860
|
-
| `windowMs` *required* | `number` | — | Length of the window in milliseconds.<br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
|
|
12861
|
-
| `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) |
|
|
12862
|
-
|
|
12863
11740
|
##### `ColumnBase`
|
|
12864
11741
|
|
|
12865
11742
|
Its table stands on [Column](#/column/type-ColumnBase).
|
|
@@ -13064,36 +11941,6 @@ type FilterFor<W> =
|
|
|
13064
11941
|
|
|
13065
11942
|
Its table stands on [Filter](#/filter/type-FilterInputProps).
|
|
13066
11943
|
|
|
13067
|
-
##### `Flood`
|
|
13068
|
-
|
|
13069
|
-
A flood that has been detected. A marking, not a suppression: the alarms all
|
|
13070
|
-
stay in the list.
|
|
13071
|
-
|
|
13072
|
-
| Prop | Type | Default | Description |
|
|
13073
|
-
|---|---|---|---|
|
|
13074
|
-
| `from` *required* | `number` | — | Earliest and latest moment of the alarms involved - so that the interface can say "forty alarms in 82 seconds". |
|
|
13075
|
-
| `to` *required* | `number` | — | |
|
|
13076
|
-
| `count` *required* | `number` | — | |
|
|
13077
|
-
| `alarms` *required* | `readonly string[]` | — | Ids of the alarms involved. |
|
|
13078
|
-
|
|
13079
|
-
##### `FloodRule`
|
|
13080
|
-
|
|
13081
|
-
From when a set of alarms is a flood.
|
|
13082
|
-
|
|
13083
|
-
| Prop | Type | Default | Description |
|
|
13084
|
-
|---|---|---|---|
|
|
13085
|
-
| `windowMs` *required* | `number` | — | <br>Shown in: [Mark a flood (AlarmList)](#/alarmlist/mark-a-flood) |
|
|
13086
|
-
| `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) |
|
|
13087
|
-
|
|
13088
|
-
##### `FooterFor<W>`
|
|
13089
|
-
|
|
13090
|
-
What the old `footer` accepts: `"sum"` and `"avg"` for numbers, nothing
|
|
13091
|
-
for every other value.
|
|
13092
|
-
|
|
13093
|
-
```ts
|
|
13094
|
-
type FooterFor<W> = [Present<W>] extends [number] ? "sum" | "avg" : never;
|
|
13095
|
-
```
|
|
13096
|
-
|
|
13097
11944
|
##### `FormatFor<W>`
|
|
13098
11945
|
|
|
13099
11946
|
What a column accepts as `format`: a number format for numbers, a date
|
|
@@ -13182,21 +12029,6 @@ type IsDisplayable<W> = [Present<W>] extends [never]
|
|
|
13182
12029
|
: false;
|
|
13183
12030
|
```
|
|
13184
12031
|
|
|
13185
|
-
##### `LifecycleState`
|
|
13186
|
-
|
|
13187
|
-
One field, four values. `resolved-unacknowledged` is the fleeting alarm and the
|
|
13188
|
-
reason why no pair of booleans stands here.
|
|
13189
|
-
|
|
13190
|
-
```ts
|
|
13191
|
-
type LifecycleState =
|
|
13192
|
-
| "active-unacknowledged"
|
|
13193
|
-
| "active-acknowledged"
|
|
13194
|
-
| "resolved-unacknowledged"
|
|
13195
|
-
| "resolved-acknowledged";
|
|
13196
|
-
```
|
|
13197
|
-
|
|
13198
|
-
Used on [AlarmList](#/alarmlist).
|
|
13199
|
-
|
|
13200
12032
|
##### `ListCondition<W>`
|
|
13201
12033
|
|
|
13202
12034
|
The condition of a list filter: the chosen values, an absent one as `null`.
|
|
@@ -13208,8 +12040,7 @@ type ListCondition<W> = readonly (Present<W> | null)[];
|
|
|
13208
12040
|
##### `ModelColumn<Z, K extends string = string>`
|
|
13209
12041
|
|
|
13210
12042
|
A column as the model reads it - what sorting, search, hiding and the
|
|
13211
|
-
export need of it, not its presentation.
|
|
13212
|
-
`ALARM_COLUMNS` are the alarm list's.
|
|
12043
|
+
export need of it, not its presentation.
|
|
13213
12044
|
|
|
13214
12045
|
| Prop | Type | Default | Description |
|
|
13215
12046
|
|---|---|---|---|
|
|
@@ -13280,22 +12111,6 @@ type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
|
|
|
13280
12111
|
|
|
13281
12112
|
Used on [Formats](#/formats).
|
|
13282
12113
|
|
|
13283
|
-
##### `Priority`
|
|
13284
|
-
|
|
13285
|
-
Three levels. Not two, because an alarm system orders the urgency of acting
|
|
13286
|
-
more finely than a limit does; not seven, because every level above about
|
|
13287
|
-
four gets used as a synonym of the one below it.
|
|
13288
|
-
|
|
13289
|
-
This is a DIFFERENT scale from the severity of a limit (which has two), on a
|
|
13290
|
-
different object. The mapping between the two is the caller's, in his code,
|
|
13291
|
-
where the application's convention stands.
|
|
13292
|
-
|
|
13293
|
-
```ts
|
|
13294
|
-
type Priority = "high" | "medium" | "low";
|
|
13295
|
-
```
|
|
13296
|
-
|
|
13297
|
-
Used on [AlarmList](#/alarmlist).
|
|
13298
|
-
|
|
13299
12114
|
##### `RangeCondition<W>`
|
|
13300
12115
|
|
|
13301
12116
|
The condition of a range filter: both bounds inclusive, each may be absent.
|
|
@@ -13305,20 +12120,6 @@ The condition of a range filter: both bounds inclusive, each may be absent.
|
|
|
13305
12120
|
| `from` | `W` | — | |
|
|
13306
12121
|
| `to` | `W` | — | |
|
|
13307
12122
|
|
|
13308
|
-
##### `ReturnBand`
|
|
13309
|
-
|
|
13310
|
-
The triggering bound and the return band of an alarm type.
|
|
13311
|
-
|
|
13312
|
-
With an upper bound the return value lies below it, with a lower one above
|
|
13313
|
-
it. That is the dead band: it keeps the value sitting on the bound from
|
|
13314
|
-
producing a hundred alarms.
|
|
13315
|
-
|
|
13316
|
-
| Prop | Type | Default | Description |
|
|
13317
|
-
|---|---|---|---|
|
|
13318
|
-
| `direction` *required* | `"upper" \| "lower"` | — | `upper`: the alarm comes when the value rises above the bound. `lower`: it comes when the value falls below it. |
|
|
13319
|
-
| `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. |
|
|
13320
|
-
| `returnTo` *required* | `number` | — | The value the reading must come back past before the alarm resolves. |
|
|
13321
|
-
|
|
13322
12123
|
##### `RowActionsProps`
|
|
13323
12124
|
|
|
13324
12125
|
Its table stands on [RowActions](#/rowactions/type-RowActionsProps).
|
|
@@ -13403,19 +12204,6 @@ interface SetFilter<Z> {
|
|
|
13403
12204
|
}
|
|
13404
12205
|
```
|
|
13405
12206
|
|
|
13406
|
-
##### `Snooze`
|
|
13407
|
-
|
|
13408
|
-
A snooze: a person's own, time-limited decision to take an alarm out of
|
|
13409
|
-
the way.
|
|
13410
|
-
|
|
13411
|
-
| Prop | Type | Default | Description |
|
|
13412
|
-
|---|---|---|---|
|
|
13413
|
-
| `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 |
|
|
13414
|
-
| `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 |
|
|
13415
|
-
| `reason` | `string` | — | Why, when the application asked for one. The list does not show it. |
|
|
13416
|
-
|
|
13417
|
-
Used on [Scenarios](#/) and [AlarmList](#/alarmlist).
|
|
13418
|
-
|
|
13419
12207
|
##### `SortDirection`
|
|
13420
12208
|
|
|
13421
12209
|
The direction of one sort level: `asc` puts the smallest value on top,
|
|
@@ -13442,8 +12230,8 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13442
12230
|
|
|
13443
12231
|
| Prop | Type | Default | Description |
|
|
13444
12232
|
|---|---|---|---|
|
|
13445
|
-
| `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
|
|
13446
|
-
| `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
|
|
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 |
|
|
13447
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 |
|
|
13448
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 |
|
|
13449
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 |
|
|
@@ -13474,9 +12262,10 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13474
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) |
|
|
13475
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 |
|
|
13476
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 |
|
|
13477
|
-
| `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), [
|
|
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 |
|
|
13478
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) |
|
|
13479
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) |
|
|
13480
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) |
|
|
13481
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) |
|
|
13482
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) |
|
|
@@ -13487,6 +12276,7 @@ row. Pass it as `of` to a part that stands outside the table.
|
|
|
13487
12276
|
| `foldAllBranches` *required* | `() => void` | — | Tree rows: closes every branch. From `TableSnapshot`.<br>Shown in: [Open branches from controls of your own (Tree rows)](#/tree-rows/open-branches-from-controls-of-your-own) |
|
|
13488
12277
|
| `view` *required* | [`TableView`](#type-TableView) | — | The part of the state an application can keep; whatever still stands as the options set it up is absent. From `TableSnapshot`.<br>Shown in: [Set a condition from outside the table (Filter)](#/filter/conditions-from-outside), [Fold groups into a summary (Grouping)](#/grouping/the-overview), [Keep and restore a view (View)](#/view/initial-view) |
|
|
13489
12278
|
| `asCsv` *required* | `() => string` | — | The filtered set in the visible columns as text for a spreadsheet - in server mode the page. From `TableSnapshot`.<br>Shown in: [Sort, arrange and export from controls of your own (First table)](#/first-table/sort-arrange-and-export-from-controls-of-your-own) |
|
|
12279
|
+
| `selectionAsText` *required* | `() => string` | — | The selected rows within the filtered set as tab-separated text under a header line - the text Ctrl+C writes. `""` with nothing selected. From `TableSnapshot`.<br>Shown in: [Copy the selection (Export)](#/export/copy-the-selection) |
|
|
13490
12280
|
| `virtual` *required* | `boolean` | — | Whether it virtualises. From `TableSnapshot`.<br>Shown in: [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) |
|
|
13491
12281
|
| `rowCount` *required* | `number` | — | How many rows the filtered set has - in server mode the server's count. From `TableSnapshot`.<br>Shown in: [Search and page from a header of your own (First table)](#/first-table/search-and-page-from-a-header-of-your-own) |
|
|
13492
12282
|
| `server` *required* | `boolean` | — | Whether it is in server mode: the rows are one page of a server's. From `TableSnapshot`.<br>Shown in: [Sort, arrange and export from controls of your own (First table)](#/first-table/sort-arrange-and-export-from-controls-of-your-own) |
|
|
@@ -13501,15 +12291,15 @@ columns: search, filter, sort, page, hidden columns, order, grouping, tree.
|
|
|
13501
12291
|
| Prop | Type | Default | Description |
|
|
13502
12292
|
|---|---|---|---|
|
|
13503
12293
|
| `search` | `string` | — | |
|
|
13504
|
-
| `filter` | `(row: Z) => boolean` | — | An additional filter beside the free-text search, e.g. a status choice
|
|
13505
|
-
| `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
|
|
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. |
|
|
13506
12296
|
| `page` | `number` | — | 1-based; is clamped to the valid range. |
|
|
13507
12297
|
| `pageSize` | `number` | — | |
|
|
13508
12298
|
| `hidden` | `readonly K[]` | — | Ids of columns switched away. Columns that are not hideable stay. |
|
|
13509
12299
|
| `order` | `readonly K[]` | — | The wanted column order. Columns not named follow in their natural order; unknown ids are passed over. |
|
|
13510
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. |
|
|
13511
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. |
|
|
13512
|
-
| `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
|
|
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. |
|
|
13513
12303
|
|
|
13514
12304
|
##### `TableOptions`
|
|
13515
12305
|
|
|
@@ -13555,14 +12345,14 @@ selection.
|
|
|
13555
12345
|
|
|
13556
12346
|
| Prop | Type | Default | Description |
|
|
13557
12347
|
|---|---|---|---|
|
|
13558
|
-
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [
|
|
12348
|
+
| `selected` *required* | `ReadonlySet<T>` | — | The keys currently selected.<br>Shown in: [Work through the alerts (Scenarios)](#/scenarios/work-through-the-alerts) |
|
|
13559
12349
|
| `isSelected` *required* | `(id: T) => boolean` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
13560
12350
|
| `toggle` *required* | `(id: T) => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself) |
|
|
13561
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. |
|
|
13562
|
-
| `clear` *required* | `() => void` | — | <br>Shown in: [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [
|
|
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) |
|
|
13563
12353
|
| `allSelected` *required* | `boolean` | — | true when every key passed in is selected. |
|
|
13564
12354
|
| `someSelected` *required* | `boolean` | — | true when some - but not all - are selected. |
|
|
13565
|
-
| `count` *required* | `number` | — | <br>Shown in: [Select rows (Selection)](#/selection/selection), [Hold the selection yourself (Selection)](#/selection/hold-the-selection-yourself), [
|
|
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 |
|
|
13566
12356
|
|
|
13567
12357
|
##### `TableSnapshot`
|
|
13568
12358
|
|
|
@@ -13604,15 +12394,6 @@ The size of a toolbar's controls.
|
|
|
13604
12394
|
type ToolbarSize = "sm" | "md";
|
|
13605
12395
|
```
|
|
13606
12396
|
|
|
13607
|
-
##### `Transition`
|
|
13608
|
-
|
|
13609
|
-
What can happen to an alarm. The caller reports the event; what it means the
|
|
13610
|
-
model knows.
|
|
13611
|
-
|
|
13612
|
-
```ts
|
|
13613
|
-
type Transition = "raised" | "acknowledged" | "resolved";
|
|
13614
|
-
```
|
|
13615
|
-
|
|
13616
12397
|
##### `TreeInput<Z>`
|
|
13617
12398
|
|
|
13618
12399
|
Tree rows for the model: how a row is keyed, how its children are read,
|
|
@@ -13645,63 +12426,3 @@ interface VerdictColumnComponent<Z> {
|
|
|
13645
12426
|
<K extends NumberField<Z>>(props: VerdictBase & { value: K; id?: string }): ReactNode;
|
|
13646
12427
|
}
|
|
13647
12428
|
```
|
|
13648
|
-
|
|
13649
|
-
#### Types on this page
|
|
13650
|
-
|
|
13651
|
-
##### `Line<Z>`
|
|
13652
|
-
|
|
13653
|
-
One line of a grouped table. A header heads a group of an outer level; a row
|
|
13654
|
-
of the innermost level stands in its span; a folded span is one line.
|
|
13655
|
-
|
|
13656
|
-
```ts
|
|
13657
|
-
type Line<Z> =
|
|
13658
|
-
| {
|
|
13659
|
-
kind: "header";
|
|
13660
|
-
group: RowGroup<Z>;
|
|
13661
|
-
/** The headers around it. */
|
|
13662
|
-
parents: readonly RowGroup<Z>[];
|
|
13663
|
-
/** Repeated at the top of a page that begins inside the group. */
|
|
13664
|
-
continued: boolean;
|
|
13665
|
-
}
|
|
13666
|
-
| {
|
|
13667
|
-
kind: "row";
|
|
13668
|
-
row: Z;
|
|
13669
|
-
parents: readonly RowGroup<Z>[];
|
|
13670
|
-
/** The span the row stands in - the innermost group, when there are
|
|
13671
|
-
several levels; a single level has no span, its rows stand under
|
|
13672
|
-
their group header. */
|
|
13673
|
-
span: RowGroup<Z> | undefined;
|
|
13674
|
-
/** The span shows its value on this line: the group's first row, or the
|
|
13675
|
-
first of a page that begins inside it. */
|
|
13676
|
-
first: boolean;
|
|
13677
|
-
continued: boolean;
|
|
13678
|
-
}
|
|
13679
|
-
| { kind: "folded"; group: RowGroup<Z>; parents: readonly RowGroup<Z>[] };
|
|
13680
|
-
```
|
|
13681
|
-
|
|
13682
|
-
##### `FlatteningEntry<K, S extends Key = string>`
|
|
13683
|
-
|
|
13684
|
-
From `@umriss-ui/core`.
|
|
13685
|
-
|
|
13686
|
-
One visible node of a tree, with everything a row needs to be drawn and
|
|
13687
|
-
read out: level, branch or leaf, check state, search state and position
|
|
13688
|
-
among its siblings.
|
|
13689
|
-
|
|
13690
|
-
| Prop | Type | Default | Description |
|
|
13691
|
-
|---|---|---|---|
|
|
13692
|
-
| `node` *required* | `K` | — | |
|
|
13693
|
-
| `key` *required* | `S` | — | |
|
|
13694
|
-
| `level` *required* | `number` | — | Roots stand at 0. Drives the indentation and what is read out. |
|
|
13695
|
-
| `label` *required* | `string` | — | The node's text; here, so that typeahead can be a pure function over the flattening and needs no reader. |
|
|
13696
|
-
| `branch` *required* | `boolean` | — | |
|
|
13697
|
-
| `empty` *required* | `boolean` | — | Branch without content: expanding it showed nothing. An unloaded branch is not empty - it could have children. |
|
|
13698
|
-
| `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. |
|
|
13699
|
-
| `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. |
|
|
13700
|
-
| `expanded` *required* | `boolean` | — | |
|
|
13701
|
-
| `checked` *required* | `boolean` | — | |
|
|
13702
|
-
| `indeterminate` *required* | `boolean` | — | Derived: not checked itself, but at least one descendant is. |
|
|
13703
|
-
| `active` *required* | `boolean` | — | |
|
|
13704
|
-
| `matches` *required* | `boolean` | — | Matched the search itself. Without a search text every entry matches, so that the surface needs no special case. |
|
|
13705
|
-
| `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. |
|
|
13706
|
-
| `position` *required* | `number` | — | 1-based, among the siblings that survive the filter. |
|
|
13707
|
-
| `siblings` *required* | `number` | — | |
|