Relation field type for selecting related records in forms.
Follows the same pattern as MishkaGervaz.Table.Types.Filter.Relation.
Modes
:static- Load all options at once (default, for small datasets):load_more- Paginated with "Load more" button:search- Searchable single select:search_multi- Searchable multi select
Examples
field :site_id, :relation do
mode :static
display_field :name
end
field :category_id, :relation do
mode :search_multi
search_field :name
min_chars 1
endSee MishkaGervaz.Form.Behaviours.FieldType,
MishkaGervaz.Form.Types.Field, and the table-side counterpart
MishkaGervaz.Table.Types.Filter.Relation.
Summary
Functions
Renders the relation field input by building assigns and calling the UI adapter.
Functions
@spec render_input(map(), map(), map(), module()) :: Phoenix.LiveView.Rendered.t()
Renders the relation field input by building assigns and calling the UI adapter.
Delegates to the appropriate UI adapter function based on mode:
:static→ui.select/1:search→ui.search_select/1:load_more→ui.load_more_select/1:search_multi→ui.multi_select/1