AshFormBuilder.Field (AshFormBuilder v0.2.0)

View Source

Represents a single form field declared via the field DSL entity.

Relationship Fields

When a field represents a relationship (e.g., many_to_many), the following fields are populated:

  • :relationship - The relationship name (atom)
  • :relationship_type - The type of relationship (:many_to_many, :has_many, etc.)
  • :destination_resource - The related resource module
  • :opts - Custom options for UI components (search events, preload options, etc.)

Types

  • :text_input - Standard text input
  • :textarea - Multi-line text area
  • :select - Single-select dropdown
  • :multiselect_combobox - Many-to-many searchable multi-select (MishkaChelekom combobox)
  • :checkbox - Boolean checkbox
  • :number - Numeric input
  • :email - Email input
  • :password - Password input
  • :date - Date picker
  • :datetime - DateTime picker
  • :hidden - Hidden input
  • :url - URL input
  • :tel - Telephone input

Summary

Types

t()

@type t() :: %AshFormBuilder.Field{
  __spark_metadata__: map() | nil,
  class: String.t() | nil,
  destination_resource: module() | nil,
  hint: String.t() | nil,
  label: String.t() | nil,
  name: atom(),
  options: list(),
  opts: keyword(),
  placeholder: String.t() | nil,
  relationship: atom() | nil,
  relationship_type: atom() | nil,
  required: boolean(),
  type:
    :text_input
    | :textarea
    | :select
    | :multiselect_combobox
    | :checkbox
    | :number
    | :email
    | :password
    | :date
    | :datetime
    | :hidden
    | :url
    | :tel,
  wrapper_class: String.t() | nil
}