@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
@@ -215,8 +215,9 @@ class CngxMatAccordion {
215
215
  * open-set stores for that panel - making a pre-populated
216
216
  * `[(openIds)]` model addressable (the generated
217
217
  * `cngx-mat-panel-N` ids are unknowable to consumers). The
218
- * function must return a stable, unique id per panel instance;
219
- * `MatExpansionPanel.id` (consumer-assignable) is a natural key.
218
+ * function must return a stable, unique id per panel instance.
219
+ * `MatExpansionPanel.id` is a readonly id the CDK generates, so it is
220
+ * not known up front; key panels from your own data instead.
220
221
  * Unbound, ids fall back to generated `nextUid` values. Swapping
221
222
  * the bound function at runtime re-keys future events but does not
222
223
  * migrate ids already stored in `openIds` - bind it once.
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-mat-accordion.mjs","sources":["../../../projects/ui/mat-accordion/material-bridge/set-sync.ts","../../../projects/ui/mat-accordion/mat-accordion.directive.ts","../../../projects/ui/mat-accordion/public-api.ts","../../../projects/ui/mat-accordion/cngx-ui-mat-accordion.ts"],"sourcesContent":["import { type DestroyRef, effect, type Injector, runInInjectionContext, type Signal, untracked } from '@angular/core';\n\n/**\n * Minimal structural view of a `MatExpansionPanel` the set-sync needs:\n * a read/write `expanded` boolean and an `expandedChange` stream. Kept\n * host-agnostic (no `@angular/material` type in the signature) so the\n * helper is unit-testable with plain fakes, mirroring the Material-\n * agnostic shape of `createMaterialBidirectionalSync` in\n * `@cngx/common/data`. `MatExpansionPanel` satisfies it structurally\n * (`expanded` getter/setter from `CdkAccordionItem`, `expandedChange`\n * is an `EventEmitter<boolean>` whose `.subscribe` matches).\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxExpansionPanelLike {\n /** Current expanded state; assigning it drives the Material panel open/closed. */\n expanded: boolean;\n /** Emits the new expanded state on every Material-driven or programmatic change. */\n readonly expandedChange: {\n subscribe(next: (expanded: boolean) => void): { unsubscribe(): void };\n };\n}\n\n/**\n * Minimal structural view of the accordion brain the sync drives:\n * a reactive membership read plus the same `toggle` the native\n * `CngxAccordionPanel` calls. `CngxAccordion` satisfies it - `isOpen`\n * reads the clamped `effectiveOpenIds` computed and `toggle` mutates\n * from that clamped view, so single-open arbitration stays authoritative\n * and the exposed `openIds` model never retains a clamped-out id. The\n * sync writes membership exclusively through `toggle`, never a raw\n * set-write, so it can never diverge from the brain's own DOM path.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxAccordionOpenSet {\n /** Reactive membership read - reflects single-mode arbitration. Tracked inside the sync effect. */\n isOpen(panelId: string): boolean;\n /** Flip a panel's open state, arbitrated by the brain (clamps siblings in single mode). */\n toggle(panelId: string): void;\n}\n\n/**\n * Options for {@link createMatExpansionSetSync}.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxMatExpansionSetSyncOptions<P extends CngxExpansionPanelLike> {\n /** Reactive list of projected expansion panels (a `contentChildren` signal). */\n readonly panels: Signal<readonly P[]>;\n /** Stable id for a panel - the key the brain's open-set stores. */\n readonly panelId: (panel: P) => string;\n /** The accordion brain's open-set (membership read + settable model). */\n readonly accordion: CngxAccordionOpenSet;\n /** Injection context for the underlying `effect()`s. */\n readonly injector: Injector;\n /** Same lifetime as the host directive; tears down the `expandedChange` listeners. */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Set-based bidirectional sync between a `<mat-accordion>`'s projected\n * `<mat-expansion-panel>` tree and the headless {@link CngxAccordion}\n * open-set. The accordion open-set is a multi-membership\n * `Set<string>`, so the index-based `createMaterialBidirectionalSync`\n * (`@cngx/common/data`) does not fit - this helper syncs per-panel\n * `expanded` against set membership instead.\n *\n * Installs two effects and one listener-set:\n *\n * 1. **brain→Material** - an `effect()` tracking `panels()` and, per\n * panel, `accordion.isOpen(id)`. When the open-set (or the panel\n * list) changes it writes `panel.expanded` to match, guarded by a\n * re-entrancy flag so the resulting synchronous `expandedChange`\n * echo does not loop back. The Material writes run inside\n * `untracked()` per the signal-architecture rules. Before the\n * first write for a freshly-sighted panel, its authored\n * `[expanded]` state SEEDS the brain: a panel that arrives\n * already expanded toggles its id into the open-set instead of\n * being closed by the (initially empty) membership write.\n * Membership still flows through `toggle`, so single-open\n * arbitration applies to seeded panels exactly as it does to a\n * user click - two panels authored expanded clamp to one in\n * single mode.\n * 2. **subscription reconcile** - an `effect()` tracking only\n * `panels()`; inside `untracked()` it subscribes freshly-added\n * panels' `expandedChange` and drops removed ones (diff-only churn,\n * a `Map<P, subscription>`).\n * 3. **Material→brain** - each `expandedChange` listener flips the\n * brain via `accordion.toggle(id)`, but only when the incoming\n * `expanded` differs from the brain's current (clamped) membership,\n * so a programmatic echo (or a redundant Material emit) is a no-op.\n * Routing through `toggle` (not a raw set-write) means single-mode\n * arbitration and the exposed `openIds` model stay identical to the\n * native `CngxAccordionPanel` DOM path.\n *\n * The idempotent membership check plus the re-entrancy flag together\n * close the loop: the flag drops the synchronous echo `CdkAccordionItem`\n * emits from its `expanded` setter during our own write, and the\n * membership check drops any Material emit that already agrees with the\n * brain.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport function createMatExpansionSetSync<P extends CngxExpansionPanelLike>(\n opts: CngxMatExpansionSetSyncOptions<P>,\n): void {\n const { panels, panelId, accordion, injector, destroyRef } = opts;\n\n // True while effect 1 is writing Material. `CdkAccordionItem` emits\n // `expandedChange` synchronously from its `expanded` setter, so the\n // Material→brain listener fires re-entrantly during our own write -\n // the flag drops that echo before the idempotent check even runs.\n let writingToMaterial = false;\n\n const subscriptions = new Map<P, { unsubscribe(): void }>();\n // Panels whose authored `expanded` state has already been folded\n // into the brain - seeding happens exactly once per panel lifetime.\n const seeded = new WeakSet<P>();\n\n const writeBackFromMaterial = (id: string, expanded: boolean): void => {\n if (writingToMaterial) {\n return;\n }\n if (accordion.isOpen(id) === expanded) {\n return;\n }\n accordion.toggle(id);\n };\n\n runInInjectionContext(injector, () => {\n // brain→Material.\n effect(() => {\n const list = panels();\n // Seed first: a freshly-sighted panel authored `[expanded]`\n // flows Material→brain BEFORE the membership write below runs,\n // otherwise the initially-empty open-set would close it. Runs\n // inside untracked() - `toggle` is a service call writing\n // signals; the tracked `isOpen` reads below pick up the\n // seeded membership synchronously.\n untracked(() => {\n for (const panel of list) {\n if (seeded.has(panel)) {\n continue;\n }\n seeded.add(panel);\n if (panel.expanded && !accordion.isOpen(panelId(panel))) {\n accordion.toggle(panelId(panel));\n }\n }\n });\n const desired = list.map((panel) => accordion.isOpen(panelId(panel)));\n untracked(() => {\n writingToMaterial = true;\n try {\n list.forEach((panel, index) => {\n if (panel.expanded !== desired[index]) {\n panel.expanded = desired[index];\n }\n });\n } finally {\n writingToMaterial = false;\n }\n });\n });\n\n // Subscription reconcile.\n effect(() => {\n const live = new Set(panels());\n untracked(() => {\n for (const panel of live) {\n if (subscriptions.has(panel)) {\n continue;\n }\n // Resolve the id per event, not at subscribe time - a\n // consumer-swapped panelId fn would otherwise leave this\n // listener toggling the stale key forever.\n subscriptions.set(\n panel,\n panel.expandedChange.subscribe((expanded) =>\n writeBackFromMaterial(panelId(panel), expanded),\n ),\n );\n }\n for (const [panel, subscription] of Array.from(subscriptions.entries())) {\n if (live.has(panel)) {\n continue;\n }\n subscription.unsubscribe();\n subscriptions.delete(panel);\n }\n });\n });\n });\n\n destroyRef.onDestroy(() => {\n for (const subscription of subscriptions.values()) {\n subscription.unsubscribe();\n }\n subscriptions.clear();\n });\n}\n","import {\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n inject,\n Injector,\n input,\n untracked,\n} from '@angular/core';\nimport { MatAccordion, MatExpansionPanel } from '@angular/material/expansion';\n\nimport { CngxAccordion } from '@cngx/common/interactive';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { createMatExpansionSetSync } from './material-bridge/set-sync';\n\n/**\n * The Material twin of the cngx accordion: attach `cngxMatAccordion` to\n * a vanilla `<mat-accordion>` and it is driven by the headless\n * {@link CngxAccordion} brain. Consumers gain the controlled\n * `[(openIds)]` group model and single-open arbitration on Material\n * markup - neither of which `<mat-accordion>` exposes (Material has only\n * per-panel `[expanded]`). Mirrors `[cngxMatStepper]` / `[cngxMatTabs]`.\n *\n * This is the instrumentation pattern: Material owns rendering and the\n * consumer authors native `<mat-expansion-panel>` markup; cngx is the\n * behaviour layer. `[multi]` and the two-way `[(openIds)]` are forwarded\n * from {@link CngxAccordion} via `hostDirectives`.\n *\n * ```html\n * <mat-accordion cngxMatAccordion [(openIds)]=\"openIds\" [multi]=\"false\">\n * <mat-expansion-panel>\n * <mat-expansion-panel-header>Personal info</mat-expansion-panel-header>\n * <p>Tell us who you are.</p>\n * </mat-expansion-panel>\n * <mat-expansion-panel>\n * <mat-expansion-panel-header>Account</mat-expansion-panel-header>\n * <p>Choose your sign-in method.</p>\n * </mat-expansion-panel>\n * </mat-accordion>\n * ```\n *\n * `multi` is authoritative on the cngx side. `MatAccordion` inherits its\n * own `multi` input from `CdkAccordion`, and both directives sit on the\n * same host element, so a single `[multi]` binding feeds both - the\n * directive therefore pins `matAccordion.multi = true` (via an `effect`\n * that re-asserts on every `multi` change) so Material never runs its own\n * single-open close while the cngx `effectiveOpenIds` clamp arbitrates.\n *\n * Panels authored `[expanded]=\"true\"` seed the open-set at first\n * registration (Material→brain), so an initially-open Material panel\n * is not closed by the initially-empty membership model. To make a\n * pre-populated `[(openIds)]` addressable, bind `[panelIdFn]` - the\n * hook replaces the generated per-panel ids with consumer-known keys:\n *\n * ```html\n * <mat-accordion\n * cngxMatAccordion\n * [(openIds)]=\"openIds\"\n * [panelIdFn]=\"idFromPanel\"\n * >\n * ```\n *\n * @playground Controlled open-set ./examples/bridge/bridge-example.component.ts\n * @category ui/mat-accordion\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-accordion/mat-accordion.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionItem, CngxMatStepper, CngxMatTabs\n */\n@Directive({\n selector: '[cngxMatAccordion]',\n exportAs: 'cngxMatAccordion',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxAccordion,\n inputs: ['multi', 'openIds'],\n outputs: ['openIdsChange'],\n },\n ],\n})\nexport class CngxMatAccordion {\n private readonly matAccordion = inject(MatAccordion, { self: true });\n /**\n * The accordion brain on this host element (declared in\n * `hostDirectives`). Same-host ownership - not a child→parent inject -\n * so it stays decompose-safe.\n */\n private readonly accordion = inject(CngxAccordion, { self: true });\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly panels = contentChildren(MatExpansionPanel, { descendants: true });\n\n // Ownership filter: `descendants: true` also surfaces panels of an\n // accordion nested inside one of OUR panels' bodies. Each panel\n // carries its owning `accordion` (public on CdkAccordionItem), so\n // foreign panels never enter the set-sync - the nested accordion\n // arbitrates its own children. Element-wise equal keeps downstream\n // effects quiet on identity-preserving query re-emissions.\n private readonly ownPanels = computed(\n () => this.panels().filter((panel) => panel.accordion === this.matAccordion),\n {\n equal: (a, b) => a.length === b.length && a.every((panel, i) => panel === b[i]),\n },\n );\n\n /**\n * Per-panel id hook. When bound, the returned key is what the\n * open-set stores for that panel - making a pre-populated\n * `[(openIds)]` model addressable (the generated\n * `cngx-mat-panel-N` ids are unknowable to consumers). The\n * function must return a stable, unique id per panel instance;\n * `MatExpansionPanel.id` (consumer-assignable) is a natural key.\n * Unbound, ids fall back to generated `nextUid` values. Swapping\n * the bound function at runtime re-keys future events but does not\n * migrate ids already stored in `openIds` - bind it once.\n */\n readonly panelIdFn = input<((panel: MatExpansionPanel) => string) | undefined>(undefined);\n\n // Stable id per panel - the key the brain's open-set stores. A WeakMap:\n // the id is assigned first-seen and never needs enumeration, so a removed\n // panel's entry drops with the panel instead of accumulating over churn.\n private readonly idByPanel = new WeakMap<MatExpansionPanel, string>();\n\n constructor() {\n // Pin Material's own `multi` so it never arbitrates single-open: the\n // brain's `effectiveOpenIds` clamp is the sole arbiter. A single\n // `[multi]` binding on the host also sets `MatAccordion.multi`\n // (inherited from `CdkAccordion`); Angular applies that input during\n // change detection, so re-assert from an `effect` that flushes after\n // CD and re-runs whenever the consumer's `multi` changes.\n effect(() => {\n this.accordion.multi();\n untracked(() => {\n this.matAccordion.multi = true;\n });\n });\n\n createMatExpansionSetSync<MatExpansionPanel>({\n panels: this.ownPanels,\n panelId: (panel) => this.panelId(panel),\n accordion: this.accordion,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n }\n\n private panelId(panel: MatExpansionPanel): string {\n const idFn = this.panelIdFn();\n if (idFn !== undefined) {\n return idFn(panel);\n }\n let id = this.idByPanel.get(panel);\n if (id === undefined) {\n id = nextUid('cngx-mat-panel-');\n this.idByPanel.set(panel, id);\n }\n return id;\n }\n}\n","/**\n * @module @cngx/ui/mat-accordion\n *\n * Material instrumentation directive for `<mat-accordion>`: attach\n * `[cngxMatAccordion]` and it composes the same {@link CngxAccordion}\n * brain as `<cngx-accordion-group>` (in `@cngx/ui/accordion`) via\n * `hostDirectives`, so the controlled `[(openIds)]` group model and\n * single-open arbitration work against Material's own markup. Mirrors\n * `[cngxMatStepper]` / `[cngxMatTabs]`.\n */\nexport { CngxMatAccordion } from './mat-accordion.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,yBAAyB,CACvC,IAAuC,EAAA;AAEvC,IAAA,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI;;;;;IAMjE,IAAI,iBAAiB,GAAG,KAAK;AAE7B,IAAA,MAAM,aAAa,GAAG,IAAI,GAAG,EAA8B;;;AAG3D,IAAA,MAAM,MAAM,GAAG,IAAI,OAAO,EAAK;AAE/B,IAAA,MAAM,qBAAqB,GAAG,CAAC,EAAU,EAAE,QAAiB,KAAU;QACpE,IAAI,iBAAiB,EAAE;YACrB;QACF;QACA,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,QAAQ,EAAE;YACrC;QACF;AACA,QAAA,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AACtB,IAAA,CAAC;AAED,IAAA,qBAAqB,CAAC,QAAQ,EAAE,MAAK;;QAEnC,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,IAAI,GAAG,MAAM,EAAE;;;;;;;YAOrB,SAAS,CAAC,MAAK;AACb,gBAAA,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE;AACxB,oBAAA,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;wBACrB;oBACF;AACA,oBA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A,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,WAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AChGpF;;;;;;;;;AASG;;ACTH;;AAEG;;;;"}
1
+ {"version":3,"file":"cngx-ui-mat-accordion.mjs","sources":["../../../projects/ui/mat-accordion/material-bridge/set-sync.ts","../../../projects/ui/mat-accordion/mat-accordion.directive.ts","../../../projects/ui/mat-accordion/public-api.ts","../../../projects/ui/mat-accordion/cngx-ui-mat-accordion.ts"],"sourcesContent":["import { type DestroyRef, effect, type Injector, runInInjectionContext, type Signal, untracked } from '@angular/core';\n\n/**\n * Minimal structural view of a `MatExpansionPanel` the set-sync needs:\n * a read/write `expanded` boolean and an `expandedChange` stream. Kept\n * host-agnostic (no `@angular/material` type in the signature) so the\n * helper is unit-testable with plain fakes, mirroring the Material-\n * agnostic shape of `createMaterialBidirectionalSync` in\n * `@cngx/common/data`. `MatExpansionPanel` satisfies it structurally\n * (`expanded` getter/setter from `CdkAccordionItem`, `expandedChange`\n * is an `EventEmitter<boolean>` whose `.subscribe` matches).\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxExpansionPanelLike {\n /** Current expanded state; assigning it drives the Material panel open/closed. */\n expanded: boolean;\n /** Emits the new expanded state on every Material-driven or programmatic change. */\n readonly expandedChange: {\n subscribe(next: (expanded: boolean) => void): { unsubscribe(): void };\n };\n}\n\n/**\n * Minimal structural view of the accordion brain the sync drives:\n * a reactive membership read plus the same `toggle` the native\n * `CngxAccordionPanel` calls. `CngxAccordion` satisfies it - `isOpen`\n * reads the clamped `effectiveOpenIds` computed and `toggle` mutates\n * from that clamped view, so single-open arbitration stays authoritative\n * and the exposed `openIds` model never retains a clamped-out id. The\n * sync writes membership exclusively through `toggle`, never a raw\n * set-write, so it can never diverge from the brain's own DOM path.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxAccordionOpenSet {\n /** Reactive membership read - reflects single-mode arbitration. Tracked inside the sync effect. */\n isOpen(panelId: string): boolean;\n /** Flip a panel's open state, arbitrated by the brain (clamps siblings in single mode). */\n toggle(panelId: string): void;\n}\n\n/**\n * Options for {@link createMatExpansionSetSync}.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport interface CngxMatExpansionSetSyncOptions<P extends CngxExpansionPanelLike> {\n /** Reactive list of projected expansion panels (a `contentChildren` signal). */\n readonly panels: Signal<readonly P[]>;\n /** Stable id for a panel - the key the brain's open-set stores. */\n readonly panelId: (panel: P) => string;\n /** The accordion brain's open-set (membership read + settable model). */\n readonly accordion: CngxAccordionOpenSet;\n /** Injection context for the underlying `effect()`s. */\n readonly injector: Injector;\n /** Same lifetime as the host directive; tears down the `expandedChange` listeners. */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Set-based bidirectional sync between a `<mat-accordion>`'s projected\n * `<mat-expansion-panel>` tree and the headless {@link CngxAccordion}\n * open-set. The accordion open-set is a multi-membership\n * `Set<string>`, so the index-based `createMaterialBidirectionalSync`\n * (`@cngx/common/data`) does not fit - this helper syncs per-panel\n * `expanded` against set membership instead.\n *\n * Installs two effects and one listener-set:\n *\n * 1. **brain→Material** - an `effect()` tracking `panels()` and, per\n * panel, `accordion.isOpen(id)`. When the open-set (or the panel\n * list) changes it writes `panel.expanded` to match, guarded by a\n * re-entrancy flag so the resulting synchronous `expandedChange`\n * echo does not loop back. The Material writes run inside\n * `untracked()` per the signal-architecture rules. Before the\n * first write for a freshly-sighted panel, its authored\n * `[expanded]` state SEEDS the brain: a panel that arrives\n * already expanded toggles its id into the open-set instead of\n * being closed by the (initially empty) membership write.\n * Membership still flows through `toggle`, so single-open\n * arbitration applies to seeded panels exactly as it does to a\n * user click - two panels authored expanded clamp to one in\n * single mode.\n * 2. **subscription reconcile** - an `effect()` tracking only\n * `panels()`; inside `untracked()` it subscribes freshly-added\n * panels' `expandedChange` and drops removed ones (diff-only churn,\n * a `Map<P, subscription>`).\n * 3. **Material→brain** - each `expandedChange` listener flips the\n * brain via `accordion.toggle(id)`, but only when the incoming\n * `expanded` differs from the brain's current (clamped) membership,\n * so a programmatic echo (or a redundant Material emit) is a no-op.\n * Routing through `toggle` (not a raw set-write) means single-mode\n * arbitration and the exposed `openIds` model stay identical to the\n * native `CngxAccordionPanel` DOM path.\n *\n * The idempotent membership check plus the re-entrancy flag together\n * close the loop: the flag drops the synchronous echo `CdkAccordionItem`\n * emits from its `expanded` setter during our own write, and the\n * membership check drops any Material emit that already agrees with the\n * brain.\n *\n * @category ui/mat-accordion/material-bridge\n * @internal\n */\nexport function createMatExpansionSetSync<P extends CngxExpansionPanelLike>(\n opts: CngxMatExpansionSetSyncOptions<P>,\n): void {\n const { panels, panelId, accordion, injector, destroyRef } = opts;\n\n // True while effect 1 is writing Material. `CdkAccordionItem` emits\n // `expandedChange` synchronously from its `expanded` setter, so the\n // Material→brain listener fires re-entrantly during our own write -\n // the flag drops that echo before the idempotent check even runs.\n let writingToMaterial = false;\n\n const subscriptions = new Map<P, { unsubscribe(): void }>();\n // Panels whose authored `expanded` state has already been folded\n // into the brain - seeding happens exactly once per panel lifetime.\n const seeded = new WeakSet<P>();\n\n const writeBackFromMaterial = (id: string, expanded: boolean): void => {\n if (writingToMaterial) {\n return;\n }\n if (accordion.isOpen(id) === expanded) {\n return;\n }\n accordion.toggle(id);\n };\n\n runInInjectionContext(injector, () => {\n // brain→Material.\n effect(() => {\n const list = panels();\n // Seed first: a freshly-sighted panel authored `[expanded]`\n // flows Material→brain BEFORE the membership write below runs,\n // otherwise the initially-empty open-set would close it. Runs\n // inside untracked() - `toggle` is a service call writing\n // signals; the tracked `isOpen` reads below pick up the\n // seeded membership synchronously.\n untracked(() => {\n for (const panel of list) {\n if (seeded.has(panel)) {\n continue;\n }\n seeded.add(panel);\n if (panel.expanded && !accordion.isOpen(panelId(panel))) {\n accordion.toggle(panelId(panel));\n }\n }\n });\n const desired = list.map((panel) => accordion.isOpen(panelId(panel)));\n untracked(() => {\n writingToMaterial = true;\n try {\n list.forEach((panel, index) => {\n if (panel.expanded !== desired[index]) {\n panel.expanded = desired[index];\n }\n });\n } finally {\n writingToMaterial = false;\n }\n });\n });\n\n // Subscription reconcile.\n effect(() => {\n const live = new Set(panels());\n untracked(() => {\n for (const panel of live) {\n if (subscriptions.has(panel)) {\n continue;\n }\n // Resolve the id per event, not at subscribe time - a\n // consumer-swapped panelId fn would otherwise leave this\n // listener toggling the stale key forever.\n subscriptions.set(\n panel,\n panel.expandedChange.subscribe((expanded) =>\n writeBackFromMaterial(panelId(panel), expanded),\n ),\n );\n }\n for (const [panel, subscription] of Array.from(subscriptions.entries())) {\n if (live.has(panel)) {\n continue;\n }\n subscription.unsubscribe();\n subscriptions.delete(panel);\n }\n });\n });\n });\n\n destroyRef.onDestroy(() => {\n for (const subscription of subscriptions.values()) {\n subscription.unsubscribe();\n }\n subscriptions.clear();\n });\n}\n","import {\n computed,\n contentChildren,\n DestroyRef,\n Directive,\n effect,\n inject,\n Injector,\n input,\n untracked,\n} from '@angular/core';\nimport { MatAccordion, MatExpansionPanel } from '@angular/material/expansion';\n\nimport { CngxAccordion } from '@cngx/common/interactive';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { createMatExpansionSetSync } from './material-bridge/set-sync';\n\n/**\n * The Material twin of the cngx accordion: attach `cngxMatAccordion` to\n * a vanilla `<mat-accordion>` and it is driven by the headless\n * {@link CngxAccordion} brain. Consumers gain the controlled\n * `[(openIds)]` group model and single-open arbitration on Material\n * markup - neither of which `<mat-accordion>` exposes (Material has only\n * per-panel `[expanded]`). Mirrors `[cngxMatStepper]` / `[cngxMatTabs]`.\n *\n * This is the instrumentation pattern: Material owns rendering and the\n * consumer authors native `<mat-expansion-panel>` markup; cngx is the\n * behaviour layer. `[multi]` and the two-way `[(openIds)]` are forwarded\n * from {@link CngxAccordion} via `hostDirectives`.\n *\n * ```html\n * <mat-accordion cngxMatAccordion [(openIds)]=\"openIds\" [multi]=\"false\">\n * <mat-expansion-panel>\n * <mat-expansion-panel-header>Personal info</mat-expansion-panel-header>\n * <p>Tell us who you are.</p>\n * </mat-expansion-panel>\n * <mat-expansion-panel>\n * <mat-expansion-panel-header>Account</mat-expansion-panel-header>\n * <p>Choose your sign-in method.</p>\n * </mat-expansion-panel>\n * </mat-accordion>\n * ```\n *\n * `multi` is authoritative on the cngx side. `MatAccordion` inherits its\n * own `multi` input from `CdkAccordion`, and both directives sit on the\n * same host element, so a single `[multi]` binding feeds both - the\n * directive therefore pins `matAccordion.multi = true` (via an `effect`\n * that re-asserts on every `multi` change) so Material never runs its own\n * single-open close while the cngx `effectiveOpenIds` clamp arbitrates.\n *\n * Panels authored `[expanded]=\"true\"` seed the open-set at first\n * registration (Material→brain), so an initially-open Material panel\n * is not closed by the initially-empty membership model. To make a\n * pre-populated `[(openIds)]` addressable, bind `[panelIdFn]` - the\n * hook replaces the generated per-panel ids with consumer-known keys:\n *\n * ```html\n * <mat-accordion\n * cngxMatAccordion\n * [(openIds)]=\"openIds\"\n * [panelIdFn]=\"idFromPanel\"\n * >\n * ```\n *\n * @playground Controlled open-set ./examples/bridge/bridge-example.component.ts\n * @category ui/mat-accordion\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-accordion/mat-accordion.directive.ts\n * @since 0.1.0\n * @relatedTo CngxAccordion, CngxAccordionItem, CngxMatStepper, CngxMatTabs\n */\n@Directive({\n selector: '[cngxMatAccordion]',\n exportAs: 'cngxMatAccordion',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxAccordion,\n inputs: ['multi', 'openIds'],\n outputs: ['openIdsChange'],\n },\n ],\n})\nexport class CngxMatAccordion {\n private readonly matAccordion = inject(MatAccordion, { self: true });\n /**\n * The accordion brain on this host element (declared in\n * `hostDirectives`). Same-host ownership - not a child→parent inject -\n * so it stays decompose-safe.\n */\n private readonly accordion = inject(CngxAccordion, { self: true });\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n private readonly panels = contentChildren(MatExpansionPanel, { descendants: true });\n\n // Ownership filter: `descendants: true` also surfaces panels of an\n // accordion nested inside one of OUR panels' bodies. Each panel\n // carries its owning `accordion` (public on CdkAccordionItem), so\n // foreign panels never enter the set-sync - the nested accordion\n // arbitrates its own children. Element-wise equal keeps downstream\n // effects quiet on identity-preserving query re-emissions.\n private readonly ownPanels = computed(\n () => this.panels().filter((panel) => panel.accordion === this.matAccordion),\n {\n equal: (a, b) => a.length === b.length && a.every((panel, i) => panel === b[i]),\n },\n );\n\n /**\n * Per-panel id hook. When bound, the returned key is what the\n * open-set stores for that panel - making a pre-populated\n * `[(openIds)]` model addressable (the generated\n * `cngx-mat-panel-N` ids are unknowable to consumers). The\n * function must return a stable, unique id per panel instance.\n * `MatExpansionPanel.id` is a readonly id the CDK generates, so it is\n * not known up front; key panels from your own data instead.\n * Unbound, ids fall back to generated `nextUid` values. Swapping\n * the bound function at runtime re-keys future events but does not\n * migrate ids already stored in `openIds` - bind it once.\n */\n readonly panelIdFn = input<((panel: MatExpansionPanel) => string) | undefined>(undefined);\n\n // Stable id per panel - the key the brain's open-set stores. A WeakMap:\n // the id is assigned first-seen and never needs enumeration, so a removed\n // panel's entry drops with the panel instead of accumulating over churn.\n private readonly idByPanel = new WeakMap<MatExpansionPanel, string>();\n\n constructor() {\n // Pin Material's own `multi` so it never arbitrates single-open: the\n // brain's `effectiveOpenIds` clamp is the sole arbiter. A single\n // `[multi]` binding on the host also sets `MatAccordion.multi`\n // (inherited from `CdkAccordion`); Angular applies that input during\n // change detection, so re-assert from an `effect` that flushes after\n // CD and re-runs whenever the consumer's `multi` changes.\n effect(() => {\n this.accordion.multi();\n untracked(() => {\n this.matAccordion.multi = true;\n });\n });\n\n createMatExpansionSetSync<MatExpansionPanel>({\n panels: this.ownPanels,\n panelId: (panel) => this.panelId(panel),\n accordion: this.accordion,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n }\n\n private panelId(panel: MatExpansionPanel): string {\n const idFn = this.panelIdFn();\n if (idFn !== undefined) {\n return idFn(panel);\n }\n let id = this.idByPanel.get(panel);\n if (id === undefined) {\n id = nextUid('cngx-mat-panel-');\n this.idByPanel.set(panel, id);\n }\n return id;\n }\n}\n","/**\n * @module @cngx/ui/mat-accordion\n *\n * Material instrumentation directive for `<mat-accordion>`: attach\n * `[cngxMatAccordion]` and it composes the same {@link CngxAccordion}\n * brain as `<cngx-accordion-group>` (in `@cngx/ui/accordion`) via\n * `hostDirectives`, so the controlled `[(openIds)]` group model and\n * single-open arbitration work against Material's own markup. Mirrors\n * `[cngxMatStepper]` / `[cngxMatTabs]`.\n */\nexport { CngxMatAccordion } from './mat-accordion.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;AACG,SAAU,yBAAyB,CACvC,IAAuC,EAAA;AAEvC,IAAA,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,IAAI;;;;;IAMjE,IAAI,iBAAiB,GAAG,KAAK;AAE7B,IAAA,MAAM,aAAa,GAAG,IAAI,GAAG,EAA8B;;;AAG3D,IAAA,MAAM,MAAM,GAAG,IAAI,OAAO,EAAK;AAE/B,IAAA,MAAM,qBAAqB,GAAG,CAAC,EAAU,EAAE,QAAiB,KAAU;QACpE,IAAI,iBAAiB,EAAE;YACrB;QACF;QACA,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,QAAQ,EAAE;YACrC;QACF;AACA,QAAA,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AACtB,IAAA,CAAC;AAED,IAAA,qBAAqB,CAAC,QAAQ,EAAE,MAAK;;QAEnC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