@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
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 +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +224 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +194 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +314 -141
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui-toc.mjs","sources":["../../../projects/ui/toc/config/toc.config.defaults.ts","../../../projects/ui/toc/config/inject-toc-config.ts","../../../projects/ui/toc/toc-item-slot.ts","../../../projects/ui/toc/toc-token.ts","../../../projects/ui/toc/toc.component.ts","../../../projects/ui/toc/toc.component.html","../../../projects/ui/toc/toc-router-sync.directive.ts","../../../projects/ui/toc/config/features.ts","../../../projects/ui/toc/config/provide-toc-config.ts","../../../projects/ui/toc/public-api.ts","../../../projects/ui/toc/cngx-ui-toc.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport type { CngxTocConfig } from './toc.config';\n\n/**\n * Library defaults for the toc configuration cascade. English by default per\n * `feedback_en_default_locale`; locale overrides ride the `withTocAriaLabels`\n * feature. The spy defaults (`rootMargin` / `threshold`) mirror\n * `CngxScrollSpy`'s own input defaults so an un-configured toc tracks\n * scrolling identically to a hand-wired spy.\n *\n * Exported for intra-lib consumers (`provideTocConfig` deep-merges with this\n * base) but **NOT** re-exported from `public-api.ts` - downstream consumers\n * reach the defaults via `inject(CNGX_TOC_CONFIG)` so `provideTocConfig` /\n * `provideTocConfigAt` overrides take precedence.\n *\n * @internal\n */\nexport const CNGX_TOC_DEFAULTS: CngxTocConfig = {\n ariaLabels: {\n nav: 'On this page',\n },\n scrollBehavior: 'smooth',\n spy: {\n rootMargin: '0px',\n threshold: 0.3,\n },\n};\n\n/**\n * App-wide configuration cascade for the table-of-contents organism. Resolves\n * in priority order:\n *\n * 1. Per-instance Input binding.\n * 2. `provideTocConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideTocConfig(...)` at the application root.\n * 4. Library defaults (this token's `factory`).\n *\n * `providedIn: 'root'` with a default factory means consumers never need to\n * provide the token explicitly - `inject(CNGX_TOC_CONFIG)` always resolves.\n * Consumers who want overrides call `provideTocConfig(...)` in\n * `bootstrapApplication` providers (root cascade) or `provideTocConfigAt(...)`\n * in a component's `viewProviders` (sub-tree cascade).\n *\n * @category ui/toc\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/config/toc.config.defaults.ts\n * @since 0.1.0\n */\nexport const CNGX_TOC_CONFIG = new InjectionToken<CngxTocConfig>('CNGX_TOC_CONFIG', {\n providedIn: 'root',\n factory: () => CNGX_TOC_DEFAULTS,\n});\n","import { inject } from '@angular/core';\n\nimport type { CngxTocConfig } from './toc.config';\nimport { CNGX_TOC_CONFIG } from './toc.config.defaults';\n\n/**\n * Convenience accessor for the toc configuration cascade. Runs in injection\n * context; resolves through the priority chain (per-instance Input ->\n * `provideTocConfigAt` -> `provideTocConfig` -> library defaults). Equivalent\n * to `inject(CNGX_TOC_CONFIG)` - the helper exists so consumers don't import\n * the token directly. Mirrors `injectBreadcrumbConfig`.\n *\n * ```ts\n * export class CngxToc {\n * private readonly cfg = injectTocConfig();\n * protected readonly navLabel = computed(() => this.cfg.ariaLabels?.nav ?? 'On this page');\n * }\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function injectTocConfig(): CngxTocConfig {\n return inject(CNGX_TOC_CONFIG);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTocItemContext } from './toc.types';\n\n/**\n * Per-item template slot for `CngxToc`. Project an `<ng-template cngxTocItem>`\n * inside `<cngx-toc>` to replace the built-in plain-label rendering with\n * custom markup - the `let-` variables come out typed via\n * `ngTemplateContextGuard`:\n *\n * ```html\n * <cngx-toc [items]=\"toc\" contentRoot=\"#article\">\n * <ng-template cngxTocItem let-item let-active=\"active\" let-depth=\"depth\">\n * <span [class.is-active]=\"active\">{{ item.label }}</span>\n * @if (depth === 0) { <cngx-badge>{{ item.children?.length }}</cngx-badge> }\n * </ng-template>\n * </cngx-toc>\n * ```\n *\n * Named `CngxTocItemSlot` (not `*Directive`) per the repo's no-artifact-suffix\n * rule; the selector stays `cngxTocItem`, which is what consumers write.\n * Resolves ahead of `CNGX_TOC_CONFIG.templates.item` and the built-in label.\n *\n * @category ui/toc\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-item-slot.ts\n * @since 0.1.0\n * @relatedTo CngxToc\n * <example-url>http://localhost:4200/#/ui/toc/slots/custom-item-template</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTocItem]',\n standalone: true,\n exportAs: 'cngxTocItem',\n})\nexport class CngxTocItemSlot {\n readonly templateRef = inject<TemplateRef<CngxTocItemContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: CngxTocItemSlot,\n ctx: unknown,\n ): ctx is CngxTocItemContext {\n return true;\n }\n}\n","import { InjectionToken, type OutputRef, type Signal } from '@angular/core';\n\nimport type { CngxTocItem } from './toc.types';\n\n/**\n * Minimal contract a toc rail exposes to its collaborators (the opt-in\n * `CngxTocRouterSync` fragment directive): the active-section signal it\n * derives, the activation output it emits, and the imperative `scrollTo`\n * it owns. Injected via {@link CNGX_TOC} + `useExisting`, never by injecting\n * the concrete `CngxToc` class - that would create a cyclic type dependency\n * and block the decompose brain/skin split.\n *\n * Direction mirrors `CNGX_SIDENAV`, not `CNGX_BREADCRUMB_ITEMS_SOURCE`: the\n * rail owns the state (`activeId`, `scrollTo`) and the collaborator consumes\n * it, so the toc *provides* the token and the sync directive *injects* it.\n *\n * @category ui/toc\n * @since 0.1.0\n * @relatedTo CngxToc, CngxTocRouterSync\n */\nexport interface CngxTocContract {\n /** The section currently most visible, or `null` before the spy resolves. */\n readonly activeId: Signal<string | null>;\n /** Fires when a link is activated (click / Enter), carrying its item. */\n readonly activated: OutputRef<CngxTocItem>;\n /** Scroll the section with this id into view and move focus to it. */\n scrollTo(id: string): void;\n}\n\n/**\n * Contract token for a toc rail. `CngxToc` provides it via\n * `{ provide: CNGX_TOC, useExisting: CngxToc }`, so a collaborator injects the\n * narrow {@link CngxTocContract} instead of the concrete class.\n *\n * @category ui/toc\n * @since 0.1.0\n * @relatedTo CngxToc, CngxTocRouterSync\n */\nexport const CNGX_TOC = new InjectionToken<CngxTocContract>('CNGX_TOC');\n","import { DOCUMENT, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewEncapsulation,\n viewChild,\n type Signal,\n} from '@angular/core';\nimport { CngxScrollSpy, injectMediaQuery } from '@cngx/common/layout';\n\nimport { injectTocConfig } from './config/inject-toc-config';\nimport { CngxTocItemSlot } from './toc-item-slot';\nimport { CNGX_TOC, type CngxTocContract } from './toc-token';\nimport type { CngxTocItem } from './toc.types';\n\n/** Shared empty result so the no-active-section trail is reference-stable. */\nconst EMPTY_IDS: readonly string[] = [];\n\n/** Shared empty outline so the pre-scan / no-headings state is reference-stable. */\nconst EMPTY_ITEMS: readonly CngxTocItem[] = [];\n\n/** Mutable node used while building the discovered tree, before it is frozen to CngxTocItem. */\ninterface MutableItem {\n id: string;\n label: string;\n children: MutableItem[];\n}\n\n/** Element-wise string-array compare - the shared comparator for both the flat-id list and the active trail. */\nfunction idsEqual(a: readonly string[], b: readonly string[]): boolean {\n return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Structural compare of two discovered outlines (id + label + nesting). Guards\n * the `discovered` signal so a re-scan of unchanged headings keeps the same\n * reference and never re-stamps the outline outlet.\n */\nfunction itemsEqual(a: readonly CngxTocItem[], b: readonly CngxTocItem[]): boolean {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.id !== y.id || x.label !== y.label) {\n return false;\n }\n if (!itemsEqual(x.children ?? EMPTY_ITEMS, y.children ?? EMPTY_ITEMS)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * \"On this page\" navigation rail. Renders a `<nav>` of anchor links from a\n * {@link CngxTocItem} outline, tracks the most-visible section through an\n * internal {@link CngxScrollSpy}, and communicates the active link via\n * `aria-current` inside the `computed()` graph. Nested items render as\n * indented sub-lists; native link semantics and tab order stay intact (a toc\n * is a navigation landmark of links, not a treeview).\n *\n * Composition over configuration: the spy is bound in this component's own\n * template rather than via `hostDirectives`, because the organism - not the\n * consumer - owns the flat id list the spy observes, and `[cngxScrollSpy]` is\n * a required input. The spy resolves its targets through `getElementById`, so\n * its host placement is irrelevant to its function.\n *\n * @category ui/toc\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc.component.ts\n * @since 0.1.0\n * @relatedTo CngxScrollSpy, CngxTocRouterSync, CngxSidenav\n * <example-url>http://localhost:4200/#/ui/toc/basic/on-this-page-rail</example-url>\n * <example-url>http://localhost:4200/#/ui/toc/auto/heading-auto-discovery</example-url>\n */\n@Component({\n selector: 'cngx-toc',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, CngxScrollSpy],\n providers: [{ provide: CNGX_TOC, useExisting: CngxToc }],\n templateUrl: './toc.component.html',\n styleUrl: './toc.component.css',\n})\nexport class CngxToc implements CngxTocContract {\n private readonly doc = inject(DOCUMENT);\n private readonly cfg = injectTocConfig();\n private readonly reducedMotion = injectMediaQuery('(prefers-reduced-motion: reduce)');\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * The outline to render. Tree-shaped; nested `children` become sub-lists.\n * Ignored when `[autoDiscover]` is set - the headings under `contentRoot`\n * become the outline instead.\n */\n readonly items = input<readonly CngxTocItem[]>(EMPTY_ITEMS);\n /**\n * Derive the outline from the heading elements under `contentRoot` instead\n * of a hand-maintained `[items]` array. Headings nest by their level\n * (`h2 > h3`), and a heading with no `id` gets a slugified one written onto\n * it so the link can target it. Scans once after the first render; call\n * {@link refresh} after you inject or remove sections at runtime.\n */\n readonly autoDiscover = input(false, { transform: booleanAttribute });\n /** Which headings `[autoDiscover]` collects, in CSS-selector form. */\n readonly headingSelector = input<string>('h2, h3');\n /**\n * CSS selector for the scroll container the spy observes. `null` (default)\n * uses the viewport. Forwarded to the spy's `[root]`; also the root the\n * `[autoDiscover]` scan walks for headings.\n */\n readonly contentRoot = input<string | null>(null);\n /** Root margin forwarded to the spy. Defaults to the config cascade. */\n readonly rootMargin = input<string>(this.cfg.spy?.rootMargin ?? '0px');\n /** Minimum visibility ratio forwarded to the spy. Defaults to the config cascade. */\n readonly threshold = input<number>(this.cfg.spy?.threshold ?? 0.3);\n\n /** Fires when a link is activated (click / Enter). */\n readonly activated = output<CngxTocItem>();\n\n private readonly spy = viewChild(CngxScrollSpy);\n private readonly itemSlot = contentChild(CngxTocItemSlot);\n\n /** Headings discovered by the last `[autoDiscover]` scan. */\n private readonly discovered = signal<readonly CngxTocItem[]>(EMPTY_ITEMS, { equal: itemsEqual });\n\n /** The outline actually rendered: the discovered headings when `[autoDiscover]` is on, else `[items]`. */\n protected readonly resolvedItems = computed(() =>\n this.autoDiscover() ? this.discovered() : this.items(),\n );\n\n /** Accessible name of the `nav` landmark, from the config cascade. */\n protected readonly navLabel = computed(() => this.cfg.ariaLabels?.nav ?? 'On this page');\n\n /**\n * Depth-first flat id list feeding `[cngxScrollSpy]`. `equal: idsEqual`\n * keeps the reference stable across same-shape re-sets so a re-render does\n * not re-create the observer.\n */\n protected readonly flatIds = computed(() => this.collectIds(this.resolvedItems()), {\n equal: idsEqual,\n });\n\n constructor() {\n // Re-scan whenever the discovery inputs change. The DOM read + discovered\n // write are deferred to a microtask so no signal is written during effect\n // execution (Pillar 1) and the just-rendered content has settled - the same\n // queueMicrotask discipline the panel-lifecycle focus restore uses.\n effect(() => {\n if (!this.autoDiscover()) {\n return;\n }\n this.contentRoot();\n this.headingSelector();\n queueMicrotask(() => this.refresh());\n });\n }\n\n /**\n * The active section, or `null`. `viewChild` is a view query, so `spy()` is\n * `undefined` during the creation pass; `?? null` makes that an explicit\n * value every downstream computed is defined at.\n */\n readonly activeId: Signal<string | null> = computed(() => this.spy()?.activeId() ?? null);\n\n /**\n * Ancestor-id chain of the active leaf - the parent links that get\n * `data-active-trail`. Same `equal` as `flatIds`: an array-valued computed\n * feeding an attribute binding must not allocate a fresh array every spy\n * tick (reference_signal_architecture Equality Rule).\n */\n protected readonly activeTrail = computed(() => this.computeTrail(), { equal: idsEqual });\n\n /** Resolved item template: instance slot -> config default -> built-in label. */\n protected readonly resolvedItemTpl = computed(\n () => this.itemSlot()?.templateRef ?? this.cfg.templates?.item ?? null,\n );\n\n /**\n * Scroll the section with this id into view and move focus to it. Honours\n * `prefers-reduced-motion` - the configured `scrollBehavior` is swapped for\n * `'auto'` (instant) whenever reduced motion is requested. A visual-only\n * jump is a silent state change for screen-reader users, so focus follows\n * the scroll (Pillar 2).\n */\n scrollTo(id: string): void {\n const target = this.doc.getElementById(id);\n if (target === null) {\n return;\n }\n const behavior = this.reducedMotion() ? 'auto' : (this.cfg.scrollBehavior ?? 'smooth');\n target.scrollIntoView({ behavior });\n this.focusTarget(target);\n }\n\n /** Click / Enter handler: takes over the native anchor jump, scrolls, and announces the activation. */\n protected handleActivate(item: CngxTocItem, event?: Event): void {\n event?.preventDefault();\n this.scrollTo(item.id);\n this.activated.emit(item);\n }\n\n /**\n * Move focus to the scrolled-to section. `preventScroll` keeps `focus()`\n * from fighting the smooth `scrollIntoView` above with a second instant\n * jump. Section elements are consumer-owned DOM, so `tabindex=\"-1\"` is set\n * imperatively only when the element is not focusable by default and the\n * consumer set no `tabindex` - an author-set value is never overwritten.\n * That persistent attribute on borrowed DOM is the entry's tracked debt.\n */\n private focusTarget(target: HTMLElement): void {\n const needsTabindex = !target.hasAttribute('tabindex') && !this.isFocusableByDefault(target);\n if (needsTabindex) {\n target.setAttribute('tabindex', '-1');\n }\n target.focus({ preventScroll: true });\n }\n\n /** Elements that take focus without an author `tabindex`. */\n private isFocusableByDefault(el: HTMLElement): boolean {\n return /^(a|button|input|select|textarea|summary|iframe)$/i.test(el.tagName);\n }\n\n /** Depth-first collect of every id in the outline. */\n private collectIds(items: readonly CngxTocItem[], acc: string[] = []): string[] {\n for (const item of items) {\n acc.push(item.id);\n if (item.children?.length) {\n this.collectIds(item.children, acc);\n }\n }\n return acc;\n }\n\n /** Ancestor ids of the active leaf (path from root, excluding the leaf itself). */\n private computeTrail(): readonly string[] {\n const id = this.activeId();\n if (id === null) {\n return EMPTY_IDS;\n }\n const path = this.pathTo(id, this.resolvedItems());\n return path ? path.slice(0, -1) : EMPTY_IDS;\n }\n\n /** Root-to-target id path, or `null` when the id is not in the outline. */\n private pathTo(target: string, items: readonly CngxTocItem[]): readonly string[] | null {\n for (const item of items) {\n if (item.id === target) {\n return [item.id];\n }\n const childPath = item.children?.length ? this.pathTo(target, item.children) : null;\n if (childPath) {\n return [item.id, ...childPath];\n }\n }\n return null;\n }\n\n /**\n * Re-run the `[autoDiscover]` heading scan. No-op unless `[autoDiscover]` is\n * set and we are on the browser. Call it after injecting or removing sections\n * at runtime - discovery is one-shot by design, not a live observer.\n */\n refresh(): void {\n if (!this.autoDiscover() || !this.isBrowser) {\n return;\n }\n this.discovered.set(this.scanHeadings());\n }\n\n /** Walk the headings under `contentRoot` into a level-nested outline. */\n private scanHeadings(): readonly CngxTocItem[] {\n const rootSelector = this.contentRoot();\n let root: ParentNode = this.doc;\n if (rootSelector) {\n const matched = this.doc.querySelector(rootSelector);\n // A set-but-unmatched root scans nothing, not the whole document -\n // falling back to `doc` would sweep site chrome into the outline.\n if (matched === null) {\n return EMPTY_ITEMS;\n }\n root = matched;\n }\n const headings = Array.from(root.querySelectorAll<HTMLElement>(this.headingSelector()));\n if (headings.length === 0) {\n return EMPTY_ITEMS;\n }\n\n const roots: MutableItem[] = [];\n const stack: { level: number; node: MutableItem }[] = [];\n const used = new Set<string>();\n\n for (const el of headings) {\n const level = this.headingLevel(el);\n const node: MutableItem = { id: this.ensureId(el, used), label: this.headingLabel(el), children: [] };\n while (stack.length > 0 && stack[stack.length - 1].level >= level) {\n stack.pop();\n }\n const parent = stack[stack.length - 1];\n if (parent) {\n parent.node.children.push(node);\n } else {\n roots.push(node);\n }\n stack.push({ level, node });\n }\n\n return roots.map((node) => this.freeze(node));\n }\n\n /** Numeric level of a heading element (`h2` -> 2). Non-heading matches read as level 1. */\n private headingLevel(el: HTMLElement): number {\n const match = /^h([1-6])$/i.exec(el.tagName);\n return match ? Number(match[1]) : 1;\n }\n\n /** Visible text of a heading, collapsed to a single spaced line. */\n private headingLabel(el: HTMLElement): string {\n return (el.textContent ?? '').replace(/\\s+/g, ' ').trim();\n }\n\n /**\n * Return the heading's id, generating and writing a slug when it has none.\n * The write mutates consumer-owned DOM (tracked debt); an author-set id is\n * kept verbatim. Collisions against prior scan ids and existing document ids\n * get a `-2`, `-3`, ... suffix.\n */\n private ensureId(el: HTMLElement, used: Set<string>): string {\n if (el.id) {\n used.add(el.id);\n return el.id;\n }\n const base = this.slugify(this.headingLabel(el)) || 'section';\n let candidate = base;\n let n = 2;\n while (used.has(candidate) || this.doc.getElementById(candidate) !== null) {\n candidate = `${base}-${n++}`;\n }\n used.add(candidate);\n el.setAttribute('id', candidate);\n return candidate;\n }\n\n /** Lowercase, strip diacritics-free non-alphanumerics to hyphens, collapse and trim. */\n private slugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n }\n\n /** Freeze a mutable node into a CngxTocItem, dropping empty children arrays. */\n private freeze(node: MutableItem): CngxTocItem {\n if (node.children.length === 0) {\n return { id: node.id, label: node.label };\n }\n return { id: node.id, label: node.label, children: node.children.map((child) => this.freeze(child)) };\n }\n}\n","<nav\n class=\"cngx-toc__nav\"\n [attr.aria-label]=\"navLabel()\"\n [cngxScrollSpy]=\"flatIds()\"\n [root]=\"contentRoot()\"\n [rootMargin]=\"rootMargin()\"\n [threshold]=\"threshold()\"\n>\n <ng-container *ngTemplateOutlet=\"list; context: { $implicit: resolvedItems(), depth: 0 }\" />\n</nav>\n\n<ng-template #list let-nodes let-depth=\"depth\">\n <ul class=\"cngx-toc__list\" [style.--cngx-toc-depth]=\"depth\">\n @for (item of nodes; track item.id) {\n <li class=\"cngx-toc__item\" [attr.data-active-trail]=\"activeTrail().includes(item.id) ? '' : null\">\n <a\n class=\"cngx-toc__link\"\n [href]=\"'#' + item.id\"\n [attr.aria-current]=\"activeId() === item.id ? 'location' : null\"\n (click)=\"handleActivate(item, $event)\"\n >\n @if (resolvedItemTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"\n tpl;\n context: { $implicit: item, active: activeId() === item.id, depth: depth }\n \"\n />\n } @else {\n {{ item.label }}\n }\n </a>\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"list; context: { $implicit: item.children, depth: depth + 1 }\"\n />\n }\n </li>\n }\n </ul>\n</ng-template>\n","import { afterNextRender, Directive, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { CNGX_TOC } from './toc-token';\n\n/**\n * Dev-warning emitted when `@angular/router` is absent. A deliberate small\n * local copy of the `@cngx/common/layout` kernel's warning rather than a\n * shared import - sharing would force the helper onto a `public-api.ts`, and\n * `warn*` matches no approved public-API prefix (same call the tabs and\n * sidenav sync directives make).\n *\n * @internal\n */\nfunction warnRouterAbsent(directive: string, enables: string): void {\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n\n/**\n * Deep-links a `CngxToc` into the URL fragment. Opt-in via\n * `[cngxTocRouterSync]` on the same host as `<cngx-toc>`: activating a link\n * writes `#<section-id>` (replacing the history entry, so a scroll-driven rail\n * never floods the back stack), and a deep link like `/guide#pricing` scrolls\n * to that section once on load.\n *\n * Reaches the rail through the {@link CNGX_TOC} contract token, never the\n * concrete `CngxToc` class. The activation subscription is torn down with the\n * directive via `takeUntilDestroyed` - an `OutputRef` subscription would\n * otherwise outlive route changes. Without `@angular/router` the directive\n * dev-warns once and no-ops.\n *\n * @category ui/toc\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxToc, CNGX_TOC\n * <example-url>http://localhost:4200/#/ui/toc/router/fragment-deep-link</example-url>\n */\n@Directive({\n selector: '[cngxTocRouterSync]',\n exportAs: 'cngxTocRouterSync',\n standalone: true,\n})\nexport class CngxTocRouterSync {\n private readonly toc = inject(CNGX_TOC, { host: true });\n private readonly router = inject(Router, { optional: true });\n private readonly route = inject(ActivatedRoute, { optional: true });\n\n constructor() {\n if (!this.router || !this.route) {\n afterNextRender(() => warnRouterAbsent('CngxTocRouterSync', 'fragment deep-linking'));\n return;\n }\n const router = this.router;\n\n // Write the fragment on every activation. replaceUrl keeps a scroll-driven\n // rail from pushing a history entry per section.\n outputToObservable(this.toc.activated)\n .pipe(takeUntilDestroyed())\n .subscribe((item) => {\n void router.navigate([], { fragment: item.id, replaceUrl: true });\n });\n\n // One-shot deep-link scroll: read the fragment present at load and bring\n // that section into view after the first render.\n const fragment = toSignal(this.route.fragment, {\n initialValue: this.route.snapshot.fragment,\n });\n afterNextRender(() => {\n const initial = fragment();\n if (initial) {\n this.toc.scrollTo(initial);\n }\n });\n }\n}\n","import type { CngxTocConfig } from './toc.config';\nimport type { CngxTocConfigFeature } from './provide-toc-config';\n\n/**\n * Override the toc's ARIA-string fallback - the accessible name of the `nav`\n * landmark that wraps the link list (default `'On this page'`).\n *\n * ```ts\n * provideTocConfig(withTocAriaLabels({ nav: 'Auf dieser Seite' }));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocAriaLabels(\n payload: NonNullable<CngxTocConfig['ariaLabels']>,\n): CngxTocConfigFeature {\n return { kind: 'ariaLabels', payload };\n}\n\n/**\n * Set the app-wide default scroll behaviour used when a link is activated.\n * `'smooth'` by default; the organism still swaps to `'auto'` at runtime\n * whenever `prefers-reduced-motion: reduce` matches, so this only chooses the\n * motion-allowed behaviour.\n *\n * ```ts\n * provideTocConfig(withTocScrollBehavior('auto'));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocScrollBehavior(\n scrollBehavior: NonNullable<CngxTocConfig['scrollBehavior']>,\n): CngxTocConfigFeature {\n return { kind: 'scrollBehavior', payload: { scrollBehavior } };\n}\n\n/**\n * Move the app-wide `CngxScrollSpy` defaults - the `rootMargin` and\n * `threshold` the rail forwards to its internal spy. Per-instance\n * `[rootMargin]` / `[threshold]` bindings still win; this only sets the\n * cascade default (e.g. a fixed-header offset every toc should share).\n *\n * ```ts\n * provideTocConfig(withTocSpy({ rootMargin: '-80px 0px 0px 0px' }));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocSpy(payload: NonNullable<CngxTocConfig['spy']>): CngxTocConfigFeature {\n return { kind: 'spy', payload };\n}\n\n/**\n * Register a global default item template. Resolves after a per-instance\n * `*cngxTocItem` slot and before the built-in plain-label rendering, so every\n * un-slotted toc renders the same custom item markup.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideTocConfigAt(withTocTemplates({ item: myItemTpl }))],\n * })\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocTemplates(\n payload: NonNullable<CngxTocConfig['templates']>,\n): CngxTocConfigFeature {\n return { kind: 'templates', payload };\n}\n","import {\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport type { CngxTocConfig } from './toc.config';\nimport { CNGX_TOC_CONFIG, CNGX_TOC_DEFAULTS } from './toc.config.defaults';\n\n/**\n * Discriminated-union shape returned by the toc config features -\n * `withTocAriaLabels`, `withTocScrollBehavior`, `withTocSpy`, and\n * `withTocTemplates`. The\n * reducer in `provideTocConfig` / `provideTocConfigAt` matches on `kind` and\n * merges `payload` into the corresponding config sub-tree. Mirrors\n * `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across\n * feature areas.\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport type CngxTocConfigFeature =\n | {\n readonly kind: 'ariaLabels';\n readonly payload: NonNullable<CngxTocConfig['ariaLabels']>;\n }\n | {\n readonly kind: 'scrollBehavior';\n readonly payload: { readonly scrollBehavior: NonNullable<CngxTocConfig['scrollBehavior']> };\n }\n | {\n readonly kind: 'spy';\n readonly payload: NonNullable<CngxTocConfig['spy']>;\n }\n | {\n readonly kind: 'templates';\n readonly payload: NonNullable<CngxTocConfig['templates']>;\n };\n\n/**\n * Reduces a list of feature objects into a partial config - last write wins\n * per sub-tree. Inner objects are spread-merged so partial overrides compose\n * cleanly with prior writes.\n *\n * @internal\n */\nfunction reduceFeatures(features: readonly CngxTocConfigFeature[]): Partial<CngxTocConfig> {\n const out: {\n ariaLabels?: NonNullable<CngxTocConfig['ariaLabels']>;\n scrollBehavior?: NonNullable<CngxTocConfig['scrollBehavior']>;\n spy?: NonNullable<CngxTocConfig['spy']>;\n templates?: NonNullable<CngxTocConfig['templates']>;\n } = {};\n for (const f of features) {\n switch (f.kind) {\n case 'ariaLabels':\n out.ariaLabels = { ...out.ariaLabels, ...f.payload };\n break;\n case 'scrollBehavior':\n out.scrollBehavior = f.payload.scrollBehavior;\n break;\n case 'spy':\n out.spy = { ...out.spy, ...f.payload };\n break;\n case 'templates':\n out.templates = { ...out.templates, ...f.payload };\n break;\n }\n }\n return out;\n}\n\n/**\n * Deep merge: the nested sub-trees (`ariaLabels` / `spy` / `templates`) are\n * spread-merged so a partial fills in missing keys without nuking unrelated\n * sub-trees; the flat scalar `scrollBehavior` takes the partial when present,\n * else the base. Inner objects are flat (one level), so a single spread per\n * key suffices.\n *\n * @internal\n */\nfunction mergeConfig(\n base: CngxTocConfig,\n partial: Partial<CngxTocConfig>,\n): CngxTocConfig {\n return {\n ariaLabels: { ...base.ariaLabels, ...partial.ariaLabels },\n scrollBehavior: partial.scrollBehavior ?? base.scrollBehavior,\n spy: { ...base.spy, ...partial.spy },\n templates: { ...base.templates, ...partial.templates },\n };\n}\n\n/**\n * Application-root configuration cascade for the toc organism. Pass any\n * combination of `withTocAriaLabels`, `withTocScrollBehavior`, `withTocSpy`,\n * and `withTocTemplates` features in `bootstrapApplication`'s providers array.\n *\n * Resolution priority (high -> low):\n * 1. Per-instance Input binding.\n * 2. `provideTocConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideTocConfig(...)` at the application root.\n * 4. Library defaults (`CNGX_TOC_DEFAULTS`).\n *\n * The provider deep-merges supplied features with the library defaults so\n * consumers only declare keys they want to override.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTocConfig(\n * withTocAriaLabels({ nav: 'On this page' }),\n * withTocScrollBehavior('smooth'),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function provideTocConfig(...features: CngxTocConfigFeature[]): EnvironmentProviders {\n // Empty-features: skip the override so the root factory's CNGX_TOC_DEFAULTS\n // reference flows through untouched. A fresh mergeConfig(...) would allocate\n // identical content under a new reference and bust identity comparisons.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n const partial = reduceFeatures(features);\n return makeEnvironmentProviders([\n {\n provide: CNGX_TOC_CONFIG,\n useValue: mergeConfig(CNGX_TOC_DEFAULTS, partial),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration cascade for the toc organism. Pass any\n * combination of feature factories in a parent component's `viewProviders`\n * array.\n *\n * Unlike `provideTocConfig` (root-only), `provideTocConfigAt` injects the\n * parent injector's `CNGX_TOC_CONFIG` value (resolves through the priority\n * chain) and deep-merges the supplied features on top. Descendant toc\n * instances see the merged config; sibling sub-trees keep the inherited value.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideTocConfigAt(withTocScrollBehavior('auto'))],\n * template: '<cngx-toc [items]=\"toc\" contentRoot=\"#article\" />',\n * })\n * class Guide {}\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provider[] {\n // Empty-features call: parent value flows through untouched. Skipping the\n // factory preserves reference identity through the sub-tree.\n if (features.length === 0) {\n return [];\n }\n const partial = reduceFeatures(features);\n return [\n {\n provide: CNGX_TOC_CONFIG,\n useFactory: () => {\n const parent = inject(CNGX_TOC_CONFIG, { skipSelf: true });\n return mergeConfig(parent, partial);\n },\n },\n ];\n}\n","/**\n * @module @cngx/ui/toc\n */\n\nexport { CngxToc } from './toc.component';\nexport { CngxTocRouterSync } from './toc-router-sync.directive';\nexport { CngxTocItemSlot } from './toc-item-slot';\nexport { CNGX_TOC, type CngxTocContract } from './toc-token';\nexport type { CngxTocItem, CngxTocItemContext } from './toc.types';\nexport type { CngxTocConfig } from './config/toc.config';\nexport { CNGX_TOC_CONFIG } from './config/toc.config.defaults';\nexport {\n withTocAriaLabels,\n withTocScrollBehavior,\n withTocSpy,\n withTocTemplates,\n} from './config/features';\nexport {\n provideTocConfig,\n provideTocConfigAt,\n type CngxTocConfigFeature,\n} from './config/provide-toc-config';\nexport { injectTocConfig } from './config/inject-toc-config';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAIA;;;;;;;;;;;;;AAaG;AACI,MAAM,iBAAiB,GAAkB;AAC9C,IAAA,UAAU,EAAE;AACV,QAAA,GAAG,EAAE,cAAc;AACpB,KAAA;AACD,IAAA,cAAc,EAAE,QAAQ;AACxB,IAAA,GAAG,EAAE;AACH,QAAA,UAAU,EAAE,KAAK;AACjB,QAAA,SAAS,EAAE,GAAG;AACf,KAAA;CACF;AAED;;;;;;;;;;;;;;;;;;AAkBG;MACU,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,iBAAiB;AACjC,CAAA;;AC9CD;;;;;;;;;;;;;;;;AAgBG;SACa,eAAe,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,eAAe,CAAC;AAChC;;ACpBA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAMU,eAAe,CAAA;AACjB,IAAA,WAAW,GAAG,MAAM,CAAkC,WAAW,CAAC;AAE3E,IAAA,OAAO,sBAAsB,CAC3B,IAAqB,EACrB,GAAY,EAAA;AAEZ,QAAA,OAAO,IAAI;IACb;uGARW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,0BAAA,EAAA,QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAL3B,SAAS;AAAC,YAAA,IAAA,EAAA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AAE,OAAO,CAAC;YACrC,CAAC;AACF,SAAA;KACF;AACH;;AC/KA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-ui-toc.mjs","sources":["../../../projects/ui/toc/i18n/toc-language-section.ts","../../../projects/ui/toc/i18n/toc-i18n.ts","../../../projects/ui/toc/config/toc.config.defaults.ts","../../../projects/ui/toc/config/inject-toc-config.ts","../../../projects/ui/toc/toc-item-slot.ts","../../../projects/ui/toc/toc-token.ts","../../../projects/ui/toc/toc.component.ts","../../../projects/ui/toc/toc.component.html","../../../projects/ui/toc/toc-router-sync.directive.ts","../../../projects/ui/toc/config/features.ts","../../../projects/ui/toc/config/provide-toc-config.ts","../../../projects/ui/toc/public-api.ts","../../../projects/ui/toc/cngx-ui-toc.ts"],"sourcesContent":["/**\n * The toc section of a {@link CngxLanguagePack}: the accessible names of\n * `CngxToc`. It feeds the `ariaLabels` of `CNGX_TOC_CONFIG`; a key set through\n * `withTocAriaLabels` still wins.\n *\n * @category ui/toc/i18n\n * @since 0.1.0\n * @relatedTo CNGX_TOC_CONFIG, withTocAriaLabels\n */\nexport interface CngxTocLanguageSection {\n /** Accessible name of the `nav` landmark. */\n readonly nav: string;\n}\n\n/**\n * The English toc section: the single source of the toc's English copy. The\n * `CNGX_TOC_CONFIG` labels default to it.\n *\n * @category ui/toc/i18n\n * @since 0.1.0\n * @relatedTo CNGX_TOC_CONFIG\n */\nexport const CNGX_TOC_LANGUAGE_EN: CngxTocLanguageSection = {\n nav: 'On this page',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly toc: CngxTocLanguageSection;\n }\n}\n","import { createLanguageSection } from '@cngx/core/i18n';\n\nimport { CNGX_TOC_LANGUAGE_EN } from './toc-language-section';\n\n/**\n * @internal The toc section of the active pack over the English section,\n * shared app-wide. Consumers override copy through `withTocAriaLabels`.\n */\nexport const injectTocSiteCopy = createLanguageSection('toc', CNGX_TOC_LANGUAGE_EN);\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxTocConfig } from './toc.config';\n\n/**\n * Library defaults for the toc configuration cascade. Carries no copy: the\n * `ariaLabels` defaults are the `toc` section of the language pack; single\n * keys ride the `withTocAriaLabels` feature. The spy defaults (`rootMargin` / `threshold`) mirror\n * `CngxScrollSpy`'s own input defaults so an un-configured toc tracks\n * scrolling identically to a hand-wired spy.\n *\n * Exported for intra-lib consumers (`provideTocConfig` deep-merges with this\n * base) but **NOT** re-exported from `public-api.ts` - downstream consumers\n * reach the defaults via `inject(CNGX_TOC_CONFIG)` so `provideTocConfig` /\n * `provideTocConfigAt` overrides take precedence.\n *\n * @internal\n */\nexport const CNGX_TOC_DEFAULTS: CngxTocConfig = {\n scrollBehavior: 'smooth',\n spy: {\n rootMargin: '0px',\n threshold: 0.3,\n },\n};\n\n/**\n * App-wide configuration cascade for the table-of-contents organism. Resolves\n * in priority order:\n *\n * 1. Per-instance Input binding.\n * 2. `provideTocConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideTocConfig(...)` at the application root.\n * 4. Library defaults (this token's `factory`).\n *\n * `providedIn: 'root'` with a default factory means consumers never need to\n * provide the token explicitly - `inject(CNGX_TOC_CONFIG)` always resolves.\n * Consumers who want overrides call `provideTocConfig(...)` in\n * `bootstrapApplication` providers (root cascade) or `provideTocConfigAt(...)`\n * in a component's `viewProviders` (sub-tree cascade).\n *\n * @category ui/toc\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/config/toc.config.defaults.ts\n * @since 0.1.0\n */\nexport const CNGX_TOC_CONFIG = new InjectionToken<CngxTocConfig>('CNGX_TOC_CONFIG', {\n providedIn: 'root',\n factory: () => CNGX_TOC_DEFAULTS,\n});\n","import { inject, type Signal } from '@angular/core';\nimport { createFilledOverrideMerge } from '@cngx/core/utils';\n\nimport { injectTocSiteCopy } from '../i18n/toc-i18n';\nimport type { CngxTocAriaLabels, CngxTocConfig } from './toc.config';\nimport { CNGX_TOC_CONFIG } from './toc.config.defaults';\n\n/**\n * Convenience accessor for the toc configuration cascade. Runs in injection\n * context; resolves through the priority chain (per-instance Input ->\n * `provideTocConfigAt` -> `provideTocConfig` -> library defaults). Equivalent\n * to `inject(CNGX_TOC_CONFIG)` - the helper exists so consumers don't import\n * the token directly. Mirrors `injectBreadcrumbConfig`.\n *\n * ```ts\n * export class CngxToc {\n * private readonly cfg = injectTocConfig();\n * protected readonly navLabel = computed(() => this.cfg.ariaLabels?.nav ?? 'On this page');\n * }\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function injectTocConfig(): CngxTocConfig {\n return inject(CNGX_TOC_CONFIG);\n}\n\n/**\n * The resolved accessible names of the toc config in scope, every key the\n * config leaves unset (also a key an override sets to `undefined`) filled from\n * the `toc` section of the active pack, as a Signal that follows a runtime\n * language switch. Runs in injection context; read it inside a `computed()`, a template\n * or a handler.\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function injectTocAriaLabels(): Signal<Required<CngxTocAriaLabels>> {\n return createFilledOverrideMerge(injectTocSiteCopy(), injectTocConfig().ariaLabels);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTocItemContext } from './toc.types';\n\n/**\n * Per-item template slot for `CngxToc`. Project an `<ng-template cngxTocItem>`\n * inside `<cngx-toc>` to replace the built-in plain-label rendering with\n * custom markup - the `let-` variables come out typed via\n * `ngTemplateContextGuard`:\n *\n * ```html\n * <cngx-toc [items]=\"toc\" contentRoot=\"#article\">\n * <ng-template cngxTocItem let-item let-active=\"active\" let-depth=\"depth\">\n * <span [class.is-active]=\"active\">{{ item.label }}</span>\n * @if (depth === 0) { <cngx-badge>{{ item.children?.length }}</cngx-badge> }\n * </ng-template>\n * </cngx-toc>\n * ```\n *\n * Named `CngxTocItemSlot` (not `*Directive`) per the repo's no-artifact-suffix\n * rule; the selector stays `cngxTocItem`, which is what consumers write.\n * Resolves ahead of `CNGX_TOC_CONFIG.templates.item` and the built-in label.\n *\n * @category ui/toc\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-item-slot.ts\n * @since 0.1.0\n * @relatedTo CngxToc\n * <example-url>http://localhost:4200/#/ui/toc/slots/custom-item-template</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTocItem]',\n standalone: true,\n exportAs: 'cngxTocItem',\n})\nexport class CngxTocItemSlot {\n readonly templateRef = inject<TemplateRef<CngxTocItemContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _dir: CngxTocItemSlot,\n ctx: unknown,\n ): ctx is CngxTocItemContext {\n return true;\n }\n}\n","import { InjectionToken, type OutputRef, type Signal } from '@angular/core';\n\nimport type { CngxTocItem } from './toc.types';\n\n/**\n * Minimal contract a toc rail exposes to its collaborators (the opt-in\n * `CngxTocRouterSync` fragment directive): the active-section signal it\n * derives, the activation output it emits, and the imperative `scrollTo`\n * it owns. Injected via {@link CNGX_TOC} + `useExisting`, never by injecting\n * the concrete `CngxToc` class - that would create a cyclic type dependency\n * and block the decompose brain/skin split.\n *\n * Direction mirrors `CNGX_SIDENAV`, not `CNGX_BREADCRUMB_ITEMS_SOURCE`: the\n * rail owns the state (`activeId`, `scrollTo`) and the collaborator consumes\n * it, so the toc *provides* the token and the sync directive *injects* it.\n *\n * @category ui/toc\n * @since 0.1.0\n * @relatedTo CngxToc, CngxTocRouterSync\n */\nexport interface CngxTocContract {\n /** The section currently most visible, or `null` before the spy resolves. */\n readonly activeId: Signal<string | null>;\n /** Fires when a link is activated (click / Enter), carrying its item. */\n readonly activated: OutputRef<CngxTocItem>;\n /** Scroll the section with this id into view and move focus to it. */\n scrollTo(id: string): void;\n}\n\n/**\n * Contract token for a toc rail. `CngxToc` provides it via\n * `{ provide: CNGX_TOC, useExisting: CngxToc }`, so a collaborator injects the\n * narrow {@link CngxTocContract} instead of the concrete class.\n *\n * @category ui/toc\n * @since 0.1.0\n * @relatedTo CngxToc, CngxTocRouterSync\n */\nexport const CNGX_TOC = new InjectionToken<CngxTocContract>('CNGX_TOC');\n","import { DOCUMENT, isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n effect,\n inject,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewEncapsulation,\n viewChild,\n type Signal,\n} from '@angular/core';\nimport { arrayEqual } from '@cngx/utils';\nimport { CngxScrollSpy, injectMediaQuery } from '@cngx/common/layout';\n\nimport { injectTocAriaLabels, injectTocConfig } from './config/inject-toc-config';\nimport { CngxTocItemSlot } from './toc-item-slot';\nimport { CNGX_TOC, type CngxTocContract } from './toc-token';\nimport type { CngxTocItem } from './toc.types';\n\n/** Shared empty result so the no-active-section trail is reference-stable. */\nconst EMPTY_IDS: readonly string[] = [];\n\n/** Shared empty outline so the pre-scan / no-headings state is reference-stable. */\nconst EMPTY_ITEMS: readonly CngxTocItem[] = [];\n\n/** Mutable node used while building the discovered tree, before it is frozen to CngxTocItem. */\ninterface MutableItem {\n id: string;\n label: string;\n children: MutableItem[];\n}\n\n/**\n * Structural compare of two discovered outlines (id + label + nesting). Guards\n * the `discovered` signal so a re-scan of unchanged headings keeps the same\n * reference and never re-stamps the outline outlet.\n */\nfunction itemsEqual(a: readonly CngxTocItem[], b: readonly CngxTocItem[]): boolean {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.id !== y.id || x.label !== y.label) {\n return false;\n }\n if (!itemsEqual(x.children ?? EMPTY_ITEMS, y.children ?? EMPTY_ITEMS)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * \"On this page\" navigation rail. Renders a `<nav>` of anchor links from a\n * {@link CngxTocItem} outline, tracks the most-visible section through an\n * internal {@link CngxScrollSpy}, and communicates the active link via\n * `aria-current` inside the `computed()` graph. Nested items render as\n * indented sub-lists; native link semantics and tab order stay intact (a toc\n * is a navigation landmark of links, not a treeview).\n *\n * Composition over configuration: the spy is bound in this component's own\n * template rather than via `hostDirectives`, because the organism - not the\n * consumer - owns the flat id list the spy observes, and `[cngxScrollSpy]` is\n * a required input. The spy resolves its targets through `getElementById`, so\n * its host placement is irrelevant to its function.\n *\n * @category ui/toc\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc.component.ts\n * @since 0.1.0\n * @relatedTo CngxScrollSpy, CngxTocRouterSync, CngxSidenav\n * <example-url>http://localhost:4200/#/ui/toc/basic/on-this-page-rail</example-url>\n * <example-url>http://localhost:4200/#/ui/toc/auto/heading-auto-discovery</example-url>\n * @slot cngxTocItem Replaces the plain label inside each item's link at every depth, ahead of CNGX_TOC_CONFIG.templates.item; gets the item as $implicit, plus active and the zero-based depth.\n */\n@Component({\n selector: 'cngx-toc',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, CngxScrollSpy],\n providers: [{ provide: CNGX_TOC, useExisting: CngxToc }],\n templateUrl: './toc.component.html',\n styleUrl: './toc.component.css',\n})\nexport class CngxToc implements CngxTocContract {\n private readonly doc = inject(DOCUMENT);\n private readonly cfg = injectTocConfig();\n private readonly ariaLabels = injectTocAriaLabels();\n private readonly reducedMotion = injectMediaQuery('(prefers-reduced-motion: reduce)');\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /**\n * The outline to render. Tree-shaped; nested `children` become sub-lists.\n * Ignored when `[autoDiscover]` is set - the headings under `contentRoot`\n * become the outline instead.\n */\n readonly items = input<readonly CngxTocItem[]>(EMPTY_ITEMS);\n /**\n * Derive the outline from the heading elements under `contentRoot` instead\n * of a hand-maintained `[items]` array. Headings nest by their level\n * (`h2 > h3`), and a heading with no `id` gets a slugified one written onto\n * it so the link can target it. Scans once after the first render; call\n * {@link refresh} after you inject or remove sections at runtime.\n */\n readonly autoDiscover = input(false, { transform: booleanAttribute });\n /** Which headings `[autoDiscover]` collects, in CSS-selector form. */\n readonly headingSelector = input<string>('h2, h3');\n /**\n * CSS selector for the scroll container the spy observes. `null` (default)\n * uses the viewport. Forwarded to the spy's `[root]`; also the root the\n * `[autoDiscover]` scan walks for headings.\n */\n readonly contentRoot = input<string | null>(null);\n /** Root margin forwarded to the spy. Defaults to the config cascade. */\n readonly rootMargin = input<string>(this.cfg.spy?.rootMargin ?? '0px');\n /** Minimum visibility ratio forwarded to the spy. Defaults to the config cascade. */\n readonly threshold = input<number>(this.cfg.spy?.threshold ?? 0.3);\n\n /** Fires when a link is activated (click / Enter). */\n readonly activated = output<CngxTocItem>();\n\n private readonly spy = viewChild(CngxScrollSpy);\n private readonly itemSlot = contentChild(CngxTocItemSlot);\n\n /** Headings discovered by the last `[autoDiscover]` scan. */\n private readonly discovered = signal<readonly CngxTocItem[]>(EMPTY_ITEMS, { equal: itemsEqual });\n\n /** The outline actually rendered: the discovered headings when `[autoDiscover]` is on, else `[items]`. */\n protected readonly resolvedItems = computed(() =>\n this.autoDiscover() ? this.discovered() : this.items(),\n );\n\n /** Accessible name of the `nav` landmark, from the config cascade; follows a language switch. */\n protected readonly navLabel = computed(() => this.ariaLabels().nav);\n\n /**\n * Depth-first flat id list feeding `[cngxScrollSpy]`. `equal: arrayEqual`\n * keeps the reference stable across same-shape re-sets so a re-render does\n * not re-create the observer.\n */\n protected readonly flatIds = computed(() => this.collectIds(this.resolvedItems()), {\n equal: arrayEqual,\n });\n\n constructor() {\n // Re-scan whenever the discovery inputs change. The DOM read + discovered\n // write are deferred to a microtask so no signal is written during effect\n // execution (Pillar 1) and the just-rendered content has settled - the same\n // queueMicrotask discipline the panel-lifecycle focus restore uses. The\n // destroyed guard keeps a microtask queued right before teardown from\n // scanning a detached DOM.\n let destroyed = false;\n inject(DestroyRef).onDestroy(() => {\n destroyed = true;\n });\n effect(() => {\n if (!this.autoDiscover()) {\n return;\n }\n this.contentRoot();\n this.headingSelector();\n queueMicrotask(() => {\n if (!destroyed) {\n this.refresh();\n }\n });\n });\n }\n\n /**\n * The active section, or `null`. `viewChild` is a view query, so `spy()` is\n * `undefined` during the creation pass; `?? null` makes that an explicit\n * value every downstream computed is defined at.\n */\n readonly activeId: Signal<string | null> = computed(() => this.spy()?.activeId() ?? null);\n\n /**\n * Ancestor-id chain of the active leaf - the parent links that get\n * `data-active-trail`. Same `equal` as `flatIds`: an array-valued computed\n * feeding an attribute binding must not allocate a fresh array every spy\n * tick (reference_signal_architecture Equality Rule).\n */\n protected readonly activeTrail = computed(() => this.computeTrail(), { equal: arrayEqual });\n\n /** Resolved item template: instance slot -> config default -> built-in label. */\n protected readonly resolvedItemTpl = computed(\n () => this.itemSlot()?.templateRef ?? this.cfg.templates?.item ?? null,\n );\n\n /**\n * Scroll the section with this id into view and move focus to it. Honours\n * `prefers-reduced-motion` - the configured `scrollBehavior` is swapped for\n * `'auto'` (instant) whenever reduced motion is requested. A visual-only\n * jump is a silent state change for screen-reader users, so focus follows\n * the scroll (Pillar 2).\n */\n scrollTo(id: string): void {\n const target = this.doc.getElementById(id);\n if (target === null) {\n return;\n }\n const behavior = this.reducedMotion() ? 'auto' : (this.cfg.scrollBehavior ?? 'smooth');\n target.scrollIntoView({ behavior });\n this.focusTarget(target);\n }\n\n /** Click / Enter handler: takes over the native anchor jump, scrolls, and announces the activation. */\n protected handleActivate(item: CngxTocItem, event?: Event): void {\n event?.preventDefault();\n this.scrollTo(item.id);\n this.activated.emit(item);\n }\n\n /**\n * Move focus to the scrolled-to section. `preventScroll` keeps `focus()`\n * from fighting the smooth `scrollIntoView` above with a second instant\n * jump. Section elements are consumer-owned DOM, so `tabindex=\"-1\"` is set\n * imperatively only when the element is not focusable by default and the\n * consumer set no `tabindex` - an author-set value is never overwritten.\n * That persistent attribute on borrowed DOM is the entry's tracked debt.\n */\n private focusTarget(target: HTMLElement): void {\n const needsTabindex = !target.hasAttribute('tabindex') && !this.isFocusableByDefault(target);\n if (needsTabindex) {\n target.setAttribute('tabindex', '-1');\n }\n target.focus({ preventScroll: true });\n }\n\n /** Elements that take focus without an author `tabindex`. */\n private isFocusableByDefault(el: HTMLElement): boolean {\n return /^(a|button|input|select|textarea|summary|iframe)$/i.test(el.tagName);\n }\n\n /** Depth-first collect of every id in the outline. */\n private collectIds(items: readonly CngxTocItem[], acc: string[] = []): string[] {\n for (const item of items) {\n acc.push(item.id);\n if (item.children?.length) {\n this.collectIds(item.children, acc);\n }\n }\n return acc;\n }\n\n /** Ancestor ids of the active leaf (path from root, excluding the leaf itself). */\n private computeTrail(): readonly string[] {\n const id = this.activeId();\n if (id === null) {\n return EMPTY_IDS;\n }\n const path = this.pathTo(id, this.resolvedItems());\n return path ? path.slice(0, -1) : EMPTY_IDS;\n }\n\n /** Root-to-target id path, or `null` when the id is not in the outline. */\n private pathTo(target: string, items: readonly CngxTocItem[]): readonly string[] | null {\n for (const item of items) {\n if (item.id === target) {\n return [item.id];\n }\n const childPath = item.children?.length ? this.pathTo(target, item.children) : null;\n if (childPath) {\n return [item.id, ...childPath];\n }\n }\n return null;\n }\n\n /**\n * Re-run the `[autoDiscover]` heading scan. No-op unless `[autoDiscover]` is\n * set and we are on the browser. Call it after injecting or removing sections\n * at runtime - discovery is one-shot by design, not a live observer.\n */\n refresh(): void {\n if (!this.autoDiscover() || !this.isBrowser) {\n return;\n }\n this.discovered.set(this.scanHeadings());\n }\n\n /** Walk the headings under `contentRoot` into a level-nested outline. */\n private scanHeadings(): readonly CngxTocItem[] {\n const rootSelector = this.contentRoot();\n let root: ParentNode = this.doc;\n if (rootSelector) {\n const matched = this.doc.querySelector(rootSelector);\n // A set-but-unmatched root scans nothing, not the whole document -\n // falling back to `doc` would sweep site chrome into the outline.\n if (matched === null) {\n return EMPTY_ITEMS;\n }\n root = matched;\n }\n const headings = Array.from(root.querySelectorAll<HTMLElement>(this.headingSelector()));\n if (headings.length === 0) {\n return EMPTY_ITEMS;\n }\n\n const roots: MutableItem[] = [];\n const stack: { level: number; node: MutableItem }[] = [];\n const used = new Set<string>();\n\n for (const el of headings) {\n const level = this.headingLevel(el);\n const node: MutableItem = { id: this.ensureId(el, used), label: this.headingLabel(el), children: [] };\n while (stack.length > 0 && stack[stack.length - 1].level >= level) {\n stack.pop();\n }\n const parent = stack[stack.length - 1];\n if (parent) {\n parent.node.children.push(node);\n } else {\n roots.push(node);\n }\n stack.push({ level, node });\n }\n\n return roots.map((node) => this.freeze(node));\n }\n\n /** Numeric level of a heading element (`h2` -> 2). Non-heading matches read as level 1. */\n private headingLevel(el: HTMLElement): number {\n const match = /^h([1-6])$/i.exec(el.tagName);\n return match ? Number(match[1]) : 1;\n }\n\n /** Visible text of a heading, collapsed to a single spaced line. */\n private headingLabel(el: HTMLElement): string {\n return (el.textContent ?? '').replace(/\\s+/g, ' ').trim();\n }\n\n /**\n * Return the heading's id, generating and writing a slug when it has none.\n * The write mutates consumer-owned DOM (tracked debt); an author-set id is\n * kept verbatim. Collisions against prior scan ids and existing document ids\n * get a `-2`, `-3`, ... suffix.\n */\n private ensureId(el: HTMLElement, used: Set<string>): string {\n if (el.id) {\n used.add(el.id);\n return el.id;\n }\n const base = this.slugify(this.headingLabel(el)) || 'section';\n let candidate = base;\n let n = 2;\n while (used.has(candidate) || this.doc.getElementById(candidate) !== null) {\n candidate = `${base}-${n++}`;\n }\n used.add(candidate);\n el.setAttribute('id', candidate);\n return candidate;\n }\n\n /** Lowercase, strip diacritics-free non-alphanumerics to hyphens, collapse and trim. */\n private slugify(text: string): string {\n return text\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n }\n\n /** Freeze a mutable node into a CngxTocItem, dropping empty children arrays. */\n private freeze(node: MutableItem): CngxTocItem {\n if (node.children.length === 0) {\n return { id: node.id, label: node.label };\n }\n return { id: node.id, label: node.label, children: node.children.map((child) => this.freeze(child)) };\n }\n}\n","<nav\n class=\"cngx-toc__nav\"\n [attr.aria-label]=\"navLabel()\"\n [cngxScrollSpy]=\"flatIds()\"\n [root]=\"contentRoot()\"\n [rootMargin]=\"rootMargin()\"\n [threshold]=\"threshold()\"\n>\n <ng-container *ngTemplateOutlet=\"list; context: { $implicit: resolvedItems(), depth: 0 }\" />\n</nav>\n\n<ng-template #list let-nodes let-depth=\"depth\">\n <ul class=\"cngx-toc__list\" [style.--cngx-toc-depth]=\"depth\">\n @for (item of nodes; track item.id) {\n <li class=\"cngx-toc__item\" [attr.data-active-trail]=\"activeTrail().includes(item.id) ? '' : null\">\n <a\n class=\"cngx-toc__link\"\n [href]=\"'#' + item.id\"\n [attr.aria-current]=\"activeId() === item.id ? 'location' : null\"\n (click)=\"handleActivate(item, $event)\"\n >\n @if (resolvedItemTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"\n tpl;\n context: { $implicit: item, active: activeId() === item.id, depth: depth }\n \"\n />\n } @else {\n {{ item.label }}\n }\n </a>\n @if (item.children?.length) {\n <ng-container\n *ngTemplateOutlet=\"list; context: { $implicit: item.children, depth: depth + 1 }\"\n />\n }\n </li>\n }\n </ul>\n</ng-template>\n","import { afterNextRender, Directive, inject } from '@angular/core';\nimport { outputToObservable, takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { ActivatedRoute, Router } from '@angular/router';\n\nimport { CNGX_TOC } from './toc-token';\n\n/**\n * Dev-warning emitted when `@angular/router` is absent. A deliberate small\n * local copy of the `@cngx/common/layout` kernel's warning rather than a\n * shared import - sharing would force the helper onto a `public-api.ts`, and\n * `warn*` matches no approved public-API prefix (same call the tabs and\n * sidenav sync directives make).\n *\n * @internal\n */\nfunction warnRouterAbsent(directive: string, enables: string): void {\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n\n/**\n * Deep-links a `CngxToc` into the URL fragment. Opt-in via\n * `[cngxTocRouterSync]` on the same host as `<cngx-toc>`: activating a link\n * writes `#<section-id>` (replacing the history entry, so a scroll-driven rail\n * never floods the back stack), and a deep link like `/guide#pricing` scrolls\n * to that section once on load.\n *\n * Reaches the rail through the {@link CNGX_TOC} contract token, never the\n * concrete `CngxToc` class. The activation subscription is torn down with the\n * directive via `takeUntilDestroyed` - an `OutputRef` subscription would\n * otherwise outlive route changes. Without `@angular/router` the directive\n * dev-warns once and no-ops.\n *\n * @category ui/toc\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/toc/toc-router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxToc, CNGX_TOC\n * <example-url>http://localhost:4200/#/ui/toc/router/fragment-deep-link</example-url>\n */\n@Directive({\n selector: '[cngxTocRouterSync]',\n exportAs: 'cngxTocRouterSync',\n standalone: true,\n})\nexport class CngxTocRouterSync {\n private readonly toc = inject(CNGX_TOC, { host: true });\n private readonly router = inject(Router, { optional: true });\n private readonly route = inject(ActivatedRoute, { optional: true });\n\n constructor() {\n if (!this.router || !this.route) {\n afterNextRender(() => warnRouterAbsent('CngxTocRouterSync', 'fragment deep-linking'));\n return;\n }\n const router = this.router;\n\n // Write the fragment on every activation. replaceUrl keeps a scroll-driven\n // rail from pushing a history entry per section; 'merge' keeps the query\n // params a bare fragment navigate would otherwise wipe.\n outputToObservable(this.toc.activated)\n .pipe(takeUntilDestroyed())\n .subscribe((item) => {\n router\n .navigate([], { fragment: item.id, replaceUrl: true, queryParamsHandling: 'merge' })\n .catch(() => undefined);\n });\n\n // One-shot deep-link scroll: read the fragment present at load and bring\n // that section into view after the first render.\n const fragment = toSignal(this.route.fragment, {\n initialValue: this.route.snapshot.fragment,\n });\n afterNextRender(() => {\n const initial = fragment();\n if (initial) {\n this.toc.scrollTo(initial);\n }\n });\n }\n}\n","import type { Signal } from '@angular/core';\n\nimport type { CngxTocAriaLabels, CngxTocConfig } from './toc.config';\nimport type { CngxTocConfigFeature } from './provide-toc-config';\n\n/**\n * Override the toc's ARIA-string fallback - the accessible name of the `nav`\n * landmark that wraps the link list (default `'On this page'`). Pass a\n * `Signal` to switch the language at runtime.\n *\n * ```ts\n * provideTocConfig(withTocAriaLabels({ nav: 'Auf dieser Seite' }));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocAriaLabels(\n payload: CngxTocAriaLabels | Signal<CngxTocAriaLabels>,\n): CngxTocConfigFeature {\n return { kind: 'ariaLabels', payload };\n}\n\n/**\n * Set the app-wide default scroll behaviour used when a link is activated.\n * `'smooth'` by default; the organism still swaps to `'auto'` at runtime\n * whenever `prefers-reduced-motion: reduce` matches, so this only chooses the\n * motion-allowed behaviour.\n *\n * ```ts\n * provideTocConfig(withTocScrollBehavior('auto'));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocScrollBehavior(\n scrollBehavior: NonNullable<CngxTocConfig['scrollBehavior']>,\n): CngxTocConfigFeature {\n return { kind: 'scrollBehavior', payload: { scrollBehavior } };\n}\n\n/**\n * Move the app-wide `CngxScrollSpy` defaults - the `rootMargin` and\n * `threshold` the rail forwards to its internal spy. Per-instance\n * `[rootMargin]` / `[threshold]` bindings still win; this only sets the\n * cascade default (e.g. a fixed-header offset every toc should share).\n *\n * ```ts\n * provideTocConfig(withTocSpy({ rootMargin: '-80px 0px 0px 0px' }));\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocSpy(payload: NonNullable<CngxTocConfig['spy']>): CngxTocConfigFeature {\n return { kind: 'spy', payload };\n}\n\n/**\n * Register a global default item template. Resolves after a per-instance\n * `*cngxTocItem` slot and before the built-in plain-label rendering, so every\n * un-slotted toc renders the same custom item markup.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideTocConfigAt(withTocTemplates({ item: myItemTpl }))],\n * })\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function withTocTemplates(\n payload: NonNullable<CngxTocConfig['templates']>,\n): CngxTocConfigFeature {\n return { kind: 'templates', payload };\n}\n","import {\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n type Provider,\n type Signal,\n} from '@angular/core';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport type { CngxTocAriaLabels, CngxTocConfig } from './toc.config';\nimport { CNGX_TOC_CONFIG, CNGX_TOC_DEFAULTS } from './toc.config.defaults';\n\nconst NO_ARIA_LABELS: CngxTocAriaLabels = {};\n\n/**\n * Discriminated-union shape returned by the toc config features -\n * `withTocAriaLabels`, `withTocScrollBehavior`, `withTocSpy`, and\n * `withTocTemplates`. The\n * reducer in `provideTocConfig` / `provideTocConfigAt` matches on `kind` and\n * merges `payload` into the corresponding config sub-tree. Mirrors\n * `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across\n * feature areas.\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport type CngxTocConfigFeature =\n | {\n readonly kind: 'ariaLabels';\n readonly payload: CngxTocAriaLabels | Signal<CngxTocAriaLabels>;\n }\n | {\n readonly kind: 'scrollBehavior';\n readonly payload: { readonly scrollBehavior: NonNullable<CngxTocConfig['scrollBehavior']> };\n }\n | {\n readonly kind: 'spy';\n readonly payload: NonNullable<CngxTocConfig['spy']>;\n }\n | {\n readonly kind: 'templates';\n readonly payload: NonNullable<CngxTocConfig['templates']>;\n };\n\n/**\n * Reduces a list of feature objects into a partial config - last write wins\n * per sub-tree. Inner objects are spread-merged so partial overrides compose\n * cleanly with prior writes.\n *\n * @internal\n */\nfunction reduceFeatures(features: readonly CngxTocConfigFeature[]): Partial<CngxTocConfig> {\n const out: {\n ariaLabels?: CngxTocAriaLabels | Signal<CngxTocAriaLabels>;\n scrollBehavior?: NonNullable<CngxTocConfig['scrollBehavior']>;\n spy?: NonNullable<CngxTocConfig['spy']>;\n templates?: NonNullable<CngxTocConfig['templates']>;\n } = {};\n for (const f of features) {\n switch (f.kind) {\n case 'ariaLabels':\n out.ariaLabels = createOverrideMerge(out.ariaLabels ?? NO_ARIA_LABELS, f.payload);\n break;\n case 'scrollBehavior':\n out.scrollBehavior = f.payload.scrollBehavior;\n break;\n case 'spy':\n out.spy = { ...out.spy, ...f.payload };\n break;\n case 'templates':\n out.templates = { ...out.templates, ...f.payload };\n break;\n }\n }\n return out;\n}\n\n/**\n * Deep merge: the nested sub-trees (`ariaLabels` / `spy` / `templates`) are\n * spread-merged so a partial fills in missing keys without nuking unrelated\n * sub-trees; the flat scalar `scrollBehavior` takes the partial when present,\n * else the base. Inner objects are flat (one level), so a single spread per\n * key suffices.\n *\n * @internal\n */\nfunction mergeConfig(\n base: CngxTocConfig,\n partial: Partial<CngxTocConfig>,\n): CngxTocConfig {\n return {\n ariaLabels: createOverrideMerge(base.ariaLabels ?? NO_ARIA_LABELS, partial.ariaLabels),\n scrollBehavior: partial.scrollBehavior ?? base.scrollBehavior,\n spy: { ...base.spy, ...partial.spy },\n templates: { ...base.templates, ...partial.templates },\n };\n}\n\n/**\n * Application-root configuration cascade for the toc organism. Pass any\n * combination of `withTocAriaLabels`, `withTocScrollBehavior`, `withTocSpy`,\n * and `withTocTemplates` features in `bootstrapApplication`'s providers array.\n *\n * Resolution priority (high -> low):\n * 1. Per-instance Input binding.\n * 2. `provideTocConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideTocConfig(...)` at the application root.\n * 4. Library defaults (`CNGX_TOC_DEFAULTS`).\n *\n * The provider deep-merges supplied features with the library defaults so\n * consumers only declare keys they want to override.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTocConfig(\n * withTocAriaLabels({ nav: 'On this page' }),\n * withTocScrollBehavior('smooth'),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function provideTocConfig(...features: CngxTocConfigFeature[]): EnvironmentProviders {\n // Empty-features: skip the override so the root factory's CNGX_TOC_DEFAULTS\n // reference flows through untouched. A fresh mergeConfig(...) would allocate\n // identical content under a new reference and bust identity comparisons.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n const partial = reduceFeatures(features);\n return makeEnvironmentProviders([\n {\n provide: CNGX_TOC_CONFIG,\n useValue: mergeConfig(CNGX_TOC_DEFAULTS, partial),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration cascade for the toc organism. Pass any\n * combination of feature factories in a parent component's `viewProviders`\n * array.\n *\n * Unlike `provideTocConfig` (root-only), `provideTocConfigAt` injects the\n * parent injector's `CNGX_TOC_CONFIG` value (resolves through the priority\n * chain) and deep-merges the supplied features on top. Descendant toc\n * instances see the merged config; sibling sub-trees keep the inherited value.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideTocConfigAt(withTocScrollBehavior('auto'))],\n * template: '<cngx-toc [items]=\"toc\" contentRoot=\"#article\" />',\n * })\n * class Guide {}\n * ```\n *\n * @category ui/toc\n * @since 0.1.0\n */\nexport function provideTocConfigAt(...features: CngxTocConfigFeature[]): Provider[] {\n // Empty-features call: parent value flows through untouched. Skipping the\n // factory preserves reference identity through the sub-tree.\n if (features.length === 0) {\n return [];\n }\n const partial = reduceFeatures(features);\n return [\n {\n provide: CNGX_TOC_CONFIG,\n useFactory: () => {\n const parent = inject(CNGX_TOC_CONFIG, { skipSelf: true });\n return mergeConfig(parent, partial);\n },\n },\n ];\n}\n","/**\n * @module @cngx/ui/toc\n */\n\nexport { CngxToc } from './toc.component';\nexport { CngxTocRouterSync } from './toc-router-sync.directive';\nexport { CngxTocItemSlot } from './toc-item-slot';\nexport { CNGX_TOC, type CngxTocContract } from './toc-token';\nexport type { CngxTocItem, CngxTocItemContext } from './toc.types';\nexport type { CngxTocAriaLabels, CngxTocConfig } from './config/toc.config';\nexport { CNGX_TOC_CONFIG, CNGX_TOC_DEFAULTS } from './config/toc.config.defaults';\nexport {\n withTocAriaLabels,\n withTocScrollBehavior,\n withTocSpy,\n withTocTemplates,\n} from './config/features';\nexport {\n provideTocConfig,\n provideTocConfigAt,\n type CngxTocConfigFeature,\n} from './config/provide-toc-config';\nexport { injectTocAriaLabels, injectTocConfig } from './config/inject-toc-config';\nexport { CNGX_TOC_LANGUAGE_EN, type CngxTocLanguageSection } from './i18n/toc-language-section';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAcA;;;;;;;AAOG;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,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC1D,gBAAA,OAAO,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;YACrC,CAAC;AACF,SAAA;KACF;AACH;;ACnLA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/fesm2022/cngx-ui.mjs
CHANGED
|
@@ -8,32 +8,27 @@ export { CngxFailed, CngxPending, CngxSucceeded } from '@cngx/common/interactive
|
|
|
8
8
|
/**
|
|
9
9
|
* @cngx/ui
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Organism layer of cngx: 26 secondary entry points (layout, overlay,
|
|
12
|
+
* feedback, stepper/mat-stepper, tabs/mat-tabs, accordion/mat-accordion,
|
|
13
|
+
* paginator/mat-paginator, sidenav, breadcrumb, timeline, toc,
|
|
14
|
+
* command-palette, context-menu, collection, stat-card, chart-panel,
|
|
15
|
+
* data-grid-accordion, empty-state, action-button, skeleton, speak, a11y).
|
|
16
|
+
* Import from the specific entry point; the root barrel keeps only a
|
|
17
|
+
* small backwards-compat set (see public-api.ts).
|
|
15
18
|
*/
|
|
16
19
|
/** @internal - replaced at publish time, not part of consumer API. */
|
|
17
|
-
const VERSION = makeVersion('0.1.0-rc.
|
|
20
|
+
const VERSION = makeVersion('0.1.0-rc.8');
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* Public API Surface of @cngx/ui
|
|
21
24
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @cngx/ui/mat-stepper
|
|
30
|
-
* @cngx/ui/mat-tabs
|
|
31
|
-
* @cngx/ui/overlay
|
|
32
|
-
* @cngx/ui/sidenav
|
|
33
|
-
* @cngx/ui/skeleton
|
|
34
|
-
* @cngx/ui/speak
|
|
35
|
-
* @cngx/ui/stepper
|
|
36
|
-
* @cngx/ui/tabs
|
|
25
|
+
* The root entry is a small backwards-compat set only: it re-exports
|
|
26
|
+
* `action-button`, `sidenav`, `skeleton` and `speak` plus the three
|
|
27
|
+
* async-state directives that moved to `@cngx/common/interactive`.
|
|
28
|
+
* Everything else ships exclusively through its secondary entry point
|
|
29
|
+
* (`@cngx/ui/<entry>`, 26 entries) - deliberately not re-exported here so
|
|
30
|
+
* a root import can never pull Material or CDK into a bundle that does
|
|
31
|
+
* not use them.
|
|
37
32
|
*
|
|
38
33
|
* @module @cngx/ui
|
|
39
34
|
*/
|
package/fesm2022/cngx-ui.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui.mjs","sources":["../../../projects/ui/ui.ts","../../../projects/ui/public-api.ts","../../../projects/ui/cngx-ui.ts"],"sourcesContent":["/**\n * @cngx/ui\n *\n *
|
|
1
|
+
{"version":3,"file":"cngx-ui.mjs","sources":["../../../projects/ui/ui.ts","../../../projects/ui/public-api.ts","../../../projects/ui/cngx-ui.ts"],"sourcesContent":["/**\n * @cngx/ui\n *\n * Organism layer of cngx: 26 secondary entry points (layout, overlay,\n * feedback, stepper/mat-stepper, tabs/mat-tabs, accordion/mat-accordion,\n * paginator/mat-paginator, sidenav, breadcrumb, timeline, toc,\n * command-palette, context-menu, collection, stat-card, chart-panel,\n * data-grid-accordion, empty-state, action-button, skeleton, speak, a11y).\n * Import from the specific entry point; the root barrel keeps only a\n * small backwards-compat set (see public-api.ts).\n */\n\nimport { makeVersion } from '@cngx/utils';\n\n/** @internal - replaced at publish time, not part of consumer API. */\nexport const VERSION = makeVersion('0.0.0-PLACEHOLDER');\n","/**\n * Public API Surface of @cngx/ui\n *\n * The root entry is a small backwards-compat set only: it re-exports\n * `action-button`, `sidenav`, `skeleton` and `speak` plus the three\n * async-state directives that moved to `@cngx/common/interactive`.\n * Everything else ships exclusively through its secondary entry point\n * (`@cngx/ui/<entry>`, 26 entries) - deliberately not re-exported here so\n * a root import can never pull Material or CDK into a bundle that does\n * not use them.\n *\n * @module @cngx/ui\n */\n\nexport * from './ui';\nexport * from '@cngx/ui/action-button';\nexport * from '@cngx/ui/sidenav';\nexport * from '@cngx/ui/skeleton';\nexport * from '@cngx/ui/speak';\n\n// Re-export from @cngx/common/interactive for backwards compatibility\nexport { CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;AAUG;AAIH;MACa,OAAO,GAAG,WAAW,CAAC,mBAAmB;;ACftD;;;;;;;;;;;;AAYG;;ACZH;;AAEG;;;;"}
|
package/mat-paginator/README.md
CHANGED
|
@@ -72,8 +72,15 @@ every change-detection pass and would reset on each.
|
|
|
72
72
|
|
|
73
73
|
`<mat-paginator>` only relabels its own range text, which a screen reader does not
|
|
74
74
|
announce. With `[announce]` the bridge mounts a visually-hidden `aria-live`
|
|
75
|
-
region and speaks the new page
|
|
76
|
-
the
|
|
75
|
+
region and speaks the new page after every change. The default phrasing
|
|
76
|
+
resolves from the shared `CNGX_PAGINATOR_CONFIG` cascade
|
|
77
|
+
(`announcements.pageChange`, "Page N of M" in English), whose defaults are the
|
|
78
|
+
`paginator` section of the cngx language pack, so the announcement is translated
|
|
79
|
+
with the rest of the pack and `provideCngxPaginatorConfig(withPaginatorAnnouncements(...))`
|
|
80
|
+
overrides it together with the `CngxPaginator` organism. Material's own
|
|
81
|
+
`MatPaginatorIntl` stays responsible for the visible Material labels and range;
|
|
82
|
+
cngx never writes it. Bind `[announceLabel]` for a richer per-instance message -
|
|
83
|
+
its context also carries the visible item range.
|
|
77
84
|
|
|
78
85
|
```html
|
|
79
86
|
<mat-paginator cngxMatPaginator [total]="items().length" announce></mat-paginator>
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
* ring, font-weight bump. Specificity bump `.mat-mdc-tab.cngx-
|
|
19
19
|
* mat-tab--error` is load-bearing - Material 21's `.mdc-tab` sets
|
|
20
20
|
* `outline: none` at (0,1,0)
|
|
21
|
-
* - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` -
|
|
22
|
-
*
|
|
21
|
+
* - `.cngx-mat-tab--error` + `.mat-mdc-tab-disabled` - no extra rule:
|
|
22
|
+
* Material paints the disabled label colour and the error outline
|
|
23
|
+
* stays, so it does not pass for a healthy disabled tab
|
|
23
24
|
* - `.cngx-mat-tab--has-errors` - form-validation errors present;
|
|
24
25
|
* renders a `::before` red disc with an `!` glyph at the trailing
|
|
25
26
|
* corner. Distinct semantic from `--error` and the two coexist
|
|
@@ -272,13 +273,11 @@
|
|
|
272
273
|
font-weight: var(--cngx-mat-tab-error-font-weight, 600);
|
|
273
274
|
}
|
|
274
275
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
opacity: 0.7;
|
|
281
|
-
}
|
|
276
|
+
/*
|
|
277
|
+
* A disabled-and-rejected tab takes no fade: Material paints the
|
|
278
|
+
* disabled label colour, and the error outline above keeps it apart
|
|
279
|
+
* from a healthy disabled tab. Disabled is colour, never opacity.
|
|
280
|
+
*/
|
|
282
281
|
|
|
283
282
|
/*
|
|
284
283
|
* Per-tab form-error aggregation badge. Distinct semantic from
|
|
@@ -298,7 +297,7 @@
|
|
|
298
297
|
*/
|
|
299
298
|
.mat-mdc-tab.cngx-mat-tab--has-errors::before,
|
|
300
299
|
.mat-mdc-tab-link.cngx-mat-tab--has-errors::before {
|
|
301
|
-
content: '!';
|
|
300
|
+
content: '!' / '';
|
|
302
301
|
position: absolute;
|
|
303
302
|
top: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
|
304
303
|
inset-inline-end: var(--cngx-mat-tab-has-errors-glyph-offset, 4px);
|
package/overlay/README.md
CHANGED
|
@@ -49,15 +49,20 @@ Key features:
|
|
|
49
49
|
```typescript
|
|
50
50
|
type CngxOverlayConfig = Partial<OverlayConfig>;
|
|
51
51
|
|
|
52
|
-
// Example
|
|
53
|
-
|
|
52
|
+
// Example. Position and scroll strategies come from CDK's own Overlay
|
|
53
|
+
// service - CngxOverlay wraps attachment and lifecycle, not strategy
|
|
54
|
+
// construction:
|
|
55
|
+
private readonly overlay = inject(CngxOverlay);
|
|
56
|
+
private readonly cdkOverlay = inject(Overlay); // @angular/cdk/overlay
|
|
57
|
+
|
|
58
|
+
const ref = this.overlay.open(MyComponent, {
|
|
54
59
|
hasBackdrop: true,
|
|
55
60
|
backdropClass: 'my-backdrop',
|
|
56
61
|
panelClass: 'my-panel',
|
|
57
62
|
maxHeight: '80vh',
|
|
58
63
|
width: '600px',
|
|
59
|
-
positionStrategy:
|
|
60
|
-
scrollStrategy:
|
|
64
|
+
positionStrategy: this.cdkOverlay.position().global().centerHorizontally(),
|
|
65
|
+
scrollStrategy: this.cdkOverlay.scrollStrategies.block(),
|
|
61
66
|
});
|
|
62
67
|
```
|
|
63
68
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cngx/ui",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.8",
|
|
4
4
|
"description": "Organism layer (layout, overlay, feedback, stepper, tabs) for the CNGX Angular component library. Material opt-in (mat-stepper, mat-tabs, material).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cngx",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"directory": "projects/ui"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@cngx/utils": "0.1.0-rc.
|
|
28
|
-
"@cngx/core": "0.1.0-rc.
|
|
29
|
-
"@cngx/common": "0.1.0-rc.
|
|
27
|
+
"@cngx/utils": "0.1.0-rc.8",
|
|
28
|
+
"@cngx/core": "0.1.0-rc.8",
|
|
29
|
+
"@cngx/common": "0.1.0-rc.8",
|
|
30
30
|
"@angular/cdk": "^21.2.0",
|
|
31
31
|
"@angular/common": "^21.2.0",
|
|
32
32
|
"@angular/core": "^21.2.0"
|
package/paginator/README.md
CHANGED
|
@@ -99,9 +99,11 @@ gates navigation, renders an indeterminate `cngx-progress` bar, flips
|
|
|
99
99
|
|
|
100
100
|
## Configuration
|
|
101
101
|
|
|
102
|
-
All accessible-name strings, announcement phrasing, the
|
|
103
|
-
default page-size choices cascade through `CNGX_PAGINATOR_CONFIG
|
|
104
|
-
defaults
|
|
102
|
+
All accessible-name strings, announcement phrasing, the readout formats, and the
|
|
103
|
+
default page-size choices cascade through `CNGX_PAGINATOR_CONFIG`. The copy
|
|
104
|
+
defaults are the `paginator` section of the language pack (English without one),
|
|
105
|
+
with numbers formatted for the locale; translate them with the language file.
|
|
106
|
+
Override single keys at the app root with `provideCngxPaginatorConfig(...)`, or
|
|
105
107
|
per region with `provideCngxPaginatorConfigAt(...)` in `viewProviders`.
|
|
106
108
|
|
|
107
109
|
```ts
|
|
@@ -131,4 +133,6 @@ without forking the shell. It mirrors the select family's
|
|
|
131
133
|
roving tab stop on the page row (arrows / Home / End); `aria-current="page"` on
|
|
132
134
|
the active page; a single computed `aria-busy` owner; live-region page-change,
|
|
133
135
|
clamp, and async announcements. A `total`-shrink clamp is never silent - the
|
|
134
|
-
clamped page is
|
|
136
|
+
clamped page is announced, and emitted back to the consumer once the state is
|
|
137
|
+
settled and non-empty (a transient total drop during a busy refetch is held
|
|
138
|
+
back, so it never pins a controlled consumer to page 0).
|
package/sidenav/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CngxSidenav
|
|
2
2
|
|
|
3
|
-
Declarative sidebar component
|
|
3
|
+
Declarative sidebar component. Responsive out of the box: the rail docks beside the content on a wide layout and overlays it on a narrow one, with nothing bound.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
selector: 'app-example',
|
|
32
32
|
template: `
|
|
33
33
|
<cngx-sidenav-layout>
|
|
34
|
-
<cngx-sidenav position="start" [(opened)]="navOpen"
|
|
34
|
+
<cngx-sidenav position="start" [(opened)]="navOpen">
|
|
35
35
|
<cngx-sidenav-header>Logo</cngx-sidenav-header>
|
|
36
36
|
<a cngxNavLink [active]="true">Dashboard</a>
|
|
37
37
|
<cngx-sidenav-footer>v1.0</cngx-sidenav-footer>
|
|
@@ -57,22 +57,47 @@ export class ExampleComponent {
|
|
|
57
57
|
|
|
58
58
|
## Overview
|
|
59
59
|
|
|
60
|
-
`CngxSidenav` is a composable sidebar component that handles drawer behavior, keyboard shortcuts,
|
|
60
|
+
`CngxSidenav` is a composable sidebar component that handles drawer behavior, keyboard shortcuts, width-driven mode switching, and optional resize functionality. It coordinates with `CngxSidenavLayout` for backdrop and scroll-lock management.
|
|
61
61
|
|
|
62
62
|
Key features:
|
|
63
63
|
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
64
|
+
- **Responsive by default:** `mode` is `auto` unless you say otherwise - `side` once the surrounding layout is `64rem` or wider, `over` below that
|
|
65
|
+
- **Mode switching:** bind `mode` to pin one of `over` (overlay), `push` (nudges content), `side` (permanent), `mini` (collapsed icon rail; hover expands after a tunable dwell via `[expandDelay]` / `[collapseDelay]`)
|
|
66
66
|
- **Two-way binding:** `[(opened)]` synchronizes with external state
|
|
67
|
-
- **Resize:** Optional drag handle with min/max constraints
|
|
67
|
+
- **Resize:** Optional drag handle with min/max constraints; the separator speaks its position as a percent of the min-max range (`aria-valuetext`, `sidenav` language section)
|
|
68
68
|
- **Keyboard:** Escape closes overlay, configurable global shortcut via `[shortcut]`
|
|
69
69
|
- **RTL-aware:** `position="start"` / `"end"` flip logically in RTL
|
|
70
70
|
- **Deep-linking:** persist open state to a URL query param via `[cngxSidenavRouterSync]` (see [Deep-linking](#deep-linking-router-sync))
|
|
71
|
-
- **App-wide defaults:** `CNGX_SIDENAV_CONFIG` cascade for dimensions,
|
|
71
|
+
- **App-wide defaults:** `CNGX_SIDENAV_CONFIG` cascade for dimensions, shortcut, hover dwell, and router-sync param (see [Configuration](#configuration))
|
|
72
|
+
|
|
73
|
+
## Container, not viewport
|
|
74
|
+
|
|
75
|
+
The docking decision reads the width of the surrounding `CngxSidenavLayout`, not the width of the window. A rail inside a dashboard pane collapses when that pane is narrow, whatever the browser window is doing.
|
|
76
|
+
|
|
77
|
+
The threshold lives in exactly one place - a `@container` rule in `sidenav-layout.css` that writes `--cngx-sidenav-layout-wide` on the rail:
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
@container cngx-sidenav-layout (min-inline-size: 64rem) {
|
|
81
|
+
cngx-sidenav-layout > cngx-sidenav {
|
|
82
|
+
--cngx-sidenav-layout-wide: 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`CngxSidenav` reads the resolved value; it never evaluates the condition itself. Override that rule to move the breakpoint. To opt out of auto entirely, bind `mode`:
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<!-- always an overlay, whatever the layout width -->
|
|
91
|
+
<cngx-sidenav mode="over" [(opened)]="navOpen">…</cngx-sidenav>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
A rail mounted without `<cngx-sidenav-layout>` has no container to measure; it renders as `over` and warns in dev mode.
|
|
95
|
+
|
|
96
|
+
See `core-concepts/responsive-by-default.md` for the library-wide contract.
|
|
72
97
|
|
|
73
98
|
## Configuration
|
|
74
99
|
|
|
75
|
-
Every dimension default, the
|
|
100
|
+
Every dimension default, the toggle shortcut, and the mini hover dwell resolve through a standard cascade. The docking threshold is deliberately not in the cascade - it is a CSS rule (see above), so it travels with the skin. Per-instance bindings always win; unset keys fall back to the library defaults, so an unconfigured `<cngx-sidenav>` behaves exactly as before.
|
|
76
101
|
|
|
77
102
|
Resolution priority (high to low):
|
|
78
103
|
|
|
@@ -85,7 +110,6 @@ Resolution priority (high to low):
|
|
|
85
110
|
import {
|
|
86
111
|
provideSidenavConfig,
|
|
87
112
|
withSidenavDimensions,
|
|
88
|
-
withSidenavResponsive,
|
|
89
113
|
withSidenavShortcut,
|
|
90
114
|
withSidenavHoverDwell,
|
|
91
115
|
} from '@cngx/ui';
|
|
@@ -94,7 +118,6 @@ bootstrapApplication(AppComponent, {
|
|
|
94
118
|
providers: [
|
|
95
119
|
provideSidenavConfig(
|
|
96
120
|
withSidenavDimensions({ width: '320px', miniWidth: '64px' }),
|
|
97
|
-
withSidenavResponsive('(min-width: 1024px)'),
|
|
98
121
|
withSidenavShortcut('mod+b'),
|
|
99
122
|
withSidenavHoverDwell({ enterDelay: 200, leaveDelay: 150 }),
|
|
100
123
|
),
|
|
@@ -105,7 +128,6 @@ bootstrapApplication(AppComponent, {
|
|
|
105
128
|
| Feature | Overrides |
|
|
106
129
|
|-|-|
|
|
107
130
|
| `withSidenavDimensions({ width?, miniWidth?, minWidth?, maxWidth? })` | Panel dimensions |
|
|
108
|
-
| `withSidenavResponsive(query)` | Default responsive media query |
|
|
109
131
|
| `withSidenavShortcut(combo)` | Default toggle shortcut |
|
|
110
132
|
| `withSidenavHoverDwell({ enterDelay?, leaveDelay? })` | Mini expand/collapse dwell (ms) |
|
|
111
133
|
| `withSidenavRouterSync({ param })` | Default deep-link query-param key |
|
package/speak/README.md
CHANGED
|
@@ -35,7 +35,7 @@ export class ExampleComponent {
|
|
|
35
35
|
`CngxSpeakButton` is a ready-made speaker button that connects to a `CngxSpeak` directive via an explicit `[speakRef]` input. It provides:
|
|
36
36
|
|
|
37
37
|
- **Speaker and stop icons** - Built-in SVGs that toggle based on speaking state
|
|
38
|
-
- **Accessible labels** - ARIA labels that reflect the current state ("Read aloud" / "Stop speaking")
|
|
38
|
+
- **Accessible labels** - ARIA labels that reflect the current state, English by default (`"Read aloud"` / `"Stop speaking"`), translated through the `speak` section of the language pack, and overridable per instance via `[readAloudLabel]` / `[stopLabel]`
|
|
39
39
|
- **Cognitive accessibility** - Part of CngxSpeak, targeting dyslexia and reading ease
|
|
40
40
|
- **Full theming control** - CSS custom properties for styling, Material theme SCSS integration
|
|
41
41
|
- **No ancestor injection** - Explicit `[speakRef]` wiring prevents hidden dependencies
|
|
@@ -44,7 +44,8 @@ export class ExampleComponent {
|
|
|
44
44
|
|
|
45
45
|
`CngxSpeakButton` is designed for cognitive accessibility:
|
|
46
46
|
|
|
47
|
-
- **ARIA labels:** Button label dynamically changes between "Read aloud" (idle) and "Stop speaking" (active)
|
|
47
|
+
- **ARIA labels:** Button label dynamically changes between "Read aloud" (idle) and "Stop speaking" (active); both are overridable via `[readAloudLabel]` / `[stopLabel]`.
|
|
48
|
+
- **Capability gating:** When `CngxSpeak` reports no speech-synthesis engine (`supported === false`), the button hides itself (`hidden`) rather than render a dead control, keeping it out of the layout and the accessibility tree.
|
|
48
49
|
- **Icon semantics:** SVG icons are marked `aria-hidden="true"` - the text label carries the meaning.
|
|
49
50
|
- **CngxSpeak integration:** The underlying `CngxSpeak` directive handles the speech synthesis API, managing pause/resume, focus restoration, and `prefers-reduced-motion` respect.
|
|
50
51
|
- **Cognitive focus:** Targets users with dyslexia, ADHD, and reading difficulties by providing auditory reinforcement alongside visual text.
|
package/stepper/README.md
CHANGED
|
@@ -68,7 +68,19 @@ Per-instance override:
|
|
|
68
68
|
<cngx-stepper skin="linear-minimal" aria-label="Wizard">...</cngx-stepper>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
### Container, not viewport
|
|
72
|
+
|
|
73
|
+
Below `30rem` of **its own container width** the classic strip auto-collapses to `<cngx-text-stepper>` (default) or `<cngx-dot-stepper>`. A stepper in a 400px dialog collapses on a 4K desktop; one in a wide page stays classic on a phone in landscape.
|
|
74
|
+
|
|
75
|
+
`withStepperMobileCollapse('text' | 'dots' | 'off')` picks *what* it collapses into. *Where* is a `@container` rule in the stepper stylesheet and is not a TypeScript knob - override it in your own CSS:
|
|
76
|
+
|
|
77
|
+
```css
|
|
78
|
+
.my-wizard .cngx-stepper::after {
|
|
79
|
+
--cngx-stepper-collapse: 1; /* or 0 to suppress the collapse */
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
An unlayered author rule beats the library rule in `@layer cngx.components`, so no `!important` is needed. See `core-concepts/responsive-by-default.md`.
|
|
72
84
|
|
|
73
85
|
## Density
|
|
74
86
|
|
package/timeline/README.md
CHANGED
|
@@ -159,7 +159,7 @@ the swap from skeleton to content does not reflow.
|
|
|
159
159
|
**`alternate` is not supported with `mode="activity"`.** Alternating a
|
|
160
160
|
scan-feed defeats the scan; those rows render `start` and dev mode warns once.
|
|
161
161
|
|
|
162
|
-
**`alternate` collapses to a single side below `
|
|
162
|
+
**`alternate` collapses to a single side below `30rem`** of the timeline's own
|
|
163
163
|
width. It is a container query, not a viewport one, so the same timeline
|
|
164
164
|
behaves correctly inside a narrow panel on a wide screen. The threshold is a
|
|
165
165
|
literal because a container-query condition cannot read a custom property.
|