@cngx/common 0.1.0-rc.1 → 0.1.0-rc.3
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/data/README.md +10 -3
- package/fesm2022/cngx-common-data.mjs +379 -57
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +318 -5
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +532 -151
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/package.json +2 -2
- package/stepper/README.md +0 -13
- package/types/cngx-common-data.d.ts +446 -41
- package/types/cngx-common-stepper.d.ts +350 -6
- package/types/cngx-common-tabs.d.ts +586 -191
- package/tabs/README.md +0 -32
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Signal, InjectionToken, TemplateRef, EnvironmentProviders, Provider, DestroyRef } from '@angular/core';
|
|
2
|
+
import { Signal, InjectionToken, TemplateRef, EnvironmentProviders, Provider, DestroyRef, Injector } from '@angular/core';
|
|
3
3
|
import { CngxAsyncState, StatusTransition } from '@cngx/core/utils';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import * as i1 from '@cngx/common/interactive';
|
|
@@ -89,8 +89,32 @@ interface CngxStepperHost {
|
|
|
89
89
|
* @category common/stepper
|
|
90
90
|
*/
|
|
91
91
|
readonly stepsOnly: Signal<readonly CngxStepNode[]>;
|
|
92
|
+
/**
|
|
93
|
+
* Flat strip projection under the focus-driven group-collapse policy:
|
|
94
|
+
* identical to {@link flatSteps} when `groupCollapse` is `'off'`, and
|
|
95
|
+
* with every non-active root-level group's children dropped (header
|
|
96
|
+
* node alone) under `'expand-active'`. The strip `@for` reads this;
|
|
97
|
+
* `stepsOnly` stays the single counting / announcement source.
|
|
98
|
+
*
|
|
99
|
+
* **Contract:** variant and skin organisms drive the strip off this
|
|
100
|
+
* projection, never re-derive it. Structural-equal via `flatStepsEqual`
|
|
101
|
+
* (each retained node keeps its `flatSteps` `flatIndex`), so a
|
|
102
|
+
* shape-stable re-emit short-circuits the strip render.
|
|
103
|
+
*
|
|
104
|
+
* @category common/stepper
|
|
105
|
+
*/
|
|
106
|
+
readonly visibleStripNodes: Signal<readonly CngxStepNode[]>;
|
|
92
107
|
readonly activeStepIndex: Signal<number>;
|
|
93
108
|
readonly activeStepId: Signal<string | null>;
|
|
109
|
+
/**
|
|
110
|
+
* Root-level group whose subtree contains the active step, or `null`
|
|
111
|
+
* when the active step is a root-level step (e.g. a trailing
|
|
112
|
+
* `Finish`). The single focus-driven-collapse source: atoms read it
|
|
113
|
+
* via this contract, never the concrete presenter. Drives
|
|
114
|
+
* `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and
|
|
115
|
+
* {@link visibleStripNodes}.
|
|
116
|
+
*/
|
|
117
|
+
readonly activeGroupId: Signal<string | null>;
|
|
94
118
|
/** Step-only count - the length of {@link stepsOnly}. */
|
|
95
119
|
readonly stepCount: Signal<number>;
|
|
96
120
|
/** `true` when the active step is the first one (no earlier step). */
|
|
@@ -265,6 +289,30 @@ declare class CngxStepperPresenter implements CngxStepperHost {
|
|
|
265
289
|
readonly stepsOnly: Signal<readonly CngxStepNode[]>;
|
|
266
290
|
private readonly clampedIndex;
|
|
267
291
|
readonly activeStepId: Signal<string | null>;
|
|
292
|
+
/**
|
|
293
|
+
* {@inheritDoc CngxStepperHost.activeGroupId}
|
|
294
|
+
*
|
|
295
|
+
* Single derivation over `activeStepId` and `stepTree` - the root-level
|
|
296
|
+
* group whose subtree holds the active step, or `null` for a
|
|
297
|
+
* root-level active step (e.g. a trailing `Finish`). Walked once here;
|
|
298
|
+
* `CngxStepGroup.isCollapsed`, the strip `aria-expanded` binding, and
|
|
299
|
+
* `visibleStripNodes` read this rather than re-walking the tree.
|
|
300
|
+
*/
|
|
301
|
+
readonly activeGroupId: Signal<string | null>;
|
|
302
|
+
/**
|
|
303
|
+
* {@inheritDoc CngxStepperHost.visibleStripNodes}
|
|
304
|
+
*
|
|
305
|
+
* Flat strip projection honouring the focus-driven group-collapse
|
|
306
|
+
* policy. Under `'off'` it returns `flatSteps()` verbatim (same
|
|
307
|
+
* reference, so the `equal` short-circuits). Under `'expand-active'`
|
|
308
|
+
* every non-active root-level group's subtree is dropped, leaving the
|
|
309
|
+
* group header node alone - the active group and all root-level steps
|
|
310
|
+
* stay. Each retained node keeps its canonical `flatIndex` from
|
|
311
|
+
* `flatSteps`, so per-step state/announcement lookups are unaffected.
|
|
312
|
+
* Returns a fresh array, so it MUST carry `{ equal: flatStepsEqual }`
|
|
313
|
+
* or every re-emit cascades the strip `@for`.
|
|
314
|
+
*/
|
|
315
|
+
readonly visibleStripNodes: Signal<readonly CngxStepNode[]>;
|
|
268
316
|
readonly commitState: CngxAsyncState<number | undefined>;
|
|
269
317
|
/**
|
|
270
318
|
* Next enabled step-only index after the active one, skipping
|
|
@@ -452,7 +500,7 @@ declare function flatStepsEqual(a: readonly CngxStepNode[], b: readonly CngxStep
|
|
|
452
500
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-content.directive.ts
|
|
453
501
|
* @since 0.1.0
|
|
454
502
|
* @relatedTo CngxStep, CngxStepLabel
|
|
455
|
-
* <example-url>http://localhost:4200/#/ui/stepper/stepper-
|
|
503
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
|
|
456
504
|
*/
|
|
457
505
|
declare class CngxStepContent {
|
|
458
506
|
readonly templateRef: TemplateRef<CngxStepContentContext>;
|
|
@@ -499,7 +547,7 @@ declare class CngxStepLabel {
|
|
|
499
547
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step.directive.ts
|
|
500
548
|
* @since 0.1.0
|
|
501
549
|
* @relatedTo CngxStepGroup, CngxStepperPresenter, CngxStepLabel, CngxStepContent
|
|
502
|
-
* <example-url>http://localhost:4200/#/ui/stepper/stepper-
|
|
550
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
|
|
503
551
|
*/
|
|
504
552
|
declare class CngxStep {
|
|
505
553
|
readonly id: i0.InputSignal<string>;
|
|
@@ -553,14 +601,31 @@ declare class CngxStep {
|
|
|
553
601
|
* @since 0.1.0
|
|
554
602
|
* @relatedTo CngxStep, CngxStepperPresenter, CngxStepGroupHeader
|
|
555
603
|
* <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-nested-steps-trailing-root-step</example-url>
|
|
604
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/expand-active-group-collapse</example-url>
|
|
605
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-hierarchical/group-collapse-summary-count</example-url>
|
|
556
606
|
*/
|
|
557
607
|
declare class CngxStepGroup implements CngxStepGroupHost {
|
|
558
608
|
readonly id: i0.InputSignal<string>;
|
|
559
609
|
readonly disabled: i0.InputSignal<boolean>;
|
|
560
610
|
readonly label: i0.InputSignal<string>;
|
|
611
|
+
private readonly config;
|
|
561
612
|
private readonly childRegistry;
|
|
562
613
|
readonly aggregatedStatus: Signal<CngxStepStatus>;
|
|
563
614
|
private readonly stepperHost;
|
|
615
|
+
/**
|
|
616
|
+
* `true` when this group's children are collapsed to the header node:
|
|
617
|
+
* the focus-driven policy is `'expand-active'`, this group does not
|
|
618
|
+
* hold the active step, and it has at least one child. Pure
|
|
619
|
+
* `computed()` over the host's `activeGroupId` + the resolved policy -
|
|
620
|
+
* never toggled in an event handler (Pillar 1).
|
|
621
|
+
*
|
|
622
|
+
* Consumer-readable via `exportAs: 'cngxStepGroup'` (e.g.
|
|
623
|
+
* `#g="cngxStepGroup"` then `g.isCollapsed()`). The rendered strip
|
|
624
|
+
* group header owns the reactive `aria-expanded` disclosure attribute
|
|
625
|
+
* (`<cngx-stepper>` `groupAriaExpanded`); the projected `[cngxStepGroup]`
|
|
626
|
+
* host element is not rendered in the strip, so it carries no ARIA.
|
|
627
|
+
*/
|
|
628
|
+
readonly isCollapsed: Signal<boolean>;
|
|
564
629
|
constructor();
|
|
565
630
|
register(handle: CngxStepRegistration): void;
|
|
566
631
|
unregister(id: string): void;
|
|
@@ -952,7 +1017,6 @@ interface CngxDotStepperDotContext {
|
|
|
952
1017
|
* @since 0.1.0
|
|
953
1018
|
* @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepBusySpinner, CngxStepRejection
|
|
954
1019
|
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>
|
|
955
|
-
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>
|
|
956
1020
|
*/
|
|
957
1021
|
declare class CngxDotStepperDot {
|
|
958
1022
|
readonly templateRef: TemplateRef<CngxDotStepperDotContext>;
|
|
@@ -1031,6 +1095,51 @@ type CngxStepperMobileCollapse = 'text' | 'dots' | 'off';
|
|
|
1031
1095
|
* @category common/stepper
|
|
1032
1096
|
*/
|
|
1033
1097
|
type CngxStepperHeaderNavigation = 'none' | 'visited';
|
|
1098
|
+
/**
|
|
1099
|
+
* Focus-driven group-collapse policy for grouped `<cngx-stepper>` flows.
|
|
1100
|
+
* `'expand-active'` collapses every non-active `cngxStepGroup` branch to
|
|
1101
|
+
* its header node and expands only the group holding the active step;
|
|
1102
|
+
* `'off'` (default) keeps every group's children rendered in the strip -
|
|
1103
|
+
* the browser-native baseline. Orthogonal to the `mobileCollapse` axis;
|
|
1104
|
+
* the two never edit each other. The Material twin (`[cngxMatStepper]`)
|
|
1105
|
+
* ignores this setting.
|
|
1106
|
+
*
|
|
1107
|
+
* @category common/stepper
|
|
1108
|
+
*/
|
|
1109
|
+
type CngxStepperGroupCollapse = 'expand-active' | 'off';
|
|
1110
|
+
/**
|
|
1111
|
+
* What a collapsed `cngxStepGroup` header shows next to its label under
|
|
1112
|
+
* `groupCollapse: 'expand-active'`. `'progress'` (default) shows
|
|
1113
|
+
* completed/total steps; `'count'` shows the step count; `'status'`
|
|
1114
|
+
* shows a status dot coloured by the group's rolled-up state; `'off'`
|
|
1115
|
+
* shows the bare label. Only ever rendered on a collapsed group header.
|
|
1116
|
+
*
|
|
1117
|
+
* @category common/stepper
|
|
1118
|
+
*/
|
|
1119
|
+
type CngxStepperGroupSummary = 'progress' | 'count' | 'status' | 'off';
|
|
1120
|
+
/**
|
|
1121
|
+
* Space-driven density policy for the classic `<cngx-stepper>` strip.
|
|
1122
|
+
* `'auto'` degrades the strip on its own container width
|
|
1123
|
+
* (full labels -> ellipsis-truncated -> indicators-only with the active
|
|
1124
|
+
* label kept); `'comfortable'` (default) keeps full labels at every
|
|
1125
|
+
* width. Orthogonal to `mobileCollapse` and `groupCollapse`; the
|
|
1126
|
+
* Material twin ignores this setting.
|
|
1127
|
+
*
|
|
1128
|
+
* @category common/stepper
|
|
1129
|
+
*/
|
|
1130
|
+
type CngxStepperDensity = 'comfortable' | 'auto';
|
|
1131
|
+
/**
|
|
1132
|
+
* Per-step px thresholds the `density: 'auto'` ladder reacts to.
|
|
1133
|
+
* `compact` is the minimum px per step that keeps full labels; below
|
|
1134
|
+
* `minimal` px per step the strip drops to indicators-only. `compact`
|
|
1135
|
+
* must exceed `minimal`.
|
|
1136
|
+
*
|
|
1137
|
+
* @category common/stepper
|
|
1138
|
+
*/
|
|
1139
|
+
interface CngxStepperDensityBreakpoints {
|
|
1140
|
+
readonly compact: number;
|
|
1141
|
+
readonly minimal: number;
|
|
1142
|
+
}
|
|
1034
1143
|
/**
|
|
1035
1144
|
* Where the mobile auto-collapse indicator (text caption or dot row)
|
|
1036
1145
|
* sits relative to the active step's panel content under narrow
|
|
@@ -1051,6 +1160,15 @@ type CngxStepperMobileIndicatorPosition = 'top' | 'bottom';
|
|
|
1051
1160
|
* @category common/stepper
|
|
1052
1161
|
*/
|
|
1053
1162
|
declare const STEPPER_DEFAULT_MOBILE_BREAKPOINT = "(max-width: 480px)";
|
|
1163
|
+
/**
|
|
1164
|
+
* Default per-step px thresholds for the `density: 'auto'` ladder. The
|
|
1165
|
+
* literal lives on a single exported const so the runtime resolver, the
|
|
1166
|
+
* config default, and any JSDoc cross-references stay in lockstep.
|
|
1167
|
+
* Consumers override via {@link withStepperDensity}'s second argument.
|
|
1168
|
+
*
|
|
1169
|
+
* @category common/stepper
|
|
1170
|
+
*/
|
|
1171
|
+
declare const STEPPER_DEFAULT_DENSITY_BREAKPOINTS: CngxStepperDensityBreakpoints;
|
|
1054
1172
|
/**
|
|
1055
1173
|
* Stepper config surface. Resolution priority: per-instance Input
|
|
1056
1174
|
* > `provideStepperConfigAt` (viewProviders) > `provideStepperConfig`
|
|
@@ -1072,6 +1190,34 @@ interface CngxStepperConfig {
|
|
|
1072
1190
|
* Per-instance `[headerNavigation]` Input still wins.
|
|
1073
1191
|
*/
|
|
1074
1192
|
readonly headerNavigation?: CngxStepperHeaderNavigation;
|
|
1193
|
+
/**
|
|
1194
|
+
* Focus-driven group-collapse policy. `'expand-active'` collapses
|
|
1195
|
+
* non-active `cngxStepGroup` branches to their header node and expands
|
|
1196
|
+
* only the active group; `'off'` (default) keeps the full strip.
|
|
1197
|
+
* Orthogonal to `mobileCollapse`. Apply app-wide via
|
|
1198
|
+
* {@link withStepperGroupCollapse}.
|
|
1199
|
+
*/
|
|
1200
|
+
readonly groupCollapse?: CngxStepperGroupCollapse;
|
|
1201
|
+
/**
|
|
1202
|
+
* What a collapsed `cngxStepGroup` header shows beside its label.
|
|
1203
|
+
* Default `'progress'` (completed/total). Only applies when
|
|
1204
|
+
* `groupCollapse` is `'expand-active'`. Set via
|
|
1205
|
+
* {@link withStepperGroupCollapseSummary}.
|
|
1206
|
+
*/
|
|
1207
|
+
readonly groupCollapseSummary?: CngxStepperGroupSummary;
|
|
1208
|
+
/**
|
|
1209
|
+
* Space-driven density policy for the classic strip. `'auto'`
|
|
1210
|
+
* degrades labels on the strip's own container width; `'comfortable'`
|
|
1211
|
+
* (default) keeps full labels. Orthogonal to `mobileCollapse`. Apply
|
|
1212
|
+
* app-wide via {@link withStepperDensity}.
|
|
1213
|
+
*/
|
|
1214
|
+
readonly density?: CngxStepperDensity;
|
|
1215
|
+
/**
|
|
1216
|
+
* Per-step px thresholds for the `density: 'auto'` ladder. Default
|
|
1217
|
+
* {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}. Override via
|
|
1218
|
+
* {@link withStepperDensity}'s second argument.
|
|
1219
|
+
*/
|
|
1220
|
+
readonly densityBreakpoints?: CngxStepperDensityBreakpoints;
|
|
1075
1221
|
/**
|
|
1076
1222
|
* Opt-in connector rail between adjacent step indicators on the
|
|
1077
1223
|
* classic skin. Off by default. The rule is double-scoped on
|
|
@@ -1229,6 +1375,39 @@ declare function withStepperMobileSwipe(enabled: boolean): CngxStepperConfigFeat
|
|
|
1229
1375
|
* @category common/stepper
|
|
1230
1376
|
*/
|
|
1231
1377
|
declare function withStepperHeaderNavigation(mode: CngxStepperHeaderNavigation): CngxStepperConfigFeature;
|
|
1378
|
+
/**
|
|
1379
|
+
* Set the app-wide focus-driven group-collapse policy for grouped
|
|
1380
|
+
* `<cngx-stepper>` flows. `'expand-active'` collapses every non-active
|
|
1381
|
+
* `cngxStepGroup` branch to its header node and expands only the group
|
|
1382
|
+
* holding the active step; `'off'` (library default) keeps the full
|
|
1383
|
+
* strip. Orthogonal to the `mobileCollapse` axis. The Material twin
|
|
1384
|
+
* ignores this setting.
|
|
1385
|
+
*
|
|
1386
|
+
* @category common/stepper
|
|
1387
|
+
*/
|
|
1388
|
+
declare function withStepperGroupCollapse(mode: CngxStepperGroupCollapse): CngxStepperConfigFeature;
|
|
1389
|
+
/**
|
|
1390
|
+
* Choose what a collapsed `cngxStepGroup` header shows beside its label
|
|
1391
|
+
* under `groupCollapse: 'expand-active'`. `'progress'` (library default)
|
|
1392
|
+
* shows completed/total steps; `'count'` the step count; `'status'` a
|
|
1393
|
+
* status dot coloured by the group's rolled-up state; `'off'` the bare
|
|
1394
|
+
* label. No effect unless `groupCollapse` is `'expand-active'`.
|
|
1395
|
+
*
|
|
1396
|
+
* @category common/stepper
|
|
1397
|
+
*/
|
|
1398
|
+
declare function withStepperGroupCollapseSummary(mode: CngxStepperGroupSummary): CngxStepperConfigFeature;
|
|
1399
|
+
/**
|
|
1400
|
+
* Set the app-wide space-driven density policy for the classic
|
|
1401
|
+
* `<cngx-stepper>` strip. `'auto'` degrades labels on the strip's own
|
|
1402
|
+
* container width (full -> compact -> minimal); `'comfortable'`
|
|
1403
|
+
* (library default) keeps full labels at every width. The optional
|
|
1404
|
+
* second argument overrides the per-step px thresholds (default
|
|
1405
|
+
* {@link STEPPER_DEFAULT_DENSITY_BREAKPOINTS}). Orthogonal to the
|
|
1406
|
+
* `mobileCollapse` axis; the Material twin ignores this setting.
|
|
1407
|
+
*
|
|
1408
|
+
* @category common/stepper
|
|
1409
|
+
*/
|
|
1410
|
+
declare function withStepperDensity(mode: CngxStepperDensity, breakpoints?: CngxStepperDensityBreakpoints): CngxStepperConfigFeature;
|
|
1232
1411
|
/**
|
|
1233
1412
|
* Merge ARIA labels into the cascade. Keys not provided keep their
|
|
1234
1413
|
* library defaults; per-instance overrides on the stepper still win.
|
|
@@ -1625,6 +1804,162 @@ declare function createMobileViewportSignal(mediaQuery: string, destroyRef: Dest
|
|
|
1625
1804
|
*/
|
|
1626
1805
|
declare function createStepperDisplayMode(mediaQuery: string, mobileCollapse: () => CngxStepperMobileCollapse | undefined, destroyRef: DestroyRef): Signal<'classic' | 'text' | 'dots'>;
|
|
1627
1806
|
|
|
1807
|
+
/**
|
|
1808
|
+
* Resolved density rung for the classic `<cngx-stepper>` strip.
|
|
1809
|
+
* `'full'` shows every label; `'compact'` ellipsis-truncates labels;
|
|
1810
|
+
* `'minimal'` drops to indicators-only (the active step keeps its
|
|
1811
|
+
* label). Orthogonal to the `mobileCollapse` display-mode union.
|
|
1812
|
+
*
|
|
1813
|
+
* @category common/stepper
|
|
1814
|
+
*/
|
|
1815
|
+
type CngxStripDensity = 'full' | 'compact' | 'minimal';
|
|
1816
|
+
/**
|
|
1817
|
+
* Options for {@link createStripDensity}.
|
|
1818
|
+
*
|
|
1819
|
+
* @internal
|
|
1820
|
+
*/
|
|
1821
|
+
interface CngxStripDensityOptions {
|
|
1822
|
+
/** Strip container element whose width drives the density rung. */
|
|
1823
|
+
readonly element: HTMLElement;
|
|
1824
|
+
/** Current step-only count - the width budget is split across these. */
|
|
1825
|
+
readonly stepCount: () => number;
|
|
1826
|
+
/**
|
|
1827
|
+
* Resolved density policy. Only `'auto'` degrades; `'comfortable'`
|
|
1828
|
+
* (or `undefined`) short-circuits to `'full'`, preserving today's
|
|
1829
|
+
* behaviour.
|
|
1830
|
+
*/
|
|
1831
|
+
readonly density: () => 'comfortable' | 'auto' | undefined;
|
|
1832
|
+
/**
|
|
1833
|
+
* Per-step width thresholds in px. At or above `compact` px per step
|
|
1834
|
+
* the strip stays `'full'`; at or above `minimal` it is `'compact'`;
|
|
1835
|
+
* below `minimal` it is `'minimal'`. `compact` must exceed `minimal`.
|
|
1836
|
+
*/
|
|
1837
|
+
readonly breakpoints: () => {
|
|
1838
|
+
readonly compact: number;
|
|
1839
|
+
readonly minimal: number;
|
|
1840
|
+
};
|
|
1841
|
+
readonly destroyRef: DestroyRef;
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Resolves the classic strip's density rung from its own container
|
|
1845
|
+
* width against the step count and two per-step px thresholds. Pure
|
|
1846
|
+
* `create*` factory, sibling to `createStepperDisplayMode` - it owns a
|
|
1847
|
+
* `ResizeObserver` the way the display-mode factory owns a
|
|
1848
|
+
* `matchMedia` listener, and returns a single derived `Signal`.
|
|
1849
|
+
*
|
|
1850
|
+
* `'comfortable'` density short-circuits to `'full'` (no measurement
|
|
1851
|
+
* dependency). Before the first measurement (`width === 0`) and for an
|
|
1852
|
+
* empty strip the rung is `'full'`, so the strip never flashes
|
|
1853
|
+
* `'minimal'` on mount.
|
|
1854
|
+
*
|
|
1855
|
+
* @category common/stepper
|
|
1856
|
+
*/
|
|
1857
|
+
declare function createStripDensity(options: CngxStripDensityOptions): Signal<CngxStripDensity>;
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Collapsed-group summary view consumed by `<cngx-stepper>`. Resolves
|
|
1861
|
+
* the `groupCollapseSummary` mode and the per-group `progress` / `count`
|
|
1862
|
+
* text, the `status`-dot gate, and the SR phrase. Pure derivation over
|
|
1863
|
+
* the group's subtree step states; rendered only on collapsed groups.
|
|
1864
|
+
*
|
|
1865
|
+
* @category common/stepper
|
|
1866
|
+
*/
|
|
1867
|
+
interface CngxStepperGroupSummaryView {
|
|
1868
|
+
/** Resolved summary mode (config cascade, default `'progress'`). */
|
|
1869
|
+
readonly mode: Signal<CngxStepperGroupSummary>;
|
|
1870
|
+
/** Visible badge text for `progress`/`count`, else `null`. */
|
|
1871
|
+
text(node: CngxStepNode): string | null;
|
|
1872
|
+
/** `true` when a status dot should render (mode `status`, group collapsed). */
|
|
1873
|
+
showStatus(node: CngxStepNode): boolean;
|
|
1874
|
+
/** Screen-reader phrase for `progress`/`count`, else `null`. */
|
|
1875
|
+
srText(node: CngxStepNode): string | null;
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Options for {@link createStepperGroupSummary}.
|
|
1879
|
+
*
|
|
1880
|
+
* @internal
|
|
1881
|
+
*/
|
|
1882
|
+
interface CngxStepperGroupSummaryOptions {
|
|
1883
|
+
/** Raw `groupCollapseSummary` config value (may be undefined). */
|
|
1884
|
+
readonly summaryMode: () => CngxStepperGroupSummary | undefined;
|
|
1885
|
+
/** Whether a given group node is currently collapsed. */
|
|
1886
|
+
readonly isCollapsed: (node: CngxStepNode) => boolean;
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Builds the collapsed-group summary view. Level-2 helper so the
|
|
1890
|
+
* organism stays a thin renderer. `status` mode defers its SR phrasing
|
|
1891
|
+
* to the group's existing status-phrase span, so {@link srText} returns
|
|
1892
|
+
* `null` there. English defaults (locale via the i18n cascade is a
|
|
1893
|
+
* follow-up).
|
|
1894
|
+
*
|
|
1895
|
+
* @category common/stepper
|
|
1896
|
+
*/
|
|
1897
|
+
declare function createStepperGroupSummary(options: CngxStepperGroupSummaryOptions): CngxStepperGroupSummaryView;
|
|
1898
|
+
|
|
1899
|
+
/**
|
|
1900
|
+
* Collapsed-group pointer-navigation view consumed by `<cngx-stepper>`
|
|
1901
|
+
* under `groupCollapse: 'expand-active'`. A folded group header becomes a
|
|
1902
|
+
* click shortcut into its branch: activating it selects the group's first
|
|
1903
|
+
* navigable step, which then becomes the active group and expands as a
|
|
1904
|
+
* consequence (no in-place disclosure). Keyboard users reach the same
|
|
1905
|
+
* steps via the arrow-key contract, which already steps into a collapsed
|
|
1906
|
+
* group, so this is a supplementary pointer affordance.
|
|
1907
|
+
*
|
|
1908
|
+
* @category common/stepper
|
|
1909
|
+
*/
|
|
1910
|
+
interface CngxStepperGroupNavigationView {
|
|
1911
|
+
/**
|
|
1912
|
+
* `true` when a collapsed group header offers a click shortcut: header
|
|
1913
|
+
* navigation is on, the group is folded, and at least one descendant
|
|
1914
|
+
* step is navigable right now. The expanded (active) group header is
|
|
1915
|
+
* never navigable - its steps are already on screen and clickable.
|
|
1916
|
+
*/
|
|
1917
|
+
isNavigable(node: CngxStepNode): boolean;
|
|
1918
|
+
/**
|
|
1919
|
+
* Selects the group's first navigable step. No-op for an expanded
|
|
1920
|
+
* header, a navigation-off header, or a group with no reachable step.
|
|
1921
|
+
*/
|
|
1922
|
+
select(node: CngxStepNode): void;
|
|
1923
|
+
/**
|
|
1924
|
+
* `true` when the group owns the active step (`activeGroupId`). Drives
|
|
1925
|
+
* the active-branch chip treatment on the header, independent of
|
|
1926
|
+
* `groupCollapse`, so the branch in focus reads distinctly even when
|
|
1927
|
+
* every group stays expanded.
|
|
1928
|
+
*/
|
|
1929
|
+
isActive(node: CngxStepNode): boolean;
|
|
1930
|
+
}
|
|
1931
|
+
/**
|
|
1932
|
+
* Options for {@link createStepperGroupNavigation}.
|
|
1933
|
+
*
|
|
1934
|
+
* @internal
|
|
1935
|
+
*/
|
|
1936
|
+
interface CngxStepperGroupNavigationOptions {
|
|
1937
|
+
/**
|
|
1938
|
+
* Host slice owning the flat projection (`flatSteps`, DFS order with
|
|
1939
|
+
* live `flatIndex`), the reachability predicate (`canNavigateTo`), the
|
|
1940
|
+
* commit-in-flight gate (`busy`), and the selection method (`select`).
|
|
1941
|
+
*/
|
|
1942
|
+
readonly presenter: Pick<CngxStepperHost, 'flatSteps' | 'canNavigateTo' | 'busy' | 'select' | 'activeGroupId'>;
|
|
1943
|
+
/** Whether a given group node is currently folded. */
|
|
1944
|
+
readonly isCollapsed: (node: CngxStepNode) => boolean;
|
|
1945
|
+
/** `false` when `headerNavigation: 'none'` keeps every header inert. */
|
|
1946
|
+
readonly navigationEnabled: () => boolean;
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Builds the collapsed-group pointer-navigation view. Level-2 helper so
|
|
1950
|
+
* the organism stays a thin renderer.
|
|
1951
|
+
*
|
|
1952
|
+
* Indices resolve against `flatSteps` (DFS order, live `flatIndex`) rather
|
|
1953
|
+
* than `group.children` - the flattener spreads group nodes but leaves
|
|
1954
|
+
* their `children` as the tree projection where every step still carries
|
|
1955
|
+
* the seeded `-1`. Each candidate is gated by `canNavigateTo` + `busy`
|
|
1956
|
+
* (mirroring the step-header reachability), so a linear-blocked leading
|
|
1957
|
+
* step is skipped to the first reachable one.
|
|
1958
|
+
*
|
|
1959
|
+
* @category common/stepper
|
|
1960
|
+
*/
|
|
1961
|
+
declare function createStepperGroupNavigation(options: CngxStepperGroupNavigationOptions): CngxStepperGroupNavigationView;
|
|
1962
|
+
|
|
1628
1963
|
/**
|
|
1629
1964
|
* Input bundle for {@link createStepperHostAttrs}: the three per-instance
|
|
1630
1965
|
* inputs (each `Signal<T | undefined>`) and the resolved config (read
|
|
@@ -1697,6 +2032,15 @@ interface CngxStepperStripKeyboardNavOptions {
|
|
|
1697
2032
|
* labels rather than focusable buttons. Omitted defaults to enabled.
|
|
1698
2033
|
*/
|
|
1699
2034
|
readonly enabled?: () => boolean;
|
|
2035
|
+
/**
|
|
2036
|
+
* Injector used to defer the post-move focus to `afterNextRender`.
|
|
2037
|
+
* Required when the strip can re-render its node set on navigation
|
|
2038
|
+
* (focus-driven group collapse: crossing a group boundary removes the
|
|
2039
|
+
* old button and adds the target's), so the focus lands after the new
|
|
2040
|
+
* DOM exists. Omitted, focus falls back to a `queueMicrotask` defer -
|
|
2041
|
+
* correct for a static strip where every button is always present.
|
|
2042
|
+
*/
|
|
2043
|
+
readonly injector?: Injector;
|
|
1700
2044
|
}
|
|
1701
2045
|
/**
|
|
1702
2046
|
* Builds the WAI-ARIA APG arrow-key handler for a stepper strip. The
|
|
@@ -2293,5 +2637,5 @@ declare function provideCngxStepper(...features: readonly CngxStepperFeature[]):
|
|
|
2293
2637
|
*/
|
|
2294
2638
|
declare function provideCngxStepperAt(...features: readonly CngxStepperFeature[]): Provider[];
|
|
2295
2639
|
|
|
2296
|
-
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, 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, STEPPER_DEFAULT_MOBILE_BREAKPOINT, createMobileViewportSignal, createStepperAnnouncementBuilders, createStepperCommitHandler, createStepperDisplayMode, createStepperHostAttrs, createStepperHostProxy, createStepperSlotContextBuilders, createStepperStateView, createStepperStripKeyboardNav, createStepperTemplateBindings, flatStepsEqual, injectStepperConfig, injectStepperI18n, provideCngxStepper, provideCngxStepperAt, provideStepperConfig, provideStepperConfigAt, provideStepperI18n, resolveStepperErrorSummary, resolveStepperStatusLabel, withDotStepperDotTemplate, withStepBadgeTemplate, withStepBusySpinnerTemplate, withStepErrorTemplate, withStepGroupHeaderTemplate, withStepIndicatorTemplate, withStepRejectionTemplate, withStepperAriaLabels, withStepperCommitMode, withStepperConnectors, withStepperDefaultOrientation, withStepperEmptyTemplate, withStepperFallbackLabels, withStepperHeaderNavigation, withStepperI18nLabels, withStepperLinear, withStepperMobileBreakpoint, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
|
|
2297
|
-
export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperFallbackLabels, CngxStepperFeature, CngxStepperHeaderNavigation, CngxStepperHost, CngxStepperHostAttrs, CngxStepperHostAttrsInputs, CngxStepperI18n, CngxStepperI18nFeature, CngxStepperI18nOverrides, CngxStepperMobileCollapse, CngxStepperMobileIndicatorPosition, CngxStepperSkin, CngxStepperSlotContextBuilders, CngxStepperSlotContextBuildersInputs, CngxStepperStateView, CngxStepperStatusLabels, CngxStepperStripKeyboardNavOptions, CngxStepperTemplateBindings, CngxStepperTemplateBindingsOptions, CngxStepperTemplates };
|
|
2640
|
+
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, CNGX_STEPPER_GLYPHS, CNGX_STEPPER_HOST, CNGX_STEPPER_I18N, 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, STEPPER_DEFAULT_DENSITY_BREAKPOINTS, STEPPER_DEFAULT_MOBILE_BREAKPOINT, createMobileViewportSignal, createStepperAnnouncementBuilders, createStepperCommitHandler, createStepperDisplayMode, createStepperGroupNavigation, createStepperGroupSummary, createStepperHostAttrs, createStepperHostProxy, createStepperSlotContextBuilders, createStepperStateView, createStepperStripKeyboardNav, createStepperTemplateBindings, createStripDensity, flatStepsEqual, 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, withStepperMobileBreakpoint, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
|
|
2641
|
+
export type { CngxDotStepperDotContext, CngxStepBadgeContext, CngxStepBusySpinnerContext, CngxStepContentContext, CngxStepErrorContext, CngxStepGroupHeaderContext, CngxStepGroupHost, CngxStepIndicatorContext, CngxStepLabelContext, CngxStepNode, CngxStepPanelHost, CngxStepRegistration, CngxStepRejectionContext, CngxStepStatus, CngxStepperAnnouncementBuilders, CngxStepperAnnouncementBuildersInputs, CngxStepperAriaLabels, CngxStepperCommitAction, CngxStepperCommitHandler, CngxStepperCommitHandlerFactory, CngxStepperCommitHandlerOptions, CngxStepperConfig, CngxStepperConfigFeature, CngxStepperCountHost, CngxStepperDensity, CngxStepperDensityBreakpoints, CngxStepperFallbackLabels, CngxStepperFeature, CngxStepperGroupCollapse, CngxStepperGroupNavigationOptions, CngxStepperGroupNavigationView, CngxStepperGroupSummary, CngxStepperGroupSummaryOptions, CngxStepperGroupSummaryView, CngxStepperHeaderNavigation, CngxStepperHost, CngxStepperHostAttrs, CngxStepperHostAttrsInputs, CngxStepperI18n, CngxStepperI18nFeature, CngxStepperI18nOverrides, CngxStepperMobileCollapse, CngxStepperMobileIndicatorPosition, CngxStepperSkin, CngxStepperSlotContextBuilders, CngxStepperSlotContextBuildersInputs, CngxStepperStateView, CngxStepperStatusLabels, CngxStepperStripKeyboardNavOptions, CngxStepperTemplateBindings, CngxStepperTemplateBindingsOptions, CngxStepperTemplates, CngxStripDensity, CngxStripDensityOptions };
|