AshFormBuilder.Theme.MishkaTheme (AshFormBuilder v0.2.0)

View Source

Strict MishkaChelekom integration theme for AshFormBuilder.

This theme strictly utilizes MishkaChelekom components from your deps, providing first-class support for many-to-many relationships via the searchable combobox component.

Setup

  1. Ensure mishka_chelekom is in your deps:

    {:mishka_chelekom, "~> 0.0.8"}
  2. Generate the required components:

    mix mishka.ui.gen.component text_field
    mix mishka.ui.gen.component textarea_field
    mix mishka.ui.gen.component native_select
    mix mishka.ui.gen.component checkbox_field
    mix mishka.ui.gen.component number_field
    mix mishka.ui.gen.component email_field
    mix mishka.ui.gen.component password_field
    mix mishka.ui.gen.component date_time_field
    mix mishka.ui.gen.component url_field
    mix mishka.ui.gen.component combobox
  3. Configure the theme:

    config :ash_form_builder, :theme, AshFormBuilder.Theme.MishkaTheme

Many-to-Many with Combobox

The :multiselect_combobox type renders a searchable multi-select using <MishkaChelekom.Components.Combobox.combobox>. Pass custom options via opts:

field :specialties do
  type :multiselect_combobox
  opts [
    search_event: "search_specialties",
    debounce: 300,
    placeholder: "Search specialties..."
  ]
end

Strict Component Usage

This theme ONLY uses:

  • MishkaChelekom.Components.Combobox.combobox for :multiselect_combobox
  • MishkaChelekom.Components.TextField.text_field for text/email/password/url/tel
  • MishkaChelekom.Components.TextareaField.textarea_field for :textarea
  • MishkaChelekom.Components.NativeSelect.native_select for :select
  • MishkaChelekom.Components.CheckboxField.checkbox_field for :checkbox
  • MishkaChelekom.Components.NumberField.number_field for :number
  • MishkaChelekom.Components.DateTimeField.date_time_field for :date/:datetime