TableColumnsState

Column layout of one table: the order columns render in, the width overrides that apply to them, and the measurements the auto-fit works from.

Reached as TableState.columns. Every member here has a deprecated forwarder on TableState itself, kept for one release so existing call sites compile with a warning that names the replacement; the forwarders go away in the next major.

TooManyFunctions is suppressed because this is the single holder for column layout operations (order, widths, pinning, visibility); splitting it would scatter one concept.

Properties

Link copied to clipboard

Whether automatic width fitting has been applied for the first data batch render.

Link copied to clipboard

Whether automatic width fitting has been applied for the empty (header-only) state.

Link copied to clipboard

Tracks the maximum measured minimal content width per column across visible rows. Used to auto-fit columns on demand.

Link copied to clipboard

The entries of widths that were set explicitly rather than by auto-fit: the widths to persist and pass back as initialWidths or through setWidths when the table is shown again.

Link copied to clipboard

Tracks header widths separately. These are preserved during auto-width recalculation and used as base values after reset.

Link copied to clipboard

Columns hidden at runtime, e.g. from the column menu. A column renders when its spec is visible and its key is not in this set; showAll never reveals a column the spec hides.

Link copied to clipboard

Column keys in render order.

Link copied to clipboard
Link copied to clipboard

Number of trailing visible columns pinned at the end edge. Starts at ua.wwind.table.config.TableSettings.pinnedEndCount; pin and unpin change it at runtime. When this and pinnedStartCount together cover every visible column, none is pinned.

Link copied to clipboard

Number of leading visible columns pinned at the start edge. Starts at ua.wwind.table.config.TableSettings.pinnedStartCount; pin and unpin change it at runtime. When this and pinnedEndCount together cover every visible column, none is pinned.

Link copied to clipboard

Width overrides per column. A missing key falls back to the spec width, then the default.

Functions

Link copied to clipboard
fun canHide(column: C): Boolean

Whether hide would hide column: it is visible and not the last visible column.

Link copied to clipboard
fun canMoveBy(column: C, delta: Int): Boolean

Whether moveBy would move column by delta visible positions: the target exists and sits in the same block (start-pinned, scrolling or end-pinned) as the column.

Link copied to clipboard
fun canPin(column: C): Boolean

Whether pin would pin column to the deprecated single-side edge.

fun canPin(column: C, side: PinnedSide): Boolean

Whether pin would pin column to side: it is visible, unpinned, and one column would stay unpinned. Both edges share these rules today; side keeps the call paired with pin.

Link copied to clipboard
fun fitToContent(column: C)

Set the column width override to the tracked maximum minimal content width (if available). No-op if no measured width is present for the column.

Link copied to clipboard
fun hide(column: C)

Hide column. A pinned column is unpinned first: it moves just outside the pinned block, which shrinks by one.

Link copied to clipboard
fun isPinned(column: C): Boolean

Whether column is visible and inside either pinned block.

Link copied to clipboard
fun move(fromIndex: Int, toIndex: Int)

Move a column from fromIndex to toIndex within the current order. Indices are validated; dropping after the last element is supported.

Link copied to clipboard
fun moveBy(column: C, delta: Int)

Move column by delta positions among visible columns, staying inside its block.

Link copied to clipboard
fun pin(column: C)

Pin column to the deprecated single-side edge.

fun pin(column: C, side: PinnedSide)

Move column to the inner edge of the side pinned block and grow that block by one.

Link copied to clipboard
fun pinnedSide(column: C): PinnedSide?

The pinned block column sits in, or null when it is hidden or scrolls.

Link copied to clipboard

Recalculate auto-widths for columns with autoWidth enabled.

Link copied to clipboard
fun resize(column: C, action: ColumnWidthAction)

Apply a width action for a column (set or reset override).

Link copied to clipboard
fun resolveWidth(key: C, spec: ColumnSpec<*, C, *>? = null): Dp

Resolves the effective width for a column given its key and optional spec.

Link copied to clipboard
fun setOrder(newOrder: List<C>)

Replace current column order with newOrder. Missing keys are ignored; unknown keys appended.

Link copied to clipboard
fun setWidths(newWidths: Map<C, Dp?>)

Apply external newWidths in bulk. Null width removes the override for that column.

Link copied to clipboard
fun show(column: C)

Show a column hidden by hide. A column whose place in order falls inside the pinned block lands at the block's outer edge instead, so it never takes a pinned column's slot.

Link copied to clipboard
fun showAll()

Show every column hidden by hide, each one placed as show places it. Columns that all land at the same pinned block's outer edge keep their relative order.

Link copied to clipboard
fun unpin(column: C)

Move column just outside its pinned block and shrink that block by one.

Link copied to clipboard
fun updateMaxContentWidth(column: C, width: Dp, source: String)

Update the tracked maximum minimal content width for a column. If the provided width is greater than the stored value, it will be recorded.