@umriss-ui/table 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/llms-full.md CHANGED
@@ -1,6 +1,6 @@
1
- # @umriss-ui/table 0.7.0
1
+ # @umriss-ui/table 0.7.2
2
2
 
3
- > The umriss table for data-dense applications - declared the way it reads: columns as JSX, typed against their rows.
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
 
5
5
  Install with `pnpm add @umriss-ui/table`. This text is generated from the package's demo (https://romanhaendler.github.io/umriss-ui/table/): every page with its import line, its examples - the source exactly as it runs, with the package name where the demo imports its own source - its props tables generated from the code, and what it deliberately does not do. The pages index stands in https://romanhaendler.github.io/umriss-ui/table/llms.txt.
6
6
 
@@ -526,7 +526,7 @@ Two packages, no stylesheet to import, and one hook that turns an array of rows
526
526
  import { useTable } from "@umriss-ui/table";
527
527
  ```
528
528
 
529
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/installation
529
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/installation/
530
530
 
531
531
  Install `pnpm add @umriss-ui/table @umriss-ui/core`. The core package is a peer dependency: the table reads its provider, its formats and its wording (ADR-0016). React 18 or 19 as a peer as well.
532
532
 
@@ -581,7 +581,7 @@ Rows of records to scan, sort, search and select (also called a data table or da
581
581
  import { useTable } from "@umriss-ui/table";
582
582
  ```
583
583
 
584
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/table
584
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/table/
585
585
 
586
586
  `useTable` takes the rows and hands back the `Table` and the `Column` that belong to them, so a column can only name a field the row has. The parts that touch no row, such as `Toolbar` or `Search`, are ordinary imports.
587
587
 
@@ -728,7 +728,7 @@ Set the table's wording, formats and density once for the whole application, at
728
728
  import { UmrissProvider } from "@umriss-ui/table";
729
729
  ```
730
730
 
731
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/provider
731
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/provider/
732
732
 
733
733
  The table has no provider of its own: it reads the one of @umriss-ui/core (ADR-0016). German wording ships as `@umriss-ui/core/wording/de` (ADR-0019).
734
734
 
@@ -812,7 +812,7 @@ One value per row, read from a field or computed. Everything the table does with
812
812
  import { useTable } from "@umriss-ui/table";
813
813
  ```
814
814
 
815
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/column
815
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/column/
816
816
 
817
817
  Without a presentation the value type decides: text on the left, numbers right-aligned with tabular figures, points in time as date and time, truth values as a word.
818
818
 
@@ -1021,7 +1021,7 @@ How a value looks in its cell: a standard format, a presentation of its own, an
1021
1021
  import { useTable } from "@umriss-ui/table";
1022
1022
  ```
1023
1023
 
1024
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/formats
1024
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/formats/
1025
1025
 
1026
1026
  A format or a presentation changes what the cell shows and nothing else: sorting, search, export and totals keep working on the value.
1027
1027
 
@@ -1200,7 +1200,7 @@ How wide a column stands, which columns stay in view while the table scrolls sid
1200
1200
  import { useTable } from "@umriss-ui/table";
1201
1201
  ```
1202
1202
 
1203
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/width-and-pinning
1203
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/width-and-pinning/
1204
1204
 
1205
1205
  #### Examples
1206
1206
 
@@ -1398,7 +1398,7 @@ A column written once and used in many tables: as a preset spread into a column,
1398
1398
  import { column } from "@umriss-ui/table";
1399
1399
  ```
1400
1400
 
1401
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/presets
1401
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/presets/
1402
1402
 
1403
1403
  #### Examples
1404
1404
 
@@ -1524,7 +1524,7 @@ Order the rows by a column, and by further columns where the first ties. Reach f
1524
1524
  import { useTable } from "@umriss-ui/table";
1525
1525
  ```
1526
1526
 
1527
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/sorting
1527
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/sorting/
1528
1528
 
1529
1529
  #### Examples
1530
1530
 
@@ -1643,7 +1643,7 @@ A text field that narrows the table to the rows containing what the user types (
1643
1643
  import { Search } from "@umriss-ui/table";
1644
1644
  ```
1645
1645
 
1646
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/search
1646
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/search/
1647
1647
 
1648
1648
  It searches the columns whose value is text, and it searches the value, not its presentation; `searchable` on a column adds or removes one. A search term goes back to page one and counts as a restriction – the toolbar shows the matches and “Reset” – but it is not listed as a condition, since the field already shows it.
1649
1649
 
@@ -1790,7 +1790,7 @@ Narrow a column to some of its values: those that occur, a range between two bou
1790
1790
  import { columnFilter } from "@umriss-ui/table";
1791
1791
  ```
1792
1792
 
1793
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/filter
1793
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/filter/
1794
1794
 
1795
1795
  Every condition stands in the table toolbar with the count of matches, a cross to lift it and “Reset” for all. A click on a condition opens its filter again.
1796
1796
 
@@ -2077,7 +2077,7 @@ Decide which rows a table has at all – by permission, by site, by tenant. The
2077
2077
  import { useTable } from "@umriss-ui/table";
2078
2078
  ```
2079
2079
 
2080
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/pre-filter
2080
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/pre-filter/
2081
2081
 
2082
2082
  #### Examples
2083
2083
 
@@ -2152,7 +2152,7 @@ The bar under the table that splits long results into pages, with the page size
2152
2152
  import { Pagination } from "@umriss-ui/table";
2153
2153
  ```
2154
2154
 
2155
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/pagination
2155
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/pagination/
2156
2156
 
2157
2157
  `pageSize` on the hook sets the rows per page, `pageSizes` the choices. A search, a filter, a new sort or a new page size go back to page one, and a page that no longer exists after a filter becomes the last one. A virtualised table does not page, and the bar is not drawn.
2158
2158
 
@@ -2247,7 +2247,7 @@ Gather rows that share a value under one header with their count and totals (als
2247
2247
  import { useTable } from "@umriss-ui/table";
2248
2248
  ```
2249
2249
 
2250
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/grouping
2250
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/grouping/
2251
2251
 
2252
2252
  The outer levels become header rows that carry every total under its column; the innermost of several levels stands as a span beside its rows. The form follows the level, never the data (ADR-0029).
2253
2253
 
@@ -3123,7 +3123,7 @@ What a column's values come to: a sum, an average, the extremes, a count. It sta
3123
3123
  import { useTable } from "@umriss-ui/table";
3124
3124
  ```
3125
3125
 
3126
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/aggregate
3126
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/aggregate/
3127
3127
 
3128
3128
  An aggregate is always computed from rows: a group's average is over its rows, not over the averages of the groups inside it. Absent values do not count.
3129
3129
 
@@ -3484,7 +3484,7 @@ Tick rows to act on them together (also called row selection or multi-select).
3484
3484
  import { useTable } from "@umriss-ui/table";
3485
3485
  ```
3486
3486
 
3487
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/selection
3487
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/selection/
3488
3488
 
3489
3489
  “Select all” selects what search and filters leave, on every page.
3490
3490
 
@@ -3554,7 +3554,7 @@ How rows look: dense or regular, marked by their state, and what stands while ro
3554
3554
  import { useTable } from "@umriss-ui/table";
3555
3555
  ```
3556
3556
 
3557
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/row-appearance
3557
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/row-appearance/
3558
3558
 
3559
3559
  A row's mark is the application's stylesheet at work; say the same in a word in a column too, so the colour is never the only sign.
3560
3560
 
@@ -3724,7 +3724,7 @@ More about a row, opened beneath it on demand (also called an expandable or mast
3724
3724
  import { useTable } from "@umriss-ui/table";
3725
3725
  ```
3726
3726
 
3727
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/rowdetail
3727
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/rowdetail/
3728
3728
 
3729
3729
  The table puts an expander at the start of each row, named after the row – “Expand FP-1004210”. Several rows can be open at once, and a row stays open by its key: a search or a filter that hides it for a moment does not close it.
3730
3730
 
@@ -3886,7 +3886,7 @@ Buttons at the end of each row for what the user does to that row – open, appr
3886
3886
  import { useTable } from "@umriss-ui/table";
3887
3887
  ```
3888
3888
 
3889
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/rowactions
3889
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/rowactions/
3890
3890
 
3891
3891
  Up to two actions stand in the row as buttons; from three on, all of them move into one menu per row, so the column keeps its width and no action changes place when another is added. Each is read out with the row's name – “Open: INV-26-0318”.
3892
3892
 
@@ -3940,12 +3940,12 @@ export default function TwoActions() {
3940
3940
 
3941
3941
  ##### Act on a selection
3942
3942
 
3943
- Mark an action `bulk` and it receives a list: one row at the row, the selection in the toolbar that appears while rows are ticked.
3943
+ Mark an action `bulk` and it receives a list: one row at the row, the selection in the `Toolbar` while rows are ticked.
3944
3944
 
3945
3945
  ```tsx
3946
3946
  import { useState } from "react";
3947
3947
  import { Stack, Text } from "@umriss-ui/core";
3948
- import { useTable } from "@umriss-ui/table";
3948
+ import { Toolbar, useTable } from "@umriss-ui/table";
3949
3949
 
3950
3950
  interface Invoice {
3951
3951
  id: string;
@@ -3967,6 +3967,7 @@ export default function ActOnASelection() {
3967
3967
  return (
3968
3968
  <Stack gap={3}>
3969
3969
  <Table selectable ariaLabel="Invoices awaiting approval">
3970
+ <Toolbar />
3970
3971
  <Column value="id" label="Invoice" rowHeader />
3971
3972
  <Column value="supplier" label="Supplier" />
3972
3973
  <Column value="costCentre" label="Cost centre" />
@@ -4068,7 +4069,7 @@ The bar above the table that holds its search, column menu and export, shows how
4068
4069
  import { Toolbar } from "@umriss-ui/table";
4069
4070
  ```
4070
4071
 
4071
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/toolbar
4072
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/toolbar/
4072
4073
 
4073
4074
  It stands above the table wherever it stands in the JSX. On the left go the parts you put into it, then the conditions of the column filters; on the right the count of matches and “Reset” while something restricts, and the selection with its bulk actions while rows are ticked.
4074
4075
 
@@ -4189,7 +4190,7 @@ A menu in which the user shows, hides, reorders and pins the table's columns and
4189
4190
  import { ColumnMenu } from "@umriss-ui/table";
4190
4191
  ```
4191
4192
 
4192
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/columnmenu
4193
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/columnmenu/
4193
4194
 
4194
4195
  Every change applies to header, body and footer together. The row header cannot be hidden. A column moves only within its block – pinned at the start, unpinned, pinned at the end – and after a move the focus stays on the button that was pressed.
4195
4196
 
@@ -4300,7 +4301,7 @@ A button that writes the rows the user sees into a CSV file for a spreadsheet (a
4300
4301
  import { Export } from "@umriss-ui/table";
4301
4302
  ```
4302
4303
 
4303
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/export
4304
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/export/
4304
4305
 
4305
4306
  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 a decimal comma, a point in time as a timestamp, an absent value as an empty field. Fields are separated by semicolons, and a byte order mark tells the spreadsheet it is UTF-8.
4306
4307
 
@@ -4415,7 +4416,7 @@ What the user did to the table – search, conditions, sort, hidden columns, wid
4415
4416
  import { useTable } from "@umriss-ui/table";
4416
4417
  ```
4417
4418
 
4418
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/view
4419
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/view/
4419
4420
 
4420
4421
  The table remembers nothing, not in the address and not in any storage. Everything stands in `t.view`; keep it where the application keeps things and hand it back through `initialView`.
4421
4422
 
@@ -4515,7 +4516,7 @@ Thousands of rows the user scrolls through without pages: only the rows in view
4515
4516
  import { useTable } from "@umriss-ui/table";
4516
4517
  ```
4517
4518
 
4518
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/virtualisation
4519
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/virtualisation/
4519
4520
 
4520
4521
  #### Examples
4521
4522
 
@@ -4636,7 +4637,7 @@ A table over rows a server holds: the application hands in one page and the serv
4636
4637
  import { useTable } from "@umriss-ui/table";
4637
4638
  ```
4638
4639
 
4639
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/manual-mode
4640
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/manual-mode/
4640
4641
 
4641
4642
  `onViewChange` reports the view whenever what decides the rows changes – search, conditions, sort, page, page size – complete, defaults included, since a server has no default of the table's.
4642
4643
 
@@ -4993,7 +4994,7 @@ Make the table one Tab stop whose cells the arrow keys walk, as in a spreadsheet
4993
4994
  import { useTable } from "@umriss-ui/table";
4994
4995
  ```
4995
4996
 
4996
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/grid-mode
4997
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/grid-mode/
4997
4998
 
4998
4999
  A table is read by default: a native table, where every control is one Tab away and a screen reader keeps its table keys. Grid mode changes that on request only (ADR-0034).
4999
5000
 
@@ -5133,7 +5134,7 @@ Let people change a value in its cell. The table reports each edit, and the appl
5133
5134
  import { useTable } from "@umriss-ui/table";
5134
5135
  ```
5135
5136
 
5136
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/edits
5137
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/edits/
5137
5138
 
5138
5139
  An edit is reported, never applied: the application owns the rows. `validate` keeps the editor open with its message until the draft passes.
5139
5140
 
@@ -5398,6 +5399,47 @@ export default function KeepAList() {
5398
5399
  }
5399
5400
  ```
5400
5401
 
5402
+ ##### Edit a dense table
5403
+
5404
+ `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.
5405
+
5406
+ ```tsx
5407
+ import { useState } from "react";
5408
+ import { useTable } from "@umriss-ui/table";
5409
+
5410
+ interface Room {
5411
+ id: string;
5412
+ name: string;
5413
+ seats: number;
5414
+ floor: number;
5415
+ }
5416
+
5417
+ const ROOMS: Room[] = [
5418
+ { id: "r1", name: "Harbour", seats: 8, floor: 2 },
5419
+ { id: "r2", name: "Orchard", seats: 12, floor: 3 },
5420
+ { id: "r3", name: "Lantern", seats: 4, floor: 3 },
5421
+ ];
5422
+
5423
+ export default function EditADenseTable() {
5424
+ const [rooms, setRooms] = useState(ROOMS);
5425
+ const { Table, Column } = useTable(rooms, { rowKey: (r) => r.id });
5426
+ return (
5427
+ <Table
5428
+ grid
5429
+ editMode="row"
5430
+ density="compact"
5431
+ ariaLabel="Meeting rooms"
5432
+ onRowSave={({ rowKey, changes }) => setRooms((all) => all.map((r) => (r.id === rowKey ? { ...r, ...changes } : r)))}
5433
+ onRowDelete={({ rowKey }) => setRooms((all) => all.filter((r) => r.id !== rowKey))}
5434
+ >
5435
+ <Column value="name" label="Room" rowHeader edit="text" />
5436
+ <Column value="seats" label="Seats" edit="number" width={120} />
5437
+ <Column value="floor" label="Floor" edit="number" width={120} />
5438
+ </Table>
5439
+ );
5440
+ }
5441
+ ```
5442
+
5401
5443
  #### Keyboard
5402
5444
 
5403
5445
  | Key | Action |
@@ -5424,7 +5466,7 @@ A column that judges each value against limits – ok, warning, alarm or unknown
5424
5466
  import { useTable } from "@umriss-ui/table";
5425
5467
  ```
5426
5468
 
5427
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/verdictcolumn
5469
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/verdictcolumn/
5428
5470
 
5429
5471
  A missing value reads “unknown”: a fourth verdict, not a blank cell. Each verdict carries a shape and a word as well as a colour, and a value past a limit shows its excess beside it.
5430
5472
 
@@ -5659,7 +5701,7 @@ The list of alerts someone has to see and acknowledge, worst first, with their s
5659
5701
  import { AlarmList, alarmModel } from "@umriss-ui/table";
5660
5702
  ```
5661
5703
 
5662
- Demo page: https://romanhaendler.github.io/umriss-ui/table/#/alarmlist
5704
+ Demo page: https://romanhaendler.github.io/umriss-ui/table/alarmlist/
5663
5705
 
5664
5706
  The library receives alerts and raises none (ADR-0009). `alarmModel` turns them into a sorted view – priority, then acknowledgement, then time – and the list shows it; your application applies the transitions (`acknowledge`, `snooze`, `unsnooze`, `disable`, `enable`) to its own state. The lifecycle is one field with four values, active or resolved × acknowledged or not, so an alert that came and went unseen stays until someone acknowledges it.
5665
5707
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@umriss-ui/table",
3
- "version": "0.7.0",
4
- "description": "The umriss table for data-dense applications - declared the way it reads: columns as JSX, typed against their rows.",
3
+ "version": "0.7.2",
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",
7
7
  "homepage": "https://romanhaendler.github.io/umriss-ui/table/",
@@ -15,11 +15,17 @@
15
15
  },
16
16
  "keywords": [
17
17
  "react",
18
- "components",
19
- "ui",
20
- "umriss",
18
+ "react-table",
19
+ "data-table",
20
+ "data-grid",
21
+ "datagrid",
21
22
  "table",
22
- "data-grid"
23
+ "sorting",
24
+ "filtering",
25
+ "grouping",
26
+ "virtualization",
27
+ "typescript",
28
+ "umriss"
23
29
  ],
24
30
  "type": "module",
25
31
  "files": [
@@ -45,7 +51,7 @@
45
51
  "peerDependencies": {
46
52
  "react": ">=18",
47
53
  "react-dom": ">=18",
48
- "@umriss-ui/core": "^0.14.0"
54
+ "@umriss-ui/core": "^0.15.0"
49
55
  },
50
56
  "devDependencies": {
51
57
  "@fontsource/geist-mono": "^5.3.0",
@@ -59,7 +65,7 @@
59
65
  "typescript": "^5.6.3",
60
66
  "vite": "^6.0.0",
61
67
  "vite-plugin-dts": "^4.3.0",
62
- "@umriss-ui/core": "0.14.0",
68
+ "@umriss-ui/core": "0.15.0",
63
69
  "@umriss-ui/demo": "0.0.0"
64
70
  },
65
71
  "scripts": {