CngxTabGroupAnnouncements
projects/common/tabs/announcements/tab-group-announcements.ts
Referenced by#
Import#
import { CngxTabGroupAnnouncements } from '@cngx/common/tabs'
Description#
Resolved bundle returned by createTabGroupAnnouncements.
Host bindings and template outlets read these directly. Owns one
internal linkedSignal slot (prior-active-index tracker driving
the success-arm direction prefix); consumers never touch it.
Index#
Instance Properties#
SignalPolite live-region content — declarative, never an imperative
announce(). Empty between transitions so the region stays
quiet on no-op ticks.
Error arm: commitRolledBackTo(originLabel) when origin
resolves; otherwise commitFailedRetry.
Success arm: ${previousTab|nextTab}: selectedTab(...) when
the index moved; bare selectedTab(...) when it didn't (initial
mount, or commit-success that lands on the same tab).
SignalWrapper aria-label. Resolution: per-instance Input →
ariaLabels.tabsRegion → i18n.tabsLabel. Returns null when
aria-labelledby is bound (mutually exclusive per WAI-ARIA).
SignalTab-panel aria-roledescription. Cascades through
CngxTabsFallbackLabels.tabPanelRoleDescription → 'tab panel'.
SignalTablist aria-roledescription. Cascades through
CngxTabsFallbackLabels.tabRoleDescription → 'tab list'.
Distinct from i18n.tabsLabel (which feeds aria-label) so
AT does not read the same word twice.
Methods#
statusPhrase(tab: CngxTabHandle)SR descriptor phrase for a tab's cngx-sr-only span. Gated on the
folded tab.hasError() so a direct [error] tab announces without
an aggregator. Resolution: aggregator.announcement() →
tab.errorMessage() (the direct-channel message) →
i18n.tabHasErrors(errorCount). Empty string when the tab has no
error. The span itself is always rendered (cngx ARIA-by-value
rule); this returns its content.
tabAriaLabel(tab: CngxTabHandle, position: number)Verbose tab-button aria-label — selectedTab(label, position, count) so AT hears "Tab 2 of 5: Settings" instead of inferring
position from tablist enumeration. The visual span keeps the
bare label.