Cells
BadgeCell, DateCell, ExpanderCell, getExpanderColumn and 5 more: generated from the source of active-grid.
Exported by @workspace/. Generated from the package source; part of the index of every export.
Badge Cell#
Props
- Type
CategoricalCell Value
The categorical value: a string, number or boolean, exactly as broad as what body- passes through.
label is looked up on the text key (String(value)), so a boolean column keys on 'true' / 'false' -- the same shape meta. and meta. already use.
- Type
string
- Type
Record<string, string>
Takes only the props listed.
Date Cell#
Props
- Type
stringnumberDatenullundefined
- Type
string
- Type
Locale
date-fns locale object. Omitted? Then the cell follows the language of the grid itself (locale/calendar on <Active), just like the date filter in the column header.
- Type
DatePreset
The preset name, or nothing to inherit the ordinary human date form of the grid's presentation. Without a resolved form the platform fallback SHORT_ applies.
A preset, never a free date-fns pattern. The default is the same resolved form format uses, so the date column type and this cell cannot render one semantics in two forms.
- Type
"date-only" "datetime"
What the value means, and therefore how it is read.
'date-(default): a calendar fact -- date of birth, start date, contract, policy or pension date. The cell shows the same day in every time zone.only' 'datetime': a moment --created, an audit or execution moment. The cell shows that in the zone of the reader, because that is what a moment is supposed to do.At
Date-only is the default because that is what this cell gets in practice: body- renders it for columns with meta., and a column that really shows a moment goes through the date preset, which brings its own value and therefore never reaches this cell.
Never read a date-only value with new Date(value): an ISO date-only string is UTC midnight, and west of UTC it formats as the previous day.
Takes only the props listed.
Expander Cell#
Generic over TData; the props below name it.
Props
- Type
Row<TData>
Takes only the props listed.
Link Cell#
Props
- Type
string(value) => string
- Type
string | null | undefined
The link text, and at the same time the argument of an href function.
Stays string: a link carries text. The guard below is however the same as in Badge, so that a cast-in 0 does not silently remove a cell.
- Type
string
- Type
boolean
Takes only the props listed.
Selection Cell#
Props
Events
Called by the component when something happens.
- Type
(checked: boolean) => void
Takes only the props listed.
Status Cell#
Props
- Type
GridStatus Tone
The generic UI tone. Mandatory: a status cell without a tone is a categorical badge, and Badge exists for that.
The mapping from domain value to tone belongs to the caller — in the column configuration through meta., or here at the call site when the cell value is not a stable key (a derived or translated value).
- Type
string | null | undefined
The already resolved status label.
Deliberately `string` and not broader. The key of a status column is String(value), and the mapping key → tone lives in meta.; body- resolves that pair together and passes the outcome on here. Widening this type would invite a call site to pass a raw domain value, and thereby put a second key derivation next to the existing one.
The emptiness guard below is nevertheless the same as in Badge, as defence in depth: a call site that does push a false or 0 through a cast does not lose a cell by it.
- Type
string
- Type
Record<string, string>
Takes only the props listed.
Text Cell#
Props
- Type
string | number | null | undefined
- Type
string
- Type
GridText Kind
What the text is, for the bidi policy: free text (text, the default) takes its direction from its first strong character, a formatted value (value) and the grid's own words (ui) inherit.
- Type
GridText Direction
The column's declared meta.; wins for text and value.
- Type
boolean
Takes only the props listed.
Functions, hooks and constants#
- Type
<TData>() => GridDisplay Column Def<TData>
- Type
<TData>() => GridDisplay Column Def<TData>