ResourceBoard
A view's rows as a board. Prefer `<ResourceView view={v} mode="board" />`, which passes the scope and the screen's filters.
packages/ui/src/components/data/resource-view/ResourceBoard.tsx
Import
Subpath export:
@marktiderman/genesis-ui/dataimport { ResourceBoard } from "@marktiderman/genesis-ui/data";Components
Auto-generated from TypeScript source via
react-docgen-typescript.ResourceBoard
A view's rows as a board. Prefer `<ResourceView view={v} mode="board" />`, which passes the scope and the screen's filters.
| Prop | Type | Default | Description |
|---|---|---|---|
| view* | ResourceView<ResourceContract<any>, T & DataRow> | — | |
| can | ((action: ResourceAction, item?: T) => boolean) | — | The screen's own guard (ResourceView's `can`): it only narrows the view's. A card moves only when both allow `edit` for its row. |
| cardFields | readonly string[] | — | The fields a card shows under its title, in order. Default none: the title alone. |
| cells | Partial<Record<string, (row: T) => ReactNode>> | — | Draw some card and peek fields the screen's own way, by key (ResourceView's `cells`). |
| className | string | — | |
| columns | readonly string[] | — | The columns, in order, as values of `field`. Default: its choices in the contract's order, then a "No value" column when it can be empty. Listing them shows only those. |
| enabled | boolean | — | False while the screen waits (on its scope, say): nothing is fetched. Default true. |
| field | string | — | The field whose value is a card's column: a field with choices (an enum) or a yes/no one. |
| filters | readonly FilterParam[] | — | Server filters (the view's scope and the screen's), already as params. |
| limits | Readonly<Record<string, number>> | — | The most cards a column should hold, by value (`{ doing: 3 }`): a work-in-progress limit. A column over its limit says so; nothing stops a move into it. |
| live | boolean | LiveOptions | — | |
| onMoveError | ((error: unknown, row: T) => void) | — | A move was refused (a guard, the server, a conflict with someone else's edit). The card is already back where it was. Default: the reason shows above the board. |
| onNavigate | NavigateFn | — | With `open="page"`: how to go to the record's page. Default a full-page navigation. |
| onSelect | ((row: T) => void) | — | A card was chosen. Default: the view's peek. |
| open | enum | — | How a card opens (ADR 0021): `side-peek`, `center-peek` or `page` (navigates to `/{resource}/{id}` through `onNavigate`), or `none`. Default the view's `open`, else a side peek. |
| perPage | number | — | Cards per column page. Default 50. |
| recordView | RecordView<ResourceContract<any>, any> | — | The record view a peek draws. Default the view's `recordView`, else the view's columns. |
| renderCard | ((row: T) => ReactNode) | — | Draw a card this screen's way. Default: the row's title and the board's `cardFields`. |
| resourceOptions | Pick<UseResourceOptions<T & BaseRecord>, "invalidates" | "onError" | "onUpdateSuccess"> | — | The list's write options (ResourceView's `resourceOptions`): `invalidates`, `onError` and `onUpdateSuccess` apply to a move. A move is always pessimistic, so `mutationMode` is ignored. |
| select | string | — | |
| subtitle | string | — | |
| testID | string | — | |
| title | string | — |