@cngx/ui 0.0.1-rc.0 → 0.1.0-rc.1
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 +22 -48
- package/action-button/README.md +9 -11
- package/empty-state/README.md +11 -26
- package/feedback/README.md +3 -3
- package/fesm2022/cngx-ui-action-button.mjs +30 -26
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +26 -21
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +498 -261
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +32 -5
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +119 -297
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +455 -120
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-material.mjs +14 -3
- package/fesm2022/cngx-ui-material.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +22 -3
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +107 -28
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +61 -20
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +14 -5
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +659 -163
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +306 -55
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -1
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/layout/README.md +9 -44
- package/mat-stepper/README.md +37 -17
- package/mat-tabs/README.md +13 -13
- package/mat-tabs/styles/mat-tabs.css +357 -213
- package/material/README.md +19 -19
- package/overlay/README.md +11 -11
- package/package.json +7 -6
- package/sidenav/README.md +4 -19
- package/skeleton/README.md +3 -17
- package/speak/README.md +15 -15
- package/stepper/README.md +213 -5
- package/tabs/README.md +22 -4
- package/theming/system-tokens.css +29 -0
- package/types/cngx-ui-action-button.d.ts +28 -13
- package/types/cngx-ui-empty-state.d.ts +21 -9
- package/types/cngx-ui-feedback.d.ts +437 -121
- package/types/cngx-ui-layout.d.ts +38 -8
- package/types/cngx-ui-mat-stepper.d.ts +100 -134
- package/types/cngx-ui-mat-tabs.d.ts +291 -84
- package/types/cngx-ui-material.d.ts +12 -1
- package/types/cngx-ui-overlay.d.ts +25 -4
- package/types/cngx-ui-sidenav.d.ts +106 -12
- package/types/cngx-ui-skeleton.d.ts +62 -8
- package/types/cngx-ui-speak.d.ts +10 -2
- package/types/cngx-ui-stepper.d.ts +390 -57
- package/types/cngx-ui-tabs.d.ts +182 -18
- package/types/cngx-ui.d.ts +1 -0
- package/speak/speak-button-theme.scss +0 -78
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Main-axis direction for {@link CngxStack}.
|
|
5
|
+
*
|
|
6
|
+
* @category ui/layout
|
|
7
|
+
*/
|
|
4
8
|
type StackDirection = 'row' | 'column';
|
|
5
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Cross-axis alignment for {@link CngxStack}.
|
|
11
|
+
*
|
|
12
|
+
* @category ui/layout
|
|
13
|
+
*/
|
|
6
14
|
type StackAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
7
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Spacing scale for {@link CngxStack}. Maps to `--cngx-gap-*` tokens.
|
|
17
|
+
*
|
|
18
|
+
* @category ui/layout
|
|
19
|
+
*/
|
|
8
20
|
type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
21
|
/**
|
|
10
22
|
* Composable flex-based stack layout component.
|
|
@@ -17,6 +29,12 @@ type StackGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
17
29
|
* <div>Item 1</div>
|
|
18
30
|
* <div>Item 2</div>
|
|
19
31
|
* </cngx-stack>
|
|
32
|
+
*
|
|
33
|
+
* @category ui/layout
|
|
34
|
+
* @docsKind primary
|
|
35
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/layout/stack.component.ts
|
|
36
|
+
* @since 0.1.0
|
|
37
|
+
* @relatedTo CngxGrid
|
|
20
38
|
*/
|
|
21
39
|
declare class CngxStack {
|
|
22
40
|
/** Flex direction of the stack. */
|
|
@@ -35,15 +53,27 @@ declare class CngxStack {
|
|
|
35
53
|
|
|
36
54
|
/**
|
|
37
55
|
* Composable CSS grid layout component.
|
|
56
|
+
``` html
|
|
57
|
+
<cngx-grid columns="3" gap="16px">
|
|
58
|
+
<div>Cell 1</div>
|
|
59
|
+
<div>Cell 2</div>
|
|
60
|
+
</cngx-grid>
|
|
61
|
+
```
|
|
62
|
+
* `columns` accepts either a positive integer for the
|
|
63
|
+
* `repeat(N, 1fr)` shortcut or any `grid-template-columns` value
|
|
64
|
+
* (`"200px 1fr"`, `"repeat(auto-fit, minmax(120px, 1fr))"`).
|
|
65
|
+
* Bare attribute syntax works for both forms: `columns="3"` and
|
|
66
|
+
* `[columns]="3"` produce identical output.
|
|
38
67
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
68
|
+
* @category ui/layout
|
|
69
|
+
* @docsKind primary
|
|
70
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/layout/grid.component.ts
|
|
71
|
+
* @since 0.1.0
|
|
72
|
+
* @relatedTo CngxStack
|
|
43
73
|
*/
|
|
44
74
|
declare class CngxGrid {
|
|
45
75
|
/** Number of equal columns, or a custom `grid-template-columns` value. */
|
|
46
|
-
readonly columns: _angular_core.
|
|
76
|
+
readonly columns: _angular_core.InputSignalWithTransform<string | number, string | number>;
|
|
47
77
|
/** CSS gap between cells. */
|
|
48
78
|
readonly gap: _angular_core.InputSignal<string>;
|
|
49
79
|
/** @internal */
|
|
@@ -1,112 +1,78 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as _cngx_common_stepper from '@cngx/common/stepper';
|
|
2
|
+
import { CngxStepRegistration } from '@cngx/common/stepper';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { InjectionToken } from '@angular/core';
|
|
5
|
+
import { MatStep } from '@angular/material/stepper';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Material
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Bidirectional sync between presenter and `MatStepper.selectedIndex`
|
|
14
|
-
* runs in a single `effect()` with `untracked()` writes so neither
|
|
15
|
-
* direction tracks the other.
|
|
16
|
-
*
|
|
17
|
-
* Material owns keyboard nav and focus on `MatStepperHeader`, so the
|
|
18
|
-
* organism does NOT compose `CngxRovingTabindex` /
|
|
19
|
-
* `CngxFocusRestore`. Group nodes flatten — `<mat-stepper>` does not
|
|
20
|
-
* support nesting — with the depth preserved as a `data-step-depth`
|
|
21
|
-
* hint on the rendered label.
|
|
22
|
-
*/
|
|
23
|
-
declare class CngxMatStepper implements CngxStepPanelHost {
|
|
24
|
-
protected readonly presenter: i1.CngxStepperHost;
|
|
25
|
-
private readonly destroyRef;
|
|
26
|
-
private readonly injector;
|
|
27
|
-
protected readonly matStepper: Signal<MatStepper>;
|
|
28
|
-
private readonly hostCdr;
|
|
29
|
-
readonly flatSteps: Signal<readonly CngxStepNode[]>;
|
|
30
|
-
readonly activeStepIndex: Signal<number>;
|
|
31
|
-
readonly activeStepId: Signal<string | null>;
|
|
32
|
-
private readonly stepDirectives;
|
|
33
|
-
/**
|
|
34
|
-
* Consumer-projected `<ng-template matStepperIcon>` templates,
|
|
35
|
-
* forwarded into `MatStepper._iconOverrides` from the
|
|
36
|
-
* `afterNextRender` patch below. `<ng-content>` projection cannot
|
|
37
|
-
* reach Material's `@ContentChildren(MatStepperIcon)` — content-init
|
|
38
|
-
* resolves the inner query before the wrapper's projection lands.
|
|
39
|
-
* `_iconOverrides` is a Material-internal slot;
|
|
40
|
-
* `tabs-accepted-debt §5`.
|
|
41
|
-
*/
|
|
42
|
-
private readonly stepperIcons;
|
|
43
|
-
/**
|
|
44
|
-
* `Map<id, CngxStep>` so `labelTemplateFor` / `contentTemplateFor`
|
|
45
|
-
* are O(1). Structural `equal` on the id-set + per-id directive
|
|
46
|
-
* identity stops the map from cascading on shape-stable
|
|
47
|
-
* `contentChildren` re-emits.
|
|
48
|
-
*/
|
|
49
|
-
private readonly stepDirectiveById;
|
|
50
|
-
/**
|
|
51
|
-
* Step-only flat projection — `<mat-step>` does not nest, so
|
|
52
|
-
* groups collapse into the same level. Memoised via
|
|
53
|
-
* `flatStepsEqual` so consumers (`stepLabel`, panel `@for`,
|
|
54
|
-
* `stepLabelContextFor`) don't re-walk on shape-stable
|
|
55
|
-
* `flatSteps()` re-emits. Sibling-symmetric with
|
|
56
|
-
* `CngxStepper.stepsOnly`.
|
|
57
|
-
*/
|
|
58
|
-
protected readonly stepsOnly: Signal<readonly CngxStepNode[]>;
|
|
59
|
-
/** Material orientation literal — narrows our `'horizontal'|'vertical'` to its own union. */
|
|
60
|
-
protected readonly matOrientation: Signal<"horizontal" | "vertical">;
|
|
61
|
-
protected stepIndexOf(node: CngxStepNode): number;
|
|
62
|
-
/** Editability rule — non-linear lets every step click; linear only past completed. */
|
|
63
|
-
protected isEditable(node: CngxStepNode): boolean;
|
|
64
|
-
protected hasError(node: CngxStepNode): boolean;
|
|
65
|
-
protected isCompleted(node: CngxStepNode): boolean;
|
|
66
|
-
protected stepLabel(node: CngxStepNode): string;
|
|
67
|
-
/** Group nodes carry a depth marker so the label can distinguish nested rows. */
|
|
68
|
-
protected stepDepth(node: CngxStepNode): number;
|
|
69
|
-
labelTemplateFor(id: string): TemplateRef<CngxStepLabelContext> | null;
|
|
70
|
-
contentTemplateFor(id: string): TemplateRef<CngxStepContentContext> | null;
|
|
71
|
-
/**
|
|
72
|
-
* Per-node-id slot-context cache for `*cngxStepLabel` /
|
|
73
|
-
* `*cngxStepContent`. Mutating fields in place preserves the
|
|
74
|
-
* object reference, so `*ngTemplateOutlet`'s `Object.is` diff
|
|
75
|
-
* short-circuits the embedded-view rebind; the embedded view's
|
|
76
|
-
* `let-` bindings re-read the mutated fields on the next CD pass.
|
|
77
|
-
* Stale ids are pruned by the constructor effect tied to
|
|
78
|
-
* `presenter.flatSteps`.
|
|
79
|
-
*/
|
|
80
|
-
private readonly stepLabelContextCache;
|
|
81
|
-
/** Build the {@link CngxStepLabelContext} for the projected label template. */
|
|
82
|
-
protected stepLabelContextFor(node: CngxStepNode): CngxStepLabelContext;
|
|
83
|
-
/** Build the {@link CngxStepContentContext} for the projected content template. */
|
|
84
|
-
protected stepContentContextFor(node: CngxStepNode): CngxStepContentContext;
|
|
85
|
-
constructor();
|
|
86
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatStepper, never>;
|
|
87
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CngxMatStepper, "cngx-mat-stepper", ["cngxMatStepper"], {}, {}, ["stepDirectives", "stepperIcons"], never, true, [{ directive: typeof i1.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Attaches to an existing `<mat-stepper>` and bridges it to a
|
|
92
|
-
* {@link CngxStepperPresenter} — consumers gain the commit-action
|
|
8
|
+
* The Material twin of the CNGX stepper: attach `cngxMatStepper` to a
|
|
9
|
+
* vanilla `<mat-stepper>` and it is bridged to a
|
|
10
|
+
* {@link CngxStepperPresenter}. \
|
|
11
|
+
* Consumers gain the commit-action
|
|
93
12
|
* lifecycle, `CNGX_STATEFUL` (so `<cngx-toast-on />` /
|
|
94
|
-
* `<cngx-banner-on />` compose as children),
|
|
95
|
-
*
|
|
13
|
+
* `<cngx-banner-on />` compose as children), the shared
|
|
14
|
+
* `CNGX_STEPPER_HOST` contract (so a `<cngx-stepper-footer>` can drive
|
|
15
|
+
* Back / Next instead of Material's own buttons via
|
|
16
|
+
* `[host]="ref.presenter"`), and the step-handle registry - all from
|
|
17
|
+
* one attribute.
|
|
96
18
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* `exportAs` differs (`cngxMatStepperDirective`) to avoid colliding
|
|
101
|
-
* with the wrapper's `cngxMatStepper`.
|
|
19
|
+
* This is the instrumentation pattern: Material owns the rendering and
|
|
20
|
+
* the consumer authors native `<mat-step>` markup; CNGX is the
|
|
21
|
+
* behaviour layer. Topology mirrors `[cngxMatTabs]`.
|
|
102
22
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
23
|
+
* Inputs/outputs are forwarded from {@link CngxStepperPresenter}:
|
|
24
|
+
* - `activeStepIndex` (two-way, with `activeStepIndexChange`),
|
|
25
|
+
* - `linear`,
|
|
26
|
+
* - `orientation`,
|
|
27
|
+
* - `commitAction`,
|
|
28
|
+
* - `commitMode`. \
|
|
29
|
+
* See the presenter for their semantics.
|
|
30
|
+
* ```html
|
|
31
|
+
* <mat-stepper
|
|
32
|
+
* cngxMatStepper
|
|
33
|
+
* #s="cngxMatStepper"
|
|
34
|
+
* [(activeStepIndex)]="active"
|
|
35
|
+
* [commitAction]="commitAction"
|
|
36
|
+
* [commitMode]="mode()"
|
|
37
|
+
* cngxToastOn
|
|
38
|
+
* [toastError]="'Step transition failed'"
|
|
39
|
+
* cngxBannerOn
|
|
40
|
+
* bannerId="stepper:commit-error"
|
|
41
|
+
* [bannerError]="'The server rejected the step change.'"
|
|
42
|
+
* aria-label="Account setup"
|
|
43
|
+
* >
|
|
44
|
+
* <mat-step label="Personal info">
|
|
45
|
+
* <p>Tell us who you are.</p>
|
|
46
|
+
* </mat-step>
|
|
47
|
+
* <mat-step
|
|
48
|
+
* label="Account"
|
|
49
|
+
* [hasError]="!accepted()"
|
|
50
|
+
* errorMessage="Accept the terms to continue"
|
|
51
|
+
* >
|
|
52
|
+
* <p>Choose your sign-in method.</p>
|
|
53
|
+
* </mat-step>
|
|
54
|
+
* <mat-step label="Confirm">
|
|
55
|
+
* <p>Review everything, then finish.</p>
|
|
56
|
+
* </mat-step>
|
|
57
|
+
* </mat-stepper>
|
|
58
|
+
* ```
|
|
59
|
+
* @playground Bridge instrumentation ./examples/bridge/bridge-example.component.ts
|
|
60
|
+
*
|
|
61
|
+
* @category ui/mat-stepper
|
|
62
|
+
* @docsKind primary
|
|
63
|
+
* @wcag AA
|
|
64
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/mat-stepper.directive.ts
|
|
65
|
+
* @since 0.1.0
|
|
66
|
+
* @relatedTo CngxStepper, CngxStepperPresenter, CngxMatTabs, CngxStepperFooter
|
|
106
67
|
*/
|
|
107
|
-
declare class
|
|
68
|
+
declare class CngxMatStepper {
|
|
108
69
|
private readonly matStepper;
|
|
109
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Shared host contract. Public so a `<cngx-stepper-footer>` placed
|
|
72
|
+
* outside the `<mat-stepper>` can bind `[host]="ref.presenter"` (via
|
|
73
|
+
* `#ref="cngxMatStepper"`) and drive navigation.
|
|
74
|
+
*/
|
|
75
|
+
readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
110
76
|
private readonly destroyRef;
|
|
111
77
|
private readonly injector;
|
|
112
78
|
private readonly matSteps;
|
|
@@ -114,8 +80,8 @@ declare class CngxMatStepperBridge {
|
|
|
114
80
|
private readonly createHandle;
|
|
115
81
|
constructor();
|
|
116
82
|
private syncHandles;
|
|
117
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
118
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxMatStepper, never>;
|
|
84
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxMatStepper, "[cngxMatStepper]", ["cngxMatStepper"], {}, {}, ["matSteps"], never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
|
|
119
85
|
}
|
|
120
86
|
|
|
121
87
|
/**
|
|
@@ -131,65 +97,63 @@ interface CngxMatStepHandleSetup {
|
|
|
131
97
|
* Translates a Material `MatStep` into a cngx
|
|
132
98
|
* {@link CngxStepRegistration}.
|
|
133
99
|
*
|
|
134
|
-
* - `id`
|
|
100
|
+
* - `id` - always a fresh `idSeed()` value. Mirrors the tabs
|
|
135
101
|
* instrumentation handle: a label-keyed id would collide when
|
|
136
102
|
* two steps share a label.
|
|
137
|
-
* - `kind`
|
|
103
|
+
* - `kind` - fixed at `'step'`. The instrumentation path does not
|
|
138
104
|
* project nested `<mat-step>` groups (Material's stepper has no
|
|
139
105
|
* group-of-steps concept; group-aware semantics belong to the
|
|
140
106
|
* `<cngx-stepper>` thin-wrapper organism).
|
|
141
|
-
* - `label`
|
|
107
|
+
* - `label` - snapshot signal resolved through a four-tier fallback at
|
|
142
108
|
* registration time so cngx-side phrases (announcements,
|
|
143
109
|
* `aria-label` composition, telemetry) never read empty when
|
|
144
110
|
* Material consumers project a `<ng-template matStepLabel>`:
|
|
145
|
-
* 1. `MatStep.label` when it is a plain string
|
|
111
|
+
* 1. `MatStep.label` when it is a plain string - the canonical
|
|
146
112
|
* shape and the only one that emits a runtime change Material
|
|
147
113
|
* itself observes.
|
|
148
|
-
* 2. `MatStep.ariaLabel` when the consumer set the input
|
|
114
|
+
* 2. `MatStep.ariaLabel` when the consumer set the input -
|
|
149
115
|
* designed exactly as the substitute for template labels.
|
|
150
116
|
* 3. Static-text read from `MatStep.stepLabel.template` via a
|
|
151
117
|
* throwaway detached `EmbeddedViewRef` ({@link readMatStepLabelTemplateText}).
|
|
152
118
|
* Captures literal `matStepLabel` markup; dynamic interpolation
|
|
153
119
|
* bails through to (4).
|
|
154
|
-
* 4. `Step <id>`
|
|
120
|
+
* 4. `Step <id>` - deterministic, derived from the cngx handle
|
|
155
121
|
* id. Always non-empty.
|
|
156
|
-
*
|
|
157
|
-
* `CdkStep` does not expose a `_stateChanges` Subject
|
|
158
|
-
* `MatTab._stateChanges`, so cngx cannot re-trigger
|
|
159
|
-
* when Material flips the input later.
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* `MaterialPrivateSurfaces.CompletedOverrideSource` (see Phase 6.1).
|
|
164
|
-
* - `disabled` — fixed `false`. Material owns step gating via
|
|
122
|
+
* Documented limitation: runtime label changes do not propagate.
|
|
123
|
+
* CDK's `CdkStep` does not expose a `_stateChanges` Subject
|
|
124
|
+
* analogous to `MatTab._stateChanges`, so cngx cannot re-trigger
|
|
125
|
+
* the snapshot when Material flips the input later. Surface the
|
|
126
|
+
* same Material-internal coupling family typed in
|
|
127
|
+
* `MaterialPrivateSurfaces.CompletedOverrideSource`.
|
|
128
|
+
* - `disabled` - fixed `false`. Material owns step gating via
|
|
165
129
|
* `linear` + `editable` + `completed`; surfacing a cngx-side
|
|
166
130
|
* `disabled` would duplicate Material's own click-time enforcement
|
|
167
131
|
* and is ignored by `<mat-stepper>` itself.
|
|
168
|
-
* - `state`
|
|
169
|
-
* `CdkStep.completed`'s getter reads `_completedOverride()`
|
|
132
|
+
* - `state` - `computed()` over `MatStep.hasError` / `MatStep.completed`.
|
|
133
|
+
* `CdkStep.completed`'s getter reads `_completedOverride()` - a
|
|
170
134
|
* `WritableSignal<boolean | null>` typed in
|
|
171
135
|
* `MaterialPrivateSurfaces.CompletedOverrideSource`. The cngx
|
|
172
136
|
* computed transitively tracks that signal through the getter and
|
|
173
137
|
* re-fires whenever Material flips completion. `hasError` is a
|
|
174
|
-
* plain property setter on `CdkStep`, NOT a Signal
|
|
138
|
+
* plain property setter on `CdkStep`, NOT a Signal - a `hasError`
|
|
175
139
|
* write that is not paired with a `completed` change does not
|
|
176
140
|
* re-trigger this computed. In practice Material wizards write the
|
|
177
141
|
* two together (`step.hasError = true; step.completed = false` in
|
|
178
142
|
* error-handler patterns and inside Material's own error-state
|
|
179
143
|
* matchers) so the limitation is benign for the documented usage
|
|
180
|
-
* pattern.
|
|
181
|
-
*
|
|
182
|
-
* when Material exposes a public `_stateChanges`-equivalent Subject
|
|
183
|
-
* on `CdkStep` OR a consumer issue confirms an unpaired-`hasError`
|
|
184
|
-
* write reaches production.
|
|
185
|
-
* - `errorAggregator` — points at the shared
|
|
144
|
+
* pattern.
|
|
145
|
+
* - `errorAggregator` - points at the shared
|
|
186
146
|
* {@link NO_ERROR_AGGREGATOR} constant.
|
|
147
|
+
*
|
|
148
|
+
* @category ui/mat-stepper
|
|
187
149
|
*/
|
|
188
150
|
declare function createMatStepHandle(matStep: MatStep, idSeed: () => string): CngxMatStepHandleSetup;
|
|
189
151
|
/**
|
|
190
152
|
* Factory signature for {@link createMatStepHandle}. The DI token
|
|
191
153
|
* {@link CNGX_MAT_STEP_HANDLE_FACTORY} resolves to a function with
|
|
192
|
-
* this exact shape
|
|
154
|
+
* this exact shape - overrides match it identically.
|
|
155
|
+
*
|
|
156
|
+
* @category ui/mat-stepper
|
|
193
157
|
*/
|
|
194
158
|
type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
195
159
|
/**
|
|
@@ -199,12 +163,12 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
|
199
163
|
*
|
|
200
164
|
* Symmetric with the tabs sibling
|
|
201
165
|
* `CNGX_MAT_TAB_HANDLE_FACTORY` and with `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`
|
|
202
|
-
*
|
|
166
|
+
* - every Material-bridge logic block ships the same swap surface so
|
|
203
167
|
* consumers can layer telemetry, alternate id strategies, or
|
|
204
168
|
* test-environment id keying via `providers` / `viewProviders`
|
|
205
169
|
* without forking the directive.
|
|
206
170
|
*
|
|
207
|
-
* Override capability
|
|
171
|
+
* Override capability - the swap surface separates **handle shape**
|
|
208
172
|
* (factory body) from **id keying** (the supplied `idSeed` closure).
|
|
209
173
|
* The directive constructs `idSeed` as `() => nextUid('cngx-mat-step-')`
|
|
210
174
|
* and hands it to the factory as a default suggestion; an override is
|
|
@@ -212,9 +176,6 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
|
212
176
|
* deterministic-test / consumer-domain id strategy. Both axes are
|
|
213
177
|
* independently swappable from one DI seam.
|
|
214
178
|
*
|
|
215
|
-
* Tracked-debt: ships under family-uniformity staging (single
|
|
216
|
-
* in-package consumer today). See `stepper-accepted-debt §7`.
|
|
217
|
-
*
|
|
218
179
|
* ```ts
|
|
219
180
|
* providers: [
|
|
220
181
|
* {
|
|
@@ -227,8 +188,13 @@ type CngxMatStepHandleFactory = typeof createMatStepHandle;
|
|
|
227
188
|
* },
|
|
228
189
|
* ]
|
|
229
190
|
* ```
|
|
191
|
+
*
|
|
192
|
+
* @category ui/mat-stepper
|
|
193
|
+
* @wcag AA
|
|
194
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/mat-stepper/material-bridge/handle.ts
|
|
195
|
+
* @since 0.1.0
|
|
230
196
|
*/
|
|
231
197
|
declare const CNGX_MAT_STEP_HANDLE_FACTORY: InjectionToken<typeof createMatStepHandle>;
|
|
232
198
|
|
|
233
|
-
export { CNGX_MAT_STEP_HANDLE_FACTORY, CngxMatStepper,
|
|
199
|
+
export { CNGX_MAT_STEP_HANDLE_FACTORY, CngxMatStepper, createMatStepHandle };
|
|
234
200
|
export type { CngxMatStepHandleFactory };
|