@cngx/ui 0.1.0-rc.8 → 0.1.0-rc.9

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.
Files changed (55) hide show
  1. package/command-palette/README.md +5 -2
  2. package/fesm2022/cngx-ui-accordion.mjs +19 -2
  3. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  4. package/fesm2022/cngx-ui-action-button.mjs +10 -7
  5. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  6. package/fesm2022/cngx-ui-breadcrumb.mjs +55 -15
  7. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  8. package/fesm2022/cngx-ui-collection.mjs +10 -0
  9. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  10. package/fesm2022/cngx-ui-command-palette.mjs +2 -2
  11. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  12. package/fesm2022/cngx-ui-context-menu.mjs +60 -6
  13. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-data-grid-accordion.mjs +87 -7
  15. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-feedback.mjs +63 -32
  17. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-mat-accordion.mjs +3 -2
  19. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  20. package/fesm2022/cngx-ui-mat-tabs.mjs +264 -86
  21. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-paginator.mjs +67 -21
  23. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  24. package/fesm2022/cngx-ui-sidenav.mjs +19 -5
  25. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  26. package/fesm2022/cngx-ui-stepper.mjs +65 -53
  27. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-tabs.mjs +84 -25
  29. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-timeline.mjs +28 -6
  31. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-toc.mjs +32 -8
  33. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  34. package/fesm2022/cngx-ui.mjs +1 -1
  35. package/mat-tabs/README.md +30 -6
  36. package/mat-tabs/styles/mat-tabs.css +180 -33
  37. package/package.json +31 -7
  38. package/schematics/collection.json +9 -0
  39. package/schematics/ng-add/index.js +9 -0
  40. package/schematics/ng-add/schema.json +91 -0
  41. package/schematics/package.json +3 -0
  42. package/stepper/README.md +1 -1
  43. package/types/cngx-ui-accordion.d.ts +9 -2
  44. package/types/cngx-ui-breadcrumb.d.ts +14 -3
  45. package/types/cngx-ui-collection.d.ts +10 -0
  46. package/types/cngx-ui-context-menu.d.ts +42 -4
  47. package/types/cngx-ui-data-grid-accordion.d.ts +4 -1
  48. package/types/cngx-ui-feedback.d.ts +11 -3
  49. package/types/cngx-ui-mat-accordion.d.ts +3 -2
  50. package/types/cngx-ui-mat-tabs.d.ts +44 -21
  51. package/types/cngx-ui-paginator.d.ts +22 -7
  52. package/types/cngx-ui-stepper.d.ts +23 -23
  53. package/types/cngx-ui-tabs.d.ts +4 -2
  54. package/types/cngx-ui-timeline.d.ts +12 -4
  55. package/types/cngx-ui-toc.d.ts +13 -3
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-action-button.mjs","sources":["../../../projects/ui/action-button/action-button.ts","../../../projects/ui/action-button/public-api.ts","../../../projects/ui/action-button/cngx-ui-action-button.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n injectInteractiveI18n,\n reflectAsyncDisplayStatus,\n type AsyncAction,\n} from '@cngx/common/interactive';\nimport {\n buildAsyncStateView,\n createTransitionTracker,\n nextUid,\n type CngxAsyncState,\n} from '@cngx/core/utils';\nimport { CngxToastOn, CngxToaster, injectErrorDetail, injectFeedbackI18n } from '@cngx/ui/feedback';\n\n/**\n * Visual variant for the action button - maps to a CSS class.\n *\n * @category ui/action-button\n */\nexport type ActionButtonVariant = 'primary' | 'secondary' | 'ghost';\n\n/**\n * Action button organism with built-in status communication.\n *\n * Coordinates between the `CngxAsyncClick` atom (mechanism, ARIA, lifecycle)\n * and the consumer (intent, styling, labels). Provides template projection\n * for pending/succeeded/failed states and an `aria-live` region for screen\n * reader announcements.\n *\n * Uses `display: contents` - the host produces no DOM box. The inner `<button>`\n * carries the `[cngxAsyncClick]` directive directly.\n *\n * For full control, use `[cngxAsyncClick]` directly on any element instead.\n *\n * ### Minimal (covers 80% of cases)\n * ```html\n * <cngx-action-button [action]=\"save\">Save</cngx-action-button>\n * ```\n *\n * ### With string labels\n * ```html\n * <cngx-action-button [action]=\"save\"\n * pendingLabel=\"Saving...\" succeededLabel=\"Saved!\" failedLabel=\"Failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * ### With template slots\n * ```html\n * <cngx-action-button [action]=\"save\">\n * Save Draft\n * <ng-template cngxPending><mat-spinner diameter=\"18\" /> Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }} - retry?</ng-template>\n * </cngx-action-button>\n * ```\n *\n * ### With toast feedback\n * ```html\n * <cngx-action-button [action]=\"save\" toastSuccess=\"Saved\" toastError=\"Save failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * @category ui/action-button\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster\n * @slot cngxPending Replaces the label while the action runs.\n * @slot cngxSucceeded Replaces the label after the action succeeds.\n * @slot cngxFailed Replaces the label when the action fails; gets the error.\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Component({\n selector: 'cngx-action-button',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxActionButton',\n host: {\n style: 'display: contents',\n },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n <button\n [type]=\"type()\"\n [cngxAsyncClick]=\"action()\"\n [feedbackDuration]=\"feedbackDuration()\"\n [enabled]=\"clickEnabled()\"\n [busy]=\"effectiveBusy()\"\n [autoAnnounce]=\"false\"\n [succeededAnnouncement]=\"succeededAnnouncement() ?? succeededLabel()\"\n [failedAnnouncement]=\"failedAnnouncement() ?? failedLabel()\"\n [attr.aria-describedby]=\"describedBy()\"\n [class]=\"'cngx-action-button cngx-action-button--' + variant()\"\n >\n @switch (effectiveStatus()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (pendingLabel()) {\n {{ pendingLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (succeededLabel()) {\n {{ succeededLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: effectiveError() }\"\n />\n } @else if (failedLabel()) {\n {{ failedLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n @if (disabledReason(); as reason) {\n <span [id]=\"reasonId\" class=\"cngx-action-button__sr-only\">{{ reason }}</span>\n }\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-action-button__sr-only\">{{\n effectiveAnnouncement()\n }}</span>\n `,\n styleUrls: ['./action-button.css'],\n})\nexport class CngxActionButton {\n private readonly toaster = inject(CngxToaster, { optional: true });\n private readonly errorDetail = injectErrorDetail();\n private readonly feedbackI18n = injectFeedbackI18n();\n private readonly externalToastOn = inject(CngxToastOn, { self: true, optional: true });\n protected readonly i18n = injectInteractiveI18n();\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>();\n\n /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored. Passed through to `cngxAsyncClick`. */\n readonly enabled = input<boolean>(true);\n\n /** Button type attribute. Defaults to `'button'` to prevent accidental form submits. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */\n readonly variant = input<ActionButtonVariant>('primary');\n\n /**\n * SR announcement on success. Falls back to `succeededLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.\n */\n readonly succeededAnnouncement = input<string | undefined>(undefined);\n\n /**\n * SR announcement on failure. Falls back to `failedLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickFailed`.\n */\n readonly failedAnnouncement = input<string | undefined>(undefined);\n\n /** Fallback text while pending (when no `cngxPending` template is projected). */\n readonly pendingLabel = input<string | undefined>(undefined);\n\n /** Fallback text after success (when no `cngxSucceeded` template is projected). */\n readonly succeededLabel = input<string | undefined>(undefined);\n\n /** Fallback text after failure (when no `cngxFailed` template is projected). */\n readonly failedLabel = input<string | undefined>(undefined);\n\n /**\n * Bind an external async state to derive visual status from.\n * When set, the button's status display follows `externalState.status()`.\n */\n readonly externalState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Reason the button is disabled, announced to screen readers while\n * `[enabled]` is `false`. Rendered into a hidden region and referenced by\n * `aria-describedby` only while disabled - an enabled button never carries\n * the reference. No effect when `[enabled]` is `true`.\n */\n readonly disabledReason = input<string | undefined>(undefined);\n\n /**\n * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`\n * or `provideToasts()`). Silently ignored when toaster is not provided.\n *\n * `toastSuccessDuration` should be >= `feedbackDuration` to avoid rapid re-fire\n * on repeated clicks that floods the SR announcement queue.\n */\n readonly toastSuccess = input<string | undefined>(undefined);\n\n /** Toast message on error. */\n readonly toastError = input<string | undefined>(undefined);\n\n /** Include the error detail message in the error toast body. */\n readonly toastErrorDetail = input<boolean>(false);\n\n /** Duration for success toasts in ms. */\n readonly toastSuccessDuration = input<number>(3000);\n\n /** Duration for error toasts - `'persistent'` means manual dismiss only. */\n readonly toastErrorDuration = input<number | 'persistent'>('persistent');\n\n /** @internal - inner CngxAsyncClick directive instance. Non-required to allow safe pre-view-init reads. */\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * @internal - effective status: reflects external `[externalState]` if\n * bound (through the shared `CngxAsyncStatus` reflection - one home for\n * the state→display-bucket mapping), otherwise reads the inner\n * `CngxAsyncClick` directive.\n */\n protected readonly effectiveStatus = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return reflectAsyncDisplayStatus(ext);\n }\n // Guard against pre-view-init reads of `state` from consumers.\n const click = this.asyncClick();\n return click ? click.status() : ('idle' as const);\n });\n\n /** @internal - effective error value from external state or inner directive. */\n protected readonly effectiveError = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return ext.error();\n }\n const click = this.asyncClick();\n return click ? click.error() : undefined;\n });\n\n /** @internal - busy while the effective status (inner or external) is pending. */\n protected readonly effectiveBusy = computed(() => this.effectiveStatus() === 'pending');\n\n /**\n * @internal - what the inner `CngxAsyncClick` may act on: only when the\n * consumer enabled it AND no effective operation is in flight. Feeding this\n * as `[enabled]` routes external-pending through the atom's own click guard,\n * so a click cannot start a second run while an external state is pending.\n */\n protected readonly clickEnabled = computed(\n () => this.enabled() && this.effectiveStatus() !== 'pending',\n );\n\n /**\n * @internal - SR announcement derived from the effective status, so an\n * external success/error settles audibly too (the inner directive only\n * knows its own runs). Mirrors the label fallback chain the template uses.\n */\n protected readonly effectiveAnnouncement = computed(() => {\n switch (this.effectiveStatus()) {\n case 'success':\n return untracked(\n () =>\n this.succeededAnnouncement() ??\n this.succeededLabel() ??\n this.i18n().asyncClickSucceeded,\n );\n case 'error':\n return untracked(\n () => this.failedAnnouncement() ?? this.failedLabel() ?? this.i18n().asyncClickFailed,\n );\n default:\n return '';\n }\n });\n\n /** @internal - stable id for the disabled-reason region. */\n protected readonly reasonId = nextUid('cngx-action-button-reason');\n\n /**\n * @internal - reference the reason region only while actually disabled by\n * intent and a reason exists. accname traverses a directly referenced hidden\n * node, so the id must be gated on the state it describes rather than left\n * permanently pointing at a hidden region.\n */\n protected readonly describedBy = computed(() =>\n !this.enabled() && this.disabledReason() ? this.reasonId : null,\n );\n\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n\n /**\n * Full `CngxAsyncState` view of this button's effective lifecycle.\n *\n * Reflects the external state when `[externalState]` is bound,\n * otherwise the inner `CngxAsyncClick` directive's state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"btn.state\" />`.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.effectiveStatus,\n data: computed(() => undefined),\n error: this.effectiveError,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n constructor() {\n // Double-toast guard, consumer placed [cngxToastOn] on the same element.\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n this.externalToastOn &&\n (this.toastSuccess() || this.toastError())\n ) {\n console.warn(\n 'CngxActionButton: [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +\n 'on the same element will fire duplicate toasts. Use one or the other.',\n );\n }\n\n const tracker = createTransitionTracker(() => this.effectiveStatus());\n\n effect(() => {\n const status = tracker.current();\n const previous = tracker.previous();\n\n if (status === previous) {\n return;\n }\n\n // Only the transition edge may re-run this body. The toast inputs and\n // effectiveError are read untracked: previous() stays stale for the whole\n // settled window, so a tracked read would re-fire the toast on any input\n // rebind while status sits in success/error. Doctrine: bridge effects\n // untrack service calls.\n untracked(() => {\n if (status === 'success') {\n // Producer write for the buildAsyncStateView `lastUpdated` slot (no other\n // source feeds it) - state production, not derived-state sync. This is the\n // sanctioned signal-write-in-effect class, same as the async-state-view pattern.\n this.lastUpdatedState.set(new Date());\n const msg = this.toastSuccess();\n if (msg && this.toaster) {\n this.toaster.show({\n message: msg,\n severity: 'success',\n duration: this.toastSuccessDuration(),\n });\n }\n }\n\n if (status === 'error') {\n const msg = this.toastError();\n if (msg && this.toaster) {\n const err = this.effectiveError();\n const detail =\n this.toastErrorDetail() && err != null ? this.errorDetail(err) : undefined;\n this.toaster.show({\n message: detail ? this.feedbackI18n().errorWithDetail(msg, detail) : msg,\n severity: 'error',\n duration: this.toastErrorDuration(),\n });\n }\n }\n });\n });\n }\n}\n","/**\n * @module @cngx/ui/action-button\n */\n\nexport { CngxActionButton, type ActionButtonVariant } from './action-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAsCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;MAsEU,gBAAgB,CAAA;IACV,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjD,WAAW,GAAG,iBAAiB,EAAE;IACjC,YAAY,GAAG,kBAAkB,EAAE;AACnC,IAAA,eAAe,GAAG,MAA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,EAAA,IAAA,EAAA,KAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,cAAc,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MA+FT,WAAW,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAET,aAAa,2FAEhB,UAAU,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACrVxD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-action-button.mjs","sources":["../../../projects/ui/action-button/action-button.ts","../../../projects/ui/action-button/public-api.ts","../../../projects/ui/action-button/cngx-ui-action-button.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n injectInteractiveI18n,\n reflectAsyncDisplayStatus,\n type AsyncAction,\n} from '@cngx/common/interactive';\nimport {\n buildAsyncStateView,\n createTransitionTracker,\n nextUid,\n type CngxAsyncState,\n} from '@cngx/core/utils';\nimport { CngxToastOn, CngxToaster, injectErrorDetail, injectFeedbackI18n } from '@cngx/ui/feedback';\nimport { cngxDevWarn } from '@cngx/utils';\n\n/**\n * Visual variant for the action button - maps to a CSS class.\n *\n * @category ui/action-button\n */\nexport type ActionButtonVariant = 'primary' | 'secondary' | 'ghost';\n\n/**\n * Action button organism with built-in status communication.\n *\n * Coordinates between the `CngxAsyncClick` atom (mechanism, ARIA, lifecycle)\n * and the consumer (intent, styling, labels). Provides template projection\n * for pending/succeeded/failed states and an `aria-live` region for screen\n * reader announcements.\n *\n * Uses `display: contents` - the host produces no DOM box. The inner `<button>`\n * carries the `[cngxAsyncClick]` directive directly.\n *\n * For full control, use `[cngxAsyncClick]` directly on any element instead.\n *\n * ### Minimal (covers 80% of cases)\n * ```html\n * <cngx-action-button [action]=\"save\">Save</cngx-action-button>\n * ```\n *\n * ### With string labels\n * ```html\n * <cngx-action-button [action]=\"save\"\n * pendingLabel=\"Saving...\" succeededLabel=\"Saved!\" failedLabel=\"Failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * ### With template slots\n * ```html\n * <cngx-action-button [action]=\"save\">\n * Save Draft\n * <ng-template cngxPending><mat-spinner diameter=\"18\" /> Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }} - retry?</ng-template>\n * </cngx-action-button>\n * ```\n *\n * ### With toast feedback\n * ```html\n * <cngx-action-button [action]=\"save\" toastSuccess=\"Saved\" toastError=\"Save failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * @category ui/action-button\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster\n * @slot cngxPending Replaces the label while the action runs.\n * @slot cngxSucceeded Replaces the label after the action succeeds.\n * @slot cngxFailed Replaces the label when the action fails; gets the error.\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Component({\n selector: 'cngx-action-button',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxActionButton',\n host: {\n style: 'display: contents',\n },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n <button\n [type]=\"type()\"\n [cngxAsyncClick]=\"action()\"\n [feedbackDuration]=\"feedbackDuration()\"\n [enabled]=\"clickEnabled()\"\n [busy]=\"effectiveBusy()\"\n [autoAnnounce]=\"false\"\n [succeededAnnouncement]=\"succeededAnnouncement() ?? succeededLabel()\"\n [failedAnnouncement]=\"failedAnnouncement() ?? failedLabel()\"\n [attr.aria-describedby]=\"describedBy()\"\n [class]=\"'cngx-action-button cngx-action-button--' + variant()\"\n >\n @switch (effectiveStatus()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (pendingLabel()) {\n {{ pendingLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (succeededLabel()) {\n {{ succeededLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: effectiveError() }\"\n />\n } @else if (failedLabel()) {\n {{ failedLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n @if (disabledReason(); as reason) {\n <span [id]=\"reasonId\" class=\"cngx-action-button__sr-only\">{{ reason }}</span>\n }\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-action-button__sr-only\">{{\n effectiveAnnouncement()\n }}</span>\n `,\n styleUrls: ['./action-button.css'],\n})\nexport class CngxActionButton {\n private readonly toaster = inject(CngxToaster, { optional: true });\n private readonly errorDetail = injectErrorDetail();\n private readonly feedbackI18n = injectFeedbackI18n();\n private readonly externalToastOn = inject(CngxToastOn, { self: true, optional: true });\n protected readonly i18n = injectInteractiveI18n();\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>();\n\n /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored. Passed through to `cngxAsyncClick`. */\n readonly enabled = input<boolean>(true);\n\n /** Button type attribute. Defaults to `'button'` to prevent accidental form submits. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */\n readonly variant = input<ActionButtonVariant>('primary');\n\n /**\n * SR announcement on success. Falls back to `succeededLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.\n */\n readonly succeededAnnouncement = input<string | undefined>(undefined);\n\n /**\n * SR announcement on failure. Falls back to `failedLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickFailed`.\n */\n readonly failedAnnouncement = input<string | undefined>(undefined);\n\n /** Fallback text while pending (when no `cngxPending` template is projected). */\n readonly pendingLabel = input<string | undefined>(undefined);\n\n /** Fallback text after success (when no `cngxSucceeded` template is projected). */\n readonly succeededLabel = input<string | undefined>(undefined);\n\n /** Fallback text after failure (when no `cngxFailed` template is projected). */\n readonly failedLabel = input<string | undefined>(undefined);\n\n /**\n * Bind an external async state to derive visual status from.\n * When set, the button's status display follows `externalState.status()`.\n */\n readonly externalState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Reason the button is disabled, announced to screen readers while\n * `[enabled]` is `false`. Rendered into a hidden region and referenced by\n * `aria-describedby` only while disabled - an enabled button never carries\n * the reference. No effect when `[enabled]` is `true`.\n */\n readonly disabledReason = input<string | undefined>(undefined);\n\n /**\n * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`\n * or `provideToasts()`). Silently ignored when toaster is not provided.\n *\n * `toastSuccessDuration` should be >= `feedbackDuration` to avoid rapid re-fire\n * on repeated clicks that floods the SR announcement queue.\n */\n readonly toastSuccess = input<string | undefined>(undefined);\n\n /** Toast message on error. */\n readonly toastError = input<string | undefined>(undefined);\n\n /** Include the error detail message in the error toast body. */\n readonly toastErrorDetail = input<boolean>(false);\n\n /** Duration for success toasts in ms. */\n readonly toastSuccessDuration = input<number>(3000);\n\n /** Duration for error toasts - `'persistent'` means manual dismiss only. */\n readonly toastErrorDuration = input<number | 'persistent'>('persistent');\n\n /** @internal - inner CngxAsyncClick directive instance. Non-required to allow safe pre-view-init reads. */\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * @internal - effective status: reflects external `[externalState]` if\n * bound (through the shared `CngxAsyncStatus` reflection - one home for\n * the state→display-bucket mapping), otherwise reads the inner\n * `CngxAsyncClick` directive.\n */\n protected readonly effectiveStatus = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return reflectAsyncDisplayStatus(ext);\n }\n // Guard against pre-view-init reads of `state` from consumers.\n const click = this.asyncClick();\n return click ? click.status() : ('idle' as const);\n });\n\n /** @internal - effective error value from external state or inner directive. */\n protected readonly effectiveError = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return ext.error();\n }\n const click = this.asyncClick();\n return click ? click.error() : undefined;\n });\n\n /** @internal - busy while the effective status (inner or external) is pending. */\n protected readonly effectiveBusy = computed(() => this.effectiveStatus() === 'pending');\n\n /**\n * @internal - what the inner `CngxAsyncClick` may act on: only when the\n * consumer enabled it AND no effective operation is in flight. Feeding this\n * as `[enabled]` routes external-pending through the atom's own click guard,\n * so a click cannot start a second run while an external state is pending.\n */\n protected readonly clickEnabled = computed(\n () => this.enabled() && this.effectiveStatus() !== 'pending',\n );\n\n /**\n * @internal - SR announcement derived from the effective status, so an\n * external success/error settles audibly too (the inner directive only\n * knows its own runs). Mirrors the label fallback chain the template uses.\n */\n protected readonly effectiveAnnouncement = computed(() => {\n switch (this.effectiveStatus()) {\n case 'success':\n return untracked(\n () =>\n this.succeededAnnouncement() ??\n this.succeededLabel() ??\n this.i18n().asyncClickSucceeded,\n );\n case 'error':\n return untracked(\n () => this.failedAnnouncement() ?? this.failedLabel() ?? this.i18n().asyncClickFailed,\n );\n default:\n return '';\n }\n });\n\n /** @internal - stable id for the disabled-reason region. */\n protected readonly reasonId = nextUid('cngx-action-button-reason');\n\n /**\n * @internal - reference the reason region only while actually disabled by\n * intent and a reason exists. accname traverses a directly referenced hidden\n * node, so the id must be gated on the state it describes rather than left\n * permanently pointing at a hidden region.\n */\n protected readonly describedBy = computed(() =>\n !this.enabled() && this.disabledReason() ? this.reasonId : null,\n );\n\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n\n /**\n * Full `CngxAsyncState` view of this button's effective lifecycle.\n *\n * Reflects the external state when `[externalState]` is bound,\n * otherwise the inner `CngxAsyncClick` directive's state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"btn.state\" />`.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.effectiveStatus,\n data: computed(() => undefined),\n error: this.effectiveError,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n constructor() {\n // Double-toast guard, consumer placed [cngxToastOn] on the same element.\n // After the first render: template-bound inputs are unset in the constructor.\n if (typeof ngDevMode !== 'undefined' && ngDevMode && this.externalToastOn) {\n afterNextRender(() => {\n if (this.toastSuccess() || this.toastError()) {\n cngxDevWarn(\n 'CNGX3008',\n '[cngx-action-button] [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +\n 'on the same element will fire duplicate toasts. Use one or the other.',\n );\n }\n });\n }\n\n const tracker = createTransitionTracker(() => this.effectiveStatus());\n\n effect(() => {\n const status = tracker.current();\n const previous = tracker.previous();\n\n if (status === previous) {\n return;\n }\n\n // Only the transition edge may re-run this body. The toast inputs and\n // effectiveError are read untracked: previous() stays stale for the whole\n // settled window, so a tracked read would re-fire the toast on any input\n // rebind while status sits in success/error. Doctrine: bridge effects\n // untrack service calls.\n untracked(() => {\n if (status === 'success') {\n // Producer write for the buildAsyncStateView `lastUpdated` slot (no other\n // source feeds it) - state production, not derived-state sync. This is the\n // sanctioned signal-write-in-effect class, same as the async-state-view pattern.\n this.lastUpdatedState.set(new Date());\n const msg = this.toastSuccess();\n if (msg && this.toaster) {\n this.toaster.show({\n message: msg,\n severity: 'success',\n duration: this.toastSuccessDuration(),\n });\n }\n }\n\n if (status === 'error') {\n const msg = this.toastError();\n if (msg && this.toaster) {\n const err = this.effectiveError();\n const detail =\n this.toastErrorDetail() && err != null ? this.errorDetail(err) : undefined;\n this.toaster.show({\n message: detail ? this.feedbackI18n().errorWithDetail(msg, detail) : msg,\n severity: 'error',\n duration: this.toastErrorDuration(),\n });\n }\n }\n });\n });\n }\n}\n","/**\n * @module @cngx/ui/action-button\n */\n\nexport { CngxActionButton, type ActionButtonVariant } from './action-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAwCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;MAsEU,gBAAgB,CAAA;IACV,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjD,WAAW,GAAG,iBAAiB,EAAE;IACjC,YAAY,GAAG,kBAAkB,EAAE;AACnC,IAAA,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnE,IAAI,GA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AA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,cAAc,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MA+FT,WAAW,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAET,aAAa,2FAEhB,UAAU,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ACvVxD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,13 +1,14 @@
1
1
  import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
3
  import { inject, TemplateRef, Directive, isSignal, InjectionToken, input, computed, contentChild, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, afterNextRender, signal, DestroyRef, makeEnvironmentProviders } from '@angular/core';
4
- import { CNGX_BREADCRUMB, CngxMenu, CngxMenuItem, CngxMenuTrigger, CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator } from '@cngx/common/interactive';
4
+ import { CngxMenu, CngxMenuItem, CngxMenuTrigger, CNGX_BREADCRUMB, CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator } from '@cngx/common/interactive';
5
5
  import { injectContainerSize } from '@cngx/common/layout';
6
6
  import { createFilledOverrideMerge, createControlledSource, createOverrideMerge } from '@cngx/core/utils';
7
7
  import { CngxPopoverPanel, CngxPopoverTrigger } from '@cngx/common/popover';
8
+ import { CngxRuntimeError, cngxDevWarn } from '@cngx/utils';
8
9
  import { createLanguageSection } from '@cngx/core/i18n';
9
10
  import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
- import { Router, NavigationEnd } from '@angular/router';
11
+ import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
11
12
  import { filter } from 'rxjs/operators';
12
13
 
13
14
  /**
@@ -289,7 +290,7 @@ function injectBreadcrumbAriaLabels() {
289
290
  */
290
291
  class CngxBreadcrumbOverflow {
291
292
  /** Collapse-set contract, provided by the surrounding `cngxBreadcrumb`. */
292
- breadcrumb = inject(CNGX_BREADCRUMB);
293
+ breadcrumb = injectOverflowBreadcrumb();
293
294
  ariaLabels = injectBreadcrumbAriaLabels();
294
295
  /** Accessible name of the ellipsis trigger. Unbound (`undefined`), it falls back through the config cascade to the EN default. */
295
296
  triggerLabel = input(undefined, ...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
@@ -309,7 +310,7 @@ class CngxBreadcrumbOverflow {
309
310
  /** Resolved row template: a bar-forwarded input wins, else the directly-projected slot. */
310
311
  itemTemplate = createControlledSource(this.itemTemplateInput, this.itemTemplateQuery);
311
312
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxBreadcrumbOverflow, deps: [], target: i0.ɵɵFactoryTarget.Component });
312
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxBreadcrumbOverflow, isStandalone: true, selector: "cngx-breadcrumb-overflow", inputs: { triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null }, itemTemplateInput: { classPropertyName: "itemTemplateInput", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "itemTemplateQuery", first: true, predicate: CngxBreadcrumbOverflowItem, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxBreadcrumbOverflow"], ngImport: i0, template: "@if (breadcrumb.hasCollapsed()) {\n <button\n type=\"button\"\n class=\"cngx-breadcrumb__overflow-trigger\"\n [cngxMenuTrigger]=\"menu\"\n [cngxPopoverTrigger]=\"panel.popover\"\n [haspopup]=\"'menu'\"\n [popover]=\"panel.popover\"\n [attr.aria-label]=\"resolvedTriggerLabel()\"\n (click)=\"panel.popover.toggle()\"\n >\n <ng-content select=\":not([cngxBreadcrumbOverflowItem])\">&hellip;</ng-content>\n </button>\n\n <cngx-popover-panel #panel role=\"group\" placement=\"bottom-start\">\n <ul cngxMenu #menu=\"cngxMenu\" [label]=\"resolvedMenuLabel()\" class=\"cngx-breadcrumb__overflow-menu\">\n @for (crumb of breadcrumb.collapsedItems(); track crumb; let i = $index) {\n <li cngxMenuItem class=\"cngx-breadcrumb__overflow-item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: crumb, crumb: crumb, index: i }\"\n />\n } @else {\n {{ crumb.resolvedLabel() }}\n }\n </li>\n }\n </ul>\n </cngx-popover-panel>\n}\n", styles: [".cngx-breadcrumb__overflow-trigger{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:var(--cngx-breadcrumb-overflow-trigger-width, 32px);height:var(--cngx-breadcrumb-overflow-trigger-height, 26px);min-inline-size:var(--cngx-target-min, 0px);min-block-size:var(--cngx-target-min, 0px);padding:0;border:1px solid var(--cngx-breadcrumb-overflow-trigger-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-breadcrumb-overflow-trigger-radius, var(--cngx-radius-sm, 4px));background:var( --cngx-breadcrumb-overflow-trigger-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );font:inherit;line-height:1;color:var(--cngx-breadcrumb-overflow-trigger-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer;transition:background var(--cngx-duration-base, .2s) ease,color var(--cngx-duration-base, .2s) ease,border-color var(--cngx-duration-base, .2s) ease}.cngx-breadcrumb__overflow-trigger:hover{background:var( --cngx-breadcrumb-overflow-trigger-hover-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent) );color:var(--cngx-breadcrumb-overflow-trigger-hover-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));border-color:var( --cngx-breadcrumb-overflow-trigger-hover-border, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-breadcrumb__overflow-menu{--cngx-breadcrumb-overflow-menu-padding: var(--cngx-space-xs, .25rem) 0;margin:0;padding:var(--cngx-breadcrumb-overflow-menu-padding, .25rem 0);list-style:none;min-width:var(--cngx-breadcrumb-overflow-menu-min-width, 11.875rem)}.cngx-breadcrumb__overflow-item{--cngx-breadcrumb-overflow-item-padding: var(--cngx-space-sm, .5em) var(--cngx-space-sm, .6em);display:flex;align-items:center;gap:.5em;padding:var(--cngx-breadcrumb-overflow-item-padding, .5em .6em);border-radius:var(--cngx-breadcrumb-overflow-item-radius, var(--cngx-radius-sm, 4px));white-space:nowrap;color:var(--cngx-breadcrumb-overflow-item-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer}.cngx-breadcrumb__overflow-item:hover{background:var( --cngx-breadcrumb-overflow-item-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-overflow-item-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CngxMenu, selector: "[cngxMenu]", inputs: ["label"], outputs: ["itemActivated"], exportAs: ["cngxMenu"] }, { kind: "directive", type: CngxMenuItem, selector: "[cngxMenuItem]", inputs: ["value", "disabled", "label"], exportAs: ["cngxMenuItem"] }, { kind: "directive", type: CngxMenuTrigger, selector: "[cngxMenuTrigger]", inputs: ["cngxMenuTrigger", "popover"], exportAs: ["cngxMenuTrigger"] }, { kind: "component", type: CngxPopoverPanel, selector: "cngx-popover-panel", inputs: ["variant", "role", "showClose", "showArrow", "state", "loading", "error", "empty"], exportAs: ["cngxPopoverPanel"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
313
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxBreadcrumbOverflow, isStandalone: true, selector: "cngx-breadcrumb-overflow", inputs: { triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null }, itemTemplateInput: { classPropertyName: "itemTemplateInput", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "itemTemplateQuery", first: true, predicate: CngxBreadcrumbOverflowItem, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxBreadcrumbOverflow"], ngImport: i0, template: "@if (breadcrumb.hasCollapsed()) {\n <button\n type=\"button\"\n class=\"cngx-breadcrumb__overflow-trigger\"\n [cngxMenuTrigger]=\"menu\"\n [cngxPopoverTrigger]=\"panel.popover\"\n [haspopup]=\"'menu'\"\n [popover]=\"panel.popover\"\n [attr.aria-label]=\"resolvedTriggerLabel()\"\n (click)=\"panel.popover.toggle()\"\n >\n <ng-content select=\":not([cngxBreadcrumbOverflowItem])\">&hellip;</ng-content>\n </button>\n\n <cngx-popover-panel #panel role=\"group\" placement=\"bottom-start\">\n <ul cngxMenu #menu=\"cngxMenu\" [label]=\"resolvedMenuLabel()\" class=\"cngx-breadcrumb__overflow-menu\">\n @for (crumb of breadcrumb.collapsedItems(); track crumb; let i = $index) {\n <li cngxMenuItem class=\"cngx-breadcrumb__overflow-item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: crumb, crumb: crumb, index: i }\"\n />\n } @else {\n {{ crumb.resolvedLabel() }}\n }\n </li>\n }\n </ul>\n </cngx-popover-panel>\n}\n", styles: [".cngx-breadcrumb__overflow-trigger{display:inline-flex;align-items:center;justify-content:center;gap:2px;width:var(--cngx-breadcrumb-overflow-trigger-width, 32px);height:var(--cngx-breadcrumb-overflow-trigger-height, 26px);min-inline-size:var(--cngx-target-min, 0px);min-block-size:var(--cngx-target-min, 0px);padding:0;border:1px solid var(--cngx-breadcrumb-overflow-trigger-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-breadcrumb-overflow-trigger-radius, var(--cngx-radius-sm, 4px));background:var( --cngx-breadcrumb-overflow-trigger-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );font:inherit;line-height:1;color:var(--cngx-breadcrumb-overflow-trigger-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer;transition:background var(--cngx-duration-base, .2s) ease,color var(--cngx-duration-base, .2s) ease,border-color var(--cngx-duration-base, .2s) ease}.cngx-breadcrumb__overflow-trigger:hover{background:var( --cngx-breadcrumb-overflow-trigger-hover-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent) );color:var(--cngx-breadcrumb-overflow-trigger-hover-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));border-color:var( --cngx-breadcrumb-overflow-trigger-hover-border, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-breadcrumb__overflow-menu{--cngx-breadcrumb-overflow-menu-padding: var(--cngx-space-xs, .25rem) 0;margin:0;padding:var(--cngx-breadcrumb-overflow-menu-padding, .25rem 0);list-style:none;min-width:var(--cngx-breadcrumb-overflow-menu-min-width, 11.875rem)}.cngx-breadcrumb__overflow-item{--cngx-breadcrumb-overflow-item-padding: var(--cngx-space-sm, .5em) var(--cngx-space-sm, .6em);display:flex;align-items:center;gap:.5em;padding:var(--cngx-breadcrumb-overflow-item-padding, .5em .6em);border-radius:var(--cngx-breadcrumb-overflow-item-radius, var(--cngx-radius-sm, 4px));white-space:nowrap;color:var(--cngx-breadcrumb-overflow-item-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer}.cngx-breadcrumb__overflow-item:hover{background:var( --cngx-breadcrumb-overflow-item-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-overflow-item-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CngxMenu, selector: "[cngxMenu]", inputs: ["label"], outputs: ["itemActivated"], exportAs: ["cngxMenu"] }, { kind: "directive", type: CngxMenuItem, selector: "[cngxMenuItem]", inputs: ["value", "disabled", "label"], exportAs: ["cngxMenuItem"] }, { kind: "directive", type: CngxMenuTrigger, selector: "[cngxMenuTrigger]", inputs: ["cngxMenuTrigger", "popover"], exportAs: ["cngxMenuTrigger"] }, { kind: "component", type: CngxPopoverPanel, selector: "cngx-popover-panel", inputs: ["variant", "role", "showClose", "showArrow", "state", "loading", "error", "empty"], exportAs: ["cngxPopoverPanel"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "controls", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
313
314
  }
314
315
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxBreadcrumbOverflow, decorators: [{
315
316
  type: Component,
@@ -324,6 +325,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
324
325
  }], propDecorators: { triggerLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerLabel", required: false }] }], menuLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "menuLabel", required: false }] }], itemTemplateInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], itemTemplateQuery: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxBreadcrumbOverflowItem), { ...{
325
326
  read: TemplateRef,
326
327
  }, isSignal: true }] }] } });
328
+ /**
329
+ * Inject the {@link CNGX_BREADCRUMB} of the surrounding breadcrumb for
330
+ * {@link CngxBreadcrumbOverflow}. Throws a `CngxRuntimeError` with code
331
+ * `CNGX3024` when no breadcrumb is above it, in development and production
332
+ * alike.
333
+ *
334
+ * @internal
335
+ */
336
+ function injectOverflowBreadcrumb() {
337
+ const breadcrumb = inject(CNGX_BREADCRUMB, { optional: true });
338
+ if (!breadcrumb) {
339
+ throw new CngxRuntimeError('CNGX3024', typeof ngDevMode !== 'undefined' &&
340
+ ngDevMode &&
341
+ '[cngx-breadcrumb-overflow] must be placed inside an element with [cngxBreadcrumb].');
342
+ }
343
+ return breadcrumb;
344
+ }
327
345
 
328
346
  /**
329
347
  * Structural slot for the per-row body inside the {@link CngxBreadcrumbSiblings}
@@ -431,7 +449,7 @@ class CngxBreadcrumbSiblings {
431
449
  /** Per-row template overriding the default sibling row, when projected. */
432
450
  itemTemplate = contentChild(CngxBreadcrumbSiblingItem, { ...(ngDevMode ? { debugName: "itemTemplate" } : /* istanbul ignore next */ {}), read: TemplateRef });
433
451
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxBreadcrumbSiblings, deps: [], target: i0.ɵɵFactoryTarget.Component });
434
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxBreadcrumbSiblings, isStandalone: true, selector: "cngx-breadcrumb-siblings", inputs: { siblingsInput: { classPropertyName: "siblingsInput", publicName: "siblings", isSignal: true, isRequired: false, transformFunction: null }, triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CngxBreadcrumbSiblingItem, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxBreadcrumbSiblings"], ngImport: i0, template: "@if (hasSiblings()) {\n <button\n type=\"button\"\n class=\"cngx-breadcrumb__siblings-trigger\"\n [cngxPopoverTrigger]=\"panel.popover\"\n [haspopup]=\"'none'\"\n [restoreFocus]=\"true\"\n [attr.aria-label]=\"resolvedTriggerLabel()\"\n (click)=\"panel.popover.toggle()\"\n >\n <ng-content select=\":not([cngxBreadcrumbSiblingItem])\">&#9662;</ng-content>\n </button>\n\n <cngx-popover-panel #panel mode=\"auto\" placement=\"bottom-start\">\n <ul class=\"cngx-breadcrumb__siblings-menu\" role=\"list\" [attr.aria-label]=\"resolvedMenuLabel()\">\n @for (sib of items(); track sib; let i = $index) {\n <li\n class=\"cngx-breadcrumb__siblings-item\"\n [attr.aria-current]=\"sib.current ? 'page' : null\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: sib, sibling: sib, index: i }\"\n />\n } @else {\n @if (sib.href && !sib.current) {\n <a class=\"cngx-breadcrumb__siblings-link\" [attr.href]=\"sib.href\">{{ sib.label }}</a>\n } @else {\n {{ sib.label }}\n }\n }\n </li>\n }\n </ul>\n </cngx-popover-panel>\n}\n", styles: [".cngx-breadcrumb__siblings-trigger{display:inline-flex;align-items:center;justify-content:center;width:max(var(--cngx-breadcrumb-siblings-trigger-size, 22px),var(--cngx-target-min, 0px));height:max(var(--cngx-breadcrumb-siblings-trigger-size, 22px),var(--cngx-target-min, 0px));padding:0;border:0;border-radius:var(--cngx-breadcrumb-siblings-trigger-radius, var(--cngx-radius-sm, 4px));background:none;font:inherit;line-height:1;color:var(--cngx-breadcrumb-siblings-trigger-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer;transition:background var(--cngx-duration-base, .2s) ease,color var(--cngx-duration-base, .2s) ease,transform var(--cngx-duration-base, .2s) ease}.cngx-breadcrumb__siblings-trigger:hover{background:var( --cngx-breadcrumb-siblings-trigger-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-siblings-trigger-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}.cngx-breadcrumb__siblings-trigger[aria-expanded=true]{background:var( --cngx-breadcrumb-siblings-trigger-open-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent) );color:var(--cngx-breadcrumb-siblings-trigger-open-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));transform:rotate(180deg)}.cngx-breadcrumb__siblings-menu{--cngx-breadcrumb-siblings-menu-padding: var(--cngx-space-xs, .25rem) 0;margin:0;padding:var(--cngx-breadcrumb-siblings-menu-padding, .25rem 0);list-style:none;min-width:var(--cngx-breadcrumb-siblings-menu-min-width, 11.25rem)}.cngx-breadcrumb__siblings-item{--cngx-breadcrumb-siblings-item-padding: var(--cngx-space-sm, .45em) var(--cngx-space-sm, .55em);display:flex;align-items:center;padding:var(--cngx-breadcrumb-siblings-item-padding, .45em .55em);min-block-size:var(--cngx-target-min, 0px);border-radius:var(--cngx-breadcrumb-siblings-item-radius, var(--cngx-radius-sm, 4px));white-space:nowrap;color:var(--cngx-breadcrumb-siblings-item-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer}.cngx-breadcrumb__siblings-item:hover{background:var( --cngx-breadcrumb-siblings-item-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-siblings-item-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}.cngx-breadcrumb__siblings-item[aria-current=page]{color:var(--cngx-breadcrumb-siblings-item-current-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));font-weight:600}.cngx-breadcrumb__siblings-link{color:var(--cngx-breadcrumb-siblings-link-color, inherit);text-decoration:var(--cngx-breadcrumb-siblings-link-decoration, none)}@media(forced-colors:active){.cngx-breadcrumb__siblings-item[aria-current=page]{--_cngx-forced-ink: HighlightText;forced-color-adjust:none;background:Highlight;color:var(--_cngx-forced-ink, HighlightText)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CngxPopoverPanel, selector: "cngx-popover-panel", inputs: ["variant", "role", "showClose", "showArrow", "state", "loading", "error", "empty"], exportAs: ["cngxPopoverPanel"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
452
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxBreadcrumbSiblings, isStandalone: true, selector: "cngx-breadcrumb-siblings", inputs: { siblingsInput: { classPropertyName: "siblingsInput", publicName: "siblings", isSignal: true, isRequired: false, transformFunction: null }, triggerLabel: { classPropertyName: "triggerLabel", publicName: "triggerLabel", isSignal: true, isRequired: false, transformFunction: null }, menuLabel: { classPropertyName: "menuLabel", publicName: "menuLabel", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CngxBreadcrumbSiblingItem, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxBreadcrumbSiblings"], ngImport: i0, template: "@if (hasSiblings()) {\n <button\n type=\"button\"\n class=\"cngx-breadcrumb__siblings-trigger\"\n [cngxPopoverTrigger]=\"panel.popover\"\n [haspopup]=\"'none'\"\n [restoreFocus]=\"true\"\n [attr.aria-label]=\"resolvedTriggerLabel()\"\n (click)=\"panel.popover.toggle()\"\n >\n <ng-content select=\":not([cngxBreadcrumbSiblingItem])\">&#9662;</ng-content>\n </button>\n\n <cngx-popover-panel #panel mode=\"auto\" placement=\"bottom-start\">\n <ul class=\"cngx-breadcrumb__siblings-menu\" role=\"list\" [attr.aria-label]=\"resolvedMenuLabel()\">\n @for (sib of items(); track sib; let i = $index) {\n <li\n class=\"cngx-breadcrumb__siblings-item\"\n [attr.aria-current]=\"sib.current ? 'page' : null\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: sib, sibling: sib, index: i }\"\n />\n } @else {\n @if (sib.href && !sib.current) {\n <a class=\"cngx-breadcrumb__siblings-link\" [attr.href]=\"sib.href\">{{ sib.label }}</a>\n } @else {\n {{ sib.label }}\n }\n }\n </li>\n }\n </ul>\n </cngx-popover-panel>\n}\n", styles: [".cngx-breadcrumb__siblings-trigger{display:inline-flex;align-items:center;justify-content:center;width:max(var(--cngx-breadcrumb-siblings-trigger-size, 22px),var(--cngx-target-min, 0px));height:max(var(--cngx-breadcrumb-siblings-trigger-size, 22px),var(--cngx-target-min, 0px));padding:0;border:0;border-radius:var(--cngx-breadcrumb-siblings-trigger-radius, var(--cngx-radius-sm, 4px));background:none;font:inherit;line-height:1;color:var(--cngx-breadcrumb-siblings-trigger-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer;transition:background var(--cngx-duration-base, .2s) ease,color var(--cngx-duration-base, .2s) ease,transform var(--cngx-duration-base, .2s) ease}.cngx-breadcrumb__siblings-trigger:hover{background:var( --cngx-breadcrumb-siblings-trigger-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-siblings-trigger-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}.cngx-breadcrumb__siblings-trigger[aria-expanded=true]{background:var( --cngx-breadcrumb-siblings-trigger-open-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent) );color:var(--cngx-breadcrumb-siblings-trigger-open-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));transform:rotate(180deg)}.cngx-breadcrumb__siblings-menu{--cngx-breadcrumb-siblings-menu-padding: var(--cngx-space-xs, .25rem) 0;margin:0;padding:var(--cngx-breadcrumb-siblings-menu-padding, .25rem 0);list-style:none;min-width:var(--cngx-breadcrumb-siblings-menu-min-width, 11.25rem)}.cngx-breadcrumb__siblings-item{--cngx-breadcrumb-siblings-item-padding: var(--cngx-space-sm, .45em) var(--cngx-space-sm, .55em);display:flex;align-items:center;padding:var(--cngx-breadcrumb-siblings-item-padding, .45em .55em);min-block-size:var(--cngx-target-min, 0px);border-radius:var(--cngx-breadcrumb-siblings-item-radius, var(--cngx-radius-sm, 4px));white-space:nowrap;color:var(--cngx-breadcrumb-siblings-item-color, var(--cngx-color-text-muted, oklch(.5 .01 250)));cursor:pointer}.cngx-breadcrumb__siblings-item:hover{background:var( --cngx-breadcrumb-siblings-item-hover-bg, color-mix(in oklch, var(--cngx-color-text, oklch(.2 .01 250)) 5%, var(--cngx-color-surface, oklch(1 0 0))) );color:var(--cngx-breadcrumb-siblings-item-hover-color, var(--cngx-color-text, oklch(.2 .01 250)))}.cngx-breadcrumb__siblings-item[aria-current=page]{color:var(--cngx-breadcrumb-siblings-item-current-color, var(--cngx-color-primary-text, color-mix(in oklab, var(--cngx-color-primary, oklch(.66 .19 50)) 70%, var(--cngx-color-text, oklch(.2 .01 250)))));font-weight:600}.cngx-breadcrumb__siblings-link{color:var(--cngx-breadcrumb-siblings-link-color, inherit);text-decoration:var(--cngx-breadcrumb-siblings-link-decoration, none)}@media(forced-colors:active){.cngx-breadcrumb__siblings-item[aria-current=page]{--_cngx-forced-ink: HighlightText;forced-color-adjust:none;background:Highlight;color:var(--_cngx-forced-ink, HighlightText)}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CngxPopoverPanel, selector: "cngx-popover-panel", inputs: ["variant", "role", "showClose", "showArrow", "state", "loading", "error", "empty"], exportAs: ["cngxPopoverPanel"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "controls", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
435
453
  }
436
454
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxBreadcrumbSiblings, decorators: [{
437
455
  type: Component,
@@ -483,6 +501,18 @@ const CNGX_BREADCRUMB_ITEMS_SOURCE = new InjectionToken('CNGX_BREADCRUMB_ITEMS_S
483
501
  * @slot cngxBreadcrumbItemAccessory Trailing control on a crumb, e.g. a siblings dropdown trigger.
484
502
  * @slot cngxBreadcrumbOverflowItem Replaces a row inside the collapsed-crumbs menu.
485
503
  * <example-url>http://localhost:4200/#/ui/breadcrumb/basic/explicit-items</example-url>
504
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/variants</example-url>
505
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/chips</example-url>
506
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/editorial</example-url>
507
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/header</example-url>
508
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/iconlabel</example-url>
509
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/icononly</example-url>
510
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/metro</example-url>
511
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/path</example-url>
512
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/record</example-url>
513
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/ribbon</example-url>
514
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/shell</example-url>
515
+ * <example-url>http://localhost:4200/#/ui/breadcrumb/skins/toolbar</example-url>
486
516
  */
487
517
  class CngxBreadcrumbBar {
488
518
  /** Uncontrolled trail. Ignored when a {@link CNGX_BREADCRUMB_ITEMS_SOURCE} is provided. */
@@ -661,12 +691,17 @@ class CngxBreadcrumbRouterSync {
661
691
  /** The router-derived trail. Wins over the bar's `[items]` input. */
662
692
  crumbs;
663
693
  constructor() {
694
+ // Router is providedIn: 'root' and resolves without provideRouter(...);
695
+ // ActivatedRoute does not, so it is the "router is set up" signal.
696
+ const route = inject(ActivatedRoute, { optional: true });
664
697
  const router = this.router;
665
- if (!router) {
666
- afterNextRender(() => {
667
- console.warn('CngxBreadcrumbRouterSync: no Router available - directive is a no-op. ' +
668
- 'Provide @angular/router via provideRouter(...) to enable router-driven crumbs.');
669
- });
698
+ if (!router || !route) {
699
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
700
+ afterNextRender(() => {
701
+ cngxDevWarn('CNGX3001', '[cngxRouterSync] on <cngx-breadcrumb>: no Router / ActivatedRoute available - directive is a no-op. ' +
702
+ 'Provide @angular/router via provideRouter(...) to enable router-driven crumbs.');
703
+ });
704
+ }
670
705
  this.crumbs = signal([]).asReadonly();
671
706
  return;
672
707
  }
@@ -823,12 +858,17 @@ class CngxBreadcrumbSiblingsRouterSync {
823
858
  /** The router-derived siblings. Wins over the component's `[siblings]` input. */
824
859
  siblings;
825
860
  constructor() {
861
+ // Router is providedIn: 'root' and resolves without provideRouter(...);
862
+ // ActivatedRoute does not, so it is the "router is set up" signal.
863
+ const route = inject(ActivatedRoute, { optional: true });
826
864
  const router = this.router;
827
- if (!router) {
828
- afterNextRender(() => {
829
- console.warn('CngxBreadcrumbSiblingsRouterSync: no Router available - directive is a no-op. ' +
830
- 'Provide @angular/router via provideRouter(...) to enable router-driven siblings.');
831
- });
865
+ if (!router || !route) {
866
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
867
+ afterNextRender(() => {
868
+ cngxDevWarn('CNGX3001', '[cngxRouterSync] on <cngx-breadcrumb-siblings>: no Router / ActivatedRoute available - directive is a no-op. ' +
869
+ 'Provide @angular/router via provideRouter(...) to enable router-driven siblings.');
870
+ });
871
+ }
832
872
  this.siblings = signal([]).asReadonly();
833
873
  return;
834
874
  }