@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +224 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +194 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +314 -141
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -2,8 +2,9 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { signal, computed, InjectionToken, inject, DestroyRef, Injector, contentChildren, effect, untracked, Directive } from '@angular/core';
|
|
3
3
|
import { MatStepper, MatStep } from '@angular/material/stepper';
|
|
4
4
|
import * as i1 from '@cngx/common/stepper';
|
|
5
|
-
import { CNGX_STEPPER_HOST, CngxStepperPresenter } from '@cngx/common/stepper';
|
|
5
|
+
import { CNGX_STEPPER_HOST, injectStepperI18n, createStepperAnnouncementBuilders, CngxStepperPresenter } from '@cngx/common/stepper';
|
|
6
6
|
import { nextUid } from '@cngx/core/utils';
|
|
7
|
+
import { createOrderedRegistrationSeam, mountLiveRegionAnnouncer } from '@cngx/ui/mat-tabs';
|
|
7
8
|
import { createMaterialBidirectionalSync } from '@cngx/common/data';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -116,9 +117,12 @@ function readMatStepLabelTemplateText(template) {
|
|
|
116
117
|
* throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).
|
|
117
118
|
* Captures literal `matStepLabel` markup; dynamic interpolation
|
|
118
119
|
* bails through to (4).
|
|
119
|
-
* 4. `
|
|
120
|
-
* id
|
|
121
|
-
*
|
|
120
|
+
* 4. `CNGX_STEPPER_I18N.stepFallbackLabel(id)` (English default
|
|
121
|
+
* `Step <id>`) - deterministic, derived from the cngx handle id.
|
|
122
|
+
* Always non-empty. The `[cngxMatStepper]` directive passes its
|
|
123
|
+
* injected bundle Signal as `i18n`. This tier follows a runtime
|
|
124
|
+
* language switch.
|
|
125
|
+
* Documented limitation: runtime changes of tiers 1-3 do not propagate.
|
|
122
126
|
* CDK's `CdkStep` does not expose a `_stateChanges` Subject
|
|
123
127
|
* analogous to `MatTab._stateChanges`, so cngx cannot re-trigger
|
|
124
128
|
* the snapshot when Material flips the input later. Surface the
|
|
@@ -146,10 +150,12 @@ function readMatStepLabelTemplateText(template) {
|
|
|
146
150
|
*
|
|
147
151
|
* @category ui/mat-stepper
|
|
148
152
|
*/
|
|
149
|
-
function createMatStepHandle(matStep, idSeed) {
|
|
153
|
+
function createMatStepHandle(matStep, idSeed, i18n) {
|
|
150
154
|
const id = idSeed();
|
|
151
|
-
const labelText =
|
|
152
|
-
const label =
|
|
155
|
+
const labelText = resolveMaterialStepLabel(matStep);
|
|
156
|
+
const label = labelText !== null
|
|
157
|
+
? signal(labelText).asReadonly()
|
|
158
|
+
: computed(() => i18n().stepFallbackLabel(id));
|
|
153
159
|
const disabled = signal(false).asReadonly();
|
|
154
160
|
const state = computed(() => {
|
|
155
161
|
if (matStep.hasError) {
|
|
@@ -172,12 +178,13 @@ function createMatStepHandle(matStep, idSeed) {
|
|
|
172
178
|
};
|
|
173
179
|
}
|
|
174
180
|
/**
|
|
175
|
-
*
|
|
181
|
+
* Tiers 1-3 of the label fallback, walked once at registration time, or
|
|
182
|
+
* `null` when tier 4 (the i18n fallback) applies. See the
|
|
176
183
|
* {@link createMatStepHandle} JSDoc for the full ladder rationale.
|
|
177
184
|
*
|
|
178
185
|
* @internal
|
|
179
186
|
*/
|
|
180
|
-
function
|
|
187
|
+
function resolveMaterialStepLabel(matStep) {
|
|
181
188
|
const labelInput = matStep.label;
|
|
182
189
|
if (typeof labelInput === 'string' && labelInput.length > 0) {
|
|
183
190
|
return labelInput;
|
|
@@ -187,13 +194,14 @@ function resolveStepLabel(matStep, id) {
|
|
|
187
194
|
return ariaLabel;
|
|
188
195
|
}
|
|
189
196
|
const tpl = matStep.stepLabel?.template;
|
|
190
|
-
if (tpl) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
197
|
+
if (!tpl) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const text = readMatStepLabelTemplateText(tpl);
|
|
201
|
+
if (!text) {
|
|
202
|
+
return null;
|
|
195
203
|
}
|
|
196
|
-
return
|
|
204
|
+
return text;
|
|
197
205
|
}
|
|
198
206
|
/**
|
|
199
207
|
* DI token fronting the per-step handle factory used by the
|
|
@@ -219,8 +227,8 @@ function resolveStepLabel(matStep, id) {
|
|
|
219
227
|
* providers: [
|
|
220
228
|
* {
|
|
221
229
|
* provide: CNGX_MAT_STEP_HANDLE_FACTORY,
|
|
222
|
-
* useValue: ((step, idSeed) => {
|
|
223
|
-
* const setup = createMatStepHandle(step, idSeed);
|
|
230
|
+
* useValue: ((step, idSeed, i18n) => {
|
|
231
|
+
* const setup = createMatStepHandle(step, idSeed, i18n);
|
|
224
232
|
* reportStepRegistered(setup.handle.id);
|
|
225
233
|
* return setup;
|
|
226
234
|
* }) satisfies CngxMatStepHandleFactory,
|
|
@@ -254,6 +262,11 @@ const CNGX_MAT_STEP_HANDLE_FACTORY = new InjectionToken('CNGX_MAT_STEP_HANDLE_FA
|
|
|
254
262
|
* the consumer authors native `<mat-step>` markup; CNGX is the
|
|
255
263
|
* behaviour layer. Topology mirrors `[cngxMatTabs]`.
|
|
256
264
|
*
|
|
265
|
+
* Commit-lifecycle transitions speak: the shared announcement builder
|
|
266
|
+
* feeds the root live announcer (pending / landed / rolled-back
|
|
267
|
+
* phrases, identical to `<cngx-stepper>`), and the host carries
|
|
268
|
+
* `aria-busy="true"` while a commit is in flight.
|
|
269
|
+
*
|
|
257
270
|
* Inputs/outputs are forwarded from {@link CngxStepperPresenter}:
|
|
258
271
|
* - `activeStepIndex` (two-way, with `activeStepIndexChange`),
|
|
259
272
|
* - `linear`,
|
|
@@ -310,19 +323,44 @@ class CngxMatStepper {
|
|
|
310
323
|
destroyRef = inject(DestroyRef);
|
|
311
324
|
injector = inject(Injector);
|
|
312
325
|
matSteps = contentChildren(MatStep, { ...(ngDevMode ? { debugName: "matSteps" } : /* istanbul ignore next */ {}), descendants: true });
|
|
313
|
-
// Map not WeakMap - syncHandles needs to iterate to find removed steps.
|
|
314
|
-
setupsByStep = new Map();
|
|
315
326
|
createHandle = inject(CNGX_MAT_STEP_HANDLE_FACTORY);
|
|
327
|
+
i18n = injectStepperI18n();
|
|
328
|
+
// Shared with [cngxMatTabsRegistry]: the presenter registry appends
|
|
329
|
+
// new registrations, but Material renders steps at their DOM
|
|
330
|
+
// position - a mid-list <mat-step> insert must land at its query
|
|
331
|
+
// index, not at the tail. The seam re-registers the diverging
|
|
332
|
+
// suffix in query order while keeping surviving handle instances.
|
|
333
|
+
seam = createOrderedRegistrationSeam({
|
|
334
|
+
create: (step) => this.createHandle(step, () => nextUid('cngx-mat-step-'), this.i18n),
|
|
335
|
+
register: (setup) => this.presenter.register(setup.handle),
|
|
336
|
+
unregister: (setup) => this.presenter.unregister(setup.handle.id, setup.handle),
|
|
337
|
+
dispose: () => {
|
|
338
|
+
// Step setups carry no per-entry resources (no child injector).
|
|
339
|
+
},
|
|
340
|
+
});
|
|
316
341
|
constructor() {
|
|
317
342
|
effect(() => {
|
|
318
|
-
|
|
319
|
-
|
|
343
|
+
// Ownership filter: `descendants: true` also surfaces MatSteps of
|
|
344
|
+
// a stepper nested inside one of OUR steps' content. Each CdkStep
|
|
345
|
+
// carries its owning `_stepper` (public in the CDK typings), so
|
|
346
|
+
// foreign steps are dropped before they can register with this
|
|
347
|
+
// presenter.
|
|
348
|
+
const steps = this.matSteps().filter((step) => step._stepper === this.matStepper);
|
|
349
|
+
untracked(() => this.seam.sync(steps));
|
|
320
350
|
});
|
|
321
|
-
this.destroyRef.onDestroy(() =>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
351
|
+
this.destroyRef.onDestroy(() => this.seam.clear());
|
|
352
|
+
// Commit-lifecycle announcements (pending / landed / rolled-back).
|
|
353
|
+
// The shared builder computes the phrase; the shared announcer
|
|
354
|
+
// renders it - an attribute directive owns no template, so the
|
|
355
|
+
// polite region lives on the root CngxLiveAnnouncer, mirroring
|
|
356
|
+
// [cngxMatTabs].
|
|
357
|
+
mountLiveRegionAnnouncer({
|
|
358
|
+
announcement: createStepperAnnouncementBuilders({
|
|
359
|
+
presenter: this.presenter,
|
|
360
|
+
stepsOnly: this.presenter.stepsOnly,
|
|
361
|
+
i18n: this.i18n,
|
|
362
|
+
}).liveAnnouncement,
|
|
363
|
+
injector: this.injector,
|
|
326
364
|
});
|
|
327
365
|
createMatStepperBidirectionalSync({
|
|
328
366
|
matStepper: this.matStepper,
|
|
@@ -331,28 +369,8 @@ class CngxMatStepper {
|
|
|
331
369
|
destroyRef: this.destroyRef,
|
|
332
370
|
});
|
|
333
371
|
}
|
|
334
|
-
syncHandles(steps) {
|
|
335
|
-
const liveSteps = new Set(steps);
|
|
336
|
-
// Only fresh MatSteps get registered; cached ones survive untouched.
|
|
337
|
-
for (const step of steps) {
|
|
338
|
-
if (this.setupsByStep.has(step)) {
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
const setup = this.createHandle(step, () => nextUid('cngx-mat-step-'));
|
|
342
|
-
this.setupsByStep.set(step, setup);
|
|
343
|
-
this.presenter.register(setup.handle);
|
|
344
|
-
}
|
|
345
|
-
// Snapshot before iterating - guards against non-current-key deletes inside the body.
|
|
346
|
-
for (const [step, setup] of Array.from(this.setupsByStep.entries())) {
|
|
347
|
-
if (liveSteps.has(step)) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
this.setupsByStep.delete(step);
|
|
351
|
-
this.presenter.unregister(setup.handle.id);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
372
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMatStepper, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
355
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.4", type: CngxMatStepper, isStandalone: true, selector: "[cngxMatStepper]", queries: [{ propertyName: "matSteps", predicate: MatStep, descendants: true, isSignal: true }], exportAs: ["cngxMatStepper"], hostDirectives: [{ directive: i1.CngxStepperPresenter, inputs: ["activeStepIndex", "activeStepIndex", "linear", "linear", "orientation", "orientation", "commitAction", "commitAction", "commitMode", "commitMode"], outputs: ["activeStepIndexChange", "activeStepIndexChange"] }], ngImport: i0 });
|
|
373
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.2.4", type: CngxMatStepper, isStandalone: true, selector: "[cngxMatStepper]", host: { properties: { "attr.aria-busy": "presenter.busy() ? 'true' : null" } }, queries: [{ propertyName: "matSteps", predicate: MatStep, descendants: true, isSignal: true }], exportAs: ["cngxMatStepper"], hostDirectives: [{ directive: i1.CngxStepperPresenter, inputs: ["activeStepIndex", "activeStepIndex", "linear", "linear", "orientation", "orientation", "commitAction", "commitAction", "commitMode", "commitMode"], outputs: ["activeStepIndexChange", "activeStepIndexChange"] }], ngImport: i0 });
|
|
356
374
|
}
|
|
357
375
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMatStepper, decorators: [{
|
|
358
376
|
type: Directive,
|
|
@@ -367,6 +385,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
367
385
|
outputs: ['activeStepIndexChange'],
|
|
368
386
|
},
|
|
369
387
|
],
|
|
388
|
+
host: {
|
|
389
|
+
// Communicated busy-state while a commit is in flight - same
|
|
390
|
+
// strict 'pending' gate the cngx-native organism uses per step.
|
|
391
|
+
'[attr.aria-busy]': "presenter.busy() ? 'true' : null",
|
|
392
|
+
},
|
|
370
393
|
}]
|
|
371
394
|
}], ctorParameters: () => [], propDecorators: { matSteps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => MatStep), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
372
395
|
|
|
@@ -379,6 +402,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
379
402
|
* as `<cngx-stepper>` (in `@cngx/ui/stepper`) via `hostDirectives`, so
|
|
380
403
|
* commit-action lifecycle, router sync, and error aggregation all work
|
|
381
404
|
* against Material's own markup. Mirrors `[cngxMatTabs]`.
|
|
405
|
+
*
|
|
406
|
+
* @module @cngx/ui/mat-stepper
|
|
382
407
|
*/
|
|
383
408
|
|
|
384
409
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui-mat-stepper.mjs","sources":["../../../projects/ui/mat-stepper/material-bridge/bidirectional-sync.ts","../../../projects/ui/mat-stepper/material-bridge/handle.ts","../../../projects/ui/mat-stepper/mat-stepper.directive.ts","../../../projects/ui/mat-stepper/public-api.ts","../../../projects/ui/mat-stepper/cngx-ui-mat-stepper.ts"],"sourcesContent":["import type { DestroyRef, Injector } from '@angular/core';\nimport type { MatStepper } from '@angular/material/stepper';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport type { CngxStepperHost } from '@cngx/common/stepper';\n\n/**\n * Options for {@link createMatStepperBidirectionalSync}.\n *\n * @internal\n */\nexport interface CngxMatStepperBidirectionalSyncOptions {\n /** Material stepper the helper bridges against. */\n readonly matStepper: MatStepper;\n /** cngx stepper presenter - write target for Material→presenter. */\n readonly presenter: CngxStepperHost;\n /** Injection context for the underlying `effect()` in `@cngx/common/data`. */\n readonly injector: Injector;\n /**\n * Destroy ref the underlying subscriber teardown attaches to.\n * Same lifetime as the host directive / component.\n */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Stepper-specific glue over {@link createMaterialBidirectionalSync}\n * (`@cngx/common/data`). Both `<cngx-mat-stepper>` (Component) and\n * `[cngxMatStepper]` (Directive) need to install the same\n * presenter↔Material `selectedIndex` sync; the option-mapping body\n * was identical at both call sites - same `presenterIndex`, same\n * `readSelectedIndex` / `writeSelectedIndex` shape, same\n * `selectedIndexChange.asObservable()` source, same\n * `onMaterialSelection` write-back. This helper is the single entry\n * point: each call site reduces to one line.\n *\n * Behaviour stays identical to the prior inline blocks - the helper\n * is a pure shape-adapter, no policy. The underlying generic factory\n * owns:\n * - presenter→Material `effect()` with read-equality guard.\n * - Material→presenter subscription with re-entrancy guard.\n * - Material-eager-advance reconciliation (Material's MDC click\n * handler advances `selectedIndex` synchronously before the\n * bidirectional sync sees the event).\n * - `destroyRef` cleanup of both directions.\n *\n * @internal\n */\nexport function createMatStepperBidirectionalSync(\n opts: CngxMatStepperBidirectionalSyncOptions,\n): void {\n createMaterialBidirectionalSync({\n presenterIndex: opts.presenter.activeStepIndex,\n readSelectedIndex: () => opts.matStepper.selectedIndex,\n writeSelectedIndex: (i) => {\n opts.matStepper.selectedIndex = i;\n },\n // `MatStepper.selectedIndexChange` emits a plain index - no adapter needed,\n // unlike `MatTabGroup.selectedIndexChange`.\n selectionChange$: opts.matStepper.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => opts.presenter.select(i),\n injector: opts.injector,\n destroyRef: opts.destroyRef,\n });\n}\n","import { computed, InjectionToken, signal, type Signal, type TemplateRef } from '@angular/core';\nimport type { MatStep } from '@angular/material/stepper';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport type { CngxStepRegistration, CngxStepStatus } from '@cngx/common/stepper';\n\n/**\n * Shared `signal(undefined)` constant used as the `errorAggregator`\n * slot for every Material-instrumented step handle. The\n * instrumentation path does not bind cngx error-aggregation per\n * `MatStep` - Material's own visual error surface (driven by\n * `MatStep.hasError` / `MatStep.optional`) stays authoritative - so\n * per-step allocation of a writable signal would be dead capacity.\n *\n * @internal\n */\nconst NO_ERROR_AGGREGATOR: Signal<CngxErrorAggregatorContract | undefined> = signal<\n CngxErrorAggregatorContract | undefined\n>(undefined).asReadonly();\n\n/**\n * Wiring bundle returned from {@link createMatStepHandle}. The\n * instrumentation directive holds the bundle in a `Map<MatStep,\n * Setup>` for diff-only registry churn; only `handle` is exposed to\n * the presenter.\n */\nexport interface CngxMatStepHandleSetup {\n readonly handle: CngxStepRegistration;\n}\n\n/**\n * Best-effort static-text extraction from a `<ng-template matStepLabel>`\n * `TemplateRef`. Used as a label fallback when consumers project a\n * template label without setting `MatStep.label` or\n * `MatStep.ariaLabel` - without it the cngx-side label slot would\n * be empty, leaving aria-label phrases that include the step label\n * with a measurable gap on the Material variant. Static markup\n * (`<ng-template matStepLabel>Review</ng-template>`) extracts cleanly\n * via a detached embedded view; templates with dynamic interpolation\n * fall through (the detached view's CD has no consumer-context\n * bindings) and the caller's deterministic id-based fallback wins.\n *\n * Idempotent: never mutates the source template; the embedded view is\n * created and destroyed inside one frame's worth of synchronous work.\n *\n * @internal\n */\nfunction readMatStepLabelTemplateText(template: TemplateRef<unknown>): string | undefined {\n try {\n const view = template.createEmbeddedView({});\n try {\n view.detectChanges();\n const text = view.rootNodes\n .map((node: Node) => node.textContent ?? '')\n .join('')\n .trim();\n return text || undefined;\n } finally {\n view.destroy();\n }\n } catch {\n return undefined;\n }\n}\n\n/**\n * Translates a Material `MatStep` into a cngx\n * {@link CngxStepRegistration}.\n *\n * - `id` - always a fresh `idSeed()` value. Mirrors the tabs\n * instrumentation handle: a label-keyed id would collide when\n * two steps share a label.\n * - `kind` - fixed at `'step'`. The instrumentation path does not\n * project nested `<mat-step>` groups (Material's stepper has no\n * group-of-steps concept; group-aware semantics belong to the\n * `<cngx-stepper>` thin-wrapper organism).\n * - `label` - snapshot signal resolved through a four-tier fallback at\n * registration time so cngx-side phrases (announcements,\n * `aria-label` composition, telemetry) never read empty when\n * Material consumers project a `<ng-template matStepLabel>`:\n * 1. `MatStep.label` when it is a plain string - the canonical\n * shape and the only one that emits a runtime change Material\n * itself observes.\n * 2. `MatStep.ariaLabel` when the consumer set the input -\n * designed exactly as the substitute for template labels.\n * 3. Static-text read from `MatStep.stepLabel.template` via a\n * throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).\n * Captures literal `matStepLabel` markup; dynamic interpolation\n * bails through to (4).\n * 4. `Step <id>` - deterministic, derived from the cngx handle\n * id. Always non-empty.\n * Documented limitation: runtime label changes do not propagate.\n * CDK's `CdkStep` does not expose a `_stateChanges` Subject\n * analogous to `MatTab._stateChanges`, so cngx cannot re-trigger\n * the snapshot when Material flips the input later. Surface the\n * same Material-internal coupling family typed in\n * `MaterialPrivateSurfaces.CompletedOverrideSource`.\n * - `disabled` - fixed `false`. Material owns step gating via\n * `linear` + `editable` + `completed`; surfacing a cngx-side\n * `disabled` would duplicate Material's own click-time enforcement\n * and is ignored by `<mat-stepper>` itself.\n * - `state` - `computed()` over `MatStep.hasError` / `MatStep.completed`.\n * `CdkStep.completed`'s getter reads `_completedOverride()` - a\n * `WritableSignal<boolean | null>` typed in\n * `MaterialPrivateSurfaces.CompletedOverrideSource`. The cngx\n * computed transitively tracks that signal through the getter and\n * re-fires whenever Material flips completion. `hasError` is a\n * plain property setter on `CdkStep`, NOT a Signal - a `hasError`\n * write that is not paired with a `completed` change does not\n * re-trigger this computed. In practice Material wizards write the\n * two together (`step.hasError = true; step.completed = false` in\n * error-handler patterns and inside Material's own error-state\n * matchers) so the limitation is benign for the documented usage\n * pattern.\n * - `errorAggregator` - points at the shared\n * {@link NO_ERROR_AGGREGATOR} constant.\n *\n * @category ui/mat-stepper\n */\nexport function createMatStepHandle(\n matStep: MatStep,\n idSeed: () => string,\n): CngxMatStepHandleSetup {\n const id = idSeed();\n const labelText = resolveStepLabel(matStep, id);\n const label = signal<string>(labelText).asReadonly();\n const disabled = signal<boolean>(false).asReadonly();\n const state = computed<CngxStepStatus>(() => {\n if (matStep.hasError) {\n return 'error';\n }\n if (matStep.completed) {\n return 'success';\n }\n return 'idle';\n });\n return {\n handle: {\n id,\n kind: 'step',\n label,\n disabled,\n state,\n errorAggregator: NO_ERROR_AGGREGATOR,\n },\n };\n}\n\n/**\n * Four-tier label fallback walked once at registration time. See the\n * {@link createMatStepHandle} JSDoc for the full ladder rationale.\n *\n * @internal\n */\nfunction resolveStepLabel(matStep: MatStep, id: string): string {\n const labelInput = matStep.label;\n if (typeof labelInput === 'string' && labelInput.length > 0) {\n return labelInput;\n }\n const ariaLabel = matStep.ariaLabel;\n if (typeof ariaLabel === 'string' && ariaLabel.length > 0) {\n return ariaLabel;\n }\n const tpl = matStep.stepLabel?.template;\n if (tpl) {\n const text = readMatStepLabelTemplateText(tpl);\n if (text) {\n return text;\n }\n }\n return `Step ${id}`;\n}\n\n/**\n * Factory signature for {@link createMatStepHandle}. The DI token\n * {@link CNGX_MAT_STEP_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * @category ui/mat-stepper\n */\nexport type CngxMatStepHandleFactory = typeof createMatStepHandle;\n\n/**\n * DI token fronting the per-step handle factory used by the\n * `[cngxMatStepper]` instrumentation directive. Default is\n * {@link createMatStepHandle}.\n *\n * Symmetric with the tabs sibling\n * `CNGX_MAT_TAB_HANDLE_FACTORY` and with `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`\n * - every Material-bridge logic block ships the same swap surface so\n * consumers can layer telemetry, alternate id strategies, or\n * test-environment id keying via `providers` / `viewProviders`\n * without forking the directive.\n *\n * Override capability - the swap surface separates **handle shape**\n * (factory body) from **id keying** (the supplied `idSeed` closure).\n * The directive constructs `idSeed` as `() => nextUid('cngx-mat-step-')`\n * and hands it to the factory as a default suggestion; an override is\n * free to call it, ignore it, or replace it with a server-synced /\n * deterministic-test / consumer-domain id strategy. Both axes are\n * independently swappable from one DI seam.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_STEP_HANDLE_FACTORY,\n * useValue: ((step, idSeed) => {\n * const setup = createMatStepHandle(step, idSeed);\n * reportStepRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatStepHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_STEP_HANDLE_FACTORY = new InjectionToken<CngxMatStepHandleFactory>(\n 'CNGX_MAT_STEP_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatStepHandle,\n },\n);\n","import {\n contentChildren,\n type DestroyRef,\n Directive,\n effect,\n inject,\n type Injector,\n untracked,\n DestroyRef as InjectableDestroyRef,\n Injector as InjectableInjector,\n} from '@angular/core';\nimport { MatStep, MatStepper } from '@angular/material/stepper';\n\nimport { CNGX_STEPPER_HOST, CngxStepperPresenter } from '@cngx/common/stepper';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { createMatStepperBidirectionalSync } from './material-bridge/bidirectional-sync';\nimport {\n CNGX_MAT_STEP_HANDLE_FACTORY,\n type CngxMatStepHandleSetup,\n} from './material-bridge/handle';\n\n/**\n * The Material twin of the CNGX stepper: attach `cngxMatStepper` to a\n * vanilla `<mat-stepper>` and it is bridged to a\n * {@link CngxStepperPresenter}. \\\n * Consumers gain the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` /\n * `<cngx-banner-on />` compose as children), the shared\n * `CNGX_STEPPER_HOST` contract (so a `<cngx-stepper-footer>` can drive\n * Back / Next instead of Material's own buttons via\n * `[host]=\"ref.presenter\"`), and the step-handle registry - all from\n * one attribute.\n *\n * This is the instrumentation pattern: Material owns the rendering and\n * the consumer authors native `<mat-step>` markup; CNGX is the\n * behaviour layer. Topology mirrors `[cngxMatTabs]`.\n *\n * Inputs/outputs are forwarded from {@link CngxStepperPresenter}:\n * - `activeStepIndex` (two-way, with `activeStepIndexChange`),\n * - `linear`,\n * - `orientation`,\n * - `commitAction`,\n * - `commitMode`. \\\n * See the presenter for their semantics.\n * ```html\n * <mat-stepper\n * cngxMatStepper\n * #s=\"cngxMatStepper\"\n * [(activeStepIndex)]=\"active\"\n * [commitAction]=\"commitAction\"\n * [commitMode]=\"mode()\"\n * cngxToastOn\n * [toastError]=\"'Step transition failed'\"\n * cngxBannerOn\n * bannerId=\"stepper:commit-error\"\n * [bannerError]=\"'The server rejected the step change.'\"\n * aria-label=\"Account setup\"\n * >\n * <mat-step label=\"Personal info\">\n * <p>Tell us who you are.</p>\n * </mat-step>\n * <mat-step\n * label=\"Account\"\n * [hasError]=\"!accepted()\"\n * errorMessage=\"Accept the terms to continue\"\n * >\n * <p>Choose your sign-in method.</p>\n * </mat-step>\n * <mat-step label=\"Confirm\">\n * <p>Review everything, then finish.</p>\n * </mat-step>\n * </mat-stepper>\n * ```\n * @playground Bridge instrumentation ./examples/bridge/bridge-example.component.ts\n *\n * @category ui/mat-stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/mat-stepper.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepper, CngxStepperPresenter, CngxMatTabs, CngxStepperFooter\n */\n@Directive({\n selector: '[cngxMatStepper]',\n exportAs: 'cngxMatStepper',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxStepperPresenter,\n inputs: ['activeStepIndex', 'linear', 'orientation', 'commitAction', 'commitMode'],\n outputs: ['activeStepIndexChange'],\n },\n ],\n})\nexport class CngxMatStepper {\n private readonly matStepper = inject(MatStepper, { self: true });\n /**\n * Shared host contract. Public so a `<cngx-stepper-footer>` placed\n * outside the `<mat-stepper>` can bind `[host]=\"ref.presenter\"` (via\n * `#ref=\"cngxMatStepper\"`) and drive navigation.\n */\n readonly presenter = inject(CNGX_STEPPER_HOST);\n private readonly destroyRef: DestroyRef = inject(InjectableDestroyRef);\n private readonly injector: Injector = inject(InjectableInjector);\n\n private readonly matSteps = contentChildren(MatStep, { descendants: true });\n // Map not WeakMap - syncHandles needs to iterate to find removed steps.\n private readonly setupsByStep = new Map<MatStep, CngxMatStepHandleSetup>();\n private readonly createHandle = inject(CNGX_MAT_STEP_HANDLE_FACTORY);\n\n constructor() {\n effect(() => {\n const steps = this.matSteps();\n untracked(() => this.syncHandles(steps));\n });\n\n this.destroyRef.onDestroy(() => {\n for (const setup of this.setupsByStep.values()) {\n this.presenter.unregister(setup.handle.id);\n }\n this.setupsByStep.clear();\n });\n\n createMatStepperBidirectionalSync({\n matStepper: this.matStepper,\n presenter: this.presenter,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n }\n\n private syncHandles(steps: readonly MatStep[]): void {\n const liveSteps = new Set<MatStep>(steps);\n\n // Only fresh MatSteps get registered; cached ones survive untouched.\n for (const step of steps) {\n if (this.setupsByStep.has(step)) {\n continue;\n }\n const setup = this.createHandle(step, () => nextUid('cngx-mat-step-'));\n this.setupsByStep.set(step, setup);\n this.presenter.register(setup.handle);\n }\n\n // Snapshot before iterating - guards against non-current-key deletes inside the body.\n for (const [step, setup] of Array.from(this.setupsByStep.entries())) {\n if (liveSteps.has(step)) {\n continue;\n }\n this.setupsByStep.delete(step);\n this.presenter.unregister(setup.handle.id);\n }\n }\n}\n","/**\n * Public API surface of `@cngx/ui/mat-stepper`.\n *\n * The Material twin of the cngx stepper family, shipped as the\n * instrumentation directive `[cngxMatStepper]`: attach it to a vanilla\n * `<mat-stepper>` and it composes the same `CngxStepperPresenter` brain\n * as `<cngx-stepper>` (in `@cngx/ui/stepper`) via `hostDirectives`, so\n * commit-action lifecycle, router sync, and error aggregation all work\n * against Material's own markup. Mirrors `[cngxMatTabs]`.\n */\nexport { CngxMatStepper } from './mat-stepper.directive';\nexport {\n CNGX_MAT_STEP_HANDLE_FACTORY,\n createMatStepHandle,\n type CngxMatStepHandleFactory,\n} from './material-bridge/handle';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["InjectableDestroyRef","InjectableInjector"],"mappings":";;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,iCAAiC,CAC/C,IAA4C,EAAA;AAE5C,IAAA,+BAA+B,CAAC;AAC9B,QAAA,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe;QAC9C,iBAAiB,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa;AACtD,QAAA,kBAAkB,EAAE,CAAC,CAAC,KAAI;AACxB,YAAA,IAAI,CAAC,UAAU,CAAC,aAAa,GAAG,CAAC;QACnC,CAAC;;;QAGD,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,YAAY,EAAE;AACpE,QAAA,mBAAmB,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QACpD,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,UAAU,EAAE,IAAI,CAAC,UAAU;AAC5B,KAAA,CAAC;AACJ;;AC1DA;;;;;;;;;AASG;AACH,MAAM,mBAAmB,GAAoD,MAAM,CAEjF,SAAS,CAAC,CAAC,UAAU,EAAE;AAYzB;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,4BAA4B,CAAC,QAA8B,EAAA;AAClE,IAAA,IAAI;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC5C,QAAA,IAAI;YACF,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AY,CAAC;4BAClF,OAAO,EAAE,CAAC,uBAAuB,CAAC;AACnC,yBAAA;AACF,qBAAA;AACF,iBAAA;AAY6C,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,OAAO,CAAA,EAAA,EAAA,GAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC1G5E;;;;;;;;;AASG;;ACTH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-ui-mat-stepper.mjs","sources":["../../../projects/ui/mat-stepper/material-bridge/bidirectional-sync.ts","../../../projects/ui/mat-stepper/material-bridge/handle.ts","../../../projects/ui/mat-stepper/mat-stepper.directive.ts","../../../projects/ui/mat-stepper/public-api.ts","../../../projects/ui/mat-stepper/cngx-ui-mat-stepper.ts"],"sourcesContent":["import type { DestroyRef, Injector } from '@angular/core';\nimport type { MatStepper } from '@angular/material/stepper';\n\nimport { createMaterialBidirectionalSync } from '@cngx/common/data';\nimport type { CngxStepperHost } from '@cngx/common/stepper';\n\n/**\n * Options for {@link createMatStepperBidirectionalSync}.\n *\n * @internal\n */\nexport interface CngxMatStepperBidirectionalSyncOptions {\n /** Material stepper the helper bridges against. */\n readonly matStepper: MatStepper;\n /** cngx stepper presenter - write target for Material→presenter. */\n readonly presenter: CngxStepperHost;\n /** Injection context for the underlying `effect()` in `@cngx/common/data`. */\n readonly injector: Injector;\n /**\n * Destroy ref the underlying subscriber teardown attaches to.\n * Same lifetime as the host directive / component.\n */\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Stepper-specific glue over {@link createMaterialBidirectionalSync}\n * (`@cngx/common/data`). Both `<cngx-mat-stepper>` (Component) and\n * `[cngxMatStepper]` (Directive) need to install the same\n * presenter↔Material `selectedIndex` sync; the option-mapping body\n * was identical at both call sites - same `presenterIndex`, same\n * `readSelectedIndex` / `writeSelectedIndex` shape, same\n * `selectedIndexChange.asObservable()` source, same\n * `onMaterialSelection` write-back. This helper is the single entry\n * point: each call site reduces to one line.\n *\n * Behaviour stays identical to the prior inline blocks - the helper\n * is a pure shape-adapter, no policy. The underlying generic factory\n * owns:\n * - presenter→Material `effect()` with read-equality guard.\n * - Material→presenter subscription with re-entrancy guard.\n * - Material-eager-advance reconciliation (Material's MDC click\n * handler advances `selectedIndex` synchronously before the\n * bidirectional sync sees the event).\n * - `destroyRef` cleanup of both directions.\n *\n * @internal\n */\nexport function createMatStepperBidirectionalSync(\n opts: CngxMatStepperBidirectionalSyncOptions,\n): void {\n createMaterialBidirectionalSync({\n presenterIndex: opts.presenter.activeStepIndex,\n readSelectedIndex: () => opts.matStepper.selectedIndex,\n writeSelectedIndex: (i) => {\n opts.matStepper.selectedIndex = i;\n },\n // `MatStepper.selectedIndexChange` emits a plain index - no adapter needed,\n // unlike `MatTabGroup.selectedIndexChange`.\n selectionChange$: opts.matStepper.selectedIndexChange.asObservable(),\n onMaterialSelection: (i) => opts.presenter.select(i),\n injector: opts.injector,\n destroyRef: opts.destroyRef,\n });\n}\n","import { computed, InjectionToken, signal, type Signal, type TemplateRef } from '@angular/core';\nimport type { MatStep } from '@angular/material/stepper';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\nimport {\n type CngxStepperI18n,\n type CngxStepRegistration,\n type CngxStepStatus,\n} from '@cngx/common/stepper';\n\n/**\n * Shared `signal(undefined)` constant used as the `errorAggregator`\n * slot for every Material-instrumented step handle. The\n * instrumentation path does not bind cngx error-aggregation per\n * `MatStep` - Material's own visual error surface (driven by\n * `MatStep.hasError` / `MatStep.optional`) stays authoritative - so\n * per-step allocation of a writable signal would be dead capacity.\n *\n * @internal\n */\nconst NO_ERROR_AGGREGATOR: Signal<CngxErrorAggregatorContract | undefined> = signal<\n CngxErrorAggregatorContract | undefined\n>(undefined).asReadonly();\n\n/**\n * Wiring bundle returned from {@link createMatStepHandle}. The\n * instrumentation directive holds the bundle in a `Map<MatStep,\n * Setup>` for diff-only registry churn; only `handle` is exposed to\n * the presenter.\n */\nexport interface CngxMatStepHandleSetup {\n readonly handle: CngxStepRegistration;\n}\n\n/**\n * Best-effort static-text extraction from a `<ng-template matStepLabel>`\n * `TemplateRef`. Used as a label fallback when consumers project a\n * template label without setting `MatStep.label` or\n * `MatStep.ariaLabel` - without it the cngx-side label slot would\n * be empty, leaving aria-label phrases that include the step label\n * with a measurable gap on the Material variant. Static markup\n * (`<ng-template matStepLabel>Review</ng-template>`) extracts cleanly\n * via a detached embedded view; templates with dynamic interpolation\n * fall through (the detached view's CD has no consumer-context\n * bindings) and the caller's deterministic id-based fallback wins.\n *\n * Idempotent: never mutates the source template; the embedded view is\n * created and destroyed inside one frame's worth of synchronous work.\n *\n * @internal\n */\nfunction readMatStepLabelTemplateText(template: TemplateRef<unknown>): string | undefined {\n try {\n const view = template.createEmbeddedView({});\n try {\n view.detectChanges();\n const text = view.rootNodes\n .map((node: Node) => node.textContent ?? '')\n .join('')\n .trim();\n return text || undefined;\n } finally {\n view.destroy();\n }\n } catch {\n return undefined;\n }\n}\n\n/**\n * Translates a Material `MatStep` into a cngx\n * {@link CngxStepRegistration}.\n *\n * - `id` - always a fresh `idSeed()` value. Mirrors the tabs\n * instrumentation handle: a label-keyed id would collide when\n * two steps share a label.\n * - `kind` - fixed at `'step'`. The instrumentation path does not\n * project nested `<mat-step>` groups (Material's stepper has no\n * group-of-steps concept; group-aware semantics belong to the\n * `<cngx-stepper>` thin-wrapper organism).\n * - `label` - snapshot signal resolved through a four-tier fallback at\n * registration time so cngx-side phrases (announcements,\n * `aria-label` composition, telemetry) never read empty when\n * Material consumers project a `<ng-template matStepLabel>`:\n * 1. `MatStep.label` when it is a plain string - the canonical\n * shape and the only one that emits a runtime change Material\n * itself observes.\n * 2. `MatStep.ariaLabel` when the consumer set the input -\n * designed exactly as the substitute for template labels.\n * 3. Static-text read from `MatStep.stepLabel.template` via a\n * throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).\n * Captures literal `matStepLabel` markup; dynamic interpolation\n * bails through to (4).\n * 4. `CNGX_STEPPER_I18N.stepFallbackLabel(id)` (English default\n * `Step <id>`) - deterministic, derived from the cngx handle id.\n * Always non-empty. The `[cngxMatStepper]` directive passes its\n * injected bundle Signal as `i18n`. This tier follows a runtime\n * language switch.\n * Documented limitation: runtime changes of tiers 1-3 do not propagate.\n * CDK's `CdkStep` does not expose a `_stateChanges` Subject\n * analogous to `MatTab._stateChanges`, so cngx cannot re-trigger\n * the snapshot when Material flips the input later. Surface the\n * same Material-internal coupling family typed in\n * `MaterialPrivateSurfaces.CompletedOverrideSource`.\n * - `disabled` - fixed `false`. Material owns step gating via\n * `linear` + `editable` + `completed`; surfacing a cngx-side\n * `disabled` would duplicate Material's own click-time enforcement\n * and is ignored by `<mat-stepper>` itself.\n * - `state` - `computed()` over `MatStep.hasError` / `MatStep.completed`.\n * `CdkStep.completed`'s getter reads `_completedOverride()` - a\n * `WritableSignal<boolean | null>` typed in\n * `MaterialPrivateSurfaces.CompletedOverrideSource`. The cngx\n * computed transitively tracks that signal through the getter and\n * re-fires whenever Material flips completion. `hasError` is a\n * plain property setter on `CdkStep`, NOT a Signal - a `hasError`\n * write that is not paired with a `completed` change does not\n * re-trigger this computed. In practice Material wizards write the\n * two together (`step.hasError = true; step.completed = false` in\n * error-handler patterns and inside Material's own error-state\n * matchers) so the limitation is benign for the documented usage\n * pattern.\n * - `errorAggregator` - points at the shared\n * {@link NO_ERROR_AGGREGATOR} constant.\n *\n * @category ui/mat-stepper\n */\nexport function createMatStepHandle(\n matStep: MatStep,\n idSeed: () => string,\n i18n: Signal<CngxStepperI18n>,\n): CngxMatStepHandleSetup {\n const id = idSeed();\n const labelText = resolveMaterialStepLabel(matStep);\n const label =\n labelText !== null\n ? signal<string>(labelText).asReadonly()\n : computed<string>(() => i18n().stepFallbackLabel(id));\n const disabled = signal<boolean>(false).asReadonly();\n const state = computed<CngxStepStatus>(() => {\n if (matStep.hasError) {\n return 'error';\n }\n if (matStep.completed) {\n return 'success';\n }\n return 'idle';\n });\n return {\n handle: {\n id,\n kind: 'step',\n label,\n disabled,\n state,\n errorAggregator: NO_ERROR_AGGREGATOR,\n },\n };\n}\n\n/**\n * Tiers 1-3 of the label fallback, walked once at registration time, or\n * `null` when tier 4 (the i18n fallback) applies. See the\n * {@link createMatStepHandle} JSDoc for the full ladder rationale.\n *\n * @internal\n */\nfunction resolveMaterialStepLabel(matStep: MatStep): string | null {\n const labelInput = matStep.label;\n if (typeof labelInput === 'string' && labelInput.length > 0) {\n return labelInput;\n }\n const ariaLabel = matStep.ariaLabel;\n if (typeof ariaLabel === 'string' && ariaLabel.length > 0) {\n return ariaLabel;\n }\n const tpl = matStep.stepLabel?.template;\n if (!tpl) {\n return null;\n }\n const text = readMatStepLabelTemplateText(tpl);\n if (!text) {\n return null;\n }\n return text;\n}\n\n/**\n * Factory signature for {@link createMatStepHandle}. The DI token\n * {@link CNGX_MAT_STEP_HANDLE_FACTORY} resolves to a function with\n * this exact shape - overrides match it identically.\n *\n * The third argument is the stepper i18n Signal the directive injected;\n * it carries the last-resort label (`stepFallbackLabel`). Forward it when\n * delegating to {@link createMatStepHandle}.\n *\n * @category ui/mat-stepper\n */\nexport type CngxMatStepHandleFactory = typeof createMatStepHandle;\n\n/**\n * DI token fronting the per-step handle factory used by the\n * `[cngxMatStepper]` instrumentation directive. Default is\n * {@link createMatStepHandle}.\n *\n * Symmetric with the tabs sibling\n * `CNGX_MAT_TAB_HANDLE_FACTORY` and with `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`\n * - every Material-bridge logic block ships the same swap surface so\n * consumers can layer telemetry, alternate id strategies, or\n * test-environment id keying via `providers` / `viewProviders`\n * without forking the directive.\n *\n * Override capability - the swap surface separates **handle shape**\n * (factory body) from **id keying** (the supplied `idSeed` closure).\n * The directive constructs `idSeed` as `() => nextUid('cngx-mat-step-')`\n * and hands it to the factory as a default suggestion; an override is\n * free to call it, ignore it, or replace it with a server-synced /\n * deterministic-test / consumer-domain id strategy. Both axes are\n * independently swappable from one DI seam.\n *\n * ```ts\n * providers: [\n * {\n * provide: CNGX_MAT_STEP_HANDLE_FACTORY,\n * useValue: ((step, idSeed, i18n) => {\n * const setup = createMatStepHandle(step, idSeed, i18n);\n * reportStepRegistered(setup.handle.id);\n * return setup;\n * }) satisfies CngxMatStepHandleFactory,\n * },\n * ]\n * ```\n *\n * @category ui/mat-stepper\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/material-bridge/handle.ts\n * @since 0.1.0\n */\nexport const CNGX_MAT_STEP_HANDLE_FACTORY = new InjectionToken<CngxMatStepHandleFactory>(\n 'CNGX_MAT_STEP_HANDLE_FACTORY',\n {\n providedIn: 'root',\n factory: () => createMatStepHandle,\n },\n);\n","import {\n contentChildren,\n type DestroyRef,\n Directive,\n effect,\n inject,\n type Injector,\n untracked,\n DestroyRef as InjectableDestroyRef,\n Injector as InjectableInjector,\n} from '@angular/core';\nimport { MatStep, MatStepper } from '@angular/material/stepper';\n\nimport {\n CNGX_STEPPER_HOST,\n CngxStepperPresenter,\n createStepperAnnouncementBuilders,\n injectStepperI18n,\n} from '@cngx/common/stepper';\nimport { nextUid } from '@cngx/core/utils';\n\nimport { createOrderedRegistrationSeam, mountLiveRegionAnnouncer } from '@cngx/ui/mat-tabs';\nimport { createMatStepperBidirectionalSync } from './material-bridge/bidirectional-sync';\nimport {\n CNGX_MAT_STEP_HANDLE_FACTORY,\n type CngxMatStepHandleSetup,\n} from './material-bridge/handle';\n\n/**\n * The Material twin of the CNGX stepper: attach `cngxMatStepper` to a\n * vanilla `<mat-stepper>` and it is bridged to a\n * {@link CngxStepperPresenter}. \\\n * Consumers gain the commit-action\n * lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` /\n * `<cngx-banner-on />` compose as children), the shared\n * `CNGX_STEPPER_HOST` contract (so a `<cngx-stepper-footer>` can drive\n * Back / Next instead of Material's own buttons via\n * `[host]=\"ref.presenter\"`), and the step-handle registry - all from\n * one attribute.\n *\n * This is the instrumentation pattern: Material owns the rendering and\n * the consumer authors native `<mat-step>` markup; CNGX is the\n * behaviour layer. Topology mirrors `[cngxMatTabs]`.\n *\n * Commit-lifecycle transitions speak: the shared announcement builder\n * feeds the root live announcer (pending / landed / rolled-back\n * phrases, identical to `<cngx-stepper>`), and the host carries\n * `aria-busy=\"true\"` while a commit is in flight.\n *\n * Inputs/outputs are forwarded from {@link CngxStepperPresenter}:\n * - `activeStepIndex` (two-way, with `activeStepIndexChange`),\n * - `linear`,\n * - `orientation`,\n * - `commitAction`,\n * - `commitMode`. \\\n * See the presenter for their semantics.\n * ```html\n * <mat-stepper\n * cngxMatStepper\n * #s=\"cngxMatStepper\"\n * [(activeStepIndex)]=\"active\"\n * [commitAction]=\"commitAction\"\n * [commitMode]=\"mode()\"\n * cngxToastOn\n * [toastError]=\"'Step transition failed'\"\n * cngxBannerOn\n * bannerId=\"stepper:commit-error\"\n * [bannerError]=\"'The server rejected the step change.'\"\n * aria-label=\"Account setup\"\n * >\n * <mat-step label=\"Personal info\">\n * <p>Tell us who you are.</p>\n * </mat-step>\n * <mat-step\n * label=\"Account\"\n * [hasError]=\"!accepted()\"\n * errorMessage=\"Accept the terms to continue\"\n * >\n * <p>Choose your sign-in method.</p>\n * </mat-step>\n * <mat-step label=\"Confirm\">\n * <p>Review everything, then finish.</p>\n * </mat-step>\n * </mat-stepper>\n * ```\n * @playground Bridge instrumentation ./examples/bridge/bridge-example.component.ts\n *\n * @category ui/mat-stepper\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/mat-stepper.directive.ts\n * @since 0.1.0\n * @relatedTo CngxStepper, CngxStepperPresenter, CngxMatTabs, CngxStepperFooter\n */\n@Directive({\n selector: '[cngxMatStepper]',\n exportAs: 'cngxMatStepper',\n standalone: true,\n hostDirectives: [\n {\n directive: CngxStepperPresenter,\n inputs: ['activeStepIndex', 'linear', 'orientation', 'commitAction', 'commitMode'],\n outputs: ['activeStepIndexChange'],\n },\n ],\n host: {\n // Communicated busy-state while a commit is in flight - same\n // strict 'pending' gate the cngx-native organism uses per step.\n '[attr.aria-busy]': \"presenter.busy() ? 'true' : null\",\n },\n})\nexport class CngxMatStepper {\n private readonly matStepper = inject(MatStepper, { self: true });\n /**\n * Shared host contract. Public so a `<cngx-stepper-footer>` placed\n * outside the `<mat-stepper>` can bind `[host]=\"ref.presenter\"` (via\n * `#ref=\"cngxMatStepper\"`) and drive navigation.\n */\n readonly presenter = inject(CNGX_STEPPER_HOST);\n private readonly destroyRef: DestroyRef = inject(InjectableDestroyRef);\n private readonly injector: Injector = inject(InjectableInjector);\n\n private readonly matSteps = contentChildren(MatStep, { descendants: true });\n private readonly createHandle = inject(CNGX_MAT_STEP_HANDLE_FACTORY);\n private readonly i18n = injectStepperI18n();\n\n // Shared with [cngxMatTabsRegistry]: the presenter registry appends\n // new registrations, but Material renders steps at their DOM\n // position - a mid-list <mat-step> insert must land at its query\n // index, not at the tail. The seam re-registers the diverging\n // suffix in query order while keeping surviving handle instances.\n private readonly seam = createOrderedRegistrationSeam<MatStep, CngxMatStepHandleSetup>({\n create: (step) => this.createHandle(step, () => nextUid('cngx-mat-step-'), this.i18n),\n register: (setup) => this.presenter.register(setup.handle),\n unregister: (setup) => this.presenter.unregister(setup.handle.id, setup.handle),\n dispose: () => {\n // Step setups carry no per-entry resources (no child injector).\n },\n });\n\n constructor() {\n effect(() => {\n // Ownership filter: `descendants: true` also surfaces MatSteps of\n // a stepper nested inside one of OUR steps' content. Each CdkStep\n // carries its owning `_stepper` (public in the CDK typings), so\n // foreign steps are dropped before they can register with this\n // presenter.\n const steps = this.matSteps().filter((step) => step._stepper === this.matStepper);\n untracked(() => this.seam.sync(steps));\n });\n\n this.destroyRef.onDestroy(() => this.seam.clear());\n\n // Commit-lifecycle announcements (pending / landed / rolled-back).\n // The shared builder computes the phrase; the shared announcer\n // renders it - an attribute directive owns no template, so the\n // polite region lives on the root CngxLiveAnnouncer, mirroring\n // [cngxMatTabs].\n mountLiveRegionAnnouncer({\n announcement: createStepperAnnouncementBuilders({\n presenter: this.presenter,\n stepsOnly: this.presenter.stepsOnly,\n i18n: this.i18n,\n }).liveAnnouncement,\n injector: this.injector,\n });\n\n createMatStepperBidirectionalSync({\n matStepper: this.matStepper,\n presenter: this.presenter,\n injector: this.injector,\n destroyRef: this.destroyRef,\n });\n }\n}\n","/**\n * Public API surface of `@cngx/ui/mat-stepper`.\n *\n * The Material twin of the cngx stepper family, shipped as the\n * instrumentation directive `[cngxMatStepper]`: attach it to a vanilla\n * `<mat-stepper>` and it composes the same `CngxStepperPresenter` brain\n * as `<cngx-stepper>` (in `@cngx/ui/stepper`) via `hostDirectives`, so\n * commit-action lifecycle, router sync, and error aggregation all work\n * against Material's own markup. Mirrors `[cngxMatTabs]`.\n *\n * @module @cngx/ui/mat-stepper\n */\nexport { CngxMatStepper } from './mat-stepper.directive';\nexport {\n CNGX_MAT_STEP_HANDLE_FACTORY,\n createMatStepHandle,\n type CngxMatStepHandleFactory,\n type CngxMatStepHandleSetup,\n} from './material-bridge/handle';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["InjectableDestroyRef","InjectableInjector"],"mappings":";;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAU,iCAAiC,CAC/C,IAA4C,EAAA;AAE5C,IAAA,+BAA+B,CAAC;AAC9B,QAAA,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe;QAC9C,iBAAiB,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa;AACtD,QAAA,kBAAkB,EAAE,CAAC,CAAC,KAAI;AACxB,YAAA,IAAI,CAAC,UAAU,CAAC,aAAa,G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