AdminElf.FieldHelpers (admin_elf v0.4.3) View Source

Link to this section Summary

Link to this section Types

Specs

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

Specs

field_type() :: :text | :date | :number | :boolean | :reference | :link

Link to this section Functions

Link to this function

boolean_field(name, opts \\ [])

View Source

Specs

boolean_field(atom(), keyword()) :: field()
Link to this function

date_field(name, opts \\ [])

View Source

Specs

date_field(atom(), keyword()) :: field()
Link to this function

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

View Source

Specs

field(atom(), field_type(), keyword()) :: field()
Link to this function

number_field(name, opts \\ [])

View Source

Specs

number_field(atom(), keyword()) :: field()
Link to this function

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

View Source

Specs

reference_field(atom(), [atom()], keyword()) :: field()
Link to this function

text_field(name, opts \\ [])

View Source

Specs

text_field(atom(), keyword()) :: field()