@umriss-ui/table 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/table 0.10.0
1
+ # @umriss-ui/table 0.11.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
 
@@ -1009,7 +1009,7 @@ export default function FirstTable() {
1009
1009
  | `filter` | `(row: Z) => boolean` | — | The old name of `preFilter` – the same filter, the same meaning. |
1010
1010
  | `rowFilters` | `readonly 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. |
1011
1011
  | `initialView` | `TableView` | — | The view on the first render. The table remembers none: where a view is kept is the application's decision. Names no column carries fall out. |
1012
- | `virtual` | `{ rowHeight: number; overscan?: number }` | — | Renders only what stands in the scroll area; paging is then off. |
1012
+ | `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). |
1013
1013
  | `selection` | `TableSelection<string>` | — | A selection from outside instead of its own – when the application holds it. |
1014
1014
 
1015
1015
  ##### `TableSnapshot<Z>`
@@ -1491,7 +1491,7 @@ export default function AbsentValues() {
1491
1491
 
1492
1492
  ##### Fit long values
1493
1493
 
1494
- Long text wraps in its cell; give a column a `width` to start from, and a table wider than its place scrolls in its own frame.
1494
+ A long value stays on its line and ends in an ellipsis; point at it, or make it the Active cell, and a tip shows it whole. A column with a `width` is exactly that wide, and a table wider than its place scrolls in its own frame.
1495
1495
 
1496
1496
  ```tsx
1497
1497
  import { useTable } from "@umriss-ui/table";
@@ -1537,6 +1537,47 @@ export default function LongValues() {
1537
1537
  }
1538
1538
  ```
1539
1539
 
1540
+ ##### Fit what does not fit
1541
+
1542
+ Nothing in a cell wraps and no row grows. Text ends in an ellipsis, and a tip shows it whole; a component that does not fit is cut at the column's edge - give its column room, or show the whole in the row's detail.
1543
+
1544
+ ```tsx
1545
+ import { Badge } from "@umriss-ui/core";
1546
+ import { useTable } from "@umriss-ui/table";
1547
+
1548
+ interface Service {
1549
+ name: string;
1550
+ tags: readonly string[];
1551
+ note: string;
1552
+ }
1553
+
1554
+ const SERVICES: Service[] = [
1555
+ { name: "Checkout", tags: ["payments", "eu-west", "critical", "pci"], note: "Card payments time out above 300 ms; the provider's status page says a partial outage." },
1556
+ { name: "Billing", tags: ["payments", "eu-west"], note: "Invoices go out on the first working day." },
1557
+ { name: "Webhooks", tags: ["integrations", "us-east", "beta"], note: "Retries back off up to an hour; a receiver that answers 410 is dropped." },
1558
+ ];
1559
+
1560
+ export default function ValuesThatDoNotFit() {
1561
+ const { Table, Column } = useTable(SERVICES, { rowKey: (s) => s.name });
1562
+
1563
+ return (
1564
+ <Table ariaLabel="Services with tags and notes">
1565
+ <Column value="name" label="Service" rowHeader width={120} />
1566
+ <Column value="tags" label="Tags" width={170} sortable={false}>
1567
+ {(tags) =>
1568
+ tags.map((tag) => (
1569
+ <Badge key={tag} style={{ marginRight: 4 }}>
1570
+ {tag}
1571
+ </Badge>
1572
+ ))
1573
+ }
1574
+ </Column>
1575
+ <Column value="note" label="Note" width={300} sortable={false} />
1576
+ </Table>
1577
+ );
1578
+ }
1579
+ ```
1580
+
1540
1581
  ### Width and pinning
1541
1582
 
1542
1583
  How wide a column stands, which columns stay in view while the table scrolls sideways, and a header that stays while it scrolls down.
@@ -4134,7 +4175,7 @@ export default function GroupOfOne() {
4134
4175
 
4135
4176
  ##### Fit long group names in a compact table
4136
4177
 
4137
- A long value in a span is cut and kept in its title, so no other column has to wrap; rows without a project gather last.
4178
+ A long value in a span is cut and kept in its title, as every value in the table stays on its line; rows without a project gather last.
4138
4179
 
4139
4180
  ```tsx
4140
4181
  import { useTable } from "@umriss-ui/table";
@@ -4224,7 +4265,7 @@ export default function TwentyThousand() {
4224
4265
  const { Table, Column, GroupBy } = useTable(requests, {
4225
4266
  rowKey: (r) => r.id,
4226
4267
  defaultGrouping: ["service", "part"],
4227
- virtual: { rowHeight: 37 },
4268
+ virtual: true,
4228
4269
  });
4229
4270
  return (
4230
4271
  <Table ariaLabel="Requests" maxHeight="480px" stickyHeader>
@@ -5507,7 +5548,7 @@ export default function StylingRows() {
5507
5548
 
5508
5549
  ##### Show loading, empty, failed and no match
5509
5550
 
5510
- `loading` shows placeholder rows, `empty` what stands without rows, a failed load too; that nothing matches the table recognises itself.
5551
+ `loading` shows placeholder rows where there are none yet, and dims the rows that stand while new ones are on their way; `empty` what stands without rows, a failed load too; that nothing matches the table recognises itself.
5511
5552
 
5512
5553
  ```tsx
5513
5554
  import type { ReactNode } from "react";
@@ -7263,7 +7304,7 @@ export default function Virtualisation() {
7263
7304
  const t = useTable(requests, {
7264
7305
  rowKey: (r) => r.id,
7265
7306
  defaultSort: { column: "id", direction: "asc" },
7266
- virtual: { rowHeight: 37 },
7307
+ virtual: true,
7267
7308
  });
7268
7309
  const { Table, Column } = t;
7269
7310
 
@@ -7910,7 +7951,7 @@ export default function ListFilter() {
7910
7951
 
7911
7952
  ##### Show loading, and drop a late answer
7912
7953
 
7913
- `loading` marks the table while a request runs. An answer to a view the user has already left is the application's to drop; the table shows whatever rows it is given.
7954
+ `loading` marks the table while a request runs: the page it has stays, dimmed after a moment, and nothing below it moves. An answer to a view the user has already left is the application's to drop; the table shows whatever rows it is given.
7914
7955
 
7915
7956
  ```tsx
7916
7957
  import { useRef, useState } from "react";
@@ -8353,7 +8394,7 @@ export default function TheWholeGrid() {
8353
8394
  rowKey: (p) => p.id,
8354
8395
  defaultGrouping: "depot",
8355
8396
  defaultSort: { column: "parcel", direction: "asc" },
8356
- virtual: { rowHeight: 37 },
8397
+ virtual: true,
8357
8398
  });
8358
8399
  return (
8359
8400
  <Table
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/table",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
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.21.0"
54
+ "@umriss-ui/core": "^0.22.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@fontsource/geist-mono": "^5.3.0",
@@ -66,7 +66,7 @@
66
66
  "vite": "^6.0.0",
67
67
  "vite-plugin-dts": "^4.3.0",
68
68
  "@umriss-ui/demo": "0.0.0",
69
- "@umriss-ui/core": "0.21.0"
69
+ "@umriss-ui/core": "0.22.0"
70
70
  },
71
71
  "scripts": {
72
72
  "props": "node --disable-warning=ExperimentalWarning --experimental-strip-types demo/props.ts",