TableState

Mutable state holder for a table instance.

Three clusters of that state live in holders of their own, reached through this one: columns (order, widths, auto-fit measurements), selection (focused row, checked rows, selected cell) and editing (edited row and column, edit callbacks). What shapes the data — sort, groupBy, filters — stays here, because it is what a table is asked for most and it belongs to the table as a whole rather than to one of the three.

The members those holders took over remain here as deprecated forwarders for one release, each naming its replacement, so existing call sites keep compiling; they are removed in the next major.

Types

Link copied to clipboard
data class SelectedCell<C>(val rowIndex: Int, val column: C)

Properties

Link copied to clipboard

Column order, width overrides and the measurements auto-fit works from.

Link copied to clipboard
Link copied to clipboard

Edited row and column, and the consumer's edit callbacks.

Link copied to clipboard

The whole filter tree; always an AND group. Snapshot-backed: observe with snapshotFlow. Internal writes are normalized as setFilterExpression does.

Link copied to clipboard

Per-column filters: a mutable view of the first top-level condition of each column in filterExpression. Writes leave groups and nots untouched.

Link copied to clipboard
var groupBy: C?
Link copied to clipboard

True while a non-null rowBlocks declaration is being ignored because groupBy is active. The two features describe incompatible structures over the same rows, so the library suppresses blocks instead of rendering both; this flag exists so consumers can surface that conflict in their own UI rather than have blocks vanish unexplained.

Link copied to clipboard

Tracks measured row heights in raw pixels for dynamic, precise scrolling.

Link copied to clipboard

Focused row, checked rows and the selected cell.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Current table width computed from visible columns and their widths. Automatically recalculates when column order, widths, or visibleColumns change.

Link copied to clipboard

The TableFilterNode.Unresolved leaves of filterExpression, in tree order; empty when the expression is resolved. While it is not empty, do not apply or send the filter at all, not even with these leaves left out. The table shows them only in the active filters row, so an app that hides the row must check this itself. Snapshot-backed: observe with snapshotFlow.

Functions

Link copied to clipboard
fun clearSort()

Remove sorting. A no-op while row reorder is enabled, matching setSort.

Link copied to clipboard
fun groupBy(column: C?)

Enable or disable grouping by a column

Link copied to clipboard
fun <T> setFilter(column: C, state: TableFilterState<T>?)

Set or clear filter state for column. Pass null to remove.

Link copied to clipboard

Replaces the tree. A root that is not an AND group becomes the single child of an AND root.

Link copied to clipboard
fun setSort(column: C, order: SortOrder? = null)

Toggle or set sorting for a column. If order is null, cycles ASC -> DESC -> none.

Link copied to clipboard
fun updateRowHeight(index: Int, heightPx: Int)

Record measured row height (in px) for index.