FrappeUIPhx.Components.FormControl (frappe_ui_phx v0.3.1)

Copy Markdown View Source

Rótulo + controle + descrição + erros, escolhendo o controle por type.

type: "textarea", "select", "checkbox", "switch" ou qualquer tipo de FrappeUIPhx.Components.TextInput. Erros vêm do field (changeset) e só aparecem depois que o campo foi usado.

Summary

Functions

form_control(assigns)

Attributes

  • field (Phoenix.HTML.FormField) (required)
  • type (:string) - Defaults to "text".
  • label (:string) - Defaults to nil.
  • description (:string) - Defaults to nil.
  • options (:list) - Defaults to [].
  • prompt (:string) - Defaults to nil.
  • variant (:atom) - Defaults to :subtle.
  • size (:atom) - Defaults to :sm.
  • required (:boolean) - espelha a regra validate_required do changeset. Defaults to false.
  • disabled (:boolean) - Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["autocomplete", "maxlength", "minlength", "min", "max", "pattern", "placeholder", "rows", "step"].