Raxol.UI.Components.Display.Table (Raxol v0.5.0)
View SourceA component for displaying tabular data with sorting, filtering, and pagination.
Summary
Functions
Handles events for the Table component.
Initializes the Table component state from props.
Mounts the Table component, performing any setup needed.
Renders the Table component.
Updates the Table component state in response to messages. Handles prop updates, sorting, filtering, and selection.
Types
@type header() :: String.t()
@type headers() :: [header()]
@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()]], optional(:sortable) => boolean(), optional(:filterable) => boolean(), optional(:selectable) => boolean(), optional(:striped) => boolean(), optional(:selected) => integer() | nil, optional(:type) => :table | :header | :footer, optional(:focused) => boolean(), optional(:disabled) => boolean() }
@type row() :: [cell()]
@type rows() :: [row()]
@type state() :: %{ id: String.t() | atom(), columns: list(), data: list(), style: map(), row_style: map() | nil, cell_style: map() | nil, header_style: map(), footer: map() | nil, scroll_top: integer(), scroll_left: integer(), focused_row: integer() | nil, focused_col: integer() | nil, max_height: integer() | nil, max_width: integer() | nil, sort_by: atom() | nil, sort_direction: :asc | :desc | nil, filter_term: String.t(), selected_row: integer() | nil, striped: boolean(), border_style: :single | :double | :none | map(), mounted: boolean(), render_count: integer(), type: :table | :header | :footer, focused: boolean(), disabled: boolean() }
Functions
Handles events for the Table component.
Initializes the Table component state from props.
Mounts the Table component, performing any setup needed.
Renders the Table component.
Updates the Table component state in response to messages. Handles prop updates, sorting, filtering, and selection.