@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,5 +1,5 @@
|
|
|
1
1
|
import * as _cngx_common_stepper from '@cngx/common/stepper';
|
|
2
|
-
import { CngxStepPanelHost,
|
|
2
|
+
import { CngxStepPanelHost, CngxStepperSkin, CngxStepperHeaderNavigation, CngxStepperMobileIndicatorPosition, CngxStepErrorContext, CngxStepperSwipeNav, CngxStepNode, CngxStepLabelContext, CngxStepContentContext, CngxDotStepperDotContext, CngxStepperHost } from '@cngx/common/stepper';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { Signal, TemplateRef } from '@angular/core';
|
|
5
5
|
import * as i2 from '@cngx/common/a11y';
|
|
@@ -10,11 +10,55 @@ import * as i2 from '@cngx/common/a11y';
|
|
|
10
10
|
* forwards `activeStepIndex`/`linear`/`orientation`/`commitAction`/
|
|
11
11
|
* `commitMode` to the presenter. Material twin lives in
|
|
12
12
|
* `@cngx/ui/mat-stepper`. ARIA attrs are in the `computed()` graph.
|
|
13
|
+
*
|
|
14
|
+
* @category ui/stepper
|
|
15
|
+
* @docsKind primary
|
|
16
|
+
* @wcag AA
|
|
17
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/stepper.component.ts
|
|
18
|
+
* @since 0.1.0
|
|
19
|
+
* @relatedTo CngxStepperPresenter, CngxStep, CngxRovingTabindex, CngxFocusRestore, CngxLiveRegion
|
|
20
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>
|
|
21
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-vertical/vertical-sidebar-layout</example-url>
|
|
22
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-linear/linear-gating-with-completion-checkboxes</example-url>
|
|
23
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-mobile-collapse/dots-collapse</example-url>
|
|
24
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/linear-minimal</example-url>
|
|
25
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/stripe-status-rich</example-url>
|
|
26
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/path-chevron</example-url>
|
|
27
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/pill-segment</example-url>
|
|
28
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/chips</example-url>
|
|
29
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/breadcrumb</example-url>
|
|
30
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/all-skins-side-by-side</example-url>
|
|
31
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/material-theme-coverage</example-url>
|
|
32
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/linear-minimal-vertical</example-url>
|
|
33
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/stripe-status-rich-vertical</example-url>
|
|
34
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/path-chevron-vertical</example-url>
|
|
35
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/pill-segment-vertical</example-url>
|
|
36
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-skins/chips-vertical</example-url>
|
|
13
37
|
*/
|
|
14
38
|
declare class CngxStepper implements CngxStepPanelHost {
|
|
15
39
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
16
40
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
17
|
-
|
|
41
|
+
/** Per-instance skin override; flips `[data-skin]`, structure/ARIA unchanged. */
|
|
42
|
+
readonly skin: _angular_core.InputSignal<CngxStepperSkin | undefined>;
|
|
43
|
+
/** Opt the classic skin into the connector-rail presentation. Off by default, classic-scoped. */
|
|
44
|
+
readonly connectors: _angular_core.InputSignalWithTransform<boolean | undefined, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Per-instance header-navigation policy. `'none'` renders inert label
|
|
47
|
+
* headers (footer-only navigation); `'visited'` keeps them as
|
|
48
|
+
* focusable buttons gated by `linear`. Cascade: Input ?? config ??
|
|
49
|
+
* `'visited'`.
|
|
50
|
+
*/
|
|
51
|
+
readonly headerNavigation: _angular_core.InputSignal<CngxStepperHeaderNavigation | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* Opt-in `Step N of M` caption under the mobile `'dots'` row. In
|
|
54
|
+
* the `'text'` collapse branch the count IS the indicator and is
|
|
55
|
+
* always rendered; this input only gates the supplemental caption
|
|
56
|
+
* that sits next to the dot row.
|
|
57
|
+
*/
|
|
58
|
+
readonly showStepCount: _angular_core.InputSignal<boolean>;
|
|
59
|
+
readonly mobileIndicatorPosition: _angular_core.InputSignal<CngxStepperMobileIndicatorPosition | undefined>;
|
|
60
|
+
/** Stepper-host contract; exposed so external `<cngx-stepper-count>` / bridge consumers can `[host]="s.presenter"` via `#s="cngxStepper"`. */
|
|
61
|
+
readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
18
62
|
protected readonly i18n: _cngx_common_stepper.CngxStepperI18n;
|
|
19
63
|
protected readonly config: _cngx_common_stepper.CngxStepperConfig;
|
|
20
64
|
private readonly hostElement;
|
|
@@ -24,23 +68,55 @@ declare class CngxStepper implements CngxStepPanelHost {
|
|
|
24
68
|
private readonly badgeSlot;
|
|
25
69
|
private readonly busySpinnerSlot;
|
|
26
70
|
private readonly rejectionSlot;
|
|
71
|
+
private readonly errorSlot;
|
|
27
72
|
private readonly groupHeaderSlot;
|
|
28
73
|
private readonly emptySlot;
|
|
29
|
-
/** Default-template glyph source
|
|
74
|
+
/** Default-template glyph source - read by `#defaultBadge` / `#defaultRejection` outlets. */
|
|
30
75
|
protected readonly glyphs: {
|
|
31
76
|
readonly errorBadge: "!";
|
|
32
77
|
readonly rejectionIcon: "!";
|
|
33
78
|
};
|
|
34
79
|
/**
|
|
35
|
-
*
|
|
80
|
+
* Template cascade (indicator/badge/busySpinner/rejection/stepError/
|
|
36
81
|
* groupHeader/empty). Resolution: per-instance slot directive →
|
|
37
82
|
* `CNGX_STEPPER_CONFIG.templates.<key>` → `null` (built-in default).
|
|
38
83
|
*/
|
|
39
84
|
protected readonly templates: _cngx_common_stepper.CngxStepperTemplateBindings;
|
|
85
|
+
protected readonly displayMode: Signal<"classic" | "text" | "dots">;
|
|
40
86
|
constructor();
|
|
41
87
|
/** Stepper landmark role-description with config + i18n cascade. */
|
|
42
88
|
protected readonly stepperRoleDescription: Signal<string>;
|
|
43
|
-
/**
|
|
89
|
+
/** Resolved skin / connectors / mobile-indicator host attrs (Level-2 cascade helper). */
|
|
90
|
+
protected readonly hostAttrs: _cngx_common_stepper.CngxStepperHostAttrs;
|
|
91
|
+
/**
|
|
92
|
+
* Resolved header-navigation policy. Cascade mirrors `skin` /
|
|
93
|
+
* `connectors`: per-instance Input ?? config ?? `'visited'`.
|
|
94
|
+
*/
|
|
95
|
+
protected readonly resolvedHeaderNavigation: Signal<CngxStepperHeaderNavigation>;
|
|
96
|
+
/**
|
|
97
|
+
* Real error reason for a step, or `null`. A reason is the direct
|
|
98
|
+
* `[error]` string or the first `errorAggregator` label.
|
|
99
|
+
*/
|
|
100
|
+
private stepErrorMessageOf;
|
|
101
|
+
/**
|
|
102
|
+
* Errored steps that carry a real message, rendered as a row BELOW the
|
|
103
|
+
* strip (full width, wraps) rather than inline in a step - a free-text
|
|
104
|
+
* message inside a strip item widens the shrink-to-fit step and tears
|
|
105
|
+
* the row. Empty when no step has a real reason.
|
|
106
|
+
*/
|
|
107
|
+
protected readonly stepErrorEntries: Signal<readonly {
|
|
108
|
+
id: string;
|
|
109
|
+
label: string;
|
|
110
|
+
message: string;
|
|
111
|
+
context: CngxStepErrorContext;
|
|
112
|
+
}[]>;
|
|
113
|
+
/** Mobile-swipe navigation host directive (Level-2 composition). */
|
|
114
|
+
protected readonly swipeNav: CngxStepperSwipeNav;
|
|
115
|
+
protected statusLabelFor: (node: CngxStepNode) => string;
|
|
116
|
+
/** Mobile-dot `data-state`: unified error (rejection + aggregator) over the raw status. */
|
|
117
|
+
protected mobileDotState(node: CngxStepNode): string;
|
|
118
|
+
/** Mobile-dot `aria-label`, appending the errored status when the dot has an error. */
|
|
119
|
+
protected mobileDotAriaLabel(node: CngxStepNode, index: number): string;
|
|
44
120
|
protected readonly groupRoleDescription: Signal<string>;
|
|
45
121
|
/**
|
|
46
122
|
* `aria-label` cascade: input → `ariaLabels.stepperRegion` → `i18n.stepperLabel`.
|
|
@@ -51,57 +127,60 @@ declare class CngxStepper implements CngxStepPanelHost {
|
|
|
51
127
|
readonly flatSteps: Signal<readonly CngxStepNode[]>;
|
|
52
128
|
readonly activeStepIndex: Signal<number>;
|
|
53
129
|
readonly activeStepId: Signal<string | null>;
|
|
54
|
-
|
|
55
|
-
* Step-only flat projection (group nodes filtered out). Structural equal
|
|
56
|
-
* via `flatStepsEqual` — downstream consumers don't re-walk on shape-stable
|
|
57
|
-
* `flatSteps()` re-emits.
|
|
58
|
-
*/
|
|
59
|
-
protected readonly stepsOnly: Signal<CngxStepNode[]>;
|
|
130
|
+
protected readonly stepsOnly: Signal<readonly CngxStepNode[]>;
|
|
60
131
|
/**
|
|
61
132
|
* Position in the step-only flat projection. Group nodes carry `-1`;
|
|
62
133
|
* callers must guard on `kind === 'step'`.
|
|
63
134
|
*/
|
|
64
135
|
protected stepIndexOf(node: CngxStepNode): number;
|
|
65
|
-
|
|
66
|
-
protected
|
|
67
|
-
/**
|
|
136
|
+
/** Per-step predicates + slot-context builders (Level-2 factory). */
|
|
137
|
+
protected readonly slotContext: _cngx_common_stepper.CngxStepperSlotContextBuilders;
|
|
138
|
+
/**
|
|
139
|
+
* Shared state view - feeds the mobile-collapse `text` / `dots` branches,
|
|
140
|
+
* which otherwise rendered only `Step N of M` (text) or `node.state()`
|
|
141
|
+
* (dots) and dropped the per-step error the desktop branch shows.
|
|
142
|
+
*/
|
|
143
|
+
protected readonly stateView: _cngx_common_stepper.CngxStepperStateView;
|
|
144
|
+
/**
|
|
145
|
+
* Aggregate error phrase for the mobile-collapse text branch. Feeds the
|
|
146
|
+
* real reason (the `[error]` string / aggregator label) through the
|
|
147
|
+
* resolver so the collapsed view shows "Card declined", not the generic
|
|
148
|
+
* "errored" status word - the strip's per-step row is not on screen in
|
|
149
|
+
* collapsed mode, so this line is the only error surface.
|
|
150
|
+
*/
|
|
151
|
+
protected readonly mobileErrorSummary: Signal<string>;
|
|
152
|
+
/** Commit-in-flight flag - drives the host `aria-busy` binding. Pillar 2. */
|
|
68
153
|
protected readonly isCommitting: Signal<boolean>;
|
|
69
154
|
protected stepHeaderId(node: CngxStepNode): string;
|
|
70
155
|
protected stepPanelId(node: CngxStepNode): string;
|
|
71
156
|
protected stepDescriptorId(node: CngxStepNode): string;
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
* quiet on no-op CD ticks. Error-arm priority:
|
|
75
|
-
* 1. `commitRolledBackTo(originLabel)` when both `lastFailedIndex` and a
|
|
76
|
-
* resolvable origin label exist.
|
|
77
|
-
* 2. `commitFailedRetry` otherwise.
|
|
78
|
-
*/
|
|
79
|
-
protected readonly liveAnnouncement: Signal<string>;
|
|
80
|
-
/** SR descriptor phrase. Aggregator-announced or "Step N of M: <label>"; appends stepRolledBackSuffix on the rejected row. */
|
|
81
|
-
protected statusPhrase(node: CngxStepNode): string;
|
|
82
|
-
/** Group descriptor — rolls up children's aggregated status. */
|
|
83
|
-
protected groupStatusPhrase(node: CngxStepNode): string;
|
|
84
|
-
/** Whether to render the error badge for a step node. */
|
|
85
|
-
protected showErrorBadge(node: CngxStepNode): boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Render the rejection decoration when this step's flat-index matches
|
|
88
|
-
* `presenter.lastFailedIndex()`. Closes stepper-accepted-debt §2.
|
|
89
|
-
*/
|
|
90
|
-
protected showRejection(node: CngxStepNode): boolean;
|
|
91
|
-
/** Build the slot context for `*cngxStepIndicator`. */
|
|
92
|
-
protected indicatorContextFor(node: CngxStepNode): CngxStepIndicatorContext;
|
|
93
|
-
/** Build the slot context for `*cngxStepBadge`. */
|
|
94
|
-
protected badgeContextFor(node: CngxStepNode): CngxStepBadgeContext;
|
|
95
|
-
/** Build the slot context for `*cngxStepBusySpinner`. */
|
|
96
|
-
protected busySpinnerContextFor(node: CngxStepNode): CngxStepBusySpinnerContext;
|
|
97
|
-
/**
|
|
98
|
-
* Build the slot context for `*cngxStepRejection`. Resolves origin label
|
|
99
|
-
* from `presenter.originIndexDuringCommit()` via `stepsOnly()`.
|
|
100
|
-
*/
|
|
101
|
-
protected rejectionContextFor(node: CngxStepNode): CngxStepRejectionContext;
|
|
102
|
-
/** Build the slot context for `*cngxStepGroupHeader`. */
|
|
103
|
-
protected groupHeaderContextFor(node: CngxStepNode): CngxStepGroupHeaderContext;
|
|
157
|
+
/** Live-region + per-step + group SR phrase builders (Level-2 factory). */
|
|
158
|
+
protected readonly announcement: _cngx_common_stepper.CngxStepperAnnouncementBuilders;
|
|
104
159
|
protected handleHeaderClick(node: CngxStepNode): void;
|
|
160
|
+
/**
|
|
161
|
+
* `true` when the step header at `node` may be navigated to right now:
|
|
162
|
+
* structurally reachable (`canNavigateTo` - not disabled, not
|
|
163
|
+
* linear-blocked) AND not while a commit is in flight (`busy()`). The
|
|
164
|
+
* busy gate mirrors the footer nav atoms, which disable on
|
|
165
|
+
* `!canGo* || busy()` - so the strip and the footer lock together
|
|
166
|
+
* during an async transition instead of letting a header click
|
|
167
|
+
* supersede the pending commit. Reads the host contract, never the
|
|
168
|
+
* presenter's private linear-block check.
|
|
169
|
+
*/
|
|
170
|
+
protected isHeaderReachable(node: CngxStepNode): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* `'true'` on a header that cannot be navigated to, `null` otherwise.
|
|
173
|
+
* Folds two channels into one binding: a `disabled` step and a
|
|
174
|
+
* linear-unreachable step both read as `aria-disabled`, so the gate is
|
|
175
|
+
* announced rather than silently ignored. The header stays focusable
|
|
176
|
+
* per the ARIA composite-widget disabled-focusable rule. In
|
|
177
|
+
* `'visited'` + `linear=false` this is byte-identical to the
|
|
178
|
+
* prior `node.disabled()`-only binding, since `canNavigateTo` returns
|
|
179
|
+
* `true` for every enabled step when linear is off.
|
|
180
|
+
*/
|
|
181
|
+
protected headerAriaDisabled(node: CngxStepNode): 'true' | null;
|
|
182
|
+
/** Strip-scoped arrow-key handler. See {@link createStepperStripKeyboardNav}. */
|
|
183
|
+
protected readonly handleStripKeyDown: (event: KeyboardEvent) => void;
|
|
105
184
|
/**
|
|
106
185
|
* Clear the presenter's `lastFailedIndex`. Lets template-ref consumers
|
|
107
186
|
* (`#s="cngxStepper"`) dismiss the rejection decoration without injecting
|
|
@@ -110,20 +189,274 @@ declare class CngxStepper implements CngxStepPanelHost {
|
|
|
110
189
|
clearLastFailed(): void;
|
|
111
190
|
labelTemplateFor(id: string): TemplateRef<CngxStepLabelContext> | null;
|
|
112
191
|
contentTemplateFor(id: string): TemplateRef<CngxStepContentContext> | null;
|
|
192
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepper, never>;
|
|
193
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStepper, "cngx-stepper", ["cngxStepper"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "connectors": { "alias": "connectors"; "required": false; "isSignal": true; }; "headerNavigation": { "alias": "headerNavigation"; "required": false; "isSignal": true; }; "showStepCount": { "alias": "showStepCount"; "required": false; "isSignal": true; }; "mobileIndicatorPosition": { "alias": "mobileIndicatorPosition"; "required": false; "isSignal": true; }; }, {}, ["stepDirectives", "indicatorSlot", "badgeSlot", "busySpinnerSlot", "rejectionSlot", "errorSlot", "groupHeaderSlot", "emptySlot"], ["cngx-stepper-footer, [cngxStepperFooter]"], true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; "orientation": "orientation"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }, { directive: typeof i2.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }, { directive: typeof _cngx_common_stepper.CngxStepperSwipeNav; inputs: { "mobileSwipe": "mobileSwipe"; }; outputs: {}; }, { directive: typeof i2.CngxFocusRestore; inputs: {}; outputs: {}; }]>;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Progress-Bar stepper variant. Thin Level-4 organism composing
|
|
198
|
+
* `CngxStepperPresenter` via `hostDirectives` and rendering the
|
|
199
|
+
* existing `<cngx-progress>` primitive as the visual bar instead of
|
|
200
|
+
* reinventing `<div role="progressbar">`. Material consumers inherit
|
|
201
|
+
* Material progress styling through `CngxProgress` automatically.
|
|
202
|
+
*
|
|
203
|
+
* `completedPercent()` is `computed` from `presenter.activeStepIndex()`
|
|
204
|
+
* and the count of step nodes in `presenter.flatSteps()`. Optional
|
|
205
|
+
* `[showStepCount]` adds a `Step N of M` caption sourced from
|
|
206
|
+
* `CngxStepperI18n.textStepperFormat`.
|
|
207
|
+
*
|
|
208
|
+
* @category ui/stepper
|
|
209
|
+
* @docsKind primary
|
|
210
|
+
* @wcag AA
|
|
211
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/progress-bar-stepper.component.ts
|
|
212
|
+
* @since 0.1.0
|
|
213
|
+
* @relatedTo CngxStepperPresenter, CngxProgress, CngxDotStepper, CngxTextStepper
|
|
214
|
+
* <example-url>http://localhost:4200/#/ui/stepper/progress-bar/onboarding-flow</example-url>
|
|
215
|
+
*/
|
|
216
|
+
declare class CngxProgressBarStepper {
|
|
217
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
218
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
219
|
+
/** Render a `Step N of M` caption below the bar. Off by default. */
|
|
220
|
+
readonly showStepCount: _angular_core.InputSignal<boolean>;
|
|
221
|
+
protected readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
222
|
+
protected readonly i18n: _cngx_common_stepper.CngxStepperI18n;
|
|
223
|
+
/** Shared per-step/aggregate state derivations - the single error source. */
|
|
224
|
+
protected readonly stateView: _cngx_common_stepper.CngxStepperStateView;
|
|
225
|
+
/** Default error glyph for the error caption. */
|
|
226
|
+
protected readonly errorGlyph: "!";
|
|
227
|
+
/** Total step count (group nodes excluded). */
|
|
228
|
+
protected readonly totalSteps: _angular_core.Signal<number>;
|
|
229
|
+
/** 1-based active position used in the caption format. */
|
|
230
|
+
protected readonly currentStep: _angular_core.Signal<number>;
|
|
113
231
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* (`flatIndex === -1`) yield `0` and are never iterated here.
|
|
232
|
+
* Completion percentage 0-100. `(active / max(total - 1, 1)) * 100`
|
|
233
|
+
* so the final step renders the bar full.
|
|
117
234
|
*/
|
|
118
|
-
protected
|
|
235
|
+
protected readonly completedPercent: _angular_core.Signal<number>;
|
|
236
|
+
protected readonly captionText: _angular_core.Signal<string>;
|
|
119
237
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
* `
|
|
238
|
+
* Aggregate error caption. A single errored step names itself
|
|
239
|
+
* (`"Payment: Errored"`), several collapse to the i18n count phrase.
|
|
240
|
+
* Read only when `stateView.hasAnyError()` gates the template.
|
|
123
241
|
*/
|
|
124
|
-
protected
|
|
125
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
126
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
242
|
+
protected readonly errorText: _angular_core.Signal<string>;
|
|
243
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxProgressBarStepper, never>;
|
|
244
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxProgressBarStepper, "cngx-progress-bar-stepper", ["cngxProgressBarStepper"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "showStepCount": { "alias": "showStepCount"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Dot stepper variant. Mobile-first sequential-flow indicator. Renders
|
|
249
|
+
* one labelled `<span role="img">` per step (a name-permitting role, so
|
|
250
|
+
* each dot announces "Step N of M: label") inside a
|
|
251
|
+
* `<div role="group" aria-roledescription="Step indicator">`. The active
|
|
252
|
+
* dot carries `aria-current="step"` per the W3C APG step-indicator
|
|
253
|
+
* pattern (NOT `role="tablist"` / `role="tab"` - those are reserved
|
|
254
|
+
* for parallel content panels, not sequential flow).
|
|
255
|
+
*
|
|
256
|
+
* Tap-to-select is intentionally NOT wired on individual dots: under
|
|
257
|
+
* the APG pattern each dot is a label, not a button, and attaching
|
|
258
|
+
* `(click)` to `role="img"` conflates two ARIA contracts. Navigation
|
|
259
|
+
* is offered uniformly via three modalities owned by the host element:
|
|
260
|
+
* arrow / Home / End keys, the composed `CngxStepperSwipeNav` dot-row
|
|
261
|
+
* gesture, and the two-way `[(activeStepIndex)]` binding for
|
|
262
|
+
* external buttons. Consumers wanting per-dot tap-to-jump compose the
|
|
263
|
+
* parent `<cngx-stepper>` (whose mobile-collapse `dots` branch
|
|
264
|
+
* renders each dot as a `<button>`).
|
|
265
|
+
*
|
|
266
|
+
* Theming flows through new `--cngx-dot-step-*` custom properties whose
|
|
267
|
+
* defaults cascade through `var(--cngx-step-active-fill, ...)`, so the
|
|
268
|
+
* Phase A active-fill chain reaches the dot variant without duplication.
|
|
269
|
+
*
|
|
270
|
+
* @category ui/stepper
|
|
271
|
+
* @docsKind primary
|
|
272
|
+
* @wcag AA
|
|
273
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/dot-stepper.component.ts
|
|
274
|
+
* @since 0.1.0
|
|
275
|
+
* @relatedTo CngxStepperPresenter, CngxProgressBarStepper, CngxTextStepper
|
|
276
|
+
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>
|
|
277
|
+
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>
|
|
278
|
+
*/
|
|
279
|
+
declare class CngxDotStepper {
|
|
280
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
281
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
282
|
+
protected readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
283
|
+
protected readonly i18n: _cngx_common_stepper.CngxStepperI18n;
|
|
284
|
+
protected readonly config: _cngx_common_stepper.CngxStepperConfig;
|
|
285
|
+
/** Mobile-swipe routing surface composed via hostDirectives. */
|
|
286
|
+
protected readonly swipeNav: CngxStepperSwipeNav;
|
|
287
|
+
protected readonly stepNodes: Signal<readonly CngxStepNode[]>;
|
|
288
|
+
protected readonly activeIndex: Signal<number>;
|
|
289
|
+
/** Shared per-step/aggregate state derivations - the single error source. */
|
|
290
|
+
protected readonly stateView: _cngx_common_stepper.CngxStepperStateView;
|
|
291
|
+
/** Default error glyph for the aggregate error line. */
|
|
292
|
+
protected readonly errorGlyph: "!";
|
|
293
|
+
/**
|
|
294
|
+
* Aggregate error line. The dot row only colours the errored dot, so
|
|
295
|
+
* the real reason (the `[error]` string / aggregator label) needs a
|
|
296
|
+
* text surface; this is it. Falls back to the count phrase for
|
|
297
|
+
* multiple errors.
|
|
298
|
+
*/
|
|
299
|
+
protected readonly errorText: Signal<string>;
|
|
300
|
+
private readonly dotSlot;
|
|
301
|
+
/**
|
|
302
|
+
* Resolved dot-body template cascade: per-instance `*cngxDotStepperDot`
|
|
303
|
+
* directive > `CNGX_STEPPER_CONFIG.templates.dotStepperDot` > `null`
|
|
304
|
+
* (built-in empty body). Pillar 1 - resolution is a `computed`, not
|
|
305
|
+
* manual sync.
|
|
306
|
+
*/
|
|
307
|
+
protected readonly resolvedDotTemplate: Signal<TemplateRef<CngxDotStepperDotContext> | null>;
|
|
308
|
+
protected isActive(node: CngxStepNode, index: number): boolean;
|
|
309
|
+
protected isCompleted(index: number): boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Resolved `data-state` for the dot: `'error'` whenever the unified error
|
|
312
|
+
* view fires (covers commit rejection and the error aggregator, not just a
|
|
313
|
+
* literal `state === 'error'`), otherwise the raw step status.
|
|
314
|
+
*/
|
|
315
|
+
protected dotState(node: CngxStepNode): string;
|
|
316
|
+
protected ariaLabelFor(node: CngxStepNode, index: number): string;
|
|
317
|
+
/** Build the slot context for `*cngxDotStepperDot`. */
|
|
318
|
+
protected dotContextFor(node: CngxStepNode, index: number): CngxDotStepperDotContext;
|
|
319
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
320
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDotStepper, never>;
|
|
321
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxDotStepper, "cngx-dot-stepper", ["cngxDotStepper"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; }, {}, ["dotSlot"], never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }, { directive: typeof _cngx_common_stepper.CngxStepperSwipeNav; inputs: { "mobileSwipe": "mobileSwipe"; }; outputs: {}; }]>;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Text stepper variant. Smallest possible stepper: a single
|
|
326
|
+
* `<span aria-live="polite">` driven by the presenter. Renders
|
|
327
|
+
* `Step N of M` by default (sourced from
|
|
328
|
+
* `CngxStepperI18n.textStepperFormat`); optional `[showCurrentLabel]`
|
|
329
|
+
* appends the active step's label next to the count. Material consumers
|
|
330
|
+
* inherit surrounding text styling via CSS inheritance, no theme bridge
|
|
331
|
+
* required.
|
|
332
|
+
*
|
|
333
|
+
* @category ui/stepper
|
|
334
|
+
* @docsKind primary
|
|
335
|
+
* @wcag AA
|
|
336
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/text-stepper.component.ts
|
|
337
|
+
* @since 0.1.0
|
|
338
|
+
* @relatedTo CngxStepperPresenter, CngxProgressBarStepper, CngxDotStepper
|
|
339
|
+
* <example-url>http://localhost:4200/#/ui/stepper/text-stepper/inline-progress</example-url>
|
|
340
|
+
*/
|
|
341
|
+
declare class CngxTextStepper {
|
|
342
|
+
/** Append the active step's label to the count text. Off by default. */
|
|
343
|
+
readonly showCurrentLabel: _angular_core.InputSignal<boolean>;
|
|
344
|
+
protected readonly presenter: _cngx_common_stepper.CngxStepperHost;
|
|
345
|
+
protected readonly i18n: _cngx_common_stepper.CngxStepperI18n;
|
|
346
|
+
protected readonly stepNodes: Signal<readonly CngxStepNode[]>;
|
|
347
|
+
/** Shared per-step/aggregate state derivations - the single error source. */
|
|
348
|
+
protected readonly stateView: _cngx_common_stepper.CngxStepperStateView;
|
|
349
|
+
/** Default error glyph for the error sub-line. */
|
|
350
|
+
protected readonly errorGlyph: "!";
|
|
351
|
+
protected readonly totalSteps: Signal<number>;
|
|
352
|
+
protected readonly currentStep: Signal<number>;
|
|
353
|
+
protected readonly stepText: Signal<string>;
|
|
354
|
+
/**
|
|
355
|
+
* Aggregate error sub-line text. A single errored step names itself
|
|
356
|
+
* (`"Payment: Errored"`), several collapse to the i18n count phrase
|
|
357
|
+
* (`"2 errors"`). Empty when no step errored - the template gates on
|
|
358
|
+
* `stateView.hasAnyError()`, so this is only read when non-empty.
|
|
359
|
+
*/
|
|
360
|
+
protected readonly errorText: Signal<string>;
|
|
361
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTextStepper, never>;
|
|
362
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTextStepper, "cngx-text-stepper", ["cngxTextStepper"], { "showCurrentLabel": { "alias": "showCurrentLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof _cngx_common_stepper.CngxStepperPresenter; inputs: { "activeStepIndex": "activeStepIndex"; "linear": "linear"; }; outputs: { "activeStepIndexChange": "activeStepIndexChange"; }; }]>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Navigation action-bar molecule for the stepper family. \
|
|
367
|
+
* Lays out three regions - **start** (Back), **center** (progress hint), **end** (Continue / Finish). \
|
|
368
|
+
* Wires the {@link CNGX_STEPPER_HOST} for any nav atoms a consumer drops inside.
|
|
369
|
+
*
|
|
370
|
+
* **Resolves its host like `CngxStepperCount`:** \
|
|
371
|
+
* An explicit `[host]` input for placement outside the stepper tree, falling back to the ambient
|
|
372
|
+
* host injected from an ancestor `<cngx-stepper>` / `<cngx-mat-stepper>`
|
|
373
|
+
* (`skipSelf`, so the footer reads the real presenter rather than its own
|
|
374
|
+
* re-provided proxy). \
|
|
375
|
+
* It then re-provides `CNGX_STEPPER_HOST` as a live
|
|
376
|
+
* {@link createStepperHostProxy} over the resolved host, so child
|
|
377
|
+
* `[cngxStepperPrevious]` / `[cngxStepperNext]` atoms resolve it
|
|
378
|
+
* ambiently whether the footer is nested or used standalone with
|
|
379
|
+
* `[host]`. \
|
|
380
|
+
* `providers` (not `viewProviders`) carries the proxy to the
|
|
381
|
+
* consumer-projected button content. With no host at all, the proxy's
|
|
382
|
+
* neutral set renders the nav buttons disabled.
|
|
383
|
+
*
|
|
384
|
+
* ```html
|
|
385
|
+
* <cngx-stepper #s="cngxStepper"> … </cngx-stepper>
|
|
386
|
+
* <cngx-stepper-footer [host]="s.presenter">
|
|
387
|
+
* <button cngxStepperFooterStart cngxStepperPrevious>Back</button>
|
|
388
|
+
* <cngx-stepper-count cngxStepperFooterCenter />
|
|
389
|
+
* <button cngxStepperFooterEnd cngxStepperNext>Continue</button>
|
|
390
|
+
* </cngx-stepper-footer>
|
|
391
|
+
* ```
|
|
392
|
+
*
|
|
393
|
+
* @category ui/stepper
|
|
394
|
+
* @docsKind primary
|
|
395
|
+
* @wcag AA
|
|
396
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/footer/stepper-footer.component.ts
|
|
397
|
+
* @since 0.1.0
|
|
398
|
+
* @relatedTo CngxStepper, CngxStepperPrevious, CngxStepperNext, CngxStepperComplete, CngxStepperCount
|
|
399
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/back-continue</example-url>
|
|
400
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/save-draft-extra-button</example-url>
|
|
401
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/footer-with-progress-center</example-url>
|
|
402
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/percent-complete-center</example-url>
|
|
403
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/segmented-progress-center</example-url>
|
|
404
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/complete-finish-button</example-url>
|
|
405
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-footer/async-commit-status</example-url>
|
|
406
|
+
*/
|
|
407
|
+
declare class CngxStepperFooter {
|
|
408
|
+
/**
|
|
409
|
+
* Explicit stepper-host reference for placement *outside* the stepper
|
|
410
|
+
* tree (`[host]="s.presenter"`). When unset, the ambient
|
|
411
|
+
* {@link CNGX_STEPPER_HOST} from an ancestor stepper is used.
|
|
412
|
+
*/
|
|
413
|
+
readonly host: _angular_core.InputSignal<CngxStepperHost | null>;
|
|
414
|
+
private readonly injectedHost;
|
|
415
|
+
/** Resolved host: explicit input wins, else the ambient ancestor host. */
|
|
416
|
+
readonly resolvedHost: _angular_core.Signal<CngxStepperHost | null>;
|
|
417
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepperFooter, never>;
|
|
418
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStepperFooter, "cngx-stepper-footer", ["cngxStepperFooter"], { "host": { "alias": "host"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStepperFooterStart]", "[cngxStepperFooterCenter]", "[cngxStepperFooterEnd]"], true, never>;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Marker for the footer's leading region (inline-start). Place on the
|
|
423
|
+
* element you want in the start slot - typically a Back control.
|
|
424
|
+
*
|
|
425
|
+
* ```html
|
|
426
|
+
* <button cngxStepperFooterStart cngxStepperPrevious>Back</button>
|
|
427
|
+
* ```
|
|
428
|
+
*
|
|
429
|
+
* @category ui/stepper
|
|
430
|
+
* @since 0.1.0
|
|
431
|
+
* @relatedTo CngxStepperFooter, CngxStepperFooterCenter, CngxStepperFooterEnd
|
|
432
|
+
*/
|
|
433
|
+
declare class CngxStepperFooterStart {
|
|
434
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepperFooterStart, never>;
|
|
435
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStepperFooterStart, "[cngxStepperFooterStart]", never, {}, {}, never, never, true, never>;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Marker for the footer's center region - a progress hint, a
|
|
439
|
+
* `<cngx-stepper-count>`, or a "50% complete" caption.
|
|
440
|
+
*
|
|
441
|
+
* @category ui/stepper
|
|
442
|
+
* @since 0.1.0
|
|
443
|
+
* @relatedTo CngxStepperFooter, CngxStepperFooterStart, CngxStepperFooterEnd
|
|
444
|
+
*/
|
|
445
|
+
declare class CngxStepperFooterCenter {
|
|
446
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepperFooterCenter, never>;
|
|
447
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStepperFooterCenter, "[cngxStepperFooterCenter]", never, {}, {}, never, never, true, never>;
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Marker for the footer's trailing region (inline-end) - typically a
|
|
451
|
+
* Continue / Finish control, optionally preceded by a "Save draft".
|
|
452
|
+
*
|
|
453
|
+
* @category ui/stepper
|
|
454
|
+
* @since 0.1.0
|
|
455
|
+
* @relatedTo CngxStepperFooter, CngxStepperFooterStart, CngxStepperFooterCenter
|
|
456
|
+
*/
|
|
457
|
+
declare class CngxStepperFooterEnd {
|
|
458
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStepperFooterEnd, never>;
|
|
459
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStepperFooterEnd, "[cngxStepperFooterEnd]", never, {}, {}, never, never, true, never>;
|
|
127
460
|
}
|
|
128
461
|
|
|
129
|
-
export { CngxStepper };
|
|
462
|
+
export { CngxDotStepper, CngxProgressBarStepper, CngxStepper, CngxStepperFooter, CngxStepperFooterCenter, CngxStepperFooterEnd, CngxStepperFooterStart, CngxTextStepper };
|