FrappeUIPhx.Components.TextInput (frappe_ui_phx v0.3.1)

Copy Markdown View Source

Campo de uma linha. Aceita field={@form[:campo]} (Phoenix/Ecto) ou name/value avulsos. Restrições (required, maxlength, min, pattern, placeholder...) vão direto ao <input>; o servidor continua sendo a barreira real (o required aqui espelha a regra do changeset).

Summary

Functions

text_input(assigns)

Attributes

  • field (Phoenix.HTML.FormField) - Defaults to nil.
  • id (:any) - Defaults to nil.
  • name (:any)
  • value (:any)
  • type (:string) - Defaults to "text". Must be one of "text", "email", "number", "password", "search", "tel", "url", "date", "time", "datetime-local", "month", "week", or "color".
  • variant (:atom) - Defaults to :subtle. Must be one of :subtle, :outline, or :ghost.
  • size (:atom) - Defaults to :sm. Must be one of :xs, :sm, :md, or :lg.
  • errors (:list) - Defaults to [].
  • disabled (:boolean) - Defaults to false.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["autocomplete", "autofocus", "form", "list", "max", "maxlength", "min", "minlength", "pattern", "placeholder", "readonly", "required", "step", "inputmode"].