@umriss-ui/table 0.55.1 → 0.57.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/API.md +143 -27
- package/CHANGELOG.md +25 -0
- package/README.md +4 -4
- package/dist/index.d.ts +19 -23
- package/dist/table.css +1 -1
- package/dist/table.js +1650 -1646
- package/docs/llms-full.md +4925 -603
- package/package.json +8 -5
package/API.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @umriss-ui/table API
|
|
2
2
|
|
|
3
|
-
Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edit.
|
|
3
|
+
Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edit. Lists every export, and the props, options and returns of each component and hook, with first sentences only; the full text is `docs/llms-full.md`. What stands under `## Experimental`, or is marked `(experimental)`, may change in a minor release; everything else is the surface a break costs a major for (ADR-0083).
|
|
4
4
|
|
|
5
5
|
## Components
|
|
6
6
|
|
|
@@ -30,88 +30,88 @@ Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edi
|
|
|
30
30
|
|
|
31
31
|
## Types
|
|
32
32
|
|
|
33
|
-
- Absent — A value that is not there: `null` or `undefined`.
|
|
34
|
-
- ActionProps — The props of `Action`: one action on a row, or with `bulk` on a list of rows - then it also stands in the table toolbar for the selection.
|
|
33
|
+
- Absent — A value that is not there: `null` or `undefined`. = null | undefined
|
|
34
|
+
- ActionProps — The props of `Action`: one action on a row, or with `bulk` on a list of rows - then it also stands in the table toolbar for the selection. = ActionBase<Z> & { bulk?: false; /** Gets the row the action was triggered on. */ onSelect: (row: Z) => void; } | ActionBase<Z> & { /** Acts on a list: at the row on a list made from it, in the table toolbar on the selection within the filtered set. */ bulk: true; /** With `bulk` a list: at the row one made from it, in the table toolbar the selection. */ onSelect(selected: S extends true ? Z[] | AllMatching<Key> : Z[]): void; }
|
|
35
35
|
- AggregateColumn — A column that carries an aggregate, as the pipeline needs it. [id, read, aggregate]
|
|
36
|
-
- AggregateFor — What a column accepts as `aggregate`: sums and averages for numbers, the extremes for numbers and points in time, the range for points in time, counts for every value with a text form - or a function of one's own.
|
|
36
|
+
- AggregateFor — What a column accepts as `aggregate`: sums and averages for numbers, the extremes for numbers and points in time, the range for points in time, counts for every value with a text form - or a function of one's own. = [Present<W>] extends [number] ? "sum" | "avg" | "min" | "max" : never | [Present<W>] extends [Date] ? "min" | "max" | "range" : never | IsDisplayable<W> extends true ? "count" | "distinct" : never | AggregateFunction
|
|
37
37
|
- AggregateFunction — An aggregate of one's own: the values present and the rows of the group - or of the filtered set, in the footer.
|
|
38
|
-
- AggregateKind — The built-in aggregates.
|
|
38
|
+
- AggregateKind — The built-in aggregates. = "sum" | "avg" | "min" | "max" | "range" | "count" | "distinct"
|
|
39
39
|
- AggregateOptions — What a column's values come to - the props a column carries for it. [aggregate, aggregateLabel, share]
|
|
40
40
|
- AllMatching — What a server-mode bulk action receives, in the toolbar, while all that match are selected, or a group of them: the request they match and the keys unticked since. [request, except, group]
|
|
41
41
|
- CellEdit — An edit the user committed - reported, not applied. [rowKey, columnId, value, row]
|
|
42
42
|
- CellEditorProps — What an editor of one's own receives.
|
|
43
|
-
- ColumnBase — What every column takes, whatever its value: label, width, pinning and what the user may do with it. [label, rowHeader, numeric, width, flex, minWidth, resizable, pin, sortable, searchable, groupable]
|
|
43
|
+
- ColumnBase — What every column takes, whatever its value: label, width, pinning and what the user may do with it. [label, rowHeader, numeric, align, width, flex, minWidth, resizable, pin, sortable, searchable, groupable]
|
|
44
44
|
- ColumnComponent — The `Column` of a table, typed at its row: a field column names a field in `value`, a computed column a function and an `id`.
|
|
45
45
|
- ColumnFilter — A column filter of one's own, as `columnFilter` makes it: when a value satisfies a condition, the control that sets it, and its text in the table toolbar. [matches, Input, describe]
|
|
46
46
|
- ColumnGroupProps — The props of `ColumnGroup`.
|
|
47
47
|
- ColumnMenuProps — The props of `ColumnMenu`.
|
|
48
48
|
- ColumnPreset — The properties of a column, as `column()` supplies them.
|
|
49
|
-
- Computed — A computed column's props: its value is a function of the row, so it needs an `id`.
|
|
49
|
+
- Computed — A computed column's props: its value is a function of the row, so it needs an `id`. [id, value, aggregateLabel, filter, edit, editOptions, validate]
|
|
50
50
|
- DateFormat — The names of the standard presentations of a point in time, with the English text of 17 March 2026 at 09:05:03 for each: - `"date"`: "17/03/2026" - `"time"`: "09:05" - `"dateTime"`: "17/03/2026, 09:05" - `"timeWithSeconds"`: "09:05:03" - `"dateTimeWithSeconds"`: "17/03/2026, 09:05:03" German formats write the same with "17.03.2026".
|
|
51
|
-
- DatePeriod — The span a point in time is grouped by.
|
|
52
|
-
- Displayable — What can appear as text without `children`.
|
|
53
|
-
- EditFor — What a column accepts as `edit`: the core field for its value - `"text"` for text, `"number"` for numbers, `"date"` for points in time, `"select"` for text and numbers, `"dateTime"` for points in time with a time of day, `"boolean"` for a checkbox - or an editor of one's own.
|
|
51
|
+
- DatePeriod — The span a point in time is grouped by. = "day" | "week" | "month" | "year"
|
|
52
|
+
- Displayable — What can appear as text without `children`. = string | number | boolean | Date
|
|
53
|
+
- EditFor — What a column accepts as `edit`: the core field for its value - `"text"` for text, `"number"` for numbers, `"date"` for points in time, `"select"` for text and numbers, `"dateTime"` for points in time with a time of day, `"boolean"` for a checkbox - or an editor of one's own. = [Present<W>] extends [string] ? "text" | "select" : never | [Present<W>] extends [number] ? "number" | "select" : never | [Present<W>] extends [Date] ? "date" | "dateTime" : never | [Present<W>] extends [boolean] ? "boolean" : never | (editor: CellEditorProps<W, Z>) => ReactNode
|
|
54
54
|
- EditOptions — The props a column carries for editing in grid mode (`<Table grid>`). [edit, editOptions, validate]
|
|
55
|
-
- ExportCell — What a spreadsheet cell holds: numbers, booleans and points in time stay what they are, an absent value is `undefined`.
|
|
55
|
+
- ExportCell — What a spreadsheet cell holds: numbers, booleans and points in time stay what they are, an absent value is `undefined`. = string | number | boolean | Date | undefined
|
|
56
56
|
- ExportContext — What the language in use hands a format. [formats, wording, wallClock]
|
|
57
57
|
- ExportFormat — A way to write the export: the file's extension and MIME type, and the function that turns the sheet into `R` - text or bytes. [extension, mime, write]
|
|
58
58
|
- ExportProps — The props of `Export`: by default a CSV file is downloaded; with `onExport` the text is handed over instead.
|
|
59
59
|
- ExportSheet — What a format writes: the header labels, the widths the table holds, whether a column's own `exportValue` made its values (`own`: written as they come), whether a date column is a column of days (`day`, from its `format`; unset: the writer decides by whether every date lies at midnight), and the rows as typed cells. [columns, rows]
|
|
60
60
|
- Field — The field names of a row.
|
|
61
61
|
- FieldColumn — The props of a column over a field `K` of the row `Z`: what every column takes, and what the field's value decides - its format, filter, grouping, aggregate and editing. [value, id, format, filter, group, edit, editOptions, validate, children]
|
|
62
|
-
- FieldCondition — What can be set as a condition on a field: a list of its values, for numbers and points in time a range, and for text a text condition.
|
|
63
|
-
- FilterFor — What a column accepts as `filter`: `"list"` for every value with a text form, `"range"` for numbers and points in time, `"text"` for text, a filter from `columnFilter` only where its value type fits.
|
|
62
|
+
- FieldCondition — What can be set as a condition on a field: a list of its values, for numbers and points in time a range, and for text a text condition. = ListCondition | [Present<W>] extends [string] ? TextCondition : never | [Present<W>] extends [number] ? RangeCondition<number> : [Present<W>] extends [Date] ? RangeCondition<Date> : never
|
|
63
|
+
- FilterFor — What a column accepts as `filter`: `"list"` for every value with a text form, `"range"` for numbers and points in time, `"text"` for text, a filter from `columnFilter` only where its value type fits. = IsDisplayable<W> extends true ? "list" : never | [Present<W>] extends [string] ? "text" : never | [Present<W>] extends [number] ? "range" : [Present<W>] extends [Date] ? "range" : never | ColumnFilter
|
|
64
64
|
- FilterInputProps — What the `Input` of a filter of one's own receives: the condition, its setter, and the values the column holds.
|
|
65
65
|
- FormatFor — What a column accepts as `format`: a number format for numbers, a date format for points in time, nothing for every other value.
|
|
66
66
|
- GroupByBase — What every group key takes, whatever its value. [label]
|
|
67
67
|
- GroupByComponent — A value the table can be grouped by without being a column: no cell, no export, no entry among the columns - only where a grouping is chosen.
|
|
68
68
|
- GroupFor — `group` on a point in time: its rows are grouped by day, ISO week, month or year.
|
|
69
69
|
- GroupLevel — One level of the grouping: what a row is grouped by on it. [id, value, order]
|
|
70
|
-
- GroupingId — A column or group key the table can be grouped by.
|
|
70
|
+
- GroupingId — A column or group key the table can be grouped by. = Field | string & {}
|
|
71
71
|
- IsDisplayable — `true` where the value present can appear as text without `children` (`Displayable`), `false` otherwise - what decides the filters and aggregates a column offers.
|
|
72
|
-
- Line — One line of a grouped table.
|
|
72
|
+
- Line — One line of a grouped table. = { kind: "header", group, parents, continued } | { kind: "row", row, parents, span, first, continued } | { kind: "folded", group, parents }
|
|
73
73
|
- ListCondition — The condition of a list filter: the chosen values, an absent one as `null`.
|
|
74
74
|
- ModelColumn — A column as the model reads it - what sorting, search, hiding and the export need of it, not its presentation. [id, label, value, compare, searchValue, searchable, hideable, resizable, width]
|
|
75
75
|
- NumberField — The field names whose value is a number or may be absent.
|
|
76
|
-
- NumberFormat — How a number column is written: `"percent"`, `"count"`, or Intl's number options plus `decimals`; the same shape as core's `NumberFormat`.
|
|
76
|
+
- NumberFormat — How a number column is written: `"percent"`, `"count"`, or Intl's number options plus `decimals`; the same shape as core's `NumberFormat`. = "percent" | "count" | NumberOptions
|
|
77
77
|
- OwnAggregate — An aggregate of one's own: the values present and the group's rows.
|
|
78
78
|
- PaginationProps — The props of `Pagination`.
|
|
79
|
-
- Pin — Where a pinned column stands: in the block before or after the others.
|
|
79
|
+
- Pin — Where a pinned column stands: in the block before or after the others. = "start" | "end"
|
|
80
80
|
- Present — The value without the absence - that is what `children` gets.
|
|
81
81
|
- Presentation — What a column draws in a cell: the value present and its row.
|
|
82
82
|
- RangeCondition — The condition of a range filter: both bounds inclusive, each may be absent. [from, to]
|
|
83
83
|
- RowActionsProps — The props of `RowActions`: the `Action`s of each row, in its menu.
|
|
84
84
|
- RowAdd — A new row the user saved: every column that edits, by column id. [values]
|
|
85
|
-
- RowAttributes — What a row carries in classes and data attributes.
|
|
85
|
+
- RowAttributes — What a row carries in classes and data attributes. [className]
|
|
86
86
|
- RowDelete — A row the user asked to delete, and confirmed. [rowKey, row]
|
|
87
87
|
- RowDetailProps — The props of `RowDetail`: what an expanded row shows underneath it.
|
|
88
88
|
- RowFilter — A row filter, as `rowFilter` makes it: a condition over the whole row that a control of the application sets through `setFilter`. [id, label, matches, describe]
|
|
89
89
|
- RowGroup — The rows of the filtered set that share one grouping value on one level. [path, value, level, rows, groups, aggregates, size]
|
|
90
|
-
- RowKey — What `rowKey` returns: `1` and `"1"` are different keys.
|
|
90
|
+
- RowKey — What `rowKey` returns: `1` and `"1"` are different keys. = string | number
|
|
91
91
|
- RowSave — A Row draft the user saved (ADR-0036) - reported, not applied. [rowKey, changes, row]
|
|
92
92
|
- SearchProps — The props of `Search`.
|
|
93
93
|
- ServerGroup — One group line of a server's answer (`groups`): a group the page shows rows of, or a folded one. [path, count, totals, at, continued]
|
|
94
94
|
- SetFilter — Sets a condition from outside.
|
|
95
|
-
- SortDirection — The direction of one sort level: `asc` puts the smallest value on top, `desc` the largest.
|
|
95
|
+
- SortDirection — The direction of one sort level: `asc` puts the smallest value on top, `desc` the largest. = "asc" | "desc"
|
|
96
96
|
- SortLevel — One level of the sort. [column, direction]
|
|
97
|
-
- Table — What `useTable` returns: the table's state, and its parts typed at the row. [Table, Column, VerdictColumn, RowDetail, RowActions, Action, GroupBy, scrollToRow, focusCell, rows, filtered, visible, page, pageCount, pageSize, setPage, setPageSize, search, setSearch, sort, toggleSort, hidden, toggleColumn, order, setOrder, pinned, setPin, widths, setWidth, autoSizeColumns, expanded, toggleRow, filter, setFilter, conditionOf, selection, grouping, setGrouping, setView, folded, toggleFold, foldAll, unfoldAll, branches, toggleBranch, unfoldAllBranches, foldAllBranches, view, asCsv, selectionAsText, virtual, rowCount, server, request, framed]
|
|
97
|
+
- Table — What `useTable` returns: the table's state, and its parts typed at the row. [Table, Column, VerdictColumn, RowDetail, RowActions, Action, GroupBy, scrollToRow, focusCell, rows, filtered, visible, page, pageCount, pageSize, setPage, setPageSize, search, setSearch, sort, toggleSort, hidden, toggleColumn, order, setOrder, pinned, setPin, widths, setWidth, autoSizeColumns, expanded, toggleRow, filter, setFilter, conditionOf, selection, grouping, setGrouping, setView, folded, toggleFold, foldAll, unfoldAll, branches, toggleBranch, unfoldAllBranches, foldAllBranches, view, asCsv, exportAs<R>(format: ExportFormat<R>, rows?: readonly Z[]): R, selectionAsText, virtual, rowCount, server, request, framed]
|
|
98
98
|
- TableInput — The view's state the model computes a table from, beside its rows and columns: search, filter, sort, page, hidden columns, order, grouping, tree. [search, filter, sort, page, pageSize, hidden, order, grouping, server, tree]
|
|
99
99
|
- TableOptions — The options of `useTable`: automatic, or in server mode over a server's rows. [rowKey, pageSize, defaultSort, defaultGrouping, preFilter, rowFilters, initialView, onViewChange, virtual, selection, onSelectionChange]
|
|
100
100
|
- TableProjection — The table's pipeline as a pure function - filter, sort, page over rows and model columns. [columns, filtered, visible, groups, lines, visibleLines, entries, shown, roots, exported, total, page, pageCount, columnCount]
|
|
101
101
|
- TableProps — The props of `Table`: how the table looks and behaves.
|
|
102
|
-
- TableRef — What a part without a row type needs from a table – for `of`.
|
|
102
|
+
- TableRef — What a part without a row type needs from a table – for `of`. [rows, filtered, visible, page, pageCount, pageSize, setPage, setPageSize, search, setSearch, sort, toggleSort, hidden, toggleColumn, order, setOrder, pinned, setPin, widths, setWidth, autoSizeColumns, expanded, toggleRow, filter, selection, grouping, setGrouping, setView, folded, toggleFold, foldAll, unfoldAll, branches, toggleBranch, unfoldAllBranches, foldAllBranches, view, asCsv, exportAs<R>(format: ExportFormat<R>, rows?: readonly unknown[]): R, selectionAsText, virtual, rowCount, server, request, framed, Table, setFilter(column: string, condition: unknown): void]
|
|
103
103
|
- TableRequest — The request server mode reports to `onRequest`: the parts of the view that decide the rows - search, conditions, sort, page, page size, the grouping and the folded groups - and nothing else, each at its default as well.
|
|
104
104
|
- TableSelection — What `useTableSelection` returns: the selected keys and the gestures on them. [selected, isSelected, toggle, set, toggleAll, clear, allSelected, someSelected, allMatching, except, selectMatching, count]
|
|
105
|
-
- TableSnapshot — The state of a table, as everything outside the columns reads it. [rows, filtered, visible, page, pageCount, pageSize, setPage, setPageSize, search, setSearch, sort, toggleSort, hidden, toggleColumn, order, setOrder, pinned, setPin, widths, setWidth, autoSizeColumns, expanded, toggleRow, filter, setFilter, conditionOf, selection, grouping, setGrouping, setView, folded, toggleFold, foldAll, unfoldAll, branches, toggleBranch, unfoldAllBranches, foldAllBranches, view, asCsv, selectionAsText, virtual, rowCount, server, request, framed]
|
|
106
|
-
- TableView — Search, conditions, sort levels, page, page size, hidden columns, order, dragged widths, the grouping and the
|
|
105
|
+
- TableSnapshot — The state of a table, as everything outside the columns reads it. [rows, filtered, visible, page, pageCount, pageSize, setPage, setPageSize, search, setSearch, sort, toggleSort, hidden, toggleColumn, order, setOrder, pinned, setPin, widths, setWidth, autoSizeColumns, expanded, toggleRow, filter, setFilter, conditionOf, selection, grouping, setGrouping, setView, folded, toggleFold, foldAll, unfoldAll, branches, toggleBranch, unfoldAllBranches, foldAllBranches, view, asCsv, exportAs<R>(format: ExportFormat<R>, rows?: readonly Z[]): R, selectionAsText, virtual, rowCount, server, request, framed]
|
|
106
|
+
- TableView — Search, conditions, sort levels, page, page size, hidden columns, order, dragged widths, the grouping, the pinned columns, the folded groups and the open branches. [search, conditions, sort, page, pageSize, hidden, order, widths, grouping, folded, branches, pinned]
|
|
107
107
|
- TextCondition — The condition of a text filter: one or two terms, joined by `join` (`"and"` unless given). [join, terms]
|
|
108
|
-
- TextOperator — How a text filter compares: without regard to case, with the formats' locale.
|
|
108
|
+
- TextOperator — How a text filter compares: without regard to case, with the formats' locale. = "contains" | "notContains" | "startsWith" | "endsWith" | "equals" | "isEmpty"
|
|
109
109
|
- TextTerm — One term of a text condition. [operator, value]
|
|
110
110
|
- ToolbarProps — The props of `Toolbar`.
|
|
111
|
-
- ToolbarSize — The size of a toolbar's controls.
|
|
111
|
+
- ToolbarSize — The size of a toolbar's controls. = "sm" | "md"
|
|
112
112
|
- TreeInput — Tree rows for the model: how a row is keyed, how its children are read, and which branches are open. [key, children, unloaded, open, admit]
|
|
113
113
|
- ValuePaths — How a value that does not sort or export itself does so after all. [sortValue, exportValue, groupValue]
|
|
114
|
-
- VerdictBase — What every verdict column takes, whether its value is a field or a function. [
|
|
114
|
+
- VerdictBase — What every verdict column takes, whether its value is a field or a function. [limits, format, sortBy, align, aggregate, aggregateLabel, label, width, flex, minWidth, resizable, pin]
|
|
115
115
|
- VerdictColumnComponent — The `VerdictColumn` of a table, typed at its row: a numeric field, or a function with an `id`, whose value is read against `limits` and shown with its verdict.
|
|
116
116
|
|
|
117
117
|
## @umriss-ui/table/xlsx
|
|
@@ -249,6 +249,7 @@ Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edi
|
|
|
249
249
|
- foldAllBranches: () => void — Tree rows: closes every branch.
|
|
250
250
|
- view: TableView — The part of the state an application can keep; whatever still stands as the options set it up is absent.
|
|
251
251
|
- asCsv: () => string — The filtered set in the visible columns as text for a spreadsheet - in server mode the page.
|
|
252
|
+
- exportAs<R>(format: ExportFormat<R>, rows?: readonly Z[]): R — The same rows and columns written by a format: `csv` for text, a format of one's own for anything else.
|
|
252
253
|
- selectionAsText: () => string — The selected rows within the filtered set as tab-separated text under a header line - the text Ctrl+C writes.
|
|
253
254
|
- virtual: boolean — Whether it virtualises.
|
|
254
255
|
- rowCount: number — How many rows the filtered set has - in server mode the server's count.
|
|
@@ -256,6 +257,103 @@ Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edi
|
|
|
256
257
|
- request: TableRequest | null — Server mode: the request `onRequest` last received, or is about to; `null` outside it.
|
|
257
258
|
- framed: boolean — Whether the table fills a parent of definite height, with no prop: the frame is exactly as tall as the parent.
|
|
258
259
|
|
|
260
|
+
#### props of Table (TableProps)
|
|
261
|
+
|
|
262
|
+
- selectable?: boolean — Adds the selection column.
|
|
263
|
+
- stickyHeader?: boolean — Keeps the header row visible while scrolling.
|
|
264
|
+
- stickyRowHeader?: boolean — Keeps the row header column visible while scrolling sideways - the same as `pin="start"` on the row header.
|
|
265
|
+
- striped?: boolean — Discreet zebra stripes.
|
|
266
|
+
- density?: "regular" | "compact" — How tightly the rows stand. (default: the density of the `UmrissProvider`, else `"regular"`)
|
|
267
|
+
- maxHeight?: string — Height of the scroll area, e.g. "480px".
|
|
268
|
+
- empty?: ReactNode — What stands in the body when there are no rows.
|
|
269
|
+
- loading?: boolean — Shows placeholder rows instead of the rows.
|
|
270
|
+
- rowProps?: (row: Z) => RowAttributes — Classes and data attributes per row.
|
|
271
|
+
- currentRow?: Key | null — The key of the row the rest of the screen follows - the table marks it with `aria-current` and an accent bar, apart from the selection.
|
|
272
|
+
- onCurrentRowChange?: (key: Key, row: Z) => void — A primary click on a row, outside its controls - the checkbox, the expander, the actions and any button of yours in a cell - with the row's key and the row.
|
|
273
|
+
- groupable?: boolean — `false`: the user cannot group this table - the column menu offers no grouping, and a grouping handed in is passed over.
|
|
274
|
+
- 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.
|
|
275
|
+
- onCellEdit?: (edit: CellEdit<Z, Key>) => void — Grid mode: an edit the user committed.
|
|
276
|
+
- 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.
|
|
277
|
+
- onRowSave?: (save: RowSave<Z, Key>) => void — `editMode="row"`: a saved Row draft, with the columns it changed.
|
|
278
|
+
- onRowAdd?: (add: RowAdd) => void — Grid mode: puts up a "New row" button - in the table toolbar, or beneath the table without one.
|
|
279
|
+
- newRow?: () => Partial<Z> — What a new row starts with - the values the columns read before anything is typed.
|
|
280
|
+
- onRowDelete?: (remove: RowDelete<Z, Key>) => void — Grid mode: a Delete button on every row, which asks inside its row before the delete is reported.
|
|
281
|
+
- children?: ReactNode — Columns, `RowDetail`, `RowActions` and the unbound parts.
|
|
282
|
+
- ref?: Ref<HTMLDivElement> | undefined — Receives the component's root element.
|
|
283
|
+
|
|
284
|
+
#### props of Column (all forms)
|
|
285
|
+
|
|
286
|
+
- id: string — The id is required where the value is a function.
|
|
287
|
+
- value: (row: Z) => W
|
|
288
|
+
- aggregateLabel?: string — The word for an `aggregate` function of one's own: it stands before the value in the footer and is what a screen reader reads.
|
|
289
|
+
- filter?: "list" | "range" | "text" | ColumnFilter<Present<W>, any> — A filter in the column header: `"list"` offers the values that occur, `"range"` two bounds (meaningful only for numbers and points in time), `"text"` operators over a text, a filter from `columnFilter` asks whatever it asks itself.
|
|
290
|
+
- edit?: "text" | "number" | "select" | "date" | "dateTime" | "boolean" | ((editor: Cell… — Edits the column's cells in place in grid mode - see a field column's `edit`.
|
|
291
|
+
- editOptions?: readonly Present<W>[] — What `edit="select"` offers. (default: the values that occur)
|
|
292
|
+
- validate?: (value: W | null, row: Z) => string | null | undefined — Checks a draft before it is reported; a message keeps the editor open.
|
|
293
|
+
- label: string — Names the column in its header, in the column menu and in the header row of the export.
|
|
294
|
+
- 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.
|
|
295
|
+
- numeric?: boolean — Right-aligned with tabular figures. (default: decided by the first value present)
|
|
296
|
+
- align?: "start" | "center" | "end" — The side the whole column stands on - label with its tools, values, footer, aggregates and loading rows: flush at the start, centred, or flush at the end. (default: `"end"` for a numeric column, otherwise `"start"`)
|
|
297
|
+
- width?: number — Initial width in pixels. (default: the browser's)
|
|
298
|
+
- flex?: number — A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. (default: none: the column is as wide as its content)
|
|
299
|
+
- minWidth?: number — The least width of a column with `flex`, in pixels.
|
|
300
|
+
- resizable?: boolean — Shows the drag grip on the header cell. (default: false)
|
|
301
|
+
- pin?: Pin — Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them.
|
|
302
|
+
- sortable?: boolean — Whether the column can be sorted by. (default: `true` when the value is text, a number, a point in time or a boolean)
|
|
303
|
+
- searchable?: boolean — Takes part in the search. (default: `true` for text, `false` otherwise)
|
|
304
|
+
- groupable?: boolean — Can the table be grouped by this column? (default: `true` when its value is text, a number, a point in time or a boolean, or it has a `groupValue`)
|
|
305
|
+
- sortValue?: (value: Present<W>) => string | number | Absent — What is sorted by, when not by the value itself.
|
|
306
|
+
- exportValue?: (value: Present<W>) => string | number | Absent — What stands in the export, when not the value itself.
|
|
307
|
+
- groupValue?: (value: Present<W>) => string | number | boolean | Date | Absent — What is grouped by, when not the value itself - a group header of a number, say.
|
|
308
|
+
- aggregate: "sum" | "avg" | "min" | "max" | "count" | "distinct"
|
|
309
|
+
- share?: boolean
|
|
310
|
+
- format?: NumberFormat
|
|
311
|
+
- children?: Presentation<W, Z>
|
|
312
|
+
- group?: DatePeriod
|
|
313
|
+
|
|
314
|
+
#### props of VerdictColumn (all forms)
|
|
315
|
+
|
|
316
|
+
- limits: LimitSet — The limit set every value is read against.
|
|
317
|
+
- format?: NumberFormat — How the value and its excess are written.
|
|
318
|
+
- sortBy?: "verdict" | "value" — What the column sorts by: by the weight of the verdict (with equal weight the existing order stays) – or by the value. (default: "verdict")
|
|
319
|
+
- align?: "start" | "center" | "end" — The side the whole column stands on: flush at the start, centred, or flush at the end. (default: "end")
|
|
320
|
+
- aggregate?: "worst" — `"worst"`: the worst verdict among the rows – in the footer and in a group's header.
|
|
321
|
+
- aggregateLabel?: string — The word for the aggregate in the footer, read by a screen reader.
|
|
322
|
+
- label: string — Names the column in its header, in the column menu and in the header row of the export.
|
|
323
|
+
- width?: number — Initial width in pixels. (default: the browser's)
|
|
324
|
+
- flex?: number — A share of the width the other columns leave, so that the table fills its frame: two columns with `flex={1}` split it equally. (default: none: the column is as wide as its content)
|
|
325
|
+
- minWidth?: number — The least width of a column with `flex`, in pixels.
|
|
326
|
+
- resizable?: boolean — Shows the drag grip on the header cell. (default: false)
|
|
327
|
+
- pin?: Pin — Keeps the column in view while the table scrolls sideways: in a block before every other column, or after them.
|
|
328
|
+
- id: string
|
|
329
|
+
- value: (row: Z) => number | Absent
|
|
330
|
+
|
|
331
|
+
#### props of RowDetail (RowDetailProps)
|
|
332
|
+
|
|
333
|
+
- children: (row: Z) => ReactNode — What stands underneath an expanded row.
|
|
334
|
+
|
|
335
|
+
#### props of RowActions (RowActionsProps)
|
|
336
|
+
|
|
337
|
+
- children: ReactNode — The row's `Action`s.
|
|
338
|
+
- pin?: boolean — Whether the actions column sticks at the end of the row while the table scrolls sideways. (default: true)
|
|
339
|
+
|
|
340
|
+
#### props of Action (ActionProps)
|
|
341
|
+
|
|
342
|
+
- children: string — The label – text, because it is read out together with the row's name.
|
|
343
|
+
- tone?: "default" | "danger" — `"danger"` for an action that destroys something – that is how it appears in the menu and in the table toolbar.
|
|
344
|
+
- disabled?: boolean | ((row: Z) => boolean) — Whether the action is unavailable for a row. (default: false)
|
|
345
|
+
- hidden?: boolean | ((row: Z) => boolean) — Whether the action is absent for a row. (default: false)
|
|
346
|
+
- bulk?: false | true — Acts on a list: at the row on a list made from it, in the table toolbar on the selection within the filtered set.
|
|
347
|
+
- onSelect: ((row: Z) => void) | ((selected: S extends true ? Z[] | AllMatching<Key> : Z[]) => void) — Gets the row the action was triggered on.
|
|
348
|
+
|
|
349
|
+
#### props of GroupBy (all forms)
|
|
350
|
+
|
|
351
|
+
- label: string — Names the group key where a grouping is chosen, and in the grouping's tag in the table toolbar.
|
|
352
|
+
- id: string — The id is required where the value is a function.
|
|
353
|
+
- value: (row: Z) => W
|
|
354
|
+
- groupValue?: (value: Present<W>) => string | number | boolean | Date | Absent
|
|
355
|
+
- group?: GroupFor<W>
|
|
356
|
+
|
|
259
357
|
### useTableSelection
|
|
260
358
|
|
|
261
359
|
#### returns (TableSelection)
|
|
@@ -272,3 +370,21 @@ Generated by the props step (`pnpm --filter @umriss-ui/table props`); do not edi
|
|
|
272
370
|
- except: ReadonlySet<T> — While `allMatching`: the keys unticked since.
|
|
273
371
|
- selectMatching: () => void — Selects all that match; the keys selected before are dropped.
|
|
274
372
|
- count: number
|
|
373
|
+
|
|
374
|
+
## Other props
|
|
375
|
+
|
|
376
|
+
#### props (FilterInputProps)
|
|
377
|
+
|
|
378
|
+
- condition: B | null — The condition that holds right now; `null` as long as the filter requires nothing.
|
|
379
|
+
- setCondition: (condition: B | null) => void — Sets the condition; `null` lifts it.
|
|
380
|
+
- values: readonly Present<W>[] — The values that occur in the rows the pre-filter admits – each one once, ordered, without the absent one.
|
|
381
|
+
- column: { id: string; label: string } — The column whose filter this is.
|
|
382
|
+
|
|
383
|
+
#### props (CellEditorProps)
|
|
384
|
+
|
|
385
|
+
- value: W | null — The draft - the cell's value until the field changes it.
|
|
386
|
+
- onChange: (value: W | null) => void — Changes the draft.
|
|
387
|
+
- commit: (value?: W | null) => void — Commits - the draft, or the value given.
|
|
388
|
+
- row: Z
|
|
389
|
+
- invalid: boolean — The draft did not validate: the field shows it; the message stands beneath.
|
|
390
|
+
- label: string — The field's name: what is edited, for which row.
|
package/CHANGELOG.md
CHANGED
|
@@ -26,6 +26,31 @@ is one of the internal numbers from before core's first publication as `0.1.0`
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## 0.57.0 – `API.md` lists the props of `Table`, `Column` and `Action`; three examples (Nov. 2026)
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- **`API.md` lists the whole surface:** the props of `Table`, `Column`, `VerdictColumn`, `GroupBy`, `RowDetail`, `RowActions` and `Action` under `useTable`, `exportAs`, the members of `TableRef`, and the whole signature of the bulk action's `onSelect`. What is marked `@experimental` will stand under a heading of its own, and a deprecated member last in its table.
|
|
34
|
+
- **Examples** for a list filter set through `initialView`, a filter on a boolean column, and `Search`'s `onValueChange`.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- **The properties the table sets on itself for pinning and header levels are named `--_table-*`** (were `--u-table-*` and `--u-header-level`); they carried the tokens' prefix and were never tokens.
|
|
39
|
+
- Migration: nothing, unless a stylesheet of your own read them.
|
|
40
|
+
- **The package names Node 22 in `engines` and peers `react` and `react-dom` as `^19`** (was `>=19`), so that a later React is not promised before it has run (ADR-0083).
|
|
41
|
+
- Migration: nothing on Node 22 and React 19.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **The browser floors are the ones the source needs: Chrome 125, Firefox 121, Safari 17.5.** The documents named Chrome 123 and Firefox 120, though `round()` and `:has()` were in use; nothing changes in a browser. A test now derives the three numbers from the source. A build that pins `cssTarget` or `browserslist` to `chrome123` or `firefox120` raises them to `chrome125` and `firefox121`.
|
|
46
|
+
- **`API.md` states `resizable`'s default,** and `TableView`'s doc comments name the folded groups, the open branches and the row filters' conditions.
|
|
47
|
+
|
|
48
|
+
## 0.56.0 – A column says where its values stand (Nov. 2026)
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- **`align` on every column**, `VerdictColumn` and presets made with `column()` included: `"start"`, `"center"` or `"end"` sets the side of the whole column - the head label with its arrow, rank and funnel, the values, the footer, the aggregates in group lines and the loading rows - so a column of short codes, states or check marks stands centred under its label. It decides the side alone: `numeric`, given or decided by the first value, keeps deciding the figures, so `numeric align="center"` is tabular figures, centred, and `align="end"` on text is ordinary type, flush right. A centred head is centred as one group of label, arrow slot and funnel; a value or label wider than its column is cut at the end, as everywhere. Without `align` a table stands as before, and an export writes nothing of it.
|
|
53
|
+
|
|
29
54
|
## 0.55.1 – Every head stands whole, and lines up with its column (Nov. 2026)
|
|
30
55
|
|
|
31
56
|
### Changed
|
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ export function Orders() {
|
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
What the columns do not say is decided by the value: text on the left, a number
|
|
64
|
-
right-aligned in the provider's notation and sortable. `rowHeader` makes the
|
|
64
|
+
right-aligned in the provider's notation and sortable; `align` sets a column's side by hand - start, centre or end. `rowHeader` makes the
|
|
65
65
|
order number the name of the row — for a screen reader, and for the sticky
|
|
66
66
|
column.
|
|
67
67
|
|
|
@@ -347,15 +347,15 @@ The speeds in [`docs/capabilities.md`](https://github.com/romanhaendler/umriss-u
|
|
|
347
347
|
* The demo, in a checkout: `pnpm dev:table` (port 4175). It is the documentation — one page per
|
|
348
348
|
feature, each with running examples and their source, and the props tables
|
|
349
349
|
generated from `src/` where a page documents a type, each prop linked to the
|
|
350
|
-
examples that show it.
|
|
351
|
-
across all
|
|
350
|
+
examples that show it. Every export is listed in [API.md](https://github.com/romanhaendler/umriss-ui/blob/main/packages/table/API.md), one search finds
|
|
351
|
+
across all seven packages, and the header switches the examples to German.
|
|
352
352
|
* [`CHANGELOG.md`](CHANGELOG.md) — what changes for a caller.
|
|
353
353
|
* **For a coding agent**: `docs/llms-full.md` inside the installed package —
|
|
354
354
|
the demo as one Markdown file, pinned to the installed version: every page
|
|
355
355
|
with its examples' source, its props tables and why it is built as it is,
|
|
356
356
|
and an index of every export with its comment and its declaration. The running documentation of a version is opened as [the repository README describes](https://github.com/romanhaendler/umriss-ui#see-it-running): check out the tag `<package>-v<version>`, then `pnpm start`.
|
|
357
357
|
* [`../../docs/design-language.md`](https://github.com/romanhaendler/umriss-ui/blob/main/docs/design-language.md) — the design
|
|
358
|
-
language all
|
|
358
|
+
language all seven packages share.
|
|
359
359
|
* [`../core/README.md`](https://github.com/romanhaendler/umriss-ui/blob/main/packages/core/README.md) — the component library underneath.
|
|
360
360
|
|
|
361
361
|
## Testing
|
package/dist/index.d.ts
CHANGED
|
@@ -182,6 +182,11 @@ export declare interface ColumnBase {
|
|
|
182
182
|
/** Right-aligned with tabular figures.
|
|
183
183
|
@default decided by the first value present */
|
|
184
184
|
numeric?: boolean;
|
|
185
|
+
/** The side the whole column stands on - label with its tools, values, footer,
|
|
186
|
+
aggregates and loading rows: flush at the start, centred, or flush at the end.
|
|
187
|
+
It decides the side alone; `numeric` keeps deciding the figures.
|
|
188
|
+
@default `"end"` for a numeric column, otherwise `"start"` */
|
|
189
|
+
align?: "start" | "center" | "end";
|
|
185
190
|
/** Initial width in pixels.
|
|
186
191
|
@default the browser's */
|
|
187
192
|
width?: number;
|
|
@@ -192,7 +197,8 @@ export declare interface ColumnBase {
|
|
|
192
197
|
flex?: number;
|
|
193
198
|
/** The least width of a column with `flex`, in pixels. */
|
|
194
199
|
minWidth?: number;
|
|
195
|
-
/** Shows the drag grip on the header cell.
|
|
200
|
+
/** Shows the drag grip on the header cell.
|
|
201
|
+
@default false */
|
|
196
202
|
resizable?: boolean;
|
|
197
203
|
/** Keeps the column in view while the table scrolls sideways: in a block
|
|
198
204
|
before every other column, or after them. The user can change it in the
|
|
@@ -1134,7 +1140,7 @@ export declare type TableRequest<K extends string = string> = Required<Pick<Tabl
|
|
|
1134
1140
|
/** What `useTableSelection` returns: the selected keys and the gestures on
|
|
1135
1141
|
them. Give it to `useTable` as `selection` when the application holds the
|
|
1136
1142
|
selection. */
|
|
1137
|
-
export declare interface TableSelection<T extends
|
|
1143
|
+
export declare interface TableSelection<T extends RowKey> {
|
|
1138
1144
|
/** The keys currently selected. */
|
|
1139
1145
|
selected: ReadonlySet<T>;
|
|
1140
1146
|
isSelected: (id: T) => boolean;
|
|
@@ -1286,12 +1292,15 @@ export declare interface TableSnapshot<Z, Key extends RowKey = string> {
|
|
|
1286
1292
|
}
|
|
1287
1293
|
|
|
1288
1294
|
/** Search, conditions, sort levels, page, page size, hidden columns, order,
|
|
1289
|
-
dragged widths, the grouping
|
|
1295
|
+
dragged widths, the grouping, the pinned columns, the folded groups and the
|
|
1296
|
+
open branches. Whatever is at its
|
|
1290
1297
|
default is absent. The pre-filter never belongs to it: it is a function of
|
|
1291
1298
|
the application. */
|
|
1292
1299
|
export declare interface TableView<K extends string = string> {
|
|
1293
1300
|
search?: string;
|
|
1294
|
-
/** The conditions of the column filters
|
|
1301
|
+
/** The conditions of the column filters and of the row filters, by column id
|
|
1302
|
+
or filter id: a `ListCondition`, a `RangeCondition` or a `TextCondition` for
|
|
1303
|
+
a column, whatever a filter of one's own defines. A condition for an id
|
|
1295
1304
|
that does not exist, or whose filter is of another kind, falls out. */
|
|
1296
1305
|
conditions?: Readonly<Record<string, unknown>>;
|
|
1297
1306
|
sort?: readonly SortLevel<K>[];
|
|
@@ -1306,7 +1315,7 @@ export declare interface TableView<K extends string = string> {
|
|
|
1306
1315
|
/** The paths of the folded groups. A path that no longer occurs falls out. */
|
|
1307
1316
|
folded?: readonly string[];
|
|
1308
1317
|
/** Tree rows: the keys of the open branches. A key that no longer occurs falls out. */
|
|
1309
|
-
branches?: readonly
|
|
1318
|
+
branches?: readonly RowKey[];
|
|
1310
1319
|
/** The pinned columns, whole, once the user's choice deviates from what the
|
|
1311
1320
|
columns declare - `{}` when every declared pin was undone. A column that
|
|
1312
1321
|
does not exist falls out. */
|
|
@@ -1396,7 +1405,7 @@ export declare function useTable<Z, Key extends RowKey = string>(rows: readonly
|
|
|
1396
1405
|
* and supplies the states for "select all" (including indeterminate).
|
|
1397
1406
|
* What the selection means in the domain stays the application's business.
|
|
1398
1407
|
*/
|
|
1399
|
-
export declare function useTableSelection<T extends
|
|
1408
|
+
export declare function useTableSelection<T extends RowKey>(ids: readonly T[]): TableSelection<T>;
|
|
1400
1409
|
|
|
1401
1410
|
/** How a value that does not sort or export itself does so after all. */
|
|
1402
1411
|
export declare interface ValuePaths<W> {
|
|
@@ -1411,9 +1420,7 @@ export declare interface ValuePaths<W> {
|
|
|
1411
1420
|
|
|
1412
1421
|
/** What every verdict column takes, whether its value is a field or a
|
|
1413
1422
|
function. */
|
|
1414
|
-
export declare interface VerdictBase {
|
|
1415
|
-
/** Names the column in its header, in the column menu and in the header row of the export. */
|
|
1416
|
-
label: string;
|
|
1423
|
+
export declare interface VerdictBase extends Pick<ColumnBase, "label" | "width" | "flex" | "minWidth" | "resizable" | "pin"> {
|
|
1417
1424
|
/** The limit set every value is read against. */
|
|
1418
1425
|
limits: LimitSet;
|
|
1419
1426
|
/** How the value and its excess are written. */
|
|
@@ -1422,20 +1429,9 @@ export declare interface VerdictBase {
|
|
|
1422
1429
|
weight the existing order stays) – or by the value.
|
|
1423
1430
|
@default "verdict" */
|
|
1424
1431
|
sortBy?: "verdict" | "value";
|
|
1425
|
-
/**
|
|
1426
|
-
@default
|
|
1427
|
-
|
|
1428
|
-
/** A share of the width the other columns leave, so that the table fills its
|
|
1429
|
-
frame: two columns with `flex={1}` split it equally. A width, declared or
|
|
1430
|
-
dragged by hand, ends the flex of that column.
|
|
1431
|
-
@default none: the column is as wide as its content */
|
|
1432
|
-
flex?: number;
|
|
1433
|
-
/** The least width of a column with `flex`, in pixels. */
|
|
1434
|
-
minWidth?: number;
|
|
1435
|
-
/** Shows the drag grip on the header cell. */
|
|
1436
|
-
resizable?: boolean;
|
|
1437
|
-
/** Keeps the column in view while the table scrolls sideways, before or after every other column. */
|
|
1438
|
-
pin?: Pin;
|
|
1432
|
+
/** The side the whole column stands on: flush at the start, centred, or flush at the end.
|
|
1433
|
+
@default "end" */
|
|
1434
|
+
align?: "start" | "center" | "end";
|
|
1439
1435
|
/** A verdict column has no list filter: four verdicts are filtered through the sort. */
|
|
1440
1436
|
filter?: never;
|
|
1441
1437
|
/** `"worst"`: the worst verdict among the rows – in the footer and in a
|