Skip to main content
cngx-src documentation

CngxTabGroupHost

Interface

projects/common/tabs/tab-group-host.token.ts

Referenced by#

Import#

import { CngxTabGroupHost } from '@cngx/common/tabs'

Description#

Contract atoms see when they inject the presenter via CNGX_TAB_GROUP_HOST. Atoms never reach into the concrete class - keeps layering cycle-free and the decompose schematic clean.

Index#

Instance Properties#

activeId#Signal
Readonly
activeIndex#ModelSignal
Readonly
commitState#CngxAsyncState
Readonly
commitTransition#StatusTransition
Readonly

Reactive current/previous pair for the commit-state status. Lets organisms and skin sub-components derive transition-driven announcements (pendingsuccess, pendingerror, sync idleerror) from a single tracker.

intendedIndex#Signal
Readonly
lastFailedIndex#Signal
Readonly

Tab index of the last refused commit (both optimistic and pessimistic modes). Cleared on next successful re-pick of the same index or via clearLastFailed. Drives the persistent rejection-icon decoration.

The pending → error pulse keyframe (cngx-tab-pulse-error) does not retrigger on rapid supersede sequences - CSS animations only fire on fresh class application. See tabs-accepted-debt §3; the persistent icon plus static red outline carry the durable signal in the no-pulse case.

loop#Signal
Readonly
orientation#Signal<"horizontal" | "vertical">
Readonly
originIndexDuringCommit#Signal
Readonly

Safe-harbour origin index captured at the start of an active commit window. Written when select() opens a transition under commitAction; retained on error so the live-region phrase can resolve the origin label; cleared on success. Outside the commit window the slot may carry a stale value - consumers must gate reads by joining with lastFailedIndex. The origin is meaningful only when lastFailedIndex !== undefined.

Readonly

Methods#

clearLastFailed#void

Clear lastFailedIndex without unwinding originIndexDuringCommit (consumers gate reads on lastFailedIndex anyway). Call when the bound data source changes and the rollback marker is no longer meaningful.

register#void
register(handle: CngxTabHandle)
@paramhandleCngxTabHandle
requestAdd#void

Request adding a new tab. Emits tabAdd; the consumer appends to its data. The presenter owns no tab-creation logic - tabs are derived from consumer data (Ableitung statt Verwaltung).

requestClose#void
requestClose(id: string)

Request closing the tab with the given id. The presenter moves the active index onto the surviving neighbour (APG: next tab, or the previous one when closing the last tab) and emits tabClose; the consumer performs the actual removal from its data. No-op for an unknown id.

@paramidstring
select#void
select(index: number)
@paramindexnumber
selectById#void
selectById(id: string)
@paramidstring
selectNext#void
selectPrevious#void
unregister#void
unregister(id: string)
@paramidstring