Skip to main content
cngx-src documentation

createSortHeaderState

Functioncommon/data/sortv0.1.0

projects/common/data/sort/sort-header-state.ts

Description#

Derives the shared sort-header state for one column from a CngxSort getter.

Both CngxSortHeader (table context, aria-sort) and CngxDgaSortHeader (disclosure context, role="button" + aria-describedby) compose this factory and keep only their own a11y presentation. The factory is a11y-agnostic - it returns the plain derived signals each header maps to its own DOM/ARIA surface.

Signature#

createSortHeaderState(sort, field)

Parameters#

@paramsort

Getter for the owning CngxSort engine (() => sortRef, () => grid.sort).

@paramfield

Getter for the column's field key.

Returns#

SortHeaderState

The derived { entry, isActive, isAsc, isDesc, priority, toggle } bundle.