@umriss-ui/table 0.7.1 → 0.7.3
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 +69 -0
- package/README.md +3 -2
- package/dist/index.d.ts +3 -1
- package/dist/table.css +1 -1
- package/dist/table.js +2002 -1944
- package/docs/llms-full.md +52 -7
- package/package.json +4 -4
package/docs/llms-full.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @umriss-ui/table 0.7.
|
|
1
|
+
# @umriss-ui/table 0.7.3
|
|
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
|
|
|
@@ -1000,7 +1000,7 @@ Also every prop of `ColumnBase`, `ValuePaths`.
|
|
|
1000
1000
|
| `numeric` | `boolean` | — | Right-aligned with tabular figures. Without it the first value present decides. |
|
|
1001
1001
|
| `width` | `number` | — | Initial width in pixels; without it the browser decides. |
|
|
1002
1002
|
| `resizable` | `boolean` | — | Shows the drag grip on the header cell. |
|
|
1003
|
-
| `pin` | `Pin` | — | Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them. The user can change it in the column menu; the view carries the change. |
|
|
1003
|
+
| `pin` | `Pin` | — | Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them. The user can change it in the column menu; the view carries the change. Pinned blocks take at most half of the width the table shows: on a narrower one the end block, then the start block scrolls with the rest, and sticks again when there is room. |
|
|
1004
1004
|
| `sortable` | `boolean` | — | Sortable unless stated otherwise, when the value is text, a number, a point in time or a boolean. |
|
|
1005
1005
|
| `searchable` | `boolean` | — | Takes part in the search. Without a statement: yes for text, no otherwise. |
|
|
1006
1006
|
| `groupable` | `boolean` | — | Can the table be grouped by this column? Without a statement: yes, when its value is text, a number, a point in time or a boolean, or it has a `groupValue`. |
|
|
@@ -3316,8 +3316,10 @@ export default function ShareBar() {
|
|
|
3316
3316
|
<Table ariaLabel="Invoices by cost centre and supplier">
|
|
3317
3317
|
<Column value="supplier" label="Supplier" />
|
|
3318
3318
|
<Column value="costCentre" label="Cost centre" />
|
|
3319
|
-
|
|
3319
|
+
{/* The amount with its bar right beside the groups: after the invoice
|
|
3320
|
+
it stood out of view on a phone. */}
|
|
3320
3321
|
<Column value="amount" label="Amount (€)" format={{ decimals: 2 }} aggregate="sum" />
|
|
3322
|
+
<Column value="id" label="Invoice" rowHeader />
|
|
3321
3323
|
<Column value="lines" label="Lines" aggregate="sum" share={false} />
|
|
3322
3324
|
</Table>
|
|
3323
3325
|
);
|
|
@@ -3940,12 +3942,12 @@ export default function TwoActions() {
|
|
|
3940
3942
|
|
|
3941
3943
|
##### Act on a selection
|
|
3942
3944
|
|
|
3943
|
-
Mark an action `bulk` and it receives a list: one row at the row, the selection in the
|
|
3945
|
+
Mark an action `bulk` and it receives a list: one row at the row, the selection in the `Toolbar` while rows are ticked.
|
|
3944
3946
|
|
|
3945
3947
|
```tsx
|
|
3946
3948
|
import { useState } from "react";
|
|
3947
3949
|
import { Stack, Text } from "@umriss-ui/core";
|
|
3948
|
-
import { useTable } from "@umriss-ui/table";
|
|
3950
|
+
import { Toolbar, useTable } from "@umriss-ui/table";
|
|
3949
3951
|
|
|
3950
3952
|
interface Invoice {
|
|
3951
3953
|
id: string;
|
|
@@ -3967,6 +3969,7 @@ export default function ActOnASelection() {
|
|
|
3967
3969
|
return (
|
|
3968
3970
|
<Stack gap={3}>
|
|
3969
3971
|
<Table selectable ariaLabel="Invoices awaiting approval">
|
|
3972
|
+
<Toolbar />
|
|
3970
3973
|
<Column value="id" label="Invoice" rowHeader />
|
|
3971
3974
|
<Column value="supplier" label="Supplier" />
|
|
3972
3975
|
<Column value="costCentre" label="Cost centre" />
|
|
@@ -4470,7 +4473,8 @@ function InvoiceList({ start, restart }: { start: TableView; restart: (view: Tab
|
|
|
4470
4473
|
<Text as="span" size="sm" tone="secondary">
|
|
4471
4474
|
What the application would keep
|
|
4472
4475
|
</Text>
|
|
4473
|
-
|
|
4476
|
+
{/* JSON has no space to break at: without this it ran past a phone's card. */}
|
|
4477
|
+
<Text as="code" size="sm" mono data-role="view" style={{ overflowWrap: "anywhere" }}>
|
|
4474
4478
|
{JSON.stringify(t.view)}
|
|
4475
4479
|
</Text>
|
|
4476
4480
|
</Stack>
|
|
@@ -5398,6 +5402,47 @@ export default function KeepAList() {
|
|
|
5398
5402
|
}
|
|
5399
5403
|
```
|
|
5400
5404
|
|
|
5405
|
+
##### Edit a dense table
|
|
5406
|
+
|
|
5407
|
+
`density="compact"` holds for a row draft too: its fields and buttons are a step smaller, and a row with actions stands as tall as one without.
|
|
5408
|
+
|
|
5409
|
+
```tsx
|
|
5410
|
+
import { useState } from "react";
|
|
5411
|
+
import { useTable } from "@umriss-ui/table";
|
|
5412
|
+
|
|
5413
|
+
interface Room {
|
|
5414
|
+
id: string;
|
|
5415
|
+
name: string;
|
|
5416
|
+
seats: number;
|
|
5417
|
+
floor: number;
|
|
5418
|
+
}
|
|
5419
|
+
|
|
5420
|
+
const ROOMS: Room[] = [
|
|
5421
|
+
{ id: "r1", name: "Harbour", seats: 8, floor: 2 },
|
|
5422
|
+
{ id: "r2", name: "Orchard", seats: 12, floor: 3 },
|
|
5423
|
+
{ id: "r3", name: "Lantern", seats: 4, floor: 3 },
|
|
5424
|
+
];
|
|
5425
|
+
|
|
5426
|
+
export default function EditADenseTable() {
|
|
5427
|
+
const [rooms, setRooms] = useState(ROOMS);
|
|
5428
|
+
const { Table, Column } = useTable(rooms, { rowKey: (r) => r.id });
|
|
5429
|
+
return (
|
|
5430
|
+
<Table
|
|
5431
|
+
grid
|
|
5432
|
+
editMode="row"
|
|
5433
|
+
density="compact"
|
|
5434
|
+
ariaLabel="Meeting rooms"
|
|
5435
|
+
onRowSave={({ rowKey, changes }) => setRooms((all) => all.map((r) => (r.id === rowKey ? { ...r, ...changes } : r)))}
|
|
5436
|
+
onRowDelete={({ rowKey }) => setRooms((all) => all.filter((r) => r.id !== rowKey))}
|
|
5437
|
+
>
|
|
5438
|
+
<Column value="name" label="Room" rowHeader edit="text" />
|
|
5439
|
+
<Column value="seats" label="Seats" edit="number" width={120} />
|
|
5440
|
+
<Column value="floor" label="Floor" edit="number" width={120} />
|
|
5441
|
+
</Table>
|
|
5442
|
+
);
|
|
5443
|
+
}
|
|
5444
|
+
```
|
|
5445
|
+
|
|
5401
5446
|
#### Keyboard
|
|
5402
5447
|
|
|
5403
5448
|
| Key | Action |
|
|
@@ -7094,7 +7139,7 @@ export interface AlertType {
|
|
|
7094
7139
|
|
|
7095
7140
|
export const ALERT_TYPES: readonly AlertType[] = [
|
|
7096
7141
|
{ id: "checkout-latency", label: "Checkout · p95 latency above 300 ms", priority: "high" },
|
|
7097
|
-
{ id: "checkout-errors", label: "Checkout · error rate above 2
|
|
7142
|
+
{ id: "checkout-errors", label: "Checkout · error rate above 2\u00a0%", priority: "high" },
|
|
7098
7143
|
{ id: "webhooks-queue", label: "Webhooks · queue older than 5 min", priority: "medium" },
|
|
7099
7144
|
{ id: "search-latency", label: "Search · p95 latency above 250 ms", priority: "medium" },
|
|
7100
7145
|
{ id: "images-disk", label: "Image service · disk 85 % full", priority: "low" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umriss-ui/table",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "React data table for data-dense applications - sorting, filtering, grouping, aggregates, virtualisation. Declared the way it reads: columns as JSX, typed against their rows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Roman Händler",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">=18",
|
|
53
53
|
"react-dom": ">=18",
|
|
54
|
-
"@umriss-ui/core": "^0.
|
|
54
|
+
"@umriss-ui/core": "^0.16.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@fontsource/geist-mono": "^5.3.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"typescript": "^5.6.3",
|
|
66
66
|
"vite": "^6.0.0",
|
|
67
67
|
"vite-plugin-dts": "^4.3.0",
|
|
68
|
-
"@umriss-ui/
|
|
69
|
-
"@umriss-ui/
|
|
68
|
+
"@umriss-ui/demo": "0.0.0",
|
|
69
|
+
"@umriss-ui/core": "0.16.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",
|