Raxol.UI.Components.Display.Table (Raxol v0.2.0)

View Source

A component for displaying tabular data with sorting, filtering, and pagination.

Summary

Types

cell()

@type cell() :: String.t() | number() | atom()

header()

@type header() :: String.t()

headers()

@type headers() :: [header()]

props()

@type props() :: %{
  optional(:id) => String.t(),
  optional(:columns) => list(),
  optional(:data) => list(),
  optional(:style) => map(),
  optional(:headers) => [header()],
  optional(:rows) => [row()],
  optional(:column_widths) => [:auto | [integer() | :auto]],
  optional(:theme) => map(),
  optional(:border_style) => :single | :double | :none | map(),
  optional(:width) => integer() | :auto,
  optional(:alignments) => [:left | :center | :right | [atom()]]
}

row()

@type row() :: [cell()]

rows()

@type rows() :: [row()]

state()

@type state() :: map()

t()

@type t() :: %{
  state: state(),
  id: String.t() | atom(),
  columns: list(),
  data: list(),
  style: map(),
  row_style: nil,
  cell_style: nil,
  header_style: %{bold: true},
  footer: nil,
  scroll_top: 0,
  scroll_left: 0,
  focused_row: nil,
  focused_col: nil,
  max_height: nil,
  max_width: nil
}