Everything @umriss-ui/table exports, with its signature. A component's props stand on its own page.
ColumnMenuColumnMenu – 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.
Used on Scenarios, Provider, Column, Width and pinning, Search, Grouping, Tree rows, Toolbar, Toolbar controls, ColumnMenu, View and Server mode.
ExportExport – 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.
Used on Scenarios, Provider, Sorting, Search, Grouping, Toolbar, Toolbar controls, Export and Server mode.
PaginationPagination – 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.
Used on Scenarios, First table, Filter, Pre-filter, Grouping, Toolbar, Toolbar controls, Pagination, Benchmark and Server mode.
SearchSearch – 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.
Used on Scenarios, First table, Provider, Formats, Sorting, Search, Filter, Pre-filter, Grouping, Tree rows, Aggregate, Selection, Row appearance, RowDetail, Toolbar, Toolbar controls, Export, View, Pagination, Virtualisation, Benchmark, Server mode, Grid mode and Edits.
ToolbarToolbar – 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).
Used on Scenarios, First table, Provider, Column, Width and pinning, Sorting, Search, Filter, Pre-filter, Grouping, Tree rows, Aggregate, Selection, Row appearance, RowDetail, RowActions, Toolbar, Toolbar controls, ColumnMenu, Export, View, Pagination, Virtualisation, Benchmark, Server mode and Edits.
useTableA table over your rows: the hook holds its state - sort, filters, search,
grouping, page, selection, column widths -, and the parts it returns are
typed at your row, so that a field name in Column is checked by the
compiler.
rows – All rows in automatic mode; in server mode the page a server delivered for the current view.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.Table, Column,
VerdictColumn, RowDetail, RowActions, Action and GroupBy. Pass it
as of to a part that stands outside the table.function useTable<Z>(rows: readonly Z[], options: TableOptions<Z>): Table<Z>;Used on Scenarios, Installation, First table, Provider, Column, Formats, Width and pinning, Presets, Sorting, Search, Filter, Pre-filter, Grouping, Tree rows, Aggregate, Selection, Row appearance, RowDetail, RowActions, Toolbar, Toolbar controls, ColumnMenu, Export, View, Pagination, Virtualisation, Benchmark, Server mode, Grid mode, Edits and VerdictColumn.
useTableSelectionA small headless helper for row selection: it holds the selection as a set and supplies the states for "select all" (including indeterminate). What the selection means in the domain stays the application's business.
function useTableSelection<T extends string | number>(ids: readonly T[]): TableSelection<T>;Used on Selection.
columnA column preset that fits every table whose rows carry its field: create it
once, outside the component, and spread it into a Column. With more than
one field in P, name the field as the second type argument.
function column<P, K extends Field<P> = Field<P>>(preset: ColumnPreset<P, K>): ColumnPreset<P, K>;Used on Scenarios, First table, Formats, Width and pinning, Presets, Sorting, Filter, Grouping, Tree rows, View, Virtualisation, Benchmark, Server mode, Grid mode and VerdictColumn.
columnFilterA filter for columns with values of type W and conditions of type B.
The compiler accepts it at every column whose value fits, and rejects it
otherwise. Create it outside the component, like a preset.
function columnFilter<W, B>(definition: ColumnFilter<W, B>): ColumnFilter<W, B>;Used on Filter.
rowFilterA filter over the rows of type Z with conditions of type B. Create it
outside the component, like a column filter, and name it in rowFilters.
function rowFilter<Z, B>(definition: RowFilter<Z, B>): RowFilter<Z, B>;Used on Filter and Toolbar controls.
AbsentA value that is not there: null or undefined.
type Absent = null | undefined;Used on Column.
ActionPropsIts table stands on RowActions.
AggregateColumn<Z>A column that carries an aggregate, as the pipeline needs it.
| Name | Type | Default | Description |
|---|---|---|---|
idrequired | string | — | |
readrequired | (row: Z) => unknown | — | |
aggregaterequired | AggregateKind | OwnAggregate<Z> | — |
AggregateFor<W, Z>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.
type AggregateFor<W, Z> =
| ([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<W, Z>;AggregateFunction<W, Z>An aggregate of one's own: the values present and the rows of the group -
or of the filtered set, in the footer. Its result runs through the column's
presentation; undefined means there is none.
type AggregateFunction<W, Z> = (values: readonly Present<NoInfer<W>>[], rows: readonly Z[]) => Present<NoInfer<W>> | undefined;AggregateKindThe built-in aggregates. range is for points in time: the earliest and
the latest.
type AggregateKind = "sum" | "avg" | "min" | "max" | "range" | "count" | "distinct";AggregateOptionsIts table stands on Aggregate.
CellEdit<Z>An edit the user committed - reported, not applied.
| Name | Type | Default | Description |
|---|---|---|---|
rowKeyrequired | string | — | Shown in: Combine grid mode with groups, pinning and many rows (Grid mode), Edit a comments column (Edits), Check an edit before it is reported (Edits) and 1 more |
columnIdrequired | string | — | Shown in: Combine grid mode with groups, pinning and many rows (Grid mode), Check an edit before it is reported (Edits), Plan the team's capacity (Scenarios) |
valuerequired | unknown | — | The editor's value: text for "text", a number or null for
"number", a day or null for "date", an option for "select".Shown in: Combine grid mode with groups, pinning and many rows (Grid mode), Edit a comments column (Edits), Check an edit before it is reported (Edits) and 1 more |
rowrequired | Z | — | Shown in: Check an edit before it is reported (Edits), Plan the team's capacity (Scenarios) |
Used on Edits.
CellEditorProps<W, Z>What an editor of one's own receives. The table holds the draft; Enter, Escape and Tab stay the table's, bubbling up from the field.
| Name | Type | Default | Description |
|---|---|---|---|
valuerequired | W | null | — | The draft - the cell's value until the field changes it. |
commitrequired | (value?: W | null) => void | — | Commits - the draft, or the value given. A picker commits on its pick. |
rowrequired | Z | — | |
invalidrequired | boolean | — | The draft did not validate: the field shows it; the message stands beneath. |
labelrequired | string | — | The field's name: what is edited, for which row. The FormField around
the editor already names a core field by it. |
| Name | Type | Default | Description |
|---|---|---|---|
onChangerequired | (value: W | null) => void | — | Changes the draft. |
ColumnBaseIts table stands on Column.
ColumnComponent<Z>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. What it accepts as
aggregate, filter, format and edit follows from the type of its
value.
interface ColumnComponent<Z> {
<W extends number | Absent>(
props: Computed<Z, W> & { footer: "sum" | "avg"; aggregate?: never; format?: NumberFormat; children?: Presentation<W, Z>; share?: boolean },
): ReactNode;
<W extends number | Absent>(
props: Computed<Z, W> & {
aggregate: "sum" | "avg" | "min" | "max" | "count" | "distinct";
footer?: never;
share?: boolean;
format?: NumberFormat;
children?: Presentation<W, Z>;
},
): ReactNode;
<W extends Date | Absent>(
props: Computed<Z, W> & {
aggregate: "min" | "max" | "range" | "count" | "distinct";
footer?: never;
format?: DateFormat;
group?: DatePeriod;
children?: Presentation<W, Z>;
},
): ReactNode;
<W extends Date | Absent>(
props: Computed<Z, W> & {
group: DatePeriod;
aggregate?: "min" | "max" | "range" | "count" | "distinct";
footer?: never;
format?: DateFormat;
children?: Presentation<W, Z>;
},
): ReactNode;
<W extends number | Absent>(
props: Computed<Z, W> & { format: NumberFormat; aggregate?: AggregateFunction<W, Z>; share?: boolean; children?: Presentation<W, Z> },
): ReactNode;
<W extends Date | Absent>(
props: Computed<Z, W> & { format: DateFormat; group?: DatePeriod; aggregate?: AggregateFunction<W, Z>; children?: Presentation<W, Z> },
): ReactNode;
<W>(
props: Computed<Z, W> & {
footer?: never;
format?: never;
aggregate?: AggregateFunction<W, Z>;
children: Presentation<W, Z>;
},
): ReactNode;
<W extends Displayable | Absent>(
props: Computed<Z, W> & { footer?: never; format?: never; aggregate?: "count" | "distinct" | AggregateFunction<W, Z>; children?: never },
): ReactNode;
<K extends Field<Z>>(props: FieldColumn<Z, K>): ReactNode;
}ColumnFilterIts table stands on Filter.
ColumnMenuPropsIts table stands on ColumnMenu.
ColumnPreset<P, K extends Field<P> = Field<P>>The properties of a column, as column() supplies them.
type ColumnPreset<P, K extends Field<P> = Field<P>> = FieldColumn<P, K>;Computed<Z, W>A computed column's props: its value is a function of the row, so it needs
an id.
type Computed<Z, W> = ColumnBase &
ValuePaths<W> & {
/** The id is required where the value is a function. */
id: string;
value: (row: Z) => W;
/* The two names stand here without a condition on the value type, unlike on
a field column: the value of a computed column is derived from `value`,
and a condition over this W is not yet resolved when the overload is
chosen - `filter="range"` would then leave the whole column untyped. A
filter of one's own is still checked against the value. */
/** A filter in the column header: `"list"` offers the values that occur,
`"range"` two bounds (meaningful only for numbers and points in time), a
filter from `columnFilter` asks whatever it asks itself. */
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the condition belongs to the filter
filter?: "list" | "range" | ColumnFilter<Present<W>, any>;
/** Edits the column's cells in place in grid mode - see a field column's `edit`. */
edit?: "text" | "number" | "select" | "date" | ((editor: CellEditorProps<W, Z>) => ReactNode);
/** What `edit="select"` offers.
@default the values that occur */
editOptions?: readonly Present<W>[];
/** Checks a draft before it is reported; a message keeps the editor open. */
validate?: (value: W | null, row: Z) => string | null | undefined;
};DateFormatThe names of the standard presentations of a point in time.
type DateFormat = "date" | "time" | "dateTime";DatePeriodThe span a point in time is grouped by.
type DatePeriod = "day" | "week" | "month" | "year";DisplayableWhat can appear as text without children.
type Displayable = string | number | boolean | Date;EditFor<W, Z>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 - or an editor of one's own.
type EditFor<W, Z> =
| ([Present<W>] extends [string] ? "text" | "select" : never)
| ([Present<W>] extends [number] ? "number" | "select" : never)
| ([Present<W>] extends [Date] ? "date" : never)
| ((editor: CellEditorProps<W, Z>) => ReactNode);EditOptions<W, Z>The props a column carries for editing in grid mode (<Table grid>).
| Name | Type | Default | Description |
|---|---|---|---|
edit | EditFor<W, 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.Shown in: Share a column between tables (Presets), Combine grid mode with groups, pinning and many rows (Grid mode), Edit a comments column (Edits) and 6 more |
editOptions | readonly Present<W>[] | the values that occur | What edit="select" offers.Shown in: Share a column between tables (Presets), Check an edit before it is reported (Edits), Save a row on purpose (Edits) and 1 more |
validate | (value: W | 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.Shown in: Share a column between tables (Presets), Combine grid mode with groups, pinning and many rows (Grid mode), Check an edit before it is reported (Edits) and 3 more |
ExportPropsIts table stands on Export.
Field<Z>The field names of a row.
type Field<Z> = Extract<keyof Z, string>;FieldColumnIts table stands on Column.
FieldCondition<W>What can be set as a condition on a field: a list of its values, and for numbers and points in time a range as well.
type FieldCondition<W> =
| ListCondition<W>
| ([Present<W>] extends [number] ? RangeCondition<number> : [Present<W>] extends [Date] ? RangeCondition<Date> : never);FilterFor<W>What a column accepts as filter: "list" for every value with a text
form, "range" for numbers and points in time, a filter from columnFilter
only where its value type fits.
type FilterFor<W> =
| (IsDisplayable<W> extends true ? "list" : never)
| ([Present<W>] extends [number] ? "range" : [Present<W>] extends [Date] ? "range" : never)
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- the condition belongs to the filter; at the column only the value counts
| ColumnFilter<Present<W>, any>;FilterInputPropsIts table stands on Filter.
FormatFor<W>What a column accepts as format: a number format for numbers, a date
format for points in time, nothing for every other value.
type FormatFor<W> = [Present<W>] extends [number]
? NumberFormat
: [Present<W>] extends [Date]
? DateFormat
: never;GroupByBaseIts table stands on Grouping.
GroupByComponent<Z>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.
interface GroupByComponent<Z> {
<W extends string | number | boolean | Date | Absent>(
props: GroupByBase & {
/** The id is required where the value is a function. */
id: string;
value: (row: Z) => W;
groupValue?: (value: Present<W>) => string | number | boolean | Date | Absent;
group?: GroupFor<W>;
},
): ReactNode;
<K extends Field<Z>>(
props: GroupByBase & {
/** A field of the row; supplies the id at the same time. */
value: K;
id?: string;
groupValue?: (value: Present<Z[K]>) => string | number | boolean | Date | Absent;
group?: GroupFor<Z[K]>;
},
): ReactNode;
}GroupFor<W>group on a point in time: its rows are grouped by day, ISO week, month or
year.
type GroupFor<W> = [Present<W>] extends [Date] ? DatePeriod : never;GroupingId<Z>A column or group key the table can be grouped by. The columns stand in the JSX, which the hook does not see: a field name is suggested, any id is taken, and one that nothing carries falls out.
type GroupingId<Z> = Field<Z> | (string & {});GroupLevel<Z>One level of the grouping: what a row is grouped by on it.
| Name | Type | Default | Description |
|---|---|---|---|
idrequired | string | — | |
valuerequired | (row: Z) => unknown | — | The grouping value - the column's value, or what groupValue or a date
period made of it. Absent values form one group of their own. |
order | (row: Z) => unknown | — | Where the groups of a key of one's own stand: by the smallest of this over their rows. Bands of a number are named "Small", "Large" and must not stand in the alphabet's order. |
IsDisplayable<W>true where the value present can appear as text without children
(Displayable), false otherwise - what decides the filters and
aggregates a column offers.
type IsDisplayable<W> = [Present<W>] extends [never]
? false
: [Present<W>] extends [Displayable]
? true
: false;ListCondition<W>The condition of a list filter: the chosen values, an absent one as null.
type ListCondition<W> = readonly (Present<W> | null)[];ModelColumn<Z, K extends string = string>A column as the model reads it - what sorting, search, hiding and the export need of it, not its presentation.
| Name | Type | Default | Description |
|---|---|---|---|
idrequired | K | — | |
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. |
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. |
compare | (a: Z, b: Z) => number | — | A comparison of one's own; otherwise by the kind of the value. |
searchable | boolean | false | Takes part in the free-text search. |
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. |
resizable | boolean | false | May the user drag the width? A column whose content fits anyway needs no grip. |
width | number | — | Initial width in pixels; without it the browser decides. |
NumberFormatThe names of the standard presentations of a number.
type NumberFormat = "percent" | "count" | { decimals: number };OwnAggregate<Z = never>An aggregate of one's own: the values present and the group's rows.
type OwnAggregate<Z = never> = (values: readonly unknown[], rows: readonly Z[]) => unknown;Used on Aggregate.
PaginationPropsIts table stands on Pagination.
PinWhere a pinned column stands: in the block before or after the others.
type Pin = "start" | "end";Present<W>The value without the absence - that is what children gets.
type Present<W> = Exclude<W, Absent>;Presentation<W, Z>What a column draws in a cell: the value present and its row.
type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;Used on Formats.
RowActionsPropsIts table stands on RowActions.
RowAddA new row the user saved: every column that edits, by column id.
| Name | Type | Default | Description |
|---|---|---|---|
valuesrequired | Readonly<Record<string, unknown>> | — |
RowAttributesWhat a row carries in classes and data attributes.
type RowAttributes = { className?: string } & {
[data: `data-${string}`]: string | undefined;
};RowDelete<Z>A row the user asked to delete, and confirmed.
| Name | Type | Default | Description |
|---|---|---|---|
rowKeyrequired | string | — | Shown in: Keep a list: add, change and delete rows (Edits), Edit a dense table (Edits) |
rowrequired | Z | — |
RowDetailPropsIts table stands on RowDetail.
RowFilterIts table stands on Filter.
RowGroup<Z>The rows of the filtered set that share one grouping value on one level.
| Name | Type | Default | Description |
|---|---|---|---|
pathrequired | string | — | Identifies the group across renders and in the view: the keys of its path, outermost first. |
valuerequired | unknown | — | The grouping value; undefined for the group of absent values. |
levelrequired | number | — | 0 is the outermost level. |
rowsrequired | Z[] | — | |
groupsrequired | RowGroup<Z>[] | — | The groups of the next level; empty on the innermost. |
aggregatesrequired | Record<string, unknown> | — | Per column id, what its aggregate comes to over this group's rows. |
RowSave<Z>A Row draft the user saved (ADR-0036) - reported, not applied.
| Name | Type | Default | Description |
|---|---|---|---|
rowKeyrequired | string | — | Shown in: Save a row on purpose (Edits), Check a whole row before it is saved (Edits), Keep a list: add, change and delete rows (Edits) and 1 more |
changesrequired | Readonly<Record<string, unknown>> | — | The columns the draft changed, by column id, with their editors' values. Shown in: Save a row on purpose (Edits), Check a whole row before it is saved (Edits), Keep a list: add, change and delete rows (Edits) and 1 more |
rowrequired | Z | — | Shown in: Save a row on purpose (Edits) |
Used on Edits.
SearchPropsIts table stands on Search.
SetFilter<Z>Sets a condition from outside. Typed at the field of the row, not at the
column: the columns stand in the JSX, and the hook does not see that
(ADR-0017). An id that is not a field name – a computed column or an id of
one's own – takes any condition; through it the condition of a filter of
one's own is set as well.
interface SetFilter<Z> {
<B>(filter: RowFilter<Z, B>, condition: B | null): void;
<K extends Field<Z>>(column: K, condition: FieldCondition<Z[K]> | null): void;
<I extends string>(column: I & (I extends Field<Z> ? never : unknown), condition: unknown): void;
}SortDirectionThe direction of one sort level: asc puts the smallest value on top,
desc the largest.
type SortDirection = "asc" | "desc";SortLevel<K extends string = string>One level of the sort. Several levels act in their order: the second decides only what the first leaves open.
| Name | Type | Default | Description |
|---|---|---|---|
columnrequired | K | — | Shown in: Sort, arrange and export from controls of your own (First table), A label wider than its column (Width and pinning), Sort by several columns (Sorting) and 10 more |
directionrequired | SortDirection"asc" | "desc" | — | Shown in: Sort, arrange and export from controls of your own (First table), A label wider than its column (Width and pinning), Sort by several columns (Sorting) and 10 more |
Table<Z>What useTable returns: the table's state, and its parts typed at the
row. Pass it as of to a part that stands outside the table.
| Name | Type | Default | Description |
|---|---|---|---|
Tablerequired | (props: TableProps<Z>) => ReactNode | — | Shown in: A first table (Installation), Show a list of services (First table), Search and page from a header of your own (First table) and 118 more |
Columnrequired | ColumnComponent<Z> | — | Shown in: A first table (Installation), Show a list of services (First table), Search and page from a header of your own (First table) and 118 more |
VerdictColumnrequired | VerdictColumnComponent<Z> | — | Shown in: Pin columns to both sides (Width and pinning), Read a day's deliveries by depot (Grouping), Carry the worst verdict up (Aggregate) and 5 more |
RowDetailrequired | (props: RowDetailProps<Z>) => ReactNode | — | Shown in: Keep the header and the names in view (Width and pinning), Employees in the detail (Tree rows), Own staff and teams (Tree rows) and 5 more |
RowActionsrequired | (props: RowActionsProps) => ReactNode | — | Shown in: Name the row (Column), Pin columns to both sides (Width and pinning), Select a whole group (Grouping) and 7 more |
Actionrequired | (props: ActionProps<Z>) => ReactNode | — | Shown in: Name the row (Column), Pin columns to both sides (Width and pinning), Select a whole group (Grouping) and 7 more |
GroupByrequired | GroupByComponent<Z> | — | Shown in: Group by a value that is no column (Grouping), Group twenty thousand rows (Grouping), Read a day's deliveries by depot (Grouping) |
rowsrequired | readonly Z[] | — | All the rows passed in, including those the pre-filter does not admit. from TableSnapshotShown in: Search and page from a header of your own (First table) |
filteredrequired | readonly Z[] | — | The filtered set: what the pre-filter admits and search and filters leave, across all pages. from TableSnapshotShown in: Select rows (Selection), Scroll twenty thousand rows (Virtualisation) |
visiblerequired | readonly Z[] | — | What is rendered right now: the page or the window. from TableSnapshot |
pagerequired | number | — | The page shown, from 1. Without Pagination always 1. from TableSnapshotShown in: Search and page from a header of your own (First table) |
pageCountrequired | number | — | How many pages the filtered set makes. from TableSnapshotShown in: Search and page from a header of your own (First table) |
pageSizerequired | number | — | Rows per page. from TableSnapshotShown in: Search and page from a header of your own (First table) |
setPagerequired | (page: number) => void | — | Changes the page, clamped to those that exist. from TableSnapshotShown in: Search and page from a header of your own (First table) |
setPageSizerequired | (size: number) => void | — | Sets the rows per page; back to page one. from TableSnapshotShown in: Search and page from a header of your own (First table) |
searchrequired | string | — | The search text. from TableSnapshotShown in: Search and page from a header of your own (First table) |
setSearchrequired | (search: string) => void | — | Sets the search text; back to page one. from TableSnapshotShown in: Search and page from a header of your own (First table) |
sortrequired | readonly SortLevel[] | — | The sort levels, the first one first – only over columns that registered. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
toggleSortrequired | (column: string, additive?: boolean) => void | — | Sorts by a column. With additive a level is added instead of replacing the sort. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
toggleColumnrequired | (column: string) => void | — | Hides a column or shows it again. The row header stays. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
orderrequired | readonly string[] | — | The order of the columns as ids, as the user chose it. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
setOrderrequired | (order: readonly string[]) => void | — | Reorders the columns – on header, body and footer at once. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
pinnedrequired | Readonly<Record<string, Pin>> | — | The pinned columns by id - the declared ones until the user chooses. from TableSnapshotShown in: Pin and size from controls of your own (Width and pinning) |
setPinrequired | (column: string, pin: Pin | null) => void | — | Pins a column to the start or the end, or unpins it with null. from TableSnapshotShown in: Pin and size from controls of your own (Width and pinning) |
widthsrequired | Readonly<Record<string, number>> | — | The widths in pixels: those of the columns, and over them the dragged ones. from TableSnapshotShown in: Pin and size from controls of your own (Width and pinning) |
setWidthrequired | (column: string, width: number | undefined) => void | — | Sets the width of a column; undefined takes it back. from TableSnapshotShown in: Pin and size from controls of your own (Width and pinning) |
expandedrequired | readonly string[] | — | The keys of the expanded rows. from TableSnapshot |
toggleRowrequired | (key: string) => void | — | Expands a row or collapses it. from TableSnapshot |
filterrequired | 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 |
setFilterrequired | 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 TableSnapshotShown in: Set a condition from outside the table (Filter), Filter by a field no column shows (Filter), Rows from a request (Filter) and 5 more |
conditionOfrequired | <B>(filter: RowFilter<Z, B>) => B | null | — | The condition of a row filter, as its type - null while it is lifted. from TableSnapshotShown in: Filter by a field no column shows (Filter), Rows from a request (Filter), Ask a question over several fields (Filter) and 3 more |
selectionrequired | TableSelection<string> | — | The selection – its own or the one handed in through selection. from TableSnapshotShown in: Select rows (Selection), Copy the selection (Export), Scroll twenty thousand rows (Virtualisation) and 3 more |
groupingrequired | 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 TableSnapshotShown in: Group and fold from controls of your own (Grouping) |
setGroupingrequired | (grouping: readonly string[]) => void | — | Groups by these columns or group keys; [] ungroups. Back to page one. from TableSnapshotShown in: Group and fold from controls of your own (Grouping) |
setViewrequired | (view: 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 TableSnapshotShown in: Keep and restore a view (View) |
foldedrequired | readonly string[] | — | The paths of the folded groups that still occur. from TableSnapshotShown in: Group and fold from controls of your own (Grouping) |
toggleFoldrequired | (path: string) => void | — | Folds a group or unfolds it. A group of one row does not fold. from TableSnapshotShown in: Group and fold from controls of your own (Grouping) |
foldAllrequired | () => void | — | Folds every group that has more than one row. from TableSnapshotShown in: Fold groups into a summary (Grouping) |
unfoldAllrequired | () => void | — | Unfolds every group. from TableSnapshotShown in: Fold groups into a summary (Grouping) |
branchesrequired | readonly string[] | — | Tree rows: the keys of the open branches. from TableSnapshotShown in: Open branches from controls of your own (Tree rows) |
toggleBranchrequired | (key: string) => void | — | Tree rows: opens a branch or closes it. from TableSnapshotShown in: Open branches from controls of your own (Tree rows) |
unfoldAllBranchesrequired | () => void | — | Tree rows: opens every branch that has children. from TableSnapshotShown in: Open branches from controls of your own (Tree rows) |
foldAllBranchesrequired | () => void | — | Tree rows: closes every branch. from TableSnapshotShown in: Open branches from controls of your own (Tree rows) |
viewrequired | TableView | — | The part of the state an application can keep; whatever still stands as
the options set it up is absent. from TableSnapshotShown in: Set a condition from outside the table (Filter), Fold groups into a summary (Grouping), Keep and restore a view (View) |
asCsvrequired | () => string | — | The filtered set in the visible columns as text for a spreadsheet - in
server mode the page. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
selectionAsTextrequired | () => 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 TableSnapshotShown in: Copy the selection (Export) |
virtualrequired | boolean | — | Whether it virtualises. from TableSnapshotShown in: Search and page from a header of your own (First table) |
rowCountrequired | number | — | How many rows the filtered set has - in server mode the server's count. from TableSnapshotShown in: Search and page from a header of your own (First table) |
serverrequired | boolean | — | Whether it is in server mode: the rows are one page of a server's. from TableSnapshotShown in: Sort, arrange and export from controls of your own (First table) |
Used on Scenarios, Installation, First table, Provider, Column, Formats, Width and pinning, Presets, Sorting, Search, Filter, Pre-filter, Grouping, Tree rows, Aggregate, Selection, Row appearance, RowDetail, RowActions, Toolbar, Toolbar controls, ColumnMenu, Export, View, Pagination, Virtualisation, Benchmark, Server mode, Grid mode, Edits and VerdictColumn.
TableInput<Z = unknown, K extends string = string>The view's state the model computes a table from, beside its rows and columns: search, filter, sort, page, hidden columns, order, grouping, tree.
| Name | Type | Default | Description |
|---|---|---|---|
search | string | — | |
filter | (row: Z) => boolean | — | An additional filter beside the free-text search, e.g. a status choice. |
sort | | SortLevel<K> | — | One level or several. A single level means the same as a list holding only it. |
page | number | — | 1-based; is clamped to the valid range. |
pageSize | number | — | |
order | readonly K[] | — | The wanted column order. Columns not named follow in their natural order; unknown ids are passed over. |
grouping | { levels: readonly GroupLevel<Z>[]; aggregates?: readonly 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. |
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. |
tree | 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. |
TableOptionsIts table stands on First table.
TablePropsIts table stands on First table.
TableRefWhat a part without a row type needs from a table – for of.
type TableRef = Omit<TableSnapshot<unknown>, "setFilter" | "conditionOf"> & {
readonly Table: unknown;
/** Without a row kind: any id, any condition. */
setFilter(column: string, condition: unknown): void;
};Used on First table.
TableRequest<K extends string = string>The request server mode reports to onRequest: the parts of the view that
decide the rows - search, conditions, sort, page and page size - and
nothing else, each at its default as well. A server has no default of the
table's to fall back on, and a request it has to complete is one it
completes wrongly. A width, an order, a pin or a fold is no part of it.
type TableRequest<K extends string = string> = Required<Pick<TableView<K>, "search" | "conditions" | "sort" | "page" | "pageSize">>;Used on Server mode.
TableSelection<T extends string | number>What useTableSelection returns: the selected keys and the gestures on
them. Give it to useTable as selection when the application holds the
selection.
| Name | Type | Default | Description |
|---|---|---|---|
selectedrequired | ReadonlySet<T> | — | The keys currently selected. Shown in: Work through the alerts (Scenarios) |
isSelectedrequired | (id: T) => boolean | — | Shown in: Select rows (Selection), Hold the selection yourself (Selection) |
togglerequired | (id: T) => void | — | Shown in: Hold the selection yourself (Selection) |
toggleAllrequired | () => void | — | Selects all the keys passed in - or, when all of them are selected already, deselects them. Keys outside them stay as they are. |
clearrequired | () => void | — | Shown in: Hold the selection yourself (Selection), Work through the alerts (Scenarios), Find a late shipment (Scenarios) |
allSelectedrequired | boolean | — | true when every key passed in is selected. |
someSelectedrequired | boolean | — | true when some - but not all - are selected. |
countrequired | number | — | Shown in: Select rows (Selection), Hold the selection yourself (Selection), Copy the selection (Export) and 2 more |
TableSnapshotIts table stands on First table.
TableView<K extends string = string>Search, conditions, sort levels, page, page size, hidden columns, order, dragged widths, the grouping and the pinned columns. Whatever is at its default is absent. The pre-filter never belongs to it: it is a function of the application.
| Name | Type | Default | Description |
|---|---|---|---|
search | string | — | Shown in: Show loading, empty, failed and no match (Row appearance), Hand the table one page (Server mode), Sort and search on the server (Server mode) and 3 more |
conditions | Readonly<Record<string, unknown>> | — | The conditions of the column filters, per column. A condition for a column
that does not exist, or whose filter is of another kind, falls out. Shown in: Ask a question over several fields (Filter), A dispatcher's bar (Toolbar controls), Hand the table one page (Server mode) and 4 more |
sort | readonly SortLevel<K>[] | — | Shown in: Keep and restore a view (View), Hand the table one page (Server mode), Sort and search on the server (Server mode) and 3 more |
page | number | — | Shown in: Hand the table one page (Server mode), Sort and search on the server (Server mode), Name the values a list filter offers (Server mode) and 2 more |
pageSize | number | — | Shown in: Hand the table one page (Server mode), Sort and search on the server (Server mode), Name the values a list filter offers (Server mode) and 2 more |
order | readonly K[] | — | |
widths | Readonly<Record<string, number>> | — | Column widths the user has dragged, in pixels. |
grouping | readonly K[] | — | The columns and group keys the table is grouped by, the outermost first. |
folded | readonly string[] | — | The paths of the folded groups. A path that no longer occurs falls out. Shown in: Fold groups into a summary (Grouping) |
branches | readonly string[] | — | Tree rows: the keys of the open branches. A key that no longer occurs falls out. |
pinned | Readonly<Record<string, Pin>> | — | The pinned columns, whole, once the user's choice deviates from what the
columns declare - {} when every declared pin was undone. A column that
does not exist falls out. |
Used on View.
ToolbarPropsIts table stands on Toolbar.
ToolbarSizeThe size of a toolbar's controls.
type ToolbarSize = "sm" | "md";TreeInput<Z>Tree rows for the model: how a row is keyed, how its children are read, and which branches are open.
| Name | Type | Default | Description |
|---|---|---|---|
keyrequired | (row: Z) => string | — | |
childrenrequired | (row: Z) => readonly Z[] | undefined | — | undefined a leaf, an array a branch - the rule of core's reader. |
openrequired | ReadonlySet<string> | — | The keys of the open branches. |
admit | (row: Z) => boolean | — | The pre-filter: a row it does not admit is gone with its subtree. |
ValuePathsIts table stands on Column.
VerdictBaseIts table stands on VerdictColumn.
VerdictColumnComponent<Z>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.
interface VerdictColumnComponent<Z> {
(props: VerdictBase & { id: string; value: (row: Z) => number | Absent }): ReactNode;
<K extends NumberField<Z>>(props: VerdictBase & { value: K; id?: string }): ReactNode;
}