Skip to main content
cngx-src documentation

CngxDgCell

Directivev0.1.0WCAG AA

projects/ui/data-grid-accordion/data-grid-cell.directive.ts

Import#

import { CngxDgCell } from '@cngx/ui/data-grid-accordion'

Description#

A single cell in a CngxDataGridRow, CngxDataGridHeader, or CngxDataGridFooter. Each cell occupies one track of the shared grid-template-columns contract; [align] sets its inline alignment and [primary] marks the one cell that names the row.

The cell is visual: the row stays a single cngxAccordionPanel button and one role="region", so marking a cell primary only points the row's aria-labelledby at it - it adds no interactive semantics. Exactly one cell per row should carry primary, so the row's accessible name is that cell's text alone rather than every cell concatenated.

Metadata#

Host#

Index#

Inputs#

input()

Inline alignment within the column track: start (default), center, end.

default 'start'
input()

Column-sizing intent read off the header cells to derive the shared grid template (CngxDgCellTrack: grow / fit / sm / md / lg). Authored on the CngxDataGridHeader cells; row and footer cells inherit the derived track by position and can leave it unset. Unset falls back to the default (primary column grows, the rest fit). Purely a sizing hint - no host binding, the group reads the signal directly.

primary#
input()

Marks this cell as the row's accessible name. The row's cngxAccordionPanel button and its role="region" both point aria-labelledby at the primary cell, so a screen reader announces one meaningful label per row instead of the concatenated text of every cell.

default false, { transform: coerceBooleanProperty }

Instance Properties#

cellId#unknown
Readonly

Stable id the row's aria-labelledby references. Reuses a consumer-supplied id when present (so the IDREF stays what the consumer expects), otherwise generates one. Read by CngxDataGridRow to resolve the primary cell.

this.element.id || nextUid('cngx-dga-cell-')

HostBindings#

BindingExpression
[id]cellId
[attr.data-align]align()
[attr.data-primary]primary() ? '' : null