@cngx/common 0.1.0-rc.8 → 0.1.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/command/README.md +29 -0
- package/data/README.md +5 -2
- package/fesm2022/cngx-common-a11y.mjs +403 -84
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +16 -13
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +4 -3
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +55 -36
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +60 -6
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +185 -37
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +86 -48
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +27 -23
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +324 -122
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +129 -26
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +947 -33
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +300 -166
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +251 -80
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +16 -10
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/layout/README.md +16 -0
- package/package.json +20 -7
- package/popover/README.md +40 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -4
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +10 -6
- package/types/cngx-common-a11y.d.ts +167 -14
- package/types/cngx-common-chart.d.ts +8 -7
- package/types/cngx-common-command.d.ts +19 -2
- package/types/cngx-common-data.d.ts +164 -26
- package/types/cngx-common-dialog.d.ts +3 -7
- package/types/cngx-common-interactive.d.ts +52 -17
- package/types/cngx-common-layout.d.ts +37 -5
- package/types/cngx-common-popover.d.ts +353 -13
- package/types/cngx-common-stepper.d.ts +168 -129
- package/types/cngx-common-tabs.d.ts +149 -30
- package/types/cngx-common-timeline.d.ts +27 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Signal, InjectionToken, TemplateRef, OnInit, EnvironmentProviders, Provider, AfterContentInit,
|
|
2
|
+
import { Signal, InjectionToken, TemplateRef, OnInit, EnvironmentProviders, Provider, AfterContentInit, Injector } from '@angular/core';
|
|
3
|
+
import { CngxTransitionOutcome, CngxCommitController } from '@cngx/common/data';
|
|
3
4
|
import { CngxAsyncState, StatusTransition } from '@cngx/core/utils';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
import * as i1 from '@cngx/common/interactive';
|
|
6
7
|
import { CngxErrorAggregatorContract, SwipeDirection } from '@cngx/common/interactive';
|
|
7
8
|
import { CngxMessage } from '@cngx/core/i18n';
|
|
8
9
|
import { CngxDirection } from '@cngx/core';
|
|
9
|
-
import { CngxCommitController } from '@cngx/common/data';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Status enum for a single step. Driven by the presenter's commit-controller
|
|
@@ -178,11 +178,22 @@ interface CngxStepperHost {
|
|
|
178
178
|
*/
|
|
179
179
|
readonly commitTransition: StatusTransition;
|
|
180
180
|
/**
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
181
|
+
* Settle record of the most recent commit that did not land:
|
|
182
|
+
* `kind: 'refused'` when `commitAction` answered `false`, `'failed'`
|
|
183
|
+
* when it threw, rejected or errored; `index` is the rejected target,
|
|
184
|
+
* `sequence` is bumped once per settled refusal or failure. Kept
|
|
185
|
+
* through {@link clearLastFailed} (which only hides the marker), so the
|
|
186
|
+
* announcement record survives a cleared decoration; dropped by
|
|
187
|
+
* `reset()`. A refusal leaves `commitState` at `'idle'` with its data
|
|
188
|
+
* intact, so this is the only place a refusal is visible as such.
|
|
189
|
+
*/
|
|
190
|
+
readonly lastOutcome: Signal<CngxTransitionOutcome | undefined>;
|
|
191
|
+
/**
|
|
192
|
+
* Index of the most recently rejected (refused or failed) commit
|
|
193
|
+
* target, or `undefined` when no rejection marker is shown. Derived
|
|
194
|
+
* from {@link lastOutcome}; cleared by a successful re-pick of the
|
|
195
|
+
* same target or via {@link clearLastFailed}. Drives strip rejection
|
|
196
|
+
* decoration and the `commitRolledBackTo` chain in `liveAnnouncement`.
|
|
186
197
|
*/
|
|
187
198
|
readonly lastFailedIndex: Signal<number | undefined>;
|
|
188
199
|
/**
|
|
@@ -206,8 +217,9 @@ interface CngxStepperHost {
|
|
|
206
217
|
selectById(id: string): void;
|
|
207
218
|
reset(): void;
|
|
208
219
|
/**
|
|
209
|
-
* Drop the persisted {@link lastFailedIndex}
|
|
210
|
-
* safe to wire to a Dismiss button or aggregator-cleared.
|
|
220
|
+
* Drop the persisted {@link lastFailedIndex} marker. Idempotent;
|
|
221
|
+
* safe to wire to a Dismiss button or aggregator-cleared. Leaves
|
|
222
|
+
* {@link lastOutcome} untouched.
|
|
211
223
|
*/
|
|
212
224
|
clearLastFailed(): void;
|
|
213
225
|
register(handle: CngxStepRegistration, parentId?: string | null): void;
|
|
@@ -289,9 +301,13 @@ declare class CngxStepperPresenter implements CngxStepperHost {
|
|
|
289
301
|
* `linkedSignal` is shared across all consumers.
|
|
290
302
|
*/
|
|
291
303
|
readonly commitTransition: StatusTransition;
|
|
292
|
-
private readonly
|
|
304
|
+
private readonly lastOutcomeState;
|
|
305
|
+
private readonly clearedSequenceState;
|
|
306
|
+
private outcomeSequence;
|
|
293
307
|
private lastCommittedIndex;
|
|
294
308
|
private readonly originIndexDuringCommitState;
|
|
309
|
+
/** {@inheritDoc CngxStepperHost.lastOutcome} */
|
|
310
|
+
readonly lastOutcome: Signal<CngxTransitionOutcome | undefined>;
|
|
295
311
|
/** {@inheritDoc CngxStepperHost.lastFailedIndex} */
|
|
296
312
|
readonly lastFailedIndex: Signal<number | undefined>;
|
|
297
313
|
/** {@inheritDoc CngxStepperHost.originIndexDuringCommit} */
|
|
@@ -822,6 +838,10 @@ declare class CngxStepBusySpinner {
|
|
|
822
838
|
* the tabs `cngxTabRejectionIcon` slot. Renders only when
|
|
823
839
|
* `presenter.lastFailedIndex()` matches the step's flat-index.
|
|
824
840
|
*
|
|
841
|
+
* `reason` tells the two commit outcomes apart: `'refused'` when the
|
|
842
|
+
* commit action answered `false`, `'failed'` when it threw, rejected or
|
|
843
|
+
* errored. Both render the slot; pick a glyph or copy per reason.
|
|
844
|
+
*
|
|
825
845
|
* `originLabel` is the safe-harbour step's label, derived from
|
|
826
846
|
* `presenter.originIndexDuringCommit()`. May be `undefined` when the
|
|
827
847
|
* origin index is out of range (synchronous-rejection edge case);
|
|
@@ -836,6 +856,8 @@ interface CngxStepRejectionContext {
|
|
|
836
856
|
readonly originLabel: string | undefined;
|
|
837
857
|
/** The rejected step node carrying id / label / state signals. */
|
|
838
858
|
readonly node: CngxStepNode;
|
|
859
|
+
/** Why the commit did not land (`presenter.lastOutcome().kind`). */
|
|
860
|
+
readonly reason: 'refused' | 'failed';
|
|
839
861
|
}
|
|
840
862
|
/**
|
|
841
863
|
* Slot directive for the rejection-decoration template on
|
|
@@ -1009,9 +1031,9 @@ declare class CngxStepperEmpty {
|
|
|
1009
1031
|
|
|
1010
1032
|
/**
|
|
1011
1033
|
* Context passed to the `*cngxDotStepperDot` template. Drives the dot
|
|
1012
|
-
* body inside `<cngx-dot-stepper
|
|
1013
|
-
* shell -
|
|
1014
|
-
* modifiers - stays library-owned; only the dot body content becomes
|
|
1034
|
+
* body inside `<cngx-dot-stepper>` and inside the dots mobile-collapse
|
|
1035
|
+
* branch of `<cngx-stepper>`. The dot shell - role, `aria-current`,
|
|
1036
|
+
* `aria-label`, class modifiers - stays library-owned; only the dot body content becomes
|
|
1015
1037
|
* overrideable so consumers can swap the default empty body for an
|
|
1016
1038
|
* icon, glyph, or branded indicator.
|
|
1017
1039
|
*
|
|
@@ -1034,7 +1056,8 @@ interface CngxDotStepperDotContext {
|
|
|
1034
1056
|
readonly completed: boolean;
|
|
1035
1057
|
}
|
|
1036
1058
|
/**
|
|
1037
|
-
* Slot directive for the dot-body template on `<cngx-dot-stepper
|
|
1059
|
+
* Slot directive for the dot-body template on `<cngx-dot-stepper>` and on
|
|
1060
|
+
* `<cngx-stepper>` (dots mobile-collapse branch, `mobileCollapse: 'dots'`).
|
|
1038
1061
|
* Discovered via `contentChild`; cascades through
|
|
1039
1062
|
* `CNGX_STEPPER_CONFIG.templates.dotStepperDot` before falling back to
|
|
1040
1063
|
* the built-in empty body (the span itself paints the dot fill via CSS).
|
|
@@ -1174,18 +1197,6 @@ type CngxStepperGroupSummary = 'progress' | 'count' | 'status' | 'off';
|
|
|
1174
1197
|
* @category common/stepper
|
|
1175
1198
|
*/
|
|
1176
1199
|
type CngxStepperDensity = 'comfortable' | 'auto';
|
|
1177
|
-
/**
|
|
1178
|
-
* Per-step px thresholds the `density: 'auto'` ladder reacts to.
|
|
1179
|
-
* `compact` is the minimum px per step that keeps full labels; below
|
|
1180
|
-
* `minimal` px per step the strip drops to indicators-only. `compact`
|
|
1181
|
-
* must exceed `minimal`.
|
|
1182
|
-
*
|
|
1183
|
-
* @category common/stepper
|
|
1184
|
-
*/
|
|
1185
|
-
interface CngxStepperDensityBreakpoints {
|
|
1186
|
-
readonly compact: number;
|
|
1187
|
-
readonly minimal: number;
|
|
1188
|
-
}
|
|
1189
1200
|
/**
|
|
1190
1201
|
* Where the mobile auto-collapse indicator (text caption or dot row)
|
|
1191
1202
|
* sits relative to the active step's panel content under narrow
|
|
@@ -1197,15 +1208,6 @@ interface CngxStepperDensityBreakpoints {
|
|
|
1197
1208
|
* @category common/stepper
|
|
1198
1209
|
*/
|
|
1199
1210
|
type CngxStepperMobileIndicatorPosition = 'top' | 'bottom';
|
|
1200
|
-
/**
|
|
1201
|
-
* Default per-step px thresholds for the `density: 'auto'` ladder. The
|
|
1202
|
-
* literal lives on a single exported const so the runtime resolver, the
|
|
1203
|
-
* config default, and any JSDoc cross-references stay in lockstep.
|
|
1204
|
-
* Consumers override via {@link withStepperDensity}'s second argument.
|
|
1205
|
-
*
|
|
1206
|
-
* @category common/stepper
|
|
1207
|
-
*/
|
|
1208
|
-
declare const STEPPER_DEFAULT_DENSITY_BREAKPOINTS: CngxStepperDensityBreakpoints;
|
|
1209
1211
|
/**
|
|
1210
1212
|
* Stepper config surface. Resolution priority: per-instance Input
|
|
1211
1213
|
* > `provideStepperConfigAt` (viewProviders) > `provideStepperConfig`
|
|
@@ -1244,17 +1246,12 @@ interface CngxStepperConfig {
|
|
|
1244
1246
|
readonly groupCollapseSummary?: CngxStepperGroupSummary;
|
|
1245
1247
|
/**
|
|
1246
1248
|
* Space-driven density policy for the classic strip. `'auto'`
|
|
1247
|
-
*
|
|
1249
|
+
* shrinks the labels in flow (a cqi budget under `[data-density-auto]`)
|
|
1250
|
+
* instead of overflowing the strip; `'comfortable'`
|
|
1248
1251
|
* (default) keeps full labels. Orthogonal to `mobileCollapse`. Apply
|
|
1249
1252
|
* app-wide via {@link withStepperDensity}.
|
|
1250
1253
|
*/
|
|
1251
1254
|
readonly density?: CngxStepperDensity;
|
|
1252
|
-
/**
|
|
1253
|
-
* Per-step px thresholds for the `density: 'auto'` ladder. Default
|
|
1254
|
-
* {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}. Override via
|
|
1255
|
-
* {@link withStepperDensity}'s second argument.
|
|
1256
|
-
*/
|
|
1257
|
-
readonly densityBreakpoints?: CngxStepperDensityBreakpoints;
|
|
1258
1255
|
/**
|
|
1259
1256
|
* Opt-in connector rail between adjacent step indicators on the
|
|
1260
1257
|
* classic skin. Off by default. The rule is double-scoped on
|
|
@@ -1423,16 +1420,16 @@ declare function withStepperGroupCollapse(mode: CngxStepperGroupCollapse): CngxS
|
|
|
1423
1420
|
declare function withStepperGroupCollapseSummary(mode: CngxStepperGroupSummary): CngxStepperConfigFeature;
|
|
1424
1421
|
/**
|
|
1425
1422
|
* Set the app-wide space-driven density policy for the classic
|
|
1426
|
-
* `<cngx-stepper>` strip. `'auto'`
|
|
1427
|
-
*
|
|
1428
|
-
*
|
|
1429
|
-
*
|
|
1430
|
-
*
|
|
1431
|
-
*
|
|
1423
|
+
* `<cngx-stepper>` strip. `'auto'` sets `[data-density-auto]`, under
|
|
1424
|
+
* which the labels shrink in flow within a cqi budget (the step furthest
|
|
1425
|
+
* from the active one gives way first) instead of overflowing the strip;
|
|
1426
|
+
* `'comfortable'` (library default) keeps full labels at every width.
|
|
1427
|
+
* Orthogonal to the `mobileCollapse` axis; the Material twin ignores this
|
|
1428
|
+
* setting.
|
|
1432
1429
|
*
|
|
1433
1430
|
* @category common/stepper
|
|
1434
1431
|
*/
|
|
1435
|
-
declare function withStepperDensity(mode: CngxStepperDensity
|
|
1432
|
+
declare function withStepperDensity(mode: CngxStepperDensity): CngxStepperConfigFeature;
|
|
1436
1433
|
/**
|
|
1437
1434
|
* Merge ARIA labels into the cascade. Keys not provided keep their
|
|
1438
1435
|
* library defaults; per-instance overrides on the stepper still win.
|
|
@@ -1499,10 +1496,11 @@ declare function withStepGroupHeaderTemplate(template: TemplateRef<CngxStepGroup
|
|
|
1499
1496
|
*/
|
|
1500
1497
|
declare function withStepperEmptyTemplate(template: TemplateRef<void>): CngxStepperConfigFeature;
|
|
1501
1498
|
/**
|
|
1502
|
-
* Override the default `*cngxDotStepperDot` template app-wide.
|
|
1503
|
-
* `<cngx-dot-stepper>`
|
|
1504
|
-
*
|
|
1505
|
-
* (the dot fill is painted by
|
|
1499
|
+
* Override the default `*cngxDotStepperDot` template app-wide. Both dot
|
|
1500
|
+
* hosts resolve the cascade per dot - `<cngx-dot-stepper>` and the dots
|
|
1501
|
+
* mobile-collapse branch of `<cngx-stepper>`: per-instance directive >
|
|
1502
|
+
* this feature > built-in empty body (the dot fill is painted by the dot
|
|
1503
|
+
* element's CSS regardless).
|
|
1506
1504
|
*
|
|
1507
1505
|
* @category common/stepper
|
|
1508
1506
|
*/
|
|
@@ -1557,6 +1555,8 @@ interface CngxStepperTemplateBindingsOptions {
|
|
|
1557
1555
|
readonly errorSlot?: Signal<CngxStepError | undefined>;
|
|
1558
1556
|
readonly groupHeaderSlot: Signal<CngxStepGroupHeader | undefined>;
|
|
1559
1557
|
readonly emptySlot: Signal<CngxStepperEmpty | undefined>;
|
|
1558
|
+
/** Optional - only hosts with a dots branch query `*cngxDotStepperDot`; without it the config template still applies. */
|
|
1559
|
+
readonly dotSlot?: Signal<CngxDotStepperDot | undefined>;
|
|
1560
1560
|
readonly config: CngxStepperConfig;
|
|
1561
1561
|
}
|
|
1562
1562
|
/**
|
|
@@ -1574,6 +1574,7 @@ interface CngxStepperTemplateBindings {
|
|
|
1574
1574
|
readonly stepError: Signal<TemplateRef<CngxStepErrorContext> | null>;
|
|
1575
1575
|
readonly groupHeader: Signal<TemplateRef<CngxStepGroupHeaderContext> | null>;
|
|
1576
1576
|
readonly empty: Signal<TemplateRef<void> | null>;
|
|
1577
|
+
readonly dot: Signal<TemplateRef<CngxDotStepperDotContext> | null>;
|
|
1577
1578
|
}
|
|
1578
1579
|
/**
|
|
1579
1580
|
* Wires the 3-stage template cascade for the `<cngx-stepper>` skin
|
|
@@ -1610,8 +1611,14 @@ declare function createStepperTemplateBindings(opts: CngxStepperTemplateBindings
|
|
|
1610
1611
|
declare const CNGX_STEPPER_GLYPHS: {
|
|
1611
1612
|
/** Default visual for `*cngxStepBadge` when no override is bound. */
|
|
1612
1613
|
readonly errorBadge: "!";
|
|
1613
|
-
/** Default visual for `*cngxStepRejection` when no override is bound. */
|
|
1614
|
+
/** Default visual for `*cngxStepRejection` on a failed commit when no override is bound. */
|
|
1614
1615
|
readonly rejectionIcon: "!";
|
|
1616
|
+
/**
|
|
1617
|
+
* Default visual for `*cngxStepRejection` on a refused commit (the action
|
|
1618
|
+
* answered `false`). A distinct glyph, so a refusal never differs from a
|
|
1619
|
+
* failure by colour alone (WCAG 1.4.1).
|
|
1620
|
+
*/
|
|
1621
|
+
readonly refusedIcon: "⊘";
|
|
1615
1622
|
};
|
|
1616
1623
|
|
|
1617
1624
|
/**
|
|
@@ -1693,6 +1700,8 @@ interface CngxStepperStatusLanguage {
|
|
|
1693
1700
|
readonly inProgress: string;
|
|
1694
1701
|
readonly upNext: string;
|
|
1695
1702
|
readonly errored: string;
|
|
1703
|
+
/** The status word of a step whose change the commit action refused. */
|
|
1704
|
+
readonly refused: string;
|
|
1696
1705
|
}
|
|
1697
1706
|
/**
|
|
1698
1707
|
* The stepper section of a {@link CngxLanguagePack}: the copy of
|
|
@@ -1731,6 +1740,12 @@ interface CngxStepperLanguageSection {
|
|
|
1731
1740
|
readonly commitRolledBackTo: CngxMessage;
|
|
1732
1741
|
/** `{base}`: the description of a rolled-back step, `{base}` being its name. */
|
|
1733
1742
|
readonly stepRolledBack: CngxMessage;
|
|
1743
|
+
/** `{origin}`: announced when the commit action refuses a step change. */
|
|
1744
|
+
readonly commitRefused: CngxMessage;
|
|
1745
|
+
/** Announced when the commit action refuses a step change from an unlabelled step. */
|
|
1746
|
+
readonly commitRefusedGeneric: string;
|
|
1747
|
+
/** `{base}`: the description of a step whose change was refused, `{base}` being its name. */
|
|
1748
|
+
readonly stepRefused: CngxMessage;
|
|
1734
1749
|
readonly statusLabels: CngxStepperStatusLanguage;
|
|
1735
1750
|
/** `{current}`, `{count}`: the short progress caption. */
|
|
1736
1751
|
readonly textStepperFormat: CngxMessage;
|
|
@@ -1834,6 +1849,25 @@ interface CngxStepperI18n {
|
|
|
1834
1849
|
* the announcement has faded. Pillar 2.
|
|
1835
1850
|
*/
|
|
1836
1851
|
readonly stepRolledBack: (base: string) => string;
|
|
1852
|
+
/**
|
|
1853
|
+
* Origin-aware refusal phrase. Read when the commit action answered
|
|
1854
|
+
* `false` and the origin label resolves. Receives the label of the step
|
|
1855
|
+
* the user stayed on, yields e.g. `Step change not allowed - stayed on
|
|
1856
|
+
* step "Customer".`. A refusal is not a failure, so it never reads the
|
|
1857
|
+
* failure copy ({@link commitRolledBackTo}, {@link commitFailedRetry}).
|
|
1858
|
+
*/
|
|
1859
|
+
readonly commitRefused: (originLabel: string) => string;
|
|
1860
|
+
/**
|
|
1861
|
+
* Refusal phrase for an origin without a label. Twin of
|
|
1862
|
+
* {@link commitFailedRetry} for the refused outcome.
|
|
1863
|
+
*/
|
|
1864
|
+
readonly commitRefusedGeneric: string;
|
|
1865
|
+
/**
|
|
1866
|
+
* Per-step `aria-describedby` text while the step carries the marker
|
|
1867
|
+
* of a refused change. Refused twin of {@link stepRolledBack}; same
|
|
1868
|
+
* `{base}` contract.
|
|
1869
|
+
*/
|
|
1870
|
+
readonly stepRefused: (base: string) => string;
|
|
1837
1871
|
/**
|
|
1838
1872
|
* Per-state pill labels surfaced by the `stripe-status-rich` skin
|
|
1839
1873
|
* (and any future skin / variant that paints a state pill). English
|
|
@@ -1992,58 +2026,6 @@ declare function injectStepperCollapse(host: Element): Signal<boolean>;
|
|
|
1992
2026
|
*/
|
|
1993
2027
|
declare function createStepperDisplayMode(collapsed: Signal<boolean>, mobileCollapse: () => CngxStepperMobileCollapse | undefined): Signal<'classic' | 'text' | 'dots'>;
|
|
1994
2028
|
|
|
1995
|
-
/**
|
|
1996
|
-
* Resolved density rung for the classic `<cngx-stepper>` strip.
|
|
1997
|
-
* `'full'` shows every label; `'compact'` ellipsis-truncates labels;
|
|
1998
|
-
* `'minimal'` drops to indicators-only (the active step keeps its
|
|
1999
|
-
* label). Orthogonal to the `mobileCollapse` display-mode union.
|
|
2000
|
-
*
|
|
2001
|
-
* @category common/stepper
|
|
2002
|
-
*/
|
|
2003
|
-
type CngxStripDensity = 'full' | 'compact' | 'minimal';
|
|
2004
|
-
/**
|
|
2005
|
-
* Options for {@link createStripDensity}.
|
|
2006
|
-
*
|
|
2007
|
-
* @internal
|
|
2008
|
-
*/
|
|
2009
|
-
interface CngxStripDensityOptions {
|
|
2010
|
-
/** Strip container element whose width drives the density rung. */
|
|
2011
|
-
readonly element: HTMLElement;
|
|
2012
|
-
/** Current step-only count - the width budget is split across these. */
|
|
2013
|
-
readonly stepCount: () => number;
|
|
2014
|
-
/**
|
|
2015
|
-
* Resolved density policy. Only `'auto'` degrades; `'comfortable'`
|
|
2016
|
-
* (or `undefined`) short-circuits to `'full'`, preserving today's
|
|
2017
|
-
* behaviour.
|
|
2018
|
-
*/
|
|
2019
|
-
readonly density: () => 'comfortable' | 'auto' | undefined;
|
|
2020
|
-
/**
|
|
2021
|
-
* Per-step width thresholds in px. At or above `compact` px per step
|
|
2022
|
-
* the strip stays `'full'`; at or above `minimal` it is `'compact'`;
|
|
2023
|
-
* below `minimal` it is `'minimal'`. `compact` must exceed `minimal`.
|
|
2024
|
-
*/
|
|
2025
|
-
readonly breakpoints: () => {
|
|
2026
|
-
readonly compact: number;
|
|
2027
|
-
readonly minimal: number;
|
|
2028
|
-
};
|
|
2029
|
-
readonly destroyRef: DestroyRef;
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Resolves the classic strip's density rung from its own container
|
|
2033
|
-
* width against the step count and two per-step px thresholds. Pure
|
|
2034
|
-
* `create*` factory, sibling to `createStepperDisplayMode` - both derive
|
|
2035
|
-
* a rung from the space the stepper was given and return a single
|
|
2036
|
-
* `Signal`; this one measures, the other reads what CSS resolved.
|
|
2037
|
-
*
|
|
2038
|
-
* `'comfortable'` density short-circuits to `'full'` (no measurement
|
|
2039
|
-
* dependency). Before the first measurement (`width === 0`) and for an
|
|
2040
|
-
* empty strip the rung is `'full'`, so the strip never flashes
|
|
2041
|
-
* `'minimal'` on mount.
|
|
2042
|
-
*
|
|
2043
|
-
* @category common/stepper
|
|
2044
|
-
*/
|
|
2045
|
-
declare function createStripDensity(options: CngxStripDensityOptions): Signal<CngxStripDensity>;
|
|
2046
|
-
|
|
2047
2029
|
/**
|
|
2048
2030
|
* Collapsed-group summary view consumed by `<cngx-stepper>`. Resolves
|
|
2049
2031
|
* the `groupCollapseSummary` mode and the per-group `progress` / `count`
|
|
@@ -2297,10 +2279,17 @@ interface CngxStepperStateView {
|
|
|
2297
2279
|
readonly isBusy: (node: CngxStepNode) => boolean;
|
|
2298
2280
|
/**
|
|
2299
2281
|
* `true` when this step is the one a commit just rejected
|
|
2300
|
-
* (`flatIndex === lastFailedIndex`)
|
|
2301
|
-
* pessimistic / optimistic flows hit.
|
|
2282
|
+
* (`flatIndex === lastFailedIndex`), refused or failed alike. The
|
|
2283
|
+
* commit-rejection marker your pessimistic / optimistic flows hit.
|
|
2302
2284
|
*/
|
|
2303
2285
|
readonly isRejected: (node: CngxStepNode) => boolean;
|
|
2286
|
+
/**
|
|
2287
|
+
* `true` when this step carries the rejection marker AND the commit
|
|
2288
|
+
* action refused it (`lastOutcome().kind === 'refused'`). A refusal is
|
|
2289
|
+
* not an error: it marks the step but never sets `aria-invalid` or
|
|
2290
|
+
* counts towards {@link errorCount}.
|
|
2291
|
+
*/
|
|
2292
|
+
readonly isRefused: (node: CngxStepNode) => boolean;
|
|
2304
2293
|
/**
|
|
2305
2294
|
* Badge-level error: per-step `state === 'error'` OR the bound error
|
|
2306
2295
|
* aggregator's `shouldShow()`. Deliberately excludes commit rejection -
|
|
@@ -2309,11 +2298,24 @@ interface CngxStepperStateView {
|
|
|
2309
2298
|
*/
|
|
2310
2299
|
readonly hasErrorBadge: (node: CngxStepNode) => boolean;
|
|
2311
2300
|
/**
|
|
2312
|
-
*
|
|
2313
|
-
*
|
|
2314
|
-
*
|
|
2315
|
-
|
|
2316
|
-
|
|
2301
|
+
* Why the step carries a commit-rejection marker, for the `data-reason`
|
|
2302
|
+
* styling hook: `'refused'` or `'failed'` while {@link isRejected} holds,
|
|
2303
|
+
* `null` otherwise. Independent of a validation error on the same step.
|
|
2304
|
+
*/
|
|
2305
|
+
readonly rejectionReason: (node: CngxStepNode) => 'refused' | 'failed' | null;
|
|
2306
|
+
/**
|
|
2307
|
+
* Visual marker predicate - the hook the minimal skins (dot / text /
|
|
2308
|
+
* progress-bar) and the mobile dots paint (`data-state="error"`,
|
|
2309
|
+
* `--error`). `true` when {@link hasErrorBadge} fires OR the step carries
|
|
2310
|
+
* a commit rejection of either kind ({@link isRejected}). Those skins have
|
|
2311
|
+
* no separate rejection slot, so every marker shares one visual state.
|
|
2312
|
+
*/
|
|
2313
|
+
readonly hasErrorMarker: (node: CngxStepNode) => boolean;
|
|
2314
|
+
/**
|
|
2315
|
+
* Semantic error predicate - what `aria-invalid`, the errored status word
|
|
2316
|
+
* and {@link errorCount} read. `true` when {@link hasErrorBadge} fires OR
|
|
2317
|
+
* a commit failed on this step. A refused step is marked
|
|
2318
|
+
* ({@link hasErrorMarker}) but not in error.
|
|
2317
2319
|
*/
|
|
2318
2320
|
readonly hasError: (node: CngxStepNode) => boolean;
|
|
2319
2321
|
/** Count of step-only nodes where {@link hasError} is `true`. */
|
|
@@ -2322,6 +2324,21 @@ interface CngxStepperStateView {
|
|
|
2322
2324
|
readonly firstErrorIndex: Signal<number>;
|
|
2323
2325
|
/** `true` when `errorCount() > 0`. Drives skin-level `aria-invalid`. */
|
|
2324
2326
|
readonly hasAnyError: Signal<boolean>;
|
|
2327
|
+
/** Count of step-only nodes where {@link hasErrorMarker} is `true`. */
|
|
2328
|
+
readonly errorMarkerCount: Signal<number>;
|
|
2329
|
+
/** Flat index of the first marked step, or `-1` when none. */
|
|
2330
|
+
readonly firstErrorMarkerIndex: Signal<number>;
|
|
2331
|
+
/**
|
|
2332
|
+
* `true` when `errorMarkerCount() > 0`. Drives skin-level visual hooks
|
|
2333
|
+
* (`data-state="error"`); `aria-invalid` stays on {@link hasAnyError}.
|
|
2334
|
+
*/
|
|
2335
|
+
readonly hasAnyErrorMarker: Signal<boolean>;
|
|
2336
|
+
/**
|
|
2337
|
+
* `true` when steps are marked but none is in error: every marker is a
|
|
2338
|
+
* refused commit. Drives the refused tone of skin-level hooks (the
|
|
2339
|
+
* aggregate error line, the progress bar) that stand for all steps.
|
|
2340
|
+
*/
|
|
2341
|
+
readonly refusalOnly: Signal<boolean>;
|
|
2325
2342
|
}
|
|
2326
2343
|
/**
|
|
2327
2344
|
* Build the shared {@link CngxStepperStateView} over a presenter host and its
|
|
@@ -2338,14 +2355,20 @@ declare function createStepperStateView(inputs: {
|
|
|
2338
2355
|
}): CngxStepperStateView;
|
|
2339
2356
|
/**
|
|
2340
2357
|
* Aggregate error phrase shared by the minimal skins (text / progress-bar)
|
|
2341
|
-
* and the classic mobile-collapse text branch.
|
|
2342
|
-
*
|
|
2343
|
-
*
|
|
2344
|
-
*
|
|
2358
|
+
* and the classic mobile-collapse text branch. Walks the marked steps
|
|
2359
|
+
* ({@link CngxStepperStateView.hasErrorMarker}). A single marked step names
|
|
2360
|
+
* itself with the word of its kind: `"Payment: Errored"` (or the custom
|
|
2361
|
+
* reason) for an error, `"Payment: Not allowed"` for a refused step change;
|
|
2362
|
+
* several failed steps collapse to the i18n count phrase (`"2 errors"`),
|
|
2363
|
+
* which never counts a refusal. Returns `''`
|
|
2364
|
+
* when no step is marked, so the error line stays quiet.
|
|
2345
2365
|
*
|
|
2346
2366
|
* The optional `messageOf` resolver lets callers surface a per-step
|
|
2347
2367
|
* reason (a direct `[error]` string or the first aggregator label) in the
|
|
2348
|
-
* single-error case instead of the generic `errored` status word.
|
|
2368
|
+
* single-error case instead of the generic `errored` status word. The
|
|
2369
|
+
* reason is still prefixed with the step label (`"Payment: Card declined"`),
|
|
2370
|
+
* because the summary line stays visible while another step is active and
|
|
2371
|
+
* a bare reason would read as belonging to the active step. When
|
|
2349
2372
|
* omitted - or when it returns `undefined`/`''` - the helper produces
|
|
2350
2373
|
* byte-identical output to the no-resolver form, so existing callers
|
|
2351
2374
|
* (the classic mobile-collapse summary) are a guaranteed no-op.
|
|
@@ -2359,7 +2382,7 @@ declare function createStepperStateView(inputs: {
|
|
|
2359
2382
|
* @category common/stepper
|
|
2360
2383
|
* @since 0.1.0
|
|
2361
2384
|
*/
|
|
2362
|
-
declare function resolveStepperErrorSummary(view: Pick<CngxStepperStateView, 'errorCount' | 'firstErrorIndex'>, stepsOnly: Signal<readonly CngxStepNode[]>, i18n: CngxStepperI18n, messageOf?: (node: CngxStepNode) => string | undefined): string;
|
|
2385
|
+
declare function resolveStepperErrorSummary(view: Pick<CngxStepperStateView, 'errorMarkerCount' | 'firstErrorMarkerIndex' | 'errorCount' | 'firstErrorIndex' | 'isRefused' | 'hasErrorBadge'>, stepsOnly: Signal<readonly CngxStepNode[]>, i18n: CngxStepperI18n, messageOf?: (node: CngxStepNode) => string | undefined): string;
|
|
2363
2386
|
|
|
2364
2387
|
/**
|
|
2365
2388
|
* Input bundle for {@link createStepperSlotContextBuilders}: the presenter
|
|
@@ -2402,6 +2425,8 @@ interface CngxStepperSlotContextBuilders {
|
|
|
2402
2425
|
readonly groupHeaderContextFor: (node: CngxStepNode) => CngxStepGroupHeaderContext;
|
|
2403
2426
|
readonly stepLabelContextFor: (node: CngxStepNode) => CngxStepLabelContext;
|
|
2404
2427
|
readonly stepContentContextFor: (node: CngxStepNode) => CngxStepContentContext;
|
|
2428
|
+
/** Context of the `*cngxDotStepperDot` body in the dots mobile-collapse branch. */
|
|
2429
|
+
readonly dotContextFor: (node: CngxStepNode) => CngxDotStepperDotContext;
|
|
2405
2430
|
}
|
|
2406
2431
|
/**
|
|
2407
2432
|
* Bundle the `*ContextFor` slot-context builders plus the small
|
|
@@ -2438,14 +2463,17 @@ interface CngxStepperAnnouncementBuilders {
|
|
|
2438
2463
|
/**
|
|
2439
2464
|
* Live-region content driven by the commit transition tracker.
|
|
2440
2465
|
* Empty string between transitions keeps the region quiet on no-op
|
|
2441
|
-
* CD ticks.
|
|
2442
|
-
*
|
|
2443
|
-
*
|
|
2466
|
+
* CD ticks. A refusal speaks `commitRefused(originLabel)` (or
|
|
2467
|
+
* `commitRefusedGeneric` without a label) once and holds it until the
|
|
2468
|
+
* next commit, step move or reset. Error-arm priority:
|
|
2469
|
+
* `commitRolledBackTo(originLabel)` when both `lastFailedIndex` and a
|
|
2470
|
+
* resolvable origin label exist; otherwise `commitFailedRetry`.
|
|
2444
2471
|
*/
|
|
2445
2472
|
readonly liveAnnouncement: Signal<string>;
|
|
2446
2473
|
/**
|
|
2447
2474
|
* SR descriptor phrase. Aggregator-announced or "Step N of M: <label>";
|
|
2448
|
-
* routes
|
|
2475
|
+
* routes a refused row through `stepRefused(base)` and a failed row
|
|
2476
|
+
* through `stepRolledBack(base)`.
|
|
2449
2477
|
*/
|
|
2450
2478
|
readonly statusPhrase: (node: CngxStepNode) => string;
|
|
2451
2479
|
/**
|
|
@@ -2645,6 +2673,7 @@ declare class CngxStepperCount {
|
|
|
2645
2673
|
* (which may itself be language-dependent) are read untracked.
|
|
2646
2674
|
*/
|
|
2647
2675
|
protected readonly liveLabel: Signal<string>;
|
|
2676
|
+
constructor();
|
|
2648
2677
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxStepperCount, never>;
|
|
2649
2678
|
static ɵcmp: i0.ɵɵComponentDeclaration<CngxStepperCount, "cngx-stepper-count", never, { "live": { "alias": "live"; "required": false; "isSignal": true; }; "format": { "alias": "format"; "required": false; "isSignal": true; }; "host": { "alias": "host"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
2650
2679
|
}
|
|
@@ -2826,6 +2855,14 @@ declare class CngxStepperComplete {
|
|
|
2826
2855
|
*/
|
|
2827
2856
|
declare function createStepperHostProxy(supplier: () => CngxStepperHost | null): CngxStepperHost;
|
|
2828
2857
|
|
|
2858
|
+
/**
|
|
2859
|
+
* How a commit-gated step change settled. `'refused'` is a `false` answer
|
|
2860
|
+
* from `commitAction` (the action declined on purpose, nothing failed);
|
|
2861
|
+
* `'failed'` is a throw, a rejected promise or an erroring observable.
|
|
2862
|
+
*
|
|
2863
|
+
* @category common/stepper
|
|
2864
|
+
*/
|
|
2865
|
+
type CngxStepperCommitResolution = 'accepted' | 'refused' | 'failed';
|
|
2829
2866
|
/**
|
|
2830
2867
|
* Adapter between the lifted commit-controller and the stepper's
|
|
2831
2868
|
* action shape. The presenter delegates to `beginTransition` on
|
|
@@ -2838,10 +2875,11 @@ interface CngxStepperCommitHandler {
|
|
|
2838
2875
|
* Start a transition commit. Returns synchronously; the controller's
|
|
2839
2876
|
* `state` signal reports the in-flight status.
|
|
2840
2877
|
*
|
|
2841
|
-
* @param onResolve fires `
|
|
2842
|
-
*
|
|
2878
|
+
* @param onResolve fires `'accepted'` when the action answers `true`,
|
|
2879
|
+
* `'refused'` when it answers `false`, `'failed'` when
|
|
2880
|
+
* it throws, rejects or errors; skipped on supersede.
|
|
2843
2881
|
*/
|
|
2844
|
-
beginTransition(fromIndex: number, toIndex: number, action: CngxStepperCommitAction, onResolve: (
|
|
2882
|
+
beginTransition(fromIndex: number, toIndex: number, action: CngxStepperCommitAction, onResolve: (outcome: CngxStepperCommitResolution) => void): void;
|
|
2845
2883
|
/** Cancel the in-flight transition without firing callbacks. */
|
|
2846
2884
|
cancel(): void;
|
|
2847
2885
|
/** Live `pending` flag from the controller. */
|
|
@@ -2858,7 +2896,8 @@ interface CngxStepperCommitHandlerOptions {
|
|
|
2858
2896
|
/**
|
|
2859
2897
|
* Build a stepper commit handler over an existing {@link CngxCommitController}.
|
|
2860
2898
|
* Resolves `Observable<boolean>` / `Promise<boolean>` / `boolean` returns into
|
|
2861
|
-
*
|
|
2899
|
+
* one {@link CngxStepperCommitResolution}: `true` accepts, `false` refuses
|
|
2900
|
+
* (the controller settles to `'idle'` and stores no error), a throw fails.
|
|
2862
2901
|
*
|
|
2863
2902
|
* @category common/stepper
|
|
2864
2903
|
*/
|
|
@@ -2937,5 +2976,5 @@ declare function provideCngxStepper(...features: readonly CngxStepperFeature[]):
|
|
|
2937
2976
|
*/
|
|
2938
2977
|
declare function provideCngxStepperAt(...features: readonly CngxStepperFeature[]): Provider[];
|
|
2939
2978
|
|
|
2940
|
-
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, CNGX_STEPPER_LANGUAGE_EN, CNGX_STEP_GROUP_HOST, CNGX_STEP_PANEL_HOST, CngxDotStepperDot, CngxStep, CngxStepBadge, CngxStepBusySpinner, CngxStepContent, CngxStepError, CngxStepGroup, CngxStepGroupHeader, CngxStepIndicator, CngxStepLabel, CngxStepRejection, CngxStepperComplete, CngxStepperCount, CngxStepperEmpty, CngxStepperNext, CngxStepperPresenter, CngxStepperPrevious, CngxStepperRouterSync, CngxStepperSwipeNav,
|
|
2941
|
-
export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAccnameInputs, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperDensity,
|
|
2979
|
+
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, CNGX_STEPPER_LANGUAGE_EN, CNGX_STEP_GROUP_HOST, CNGX_STEP_PANEL_HOST, CngxDotStepperDot, CngxStep, CngxStepBadge, CngxStepBusySpinner, CngxStepContent, CngxStepError, CngxStepGroup, CngxStepGroupHeader, CngxStepIndicator, CngxStepLabel, CngxStepRejection, CngxStepperComplete, CngxStepperCount, CngxStepperEmpty, CngxStepperNext, CngxStepperPresenter, CngxStepperPrevious, CngxStepperRouterSync, CngxStepperSwipeNav, createStepperAccname, createStepperAnnouncementBuilders, createStepperCommitHandler, createStepperDisplayMode, createStepperGroupNavigation, createStepperGroupSummary, createStepperHostAttrs, createStepperHostProxy, createStepperPanelRefs, createStepperSlotContextBuilders, createStepperStateView, createStepperStripKeyboardNav, createStepperTemplateBindings, flatStepsEqual, injectStepperCollapse, injectStepperConfig, injectStepperI18n, provideCngxStepper, provideCngxStepperAt, provideStepperConfig, provideStepperConfigAt, provideStepperI18n, resolveStepperErrorSummary, resolveStepperStatusLabel, withDotStepperDotTemplate, withStepBadgeTemplate, withStepBusySpinnerTemplate, withStepErrorTemplate, withStepGroupHeaderTemplate, withStepIndicatorTemplate, withStepRejectionTemplate, withStepperAriaLabels, withStepperCommitMode, withStepperConnectors, withStepperDefaultOrientation, withStepperDensity, withStepperEmptyTemplate, withStepperFallbackLabels, withStepperGroupCollapse, withStepperGroupCollapseSummary, withStepperHeaderNavigation, withStepperI18nLabels, withStepperLinear, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
|
|
2980
|
+
export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAccnameInputs, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperCommitResolution, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperDensity, CngxStepperFallbackLabels, CngxStepperFeature, CngxStepperGroupCollapse, CngxStepperGroupNavigationOptions, CngxStepperGroupNavigationView, CngxStepperGroupSummary, CngxStepperGroupSummaryOptions, CngxStepperGroupSummaryView, CngxStepperHeaderNavigation, CngxStepperHost, CngxStepperHostAttrs, CngxStepperHostAttrsInputs, CngxStepperI18n, CngxStepperI18nFeature, CngxStepperI18nOverrides, CngxStepperLanguageSection, CngxStepperMobileCollapse, CngxStepperMobileIndicatorPosition, CngxStepperPanelRefs, CngxStepperPanelRefsInputs, CngxStepperSkin, CngxStepperSlotContextBuilders, CngxStepperSlotContextBuildersInputs, CngxStepperStateView, CngxStepperStatusLabels, CngxStepperStatusLanguage, CngxStepperStripKeyboardNavOptions, CngxStepperTemplateBindings, CngxStepperTemplateBindingsOptions, CngxStepperTemplates };
|