Cardbox.Field (Cardbox v0.1.0)

Copy Markdown View Source

A field of a collection: its name, its type (Cardbox.Type) and that type's options.

key is made from the name when the field is added ("Due date" is due_date) and never changes: a record keeps its values under their fields' keys, and a saved view names fields by key, so a field renamed is renamed everywhere at once. Queries and writes take a field's key or its name.

Summary

Functions

The field's choices, for a select, a multi-select or a status; [] for others.

Types

t()

@type t() :: %Cardbox.Field{
  __meta__: term(),
  collection: term(),
  collection_id: integer() | nil,
  description: String.t() | nil,
  id: integer() | nil,
  inserted_at: term(),
  key: String.t(),
  name: String.t(),
  options: map(),
  position: String.t() | nil,
  type: String.t(),
  updated_at: term()
}

Functions

choices(field)

@spec choices(t()) :: [map()]

The field's choices, for a select, a multi-select or a status; [] for others.