PhoenixKitCatalogue.Web.TableConfig (PhoenixKitCatalogue v0.10.0)

Copy Markdown View Source

Column metadata for the catalogue admin tables, keyed by scope (:catalogues, :suppliers, :manufacturers). Pure data — cell and card rendering live in the LiveView. Labels are zero-arity fns so they resolve in the request's current locale.

Summary

Types

column()

@type column() :: %{
  id: String.t(),
  label: (-> String.t()),
  default?: boolean(),
  managed?: boolean(),
  sortable?: boolean(),
  sort_key: (map() -> term()) | nil,
  align: :left | :right,
  filterable?: boolean(),
  filter_type: :enum | nil
}

scope()

@type scope() :: :catalogues | :suppliers | :manufacturers

Functions

column_map(scope)

@spec column_map(scope()) :: %{required(String.t()) => column()}

columns(scope)

@spec columns(scope()) :: [column()]

default_columns(scope)

@spec default_columns(scope()) :: [String.t()]

default_sort(arg1)

@spec default_sort(scope()) :: {String.t(), :asc | :desc}

managed_columns(scope)

@spec managed_columns(scope()) :: [column()]

sortable_visible(scope, ids)

@spec sortable_visible(scope(), [String.t()]) :: [column()]

validate_columns(scope, ids)

@spec validate_columns(scope(), [String.t()]) :: [String.t()]