View Source AdminElf.FieldHelpers (admin_elf v1.1.0)

Summary

Types

@type field() :: %{
  type: field_type(),
  name: atom(),
  label: String.t(),
  value: (term() -> term()),
  link: (term() -> term()) | nil,
  referenced_resource_id: any()
}
@type field_type() :: :text | :date | :number | :boolean | :reference | :link

Functions

Link to this function

boolean_field(name, opts \\ [])

View Source
@spec boolean_field(
  atom(),
  keyword()
) :: field()
Link to this function

date_field(name, opts \\ [])

View Source
@spec date_field(
  atom(),
  keyword()
) :: field()
Link to this function

field(name, type, opts \\ [])

View Source
@spec field(atom(), field_type(), keyword()) :: field()
Link to this function

number_field(name, opts \\ [])

View Source
@spec number_field(
  atom(),
  keyword()
) :: field()
Link to this function

reference_field(name, referenced_resource_id, opts \\ [])

View Source
@spec reference_field(
  atom(),
  [atom()],
  keyword()
) :: field()
Link to this function

text_field(name, opts \\ [])

View Source
@spec text_field(
  atom(),
  keyword()
) :: field()