List cells rendered by display role (ADR-040).
cell turns one value into the content of its list cell according to the
field's role; cell-class is the class every cell of that role carries, so
the stylesheet styles roles, never fields. What a cell needs beyond the
value — a relation's title, a has-many count, the time — arrives in the
overview the shell computed for the page. Pure Hiccup.
List cells rendered by display role (ADR-040). `cell` turns one value into the content of its list cell according to the field's role; `cell-class` is the class every cell of that role carries, so the stylesheet styles roles, never fields. What a cell needs beyond the value — a relation's title, a has-many count, the time — arrives in the overview the shell computed for the page. Pure Hiccup.
(cell field
record
{:keys [role field-config entity-config display href relation]})The content of field's list cell for record.
ctx:
:role the field's display role
:field-config its config (may be nil for a has-many column)
:entity-config the entity's config
:display zone, locale, patterns and the :overview ({:titles :counts
:links :now}) from the shell (ADR-040)
:href the record's detail URL, when the user may open it
:relation the column's belongs-to or has-many
Nil renders as nothing in every role but :count, which is 0.
The content of `field`'s list cell for `record`.
ctx:
:role the field's display role
:field-config its config (may be nil for a has-many column)
:entity-config the entity's config
:display zone, locale, patterns and the `:overview` ({:titles :counts
:links :now}) from the shell (ADR-040)
:href the record's detail URL, when the user may open it
:relation the column's belongs-to or has-many
Nil renders as nothing in every role but :count, which is 0.(cell-class role)The class of a cell with role: c-money, c-relation, …
The class of a cell with `role`: `c-money`, `c-relation`, …
(columns entity-config fields)fields as list columns: {:field :config :role :class :label :relation :data?}.
:data? is a column of the table, not a computed one: only those sort,
filter and edit. The role comes with the config, or is derived now for a
config built without it.
`fields` as list columns: {:field :config :role :class :label :relation :data?}.
`:data?` is a column of the table, not a computed one: only those sort,
filter and edit. The role comes with the config, or is derived now for a
config built without it.(currency field-config entity-config)The ISO currency of a money field: its :currency, else the admin's
[:ui :currency], else EUR.
The ISO currency of a money field: its `:currency`, else the admin's `[:ui :currency]`, else EUR.
(enum-label field-config value)The label :options gives value, else the value humanized.
The label `:options` gives `value`, else the value humanized.
(enum-tone field-config value)The tone :tones gives value, else :neutral.
The tone `:tones` gives `value`, else :neutral.
(format-aggregate value role field-config entity-config display)A computed aggregate shown as role shows its values.
A computed aggregate shown as `role` shows its values.
(link-chips entity items total)Linked records as chips, each a link to its record, then "+N" for the
ones total counts beyond them.
Linked records as chips, each a link to its record, then "+N" for the ones `total` counts beyond them.
(page-total records field)The sum of field over records, or nil when no row has a number there.
The sum of `field` over `records`, or nil when no row has a number there.
(record-title entity-config record display)What record is called: its :title-field rendered by the role it would
have if it were not the title, so an instant reads as a date, else its id.
Never a link, as a heading or breadcrumb holds it.
What `record` is called: its `:title-field` rendered by the role it would have if it were not the title, so an instant reads as a date, else its id. Never a link, as a heading or breadcrumb holds it.
(urgency-tone field-config days record)For a date with :urgency: :danger when it has passed, :warning within
:warn-days (default 7), else nil. :urgency is true or a map
{:warn-days 7 :until {:status [:paid]}}; :until ends the urgency once
the record holds one of those values — a paid invoice is not overdue.
For a date with `:urgency`: :danger when it has passed, :warning within
`:warn-days` (default 7), else nil. `:urgency` is true or a map
`{:warn-days 7 :until {:status [:paid]}}`; `:until` ends the urgency once
the record holds one of those values — a paid invoice is not overdue.(with-record-title {:keys [entity-config record] :as trail} display)trail, the shell's parent trail, with its record's title rendered.
`trail`, the shell's parent trail, with its record's title rendered.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |