projects/common/data/sort/sort-header-state.ts
import { SortHeaderState } from '@cngx/common/data'
The derived sort-header state a header directive exposes for one column.
Pure derivation over a single CngxSort source plus an imperative toggle. No async state, no signal writes outside toggle.
toggle
Signal
The active sort entry for this column, or undefined when the column is not sorted.
undefined
true when this column is part of the active sort (primary or secondary).
true
true when this column is active and sorted ascending.
true when this column is active and sorted descending.
1-based position of this column in the sort stack, or 0 when it is not active. Only meaningful when multiSort is enabled on the owning CngxSort.
0
multiSort
CngxSort
void
toggle(additive?: boolean)
Toggles this column's sort through CngxSort.setSort. Pass the header's own Shift-key read as additive; the multiSort gate is applied here so the column only joins the stack additively when the owning sort allows it.
CngxSort.setSort
additive
boolean