@cngx/ui 0.1.0-rc.1 → 0.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -7
- package/fesm2022/cngx-ui-mat-paginator.mjs +215 -0
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-mat-tabs.mjs +20 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +1868 -0
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +98 -11
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +112 -12
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -2
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +135 -0
- package/package.json +9 -5
- package/paginator/README.md +131 -0
- package/stepper/README.md +24 -0
- package/types/cngx-ui-mat-paginator.d.ts +108 -0
- package/types/cngx-ui-mat-tabs.d.ts +5 -0
- package/types/cngx-ui-paginator.d.ts +1035 -0
- package/types/cngx-ui-stepper.d.ts +66 -6
- package/types/cngx-ui-tabs.d.ts +85 -9
- package/fesm2022/cngx-ui-material.mjs +0 -90
- package/fesm2022/cngx-ui-material.mjs.map +0 -1
- package/material/README.md +0 -90
- package/types/cngx-ui-material.d.ts +0 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui-mat-tabs.mjs","sources":["../../../projects/ui/mat-tabs/material-bridge/private-surfaces.ts","../../../projects/ui/mat-tabs/decorations/decoration-projectors.ts","../../../projects/ui/mat-tabs/decorations/aggregated-error-tabs.ts","../../../projects/ui/mat-tabs/decorations/half-wired-slot-sink.ts","../../../projects/ui/mat-tabs/mat-tabs-config.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts","../../../projects/ui/mat-tabs/decorations/live-region.ts","../../../projects/ui/mat-tabs/decorations/rejection-state.ts","../../../projects/ui/mat-tabs/material-bridge/handle.ts","../../../projects/ui/mat-tabs/mat-tabs-registry.directive.ts","../../../projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts","../../../projects/ui/mat-tabs/mat-tabs.directive.ts","../../../projects/ui/mat-tabs/mat-tab-nav.directive.ts","../../../projects/ui/mat-tabs/mat-tab-link.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error-flag.directive.ts","../../../projects/ui/mat-tabs/public-api.ts","../../../projects/ui/mat-tabs/cngx-ui-mat-tabs.ts"],"sourcesContent":["/**\n * Centralised type façade and selector constants for every Angular\n * Material internal surface cngx Material-bridge code couples to.\n * Replaces the per-call-site `as unknown as { _foo? }` casts and\n * the scattered `'.mat-mdc-tab*'` string literals with a single\n * grep target.\n *\n * Every leading-underscore field cngx reaches into and every\n * Material-internal CSS selector cngx queries against has its\n * declaration here. A Material-version upgrade audit only needs to\n * grep this file. The grep value is the consumer-facing benefit, so\n * this namespace is part of the published surface of\n * `@cngx/ui/mat-tabs` (re-exported from the package barrel) rather\n * than a private implementation detail.\n *\n * The grouping uses a TypeScript `namespace` so a single\n * `MaterialPrivateSurfaces.<member>` access path covers both the\n * type façades and the selector constants. The TS namespace also\n * lets cross-package consumers (`@cngx/ui/mat-stepper`) read the\n * grouped name through ESLint's `@typescript-eslint` type resolver\n * — a flat `export * as` re-export from `public-api.ts` does not\n * resolve nested members through the path-alias.\n *\n * @category ui/mat-tabs\n */\n\nimport type { TemplateRef, WritableSignal } from '@angular/core';\nimport type { MatStepperIconContext } from '@angular/material/stepper';\nimport type { Subject } from 'rxjs';\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace MaterialPrivateSurfaces {\n /**\n * Subset of Material's `MatTab` carrying the `_stateChanges`\n * Subject. The leading underscore signals\n * Material-internal-by-convention, even though the field is\n * `readonly` on the public class surface. The Subject emits\n * `void` whenever a `MatTab` input (`textLabel`, `disabled`, …)\n * changes; cngx bridges it into the Signal graph via\n * `toSignal(matTab._stateChanges)` because Material exposes no\n * public reactive surface for input changes.\n */\n export interface StateChangeSource {\n readonly _stateChanges: Subject<void>;\n }\n\n /**\n * Subset of Material's `MatStepper` carrying the `_iconOverrides`\n * map. `<cngx-mat-stepper>` patches this map inside\n * `afterNextRender` to forward consumer-projected\n * `<ng-template matStepperIcon>` declarations through the wrapper\n * into Material's per-header indicator bindings (the only\n * deterministic forwarding path — `<ng-content>` projection\n * inside `<mat-stepper>` does not reach\n * `@ContentChildren(MatStepperIcon)` due to content-init\n * lifecycle ordering).\n */\n export interface IconOverrideHost {\n _iconOverrides?: Record<string, TemplateRef<MatStepperIconContext>>;\n }\n\n /**\n * Subset of CDK's `CdkStep` carrying the `_completedOverride`\n * `WritableSignal`. `MatStep.completed`'s getter reads this\n * signal, so cngx's per-step `state` computed transitively tracks\n * it through the getter and re-fires whenever Material flips\n * completion. Documented limitation: `hasError` writes that are\n * not paired with a `completed` change do not retrigger the\n * computed — sharper note lives on `createMatStepHandle`'s JSDoc.\n */\n export interface CompletedOverrideSource {\n readonly _completedOverride: WritableSignal<boolean | null>;\n }\n\n /**\n * `.mat-mdc-tab` — the class Material applies to the rendered\n * tab `<button>` elements inside `MatTabHeader`. cngx\n * index-correlates `presenter.tabs()` registration order against\n * `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a\n * portal — the rendered buttons live inside `MatTabHeader`'s\n * template, not on the `<mat-tab>` declaration site, and Material\n * exposes no public per-tab element accessor.\n */\n export const MAT_MDC_TAB_SELECTOR = '.mat-mdc-tab';\n\n /**\n * `.mat-mdc-tab-header` — the strip element rendered by\n * `MatTabHeader`. `[cngxMatTabs]` walks\n * `host.querySelector('.mat-mdc-tab-header')` to locate the mount\n * anchor for the cngx overflow molecule (so the More button pins\n * inside Material's strip rather than as a sibling of\n * `<mat-tab-group>`).\n */\n export const MAT_MDC_TAB_HEADER_SELECTOR = '.mat-mdc-tab-header';\n\n /**\n * `.mat-mdc-tab-label-container` — Material's IO-friendly scroll\n * viewport ancestor of the rendered tab buttons. The Material-\n * twin overflow adapter walks `host → header → any tab → closest\n * label-container` to attach the molecule's\n * `IntersectionObserver` against the same element Material\n * itself scrolls.\n */\n export const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR =\n '.mat-mdc-tab-label-container';\n}\n","import {\n afterNextRender,\n type DestroyRef,\n effect,\n type EmbeddedViewRef,\n type Injector,\n isDevMode,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n type TemplateRef,\n untracked,\n type ViewContainerRef,\n} from '@angular/core';\n\nimport type { CngxMatTabAggregatorContentContext } from './mat-tab-aggregator-content.directive';\nimport type { CngxMatTabRejectionContentContext } from './mat-tab-rejection-content.directive';\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Package-private DOM-mutation projectors for `[cngxMatTabs]`.\n *\n * - {@link createMatTabRejectionDecoration} — mirrors\n * `presenter.lastFailedIndex` onto the matching `.mat-mdc-tab` as a\n * class flag plus a hidden `cngx-sr-only` descriptor span linked via\n * `aria-describedby`. `aria-invalid` is intentionally absent: ARIA\n * 1.2 scopes it to form-field vocabulary, not `role=\"tab\"`.\n * - {@link createMatTabAggregatorDecoration} — projects each handle's\n * `shouldShow()` flag onto the matching button as a class +\n * descriptor span pair, same `aria-describedby` token-append pattern.\n *\n * Distinct descriptor-id suffixes (`-rejected` vs `-errors`) let both\n * projectors stack on the same target without collision; the shared\n * token-list append preserves consumer-supplied tokens.\n *\n * @internal package-private — consumers bind `[cngxMatTabError]` on\n * each `<mat-tab>`; the directive owns the projection mechanics.\n */\n\n/**\n * Diff-restore the `aria-describedby` token list after a decoration's\n * descriptor span detaches — drops the decoration's own id token from\n * the live attribute, leaving any third-party tokens written between\n * apply and clear (tooltip refs, Material's own runtime additions)\n * intact. Treats the attribute as a token-set per the cngx ARIA-by-value\n * rule, not as a single-owner string.\n *\n * Empty-result + originally-absent attribute removes the attribute\n * entirely — a dangling `aria-describedby=\"\"` would be a malformed\n * reference in some AT readers.\n *\n * @internal\n */\nfunction restoreAriaDescribedbyExceptToken(\n el: HTMLElement,\n tokenToRemove: string,\n renderer: Renderer2,\n priorAriaDescribedby: string | null,\n): void {\n const current = el.getAttribute('aria-describedby');\n const tokens = current ? current.split(/\\s+/).filter(Boolean) : [];\n const remaining = tokens.filter((t) => t !== tokenToRemove);\n if (remaining.length === 0) {\n if (priorAriaDescribedby === null) {\n renderer.removeAttribute(el, 'aria-describedby');\n } else {\n renderer.setAttribute(el, 'aria-describedby', priorAriaDescribedby);\n }\n return;\n }\n renderer.setAttribute(el, 'aria-describedby', remaining.join(' '));\n}\n\n/**\n * Options for {@link createMatTabRejectionDecoration}.\n */\nexport interface CngxMatTabRejectionDecorationOptions {\n /** Host element whose subtree contains the `.mat-mdc-tab` buttons. */\n readonly hostEl: HTMLElement;\n /**\n * Stable id of the currently-failed target, or `null` when no\n * rejection is pinned. Sole effect-trigger; the descriptor span's\n * DOM id is `${failedHandleId}-rejected`.\n */\n readonly failedHandleId: Signal<string | null>;\n /**\n * Index of the currently-failed target — `undefined` when no\n * rejection is pinned. Read inside `untracked()` after\n * `failedHandleId` fires.\n */\n readonly failedIndex: Signal<number | undefined>;\n /**\n * Reactive descriptor phrase for the SR-only span. Typical\n * resolution at the caller: i18n `commitRolledBackTo(originLabel)`\n * when origin resolves, `commitFailedRetry` otherwise. A separate\n * effect tracks this signal so late label resolution mutates the\n * span in place rather than rebuilding it. Empty string keeps the\n * span mounted — `aria-describedby` must never dangle.\n */\n readonly descriptorText: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--error`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /**\n * Suffix appended to `failedHandleId` for the descriptor span's\n * DOM id. Default `'rejected'` — distinct from the aggregator\n * projector's `'errors'` so both can stack on the same target.\n */\n readonly descriptorIdSuffix?: string;\n /**\n * Optional `*cngxMatTabRejectionContent` slot template. When\n * non-null AND `viewContainerRef` is supplied, the projector\n * renders an embedded view into the SR span; otherwise it falls\n * back to the imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabRejectionContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path. Mirrors\n * the aggregator projector's same-name opt.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Reactive origin label feeding the slot context's `originLabel`.\n * Read inside `untracked()` during apply; the `descriptorText`\n * re-fire effect destroys + remounts the embedded view, so the\n * value is always read at fire time.\n */\n readonly originLabel?: Signal<string | undefined>;\n}\n\n/**\n * Mounts the sticky-rejection decoration projector. Class +\n * descriptor span follow `failedHandleId` reactively; cleared on\n * directive destroy. Single-target by contract (matches the\n * presenter's single-slot `lastFailedIndex`).\n *\n * Two effects split the work: one tracks `failedHandleId` and\n * mounts/unmounts the span; the other tracks `descriptorText` and\n * mutates `textContent` in place. The split keeps late label\n * resolution O(1) — no DOM rebuild when the origin label arrives\n * via a downstream `tabs()` re-emission.\n *\n * @internal\n */\nexport function createMatTabRejectionDecoration(\n opts: CngxMatTabRejectionDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--error';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const descriptorIdSuffix = opts.descriptorIdSuffix ?? 'rejected';\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. No diagnostic — single in-package consumer always\n // passes both.\n const slotEnabled = !!opts.contentTemplate && !!opts.viewContainerRef;\n let decoratedEl: HTMLElement | null = null;\n // Cached across the projector's lifetime — reusing the same node\n // keeps AT-reader / observer references live across A→B→A flips.\n let cachedSpan: HTMLElement | null = null;\n let priorAriaDescribedby: string | null = null;\n // Pillar 1 — short-circuits structurally-identical re-emissions of\n // `failedHandleId` so a `tabs()` re-eval doesn't clobber the AT\n // descriptor mid-flight.\n let lastAppliedId: string | null = null;\n let embeddedView:\n | EmbeddedViewRef<CngxMatTabRejectionContentContext>\n | undefined;\n\n const destroyEmbeddedView = (): void => {\n if (!embeddedView) {\n return;\n }\n embeddedView.destroy();\n embeddedView = undefined;\n if (cachedSpan) {\n while (cachedSpan.firstChild) {\n opts.renderer.removeChild(cachedSpan, cachedSpan.firstChild);\n }\n }\n };\n\n const writeDescriptorContent = (\n span: HTMLElement,\n handleId: string,\n text: string,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView();\n const context: CngxMatTabRejectionContentContext = {\n failedHandleId: handleId,\n originLabel: opts.originLabel?.(),\n fallbackText: text,\n };\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // Force CD before moving rootNodes out of the embedded view's\n // logical parent — zoneless + OnPush would otherwise leave the\n // first SR read stale.\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(span, node);\n }\n embeddedView = view;\n return;\n }\n // Imperative fallback — also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView();\n opts.renderer.setProperty(span, 'textContent', text);\n };\n\n const clearDecoration = (): void => {\n if (!decoratedEl || !cachedSpan) {\n return;\n }\n const ownTokenId = cachedSpan.id;\n destroyEmbeddedView();\n opts.renderer.removeClass(decoratedEl, className);\n opts.renderer.removeChild(decoratedEl, cachedSpan);\n // `cachedSpan` deliberately retained — reused on the next apply.\n restoreAriaDescribedbyExceptToken(\n decoratedEl,\n ownTokenId,\n opts.renderer,\n priorAriaDescribedby,\n );\n decoratedEl = null;\n priorAriaDescribedby = null;\n };\n\n const applyDecorationAt = (failedIdx: number, handleId: string): void => {\n clearDecoration();\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n const targetEl = buttons.item(failedIdx);\n if (!targetEl) {\n return;\n }\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${handleId}-${descriptorIdSuffix}`;\n let span = cachedSpan;\n if (!span) {\n span = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(span, srOnlyClassName);\n cachedSpan = span;\n }\n // Always rewrite id + textContent — the cached span carries stale\n // values from the prior mount. The live-text effect below picks\n // up subsequent `descriptorText` changes in place.\n opts.renderer.setAttribute(span, 'id', spanId);\n opts.renderer.appendChild(targetEl, span);\n writeDescriptorContent(span, handleId, opts.descriptorText());\n\n // Renderer2 has no `getAttribute` counterpart — read off the\n // native element. Browser-only; SSR would need a platform adapter.\n const prior = targetEl.getAttribute('aria-describedby');\n const tokens = prior ? prior.split(/\\s+/).filter(Boolean) : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n decoratedEl = targetEl;\n priorAriaDescribedby = prior;\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const id = opts.failedHandleId();\n untracked(() => {\n if (id === lastAppliedId) {\n return;\n }\n if (id === null) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n const idx = opts.failedIndex();\n if (idx === undefined) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n applyDecorationAt(idx, id);\n lastAppliedId = id;\n });\n });\n\n // Live-text effect — tracks `descriptorText` plus the slot\n // template (when wired) so a late-mounted template re-renders\n // into the existing span. Mount-state checks live in untracked.\n effect(() => {\n const text = opts.descriptorText();\n const tplSignal = opts.contentTemplate;\n if (slotEnabled && tplSignal) {\n tplSignal();\n }\n untracked(() => {\n if (decoratedEl === null || cachedSpan === null) {\n return;\n }\n const id = opts.failedHandleId();\n if (id === null) {\n return;\n }\n writeDescriptorContent(cachedSpan, id, text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(clearDecoration);\n}\n\n/**\n * One per-tab error-aggregator decoration entry. Caller pre-filters\n * to handles whose `shouldShow() === true`.\n *\n * `count` / `label` feed the optional `*cngxMatTabAggregatorContent`\n * slot context ({@link CngxMatTabAggregatorContentContext}); the\n * imperative-fallback path uses `announcement` only and ignores the\n * two extra fields. They stay on the shape so the contract is\n * uniform across render paths.\n */\nexport interface CngxMatTabAggregatorErrorEntry {\n readonly idx: number;\n readonly id: string;\n readonly announcement: string;\n /** Aggregated error count — feeds the slot context's `count` field. */\n readonly count: number;\n /** Resolved tab label — feeds the slot context's `label` field. */\n readonly label: string;\n}\n\n/**\n * Options for {@link createMatTabAggregatorDecoration}.\n */\nexport interface CngxMatTabAggregatorDecorationOptions {\n readonly hostEl: HTMLElement;\n /**\n * Reactive list of tabs whose bound aggregator wants reveal —\n * caller pre-filters; sole effect-trigger.\n */\n readonly errorTabs: Signal<readonly CngxMatTabAggregatorErrorEntry[]>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--has-errors`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /** Default: `5`. Cap on `afterNextRender` retry recursion. */\n readonly maxRetryAttempts?: number;\n /**\n * Optional dev-mode sink invoked when the retry ceiling is hit.\n * Defaults to a `console.warn` gated on `ngDevMode`.\n */\n readonly onMaxRetriesReached?: () => void;\n /**\n * Optional `*cngxMatTabAggregatorContent` template. When non-null\n * AND `viewContainerRef` is supplied, the projector renders an\n * embedded view per entry; otherwise it falls back to the\n * imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabAggregatorContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Sink fired when exactly one of `contentTemplate` /\n * `viewContainerRef` is supplied — the projector is mode-agnostic\n * so the dev-vs-prod gate lives in whichever sink the caller\n * passes. `[cngxMatTabs]` resolves this from\n * `provideMatTabsConfig(withHalfWiredSlotSink(fn))`; the default\n * is a dev-mode `console.warn`.\n */\n readonly onHalfWiredSlot?: (\n missing: 'contentTemplate' | 'viewContainerRef',\n ) => void;\n}\n\n/**\n * Mounts the per-tab aggregator decoration projector. Class +\n * descriptor span + `aria-describedby` token follow `errorTabs`\n * reactively; pruned on entry drop and on directive destroy.\n *\n * Race recovery — when the effect fires before MatTabHeader has\n * rendered the matching buttons (initial-render race), schedules a\n * single `afterNextRender` retry, bounded by `maxRetryAttempts`.\n *\n * @internal\n */\nexport function createMatTabAggregatorDecoration(\n opts: CngxMatTabAggregatorDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--has-errors';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const maxRetryAttempts = opts.maxRetryAttempts ?? 5;\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. Re-evaluated per fire so a lazy-mounted template\n // (`*ngIf` / `@defer`) picks up on first materialisation.\n const isFullyWired = (): boolean =>\n !!opts.contentTemplate && !!opts.viewContainerRef;\n // Half-wired diagnostic — graceful degradation hides the mistake\n // at runtime, so the signal has to come from a deliberate sink.\n if (!isFullyWired() && (opts.contentTemplate || opts.viewContainerRef)) {\n const missing: 'contentTemplate' | 'viewContainerRef' =\n opts.contentTemplate ? 'viewContainerRef' : 'contentTemplate';\n const sink = opts.onHalfWiredSlot ?? defaultHalfWiredSlotWarn;\n sink(missing);\n }\n\n const decorated = new Map<\n string,\n {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n /**\n * Embedded view rendered from `contentTemplate` when bound.\n * Owned by the entry so re-decorations can destroy the prior\n * view before mounting a fresh one (every signal-driven\n * context update goes through destroy + remount; embedded\n * views do not expose a context-mutation API in the\n * standalone-component world that doesn't risk stale\n * `let-` bindings).\n */\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }\n >();\n let pendingRetry = false;\n let retryAttempts = 0;\n\n const destroyEmbeddedView = (entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }): void => {\n if (!entry.embeddedView) {\n return;\n }\n entry.embeddedView.destroy();\n entry.embeddedView = undefined;\n // The rendered nodes live under the descriptor span via appendChild;\n // EmbeddedViewRef.destroy() does not detach them, so clear manually.\n while (entry.descriptorSpan.firstChild) {\n opts.renderer.removeChild(\n entry.descriptorSpan,\n entry.descriptorSpan.firstChild,\n );\n }\n };\n\n const writeDescriptorContent = (\n entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n },\n announcement: string,\n context: CngxMatTabAggregatorContentContext,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView(entry);\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // See the rejection projector's identical call site for the\n // detached-view CD rationale (rootNodes move out of the\n // embedded view's logical parent into an SR-only span).\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(entry.descriptorSpan, node);\n }\n entry.embeddedView = view;\n return;\n }\n // Imperative fallback — also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView(entry);\n opts.renderer.setProperty(\n entry.descriptorSpan,\n 'textContent',\n announcement,\n );\n };\n\n const removeDecoration = (id: string): void => {\n const entry = decorated.get(id);\n if (!entry) {\n return;\n }\n const ownTokenId = entry.descriptorSpan.id;\n destroyEmbeddedView(entry);\n opts.renderer.removeClass(entry.el, className);\n opts.renderer.removeChild(entry.el, entry.descriptorSpan);\n restoreAriaDescribedbyExceptToken(\n entry.el,\n ownTokenId,\n opts.renderer,\n entry.priorAriaDescribedby,\n );\n decorated.delete(id);\n };\n\n const applyDecoration = (\n targetEl: HTMLElement,\n entry: CngxMatTabAggregatorErrorEntry,\n ): void => {\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${entry.id}-errors`;\n const descriptorSpan = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(descriptorSpan, srOnlyClassName);\n opts.renderer.setAttribute(descriptorSpan, 'id', spanId);\n opts.renderer.appendChild(targetEl, descriptorSpan);\n\n // See the read-via-nativeElement note in `applyDecorationAt` above —\n // Renderer2 has no `getAttribute` counterpart, so attribute reads\n // go through the native element directly.\n const priorAriaDescribedby = targetEl.getAttribute('aria-describedby');\n const tokens = priorAriaDescribedby\n ? priorAriaDescribedby.split(/\\s+/).filter(Boolean)\n : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n const decoratedEntry: {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n } = { el: targetEl, descriptorSpan, priorAriaDescribedby };\n writeDescriptorContent(decoratedEntry, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n decorated.set(entry.id, decoratedEntry);\n };\n\n const sync = (\n errorTabs: readonly CngxMatTabAggregatorErrorEntry[],\n ): void => {\n const liveIds = new Set<string>();\n for (const t of errorTabs) {\n liveIds.add(t.id);\n }\n for (const id of Array.from(decorated.keys())) {\n if (!liveIds.has(id)) {\n removeDecoration(id);\n }\n }\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n let needsRetry = false;\n for (const entry of errorTabs) {\n const targetEl = buttons.item(entry.idx);\n if (!targetEl) {\n needsRetry = true;\n continue;\n }\n const existing = decorated.get(entry.id);\n if (existing?.el === targetEl) {\n // Same target element: refresh content (slot path destroys +\n // remounts the embedded view; imperative path overwrites the\n // textContent property idempotently).\n writeDescriptorContent(existing, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n continue;\n }\n if (existing) {\n removeDecoration(entry.id);\n }\n applyDecoration(targetEl, entry);\n }\n\n if (!needsRetry) {\n retryAttempts = 0;\n return;\n }\n if (pendingRetry) {\n return;\n }\n if (retryAttempts >= maxRetryAttempts) {\n retryAttempts = 0;\n const sink =\n opts.onMaxRetriesReached ?? defaultRetryCeilingWarn(maxRetryAttempts);\n sink();\n return;\n }\n pendingRetry = true;\n retryAttempts++;\n afterNextRender(\n () => {\n pendingRetry = false;\n sync(opts.errorTabs());\n },\n { injector: opts.injector },\n );\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n // Track the slot template alongside `errorTabs` so a runtime\n // project/remove of `*cngxMatTabAggregatorContent` switches\n // every decorated entry between render paths.\n const errorTabs = opts.errorTabs();\n if (isFullyWired() && opts.contentTemplate) {\n opts.contentTemplate();\n }\n untracked(() => sync(errorTabs));\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n for (const id of Array.from(decorated.keys())) {\n removeDecoration(id);\n }\n });\n}\n\nfunction defaultHalfWiredSlotWarn(\n missing: 'contentTemplate' | 'viewContainerRef',\n): void {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired — ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n}\n\nfunction defaultRetryCeilingWarn(max: number): () => void {\n return () => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator decoration retry ceiling reached ' +\n `(${max} attempts) — MatTabHeader did not render ` +\n '`.mat-mdc-tab` buttons within the expected window. Likely ' +\n 'cause: Material upgrade broke the `.mat-mdc-tab` selector ' +\n 'contract or a consumer-side render stall. ' +\n 'Bound aggregators may remain visually undecorated ' +\n 'until the next state change.',\n );\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost } from '@cngx/common/tabs';\n\nimport type { CngxMatTabAggregatorErrorEntry } from './decoration-projectors';\n\n/**\n * Builds the reactive list of tabs whose bound error-aggregator wants\n * reveal, in registration (DOM) order. Feeds\n * {@link createMatTabAggregatorDecoration} for both the\n * `[cngxMatTabs]` (`<mat-tab-group>`) and `[cngxMatTabNav]`\n * (`<nav mat-tab-nav-bar>`) bridges - one body, two hosts (Pillar 3).\n *\n * Structural `equal` drops re-runs whose entry list is shape-identical\n * so the projector does not churn on no-op aggregator re-emissions.\n *\n * @internal\n */\nexport function createAggregatedErrorTabs(\n presenter: CngxTabGroupHost,\n): Signal<readonly CngxMatTabAggregatorErrorEntry[]> {\n return computed<readonly CngxMatTabAggregatorErrorEntry[]>(\n () => {\n const tabs = presenter.tabs();\n const acc: CngxMatTabAggregatorErrorEntry[] = [];\n for (let i = 0; i < tabs.length; i++) {\n const handle = tabs[i];\n const aggregator = handle.errorAggregator();\n if (aggregator?.shouldShow()) {\n acc.push({\n idx: i,\n id: handle.id,\n announcement: aggregator.announcement(),\n count: aggregator.errorCount(),\n label: handle.label() ?? '',\n });\n }\n }\n return acc;\n },\n {\n equal: (a, b) => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].idx !== b[i].idx ||\n a[i].id !== b[i].id ||\n a[i].announcement !== b[i].announcement ||\n a[i].count !== b[i].count ||\n a[i].label !== b[i].label\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration\n * projector when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` (the slot template) or\n * `ViewContainerRef` (the embedded-view host) — the half-wired-slot\n * misconfiguration. The projector silently falls back to the\n * imperative `textContent` path when this happens; the sink is the\n * only deliberate signal that the consumer's slot template will not\n * render.\n *\n * Override via `provideMatTabsConfig(withHalfWiredSlotSink(fn))` to\n * wire production telemetry (Sentry breadcrumbs, custom logger, CI\n * fail-fast). The library default is a dev-mode `console.warn`; the\n * exported {@link CNGX_DEFAULT_HALF_WIRED_SLOT_SINK} value lets test\n * doubles compose against a stable reference.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHalfWiredSlotSink = (\n missing: 'contentTemplate' | 'viewContainerRef',\n) => void;\n\n/**\n * Default sink — gated on dev-mode. Production callers see no\n * output; production telemetry lands only when a consumer overrides\n * via `withHalfWiredSlotSink(fn)`.\n *\n * @internal — exported only for {@link CngxMatTabsConfig.halfWiredSlotSink}'s\n * library default. Consumers should override via the config feature\n * rather than reach for this reference directly.\n */\nexport const CNGX_DEFAULT_HALF_WIRED_SLOT_SINK: CngxMatTabHalfWiredSlotSink = (\n missing,\n) => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired — ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n};\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport {\n type CngxMatTabHalfWiredSlotSink,\n CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} from './decorations/half-wired-slot-sink';\n\n/**\n * Behaviour knobs for `[cngxMatTabs]`. Single canonical surface\n * symmetric to `provideSelectConfig` in the select family - every\n * tunable is a `with*` feature on the same aggregator instead of\n * a standalone DI token, so consumers configure the directive\n * through one entry point and the API surface stays small.\n *\n * Per-instance Inputs win over `provideMatTabsConfigAt(...)`\n * (component scope), which wins over `provideMatTabsConfig(...)`\n * (root), which wins over the library defaults captured by\n * {@link CNGX_MAT_TABS_CONFIG_DEFAULTS}.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfig {\n /**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop. The\n * directive runs `createDomAnchorRetry` on every `afterNextRender`\n * until `.mat-mdc-tab-header` materialises in the host subtree;\n * the cap exists so a never-rendered host (e.g. `<mat-tab-group>`\n * gated behind a never-true `*ngIf` / `@defer`) does not re-arm\n * forever.\n *\n * Default: `5` - well above normal Material render lag (a single\n * `afterNextRender` is enough on every supported version), low\n * enough to surface a dev-mode `console.warn` promptly when the\n * consumer DOM never appears.\n *\n * Note: `<cngx-tab-overflow>`'s own attach loop uses `60` rAF\n * frames, not `5` - different scheduler, different budget. The\n * two caps are intentionally independent because the underlying\n * timing primitives differ; a shared \"anchor max attempts\" knob\n * would conflate one frame of `afterNextRender` with one rAF\n * frame, which they are not.\n */\n readonly anchorMaxAttempts?: number;\n\n /**\n * Diagnostic sink invoked when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` or its `ViewContainerRef`.\n * Default is a dev-mode `console.warn`; override via\n * {@link withHalfWiredSlotSink} to wire production telemetry\n * (Sentry breadcrumbs, custom logger, CI fail-fast).\n */\n readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;\n}\n\n/**\n * Library defaults for `[cngxMatTabs]`. Source of truth for every\n * key on {@link CngxMatTabsConfig}. Consumed by\n * {@link injectMatTabsConfig} as the final fallback.\n *\n * @internal\n */\nexport const CNGX_MAT_TABS_CONFIG_DEFAULTS = {\n anchorMaxAttempts: 5,\n halfWiredSlotSink: CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} as const satisfies Required<CngxMatTabsConfig>;\n\n/**\n * DI token holding a partial {@link CngxMatTabsConfig}. Set via\n * {@link provideMatTabsConfig} (app-wide) or\n * {@link provideMatTabsConfigAt} (component scope). Read via\n * {@link injectMatTabsConfig}, which merges with the library\n * defaults so callers never see `undefined`.\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_CONFIG = new InjectionToken<CngxMatTabsConfig>('CngxMatTabsConfig');\n\n/**\n * Feature object returned by `with*` mat-tabs functions and consumed\n * by {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}.\n * The optional `_target` discriminator is reserved for a future\n * cross-family aggregator (`provideCngxMatTabs`) that dispatches\n * features to the right provider - analogous to `_target: 'select'`\n * in the select family.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfigFeature {\n readonly config: Partial<CngxMatTabsConfig>;\n /** @internal */\n readonly _target?: 'mat-tabs';\n}\n\nfunction feature(config: Partial<CngxMatTabsConfig>): CngxMatTabsConfigFeature {\n return { config, _target: 'mat-tabs' };\n}\n\n/**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop.\n * See {@link CngxMatTabsConfig.anchorMaxAttempts} for default + rationale.\n *\n * @category ui/mat-tabs\n */\nexport function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature {\n return feature({ anchorMaxAttempts: n });\n}\n\n/**\n * Override the half-wired-slot diagnostic sink.\n * See {@link CngxMatTabsConfig.halfWiredSlotSink}.\n *\n * @category ui/mat-tabs\n */\nexport function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature {\n return feature({ halfWiredSlotSink: sink });\n}\n\nfunction mergeFeatures(features: readonly CngxMatTabsConfigFeature[]): Partial<CngxMatTabsConfig> {\n const merged: {\n -readonly [K in keyof CngxMatTabsConfig]?: CngxMatTabsConfig[K];\n } = {};\n for (const f of features) {\n Object.assign(merged, f.config);\n }\n return merged;\n}\n\n/**\n * App-wide `[cngxMatTabs]` configuration. Returns\n * `EnvironmentProviders` for use inside `bootstrapApplication`'s\n * `providers` array.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideMatTabsConfig(\n * withAnchorRetryAttempts(10),\n * withHalfWiredSlotSink((missing) => Sentry.captureMessage(`half-wired ${missing}`)),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfig(\n ...features: CngxMatTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) },\n ]);\n}\n\n/**\n * Component-scope `[cngxMatTabs]` configuration. Returns a\n * `Provider[]` so the result can be spread into a component's\n * `providers` or `viewProviders` (which cannot accept opaque\n * environment providers).\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs-page',\n * viewProviders: [\n * ...provideMatTabsConfigAt(withAnchorRetryAttempts(20)),\n * ],\n * ...\n * })\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfigAt(...features: CngxMatTabsConfigFeature[]): Provider[] {\n return [{ provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) }];\n}\n\n/**\n * Resolve the effective `[cngxMatTabs]` configuration for the current\n * injector. Always returns a fully populated, non-`undefined` object\n * so call sites do not need null-coalescing.\n *\n * Resolution order per key:\n * 1. `CNGX_MAT_TABS_CONFIG` value (set via\n * {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}).\n * 2. {@link CNGX_MAT_TABS_CONFIG_DEFAULTS} (library default).\n *\n * @category ui/mat-tabs\n */\nexport function injectMatTabsConfig(): Required<CngxMatTabsConfig> {\n const user = inject(CNGX_MAT_TABS_CONFIG, { optional: true }) ?? {};\n return {\n anchorMaxAttempts: user.anchorMaxAttempts ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.anchorMaxAttempts,\n halfWiredSlotSink: user.halfWiredSlotSink ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.halfWiredSlotSink,\n };\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabAggregatorContent` template.\n * Drives the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound aggregator wants\n * reveal. The surrounding span (with its `cngx-sr-only` class, its\n * stable id, and the `aria-describedby` wiring on the button)\n * stays library-owned - the slot only customises the descriptor\n * text or markup so consumers can swap the announcement phrasing\n * (counter pills, localised templates, branded prefixes) without\n * fighting the AT contract.\n *\n * `count` mirrors the bound aggregator's `errorCount()` at the\n * moment the decoration was applied; `label` is the human-readable\n * label of the tab (the Material `MatTab.textLabel`);\n * `announcement` is the resolved AT phrase (the same string the\n * imperative `textContent` fallback would write). All three are\n * snapshotted into the decorated entry - re-emissions of the\n * underlying signals re-fire the projector's effect, which\n * re-applies the decoration with the fresh context.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabAggregatorContentContext {\n /** Aggregated error count for this tab (≥ 1 when shown). */\n readonly count: number;\n /** Resolved tab label (Material `textLabel`). */\n readonly label: string;\n /**\n * Resolved AT announcement phrase the imperative fallback path\n * would write verbatim - the bound aggregator's `announcement()`\n * value at the moment the decoration was applied. Use this when\n * the consumer template wants to render the canonical phrase\n * alongside its own decoration (counter pill, branded prefix)\n * without re-injecting the aggregator.\n */\n readonly announcement: string;\n}\n\n/**\n * Structural slot directive marking the aggregator-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the aggregator's `announcement()` string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxStepBadge`, `CngxTabErrorBadge`, `CngxTabOverflowItem`).\n *\n * Material owns the tab-button chrome; the cngx descriptor span is\n * the only consumer-visible decoration seam, so this slot directive\n * lands with one in-package consumer (the package-private\n * aggregator-decoration projector).\n *\n * ```html\n * <mat-tab-group cngxMatTabs>\n * <ng-template\n * cngxMatTabAggregatorContent\n * let-count=\"count\"\n * let-label=\"label\"\n * >\n * {{ label }}: {{ count }} validation issue(s)\n * </ng-template>\n * <mat-tab label=\"Profile\" cngxMatTabError=\"profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabRejectionContent\n */\n@Directive({\n selector: 'ng-template[cngxMatTabAggregatorContent]',\n exportAs: 'cngxMatTabAggregatorContent',\n standalone: true,\n})\nexport class CngxMatTabAggregatorContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabAggregatorContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabRejectionContent` template. Drives\n * the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound `commitAction`\n * rejects a tab change. The surrounding span (with its\n * `cngx-sr-only` class, its stable id, and the `aria-describedby`\n * wiring on the button) stays library-owned - the slot only\n * customises the descriptor text or markup so consumers can swap\n * the rejection phrasing (branded prefixes, retry CTAs, localised\n * templates) without fighting the AT contract.\n *\n * `failedHandleId` is the stable id of the rejected handle (the\n * same id the descriptor span uses as its `${id}-rejected` DOM id);\n * `originLabel` is the label the rollback returned to (when the\n * presenter exposes an `originIndexDuringCommit` and that index\n * resolves to a handle with a non-empty label) - `undefined` when\n * no labelled rollback origin is resolvable; `fallbackText` is the\n * built-in i18n phrase the imperative fallback path would write\n * verbatim (typically `commitRolledBackTo(originLabel)` when the\n * origin is resolvable, `commitFailedRetry` otherwise).\n *\n * **Re-instantiation warning.** The decoration projector destroys\n * the embedded view and creates a fresh one on every `descriptorText`\n * re-emission - typical when the rollback origin label resolves\n * later than the failed-handle id (e.g. `presenter.tabs()` re-emits\n * mid-rejection and the origin label flows in on the second tick).\n * The slot template runs to the end of its lifecycle each time;\n * consumers wiring expensive subtrees (e.g. an embedded chart, a\n * complex form) should treat this as a destroy + remount cycle and\n * lift heavy state into a sibling `*ngTemplateOutlet`-friendly\n * structure outside the slot. Cheap text + simple markup (the\n * intended use) sees no observable difference.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabRejectionContentContext {\n /** Stable id of the rejected `CngxTabHandle`. */\n readonly failedHandleId: string;\n /**\n * Label of the rollback origin (only set when the presenter's\n * `originIndexDuringCommit` resolves to a handle with a non-empty\n * label).\n */\n readonly originLabel: string | undefined;\n /**\n * Library-default i18n phrase the imperative fallback path would\n * write verbatim. Use this if the consumer template wants to\n * render the canonical phrase as a base alongside its own\n * decoration (icon, branded prefix, retry CTA).\n */\n readonly fallbackText: string;\n}\n\n/**\n * Structural slot directive marking the rejection-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the resolved fallback string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxMatTabAggregatorContent`, `CngxStepBadge`,\n * `CngxTabErrorBadge`).\n *\n * Cascade resolution:\n * 1. Per-instance `*cngxMatTabRejectionContent` template wins\n * via `contentChild(CngxMatTabRejectionContent)`.\n * 2. Library default - imperative `Renderer2.createElement('span')`\n * with `textContent = fallbackText` (the resolved\n * `commitRolledBackTo(originLabel)` / `commitFailedRetry`\n * phrase from `injectTabsI18n()`).\n *\n * ```html\n * <mat-tab-group cngxMatTabs [commitAction]=\"save\">\n * <ng-template\n * cngxMatTabRejectionContent\n * let-failedHandleId=\"failedHandleId\"\n * let-originLabel=\"originLabel\"\n * let-fallbackText=\"fallbackText\"\n * >\n * <span class=\"brand-icon\" aria-hidden=\"true\"></span>\n * {{ fallbackText }}\n * @if (originLabel) {\n * <button (click)=\"retry(failedHandleId)\">Retry</button>\n * }\n * </ng-template>\n * <mat-tab label=\"Profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabAggregatorContent, CngxMatTabError\n */\n@Directive({\n selector: 'ng-template[cngxMatTabRejectionContent]',\n exportAs: 'cngxMatTabRejectionContent',\n standalone: true,\n})\nexport class CngxMatTabRejectionContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabRejectionContentContext>>(TemplateRef);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n type DestroyRef,\n effect,\n inject,\n type Injector,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Options for {@link mountLiveRegionAnnouncer}.\n *\n * @internal\n */\nexport interface CngxMatTabLiveRegionOptions {\n /** Reactive announcement text. Empty string keeps the region quiet. */\n readonly announcement: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `'cngx-sr-only'`. */\n readonly srOnlyClassName?: string;\n /** Default: `'polite'`. */\n readonly politeness?: 'polite' | 'assertive';\n}\n\n/**\n * Mount a polite ARIA live region under `document.body` and keep\n * its `textContent` in sync with the supplied `announcement`\n * signal. Empty string between transitions so AT readers stay quiet\n * on no-op CD ticks.\n *\n * The span lives at body scope (matching the CDK `LiveAnnouncer`\n * placement convention) so Material's MDC tolerance for unexpected\n * children at the `<mat-tab-group>` host root is irrelevant — the\n * live-region never lands inside Material's component DOM. The\n * element's host bindings replicate {@link CngxLiveRegion}\n * imperatively (this attribute directive owns no template, so the\n * declarative `cngxLiveRegion` selector is unreachable).\n * Cleaned up via the supplied `DestroyRef`.\n *\n * @internal — package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport function mountLiveRegionAnnouncer(\n opts: CngxMatTabLiveRegionOptions,\n): void {\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const politeness = opts.politeness ?? 'polite';\n const role = politeness === 'assertive' ? 'alert' : 'status';\n const doc = runInInjectionContext(opts.injector, () => inject(DOCUMENT));\n const liveRegionEl = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(liveRegionEl, srOnlyClassName);\n opts.renderer.setAttribute(liveRegionEl, 'aria-live', politeness);\n opts.renderer.setAttribute(liveRegionEl, 'aria-atomic', 'true');\n opts.renderer.setAttribute(liveRegionEl, 'aria-relevant', 'additions text');\n opts.renderer.setAttribute(liveRegionEl, 'role', role);\n opts.renderer.appendChild(doc.body, liveRegionEl);\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const text = opts.announcement();\n untracked(() => {\n opts.renderer.setProperty(liveRegionEl, 'textContent', text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n opts.renderer.removeChild(doc.body, liveRegionEl);\n });\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost, injectTabsI18n } from '@cngx/common/tabs';\n\n/**\n * Reactive rejection-state derivation shared by the descriptor-text\n * pipeline and the `*cngxMatTabRejectionContent` slot context.\n *\n * Both consumers need the same source resolution (failed index →\n * origin index → origin tab label), so a single factory deduplicates\n * the lookup and keeps `[cngxMatTabs]` thin enough to pass the\n * organism-LOC guard.\n *\n * @internal — package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport interface CngxMatTabRejectionState {\n /**\n * Reactive label of the rollback origin — `undefined` when no\n * rejection is pinned, when the origin index is unresolved, or\n * when the origin tab carries no label.\n */\n readonly originLabel: Signal<string | undefined>;\n /**\n * Reactive descriptor phrase — the `commitRolledBackTo(originLabel)`\n * variant when an origin label resolves, falling back to\n * `commitFailedRetry` otherwise. Empty string between rejections\n * (the projector clears the decoration entirely on\n * `failedHandleId === null`, so consumers only consult this while\n * a rejection is pinned).\n */\n readonly descriptorText: Signal<string>;\n /**\n * SR-friendly text rendered inside the polite live-region span.\n * Mirrors `tab-group.component.ts`'s `liveAnnouncement` rejection\n * arm so AT users on Material `<mat-tab-group>` get the same\n * commit-transition narrative as cngx-native:\n *\n * 1. `'pending'` → `i18n.commitInFlight`\n * 2. `'error'` → `commitRolledBackTo(originLabel)` when an\n * origin label resolves, `commitFailedRetry` otherwise\n * 3. anything else → empty string (region stays quiet on no-op\n * CD ticks; mat-tabs does not announce success transitions\n * because Material's own ARIA already narrates the\n * activeIndex change — duplicating would make AT readers\n * hear two utterances per nav)\n */\n readonly liveAnnouncement: Signal<string>;\n}\n\n/**\n * Build the {@link CngxMatTabRejectionState} bundle for a given\n * presenter + i18n pair. Two computeds share one source-walk\n * (`lastFailedIndex` → `originIndexDuringCommit` → `tabs[idx].label()`)\n * via Angular's signal memoisation — the second computed re-uses\n * the first's cached `originLabel` value, so the `tabs()` traversal\n * happens at most once per state change.\n *\n * @internal\n */\nexport function createRejectionState(\n presenter: CngxTabGroupHost,\n i18n: ReturnType<typeof injectTabsI18n>,\n): CngxMatTabRejectionState {\n const originLabel: Signal<string | undefined> = computed(() => {\n const failedIdx = presenter.lastFailedIndex();\n if (failedIdx === undefined) {\n return undefined;\n }\n const originIdx = presenter.originIndexDuringCommit();\n if (originIdx === undefined) {\n return undefined;\n }\n return presenter.tabs()[originIdx]?.label() ?? undefined;\n });\n\n const descriptorText: Signal<string> = computed(() => {\n if (presenter.lastFailedIndex() === undefined) {\n return '';\n }\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n });\n\n const liveAnnouncement: Signal<string> = computed(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n }\n return '';\n });\n\n return { originLabel, descriptorText, liveAnnouncement };\n}\n","import {\n computed,\n InjectionToken,\n type Injector,\n signal,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport type { MatTab } from '@angular/material/tabs';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport type { CngxTabHandle } from '@cngx/common/tabs';\n\nimport type { MaterialPrivateSurfaces } from './private-surfaces';\n\n/**\n * Wiring bundle returned from {@link createMatTabHandle}. The\n * directive owns the writable `errorAggregator` slot so the\n * `[cngxMatTabError]` per-tab directive can pump aggregators into\n * it; `label` and `disabled` track Material's current state via a\n * `toSignal(matTab._stateChanges)` trigger.\n */\nexport interface CngxMatTabHandleSetup {\n readonly handle: CngxTabHandle;\n /** Convenience mirror of `handle.label`. */\n readonly label: Signal<string | undefined>;\n /** Convenience mirror of `handle.disabled`. */\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: WritableSignal<CngxErrorAggregatorContract | undefined>;\n /**\n * Direct invalid flag the `[cngxMatTabErrorFlag]` directive writes -\n * `string | boolean`, mirroring `CngxTab.error`. Folds into the\n * handle's `hasError` / `errorMessage` alongside the aggregator.\n */\n readonly directError: WritableSignal<string | boolean>;\n}\n\n/**\n * Translates a Material `MatTab` into a cngx {@link CngxTabHandle}\n * plus a writable `errorAggregator` slot the `[cngxMatTabError]`\n * directive binds.\n *\n * - `id` - fresh `idSeed()` value; a label-keyed id would collide\n * when two tabs share a label.\n * - `label` / `disabled` - `computed` signals retriggered by\n * `toSignal(matTab._stateChanges)`. Bridge lifetime is tied to\n * the supplied `injector` (typically a per-tab child\n * `EnvironmentInjector`). `_stateChanges` is a Material-internal\n * surface.\n * - `errorAggregator` - writable seeded at `undefined`;\n * `[cngxMatTabError]` writes its bound aggregator in and resets\n * on teardown. The handle exposes `.asReadonly()` to preserve the\n * `CngxTabHandle` contract.\n * - `directError` - writable seeded at `false`;\n * `[cngxMatTabErrorFlag]` writes its `string | boolean` value in\n * and resets on teardown. Folds into `hasError` / `errorMessage`.\n *\n * @category ui/mat-tabs\n */\nexport function createMatTabHandle(\n matTab: MatTab,\n idSeed: () => string,\n injector: Injector,\n): CngxMatTabHandleSetup {\n // Typed local - anchors `MaterialPrivateSurfaces.StateChangeSource`\n // at the consumer site so an upgrade-watch grep lands here too.\n // Documentation-only at runtime; MatTab's public typing already\n // exposes `_stateChanges`.\n const stateChangeSource: MaterialPrivateSurfaces.StateChangeSource = matTab;\n // `equal: () => false` is load-bearing - `_stateChanges` is a\n // `Subject<void>`, so `Object.is(undefined, undefined)` would dedup\n // every emission and the dependent computeds would never recompute.\n const stateChangeTrigger = toSignal(stateChangeSource._stateChanges, {\n injector,\n initialValue: undefined,\n equal: () => false,\n });\n const label = computed<string | undefined>(() => {\n stateChangeTrigger();\n return matTab.textLabel;\n });\n const disabled = computed<boolean>(() => {\n stateChangeTrigger();\n return matTab.disabled;\n });\n const errorAggregator = signal<CngxErrorAggregatorContract | undefined>(undefined);\n // Direct invalid flag written by `[cngxMatTabErrorFlag]` - the\n // Material-side author surface mirroring `CngxTab.error`.\n const directError = signal<string | boolean>(false);\n // Folded error state for the widened `CngxTabHandle` contract. Direct\n // flag OR the aggregator's reveal-gated `shouldShow()` (so deferred-\n // reveal validation stays silent until revealed).\n const hasError = computed<boolean>(\n () => {\n const direct = directError();\n return (direct !== false && direct !== '') || (errorAggregator()?.shouldShow?.() ?? false);\n },\n { equal: Object.is },\n );\n // Resolved direct-error message: the flag string when non-empty, else\n // `undefined`. The aggregator carries its own announcement separately.\n const errorMessage = computed<string | undefined>(() => {\n const direct = directError();\n return typeof direct === 'string' && direct !== '' ? direct : undefined;\n });\n // Material owns its own tab lifecycle - the cngx dismissable/addable\n // affordances are native-only by design, so the Material handle pins\n // `closable` to `undefined` (group-default, never a close button).\n const closable = signal<boolean | undefined>(undefined);\n // Material owns its tab-button chrome (no DOM seam for a stacked\n // second line), so the bridge pins `subLabel` to `undefined` - same\n // native-only staging as `closable`.\n const subLabel = signal<string | undefined>(undefined);\n // `nextUid` is process-wide monotonic, so `${id}-errors` descriptor\n // ids stay unique across coexisting `[cngxMatTabs]` instances.\n const id = idSeed();\n return {\n handle: {\n id,\n label,\n subLabel: subLabel.asReadonly(),\n disabled,\n errorAggregator: errorAggregator.asReadonly(),\n hasError,\n errorMessage,\n closable: closable.asReadonly(),\n },\n label,\n disabled,\n errorAggregator,\n directError,\n };\n}\n\n/**\n * Factory signature for {@link createMatTabHandle}. The DI token\n * {@link CNGX_MAT_TAB_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHandleFactory = typeof createMatTabHandle;\n\n/**\n * DI token fronting the per-tab handle factory used by\n * `[cngxMatTabs]`. Default is {@link createMatTabHandle}. Symmetric\n * with `CNGX_MAT_STEP_HANDLE_FACTORY` and\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`.\n *\n * The seam separates handle shape (factory body) from id keying\n * (the supplied `idSeed` closure). Overrides may call, ignore, or\n * replace `idSeed` - server-synced ids, deterministic test ids,\n * consumer-domain ids - without touching the factory body.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_TAB_HANDLE_FACTORY,\n * useValue: ((tab, idSeed, injector) => {\n * const setup = createMatTabHandle(tab, idSeed, injector);\n * reportTabRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatTabHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TAB_HANDLE_FACTORY = new InjectionToken<CngxMatTabHandleFactory>(\n 'CNGX_MAT_TAB_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatTabHandle,\n },\n);\n","import {\n contentChildren,\n createEnvironmentInjector,\n DestroyRef,\n Directive,\n effect,\n EnvironmentInjector,\n inject,\n InjectionToken,\n untracked,\n} from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MAT_TAB_HANDLE_FACTORY, type CngxMatTabHandleSetup } from './material-bridge/handle';\n\n/**\n * Per-MatTab registry entry. The child `EnvironmentInjector` scopes\n * the per-tab `_stateChanges` bridge - destroying it fires\n * `takeUntilDestroyed` so the subscription unsubscribes\n * deterministically.\n *\n * @internal\n */\ninterface CngxMatTabsRegistryEntry {\n readonly setup: CngxMatTabHandleSetup;\n readonly childInjector: EnvironmentInjector;\n}\n\n/**\n * Read-mostly contract for the per-tab handle-setup registry.\n * `[cngxMatTabError]` and any future `[cngxMatTab*]` decoration\n * directive injects this with `{ host: true }` to reach the\n * per-handle `errorAggregator` slot without walking the concrete\n * registry class.\n *\n * Return type narrows to `Pick<..., 'errorAggregator'>` so the\n * access path exposes only the per-handle aggregator slot; the\n * rest of the setup stays internal bookkeeping.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsRegistryHost {\n /**\n * Returns the per-handle writable slots (`errorAggregator`,\n * `directError`), or `undefined` before the tab is registered. The\n * `contentChildren(MatTab)` query lands during content-init, so a\n * same-microtask injection from an attribute directive can race;\n * consumers recover by tracking `presenter.tabs()` and re-attempting\n * on the next sync tick.\n */\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined;\n}\n\n/**\n * DI token the {@link CngxMatTabsRegistry} directive provides via\n * `useExisting`. Sibling per-tab directives inject this with\n * `{ host: true }` to reach per-handle slots without walking the\n * concrete registry class.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_REGISTRY_HOST = new InjectionToken<CngxMatTabsRegistryHost>(\n 'CngxMatTabsRegistryHost',\n);\n\n/**\n * Sibling host-directive that owns the per-MatTab handle registry\n * for `[cngxMatTabs]`. Keeps the parent under the level-4 organism\n * LOC guard and lets per-tab decoration directives reach the\n * registry through a typed token.\n *\n * Owns: `contentChildren(MatTab)` query, the `setupsByTab` map\n * (per-tab cngx setup paired with a child `EnvironmentInjector`\n * scoping the `_stateChanges` bridge), an `effect()` that diffs the\n * MatTab list and (un)registers handles with `CNGX_TAB_GROUP_HOST`,\n * and a `DestroyRef` cleanup that destroys every child injector.\n *\n * Composition: `[cngxMatTabs]` declares this in `hostDirectives`;\n * both share the parent's `CngxTabGroupPresenter` and the same\n * `<mat-tab-group>` content-children scope.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CNGX_MAT_TABS_REGISTRY_HOST\n */\n@Directive({\n selector: '[cngxMatTabsRegistry]',\n exportAs: 'cngxMatTabsRegistry',\n standalone: true,\n providers: [\n {\n provide: CNGX_MAT_TABS_REGISTRY_HOST,\n useExisting: CngxMatTabsRegistry,\n },\n ],\n})\nexport class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly createHandle = inject(CNGX_MAT_TAB_HANDLE_FACTORY);\n\n private readonly matTabs = contentChildren(MatTab, { descendants: true });\n // Map (not WeakMap) so the diff loop in `syncHandles` can iterate\n // to find removed tabs without a parallel `Set<MatTab>`. Entries\n // are explicitly deleted when the matching MatTab leaves the\n // children set, AND the map goes away on directive destroy.\n private readonly setupsByTab = new Map<MatTab, CngxMatTabsRegistryEntry>();\n\n constructor() {\n effect(() => {\n const tabs = this.matTabs();\n untracked(() => this.syncHandles(tabs));\n });\n\n this.destroyRef.onDestroy(() => {\n for (const entry of this.setupsByTab.values()) {\n // Disposes the per-tab `toSignal(_stateChanges)` bridge.\n entry.childInjector.destroy();\n }\n this.setupsByTab.clear();\n });\n }\n\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined {\n return this.setupsByTab.get(matTab)?.setup;\n }\n\n private syncHandles(tabs: readonly MatTab[]): void {\n const liveTabs = new Set<MatTab>(tabs);\n for (const tab of tabs) {\n if (this.setupsByTab.has(tab)) {\n continue;\n }\n // Per-tab child injector scopes the `toSignal(_stateChanges)`\n // bridge inside createMatTabHandle - destroying it on tab\n // removal fires `takeUntilDestroyed`.\n const childInjector = createEnvironmentInjector([], this.envInjector);\n const idSeed = () => nextUid('cngx-mat-tab-');\n const setup = this.createHandle(tab, idSeed, childInjector);\n this.setupsByTab.set(tab, { setup, childInjector });\n this.presenter.register(setup.handle);\n }\n // Snapshot entries before the loop so multi-key deletes inside\n // the body never collide with iterator state.\n for (const [tab, entry] of Array.from(this.setupsByTab.entries())) {\n if (liveTabs.has(tab)) {\n continue;\n }\n entry.childInjector.destroy();\n this.setupsByTab.delete(tab);\n this.presenter.unregister(entry.setup.handle.id);\n }\n }\n}\n","import type { CngxTabOverflowDomAdapter } from '@cngx/common/tabs';\n\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Material variant of {@link CngxTabOverflowDomAdapter}.\n *\n * `resolveStripRoot` walks from host up to `<mat-tab-header>` and\n * locates `.mat-mdc-tab-label-container` via any rendered\n * `.mat-mdc-tab` descendant — Material's IO-friendly scroll\n * container.\n *\n * `resolveTabButton` indexes positionally; Material owns the DOM\n * and cngx handle ids never reach the button elements. Index\n * correlates against `presenter.tabs()` registration order.\n *\n * Wire it via the directive's\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` provider:\n *\n * ```ts\n * providers: [\n * { provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n * useValue: createCngxMatTabOverflowDomAdapter }\n * ]\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n // Returning null is a retry signal — the rAF loop polls again\n // on the next frame, succeeds once MatTabHeader has committed.\n const header = host.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n const anyTab = header?.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n );\n return (\n anyTab?.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR,\n ) ?? null\n );\n },\n resolveTabButton(_handle, root, idx) {\n return (\n root\n .querySelectorAll<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n )\n .item(idx) ?? null\n );\n },\n };\n}\n","import {\n afterNextRender,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n ElementRef,\n Injectable,\n inject,\n Injector,\n isDevMode,\n Renderer2,\n type Signal,\n type TemplateRef,\n ViewContainerRef,\n type ComponentRef,\n} from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n CNGX_TAB_PANEL_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n type CngxTabPanelHost,\n} from '@cngx/common/tabs';\nimport { CngxTabOverflow } from '@cngx/ui/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { injectMatTabsConfig } from './mat-tabs-config';\nimport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nimport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\nimport { CngxMatTabsRegistry } from './mat-tabs-registry.directive';\nimport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n\nimport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n\n/**\n * Implements {@link CngxTabPanelHost} for the programmatically\n * mounted overflow popover. Delegates to the directive's\n * `CNGX_TAB_GROUP_HOST` presenter; both template lookups return\n * `null` because Material renders labels through `<mat-tab>` and\n * projected `<mat-tab-content>`.\n *\n * Class instead of factory-returned literal so a telemetry or\n * branded variant can subclass + swap via `useClass`. The directive\n * registers it once and binds `CNGX_TAB_PANEL_HOST` with\n * `useExisting`.\n *\n * @internal\n */\n@Injectable()\nexport class CngxMatTabsPanelHostAdapter implements CngxTabPanelHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n\n readonly tabs = this.presenter.tabs;\n readonly activeId = this.presenter.activeId;\n readonly orientation = this.presenter.orientation;\n\n selectById(id: string): void {\n this.presenter.selectById(id);\n }\n\n labelTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n\n contentTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n}\n\n/**\n * Attaches to an existing `<mat-tab-group>` and wires it to a\n * {@link CngxTabGroupPresenter} - consumers get the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` and\n * `<cngx-banner-on />` compose as children), and the tab-handle\n * registry from one attribute.\n *\n * Topology inverts `<cngx-mat-stepper>`: Material is the host, cngx\n * is the instrumentation layer. `inject(MatTabGroup, { self: true })`\n * resolves on the consumer's own element - no content projection\n * blocker applies here.\n *\n * Rejection (`--error`) and aggregator (`--has-errors`) visuals\n * live in the package-private projector factories under\n * `./decorations/`; this directive supplies their reactive triggers\n * and the delegators consumer templates call.\n *\n * @playground Form error aggregation ./examples/form-errors/form-errors.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabsRegistry, CngxMatTabError, CngxMatStepper\n */\n@Directive({\n selector: '[cngxMatTabs]',\n exportAs: 'cngxMatTabs',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxTabGroupPresenter,\n inputs: ['activeIndex', 'orientation', 'loop', 'commitAction', 'commitMode'],\n outputs: ['activeIndexChange'],\n },\n // Provides `CNGX_MAT_TABS_REGISTRY_HOST` so per-tab decoration\n // directives reach the registry through a typed token rather\n // than injecting this concrete class.\n CngxMatTabsRegistry,\n ],\n providers: [\n // Material variant of the overflow molecule's DOM-resolution\n // strategy. Swaps `.cngx-tabs__strip-wrapper` walks for the Material\n // `.mat-mdc-tab-header` → `.mat-mdc-tab-label-container` walk and\n // index-based `.mat-mdc-tab` resolution.\n {\n provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n useValue: createCngxMatTabOverflowDomAdapter,\n },\n // Panel-host adapter for the programmatically mounted overflow\n // molecule. `useExisting` binding below ensures every injection\n // resolves to the single per-host instance. The cngx-native\n // `<cngx-tab-group>` path keeps its own `useExisting:\n // CngxTabGroup` provider - sits one injector layer closer.\n CngxMatTabsPanelHostAdapter,\n {\n provide: CNGX_TAB_PANEL_HOST,\n useExisting: CngxMatTabsPanelHostAdapter,\n },\n ],\n})\nexport class CngxMatTabs {\n private readonly matTabGroup = inject(MatTabGroup, { self: true });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n // Field order matters - `overflowRef` reads `viewContainerRef` at\n // class-init time. The VCR also feeds the aggregator-decoration\n // slot path further down.\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n // Programmatic mount of the cngx overflow molecule.\n // `injector: this.injector` is load-bearing - without it,\n // `vcr.createComponent` walks the host-template's parent VCR for\n // DI resolution, missing this directive's `CNGX_TAB_PANEL_HOST`\n // and `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` providers, and the\n // molecule NG0201s on `inject(CNGX_TAB_PANEL_HOST)`. The molecule\n // initially lands as a sibling of `<mat-tab-group>`; the\n // `afterNextRender` block below moves it into\n // `.mat-mdc-tab-header`.\n private readonly overflowRef: ComponentRef<CngxTabOverflow> =\n this.viewContainerRef.createComponent(CngxTabOverflow, {\n injector: this.injector,\n });\n\n private readonly aggregatorContentSlot = contentChild(CngxMatTabAggregatorContent);\n private readonly aggregatorContentTemplate: Signal<TemplateRef<CngxMatTabAggregatorContentContext> | null> =\n computed(() => this.aggregatorContentSlot()?.templateRef ?? null);\n private readonly rejectionContentSlot = contentChild(CngxMatTabRejectionContent);\n private readonly rejectionContentTemplate: Signal<TemplateRef<CngxMatTabRejectionContentContext> | null> =\n computed(() => this.rejectionContentSlot()?.templateRef ?? null);\n private readonly i18n = injectTabsI18n();\n\n // Identity equal on `string | null` - collapses `tabs()` re-emits\n // that don't change the failed-target id.\n private readonly failedHandleId = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n // Bundle shares one source-walk across descriptorText / originLabel\n // / liveAnnouncement - pillar-2 phrasing parity with cngx-native.\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n\n // Shared with `[cngxMatTabNav]` - one body, two hosts (Pillar 3).\n // Structural equal lives in the factory so the projector doesn't\n // churn on no-op aggregator re-emissions.\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n const matTabsConfig = injectMatTabsConfig();\n\n // Polite live region - attribute directive owns no template, so\n // the helper attaches the span at document.body (CDK\n // LiveAnnouncer convention) and mirrors `CngxLiveRegion`'s host\n // bindings imperatively.\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Decoration projectors own DOM-mutation state plus `effect()`\n // registration; the directive only supplies reactive triggers.\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.rejectionContentTemplate,\n viewContainerRef: this.viewContainerRef,\n originLabel: this.rejectionState.originLabel,\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.aggregatorContentTemplate,\n viewContainerRef: this.viewContainerRef,\n onHalfWiredSlot: matTabsConfig.halfWiredSlotSink,\n });\n\n this.destroyRef.onDestroy(() => this.overflowRef.destroy());\n\n // Anchor the overflow molecule inside `.mat-mdc-tab-header` so\n // the More button pins to the strip's trailing edge. Bounded\n // `createDomAnchorRetry` covers the deferred-host case\n // (`<mat-tab-group>` gated behind `*ngIf` / `@defer`); the cap\n // dev-warns when consumer DOM never materialises. The\n // flex-layout skin in `mat-tabs.css` handles positioning - no\n // imperative layout work needed.\n const anchorMaxAttempts = matTabsConfig.anchorMaxAttempts;\n const anchorRetry = inject(CNGX_DOM_ANCHOR_RETRY_FACTORY)({\n attempt: () => {\n const headerEl = this.hostEl.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n if (!headerEl) {\n return null;\n }\n const overflowEl = this.overflowRef.location.nativeElement as HTMLElement;\n this.renderer.addClass(overflowEl, 'cngx-mat-tabs-more');\n this.renderer.appendChild(headerEl, overflowEl);\n return true;\n },\n maxAttempts: anchorMaxAttempts,\n schedule: (cb) => {\n afterNextRender(cb, { injector: this.injector });\n return () => undefined;\n },\n onGiveUp: () => {\n if (isDevMode()) {\n console.warn(\n `[CngxMatTabs] Could not anchor <cngx-tab-overflow> after ${anchorMaxAttempts} ` +\n 'attempts - .mat-mdc-tab-header was not found inside the ' +\n 'host. The More popover will fall back to a sibling-of-' +\n '<mat-tab-group> position; verify Material rendered the ' +\n 'strip (e.g. consumer is not gating <mat-tab-group> behind ' +\n 'a never-true *ngIf / @defer).',\n );\n }\n },\n });\n afterNextRender(() => anchorRetry.start());\n this.destroyRef.onDestroy(() => anchorRetry.cancel());\n\n createMaterialBidirectionalSync({\n presenterIndex: this.presenter.activeIndex,\n readSelectedIndex: () => this.matTabGroup.selectedIndex ?? 0,\n writeSelectedIndex: (i) => {\n this.matTabGroup.selectedIndex = i;\n },\n selectionChange$: this.matTabGroup.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => this.presenter.select(i),\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors `CngxTabGroup.clearLastFailed()` so a\n * template ref (`#mt=\"cngxMatTabs\"`) is enough - no host-token\n * injection needed.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n Injector,\n Renderer2,\n type Signal,\n} from '@angular/core';\n\nimport {\n CNGX_TAB_GROUP_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n} from '@cngx/common/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\n\n/**\n * Layers the cngx error / rejection / announcement layer onto\n * Material's native router tabs (`<nav mat-tab-nav-bar>` /\n * `<a mat-tab-link>` / `<mat-tab-nav-panel>`). The parallel bridge to\n * {@link CngxMatTabs}: `MatTabNav` has no `MatTab` and no\n * `selectedIndex`, so handles register per `<a mat-tab-link>` via\n * {@link CngxMatTabLink}, and the decoration projectors target\n * `.mat-mdc-tab-link` instead of `.mat-mdc-tab`.\n *\n * Gating is **native**: each link is a `routerLink`, so the router runs\n * `CanDeactivate` directly and this directive installs no\n * commit-action. The active index follows the route - add\n * `[cngxTabsRouteSync]` to the same `<nav>` and give each\n * `[cngxMatTabLink]` an `id` matching its route segment; route-sync\n * reflects `NavigationEnd` onto `activeIndex` (its commit-action stays\n * dormant because link clicks navigate natively, never through\n * `presenter.select`). Ableitung statt Verwaltung - the route-active\n * link is the single source of the active index.\n *\n * Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the\n * `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and\n * the live-region announcer come for free, identical to the cngx\n * organism (Pillar 2 - same communication across skins).\n *\n * Decoration content-template slots (`*cngxMatTabRejectionContent` /\n * `*cngxMatTabAggregatorContent`) are not forwarded on this bridge yet -\n * the projectors render their built-in `cngx-sr-only` spans. The slot\n * inputs that `[cngxMatTabs]` exposes are a deferred follow-up.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabLink, CngxMatTabs, CngxTabsRouteSync\n */\n@Directive({\n selector: '[cngxMatTabNav]',\n exportAs: 'cngxMatTabNav',\n standalone: true,\n hostDirectives: [CngxTabGroupPresenter],\n})\nexport class CngxMatTabNav {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly i18n = injectTabsI18n();\n\n // Stable id of the rejected link, or null. Identity equal collapses\n // tabs() re-emits that don't change the failed-target id.\n private readonly failedHandleId: Signal<string | null> = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Same projector bodies as `[cngxMatTabs]`; only the per-tab element\n // selector differs (`.mat-mdc-tab-link` vs `.mat-mdc-tab`).\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n originLabel: this.rejectionState.originLabel,\n buttonSelector: '.mat-mdc-tab-link',\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n buttonSelector: '.mat-mdc-tab-link',\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors {@link CngxMatTabs.clearLastFailed} so a\n * template ref (`#nav=\"cngxMatTabNav\"`) is enough.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MatTabLink } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost, type CngxTabHandle } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registers an `<a mat-tab-link>` anchor as a {@link CngxTabHandle}\n * with the enclosing {@link CngxMatTabNav} presenter. `mat-tab-nav-bar`\n * has no `MatTab` to hang a handle on (the links are the tabs), so this\n * per-link directive is the registration seam - symmetric with how\n * `CngxTab` registers in the cngx-native path and how\n * {@link CngxMatTabsRegistry} registers each `<mat-tab>`.\n *\n * Registration order follows DOM order (Angular instantiates content\n * directives top-to-bottom), so the presenter's `tabs()` index aligns\n * with `nav.querySelectorAll('.mat-mdc-tab-link')` - the index the\n * decoration projectors correlate against.\n *\n * Gating is native: the link's `routerLink` runs `CanDeactivate`\n * directly, so this directive installs no commit-action. The active\n * index follows the route through `[cngxTabsRouteSync]` on the nav,\n * which matches each handle's `id` (set to the route segment) against\n * the URL.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-link.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabNav, CngxMatTabs, CngxTab\n */\n@Directive({\n selector: '[cngxMatTabLink]',\n exportAs: 'cngxMatTabLink',\n standalone: true,\n})\nexport class CngxMatTabLink implements OnInit {\n private readonly matLink = inject(MatTabLink, { self: true });\n private readonly host = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Handle id. Set it to the link's route segment so the nav's\n * `[cngxTabsRouteSync]` reflects the active route onto this tab via\n * the default `(h) => [h.id]` mapping. Defaults to a fresh uid when\n * route-sync is not used.\n */\n readonly id = input<string>(nextUid('cngx-mat-tab-link-'));\n /** Accessible label fed to the live-region announcer. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Direct error flag for the link - `true` or a non-empty string marks\n * it invalid (the string doubles as the message). Mirrors\n * `CngxTab.error` and `[cngxMatTabErrorFlag]`.\n */\n readonly error = input<string | boolean>(false);\n /** Optional rich error aggregator for the link. */\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n private readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n private readonly hasError: Signal<boolean> = computed(\n () => {\n const direct = this.error();\n return (\n (direct !== false && direct !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n // Material's MatTabLink.disabled is a plain property, not a signal;\n // nav links rarely toggle disabled at runtime, so snapshot it onto a\n // signal at registration. A live binding would need a Material\n // reactive surface MatTabLink does not expose.\n private readonly disabledState = signal<boolean>(false);\n\n ngOnInit(): void {\n this.disabledState.set(this.matLink.disabled);\n const handle: CngxTabHandle = {\n id: this.id(),\n label: this.label,\n subLabel: signal(undefined),\n disabled: this.disabledState.asReadonly(),\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: signal(undefined),\n };\n this.host.register(handle);\n this.destroyRef.onDestroy(() => this.host.unregister(handle.id));\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab error-aggregator binding for `[cngxMatTabs]`. Attach to a\n * `<mat-tab>`; the bound aggregator's `shouldShow()` projects onto\n * the matching Material tab button (badge + descriptor span) via\n * the Renderer2 effect inside {@link CngxMatTabs}.\n *\n * Material owns `<mat-tab>` declarations - `[cngxTab]` cannot host\n * here - so a sibling attribute directive carries the input.\n * Empty-string transform handles the bare-attribute case per\n * `feedback_bridge_input_not_required` (a developer typing\n * `cngxMatTabError` without `[]` brackets must not poison the\n * slot).\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST} -\n * the registry provides the token with `useExisting`, so sibling\n * directives reach per-handle slots through a typed contract\n * instead of the concrete class. Tracks `presenter.tabs()` to\n * recover from a same-microtask race where the directive injects\n * before the registry's sync runs. `destroyRef.onDestroy` clears\n * the slot so an `*ngIf`-toggled binding returns to the\n * no-aggregator default.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabsRegistry, CngxMatTabRejectionContent\n */\n@Directive({\n selector: '[cngxMatTabError]',\n exportAs: 'cngxMatTabError',\n standalone: true,\n})\nexport class CngxMatTabError {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly aggregator = input<\n CngxErrorAggregatorContract | undefined,\n CngxErrorAggregatorContract | '' | undefined\n >(undefined, {\n alias: 'cngxMatTabError',\n transform: (value) => (typeof value === 'string' ? undefined : value),\n });\n\n constructor() {\n effect(() => {\n // Race window - registry's `contentChildren(MatTab)` query and\n // our injection land in the same microtask, so the first lookup\n // can miss our handle. Tracking `presenter.tabs()` re-fires the\n // effect on the next sync tick. `untracked` around the write\n // pre-empts a future regression where `getHandleSetup` reads a\n // signal and self-triggers the aggregator pump.\n const aggregator = this.aggregator();\n // Race-recovery dependency - tracks `setupsByTab` population so\n // the effect re-fires once our `MatTab` is registered. The bare\n // read is intentional; full rationale lives in the effect's\n // opening comment above. Do NOT tag as dead code.\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(aggregator);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(undefined);\n });\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab direct invalid flag for `[cngxMatTabs]` - the simple-case\n * sibling to `[cngxMatTabError]`. Attach to a `<mat-tab>`; the bound\n * `string | boolean` writes the per-handle `directError` slot, which\n * folds into the handle's `hasError` / `errorMessage`. A non-empty\n * string doubles as the SR descriptor message; `true` marks the tab\n * invalid with no message; `false` / `''` clear it.\n *\n * Symmetric with `[cngxMatTabError]` (one directive, one\n * responsibility - Pillar 3): the aggregator stays the rich\n * multi-source path, this is the \"this tab is invalid\" marker that\n * needs no aggregator boilerplate. A bare `cngxMatTabErrorFlag`\n * attribute (no brackets) binds the empty string and is coerced to\n * `true` so presence alone marks the tab invalid.\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST}, tracks\n * `presenter.tabs()` to recover from the content-init race, and\n * clears the slot on destroy - exactly as {@link CngxMatTabError}.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error-flag.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabsRegistry\n */\n@Directive({\n selector: '[cngxMatTabErrorFlag]',\n exportAs: 'cngxMatTabErrorFlag',\n standalone: true,\n})\nexport class CngxMatTabErrorFlag {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly error = input<string | boolean, string | boolean>(false, {\n alias: 'cngxMatTabErrorFlag',\n transform: (value) => (value === '' ? true : value),\n });\n\n constructor() {\n effect(() => {\n // Same content-init race as `[cngxMatTabError]` - the registry's\n // `contentChildren(MatTab)` query and our injection land in the\n // same microtask, so tracking `presenter.tabs()` re-fires the\n // effect once our handle is registered. `untracked` around the\n // write keeps the slot pump out of the reactive graph.\n const error = this.error();\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(error);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(false);\n });\n }\n}\n","/**\n * @module @cngx/ui/mat-tabs\n *\n * Material instrumentation directive for `<mat-tab-group>`.\n */\nexport { CngxMatTabs } from './mat-tabs.directive';\nexport { CngxMatTabNav } from './mat-tab-nav.directive';\nexport { CngxMatTabLink } from './mat-tab-link.directive';\nexport { CngxMatTabError } from './mat-tab-error.directive';\nexport { CngxMatTabErrorFlag } from './mat-tab-error-flag.directive';\nexport {\n CNGX_MAT_TABS_REGISTRY_HOST,\n CngxMatTabsRegistry,\n type CngxMatTabsRegistryHost,\n} from './mat-tabs-registry.directive';\nexport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nexport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nexport type { CngxMatTabHalfWiredSlotSink } from './decorations/half-wired-slot-sink';\nexport {\n CNGX_MAT_TABS_CONFIG,\n type CngxMatTabsConfig,\n type CngxMatTabsConfigFeature,\n injectMatTabsConfig,\n provideMatTabsConfig,\n provideMatTabsConfigAt,\n withAnchorRetryAttempts,\n withHalfWiredSlotSink,\n} from './mat-tabs-config';\nexport {\n CNGX_MAT_TAB_HANDLE_FACTORY,\n createMatTabHandle,\n type CngxMatTabHandleFactory,\n} from './material-bridge/handle';\nexport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\nexport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"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C;AACvD,gBAAA,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;AAC/B,YAAA,CAAC,CAAC;AACJ,QAAA,CAAC,CAAC;AAEF,QAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAK;AAC7B,YAAA,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC;AACvD,YAAA,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC;AAC/B,QAAA,CAAC,CAAC;IACJ;uGAjCW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpCD;;;;AAIG;;ACJH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-ui-mat-tabs.mjs","sources":["../../../projects/ui/mat-tabs/material-bridge/private-surfaces.ts","../../../projects/ui/mat-tabs/decorations/decoration-projectors.ts","../../../projects/ui/mat-tabs/decorations/aggregated-error-tabs.ts","../../../projects/ui/mat-tabs/decorations/half-wired-slot-sink.ts","../../../projects/ui/mat-tabs/mat-tabs-config.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts","../../../projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts","../../../projects/ui/mat-tabs/decorations/live-region.ts","../../../projects/ui/mat-tabs/decorations/rejection-state.ts","../../../projects/ui/mat-tabs/material-bridge/handle.ts","../../../projects/ui/mat-tabs/mat-tabs-registry.directive.ts","../../../projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts","../../../projects/ui/mat-tabs/mat-tabs.directive.ts","../../../projects/ui/mat-tabs/mat-tab-nav.directive.ts","../../../projects/ui/mat-tabs/mat-tab-link.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error.directive.ts","../../../projects/ui/mat-tabs/mat-tab-error-flag.directive.ts","../../../projects/ui/mat-tabs/public-api.ts","../../../projects/ui/mat-tabs/cngx-ui-mat-tabs.ts"],"sourcesContent":["/**\n * Centralised type façade and selector constants for every Angular\n * Material internal surface cngx Material-bridge code couples to.\n * Replaces the per-call-site `as unknown as { _foo? }` casts and\n * the scattered `'.mat-mdc-tab*'` string literals with a single\n * grep target.\n *\n * Every leading-underscore field cngx reaches into and every\n * Material-internal CSS selector cngx queries against has its\n * declaration here. A Material-version upgrade audit only needs to\n * grep this file. The grep value is the consumer-facing benefit, so\n * this namespace is part of the published surface of\n * `@cngx/ui/mat-tabs` (re-exported from the package barrel) rather\n * than a private implementation detail.\n *\n * The grouping uses a TypeScript `namespace` so a single\n * `MaterialPrivateSurfaces.<member>` access path covers both the\n * type façades and the selector constants. The TS namespace also\n * lets cross-package consumers (`@cngx/ui/mat-stepper`) read the\n * grouped name through ESLint's `@typescript-eslint` type resolver\n * — a flat `export * as` re-export from `public-api.ts` does not\n * resolve nested members through the path-alias.\n *\n * @category ui/mat-tabs\n */\n\nimport type { TemplateRef, WritableSignal } from '@angular/core';\nimport type { MatStepperIconContext } from '@angular/material/stepper';\nimport type { Subject } from 'rxjs';\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace MaterialPrivateSurfaces {\n /**\n * Subset of Material's `MatTab` carrying the `_stateChanges`\n * Subject. The leading underscore signals\n * Material-internal-by-convention, even though the field is\n * `readonly` on the public class surface. The Subject emits\n * `void` whenever a `MatTab` input (`textLabel`, `disabled`, …)\n * changes; cngx bridges it into the Signal graph via\n * `toSignal(matTab._stateChanges)` because Material exposes no\n * public reactive surface for input changes.\n */\n export interface StateChangeSource {\n readonly _stateChanges: Subject<void>;\n }\n\n /**\n * Subset of Material's `MatStepper` carrying the `_iconOverrides`\n * map. `<cngx-mat-stepper>` patches this map inside\n * `afterNextRender` to forward consumer-projected\n * `<ng-template matStepperIcon>` declarations through the wrapper\n * into Material's per-header indicator bindings (the only\n * deterministic forwarding path — `<ng-content>` projection\n * inside `<mat-stepper>` does not reach\n * `@ContentChildren(MatStepperIcon)` due to content-init\n * lifecycle ordering).\n */\n export interface IconOverrideHost {\n _iconOverrides?: Record<string, TemplateRef<MatStepperIconContext>>;\n }\n\n /**\n * Subset of CDK's `CdkStep` carrying the `_completedOverride`\n * `WritableSignal`. `MatStep.completed`'s getter reads this\n * signal, so cngx's per-step `state` computed transitively tracks\n * it through the getter and re-fires whenever Material flips\n * completion. Documented limitation: `hasError` writes that are\n * not paired with a `completed` change do not retrigger the\n * computed — sharper note lives on `createMatStepHandle`'s JSDoc.\n */\n export interface CompletedOverrideSource {\n readonly _completedOverride: WritableSignal<boolean | null>;\n }\n\n /**\n * `.mat-mdc-tab` — the class Material applies to the rendered\n * tab `<button>` elements inside `MatTabHeader`. cngx\n * index-correlates `presenter.tabs()` registration order against\n * `host.querySelectorAll('.mat-mdc-tab')` because `MatTab` is a\n * portal — the rendered buttons live inside `MatTabHeader`'s\n * template, not on the `<mat-tab>` declaration site, and Material\n * exposes no public per-tab element accessor.\n */\n export const MAT_MDC_TAB_SELECTOR = '.mat-mdc-tab';\n\n /**\n * `.mat-mdc-tab-header` — the strip element rendered by\n * `MatTabHeader`. `[cngxMatTabs]` walks\n * `host.querySelector('.mat-mdc-tab-header')` to locate the mount\n * anchor for the cngx overflow molecule (so the More button pins\n * inside Material's strip rather than as a sibling of\n * `<mat-tab-group>`).\n */\n export const MAT_MDC_TAB_HEADER_SELECTOR = '.mat-mdc-tab-header';\n\n /**\n * `.mat-mdc-tab-label-container` — Material's IO-friendly scroll\n * viewport ancestor of the rendered tab buttons. The Material-\n * twin overflow adapter walks `host → header → any tab → closest\n * label-container` to attach the molecule's\n * `IntersectionObserver` against the same element Material\n * itself scrolls.\n */\n export const MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR =\n '.mat-mdc-tab-label-container';\n}\n","import {\n afterNextRender,\n type DestroyRef,\n effect,\n type EmbeddedViewRef,\n type Injector,\n isDevMode,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n type TemplateRef,\n untracked,\n type ViewContainerRef,\n} from '@angular/core';\n\nimport type { CngxMatTabAggregatorContentContext } from './mat-tab-aggregator-content.directive';\nimport type { CngxMatTabRejectionContentContext } from './mat-tab-rejection-content.directive';\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Package-private DOM-mutation projectors for `[cngxMatTabs]`.\n *\n * - {@link createMatTabRejectionDecoration} — mirrors\n * `presenter.lastFailedIndex` onto the matching `.mat-mdc-tab` as a\n * class flag plus a hidden `cngx-sr-only` descriptor span linked via\n * `aria-describedby`. `aria-invalid` is intentionally absent: ARIA\n * 1.2 scopes it to form-field vocabulary, not `role=\"tab\"`.\n * - {@link createMatTabAggregatorDecoration} — projects each handle's\n * `shouldShow()` flag onto the matching button as a class +\n * descriptor span pair, same `aria-describedby` token-append pattern.\n *\n * Distinct descriptor-id suffixes (`-rejected` vs `-errors`) let both\n * projectors stack on the same target without collision; the shared\n * token-list append preserves consumer-supplied tokens.\n *\n * @internal package-private — consumers bind `[cngxMatTabError]` on\n * each `<mat-tab>`; the directive owns the projection mechanics.\n */\n\n/**\n * Diff-restore the `aria-describedby` token list after a decoration's\n * descriptor span detaches — drops the decoration's own id token from\n * the live attribute, leaving any third-party tokens written between\n * apply and clear (tooltip refs, Material's own runtime additions)\n * intact. Treats the attribute as a token-set per the cngx ARIA-by-value\n * rule, not as a single-owner string.\n *\n * Empty-result + originally-absent attribute removes the attribute\n * entirely — a dangling `aria-describedby=\"\"` would be a malformed\n * reference in some AT readers.\n *\n * @internal\n */\nfunction restoreAriaDescribedbyExceptToken(\n el: HTMLElement,\n tokenToRemove: string,\n renderer: Renderer2,\n priorAriaDescribedby: string | null,\n): void {\n const current = el.getAttribute('aria-describedby');\n const tokens = current ? current.split(/\\s+/).filter(Boolean) : [];\n const remaining = tokens.filter((t) => t !== tokenToRemove);\n if (remaining.length === 0) {\n if (priorAriaDescribedby === null) {\n renderer.removeAttribute(el, 'aria-describedby');\n } else {\n renderer.setAttribute(el, 'aria-describedby', priorAriaDescribedby);\n }\n return;\n }\n renderer.setAttribute(el, 'aria-describedby', remaining.join(' '));\n}\n\n/**\n * Options for {@link createMatTabRejectionDecoration}.\n */\nexport interface CngxMatTabRejectionDecorationOptions {\n /** Host element whose subtree contains the `.mat-mdc-tab` buttons. */\n readonly hostEl: HTMLElement;\n /**\n * Stable id of the currently-failed target, or `null` when no\n * rejection is pinned. Sole effect-trigger; the descriptor span's\n * DOM id is `${failedHandleId}-rejected`.\n */\n readonly failedHandleId: Signal<string | null>;\n /**\n * Index of the currently-failed target — `undefined` when no\n * rejection is pinned. Read inside `untracked()` after\n * `failedHandleId` fires.\n */\n readonly failedIndex: Signal<number | undefined>;\n /**\n * Reactive descriptor phrase for the SR-only span. Typical\n * resolution at the caller: i18n `commitRolledBackTo(originLabel)`\n * when origin resolves, `commitFailedRetry` otherwise. A separate\n * effect tracks this signal so late label resolution mutates the\n * span in place rather than rebuilding it. Empty string keeps the\n * span mounted — `aria-describedby` must never dangle.\n */\n readonly descriptorText: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--error`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /**\n * Suffix appended to `failedHandleId` for the descriptor span's\n * DOM id. Default `'rejected'` — distinct from the aggregator\n * projector's `'errors'` so both can stack on the same target.\n */\n readonly descriptorIdSuffix?: string;\n /**\n * Optional `*cngxMatTabRejectionContent` slot template. When\n * non-null AND `viewContainerRef` is supplied, the projector\n * renders an embedded view into the SR span; otherwise it falls\n * back to the imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabRejectionContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path. Mirrors\n * the aggregator projector's same-name opt.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Reactive origin label feeding the slot context's `originLabel`.\n * Read inside `untracked()` during apply; the `descriptorText`\n * re-fire effect destroys + remounts the embedded view, so the\n * value is always read at fire time.\n */\n readonly originLabel?: Signal<string | undefined>;\n}\n\n/**\n * Mounts the sticky-rejection decoration projector. Class +\n * descriptor span follow `failedHandleId` reactively; cleared on\n * directive destroy. Single-target by contract (matches the\n * presenter's single-slot `lastFailedIndex`).\n *\n * Two effects split the work: one tracks `failedHandleId` and\n * mounts/unmounts the span; the other tracks `descriptorText` and\n * mutates `textContent` in place. The split keeps late label\n * resolution O(1) — no DOM rebuild when the origin label arrives\n * via a downstream `tabs()` re-emission.\n *\n * @internal\n */\nexport function createMatTabRejectionDecoration(\n opts: CngxMatTabRejectionDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--error';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const descriptorIdSuffix = opts.descriptorIdSuffix ?? 'rejected';\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. No diagnostic — single in-package consumer always\n // passes both.\n const slotEnabled = !!opts.contentTemplate && !!opts.viewContainerRef;\n let decoratedEl: HTMLElement | null = null;\n // Cached across the projector's lifetime — reusing the same node\n // keeps AT-reader / observer references live across A→B→A flips.\n let cachedSpan: HTMLElement | null = null;\n let priorAriaDescribedby: string | null = null;\n // Pillar 1 — short-circuits structurally-identical re-emissions of\n // `failedHandleId` so a `tabs()` re-eval doesn't clobber the AT\n // descriptor mid-flight.\n let lastAppliedId: string | null = null;\n let embeddedView:\n | EmbeddedViewRef<CngxMatTabRejectionContentContext>\n | undefined;\n\n const destroyEmbeddedView = (): void => {\n if (!embeddedView) {\n return;\n }\n embeddedView.destroy();\n embeddedView = undefined;\n if (cachedSpan) {\n while (cachedSpan.firstChild) {\n opts.renderer.removeChild(cachedSpan, cachedSpan.firstChild);\n }\n }\n };\n\n const writeDescriptorContent = (\n span: HTMLElement,\n handleId: string,\n text: string,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView();\n const context: CngxMatTabRejectionContentContext = {\n failedHandleId: handleId,\n originLabel: opts.originLabel?.(),\n fallbackText: text,\n };\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // Force CD before moving rootNodes out of the embedded view's\n // logical parent — zoneless + OnPush would otherwise leave the\n // first SR read stale.\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(span, node);\n }\n embeddedView = view;\n return;\n }\n // Imperative fallback — also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView();\n opts.renderer.setProperty(span, 'textContent', text);\n };\n\n const clearDecoration = (): void => {\n if (!decoratedEl || !cachedSpan) {\n return;\n }\n const ownTokenId = cachedSpan.id;\n destroyEmbeddedView();\n opts.renderer.removeClass(decoratedEl, className);\n opts.renderer.removeChild(decoratedEl, cachedSpan);\n // `cachedSpan` deliberately retained — reused on the next apply.\n restoreAriaDescribedbyExceptToken(\n decoratedEl,\n ownTokenId,\n opts.renderer,\n priorAriaDescribedby,\n );\n decoratedEl = null;\n priorAriaDescribedby = null;\n };\n\n const applyDecorationAt = (failedIdx: number, handleId: string): void => {\n clearDecoration();\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n const targetEl = buttons.item(failedIdx);\n if (!targetEl) {\n return;\n }\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${handleId}-${descriptorIdSuffix}`;\n let span = cachedSpan;\n if (!span) {\n span = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(span, srOnlyClassName);\n cachedSpan = span;\n }\n // Always rewrite id + textContent — the cached span carries stale\n // values from the prior mount. The live-text effect below picks\n // up subsequent `descriptorText` changes in place.\n opts.renderer.setAttribute(span, 'id', spanId);\n opts.renderer.appendChild(targetEl, span);\n writeDescriptorContent(span, handleId, opts.descriptorText());\n\n // Renderer2 has no `getAttribute` counterpart — read off the\n // native element. Browser-only; SSR would need a platform adapter.\n const prior = targetEl.getAttribute('aria-describedby');\n const tokens = prior ? prior.split(/\\s+/).filter(Boolean) : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n decoratedEl = targetEl;\n priorAriaDescribedby = prior;\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const id = opts.failedHandleId();\n untracked(() => {\n if (id === lastAppliedId) {\n return;\n }\n if (id === null) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n const idx = opts.failedIndex();\n if (idx === undefined) {\n clearDecoration();\n lastAppliedId = null;\n return;\n }\n applyDecorationAt(idx, id);\n lastAppliedId = id;\n });\n });\n\n // Live-text effect — tracks `descriptorText` plus the slot\n // template (when wired) so a late-mounted template re-renders\n // into the existing span. Mount-state checks live in untracked.\n effect(() => {\n const text = opts.descriptorText();\n const tplSignal = opts.contentTemplate;\n if (slotEnabled && tplSignal) {\n tplSignal();\n }\n untracked(() => {\n if (decoratedEl === null || cachedSpan === null) {\n return;\n }\n const id = opts.failedHandleId();\n if (id === null) {\n return;\n }\n writeDescriptorContent(cachedSpan, id, text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(clearDecoration);\n}\n\n/**\n * One per-tab error-aggregator decoration entry. Caller pre-filters\n * to handles whose `shouldShow() === true`.\n *\n * `count` / `label` feed the optional `*cngxMatTabAggregatorContent`\n * slot context ({@link CngxMatTabAggregatorContentContext}); the\n * imperative-fallback path uses `announcement` only and ignores the\n * two extra fields. They stay on the shape so the contract is\n * uniform across render paths.\n */\nexport interface CngxMatTabAggregatorErrorEntry {\n readonly idx: number;\n readonly id: string;\n readonly announcement: string;\n /** Aggregated error count — feeds the slot context's `count` field. */\n readonly count: number;\n /** Resolved tab label — feeds the slot context's `label` field. */\n readonly label: string;\n}\n\n/**\n * Options for {@link createMatTabAggregatorDecoration}.\n */\nexport interface CngxMatTabAggregatorDecorationOptions {\n readonly hostEl: HTMLElement;\n /**\n * Reactive list of tabs whose bound aggregator wants reveal —\n * caller pre-filters; sole effect-trigger.\n */\n readonly errorTabs: Signal<readonly CngxMatTabAggregatorErrorEntry[]>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `.mat-mdc-tab`. Override only for testing. */\n readonly buttonSelector?: string;\n /** Default: `cngx-mat-tab--has-errors`. */\n readonly className?: string;\n /** Default: `cngx-sr-only`. */\n readonly srOnlyClassName?: string;\n /** Default: `5`. Cap on `afterNextRender` retry recursion. */\n readonly maxRetryAttempts?: number;\n /**\n * Optional dev-mode sink invoked when the retry ceiling is hit.\n * Defaults to a `console.warn` gated on `ngDevMode`.\n */\n readonly onMaxRetriesReached?: () => void;\n /**\n * Optional `*cngxMatTabAggregatorContent` template. When non-null\n * AND `viewContainerRef` is supplied, the projector renders an\n * embedded view per entry; otherwise it falls back to the\n * imperative `textContent` path.\n */\n readonly contentTemplate?: Signal<\n TemplateRef<CngxMatTabAggregatorContentContext> | null\n >;\n /**\n * Required half of the slot path. Without it, the projector\n * silently degrades to the imperative descriptor path.\n */\n readonly viewContainerRef?: ViewContainerRef;\n /**\n * Sink fired when exactly one of `contentTemplate` /\n * `viewContainerRef` is supplied — the projector is mode-agnostic\n * so the dev-vs-prod gate lives in whichever sink the caller\n * passes. `[cngxMatTabs]` resolves this from\n * `provideMatTabsConfig(withHalfWiredSlotSink(fn))`; the default\n * is a dev-mode `console.warn`.\n */\n readonly onHalfWiredSlot?: (\n missing: 'contentTemplate' | 'viewContainerRef',\n ) => void;\n}\n\n/**\n * Mounts the per-tab aggregator decoration projector. Class +\n * descriptor span + `aria-describedby` token follow `errorTabs`\n * reactively; pruned on entry drop and on directive destroy.\n *\n * Race recovery — when the effect fires before MatTabHeader has\n * rendered the matching buttons (initial-render race), schedules a\n * single `afterNextRender` retry, bounded by `maxRetryAttempts`.\n *\n * @internal\n */\nexport function createMatTabAggregatorDecoration(\n opts: CngxMatTabAggregatorDecorationOptions,\n): void {\n const buttonSelector =\n opts.buttonSelector ?? MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR;\n const className = opts.className ?? 'cngx-mat-tab--has-errors';\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const maxRetryAttempts = opts.maxRetryAttempts ?? 5;\n // Slot path needs both halves; either alone degrades to imperative\n // textContent. Re-evaluated per fire so a lazy-mounted template\n // (`*ngIf` / `@defer`) picks up on first materialisation.\n const isFullyWired = (): boolean =>\n !!opts.contentTemplate && !!opts.viewContainerRef;\n // Half-wired diagnostic — graceful degradation hides the mistake\n // at runtime, so the signal has to come from a deliberate sink.\n if (!isFullyWired() && (opts.contentTemplate || opts.viewContainerRef)) {\n const missing: 'contentTemplate' | 'viewContainerRef' =\n opts.contentTemplate ? 'viewContainerRef' : 'contentTemplate';\n const sink = opts.onHalfWiredSlot ?? defaultHalfWiredSlotWarn;\n sink(missing);\n }\n\n const decorated = new Map<\n string,\n {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n /**\n * Embedded view rendered from `contentTemplate` when bound.\n * Owned by the entry so re-decorations can destroy the prior\n * view before mounting a fresh one (every signal-driven\n * context update goes through destroy + remount; embedded\n * views do not expose a context-mutation API in the\n * standalone-component world that doesn't risk stale\n * `let-` bindings).\n */\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }\n >();\n let pendingRetry = false;\n let retryAttempts = 0;\n\n const destroyEmbeddedView = (entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n }): void => {\n if (!entry.embeddedView) {\n return;\n }\n entry.embeddedView.destroy();\n entry.embeddedView = undefined;\n // The rendered nodes live under the descriptor span via appendChild;\n // EmbeddedViewRef.destroy() does not detach them, so clear manually.\n while (entry.descriptorSpan.firstChild) {\n opts.renderer.removeChild(\n entry.descriptorSpan,\n entry.descriptorSpan.firstChild,\n );\n }\n };\n\n const writeDescriptorContent = (\n entry: {\n descriptorSpan: HTMLElement;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n },\n announcement: string,\n context: CngxMatTabAggregatorContentContext,\n ): void => {\n const tplSignal = opts.contentTemplate;\n const vcr = opts.viewContainerRef;\n const tpl = tplSignal && vcr ? tplSignal() : null;\n if (tpl && vcr) {\n destroyEmbeddedView(entry);\n const view = vcr.createEmbeddedView(tpl, context, {\n injector: opts.injector,\n });\n // See the rejection projector's identical call site for the\n // detached-view CD rationale (rootNodes move out of the\n // embedded view's logical parent into an SR-only span).\n view.detectChanges();\n for (const node of view.rootNodes) {\n opts.renderer.appendChild(entry.descriptorSpan, node);\n }\n entry.embeddedView = view;\n return;\n }\n // Imperative fallback — also covers the path where a slot was\n // previously bound and is now removed (destroy any prior view).\n destroyEmbeddedView(entry);\n opts.renderer.setProperty(\n entry.descriptorSpan,\n 'textContent',\n announcement,\n );\n };\n\n const removeDecoration = (id: string): void => {\n const entry = decorated.get(id);\n if (!entry) {\n return;\n }\n const ownTokenId = entry.descriptorSpan.id;\n destroyEmbeddedView(entry);\n opts.renderer.removeClass(entry.el, className);\n opts.renderer.removeChild(entry.el, entry.descriptorSpan);\n restoreAriaDescribedbyExceptToken(\n entry.el,\n ownTokenId,\n opts.renderer,\n entry.priorAriaDescribedby,\n );\n decorated.delete(id);\n };\n\n const applyDecoration = (\n targetEl: HTMLElement,\n entry: CngxMatTabAggregatorErrorEntry,\n ): void => {\n opts.renderer.addClass(targetEl, className);\n\n const spanId = `${entry.id}-errors`;\n const descriptorSpan = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(descriptorSpan, srOnlyClassName);\n opts.renderer.setAttribute(descriptorSpan, 'id', spanId);\n opts.renderer.appendChild(targetEl, descriptorSpan);\n\n // See the read-via-nativeElement note in `applyDecorationAt` above —\n // Renderer2 has no `getAttribute` counterpart, so attribute reads\n // go through the native element directly.\n const priorAriaDescribedby = targetEl.getAttribute('aria-describedby');\n const tokens = priorAriaDescribedby\n ? priorAriaDescribedby.split(/\\s+/).filter(Boolean)\n : [];\n if (!tokens.includes(spanId)) {\n tokens.push(spanId);\n }\n opts.renderer.setAttribute(targetEl, 'aria-describedby', tokens.join(' '));\n\n const decoratedEntry: {\n el: HTMLElement;\n descriptorSpan: HTMLElement;\n priorAriaDescribedby: string | null;\n embeddedView?: EmbeddedViewRef<CngxMatTabAggregatorContentContext>;\n } = { el: targetEl, descriptorSpan, priorAriaDescribedby };\n writeDescriptorContent(decoratedEntry, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n decorated.set(entry.id, decoratedEntry);\n };\n\n const sync = (\n errorTabs: readonly CngxMatTabAggregatorErrorEntry[],\n ): void => {\n const liveIds = new Set<string>();\n for (const t of errorTabs) {\n liveIds.add(t.id);\n }\n for (const id of Array.from(decorated.keys())) {\n if (!liveIds.has(id)) {\n removeDecoration(id);\n }\n }\n const buttons = opts.hostEl.querySelectorAll<HTMLElement>(buttonSelector);\n let needsRetry = false;\n for (const entry of errorTabs) {\n const targetEl = buttons.item(entry.idx);\n if (!targetEl) {\n needsRetry = true;\n continue;\n }\n const existing = decorated.get(entry.id);\n if (existing?.el === targetEl) {\n // Same target element: refresh content (slot path destroys +\n // remounts the embedded view; imperative path overwrites the\n // textContent property idempotently).\n writeDescriptorContent(existing, entry.announcement, {\n count: entry.count,\n label: entry.label,\n announcement: entry.announcement,\n });\n continue;\n }\n if (existing) {\n removeDecoration(entry.id);\n }\n applyDecoration(targetEl, entry);\n }\n\n if (!needsRetry) {\n retryAttempts = 0;\n return;\n }\n if (pendingRetry) {\n return;\n }\n if (retryAttempts >= maxRetryAttempts) {\n retryAttempts = 0;\n const sink =\n opts.onMaxRetriesReached ?? defaultRetryCeilingWarn(maxRetryAttempts);\n sink();\n return;\n }\n pendingRetry = true;\n retryAttempts++;\n afterNextRender(\n () => {\n pendingRetry = false;\n sync(opts.errorTabs());\n },\n { injector: opts.injector },\n );\n };\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n // Track the slot template alongside `errorTabs` so a runtime\n // project/remove of `*cngxMatTabAggregatorContent` switches\n // every decorated entry between render paths.\n const errorTabs = opts.errorTabs();\n if (isFullyWired() && opts.contentTemplate) {\n opts.contentTemplate();\n }\n untracked(() => sync(errorTabs));\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n for (const id of Array.from(decorated.keys())) {\n removeDecoration(id);\n }\n });\n}\n\nfunction defaultHalfWiredSlotWarn(\n missing: 'contentTemplate' | 'viewContainerRef',\n): void {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired — ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n}\n\nfunction defaultRetryCeilingWarn(max: number): () => void {\n return () => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator decoration retry ceiling reached ' +\n `(${max} attempts) — MatTabHeader did not render ` +\n '`.mat-mdc-tab` buttons within the expected window. Likely ' +\n 'cause: Material upgrade broke the `.mat-mdc-tab` selector ' +\n 'contract or a consumer-side render stall. ' +\n 'Bound aggregators may remain visually undecorated ' +\n 'until the next state change.',\n );\n };\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost } from '@cngx/common/tabs';\n\nimport type { CngxMatTabAggregatorErrorEntry } from './decoration-projectors';\n\n/**\n * Builds the reactive list of tabs whose bound error-aggregator wants\n * reveal, in registration (DOM) order. Feeds\n * {@link createMatTabAggregatorDecoration} for both the\n * `[cngxMatTabs]` (`<mat-tab-group>`) and `[cngxMatTabNav]`\n * (`<nav mat-tab-nav-bar>`) bridges - one body, two hosts (Pillar 3).\n *\n * Structural `equal` drops re-runs whose entry list is shape-identical\n * so the projector does not churn on no-op aggregator re-emissions.\n *\n * @internal\n */\nexport function createAggregatedErrorTabs(\n presenter: CngxTabGroupHost,\n): Signal<readonly CngxMatTabAggregatorErrorEntry[]> {\n return computed<readonly CngxMatTabAggregatorErrorEntry[]>(\n () => {\n const tabs = presenter.tabs();\n const acc: CngxMatTabAggregatorErrorEntry[] = [];\n for (let i = 0; i < tabs.length; i++) {\n const handle = tabs[i];\n const aggregator = handle.errorAggregator();\n if (aggregator?.shouldShow()) {\n acc.push({\n idx: i,\n id: handle.id,\n announcement: aggregator.announcement(),\n count: aggregator.errorCount(),\n label: handle.label() ?? '',\n });\n }\n }\n return acc;\n },\n {\n equal: (a, b) => {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].idx !== b[i].idx ||\n a[i].id !== b[i].id ||\n a[i].announcement !== b[i].announcement ||\n a[i].count !== b[i].count ||\n a[i].label !== b[i].label\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import { isDevMode } from '@angular/core';\n\n/**\n * Sink callback invoked by `[cngxMatTabs]`'s aggregator-decoration\n * projector when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` (the slot template) or\n * `ViewContainerRef` (the embedded-view host) — the half-wired-slot\n * misconfiguration. The projector silently falls back to the\n * imperative `textContent` path when this happens; the sink is the\n * only deliberate signal that the consumer's slot template will not\n * render.\n *\n * Override via `provideMatTabsConfig(withHalfWiredSlotSink(fn))` to\n * wire production telemetry (Sentry breadcrumbs, custom logger, CI\n * fail-fast). The library default is a dev-mode `console.warn`; the\n * exported {@link CNGX_DEFAULT_HALF_WIRED_SLOT_SINK} value lets test\n * doubles compose against a stable reference.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHalfWiredSlotSink = (\n missing: 'contentTemplate' | 'viewContainerRef',\n) => void;\n\n/**\n * Default sink — gated on dev-mode. Production callers see no\n * output; production telemetry lands only when a consumer overrides\n * via `withHalfWiredSlotSink(fn)`.\n *\n * @internal — exported only for {@link CngxMatTabsConfig.halfWiredSlotSink}'s\n * library default. Consumers should override via the config feature\n * rather than reach for this reference directly.\n */\nexport const CNGX_DEFAULT_HALF_WIRED_SLOT_SINK: CngxMatTabHalfWiredSlotSink = (\n missing,\n) => {\n if (!isDevMode()) {\n return;\n }\n console.warn(\n '[cngxMatTabs] aggregator-content slot half-wired — ' +\n `\\`${missing}\\` is missing while the other half is supplied. ` +\n 'The decoration projector will silently fall back to the ' +\n 'imperative `textContent` path, and the consumer-projected ' +\n '`*cngxMatTabAggregatorContent` template will never render. ' +\n 'Wire both halves on the [cngxMatTabs] directive (or neither).',\n );\n};\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport {\n type CngxMatTabHalfWiredSlotSink,\n CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} from './decorations/half-wired-slot-sink';\n\n/**\n * Behaviour knobs for `[cngxMatTabs]`. Single canonical surface\n * symmetric to `provideSelectConfig` in the select family - every\n * tunable is a `with*` feature on the same aggregator instead of\n * a standalone DI token, so consumers configure the directive\n * through one entry point and the API surface stays small.\n *\n * Per-instance Inputs win over `provideMatTabsConfigAt(...)`\n * (component scope), which wins over `provideMatTabsConfig(...)`\n * (root), which wins over the library defaults captured by\n * {@link CNGX_MAT_TABS_CONFIG_DEFAULTS}.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfig {\n /**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop. The\n * directive runs `createDomAnchorRetry` on every `afterNextRender`\n * until `.mat-mdc-tab-header` materialises in the host subtree;\n * the cap exists so a never-rendered host (e.g. `<mat-tab-group>`\n * gated behind a never-true `*ngIf` / `@defer`) does not re-arm\n * forever.\n *\n * Default: `5` - well above normal Material render lag (a single\n * `afterNextRender` is enough on every supported version), low\n * enough to surface a dev-mode `console.warn` promptly when the\n * consumer DOM never appears.\n *\n * Note: `<cngx-tab-overflow>`'s own attach loop uses `60` rAF\n * frames, not `5` - different scheduler, different budget. The\n * two caps are intentionally independent because the underlying\n * timing primitives differ; a shared \"anchor max attempts\" knob\n * would conflate one frame of `afterNextRender` with one rAF\n * frame, which they are not.\n */\n readonly anchorMaxAttempts?: number;\n\n /**\n * Diagnostic sink invoked when a consumer wires exactly one of\n * `*cngxMatTabAggregatorContent` or its `ViewContainerRef`.\n * Default is a dev-mode `console.warn`; override via\n * {@link withHalfWiredSlotSink} to wire production telemetry\n * (Sentry breadcrumbs, custom logger, CI fail-fast).\n */\n readonly halfWiredSlotSink?: CngxMatTabHalfWiredSlotSink;\n}\n\n/**\n * Library defaults for `[cngxMatTabs]`. Source of truth for every\n * key on {@link CngxMatTabsConfig}. Consumed by\n * {@link injectMatTabsConfig} as the final fallback.\n *\n * @internal\n */\nexport const CNGX_MAT_TABS_CONFIG_DEFAULTS = {\n anchorMaxAttempts: 5,\n halfWiredSlotSink: CNGX_DEFAULT_HALF_WIRED_SLOT_SINK,\n} as const satisfies Required<CngxMatTabsConfig>;\n\n/**\n * DI token holding a partial {@link CngxMatTabsConfig}. Set via\n * {@link provideMatTabsConfig} (app-wide) or\n * {@link provideMatTabsConfigAt} (component scope). Read via\n * {@link injectMatTabsConfig}, which merges with the library\n * defaults so callers never see `undefined`.\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_CONFIG = new InjectionToken<CngxMatTabsConfig>('CngxMatTabsConfig');\n\n/**\n * Feature object returned by `with*` mat-tabs functions and consumed\n * by {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}.\n * The optional `_target` discriminator is reserved for a future\n * cross-family aggregator (`provideCngxMatTabs`) that dispatches\n * features to the right provider - analogous to `_target: 'select'`\n * in the select family.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsConfigFeature {\n readonly config: Partial<CngxMatTabsConfig>;\n /** @internal */\n readonly _target?: 'mat-tabs';\n}\n\nfunction feature(config: Partial<CngxMatTabsConfig>): CngxMatTabsConfigFeature {\n return { config, _target: 'mat-tabs' };\n}\n\n/**\n * Cap on the `[cngxMatTabs]` overflow-anchor retry loop.\n * See {@link CngxMatTabsConfig.anchorMaxAttempts} for default + rationale.\n *\n * @category ui/mat-tabs\n */\nexport function withAnchorRetryAttempts(n: number): CngxMatTabsConfigFeature {\n return feature({ anchorMaxAttempts: n });\n}\n\n/**\n * Override the half-wired-slot diagnostic sink.\n * See {@link CngxMatTabsConfig.halfWiredSlotSink}.\n *\n * @category ui/mat-tabs\n */\nexport function withHalfWiredSlotSink(sink: CngxMatTabHalfWiredSlotSink): CngxMatTabsConfigFeature {\n return feature({ halfWiredSlotSink: sink });\n}\n\nfunction mergeFeatures(features: readonly CngxMatTabsConfigFeature[]): Partial<CngxMatTabsConfig> {\n const merged: {\n -readonly [K in keyof CngxMatTabsConfig]?: CngxMatTabsConfig[K];\n } = {};\n for (const f of features) {\n Object.assign(merged, f.config);\n }\n return merged;\n}\n\n/**\n * App-wide `[cngxMatTabs]` configuration. Returns\n * `EnvironmentProviders` for use inside `bootstrapApplication`'s\n * `providers` array.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [\n * provideMatTabsConfig(\n * withAnchorRetryAttempts(10),\n * withHalfWiredSlotSink((missing) => Sentry.captureMessage(`half-wired ${missing}`)),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfig(\n ...features: CngxMatTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) },\n ]);\n}\n\n/**\n * Component-scope `[cngxMatTabs]` configuration. Returns a\n * `Provider[]` so the result can be spread into a component's\n * `providers` or `viewProviders` (which cannot accept opaque\n * environment providers).\n *\n * ```ts\n * @Component({\n * selector: 'app-tabs-page',\n * viewProviders: [\n * ...provideMatTabsConfigAt(withAnchorRetryAttempts(20)),\n * ],\n * ...\n * })\n * ```\n *\n * @category ui/mat-tabs\n */\nexport function provideMatTabsConfigAt(...features: CngxMatTabsConfigFeature[]): Provider[] {\n return [{ provide: CNGX_MAT_TABS_CONFIG, useValue: mergeFeatures(features) }];\n}\n\n/**\n * Resolve the effective `[cngxMatTabs]` configuration for the current\n * injector. Always returns a fully populated, non-`undefined` object\n * so call sites do not need null-coalescing.\n *\n * Resolution order per key:\n * 1. `CNGX_MAT_TABS_CONFIG` value (set via\n * {@link provideMatTabsConfig} / {@link provideMatTabsConfigAt}).\n * 2. {@link CNGX_MAT_TABS_CONFIG_DEFAULTS} (library default).\n *\n * @category ui/mat-tabs\n */\nexport function injectMatTabsConfig(): Required<CngxMatTabsConfig> {\n const user = inject(CNGX_MAT_TABS_CONFIG, { optional: true }) ?? {};\n return {\n anchorMaxAttempts: user.anchorMaxAttempts ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.anchorMaxAttempts,\n halfWiredSlotSink: user.halfWiredSlotSink ?? CNGX_MAT_TABS_CONFIG_DEFAULTS.halfWiredSlotSink,\n };\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabAggregatorContent` template.\n * Drives the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound aggregator wants\n * reveal. The surrounding span (with its `cngx-sr-only` class, its\n * stable id, and the `aria-describedby` wiring on the button)\n * stays library-owned - the slot only customises the descriptor\n * text or markup so consumers can swap the announcement phrasing\n * (counter pills, localised templates, branded prefixes) without\n * fighting the AT contract.\n *\n * `count` mirrors the bound aggregator's `errorCount()` at the\n * moment the decoration was applied; `label` is the human-readable\n * label of the tab (the Material `MatTab.textLabel`);\n * `announcement` is the resolved AT phrase (the same string the\n * imperative `textContent` fallback would write). All three are\n * snapshotted into the decorated entry - re-emissions of the\n * underlying signals re-fire the projector's effect, which\n * re-applies the decoration with the fresh context.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabAggregatorContentContext {\n /** Aggregated error count for this tab (≥ 1 when shown). */\n readonly count: number;\n /** Resolved tab label (Material `textLabel`). */\n readonly label: string;\n /**\n * Resolved AT announcement phrase the imperative fallback path\n * would write verbatim - the bound aggregator's `announcement()`\n * value at the moment the decoration was applied. Use this when\n * the consumer template wants to render the canonical phrase\n * alongside its own decoration (counter pill, branded prefix)\n * without re-injecting the aggregator.\n */\n readonly announcement: string;\n}\n\n/**\n * Structural slot directive marking the aggregator-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the aggregator's `announcement()` string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxStepBadge`, `CngxTabErrorBadge`, `CngxTabOverflowItem`).\n *\n * Material owns the tab-button chrome; the cngx descriptor span is\n * the only consumer-visible decoration seam, so this slot directive\n * lands with one in-package consumer (the package-private\n * aggregator-decoration projector).\n *\n * ```html\n * <mat-tab-group cngxMatTabs>\n * <ng-template\n * cngxMatTabAggregatorContent\n * let-count=\"count\"\n * let-label=\"label\"\n * >\n * {{ label }}: {{ count }} validation issue(s)\n * </ng-template>\n * <mat-tab label=\"Profile\" cngxMatTabError=\"profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-aggregator-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabRejectionContent\n */\n@Directive({\n selector: 'ng-template[cngxMatTabAggregatorContent]',\n exportAs: 'cngxMatTabAggregatorContent',\n standalone: true,\n})\nexport class CngxMatTabAggregatorContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabAggregatorContentContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context passed to the `*cngxMatTabRejectionContent` template. Drives\n * the SR-descriptor content rendered inside the\n * `<span class=\"cngx-sr-only\">` decoration that `[cngxMatTabs]`\n * appends to a Material tab button when its bound `commitAction`\n * rejects a tab change. The surrounding span (with its\n * `cngx-sr-only` class, its stable id, and the `aria-describedby`\n * wiring on the button) stays library-owned - the slot only\n * customises the descriptor text or markup so consumers can swap\n * the rejection phrasing (branded prefixes, retry CTAs, localised\n * templates) without fighting the AT contract.\n *\n * `failedHandleId` is the stable id of the rejected handle (the\n * same id the descriptor span uses as its `${id}-rejected` DOM id);\n * `originLabel` is the label the rollback returned to (when the\n * presenter exposes an `originIndexDuringCommit` and that index\n * resolves to a handle with a non-empty label) - `undefined` when\n * no labelled rollback origin is resolvable; `fallbackText` is the\n * built-in i18n phrase the imperative fallback path would write\n * verbatim (typically `commitRolledBackTo(originLabel)` when the\n * origin is resolvable, `commitFailedRetry` otherwise).\n *\n * **Re-instantiation warning.** The decoration projector destroys\n * the embedded view and creates a fresh one on every `descriptorText`\n * re-emission - typical when the rollback origin label resolves\n * later than the failed-handle id (e.g. `presenter.tabs()` re-emits\n * mid-rejection and the origin label flows in on the second tick).\n * The slot template runs to the end of its lifecycle each time;\n * consumers wiring expensive subtrees (e.g. an embedded chart, a\n * complex form) should treat this as a destroy + remount cycle and\n * lift heavy state into a sibling `*ngTemplateOutlet`-friendly\n * structure outside the slot. Cheap text + simple markup (the\n * intended use) sees no observable difference.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabRejectionContentContext {\n /** Stable id of the rejected `CngxTabHandle`. */\n readonly failedHandleId: string;\n /**\n * Label of the rollback origin (only set when the presenter's\n * `originIndexDuringCommit` resolves to a handle with a non-empty\n * label).\n */\n readonly originLabel: string | undefined;\n /**\n * Library-default i18n phrase the imperative fallback path would\n * write verbatim. Use this if the consumer template wants to\n * render the canonical phrase as a base alongside its own\n * decoration (icon, branded prefix, retry CTA).\n */\n readonly fallbackText: string;\n}\n\n/**\n * Structural slot directive marking the rejection-descriptor\n * template for `[cngxMatTabs]`. Discovered via `contentChild` on the\n * directive; when bound, the projector renders an embedded view of\n * this template into the SR-only descriptor span instead of writing\n * the resolved fallback string verbatim.\n *\n * Pure marker - zero logic. Holds only a typed\n * {@link TemplateRef} reference. Mirrors the family-standard slot\n * pattern (`CngxMatTabAggregatorContent`, `CngxStepBadge`,\n * `CngxTabErrorBadge`).\n *\n * Cascade resolution:\n * 1. Per-instance `*cngxMatTabRejectionContent` template wins\n * via `contentChild(CngxMatTabRejectionContent)`.\n * 2. Library default - imperative `Renderer2.createElement('span')`\n * with `textContent = fallbackText` (the resolved\n * `commitRolledBackTo(originLabel)` / `commitFailedRetry`\n * phrase from `injectTabsI18n()`).\n *\n * ```html\n * <mat-tab-group cngxMatTabs [commitAction]=\"save\">\n * <ng-template\n * cngxMatTabRejectionContent\n * let-failedHandleId=\"failedHandleId\"\n * let-originLabel=\"originLabel\"\n * let-fallbackText=\"fallbackText\"\n * >\n * <span class=\"brand-icon\" aria-hidden=\"true\"></span>\n * {{ fallbackText }}\n * @if (originLabel) {\n * <button (click)=\"retry(failedHandleId)\">Retry</button>\n * }\n * </ng-template>\n * <mat-tab label=\"Profile\">…</mat-tab>\n * </mat-tab-group>\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/decorations/mat-tab-rejection-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabAggregatorContent, CngxMatTabError\n */\n@Directive({\n selector: 'ng-template[cngxMatTabRejectionContent]',\n exportAs: 'cngxMatTabRejectionContent',\n standalone: true,\n})\nexport class CngxMatTabRejectionContent {\n readonly templateRef = inject<TemplateRef<CngxMatTabRejectionContentContext>>(TemplateRef);\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n type DestroyRef,\n effect,\n inject,\n type Injector,\n type Renderer2,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Options for {@link mountLiveRegionAnnouncer}.\n *\n * @internal\n */\nexport interface CngxMatTabLiveRegionOptions {\n /** Reactive announcement text. Empty string keeps the region quiet. */\n readonly announcement: Signal<string>;\n readonly renderer: Renderer2;\n readonly injector: Injector;\n readonly destroyRef: DestroyRef;\n /** Default: `'cngx-sr-only'`. */\n readonly srOnlyClassName?: string;\n /** Default: `'polite'`. */\n readonly politeness?: 'polite' | 'assertive';\n}\n\n/**\n * Mount a polite ARIA live region under `document.body` and keep\n * its `textContent` in sync with the supplied `announcement`\n * signal. Empty string between transitions so AT readers stay quiet\n * on no-op CD ticks.\n *\n * The span lives at body scope (matching the CDK `LiveAnnouncer`\n * placement convention) so Material's MDC tolerance for unexpected\n * children at the `<mat-tab-group>` host root is irrelevant — the\n * live-region never lands inside Material's component DOM. The\n * element's host bindings replicate {@link CngxLiveRegion}\n * imperatively (this attribute directive owns no template, so the\n * declarative `cngxLiveRegion` selector is unreachable).\n * Cleaned up via the supplied `DestroyRef`.\n *\n * @internal — package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport function mountLiveRegionAnnouncer(\n opts: CngxMatTabLiveRegionOptions,\n): void {\n const srOnlyClassName = opts.srOnlyClassName ?? 'cngx-sr-only';\n const politeness = opts.politeness ?? 'polite';\n const role = politeness === 'assertive' ? 'alert' : 'status';\n const doc = runInInjectionContext(opts.injector, () => inject(DOCUMENT));\n const liveRegionEl = opts.renderer.createElement('span') as HTMLElement;\n opts.renderer.addClass(liveRegionEl, srOnlyClassName);\n opts.renderer.setAttribute(liveRegionEl, 'aria-live', politeness);\n opts.renderer.setAttribute(liveRegionEl, 'aria-atomic', 'true');\n opts.renderer.setAttribute(liveRegionEl, 'aria-relevant', 'additions text');\n opts.renderer.setAttribute(liveRegionEl, 'role', role);\n opts.renderer.appendChild(doc.body, liveRegionEl);\n\n runInInjectionContext(opts.injector, () => {\n effect(() => {\n const text = opts.announcement();\n untracked(() => {\n opts.renderer.setProperty(liveRegionEl, 'textContent', text);\n });\n });\n });\n\n opts.destroyRef.onDestroy(() => {\n opts.renderer.removeChild(doc.body, liveRegionEl);\n });\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type { CngxTabGroupHost, injectTabsI18n } from '@cngx/common/tabs';\n\n/**\n * Reactive rejection-state derivation shared by the descriptor-text\n * pipeline and the `*cngxMatTabRejectionContent` slot context.\n *\n * Both consumers need the same source resolution (failed index →\n * origin index → origin tab label), so a single factory deduplicates\n * the lookup and keeps `[cngxMatTabs]` thin enough to pass the\n * organism-LOC guard.\n *\n * @internal — package-private helper for `[cngxMatTabs]`. Not\n * exported from `public-api.ts`.\n */\nexport interface CngxMatTabRejectionState {\n /**\n * Reactive label of the rollback origin — `undefined` when no\n * rejection is pinned, when the origin index is unresolved, or\n * when the origin tab carries no label.\n */\n readonly originLabel: Signal<string | undefined>;\n /**\n * Reactive descriptor phrase — the `commitRolledBackTo(originLabel)`\n * variant when an origin label resolves, falling back to\n * `commitFailedRetry` otherwise. Empty string between rejections\n * (the projector clears the decoration entirely on\n * `failedHandleId === null`, so consumers only consult this while\n * a rejection is pinned).\n */\n readonly descriptorText: Signal<string>;\n /**\n * SR-friendly text rendered inside the polite live-region span.\n * Mirrors `tab-group.component.ts`'s `liveAnnouncement` rejection\n * arm so AT users on Material `<mat-tab-group>` get the same\n * commit-transition narrative as cngx-native:\n *\n * 1. `'pending'` → `i18n.commitInFlight`\n * 2. `'error'` → `commitRolledBackTo(originLabel)` when an\n * origin label resolves, `commitFailedRetry` otherwise\n * 3. anything else → empty string (region stays quiet on no-op\n * CD ticks; mat-tabs does not announce success transitions\n * because Material's own ARIA already narrates the\n * activeIndex change — duplicating would make AT readers\n * hear two utterances per nav)\n */\n readonly liveAnnouncement: Signal<string>;\n}\n\n/**\n * Build the {@link CngxMatTabRejectionState} bundle for a given\n * presenter + i18n pair. Two computeds share one source-walk\n * (`lastFailedIndex` → `originIndexDuringCommit` → `tabs[idx].label()`)\n * via Angular's signal memoisation — the second computed re-uses\n * the first's cached `originLabel` value, so the `tabs()` traversal\n * happens at most once per state change.\n *\n * @internal\n */\nexport function createRejectionState(\n presenter: CngxTabGroupHost,\n i18n: ReturnType<typeof injectTabsI18n>,\n): CngxMatTabRejectionState {\n const originLabel: Signal<string | undefined> = computed(() => {\n const failedIdx = presenter.lastFailedIndex();\n if (failedIdx === undefined) {\n return undefined;\n }\n const originIdx = presenter.originIndexDuringCommit();\n if (originIdx === undefined) {\n return undefined;\n }\n return presenter.tabs()[originIdx]?.label() ?? undefined;\n });\n\n const descriptorText: Signal<string> = computed(() => {\n if (presenter.lastFailedIndex() === undefined) {\n return '';\n }\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n });\n\n const liveAnnouncement: Signal<string> = computed(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n const label = originLabel();\n return label ? i18n.commitRolledBackTo(label) : i18n.commitFailedRetry;\n }\n return '';\n });\n\n return { originLabel, descriptorText, liveAnnouncement };\n}\n","import {\n computed,\n InjectionToken,\n type Injector,\n signal,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport type { MatTab } from '@angular/material/tabs';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport type { CngxTabHandle } from '@cngx/common/tabs';\n\nimport type { MaterialPrivateSurfaces } from './private-surfaces';\n\n/**\n * Wiring bundle returned from {@link createMatTabHandle}. The\n * directive owns the writable `errorAggregator` slot so the\n * `[cngxMatTabError]` per-tab directive can pump aggregators into\n * it; `label` and `disabled` track Material's current state via a\n * `toSignal(matTab._stateChanges)` trigger.\n */\nexport interface CngxMatTabHandleSetup {\n readonly handle: CngxTabHandle;\n /** Convenience mirror of `handle.label`. */\n readonly label: Signal<string | undefined>;\n /** Convenience mirror of `handle.disabled`. */\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: WritableSignal<CngxErrorAggregatorContract | undefined>;\n /**\n * Direct invalid flag the `[cngxMatTabErrorFlag]` directive writes -\n * `string | boolean`, mirroring `CngxTab.error`. Folds into the\n * handle's `hasError` / `errorMessage` alongside the aggregator.\n */\n readonly directError: WritableSignal<string | boolean>;\n}\n\n/**\n * Translates a Material `MatTab` into a cngx {@link CngxTabHandle}\n * plus a writable `errorAggregator` slot the `[cngxMatTabError]`\n * directive binds.\n *\n * - `id` - fresh `idSeed()` value; a label-keyed id would collide\n * when two tabs share a label.\n * - `label` / `disabled` - `computed` signals retriggered by\n * `toSignal(matTab._stateChanges)`. Bridge lifetime is tied to\n * the supplied `injector` (typically a per-tab child\n * `EnvironmentInjector`). `_stateChanges` is a Material-internal\n * surface.\n * - `errorAggregator` - writable seeded at `undefined`;\n * `[cngxMatTabError]` writes its bound aggregator in and resets\n * on teardown. The handle exposes `.asReadonly()` to preserve the\n * `CngxTabHandle` contract.\n * - `directError` - writable seeded at `false`;\n * `[cngxMatTabErrorFlag]` writes its `string | boolean` value in\n * and resets on teardown. Folds into `hasError` / `errorMessage`.\n *\n * @category ui/mat-tabs\n */\nexport function createMatTabHandle(\n matTab: MatTab,\n idSeed: () => string,\n injector: Injector,\n): CngxMatTabHandleSetup {\n // Typed local - anchors `MaterialPrivateSurfaces.StateChangeSource`\n // at the consumer site so an upgrade-watch grep lands here too.\n // Documentation-only at runtime; MatTab's public typing already\n // exposes `_stateChanges`.\n const stateChangeSource: MaterialPrivateSurfaces.StateChangeSource = matTab;\n // `equal: () => false` is load-bearing - `_stateChanges` is a\n // `Subject<void>`, so `Object.is(undefined, undefined)` would dedup\n // every emission and the dependent computeds would never recompute.\n const stateChangeTrigger = toSignal(stateChangeSource._stateChanges, {\n injector,\n initialValue: undefined,\n equal: () => false,\n });\n const label = computed<string | undefined>(() => {\n stateChangeTrigger();\n return matTab.textLabel;\n });\n const disabled = computed<boolean>(() => {\n stateChangeTrigger();\n return matTab.disabled;\n });\n const errorAggregator = signal<CngxErrorAggregatorContract | undefined>(undefined);\n // Direct invalid flag written by `[cngxMatTabErrorFlag]` - the\n // Material-side author surface mirroring `CngxTab.error`.\n const directError = signal<string | boolean>(false);\n // Folded error state for the widened `CngxTabHandle` contract. Direct\n // flag OR the aggregator's reveal-gated `shouldShow()` (so deferred-\n // reveal validation stays silent until revealed).\n const hasError = computed<boolean>(\n () => {\n const direct = directError();\n return (direct !== false && direct !== '') || (errorAggregator()?.shouldShow?.() ?? false);\n },\n { equal: Object.is },\n );\n // Resolved direct-error message: the flag string when non-empty, else\n // `undefined`. The aggregator carries its own announcement separately.\n const errorMessage = computed<string | undefined>(() => {\n const direct = directError();\n return typeof direct === 'string' && direct !== '' ? direct : undefined;\n });\n // Material owns its own tab lifecycle - the cngx dismissable/addable\n // affordances are native-only by design, so the Material handle pins\n // `closable` to `undefined` (group-default, never a close button).\n const closable = signal<boolean | undefined>(undefined);\n // Material owns its tab-button chrome (no DOM seam for a stacked\n // second line), so the bridge pins `subLabel` to `undefined` - same\n // native-only staging as `closable`.\n const subLabel = signal<string | undefined>(undefined);\n // `nextUid` is process-wide monotonic, so `${id}-errors` descriptor\n // ids stay unique across coexisting `[cngxMatTabs]` instances.\n const id = idSeed();\n return {\n handle: {\n id,\n label,\n subLabel: subLabel.asReadonly(),\n disabled,\n errorAggregator: errorAggregator.asReadonly(),\n hasError,\n errorMessage,\n closable: closable.asReadonly(),\n },\n label,\n disabled,\n errorAggregator,\n directError,\n };\n}\n\n/**\n * Factory signature for {@link createMatTabHandle}. The DI token\n * {@link CNGX_MAT_TAB_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * @category ui/mat-tabs\n */\nexport type CngxMatTabHandleFactory = typeof createMatTabHandle;\n\n/**\n * DI token fronting the per-tab handle factory used by\n * `[cngxMatTabs]`. Default is {@link createMatTabHandle}. Symmetric\n * with `CNGX_MAT_STEP_HANDLE_FACTORY` and\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`.\n *\n * The seam separates handle shape (factory body) from id keying\n * (the supplied `idSeed` closure). Overrides may call, ignore, or\n * replace `idSeed` - server-synced ids, deterministic test ids,\n * consumer-domain ids - without touching the factory body.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_TAB_HANDLE_FACTORY,\n * useValue: ((tab, idSeed, injector) => {\n * const setup = createMatTabHandle(tab, idSeed, injector);\n * reportTabRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatTabHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TAB_HANDLE_FACTORY = new InjectionToken<CngxMatTabHandleFactory>(\n 'CNGX_MAT_TAB_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatTabHandle,\n },\n);\n","import {\n contentChildren,\n createEnvironmentInjector,\n DestroyRef,\n Directive,\n effect,\n EnvironmentInjector,\n inject,\n InjectionToken,\n untracked,\n} from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { CNGX_MAT_TAB_HANDLE_FACTORY, type CngxMatTabHandleSetup } from './material-bridge/handle';\n\n/**\n * Per-MatTab registry entry. The child `EnvironmentInjector` scopes\n * the per-tab `_stateChanges` bridge - destroying it fires\n * `takeUntilDestroyed` so the subscription unsubscribes\n * deterministically.\n *\n * @internal\n */\ninterface CngxMatTabsRegistryEntry {\n readonly setup: CngxMatTabHandleSetup;\n readonly childInjector: EnvironmentInjector;\n}\n\n/**\n * Read-mostly contract for the per-tab handle-setup registry.\n * `[cngxMatTabError]` and any future `[cngxMatTab*]` decoration\n * directive injects this with `{ host: true }` to reach the\n * per-handle `errorAggregator` slot without walking the concrete\n * registry class.\n *\n * Return type narrows to `Pick<..., 'errorAggregator'>` so the\n * access path exposes only the per-handle aggregator slot; the\n * rest of the setup stays internal bookkeeping.\n *\n * @category ui/mat-tabs\n */\nexport interface CngxMatTabsRegistryHost {\n /**\n * Returns the per-handle writable slots (`errorAggregator`,\n * `directError`), or `undefined` before the tab is registered. The\n * `contentChildren(MatTab)` query lands during content-init, so a\n * same-microtask injection from an attribute directive can race;\n * consumers recover by tracking `presenter.tabs()` and re-attempting\n * on the next sync tick.\n */\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined;\n}\n\n/**\n * DI token the {@link CngxMatTabsRegistry} directive provides via\n * `useExisting`. Sibling per-tab directives inject this with\n * `{ host: true }` to reach per-handle slots without walking the\n * concrete registry class.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_TABS_REGISTRY_HOST = new InjectionToken<CngxMatTabsRegistryHost>(\n 'CngxMatTabsRegistryHost',\n);\n\n/**\n * Sibling host-directive that owns the per-MatTab handle registry\n * for `[cngxMatTabs]`. Keeps the parent under the level-4 organism\n * LOC guard and lets per-tab decoration directives reach the\n * registry through a typed token.\n *\n * Owns: `contentChildren(MatTab)` query, the `setupsByTab` map\n * (per-tab cngx setup paired with a child `EnvironmentInjector`\n * scoping the `_stateChanges` bridge), an `effect()` that diffs the\n * MatTab list and (un)registers handles with `CNGX_TAB_GROUP_HOST`,\n * and a `DestroyRef` cleanup that destroys every child injector.\n *\n * Composition: `[cngxMatTabs]` declares this in `hostDirectives`;\n * both share the parent's `CngxTabGroupPresenter` and the same\n * `<mat-tab-group>` content-children scope.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs-registry.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CNGX_MAT_TABS_REGISTRY_HOST\n */\n@Directive({\n selector: '[cngxMatTabsRegistry]',\n exportAs: 'cngxMatTabsRegistry',\n standalone: true,\n providers: [\n {\n provide: CNGX_MAT_TABS_REGISTRY_HOST,\n useExisting: CngxMatTabsRegistry,\n },\n ],\n})\nexport class CngxMatTabsRegistry implements CngxMatTabsRegistryHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly envInjector = inject(EnvironmentInjector);\n private readonly createHandle = inject(CNGX_MAT_TAB_HANDLE_FACTORY);\n\n private readonly matTabs = contentChildren(MatTab, { descendants: true });\n // Map (not WeakMap) so the diff loop in `syncHandles` can iterate\n // to find removed tabs without a parallel `Set<MatTab>`. Entries\n // are explicitly deleted when the matching MatTab leaves the\n // children set, AND the map goes away on directive destroy.\n private readonly setupsByTab = new Map<MatTab, CngxMatTabsRegistryEntry>();\n\n constructor() {\n effect(() => {\n const tabs = this.matTabs();\n untracked(() => this.syncHandles(tabs));\n });\n\n this.destroyRef.onDestroy(() => {\n for (const entry of this.setupsByTab.values()) {\n // Disposes the per-tab `toSignal(_stateChanges)` bridge.\n entry.childInjector.destroy();\n }\n this.setupsByTab.clear();\n });\n }\n\n getHandleSetup(\n matTab: MatTab,\n ): Pick<CngxMatTabHandleSetup, 'errorAggregator' | 'directError'> | undefined {\n return this.setupsByTab.get(matTab)?.setup;\n }\n\n private syncHandles(tabs: readonly MatTab[]): void {\n const liveTabs = new Set<MatTab>(tabs);\n for (const tab of tabs) {\n if (this.setupsByTab.has(tab)) {\n continue;\n }\n // Per-tab child injector scopes the `toSignal(_stateChanges)`\n // bridge inside createMatTabHandle - destroying it on tab\n // removal fires `takeUntilDestroyed`.\n const childInjector = createEnvironmentInjector([], this.envInjector);\n const idSeed = () => nextUid('cngx-mat-tab-');\n const setup = this.createHandle(tab, idSeed, childInjector);\n this.setupsByTab.set(tab, { setup, childInjector });\n this.presenter.register(setup.handle);\n }\n // Snapshot entries before the loop so multi-key deletes inside\n // the body never collide with iterator state.\n for (const [tab, entry] of Array.from(this.setupsByTab.entries())) {\n if (liveTabs.has(tab)) {\n continue;\n }\n entry.childInjector.destroy();\n this.setupsByTab.delete(tab);\n this.presenter.unregister(entry.setup.handle.id);\n }\n }\n}\n","import type { CngxTabOverflowDomAdapter } from '@cngx/common/tabs';\n\nimport { MaterialPrivateSurfaces } from '../material-bridge/private-surfaces';\n\n/**\n * Material variant of {@link CngxTabOverflowDomAdapter}.\n *\n * `resolveStripRoot` walks from host up to `<mat-tab-header>` and\n * locates `.mat-mdc-tab-label-container` via any rendered\n * `.mat-mdc-tab` descendant — Material's IO-friendly scroll\n * container.\n *\n * `resolveTabButton` indexes positionally; Material owns the DOM\n * and cngx handle ids never reach the button elements. Index\n * correlates against `presenter.tabs()` registration order.\n *\n * Wire it via the directive's\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` provider:\n *\n * ```ts\n * providers: [\n * { provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n * useValue: createCngxMatTabOverflowDomAdapter }\n * ]\n * ```\n *\n * @category ui/mat-tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/overflow/mat-tab-overflow-dom-adapter.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflow, CngxMatTabs, CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY\n */\nexport function createCngxMatTabOverflowDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n // Returning null is a retry signal — the rAF loop polls again\n // on the next frame, succeeds once MatTabHeader has committed.\n const header = host.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n const anyTab = header?.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n );\n return (\n anyTab?.closest<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_LABEL_CONTAINER_SELECTOR,\n ) ?? null\n );\n },\n resolveTabButton(_handle, root, idx) {\n return (\n root\n .querySelectorAll<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_SELECTOR,\n )\n .item(idx) ?? null\n );\n },\n };\n}\n","import {\n afterNextRender,\n computed,\n contentChild,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n Injectable,\n inject,\n Injector,\n isDevMode,\n Renderer2,\n type Signal,\n type TemplateRef,\n untracked,\n ViewContainerRef,\n type ComponentRef,\n} from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n CNGX_TAB_GROUP_HOST,\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n CNGX_TAB_PANEL_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n type CngxTabPanelHost,\n} from '@cngx/common/tabs';\nimport { CngxTabOverflow } from '@cngx/ui/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { injectMatTabsConfig } from './mat-tabs-config';\nimport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nimport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\nimport { CngxMatTabsRegistry } from './mat-tabs-registry.directive';\nimport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\n\nimport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n\n/**\n * Implements {@link CngxTabPanelHost} for the programmatically\n * mounted overflow popover. Delegates to the directive's\n * `CNGX_TAB_GROUP_HOST` presenter; both template lookups return\n * `null` because Material renders labels through `<mat-tab>` and\n * projected `<mat-tab-content>`.\n *\n * Class instead of factory-returned literal so a telemetry or\n * branded variant can subclass + swap via `useClass`. The directive\n * registers it once and binds `CNGX_TAB_PANEL_HOST` with\n * `useExisting`.\n *\n * @internal\n */\n@Injectable()\nexport class CngxMatTabsPanelHostAdapter implements CngxTabPanelHost {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n\n readonly tabs = this.presenter.tabs;\n readonly activeId = this.presenter.activeId;\n readonly orientation = this.presenter.orientation;\n\n selectById(id: string): void {\n this.presenter.selectById(id);\n }\n\n labelTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n\n contentTemplateFor(_id: string): TemplateRef<unknown> | null {\n return null;\n }\n}\n\n/**\n * Attaches to an existing `<mat-tab-group>` and wires it to a\n * {@link CngxTabGroupPresenter} - consumers get the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` and\n * `<cngx-banner-on />` compose as children), and the tab-handle\n * registry from one attribute.\n *\n * Topology inverts `<cngx-mat-stepper>`: Material is the host, cngx\n * is the instrumentation layer. `inject(MatTabGroup, { self: true })`\n * resolves on the consumer's own element - no content projection\n * blocker applies here.\n *\n * Rejection (`--error`) and aggregator (`--has-errors`) visuals\n * live in the package-private projector factories under\n * `./decorations/`; this directive supplies their reactive triggers\n * and the delegators consumer templates call.\n *\n * @playground Form error aggregation ./examples/form-errors/form-errors.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tabs.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabsRegistry, CngxMatTabError, CngxMatStepper\n */\n@Directive({\n selector: '[cngxMatTabs]',\n exportAs: 'cngxMatTabs',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxTabGroupPresenter,\n inputs: ['activeIndex', 'orientation', 'loop', 'commitAction', 'commitMode'],\n outputs: ['activeIndexChange'],\n },\n // Provides `CNGX_MAT_TABS_REGISTRY_HOST` so per-tab decoration\n // directives reach the registry through a typed token rather\n // than injecting this concrete class.\n CngxMatTabsRegistry,\n ],\n providers: [\n // Material variant of the overflow molecule's DOM-resolution\n // strategy. Swaps `.cngx-tabs__strip-wrapper` walks for the Material\n // `.mat-mdc-tab-header` → `.mat-mdc-tab-label-container` walk and\n // index-based `.mat-mdc-tab` resolution.\n {\n provide: CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n useValue: createCngxMatTabOverflowDomAdapter,\n },\n // Panel-host adapter for the programmatically mounted overflow\n // molecule. `useExisting` binding below ensures every injection\n // resolves to the single per-host instance. The cngx-native\n // `<cngx-tab-group>` path keeps its own `useExisting:\n // CngxTabGroup` provider - sits one injector layer closer.\n CngxMatTabsPanelHostAdapter,\n {\n provide: CNGX_TAB_PANEL_HOST,\n useExisting: CngxMatTabsPanelHostAdapter,\n },\n ],\n})\nexport class CngxMatTabs {\n private readonly matTabGroup = inject(MatTabGroup, { self: true });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n // Field order matters - `overflowRef` reads `viewContainerRef` at\n // class-init time. The VCR also feeds the aggregator-decoration\n // slot path further down.\n private readonly viewContainerRef = inject(ViewContainerRef);\n\n // Programmatic mount of the cngx overflow molecule.\n // `injector: this.injector` is load-bearing - without it,\n // `vcr.createComponent` walks the host-template's parent VCR for\n // DI resolution, missing this directive's `CNGX_TAB_PANEL_HOST`\n // and `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` providers, and the\n // molecule NG0201s on `inject(CNGX_TAB_PANEL_HOST)`. The molecule\n // initially lands as a sibling of `<mat-tab-group>`; the\n // `afterNextRender` block below moves it into\n // `.mat-mdc-tab-header`.\n private readonly overflowRef: ComponentRef<CngxTabOverflow> =\n this.viewContainerRef.createComponent(CngxTabOverflow, {\n injector: this.injector,\n });\n\n private readonly aggregatorContentSlot = contentChild(CngxMatTabAggregatorContent);\n private readonly aggregatorContentTemplate: Signal<TemplateRef<CngxMatTabAggregatorContentContext> | null> =\n computed(() => this.aggregatorContentSlot()?.templateRef ?? null);\n private readonly rejectionContentSlot = contentChild(CngxMatTabRejectionContent);\n private readonly rejectionContentTemplate: Signal<TemplateRef<CngxMatTabRejectionContentContext> | null> =\n computed(() => this.rejectionContentSlot()?.templateRef ?? null);\n private readonly i18n = injectTabsI18n();\n\n // Identity equal on `string | null` - collapses `tabs()` re-emits\n // that don't change the failed-target id.\n private readonly failedHandleId = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n // Bundle shares one source-walk across descriptorText / originLabel\n // / liveAnnouncement - pillar-2 phrasing parity with cngx-native.\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n\n // Shared with `[cngxMatTabNav]` - one body, two hosts (Pillar 3).\n // Structural equal lives in the factory so the projector doesn't\n // churn on no-op aggregator re-emissions.\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n const matTabsConfig = injectMatTabsConfig();\n\n // Polite live region - attribute directive owns no template, so\n // the helper attaches the span at document.body (CDK\n // LiveAnnouncer convention) and mirrors `CngxLiveRegion`'s host\n // bindings imperatively.\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Decoration projectors own DOM-mutation state plus `effect()`\n // registration; the directive only supplies reactive triggers.\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.rejectionContentTemplate,\n viewContainerRef: this.viewContainerRef,\n originLabel: this.rejectionState.originLabel,\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n contentTemplate: this.aggregatorContentTemplate,\n viewContainerRef: this.viewContainerRef,\n onHalfWiredSlot: matTabsConfig.halfWiredSlotSink,\n });\n\n this.destroyRef.onDestroy(() => this.overflowRef.destroy());\n\n // Anchor the overflow molecule inside `.mat-mdc-tab-header` so\n // the More button pins to the strip's trailing edge. Bounded\n // `createDomAnchorRetry` covers the deferred-host case\n // (`<mat-tab-group>` gated behind `*ngIf` / `@defer`); the cap\n // dev-warns when consumer DOM never materialises. The\n // flex-layout skin in `mat-tabs.css` handles positioning - no\n // imperative layout work needed.\n const anchorMaxAttempts = matTabsConfig.anchorMaxAttempts;\n const anchorRetry = inject(CNGX_DOM_ANCHOR_RETRY_FACTORY)({\n attempt: () => {\n const headerEl = this.hostEl.querySelector<HTMLElement>(\n MaterialPrivateSurfaces.MAT_MDC_TAB_HEADER_SELECTOR,\n );\n if (!headerEl) {\n return null;\n }\n const overflowEl = this.overflowRef.location.nativeElement as HTMLElement;\n this.renderer.addClass(overflowEl, 'cngx-mat-tabs-more');\n this.renderer.appendChild(headerEl, overflowEl);\n return true;\n },\n maxAttempts: anchorMaxAttempts,\n schedule: (cb) => {\n afterNextRender(cb, { injector: this.injector });\n return () => undefined;\n },\n onGiveUp: () => {\n if (isDevMode()) {\n console.warn(\n `[CngxMatTabs] Could not anchor <cngx-tab-overflow> after ${anchorMaxAttempts} ` +\n 'attempts - .mat-mdc-tab-header was not found inside the ' +\n 'host. The More popover will fall back to a sibling-of-' +\n '<mat-tab-group> position; verify Material rendered the ' +\n 'strip (e.g. consumer is not gating <mat-tab-group> behind ' +\n 'a never-true *ngIf / @defer).',\n );\n }\n },\n });\n afterNextRender(() => anchorRetry.start());\n this.destroyRef.onDestroy(() => anchorRetry.cancel());\n\n const sync = createMaterialBidirectionalSync({\n presenterIndex: this.presenter.activeIndex,\n readSelectedIndex: () => this.matTabGroup.selectedIndex ?? 0,\n writeSelectedIndex: (i) => {\n this.matTabGroup.selectedIndex = i;\n },\n selectionChange$: this.matTabGroup.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => this.presenter.select(i),\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Routed (pessimistic) gate: a rejected switch holds `activeIndex` at\n // origin, so the presenter to Material mirror never fires and Material\n // stays eager-advanced on the refused tab. Snap it back when the\n // commit settles into an error. `status()` always transitions through\n // `pending` first, so the `error` edge is observed even when the\n // router cancels a microtask after `navigate()`.\n effect(() => {\n const status = this.presenter.commitState.status();\n untracked(() => {\n if (status === 'error') {\n sync.reconcile();\n }\n });\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors `CngxTabGroup.clearLastFailed()` so a\n * template ref (`#mt=\"cngxMatTabs\"`) is enough - no host-token\n * injection needed.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n Injector,\n Renderer2,\n type Signal,\n} from '@angular/core';\n\nimport {\n CNGX_TAB_GROUP_HOST,\n CngxTabGroupPresenter,\n injectTabsI18n,\n type CngxTabGroupHost,\n} from '@cngx/common/tabs';\n\nimport {\n createMatTabAggregatorDecoration,\n createMatTabRejectionDecoration,\n} from './decorations/decoration-projectors';\nimport { createAggregatedErrorTabs } from './decorations/aggregated-error-tabs';\nimport { mountLiveRegionAnnouncer } from './decorations/live-region';\nimport { createRejectionState } from './decorations/rejection-state';\n\n/**\n * Layers the cngx error / rejection / announcement layer onto\n * Material's native router tabs (`<nav mat-tab-nav-bar>` /\n * `<a mat-tab-link>` / `<mat-tab-nav-panel>`). The parallel bridge to\n * {@link CngxMatTabs}: `MatTabNav` has no `MatTab` and no\n * `selectedIndex`, so handles register per `<a mat-tab-link>` via\n * {@link CngxMatTabLink}, and the decoration projectors target\n * `.mat-mdc-tab-link` instead of `.mat-mdc-tab`.\n *\n * Gating is **native**: each link is a `routerLink`, so the router runs\n * `CanDeactivate` directly and this directive installs no\n * commit-action. The active index follows the route - add\n * `[cngxTabsRouteSync]` to the same `<nav>` and give each\n * `[cngxMatTabLink]` an `id` matching its route segment; route-sync\n * reflects `NavigationEnd` onto `activeIndex` (its commit-action stays\n * dormant because link clicks navigate natively, never through\n * `presenter.select`). Ableitung statt Verwaltung - the route-active\n * link is the single source of the active index.\n *\n * Composes {@link CngxTabGroupPresenter} via `hostDirectives` so the\n * `CNGX_STATEFUL` producer, the `lastFailedIndex` rejection slot, and\n * the live-region announcer come for free, identical to the cngx\n * organism (Pillar 2 - same communication across skins).\n *\n * Decoration content-template slots (`*cngxMatTabRejectionContent` /\n * `*cngxMatTabAggregatorContent`) are not forwarded on this bridge yet -\n * the projectors render their built-in `cngx-sr-only` spans. The slot\n * inputs that `[cngxMatTabs]` exposes are a deferred follow-up.\n *\n * @playground Native router tabs with a CanDeactivate guard ./examples/router-nav/router-nav.component.ts\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-nav.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabLink, CngxMatTabs, CngxTabsRouteSync\n */\n@Directive({\n selector: '[cngxMatTabNav]',\n exportAs: 'cngxMatTabNav',\n standalone: true,\n hostDirectives: [CngxTabGroupPresenter],\n})\nexport class CngxMatTabNav {\n private readonly presenter = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly i18n = injectTabsI18n();\n\n // Stable id of the rejected link, or null. Identity equal collapses\n // tabs() re-emits that don't change the failed-target id.\n private readonly failedHandleId: Signal<string | null> = computed<string | null>(() => {\n const idx = this.presenter.lastFailedIndex();\n if (idx === undefined) {\n return null;\n }\n return this.presenter.tabs()[idx]?.id ?? null;\n });\n\n private readonly rejectionState = createRejectionState(this.presenter, this.i18n);\n private readonly aggregatedErrorTabs = createAggregatedErrorTabs(this.presenter);\n\n constructor() {\n mountLiveRegionAnnouncer({\n announcement: this.rejectionState.liveAnnouncement,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n\n // Same projector bodies as `[cngxMatTabs]`; only the per-tab element\n // selector differs (`.mat-mdc-tab-link` vs `.mat-mdc-tab`).\n createMatTabRejectionDecoration({\n hostEl: this.hostEl,\n failedHandleId: this.failedHandleId,\n failedIndex: this.presenter.lastFailedIndex,\n descriptorText: this.rejectionState.descriptorText,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n originLabel: this.rejectionState.originLabel,\n buttonSelector: '.mat-mdc-tab-link',\n });\n\n createMatTabAggregatorDecoration({\n hostEl: this.hostEl,\n errorTabs: this.aggregatedErrorTabs,\n renderer: this.renderer,\n injector: this.injector,\n destroyRef: this.destroyRef,\n buttonSelector: '.mat-mdc-tab-link',\n });\n }\n\n /**\n * Clears `presenter.lastFailedIndex`, dismissing the rejection\n * decoration. Mirrors {@link CngxMatTabs.clearLastFailed} so a\n * template ref (`#nav=\"cngxMatTabNav\"`) is enough.\n */\n clearLastFailed(): void {\n this.presenter.clearLastFailed();\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n signal,\n} from '@angular/core';\nimport { MatTabLink } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabGroupHost, type CngxTabHandle } from '@cngx/common/tabs';\nimport { nextUid } from '@cngx/core/utils';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registers an `<a mat-tab-link>` anchor as a {@link CngxTabHandle}\n * with the enclosing {@link CngxMatTabNav} presenter. `mat-tab-nav-bar`\n * has no `MatTab` to hang a handle on (the links are the tabs), so this\n * per-link directive is the registration seam - symmetric with how\n * `CngxTab` registers in the cngx-native path and how\n * {@link CngxMatTabsRegistry} registers each `<mat-tab>`.\n *\n * Registration order follows DOM order (Angular instantiates content\n * directives top-to-bottom), so the presenter's `tabs()` index aligns\n * with `nav.querySelectorAll('.mat-mdc-tab-link')` - the index the\n * decoration projectors correlate against.\n *\n * Gating is native: the link's `routerLink` runs `CanDeactivate`\n * directly, so this directive installs no commit-action. The active\n * index follows the route through `[cngxTabsRouteSync]` on the nav,\n * which matches each handle's `id` (set to the route segment) against\n * the URL.\n *\n * @category ui/mat-tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-link.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabNav, CngxMatTabs, CngxTab\n */\n@Directive({\n selector: '[cngxMatTabLink]',\n exportAs: 'cngxMatTabLink',\n standalone: true,\n})\nexport class CngxMatTabLink implements OnInit {\n private readonly matLink = inject(MatTabLink, { self: true });\n private readonly host = inject<CngxTabGroupHost>(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * Handle id. Set it to the link's route segment so the nav's\n * `[cngxTabsRouteSync]` reflects the active route onto this tab via\n * the default `(h) => [h.id]` mapping. Defaults to a fresh uid when\n * route-sync is not used.\n */\n readonly id = input<string>(nextUid('cngx-mat-tab-link-'));\n /** Accessible label fed to the live-region announcer. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Direct error flag for the link - `true` or a non-empty string marks\n * it invalid (the string doubles as the message). Mirrors\n * `CngxTab.error` and `[cngxMatTabErrorFlag]`.\n */\n readonly error = input<string | boolean>(false);\n /** Optional rich error aggregator for the link. */\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n private readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n private readonly hasError: Signal<boolean> = computed(\n () => {\n const direct = this.error();\n return (\n (direct !== false && direct !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n // Material's MatTabLink.disabled is a plain property, not a signal;\n // nav links rarely toggle disabled at runtime, so snapshot it onto a\n // signal at registration. A live binding would need a Material\n // reactive surface MatTabLink does not expose.\n private readonly disabledState = signal<boolean>(false);\n\n ngOnInit(): void {\n this.disabledState.set(this.matLink.disabled);\n const handle: CngxTabHandle = {\n id: this.id(),\n label: this.label,\n subLabel: signal(undefined),\n disabled: this.disabledState.asReadonly(),\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: signal(undefined),\n };\n this.host.register(handle);\n this.destroyRef.onDestroy(() => this.host.unregister(handle.id));\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab error-aggregator binding for `[cngxMatTabs]`. Attach to a\n * `<mat-tab>`; the bound aggregator's `shouldShow()` projects onto\n * the matching Material tab button (badge + descriptor span) via\n * the Renderer2 effect inside {@link CngxMatTabs}.\n *\n * Material owns `<mat-tab>` declarations - `[cngxTab]` cannot host\n * here - so a sibling attribute directive carries the input.\n * Empty-string transform handles the bare-attribute case per\n * `feedback_bridge_input_not_required` (a developer typing\n * `cngxMatTabError` without `[]` brackets must not poison the\n * slot).\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST} -\n * the registry provides the token with `useExisting`, so sibling\n * directives reach per-handle slots through a typed contract\n * instead of the concrete class. Tracks `presenter.tabs()` to\n * recover from a same-microtask race where the directive injects\n * before the registry's sync runs. `destroyRef.onDestroy` clears\n * the slot so an `*ngIf`-toggled binding returns to the\n * no-aggregator default.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabsRegistry, CngxMatTabRejectionContent\n */\n@Directive({\n selector: '[cngxMatTabError]',\n exportAs: 'cngxMatTabError',\n standalone: true,\n})\nexport class CngxMatTabError {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly aggregator = input<\n CngxErrorAggregatorContract | undefined,\n CngxErrorAggregatorContract | '' | undefined\n >(undefined, {\n alias: 'cngxMatTabError',\n transform: (value) => (typeof value === 'string' ? undefined : value),\n });\n\n constructor() {\n effect(() => {\n // Race window - registry's `contentChildren(MatTab)` query and\n // our injection land in the same microtask, so the first lookup\n // can miss our handle. Tracking `presenter.tabs()` re-fires the\n // effect on the next sync tick. `untracked` around the write\n // pre-empts a future regression where `getHandleSetup` reads a\n // signal and self-triggers the aggregator pump.\n const aggregator = this.aggregator();\n // Race-recovery dependency - tracks `setupsByTab` population so\n // the effect re-fires once our `MatTab` is registered. The bare\n // read is intentional; full rationale lives in the effect's\n // opening comment above. Do NOT tag as dead code.\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(aggregator);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.errorAggregator.set(undefined);\n });\n }\n}\n","import { DestroyRef, Directive, effect, inject, input, untracked } from '@angular/core';\nimport { MatTab } from '@angular/material/tabs';\n\nimport { CNGX_TAB_GROUP_HOST } from '@cngx/common/tabs';\n\nimport { CNGX_MAT_TABS_REGISTRY_HOST } from './mat-tabs-registry.directive';\n\n/**\n * Per-tab direct invalid flag for `[cngxMatTabs]` - the simple-case\n * sibling to `[cngxMatTabError]`. Attach to a `<mat-tab>`; the bound\n * `string | boolean` writes the per-handle `directError` slot, which\n * folds into the handle's `hasError` / `errorMessage`. A non-empty\n * string doubles as the SR descriptor message; `true` marks the tab\n * invalid with no message; `false` / `''` clear it.\n *\n * Symmetric with `[cngxMatTabError]` (one directive, one\n * responsibility - Pillar 3): the aggregator stays the rich\n * multi-source path, this is the \"this tab is invalid\" marker that\n * needs no aggregator boilerplate. A bare `cngxMatTabErrorFlag`\n * attribute (no brackets) binds the empty string and is coerced to\n * `true` so presence alone marks the tab invalid.\n *\n * Locates its target via {@link CNGX_MAT_TABS_REGISTRY_HOST}, tracks\n * `presenter.tabs()` to recover from the content-init race, and\n * clears the slot on destroy - exactly as {@link CngxMatTabError}.\n *\n * @category ui/mat-tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-tabs/mat-tab-error-flag.directive.ts\n * @since 0.1.0\n * @relatedTo CngxMatTabs, CngxMatTabError, CngxMatTabsRegistry\n */\n@Directive({\n selector: '[cngxMatTabErrorFlag]',\n exportAs: 'cngxMatTabErrorFlag',\n standalone: true,\n})\nexport class CngxMatTabErrorFlag {\n private readonly matTab = inject(MatTab, { self: true });\n private readonly registry = inject(CNGX_MAT_TABS_REGISTRY_HOST, {\n host: true,\n });\n private readonly presenter = inject(CNGX_TAB_GROUP_HOST);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly error = input<string | boolean, string | boolean>(false, {\n alias: 'cngxMatTabErrorFlag',\n transform: (value) => (value === '' ? true : value),\n });\n\n constructor() {\n effect(() => {\n // Same content-init race as `[cngxMatTabError]` - the registry's\n // `contentChildren(MatTab)` query and our injection land in the\n // same microtask, so tracking `presenter.tabs()` re-fires the\n // effect once our handle is registered. `untracked` around the\n // write keeps the slot pump out of the reactive graph.\n const error = this.error();\n this.presenter.tabs();\n\n untracked(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(error);\n });\n });\n\n this.destroyRef.onDestroy(() => {\n const setup = this.registry.getHandleSetup(this.matTab);\n setup?.directError.set(false);\n });\n }\n}\n","/**\n * @module @cngx/ui/mat-tabs\n *\n * Material instrumentation directive for `<mat-tab-group>`.\n */\nexport { CngxMatTabs } from './mat-tabs.directive';\nexport { CngxMatTabNav } from './mat-tab-nav.directive';\nexport { CngxMatTabLink } from './mat-tab-link.directive';\nexport { CngxMatTabError } from './mat-tab-error.directive';\nexport { CngxMatTabErrorFlag } from './mat-tab-error-flag.directive';\nexport {\n CNGX_MAT_TABS_REGISTRY_HOST,\n CngxMatTabsRegistry,\n type CngxMatTabsRegistryHost,\n} from './mat-tabs-registry.directive';\nexport {\n CngxMatTabAggregatorContent,\n type CngxMatTabAggregatorContentContext,\n} from './decorations/mat-tab-aggregator-content.directive';\nexport {\n CngxMatTabRejectionContent,\n type CngxMatTabRejectionContentContext,\n} from './decorations/mat-tab-rejection-content.directive';\nexport type { CngxMatTabHalfWiredSlotSink } from './decorations/half-wired-slot-sink';\nexport {\n CNGX_MAT_TABS_CONFIG,\n type CngxMatTabsConfig,\n type CngxMatTabsConfigFeature,\n injectMatTabsConfig,\n provideMatTabsConfig,\n provideMatTabsConfigAt,\n withAnchorRetryAttempts,\n withHalfWiredSlotSink,\n} from './mat-tabs-config';\nexport {\n CNGX_MAT_TAB_HANDLE_FACTORY,\n createMatTabHandle,\n type CngxMatTabHandleFactory,\n} from './material-bridge/handle';\nexport { MaterialPrivateSurfaces } from './material-bridge/private-surfaces';\nexport { createCngxMatTabOverflowDomAdapter } from './overflow/mat-tab-overflow-dom-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.CngxMatTabsRegistry"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAMH;AACM,IAAW;AAAjB,CAAA,UAAiB,uBAAuB,EAAA;AA2CtC;;;;;;;;AAQG;IACU,uBAAA,CAAA,oBAAoB,GAAG,cAAc;AAElD;;;;;;;AAOG;IACU,uBAAA,CAAA,2BAA2B,GAAG,qBAAqB;AAEhE;;;;;;;AAOG;IACU,uBAAA,CAAA,oCAAoC,GAC/C,8BAA8B;AAClC,CAAC,EA1EgB,uBAAuB,KAAvB,uBAAuB,GAAA,EAAA,CAAA,CAAA;;ACZxC;;;;;;;;;;;;;;;;;;AAkBG;AAEH;;;;;;;;;;;;;AAaG;AACH,SAAS,iCAAiC,CACxC,EAAe,EACf,aAAqB,EACrB,QAAmB,EACnB,oBAAmC,EAAA;IAEnC,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,kBAAkB,CAAC;IACnD,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,C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