View Source AdminElf.InputHelpers (admin_elf v1.1.1)

Summary

Types

@type boolean_input() :: %{type: :boolean, name: atom(), label: String.t()}
@type checkboxes_input() :: %{
  type: :checkboxes,
  name: atom(),
  label: String.t(),
  options: [{value :: String.t(), label :: String.t()}]
}
@type date_input() :: %{
  type: :date,
  name: atom(),
  label: String.t(),
  min: Date.t(),
  max: Date.t(),
  value: Date.t()
}
@type email_input() :: %{type: :email, name: atom(), label: String.t()}
@type multiselect_input() :: %{
  type: :multiselect,
  name: atom(),
  label: String.t(),
  options: [
    {value :: String.t(), label :: String.t(),
     meta :: %{
       text: String.t(),
       value: String.t(),
       html: String.t(),
       selected: boolean(),
       display: boolean(),
       disabled: boolean(),
       mandatory: boolean(),
       placeholder: boolean(),
       class: String.t(),
       style: String.t()
     }}
  ]
}
@type number_input() :: %{type: :number, name: atom(), label: String.t()}
@type password_input() :: %{type: :password, name: atom(), label: String.t()}
@type radio_input() :: %{
  type: :radio,
  name: atom(),
  label: String.t(),
  default_option: String.t(),
  options: [{value :: String.t(), label :: String.t()}]
}
@type select_input() :: %{
  type: :select,
  name: atom(),
  label: String.t(),
  options: [{value :: String.t(), label :: String.t()}]
}
@type text_input() :: %{type: :text, name: atom(), label: String.t()}

Functions

Link to this function

boolean_input(name, opts \\ [])

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

checkboxes_input(name, opts \\ [])

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

date_input(name, opts \\ [])

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

email_input(name, opts \\ [])

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

multiselect_input(name, opts \\ [])

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

number_input(name, opts \\ [])

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

password_input(name, opts \\ [])

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

radio_input(name, opts \\ [])

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

select_input(name, opts \\ [])

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

text_input(name, opts \\ [])

View Source
@spec text_input(
  atom(),
  keyword()
) :: text_input()