View Source ExTeal.Panel (ExTeal v0.27.0)

Separates fields on the detail page into panels

Summary

Functions

Given a resource, uses the fields definition to find the panels

Given a list of fields and a list of panels, assigns the panel to each field

Add helper text for the panel

Limit the amount of fields that show by default on the detail page Other fields are hidden behind a "Show more" button

Creates a new panel

Types

@type options() :: %{
  optional(:helper_text) => String.t(),
  optional(:limit) => non_neg_integer(),
  optional(:apply_to_all) => map()
}
@type t() :: %ExTeal.Panel{
  field: term(),
  fields: term(),
  key: term(),
  name: term(),
  options: term()
}

Functions

Link to this function

default_panel_name(resource)

View Source

Given a resource, uses the fields definition to find the panels

Link to this function

give_panel_to_fields(fields, resource)

View Source
@spec give_panel_to_fields([ExTeal.Field.t()], module()) :: [ExTeal.Field.t()]

Given a list of fields and a list of panels, assigns the panel to each field

Link to this function

helper_text(panel, text)

View Source
@spec helper_text(t(), String.t()) :: t()

Add helper text for the panel

@spec limit(t(), integer()) :: t()

Limit the amount of fields that show by default on the detail page Other fields are hidden behind a "Show more" button

Link to this function

new(name, fields, options \\ %{})

View Source
@spec new(String.t(), [ExTeal.Field.t()], options()) :: t()

Creates a new panel