MishkaGervaz.Form.Entities.Group (MishkaGervaz v0.0.1-alpha.2)

Copy Markdown View Source

Form field group — bundles fields into a named, layout-aware unit.

A group references field names by atom; the surrounding layout (and any wizard/tabs step) arranges the fields inside each group. Groups carry the standard visible / restricted access predicates and an optional ui sub-entity for label, icon, description, and CSS classes.

Example

groups do
  group :general do
    fields [:title, :content, :status]
    collapsible true
    collapsed false

    ui do
      label "General"
      icon "hero-pencil"
      class "border p-4"
    end
  end
end

See MishkaGervaz.Form.Dsl.Groups for the DSL section that exposes this entity, and MishkaGervaz.Form.Entities.Group.Ui for the ui sub-entity.

Summary

Functions

Transform the group after DSL compilation. Unwraps the singleton ui sub-entity from the parser's list wrapper.

Types

t()

@type t() :: %MishkaGervaz.Form.Entities.Group{
  __identifier__: term(),
  __spark_metadata__: map() | nil,
  collapsed: boolean(),
  collapsible: boolean(),
  fields: [atom()],
  name: atom(),
  position: integer() | :first | :last | nil,
  restricted: boolean() | (map() -> boolean()),
  ui: MishkaGervaz.Form.Entities.Group.Ui.t() | nil,
  visible: boolean() | (map() -> boolean())
}

Functions

transform(group)

Transform the group after DSL compilation. Unwraps the singleton ui sub-entity from the parser's list wrapper.