@cngx/common 0.1.0-rc.9 → 0.3.0
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/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +19 -8
- package/data/README.md +10 -10
- package/fesm2022/cngx-common-a11y.mjs +701 -263
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +83 -64
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +135 -76
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +749 -296
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +51 -29
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +695 -405
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +112 -112
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +668 -308
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7066 -2739
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2121 -492
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +1207 -569
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +256 -261
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +202 -262
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +28 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +1 -1
- package/menu-button/README.md +234 -0
- package/package.json +14 -4
- package/popover/README.md +42 -5
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/stepper/README.md +0 -1
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +43 -11
- package/theming/components/cngx-popover.css +37 -13
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +343 -120
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +671 -384
- package/types/cngx-common-command.d.ts +44 -47
- package/types/cngx-common-data.d.ts +350 -342
- package/types/cngx-common-dialog.d.ts +91 -120
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4350 -1723
- package/types/cngx-common-layout.d.ts +1365 -286
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +671 -289
- package/types/cngx-common-stepper.d.ts +217 -347
- package/types/cngx-common-tabs.d.ts +173 -386
- package/types/cngx-common-timeline.d.ts +25 -104
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, inject, computed, makeEnvironmentProviders, model, input, signal, afterNextRender, Directive, TemplateRef, contentChild, DestroyRef, output, effect, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component, ElementRef, afterEveryRender, afterRenderEffect } from '@angular/core';
|
|
3
3
|
import { CNGX_COMMIT_CONTROLLER_FACTORY, createRefusedPhrase } from '@cngx/common/data';
|
|
4
4
|
import { resolveStepFrom, resolveInlineStep, resolveBoundaryStep, injectDirection } from '@cngx/core';
|
|
5
|
-
import { createNestedOverrideMerge, createOverrideMerge, createTransitionTracker, CNGX_STATEFUL, nextUid,
|
|
5
|
+
import { createNestedOverrideMerge, createOverrideMerge, createTransitionTracker, createKeyedRegistry, CNGX_STATEFUL, nextUid, buildAsyncStateView } from '@cngx/core/utils';
|
|
6
6
|
import { CngxRuntimeError, recordEqual, cngxDevWarn, arrayEqual } from '@cngx/utils';
|
|
7
7
|
import { isObservable } from 'rxjs';
|
|
8
8
|
import { formatMessage, createNestedLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
@@ -11,15 +11,13 @@ import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
|
|
|
11
11
|
import { filter } from 'rxjs/operators';
|
|
12
12
|
import { injectContainerSize } from '@cngx/common/layout';
|
|
13
13
|
import * as i1 from '@cngx/common/interactive';
|
|
14
|
-
import { CngxAsyncClick } from '@cngx/common/interactive';
|
|
14
|
+
import { CNGX_ASYNC_RUN_STATE, CngxAsyncClick } from '@cngx/common/interactive';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Build a stepper commit handler over an existing {@link CngxCommitController}.
|
|
18
18
|
* Resolves `Observable<boolean>` / `Promise<boolean>` / `boolean` returns into
|
|
19
19
|
* one {@link CngxStepperCommitResolution}: `true` accepts, `false` refuses
|
|
20
20
|
* (the controller settles to `'idle'` and stores no error), a throw fails.
|
|
21
|
-
*
|
|
22
|
-
* @category common/stepper
|
|
23
21
|
*/
|
|
24
22
|
function createStepperCommitHandler(opts) {
|
|
25
23
|
const { controller } = opts;
|
|
@@ -128,9 +126,8 @@ function runStepperAction(action, fromIndex, toIndex, handlers) {
|
|
|
128
126
|
* DI token carrying the factory the presenter uses to allocate its commit
|
|
129
127
|
* handler. Symmetric to the select family's `CNGX_ARRAY_COMMIT_HANDLER_FACTORY`.
|
|
130
128
|
*
|
|
131
|
-
* @category common/stepper
|
|
132
129
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/commit-handler.ts
|
|
133
|
-
* @since 0.
|
|
130
|
+
* @since 0.3.0
|
|
134
131
|
*/
|
|
135
132
|
const CNGX_STEPPER_COMMIT_HANDLER_FACTORY = new InjectionToken('CngxStepperCommitHandlerFactory', {
|
|
136
133
|
providedIn: 'root',
|
|
@@ -141,12 +138,10 @@ const CNGX_STEPPER_COMMIT_HANDLER_FACTORY = new InjectionToken('CngxStepperCommi
|
|
|
141
138
|
* The English stepper section: the single source of the stepper's English
|
|
142
139
|
* copy. `CNGX_STEPPER_I18N` and the `CNGX_STEPPER_CONFIG` labels default to it.
|
|
143
140
|
*
|
|
144
|
-
* @
|
|
145
|
-
* @since 0.1.0
|
|
141
|
+
* @since 0.3.0
|
|
146
142
|
* @relatedTo CNGX_STEPPER_I18N
|
|
147
143
|
*/
|
|
148
144
|
const CNGX_STEPPER_LANGUAGE_EN = {
|
|
149
|
-
stepperRegion: 'Steps',
|
|
150
145
|
stepperLabel: 'Steps',
|
|
151
146
|
stepRoleDescription: 'stepper',
|
|
152
147
|
stepIndicatorRoleDescription: 'step indicator',
|
|
@@ -227,10 +222,9 @@ const stepperBundle = createSectionBundle({
|
|
|
227
222
|
* {@link provideStepperI18n}; a `{ provide, useValue }` entry must supply a
|
|
228
223
|
* `Signal<CngxStepperI18n>`.
|
|
229
224
|
*
|
|
230
|
-
* @category common/stepper/i18n
|
|
231
225
|
* @wcag AA
|
|
232
226
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/i18n/stepper-i18n.ts
|
|
233
|
-
* @since 0.
|
|
227
|
+
* @since 0.3.0
|
|
234
228
|
*/
|
|
235
229
|
const CNGX_STEPPER_I18N = new InjectionToken('CngxStepperI18n', {
|
|
236
230
|
providedIn: 'root',
|
|
@@ -250,9 +244,7 @@ function defineStepperI18nFeature(fn) {
|
|
|
250
244
|
* the language pack's copy, or the English default. {@link CngxStepperStatusLabels} is merged
|
|
251
245
|
* key-by-key so consumers can override one pill label without
|
|
252
246
|
* restating the rest. Pass a `Signal` to switch the language at runtime.
|
|
253
|
-
* Sibling of `
|
|
254
|
-
*
|
|
255
|
-
* @category common/stepper/i18n
|
|
247
|
+
* Sibling of `withStepperFallbackLabels`.
|
|
256
248
|
*/
|
|
257
249
|
function withStepperI18nLabels(overrides) {
|
|
258
250
|
return defineStepperI18nFeature((bundle) => createNestedOverrideMerge(bundle, overrides, 'statusLabels'));
|
|
@@ -266,13 +258,11 @@ function withStepperI18nLabels(overrides) {
|
|
|
266
258
|
* bootstrapApplication(AppComponent, {
|
|
267
259
|
* providers: [
|
|
268
260
|
* provideStepperI18n(
|
|
269
|
-
* withStepperI18nLabels({ stepperLabel: '
|
|
261
|
+
* withStepperI18nLabels({ stepperLabel: 'Bestellschritte', previousStep: 'Vorheriger' }),
|
|
270
262
|
* ),
|
|
271
263
|
* ],
|
|
272
264
|
* });
|
|
273
265
|
* ```
|
|
274
|
-
*
|
|
275
|
-
* @category common/stepper/i18n
|
|
276
266
|
*/
|
|
277
267
|
function provideStepperI18n(...features) {
|
|
278
268
|
return {
|
|
@@ -284,8 +274,6 @@ function provideStepperI18n(...features) {
|
|
|
284
274
|
* Inject the resolved stepper i18n bundle in an injection context. Read it
|
|
285
275
|
* inside a `computed()`, template or handler so a language switch reaches
|
|
286
276
|
* the label.
|
|
287
|
-
*
|
|
288
|
-
* @category common/stepper/i18n
|
|
289
277
|
*/
|
|
290
278
|
function injectStepperI18n() {
|
|
291
279
|
return stepperBundle.resolve(inject(CNGX_STEPPER_I18N));
|
|
@@ -307,9 +295,6 @@ const STEPPER_CONFIG_DEFAULTS = {
|
|
|
307
295
|
mobileCollapse: 'text',
|
|
308
296
|
mobileIndicatorPosition: 'top',
|
|
309
297
|
mobileSwipe: true,
|
|
310
|
-
ariaLabels: {
|
|
311
|
-
stepperRegion: CNGX_STEPPER_LANGUAGE_EN.stepperRegion,
|
|
312
|
-
},
|
|
313
298
|
fallbackLabels: {
|
|
314
299
|
groupRoleDescription: CNGX_STEPPER_LANGUAGE_EN.groupRoleDescription,
|
|
315
300
|
stepRoleDescription: CNGX_STEPPER_LANGUAGE_EN.stepRoleDescription,
|
|
@@ -323,10 +308,9 @@ const NO_LABELS = {};
|
|
|
323
308
|
* library defaults; override via {@link provideStepperConfig} (root)
|
|
324
309
|
* or {@link provideStepperConfigAt} (component scope).
|
|
325
310
|
*
|
|
326
|
-
* @category common/stepper
|
|
327
311
|
* @wcag AA
|
|
328
312
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-config.ts
|
|
329
|
-
* @since 0.
|
|
313
|
+
* @since 0.3.0
|
|
330
314
|
*/
|
|
331
315
|
const CNGX_STEPPER_CONFIG = new InjectionToken('CngxStepperConfig', {
|
|
332
316
|
providedIn: 'root',
|
|
@@ -344,8 +328,6 @@ function defineStepperConfigFeature(fn) {
|
|
|
344
328
|
/**
|
|
345
329
|
* Override the default orientation. Per-instance `[orientation]`
|
|
346
330
|
* Input still wins; this only moves the cascade default.
|
|
347
|
-
*
|
|
348
|
-
* @category common/stepper
|
|
349
331
|
*/
|
|
350
332
|
function withStepperDefaultOrientation(orientation) {
|
|
351
333
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -356,8 +338,6 @@ function withStepperDefaultOrientation(orientation) {
|
|
|
356
338
|
/**
|
|
357
339
|
* Override the default linear-progression setting. Per-instance
|
|
358
340
|
* `[linear]` Input still wins.
|
|
359
|
-
*
|
|
360
|
-
* @category common/stepper
|
|
361
341
|
*/
|
|
362
342
|
function withStepperLinear(linear) {
|
|
363
343
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, defaultLinear: linear }));
|
|
@@ -367,8 +347,6 @@ function withStepperLinear(linear) {
|
|
|
367
347
|
* `'optimistic'` advances on action dispatch and rolls back on error;
|
|
368
348
|
* `'pessimistic'` waits for success. Per-instance `[commitMode]`
|
|
369
349
|
* Input still wins.
|
|
370
|
-
*
|
|
371
|
-
* @category common/stepper
|
|
372
350
|
*/
|
|
373
351
|
function withStepperCommitMode(mode) {
|
|
374
352
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -380,8 +358,6 @@ function withStepperCommitMode(mode) {
|
|
|
380
358
|
* Configure router synchronisation for the active step. `mode` chooses
|
|
381
359
|
* the URL surface (URL fragment or query parameter); `param` names the
|
|
382
360
|
* key (default `'step'`).
|
|
383
|
-
*
|
|
384
|
-
* @category common/stepper
|
|
385
361
|
*/
|
|
386
362
|
function withStepperRouterSync(mode, param = 'step') {
|
|
387
363
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -396,8 +372,6 @@ function withStepperRouterSync(mode, param = 'step') {
|
|
|
396
372
|
* moves the cascade default. Structure, slots, ARIA, and keyboard
|
|
397
373
|
* behaviour are identical across skins - only the `[data-skin]` host
|
|
398
374
|
* attribute changes the CSS layer that paints the strip.
|
|
399
|
-
*
|
|
400
|
-
* @category common/stepper
|
|
401
375
|
*/
|
|
402
376
|
function withStepperSkin(skin) {
|
|
403
377
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, skin }));
|
|
@@ -410,8 +384,6 @@ function withStepperSkin(skin) {
|
|
|
410
384
|
* `[data-skin='classic']`; the four other skins each ship their own
|
|
411
385
|
* inter-step decoration and ignore this flag. Per-instance
|
|
412
386
|
* `[connectors]` Input still wins.
|
|
413
|
-
*
|
|
414
|
-
* @category common/stepper
|
|
415
387
|
*/
|
|
416
388
|
function withStepperConnectors(on) {
|
|
417
389
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, connectors: on }));
|
|
@@ -423,8 +395,6 @@ function withStepperConnectors(on) {
|
|
|
423
395
|
* `<cngx-text-stepper>`, `'dots'` renders `<cngx-dot-stepper>`, `'off'`
|
|
424
396
|
* keeps the classic strip. The Material twin `<cngx-mat-stepper>` ignores
|
|
425
397
|
* this setting.
|
|
426
|
-
*
|
|
427
|
-
* @category common/stepper
|
|
428
398
|
*/
|
|
429
399
|
function withStepperMobileCollapse(mode) {
|
|
430
400
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileCollapse: mode }));
|
|
@@ -436,8 +406,6 @@ function withStepperMobileCollapse(mode) {
|
|
|
436
406
|
* reads first and the navigation cue sits at thumb height. Per-
|
|
437
407
|
* instance `[mobileIndicatorPosition]` on `<cngx-stepper>` still
|
|
438
408
|
* wins.
|
|
439
|
-
*
|
|
440
|
-
* @category common/stepper
|
|
441
409
|
*/
|
|
442
410
|
function withStepperMobileIndicatorPosition(position) {
|
|
443
411
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileIndicatorPosition: position }));
|
|
@@ -447,8 +415,6 @@ function withStepperMobileIndicatorPosition(position) {
|
|
|
447
415
|
* in mobile-collapse mode. Default `true` - the `'dots'` and `'text'`
|
|
448
416
|
* variants read as carousels, so users expect to swipe. Per-instance
|
|
449
417
|
* `[mobileSwipe]` Input still wins; the classic strip is unaffected.
|
|
450
|
-
*
|
|
451
|
-
* @category common/stepper
|
|
452
418
|
*/
|
|
453
419
|
function withStepperMobileSwipe(enabled) {
|
|
454
420
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, mobileSwipe: enabled }));
|
|
@@ -459,8 +425,6 @@ function withStepperMobileSwipe(enabled) {
|
|
|
459
425
|
* navigation); `'visited'` (library default) keeps the headers as
|
|
460
426
|
* focusable buttons whose reachability folds into the `linear` axis.
|
|
461
427
|
* Per-instance `[headerNavigation]` Input still wins.
|
|
462
|
-
*
|
|
463
|
-
* @category common/stepper
|
|
464
428
|
*/
|
|
465
429
|
function withStepperHeaderNavigation(mode) {
|
|
466
430
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, headerNavigation: mode }));
|
|
@@ -472,8 +436,6 @@ function withStepperHeaderNavigation(mode) {
|
|
|
472
436
|
* holding the active step; `'off'` (library default) keeps the full
|
|
473
437
|
* strip. Orthogonal to the `mobileCollapse` axis. The Material twin
|
|
474
438
|
* ignores this setting.
|
|
475
|
-
*
|
|
476
|
-
* @category common/stepper
|
|
477
439
|
*/
|
|
478
440
|
function withStepperGroupCollapse(mode) {
|
|
479
441
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, groupCollapse: mode }));
|
|
@@ -484,8 +446,6 @@ function withStepperGroupCollapse(mode) {
|
|
|
484
446
|
* shows completed/total steps; `'count'` the step count; `'status'` a
|
|
485
447
|
* status dot coloured by the group's rolled-up state; `'off'` the bare
|
|
486
448
|
* label. No effect unless `groupCollapse` is `'expand-active'`.
|
|
487
|
-
*
|
|
488
|
-
* @category common/stepper
|
|
489
449
|
*/
|
|
490
450
|
function withStepperGroupCollapseSummary(mode) {
|
|
491
451
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, groupCollapseSummary: mode }));
|
|
@@ -498,32 +458,15 @@ function withStepperGroupCollapseSummary(mode) {
|
|
|
498
458
|
* `'comfortable'` (library default) keeps full labels at every width.
|
|
499
459
|
* Orthogonal to the `mobileCollapse` axis; the Material twin ignores this
|
|
500
460
|
* setting.
|
|
501
|
-
*
|
|
502
|
-
* @category common/stepper
|
|
503
461
|
*/
|
|
504
462
|
function withStepperDensity(mode) {
|
|
505
463
|
return defineStepperConfigFeature((cfg) => ({ ...cfg, density: mode }));
|
|
506
464
|
}
|
|
507
|
-
/**
|
|
508
|
-
* Merge ARIA labels into the cascade. Keys not provided keep their
|
|
509
|
-
* library defaults; per-instance overrides on the stepper still win.
|
|
510
|
-
* Pass a `Signal` to switch the language at runtime.
|
|
511
|
-
*
|
|
512
|
-
* @category common/stepper
|
|
513
|
-
*/
|
|
514
|
-
function withStepperAriaLabels(labels) {
|
|
515
|
-
return defineStepperConfigFeature((cfg) => ({
|
|
516
|
-
...cfg,
|
|
517
|
-
ariaLabels: createOverrideMerge(cfg.ariaLabels ?? NO_LABELS, labels),
|
|
518
|
-
}));
|
|
519
|
-
}
|
|
520
465
|
/**
|
|
521
466
|
* Merge fallback role descriptions (`groupRoleDescription` /
|
|
522
467
|
* `stepRoleDescription`) into the cascade. These feed the strip's
|
|
523
468
|
* `aria-roledescription` attributes when the consumer supplies none.
|
|
524
469
|
* Pass a `Signal` to switch the language at runtime.
|
|
525
|
-
*
|
|
526
|
-
* @category common/stepper
|
|
527
470
|
*/
|
|
528
471
|
function withStepperFallbackLabels(labels) {
|
|
529
472
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -535,8 +478,6 @@ function withStepperFallbackLabels(labels) {
|
|
|
535
478
|
* Override the default `*cngxStepIndicator` template app-wide.
|
|
536
479
|
* Per-instance directive still wins; this only moves the cascade
|
|
537
480
|
* middle tier.
|
|
538
|
-
*
|
|
539
|
-
* @category common/stepper
|
|
540
481
|
*/
|
|
541
482
|
function withStepIndicatorTemplate(template) {
|
|
542
483
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -546,8 +487,6 @@ function withStepIndicatorTemplate(template) {
|
|
|
546
487
|
}
|
|
547
488
|
/**
|
|
548
489
|
* Override the default `*cngxStepBadge` template app-wide.
|
|
549
|
-
*
|
|
550
|
-
* @category common/stepper
|
|
551
490
|
*/
|
|
552
491
|
function withStepBadgeTemplate(template) {
|
|
553
492
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -557,8 +496,6 @@ function withStepBadgeTemplate(template) {
|
|
|
557
496
|
}
|
|
558
497
|
/**
|
|
559
498
|
* Override the default `*cngxStepBusySpinner` template app-wide.
|
|
560
|
-
*
|
|
561
|
-
* @category common/stepper
|
|
562
499
|
*/
|
|
563
500
|
function withStepBusySpinnerTemplate(template) {
|
|
564
501
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -569,8 +506,6 @@ function withStepBusySpinnerTemplate(template) {
|
|
|
569
506
|
/**
|
|
570
507
|
* Override the default `*cngxStepRejection` template app-wide.
|
|
571
508
|
* Symmetric with the upcoming tabs `cngxTabRejectionIcon` (Phase 4).
|
|
572
|
-
*
|
|
573
|
-
* @category common/stepper
|
|
574
509
|
*/
|
|
575
510
|
function withStepRejectionTemplate(template) {
|
|
576
511
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -583,8 +518,6 @@ function withStepRejectionTemplate(template) {
|
|
|
583
518
|
* renders the per-step validation reason on the skins with a label area
|
|
584
519
|
* (classic / stripe-status-rich). Per-instance directive still wins;
|
|
585
520
|
* this moves the cascade middle tier.
|
|
586
|
-
*
|
|
587
|
-
* @category common/stepper
|
|
588
521
|
*/
|
|
589
522
|
function withStepErrorTemplate(template) {
|
|
590
523
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -594,8 +527,6 @@ function withStepErrorTemplate(template) {
|
|
|
594
527
|
}
|
|
595
528
|
/**
|
|
596
529
|
* Override the default `*cngxStepGroupHeader` template app-wide.
|
|
597
|
-
*
|
|
598
|
-
* @category common/stepper
|
|
599
530
|
*/
|
|
600
531
|
function withStepGroupHeaderTemplate(template) {
|
|
601
532
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -605,8 +536,6 @@ function withStepGroupHeaderTemplate(template) {
|
|
|
605
536
|
}
|
|
606
537
|
/**
|
|
607
538
|
* Override the default `*cngxStepperEmpty` template app-wide.
|
|
608
|
-
*
|
|
609
|
-
* @category common/stepper
|
|
610
539
|
*/
|
|
611
540
|
function withStepperEmptyTemplate(template) {
|
|
612
541
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -620,8 +549,6 @@ function withStepperEmptyTemplate(template) {
|
|
|
620
549
|
* mobile-collapse branch of `<cngx-stepper>`: per-instance directive >
|
|
621
550
|
* this feature > built-in empty body (the dot fill is painted by the dot
|
|
622
551
|
* element's CSS regardless).
|
|
623
|
-
*
|
|
624
|
-
* @category common/stepper
|
|
625
552
|
*/
|
|
626
553
|
function withDotStepperDotTemplate(template) {
|
|
627
554
|
return defineStepperConfigFeature((cfg) => ({
|
|
@@ -637,9 +564,6 @@ function stepperConfigDefaultsFromPack() {
|
|
|
637
564
|
const language = injectStepperLanguage();
|
|
638
565
|
return {
|
|
639
566
|
...STEPPER_CONFIG_DEFAULTS,
|
|
640
|
-
ariaLabels: computed(() => ({ stepperRegion: language().stepperRegion }), {
|
|
641
|
-
equal: recordEqual,
|
|
642
|
-
}),
|
|
643
567
|
fallbackLabels: computed(() => ({
|
|
644
568
|
groupRoleDescription: language().groupRoleDescription,
|
|
645
569
|
stepRoleDescription: language().stepRoleDescription,
|
|
@@ -654,8 +578,6 @@ function resolveFeatures(features) {
|
|
|
654
578
|
* Root-level provider for the stepper config. Apply once in the
|
|
655
579
|
* application providers array. Sibling of `provideTabsConfig` /
|
|
656
580
|
* `provideSelectConfig`.
|
|
657
|
-
*
|
|
658
|
-
* @category common/stepper
|
|
659
581
|
*/
|
|
660
582
|
function provideStepperConfig(...features) {
|
|
661
583
|
return makeEnvironmentProviders([
|
|
@@ -676,16 +598,12 @@ function provideStepperConfig(...features) {
|
|
|
676
598
|
* viewProviders: [...provideStepperConfigAt(withStepperLinear(true))],
|
|
677
599
|
* })
|
|
678
600
|
* ```
|
|
679
|
-
*
|
|
680
|
-
* @category common/stepper
|
|
681
601
|
*/
|
|
682
602
|
function provideStepperConfigAt(...features) {
|
|
683
603
|
return [{ provide: CNGX_STEPPER_CONFIG, useFactory: () => resolveFeatures(features) }];
|
|
684
604
|
}
|
|
685
605
|
/**
|
|
686
606
|
* Inject the resolved stepper config in an injection context.
|
|
687
|
-
*
|
|
688
|
-
* @category common/stepper
|
|
689
607
|
*/
|
|
690
608
|
function injectStepperConfig() {
|
|
691
609
|
return inject(CNGX_STEPPER_CONFIG);
|
|
@@ -696,10 +614,9 @@ function injectStepperConfig() {
|
|
|
696
614
|
* Atoms inject `optional: true` and either register here or fall through
|
|
697
615
|
* {@link CNGX_STEP_GROUP_HOST} when nested in a group.
|
|
698
616
|
*
|
|
699
|
-
* @category common/stepper
|
|
700
617
|
* @wcag AA
|
|
701
618
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/stepper-host.token.ts
|
|
702
|
-
* @since 0.
|
|
619
|
+
* @since 0.3.0
|
|
703
620
|
*/
|
|
704
621
|
const CNGX_STEPPER_HOST = new InjectionToken('CngxStepperHost');
|
|
705
622
|
/**
|
|
@@ -785,8 +702,6 @@ function stepTreeEqual(a, b) {
|
|
|
785
702
|
* @internal Exported from `public-api.ts` so the cngx-stepper and
|
|
786
703
|
* cngx-mat-stepper organisms share the comparator across the
|
|
787
704
|
* secondary-entry boundary (Sheriff forbids deep-relative imports).
|
|
788
|
-
*
|
|
789
|
-
* @category common/stepper
|
|
790
705
|
*/
|
|
791
706
|
function flatStepsEqual(a, b) {
|
|
792
707
|
if (a === b) {
|
|
@@ -817,25 +732,49 @@ function flatStepsEqual(a, b) {
|
|
|
817
732
|
* Sheriff: common Level 2. Pure directive - zero template, zero CSS.
|
|
818
733
|
* Level-4 organisms compose this via `hostDirectives`.
|
|
819
734
|
*
|
|
820
|
-
* @category common/stepper
|
|
821
|
-
* @docsKind primary
|
|
822
735
|
* @wcag AA
|
|
823
736
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/presenter.directive.ts
|
|
824
|
-
* @since 0.
|
|
737
|
+
* @since 0.3.0
|
|
825
738
|
* @relatedTo CngxStep, CngxStepGroup, CngxStepperRouterSync, CNGX_STEPPER_HOST, CNGX_STEPPER_CONFIG
|
|
826
|
-
* <example-url
|
|
739
|
+
* <example-url>/#/ui/stepper/stepper-commit-action/pessimistic-optimistic-commits-with-bridge-directives</example-url>
|
|
827
740
|
*/
|
|
828
741
|
class CngxStepperPresenter {
|
|
829
742
|
config = injectStepperConfig();
|
|
743
|
+
/**
|
|
744
|
+
* Zero-based index of the active step among the steps only (group nodes do not count), two-way bindable
|
|
745
|
+
* as `[(activeStepIndex)]`. Defaults to `0`. The presenter writes it on navigation, so under a
|
|
746
|
+
* `commitAction` in `'pessimistic'` mode it changes only after the action resolves `true`; reads are
|
|
747
|
+
* clamped to the registered step count.
|
|
748
|
+
*/
|
|
830
749
|
activeStepIndex = model(0, ...(ngDevMode ? [{ debugName: "activeStepIndex" }] : /* istanbul ignore next */ []));
|
|
831
750
|
// Raw *Input slots default undefined so the cascade resolves through
|
|
832
751
|
// CNGX_STEPPER_CONFIG. Must stay public - the template type-checker
|
|
833
752
|
// rejects protected/private on hostDirective alias bindings.
|
|
753
|
+
/**
|
|
754
|
+
* Binding `[linear]`: when `true`, moving forward is refused while any enabled step from the active
|
|
755
|
+
* one up to the target is not in the `'success'` state. Unset, it resolves through `defaultLinear` of the stepper config and then
|
|
756
|
+
* `false`.
|
|
757
|
+
*/
|
|
834
758
|
linearInput = input(undefined, { ...(ngDevMode ? { debugName: "linearInput" } : /* istanbul ignore next */ {}), alias: 'linear' });
|
|
835
759
|
linear = computed(() => this.linearInput() ?? this.config.defaultLinear ?? false, ...(ngDevMode ? [{ debugName: "linear" }] : /* istanbul ignore next */ []));
|
|
760
|
+
/**
|
|
761
|
+
* Binding `[orientation]`: layout axis of the stepper, `'horizontal'` or `'vertical'`. Unset, it resolves
|
|
762
|
+
* through `defaultOrientation` of the stepper config and then `'horizontal'`. The organism mirrors the
|
|
763
|
+
* resolved value to `aria-orientation` and `data-orientation`.
|
|
764
|
+
*/
|
|
836
765
|
orientationInput = input(undefined, { ...(ngDevMode ? { debugName: "orientationInput" } : /* istanbul ignore next */ {}), alias: 'orientation' });
|
|
837
766
|
orientation = computed(() => this.orientationInput() ?? this.config.defaultOrientation ?? 'horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
767
|
+
/**
|
|
768
|
+
* Async guard run before a step change: it receives the origin and target index and resolves `true` to
|
|
769
|
+
* advance or `false` to refuse. Defaults to `null`, which makes every `select` a synchronous move.
|
|
770
|
+
* Navigating back with `selectPrevious` bypasses it.
|
|
771
|
+
*/
|
|
838
772
|
commitAction = input(null, ...(ngDevMode ? [{ debugName: "commitAction" }] : /* istanbul ignore next */ []));
|
|
773
|
+
/**
|
|
774
|
+
* Binding `[commitMode]`: whether `activeStepIndex` moves to the target before the `commitAction` resolves
|
|
775
|
+
* (`'optimistic'`, rolled back on refusal or failure) or only after it resolves `true` (`'pessimistic'`).
|
|
776
|
+
* Unset, it resolves through `defaultCommitMode` of the stepper config and then `'pessimistic'`.
|
|
777
|
+
*/
|
|
839
778
|
commitModeInput = input(undefined, { ...(ngDevMode ? { debugName: "commitModeInput" } : /* istanbul ignore next */ {}), alias: 'commitMode' });
|
|
840
779
|
commitMode = computed(() => this.commitModeInput() ?? this.config.defaultCommitMode ?? 'pessimistic', ...(ngDevMode ? [{ debugName: "commitMode" }] : /* istanbul ignore next */ []));
|
|
841
780
|
genericFactory = inject(CNGX_COMMIT_CONTROLLER_FACTORY);
|
|
@@ -1014,8 +953,13 @@ class CngxStepperPresenter {
|
|
|
1014
953
|
}, ...(ngDevMode ? [{ debugName: "canGoNext" }] : /* istanbul ignore next */ []));
|
|
1015
954
|
/** {@inheritDoc CngxStepperHost.canGoPrevious} */
|
|
1016
955
|
canGoPrevious = computed(() => this.previousEnabledIndex() >= 0, ...(ngDevMode ? [{ debugName: "canGoPrevious" }] : /* istanbul ignore next */ []));
|
|
956
|
+
// Runs outside the commit (the finish run) that hold the stepper busy.
|
|
957
|
+
busySources = createKeyedRegistry({
|
|
958
|
+
name: 'CngxStepperPresenter',
|
|
959
|
+
});
|
|
1017
960
|
/** {@inheritDoc CngxStepperHost.busy} */
|
|
1018
|
-
busy = computed(() => this.commitState.status() === 'pending'
|
|
961
|
+
busy = computed(() => this.commitState.status() === 'pending' ||
|
|
962
|
+
this.busySources.values().some((pending) => pending()), ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
1019
963
|
/** {@inheritDoc CngxStepperHost.nextStepLabel} */
|
|
1020
964
|
nextStepLabel = computed(() => this.stepsOnly()[this.nextEnabledIndex()]?.label(), ...(ngDevMode ? [{ debugName: "nextStepLabel" }] : /* istanbul ignore next */ []));
|
|
1021
965
|
/** {@inheritDoc CngxStepperHost.previousStepLabel} */
|
|
@@ -1034,6 +978,12 @@ class CngxStepperPresenter {
|
|
|
1034
978
|
// register/unregister.
|
|
1035
979
|
registry = new Map();
|
|
1036
980
|
insertionOrder = [];
|
|
981
|
+
/**
|
|
982
|
+
* `CngxStepperHost` contract, called by `CngxStep` and `CngxStepGroup` in their `ngOnInit`, or by a
|
|
983
|
+
* `CngxStepGroup` on behalf of a nested child with its own id as `parentId`. Adds the node to the step
|
|
984
|
+
* tree in registration order; a second call with a known id replaces the stored handle and keeps its
|
|
985
|
+
* position. A group must register before its children.
|
|
986
|
+
*/
|
|
1037
987
|
register(handle, parentId = null) {
|
|
1038
988
|
if (this.registry.has(handle.id)) {
|
|
1039
989
|
// Idempotent re-register - replace the handle, keep the ordering slot.
|
|
@@ -1053,6 +1003,16 @@ class CngxStepperPresenter {
|
|
|
1053
1003
|
}
|
|
1054
1004
|
this.rebuildTree();
|
|
1055
1005
|
}
|
|
1006
|
+
/** {@inheritDoc CngxStepperHost.registerBusy} */
|
|
1007
|
+
registerBusy(key, pending) {
|
|
1008
|
+
this.busySources.register(key, pending);
|
|
1009
|
+
return () => this.busySources.unregister(key, pending);
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* `CngxStepperHost` contract, called from the destroy hook of `CngxStep` and `CngxStepGroup`. Removes the
|
|
1013
|
+
* node from the step tree; when `handle` is passed and is no longer the stored one (it was replaced by a
|
|
1014
|
+
* re-register), the call does nothing.
|
|
1015
|
+
*/
|
|
1056
1016
|
unregister(id, handle) {
|
|
1057
1017
|
const entry = this.registry.get(id);
|
|
1058
1018
|
if (!entry) {
|
|
@@ -1135,6 +1095,11 @@ class CngxStepperPresenter {
|
|
|
1135
1095
|
}
|
|
1136
1096
|
return !this.isLinearBlocked(index);
|
|
1137
1097
|
}
|
|
1098
|
+
/**
|
|
1099
|
+
* Moves to the step at the given step-only index, clamped to the registered range. Does nothing when the
|
|
1100
|
+
* target is the active step, is disabled, or is blocked by `linear`. Without a `commitAction` the move is
|
|
1101
|
+
* synchronous; with one, the move follows `commitMode`, and a newer call supersedes the pending one.
|
|
1102
|
+
*/
|
|
1138
1103
|
select(index) {
|
|
1139
1104
|
const stepsOnly = this.stepsOnly();
|
|
1140
1105
|
if (stepsOnly.length === 0) {
|
|
@@ -1211,6 +1176,10 @@ class CngxStepperPresenter {
|
|
|
1211
1176
|
}
|
|
1212
1177
|
});
|
|
1213
1178
|
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Moves to the next enabled step after the active one, through `select`. Does nothing when no enabled
|
|
1181
|
+
* step follows; the `linear` gate and the `commitAction` apply as for any other forward move.
|
|
1182
|
+
*/
|
|
1214
1183
|
selectNext() {
|
|
1215
1184
|
const next = this.nextEnabledIndex();
|
|
1216
1185
|
if (next < this.stepsOnly().length) {
|
|
@@ -1232,6 +1201,10 @@ class CngxStepperPresenter {
|
|
|
1232
1201
|
this.activeStepIndex.set(prev);
|
|
1233
1202
|
}
|
|
1234
1203
|
}
|
|
1204
|
+
/**
|
|
1205
|
+
* Moves to the step registered under the given id, through `select`. Group ids and unknown ids are
|
|
1206
|
+
* ignored.
|
|
1207
|
+
*/
|
|
1235
1208
|
selectById(id) {
|
|
1236
1209
|
const stepsOnly = this.stepsOnly();
|
|
1237
1210
|
const idx = stepsOnly.findIndex((n) => n.id === id);
|
|
@@ -1239,6 +1212,10 @@ class CngxStepperPresenter {
|
|
|
1239
1212
|
this.select(idx);
|
|
1240
1213
|
}
|
|
1241
1214
|
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Returns to the first step without running the `commitAction`. Cancels a commit in flight and clears the
|
|
1217
|
+
* origin, the rejection marker and the last outcome.
|
|
1218
|
+
*/
|
|
1242
1219
|
reset() {
|
|
1243
1220
|
this.activeStepIndex.set(0);
|
|
1244
1221
|
this.lastCommittedIndex = 0;
|
|
@@ -1286,9 +1263,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1286
1263
|
* DI token providing a `CngxStepGroup`'s contract to nested `CngxStep` atoms.
|
|
1287
1264
|
* Steps inject this `optional: true` and fall back to {@link CNGX_STEPPER_HOST}.
|
|
1288
1265
|
*
|
|
1289
|
-
* @category common/stepper
|
|
1290
1266
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group-host.token.ts
|
|
1291
|
-
* @since 0.
|
|
1267
|
+
* @since 0.3.0
|
|
1292
1268
|
*/
|
|
1293
1269
|
const CNGX_STEP_GROUP_HOST = new InjectionToken('CngxStepGroupHost');
|
|
1294
1270
|
|
|
@@ -1296,9 +1272,8 @@ const CNGX_STEP_GROUP_HOST = new InjectionToken('CngxStepGroupHost');
|
|
|
1296
1272
|
* DI token providing the rendering-surface contract to organism shells
|
|
1297
1273
|
* (`<cngx-stepper>`, `<cngx-mat-stepper>`) and consumer-authored skins.
|
|
1298
1274
|
*
|
|
1299
|
-
* @category common/stepper
|
|
1300
1275
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-panel-host.token.ts
|
|
1301
|
-
* @since 0.
|
|
1276
|
+
* @since 0.3.0
|
|
1302
1277
|
*/
|
|
1303
1278
|
const CNGX_STEP_PANEL_HOST = new InjectionToken('CngxStepPanelHost');
|
|
1304
1279
|
|
|
@@ -1314,12 +1289,11 @@ const CNGX_STEP_PANEL_HOST = new InjectionToken('CngxStepPanelHost');
|
|
|
1314
1289
|
* </ng-template>
|
|
1315
1290
|
* ```
|
|
1316
1291
|
*
|
|
1317
|
-
* @category common/stepper
|
|
1318
1292
|
* @wcag AA
|
|
1319
1293
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-content.directive.ts
|
|
1320
|
-
* @since 0.
|
|
1294
|
+
* @since 0.3.0
|
|
1321
1295
|
* @relatedTo CngxStep, CngxStepLabel
|
|
1322
|
-
* <example-url
|
|
1296
|
+
* <example-url>/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
|
|
1323
1297
|
*/
|
|
1324
1298
|
class CngxStepContent {
|
|
1325
1299
|
templateRef = inject(TemplateRef);
|
|
@@ -1346,12 +1320,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1346
1320
|
* </ng-template>
|
|
1347
1321
|
* ```
|
|
1348
1322
|
*
|
|
1349
|
-
* @category common/stepper
|
|
1350
1323
|
* @wcag AA
|
|
1351
1324
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-label.directive.ts
|
|
1352
|
-
* @since 0.
|
|
1325
|
+
* @since 0.3.0
|
|
1353
1326
|
* @relatedTo CngxStep, CngxStepContent, CngxStepGroupHeader
|
|
1354
|
-
* <example-url
|
|
1327
|
+
* <example-url>/#/ui/stepper/stepper-custom-labels/mixing-code-label-code-input-with-code-cngxsteplabel-code-slot</example-url>
|
|
1355
1328
|
*/
|
|
1356
1329
|
class CngxStepLabel {
|
|
1357
1330
|
templateRef = inject(TemplateRef);
|
|
@@ -1374,21 +1347,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1374
1347
|
* `state` is a pure `computed` over `[disabled]`, `[completed]`, and
|
|
1375
1348
|
* the optional `[errorAggregator]`'s `hasError()`.
|
|
1376
1349
|
*
|
|
1377
|
-
* @category common/stepper
|
|
1378
|
-
* @docsKind primary
|
|
1379
1350
|
* @wcag AA
|
|
1380
1351
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step.directive.ts
|
|
1381
|
-
* @since 0.
|
|
1352
|
+
* @since 0.3.0
|
|
1382
1353
|
* @relatedTo CngxStepGroup, CngxStepperPresenter, CngxStepLabel, CngxStepContent
|
|
1383
1354
|
* @slot cngxStepLabel The step's own header label.
|
|
1384
1355
|
* @slot cngxStepContent The step body, rendered lazily when the step activates.
|
|
1385
|
-
* <example-url
|
|
1356
|
+
* <example-url>/#/ui/stepper/stepper-step-content/typed-lazy-panels</example-url>
|
|
1357
|
+
* @axis level molecule
|
|
1386
1358
|
*/
|
|
1387
1359
|
class CngxStep {
|
|
1360
|
+
/**
|
|
1361
|
+
* Identifier the step registers under with its host. Defaults to an auto-generated `cngx-step` uid.
|
|
1362
|
+
* It is read once in `ngOnInit`, so a bound `[id]` must be set before init; the router-sync deep link
|
|
1363
|
+
* and `selectById` match against this value.
|
|
1364
|
+
*/
|
|
1388
1365
|
id = input(nextUid('cngx-step'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1366
|
+
/**
|
|
1367
|
+
* Marks the step as not navigable. Defaults to `false`. A disabled step reports `state` `'disabled'`,
|
|
1368
|
+
* is skipped by next/previous navigation and refused by `select`, and the strip header reflects it
|
|
1369
|
+
* through `aria-disabled`.
|
|
1370
|
+
*/
|
|
1389
1371
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1372
|
+
/**
|
|
1373
|
+
* Marks the step as done. Defaults to `false`. A completed step reports `state` `'success'` unless it is
|
|
1374
|
+
* disabled or errored, and a `linear` stepper only lets the user move past steps that are in that state.
|
|
1375
|
+
*/
|
|
1390
1376
|
completed = input(false, ...(ngDevMode ? [{ debugName: "completed" }] : /* istanbul ignore next */ []));
|
|
1377
|
+
/**
|
|
1378
|
+
* Header text of the step, shown in the strip and used for the next/previous step labels and the
|
|
1379
|
+
* announcement phrases. Defaults to an empty string.
|
|
1380
|
+
*/
|
|
1391
1381
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1382
|
+
/**
|
|
1383
|
+
* Optional error aggregator whose `hasError()` puts the step into the `'error'` state, for forms with
|
|
1384
|
+
* several error sources. Defaults to `undefined`. It composes with `[error]`: either one errors the step.
|
|
1385
|
+
*/
|
|
1392
1386
|
errorAggregator = input(undefined, ...(ngDevMode ? [{ debugName: "errorAggregator" }] : /* istanbul ignore next */ []));
|
|
1393
1387
|
/**
|
|
1394
1388
|
* Direct error flag for the common "this step is invalid" case - no
|
|
@@ -1484,19 +1478,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1484
1478
|
* `success` if all are success, `pending` if any is pending or busy,
|
|
1485
1479
|
* otherwise `idle`.
|
|
1486
1480
|
*
|
|
1487
|
-
* @category common/stepper
|
|
1488
|
-
* @docsKind primary
|
|
1489
1481
|
* @wcag AA
|
|
1490
1482
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/step-group.directive.ts
|
|
1491
|
-
* @since 0.
|
|
1483
|
+
* @since 0.3.0
|
|
1492
1484
|
* @relatedTo CngxStep, CngxStepperPresenter, CngxStepGroupHeader
|
|
1493
|
-
* <example-url
|
|
1494
|
-
* <example-url
|
|
1495
|
-
* <example-url
|
|
1485
|
+
* <example-url>/#/ui/stepper/stepper-hierarchical/group-nested-steps-trailing-root-step</example-url>
|
|
1486
|
+
* <example-url>/#/ui/stepper/stepper-hierarchical/expand-active-group-collapse</example-url>
|
|
1487
|
+
* <example-url>/#/ui/stepper/stepper-hierarchical/group-collapse-summary-count</example-url>
|
|
1496
1488
|
*/
|
|
1497
1489
|
class CngxStepGroup {
|
|
1490
|
+
/**
|
|
1491
|
+
* Identifier the group registers under with the root presenter. Defaults to an auto-generated
|
|
1492
|
+
* `cngx-step-group` uid. It is read once in `ngOnInit`, so a bound `[id]` must be set before init;
|
|
1493
|
+
* child steps are registered with this id as their parent.
|
|
1494
|
+
*/
|
|
1498
1495
|
id = input(nextUid('cngx-step-group'), ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
1496
|
+
/**
|
|
1497
|
+
* Disabled flag of the group node in the step tree. Defaults to `false`. It does not disable the child
|
|
1498
|
+
* steps, which keep their own `[disabled]`.
|
|
1499
|
+
*/
|
|
1499
1500
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1501
|
+
/**
|
|
1502
|
+
* Header text of the group, rendered as the group label in the stepper strip. Defaults to an empty string.
|
|
1503
|
+
*/
|
|
1500
1504
|
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1501
1505
|
config = injectStepperConfig();
|
|
1502
1506
|
// Local child registry - only feeds `aggregatedStatus` below.
|
|
@@ -1579,11 +1583,21 @@ class CngxStepGroup {
|
|
|
1579
1583
|
registrationHost.register(handle);
|
|
1580
1584
|
this.destroyRef.onDestroy(() => registrationHost.unregister(groupId, handle));
|
|
1581
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* `CngxStepGroupHost` contract, called by a nested `CngxStep` (or a nested `CngxStepGroup`) in its
|
|
1588
|
+
* `ngOnInit`. Adds the handle to the group's own registry, which feeds `aggregatedStatus`, and forwards
|
|
1589
|
+
* it to the root presenter with this group's id as parent.
|
|
1590
|
+
*/
|
|
1582
1591
|
register(handle) {
|
|
1583
1592
|
this.childRegistry.update((cur) => [...cur, handle]);
|
|
1584
1593
|
// Forward to the root with this group as parent so the tree shape is correct.
|
|
1585
1594
|
this.stepperHost.register(handle, this.id());
|
|
1586
1595
|
}
|
|
1596
|
+
/**
|
|
1597
|
+
* `CngxStepGroupHost` contract, called from the destroy hook of a nested `CngxStep` or
|
|
1598
|
+
* `CngxStepGroup`. Removes the registration from the group's registry and from the root presenter; when
|
|
1599
|
+
* `handle` is passed, only that exact instance is evicted.
|
|
1600
|
+
*/
|
|
1587
1601
|
unregister(id, handle) {
|
|
1588
1602
|
// Same instance guard as the presenter: only evict the exact handle
|
|
1589
1603
|
// (or fall back to id-keyed removal for handle-less callers).
|
|
@@ -1623,13 +1637,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1623
1637
|
* </cngx-stepper>
|
|
1624
1638
|
* ```
|
|
1625
1639
|
*
|
|
1626
|
-
* @category common/stepper/slots
|
|
1627
1640
|
* @wcag AA
|
|
1628
1641
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-indicator.directive.ts
|
|
1629
|
-
* @since 0.
|
|
1642
|
+
* @since 0.3.0
|
|
1630
1643
|
* @relatedTo CngxStepBadge, CngxStepBusySpinner, CngxStepRejection, CngxStepGroupHeader
|
|
1631
|
-
* <example-url
|
|
1632
|
-
* <example-url
|
|
1644
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/custom-indicator-glyph-via-code-cngxstepindicator-code</example-url>
|
|
1645
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/cross-skin-indicator-override</example-url>
|
|
1633
1646
|
*/
|
|
1634
1647
|
class CngxStepIndicator {
|
|
1635
1648
|
templateRef = inject(TemplateRef);
|
|
@@ -1649,7 +1662,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1649
1662
|
* Slot directive for the error-badge template on `<cngx-stepper>`.
|
|
1650
1663
|
* Discovered via `contentChild`; cascades through
|
|
1651
1664
|
* `CNGX_STEPPER_CONFIG.templates.badge` before falling back to
|
|
1652
|
-
* `
|
|
1665
|
+
* the default alert icon (`CNGX_ICON_ALERT` from `@cngx/utils`).
|
|
1653
1666
|
*
|
|
1654
1667
|
* ```html
|
|
1655
1668
|
* <cngx-stepper>
|
|
@@ -1659,13 +1672,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1659
1672
|
* </cngx-stepper>
|
|
1660
1673
|
* ```
|
|
1661
1674
|
*
|
|
1662
|
-
* @category common/stepper/slots
|
|
1663
1675
|
* @wcag AA
|
|
1664
1676
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-badge.directive.ts
|
|
1665
|
-
* @since 0.
|
|
1677
|
+
* @since 0.3.0
|
|
1666
1678
|
* @relatedTo CngxStepIndicator, CngxStepBusySpinner, CngxStepRejection
|
|
1667
|
-
* <example-url
|
|
1668
|
-
* <example-url
|
|
1679
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/custom-error-badge-via-code-cngxstepbadge-code</example-url>
|
|
1680
|
+
* <example-url>/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>
|
|
1669
1681
|
*/
|
|
1670
1682
|
class CngxStepBadge {
|
|
1671
1683
|
templateRef = inject(TemplateRef);
|
|
@@ -1695,12 +1707,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1695
1707
|
* </cngx-stepper>
|
|
1696
1708
|
* ```
|
|
1697
1709
|
*
|
|
1698
|
-
* @category common/stepper/slots
|
|
1699
1710
|
* @wcag AA
|
|
1700
1711
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-busy-spinner.directive.ts
|
|
1701
|
-
* @since 0.
|
|
1712
|
+
* @since 0.3.0
|
|
1702
1713
|
* @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepRejection
|
|
1703
|
-
* <example-url
|
|
1714
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/custom-busy-spinner-via-code-cngxstepbusyspinner-code</example-url>
|
|
1704
1715
|
*/
|
|
1705
1716
|
class CngxStepBusySpinner {
|
|
1706
1717
|
templateRef = inject(TemplateRef);
|
|
@@ -1720,7 +1731,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1720
1731
|
* Slot directive for the rejection-decoration template on
|
|
1721
1732
|
* `<cngx-stepper>`. Discovered via `contentChild`; cascades through
|
|
1722
1733
|
* `CNGX_STEPPER_CONFIG.templates.rejection` before falling back to
|
|
1723
|
-
* `
|
|
1734
|
+
* the default icon (`CNGX_ICON_ALERT` on a failed commit, `CNGX_ICON_BAN` on
|
|
1735
|
+
* a refused one, from `@cngx/utils`).
|
|
1724
1736
|
*
|
|
1725
1737
|
* Symmetric context shape with the upcoming tabs `cngxTabRejectionIcon`
|
|
1726
1738
|
* slot so consumer templates port directly between the two families.
|
|
@@ -1736,12 +1748,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1736
1748
|
* </cngx-stepper>
|
|
1737
1749
|
* ```
|
|
1738
1750
|
*
|
|
1739
|
-
* @category common/stepper/slots
|
|
1740
1751
|
* @wcag AA
|
|
1741
1752
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-rejection.directive.ts
|
|
1742
|
-
* @since 0.
|
|
1753
|
+
* @since 0.3.0
|
|
1743
1754
|
* @relatedTo CngxStepBadge, CngxStepIndicator, CngxStepBusySpinner
|
|
1744
|
-
* <example-url
|
|
1755
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/rejection-decoration-via-code-cngxsteprejection-code</example-url>
|
|
1745
1756
|
*/
|
|
1746
1757
|
class CngxStepRejection {
|
|
1747
1758
|
templateRef = inject(TemplateRef);
|
|
@@ -1779,10 +1790,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1779
1790
|
* </cngx-stepper>
|
|
1780
1791
|
* ```
|
|
1781
1792
|
*
|
|
1782
|
-
* @category common/stepper/slots
|
|
1783
1793
|
* @wcag AA
|
|
1784
1794
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-error.directive.ts
|
|
1785
|
-
* @since 0.
|
|
1795
|
+
* @since 0.3.0
|
|
1786
1796
|
* @relatedTo CngxStepRejection, CngxStepBadge, CngxStep
|
|
1787
1797
|
*/
|
|
1788
1798
|
class CngxStepError {
|
|
@@ -1813,12 +1823,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1813
1823
|
* </cngx-stepper>
|
|
1814
1824
|
* ```
|
|
1815
1825
|
*
|
|
1816
|
-
* @category common/stepper/slots
|
|
1817
1826
|
* @wcag AA
|
|
1818
1827
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/step-group-header.directive.ts
|
|
1819
|
-
* @since 0.
|
|
1828
|
+
* @since 0.3.0
|
|
1820
1829
|
* @relatedTo CngxStepGroup, CngxStepIndicator, CngxStepLabel
|
|
1821
|
-
* <example-url
|
|
1830
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/custom-group-header-via-code-cngxstepgroupheader-code</example-url>
|
|
1822
1831
|
*/
|
|
1823
1832
|
class CngxStepGroupHeader {
|
|
1824
1833
|
templateRef = inject(TemplateRef);
|
|
@@ -1852,12 +1861,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1852
1861
|
* </cngx-stepper>
|
|
1853
1862
|
* ```
|
|
1854
1863
|
*
|
|
1855
|
-
* @category common/stepper/slots
|
|
1856
1864
|
* @wcag AA
|
|
1857
1865
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/stepper-empty.directive.ts
|
|
1858
|
-
* @since 0.
|
|
1866
|
+
* @since 0.3.0
|
|
1859
1867
|
* @relatedTo CngxStepIndicator, CngxStepGroupHeader
|
|
1860
|
-
* <example-url
|
|
1868
|
+
* <example-url>/#/ui/stepper/stepper-slot-overrides/empty-state-placeholder-via-code-cngxstepperempty-code</example-url>
|
|
1861
1869
|
*/
|
|
1862
1870
|
class CngxStepperEmpty {
|
|
1863
1871
|
templateRef = inject(TemplateRef);
|
|
@@ -1894,12 +1902,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1894
1902
|
* </cngx-dot-stepper>
|
|
1895
1903
|
* ```
|
|
1896
1904
|
*
|
|
1897
|
-
* @category common/stepper/slots
|
|
1898
1905
|
* @wcag AA
|
|
1899
1906
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/slots/dot-stepper-dot.directive.ts
|
|
1900
|
-
* @since 0.
|
|
1907
|
+
* @since 0.3.0
|
|
1901
1908
|
* @relatedTo CngxStepIndicator, CngxStepBadge, CngxStepBusySpinner, CngxStepRejection
|
|
1902
|
-
* <example-url
|
|
1909
|
+
* <example-url>/#/ui/stepper/dot-stepper/icon-dots-via-code-cngxdotstepperdot-code</example-url>
|
|
1903
1910
|
*/
|
|
1904
1911
|
class CngxDotStepperDot {
|
|
1905
1912
|
templateRef = inject(TemplateRef);
|
|
@@ -1926,8 +1933,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1926
1933
|
*
|
|
1927
1934
|
* Tabs has no parallel slot surface yet - see
|
|
1928
1935
|
* `stepper-accepted-debt §3` for the planned Phase-4 closure.
|
|
1929
|
-
*
|
|
1930
|
-
* @category common/stepper/slots
|
|
1931
1936
|
*/
|
|
1932
1937
|
function createStepperTemplateBindings(opts) {
|
|
1933
1938
|
return {
|
|
@@ -1958,35 +1963,6 @@ function createStepperTemplateBindings(opts) {
|
|
|
1958
1963
|
};
|
|
1959
1964
|
}
|
|
1960
1965
|
|
|
1961
|
-
/**
|
|
1962
|
-
* Default glyphs for `<cngx-stepper>` skin slots. Used when neither a
|
|
1963
|
-
* per-instance slot directive nor `CNGX_STEPPER_CONFIG.templates.<key>`
|
|
1964
|
-
* overrides the built-in span. Sibling of `CNGX_SELECT_GLYPHS` /
|
|
1965
|
-
* `CNGX_TABS_GLYPHS`.
|
|
1966
|
-
*
|
|
1967
|
-
* Exported with `@internal` so the organism (and mat-twin) can share
|
|
1968
|
-
* the literals across the secondary-entry boundary that Sheriff
|
|
1969
|
-
* forbids deep-relative imports across. Consumers customise via
|
|
1970
|
-
* `*cngxStep*` slots or `withStep*Template` features.
|
|
1971
|
-
*
|
|
1972
|
-
* @internal
|
|
1973
|
-
* @category common/stepper
|
|
1974
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/glyphs.ts
|
|
1975
|
-
* @since 0.1.0
|
|
1976
|
-
*/
|
|
1977
|
-
const CNGX_STEPPER_GLYPHS = {
|
|
1978
|
-
/** Default visual for `*cngxStepBadge` when no override is bound. */
|
|
1979
|
-
errorBadge: '!',
|
|
1980
|
-
/** Default visual for `*cngxStepRejection` on a failed commit when no override is bound. */
|
|
1981
|
-
rejectionIcon: '!',
|
|
1982
|
-
/**
|
|
1983
|
-
* Default visual for `*cngxStepRejection` on a refused commit (the action
|
|
1984
|
-
* answered `false`). A distinct glyph, so a refusal never differs from a
|
|
1985
|
-
* failure by colour alone (WCAG 1.4.1).
|
|
1986
|
-
*/
|
|
1987
|
-
refusedIcon: '\u2298',
|
|
1988
|
-
};
|
|
1989
|
-
|
|
1990
1966
|
/**
|
|
1991
1967
|
* URL deep-linking for the stepper. Bidirectional sync between
|
|
1992
1968
|
* `activeStepId` and a URL fragment / query-param. Opt-in via
|
|
@@ -1998,20 +1974,29 @@ const CNGX_STEPPER_GLYPHS = {
|
|
|
1998
1974
|
* `Router` is optional - without `@angular/router` the directive
|
|
1999
1975
|
* dev-warns once and becomes a no-op.
|
|
2000
1976
|
*
|
|
2001
|
-
* @category common/stepper
|
|
2002
|
-
* @docsKind primary
|
|
2003
1977
|
* @wcag AA
|
|
2004
1978
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/router-sync.directive.ts
|
|
2005
|
-
* @since 0.
|
|
1979
|
+
* @since 0.3.0
|
|
2006
1980
|
* @relatedTo CngxStepperPresenter, CNGX_STEPPER_CONFIG
|
|
2007
|
-
* <example-url
|
|
1981
|
+
* <example-url>/#/ui/stepper/stepper-router-sync/deep-linking-with-fragment-queryparam-modes</example-url>
|
|
2008
1982
|
*/
|
|
2009
1983
|
class CngxStepperRouterSync {
|
|
2010
1984
|
// Default undefined so the cascade resolves through CNGX_STEPPER_CONFIG.
|
|
2011
|
-
//
|
|
2012
|
-
//
|
|
2013
|
-
//
|
|
1985
|
+
// The resolved mode / param are read on every URL write and read, not
|
|
1986
|
+
// only at init; changing either after init applies to the next one and
|
|
1987
|
+
// leaves the previous key behind in the URL.
|
|
1988
|
+
/**
|
|
1989
|
+
* Binding `[mode]`: where the active step id is kept in the URL, `'fragment'` (`#step=customer`) or
|
|
1990
|
+
* `'queryParam'` (`?step=customer`). Unset, it resolves through `routerSyncMode` of the stepper config
|
|
1991
|
+
* and then `'fragment'`. A change after init applies to the next URL write or read and leaves the
|
|
1992
|
+
* previous key in the URL.
|
|
1993
|
+
*/
|
|
2014
1994
|
modeInput = input(undefined, { ...(ngDevMode ? { debugName: "modeInput" } : /* istanbul ignore next */ {}), alias: 'mode' });
|
|
1995
|
+
/**
|
|
1996
|
+
* Binding `[paramName]`: name of the fragment or query key that carries the step id. Unset, it resolves
|
|
1997
|
+
* through `routerSyncParam` of the stepper config and then `'step'`. A change after init applies to the next URL write or read and leaves the
|
|
1998
|
+
* previous key in the URL.
|
|
1999
|
+
*/
|
|
2015
2000
|
paramNameInput = input(undefined, { ...(ngDevMode ? { debugName: "paramNameInput" } : /* istanbul ignore next */ {}), alias: 'paramName' });
|
|
2016
2001
|
config = injectStepperConfig();
|
|
2017
2002
|
mode = computed(() => this.modeInput() ?? this.config.routerSyncMode ?? 'fragment', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
@@ -2174,28 +2159,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2174
2159
|
* no signal graph involvement.
|
|
2175
2160
|
*
|
|
2176
2161
|
* Resolution order:
|
|
2177
|
-
* 1. `
|
|
2178
|
-
* 2.
|
|
2179
|
-
* 3.
|
|
2180
|
-
* 4.
|
|
2162
|
+
* 1. `error` data-state -> `statusLabels.errored`
|
|
2163
|
+
* 2. a failed commit rejection -> `statusLabels.errored`
|
|
2164
|
+
* 3. a refused commit rejection -> `statusLabels.refused`
|
|
2165
|
+
* 4. `success` data-state -> `statusLabels.done`
|
|
2166
|
+
* 5. `aria-current="step"` -> `statusLabels.inProgress`
|
|
2167
|
+
* 6. otherwise -> `statusLabels.upNext`
|
|
2181
2168
|
*
|
|
2182
|
-
*
|
|
2169
|
+
* The rejection outranks `done` and the position words because it is the
|
|
2170
|
+
* most recent event on the step: a rejected step must never read "Up next".
|
|
2183
2171
|
*
|
|
2184
|
-
*
|
|
2172
|
+
* Group nodes (non-step) return an empty string.
|
|
2185
2173
|
*/
|
|
2186
|
-
function resolveStepperStatusLabel(node, i18n, isActive) {
|
|
2174
|
+
function resolveStepperStatusLabel(node, i18n, isActive, rejection = null) {
|
|
2187
2175
|
if (node.kind !== 'step') {
|
|
2188
2176
|
return '';
|
|
2189
2177
|
}
|
|
2190
2178
|
const labels = i18n.statusLabels;
|
|
2191
2179
|
const state = node.state();
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2180
|
+
if (state === 'error' || rejection === 'failed') {
|
|
2181
|
+
return labels.errored;
|
|
2182
|
+
}
|
|
2183
|
+
if (rejection === 'refused') {
|
|
2184
|
+
return labels.refused;
|
|
2185
|
+
}
|
|
2186
|
+
if (state === 'success') {
|
|
2187
|
+
return labels.done;
|
|
2188
|
+
}
|
|
2189
|
+
return isActive ? labels.inProgress : labels.upNext;
|
|
2199
2190
|
}
|
|
2200
2191
|
|
|
2201
2192
|
/**
|
|
@@ -2213,7 +2204,6 @@ function resolveStepperStatusLabel(node, i18n, isActive) {
|
|
|
2213
2204
|
* on the stepper component is one; a bare call from a lifecycle hook is not.
|
|
2214
2205
|
*
|
|
2215
2206
|
* @param host The `<cngx-stepper>` host element, which is its own container.
|
|
2216
|
-
* @category common/stepper
|
|
2217
2207
|
* @relatedTo createStepperDisplayMode, injectContainerSize
|
|
2218
2208
|
*/
|
|
2219
2209
|
function injectStepperCollapse(host) {
|
|
@@ -2233,7 +2223,6 @@ function injectStepperCollapse(host) {
|
|
|
2233
2223
|
*
|
|
2234
2224
|
* @param collapsed `true` while the container sits below the collapse rung.
|
|
2235
2225
|
* @param mobileCollapse The configured collapse policy, read lazily.
|
|
2236
|
-
* @category common/stepper
|
|
2237
2226
|
*/
|
|
2238
2227
|
function createStepperDisplayMode(collapsed, mobileCollapse) {
|
|
2239
2228
|
return computed(() => {
|
|
@@ -2267,8 +2256,6 @@ function subtreeStats(node) {
|
|
|
2267
2256
|
* to the group's existing status-phrase span, so {@link srText} returns
|
|
2268
2257
|
* `null` there. SR phrases resolve through the `CngxStepperI18n` bundle
|
|
2269
2258
|
* when passed; English defaults otherwise.
|
|
2270
|
-
*
|
|
2271
|
-
* @category common/stepper
|
|
2272
2259
|
*/
|
|
2273
2260
|
function createStepperGroupSummary(options) {
|
|
2274
2261
|
const mode = computed(() => options.summaryMode() ?? 'progress', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
@@ -2308,8 +2295,6 @@ function createStepperGroupSummary(options) {
|
|
|
2308
2295
|
* the seeded `-1`. Each candidate is gated by `canNavigateTo` + `busy`
|
|
2309
2296
|
* (mirroring the step-header reachability), so a linear-blocked leading
|
|
2310
2297
|
* step is skipped to the first reachable one.
|
|
2311
|
-
*
|
|
2312
|
-
* @category common/stepper
|
|
2313
2298
|
*/
|
|
2314
2299
|
function createStepperGroupNavigation(options) {
|
|
2315
2300
|
const { presenter } = options;
|
|
@@ -2371,19 +2356,17 @@ function createStepperHostAttrs(inputs) {
|
|
|
2371
2356
|
* Shared `aria-label` cascade for every stepper organism host
|
|
2372
2357
|
* (`<cngx-stepper>` and the compact variants): a bound
|
|
2373
2358
|
* `aria-labelledby` trumps and nulls the label out; otherwise the
|
|
2374
|
-
* per-instance input wins over `
|
|
2375
|
-
* `i18n.stepperLabel`. One source so the variants cannot drift from
|
|
2359
|
+
* per-instance input wins over `i18n.stepperLabel`. One source so the variants cannot drift from
|
|
2376
2360
|
* the parent's naming behaviour.
|
|
2377
2361
|
*
|
|
2378
2362
|
* @internal
|
|
2379
2363
|
*/
|
|
2380
2364
|
function createStepperAccname(inputs) {
|
|
2381
|
-
const ariaLabels = coerceSignal(inputs.config.ariaLabels);
|
|
2382
2365
|
return computed(() => {
|
|
2383
2366
|
if (inputs.ariaLabelledBy()) {
|
|
2384
2367
|
return null; // labelledby trumps label
|
|
2385
2368
|
}
|
|
2386
|
-
return inputs.ariaLabel() ??
|
|
2369
|
+
return inputs.ariaLabel() ?? inputs.i18n().stepperLabel;
|
|
2387
2370
|
});
|
|
2388
2371
|
}
|
|
2389
2372
|
|
|
@@ -2421,7 +2404,9 @@ function createStepperStripKeyboardNav(options) {
|
|
|
2421
2404
|
// the action settles). The controller retains intendedValue after a
|
|
2422
2405
|
// rejection for the commit-error surface, so an unguarded read
|
|
2423
2406
|
// would teleport focus to the refused step on any later no-op key.
|
|
2424
|
-
|
|
2407
|
+
// Keyed on the commit, not busy(): a finish run must not move focus
|
|
2408
|
+
// to an intendedValue retained from an earlier refused commit.
|
|
2409
|
+
const intendedIdx = options.presenter.commitState.status() === 'pending'
|
|
2425
2410
|
? options.presenter.intendedStepIndex()
|
|
2426
2411
|
: undefined;
|
|
2427
2412
|
const intendedId = intendedIdx !== undefined
|
|
@@ -2501,8 +2486,7 @@ function createStepperStripKeyboardNav(options) {
|
|
|
2501
2486
|
* step-only projection. Pure factory - `computed()` only, no injection
|
|
2502
2487
|
* context required, so any skin can allocate it in a field initializer.
|
|
2503
2488
|
*
|
|
2504
|
-
* @
|
|
2505
|
-
* @since 0.1.0
|
|
2489
|
+
* @since 0.3.0
|
|
2506
2490
|
* @relatedTo CngxStepperHost, createStepperSlotContextBuilders
|
|
2507
2491
|
*/
|
|
2508
2492
|
function createStepperStateView(inputs) {
|
|
@@ -2583,8 +2567,7 @@ function createStepperStateView(inputs) {
|
|
|
2583
2567
|
* re-announce the line. Pass the i18n bundle as an untracked snapshot for
|
|
2584
2568
|
* the same reason.
|
|
2585
2569
|
*
|
|
2586
|
-
* @
|
|
2587
|
-
* @since 0.1.0
|
|
2570
|
+
* @since 0.3.0
|
|
2588
2571
|
*/
|
|
2589
2572
|
function resolveStepperErrorSummary(view, stepsOnly, i18n, messageOf) {
|
|
2590
2573
|
const count = view.errorMarkerCount();
|
|
@@ -2975,11 +2958,9 @@ function createStepperPanelRefs(inputs) {
|
|
|
2975
2958
|
* window apply identically to a click); the back swipe ->
|
|
2976
2959
|
* `selectPrevious()`, gated on `busy()` like the strip back-arrow.
|
|
2977
2960
|
*
|
|
2978
|
-
* @category common/stepper
|
|
2979
|
-
* @docsKind primary
|
|
2980
2961
|
* @wcag AA
|
|
2981
2962
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/swipe-nav.directive.ts
|
|
2982
|
-
* @since 0.
|
|
2963
|
+
* @since 0.3.0
|
|
2983
2964
|
*/
|
|
2984
2965
|
class CngxStepperSwipeNav {
|
|
2985
2966
|
/**
|
|
@@ -3077,11 +3058,9 @@ function warnStepperControlUnhosted(selector, host) {
|
|
|
3077
3058
|
* the caption sits next to another live region (e.g. a stepper that
|
|
3078
3059
|
* already mounts its own live announcer) to prevent double announces.
|
|
3079
3060
|
*
|
|
3080
|
-
* @
|
|
3081
|
-
* @docsKind primary
|
|
3082
|
-
* @since 0.1.0
|
|
3061
|
+
* @since 0.3.0
|
|
3083
3062
|
* @relatedTo CngxStepperHost, CngxStepperI18n
|
|
3084
|
-
* <example-url
|
|
3063
|
+
* <example-url>/#/ui/stepper/stepper-count/multi-instance-format-overrides</example-url>
|
|
3085
3064
|
*/
|
|
3086
3065
|
class CngxStepperCount {
|
|
3087
3066
|
/**
|
|
@@ -3180,11 +3159,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3180
3159
|
* ambient {@link CNGX_STEPPER_HOST}.
|
|
3181
3160
|
*
|
|
3182
3161
|
* `(click)` retreats via `selectPrevious()`. The control disables itself
|
|
3183
|
-
* when there is no earlier step (`!canGoPrevious()`) OR while a commit
|
|
3184
|
-
* in flight (`busy()`): `selectPrevious()` writes
|
|
3185
|
-
* directly, bypassing the commit controller, so
|
|
3186
|
-
* in-flight forward commit
|
|
3187
|
-
* is the host's `canGoPrevious` bound -
|
|
3162
|
+
* when there is no earlier step (`!canGoPrevious()`) OR while a commit or
|
|
3163
|
+
* the finish run is in flight (`busy()`): `selectPrevious()` writes
|
|
3164
|
+
* `activeStepIndex` directly, bypassing the commit controller, so
|
|
3165
|
+
* disabling it during an in-flight forward commit or finish run prevents
|
|
3166
|
+
* a navigate-mid-run race. The gate is the host's `canGoPrevious` bound -
|
|
3167
|
+
* never re-derived from `stepsOnly`.
|
|
3188
3168
|
*
|
|
3189
3169
|
* Reflects the disabled state via `aria-disabled` only - never native
|
|
3190
3170
|
* `disabled` - so the control stays focusable and AT-reachable; the
|
|
@@ -3194,11 +3174,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3194
3174
|
* <button cngxStepperPrevious>Back</button>
|
|
3195
3175
|
* ```
|
|
3196
3176
|
*
|
|
3197
|
-
* @category common/stepper
|
|
3198
|
-
* @docsKind primary
|
|
3199
3177
|
* @wcag AA
|
|
3200
3178
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-previous.directive.ts
|
|
3201
|
-
* @since 0.
|
|
3179
|
+
* @since 0.3.0
|
|
3202
3180
|
* @relatedTo CngxStepperNext, CngxStepperComplete, CngxStepperHost
|
|
3203
3181
|
*/
|
|
3204
3182
|
class CngxStepperPrevious {
|
|
@@ -3210,7 +3188,10 @@ class CngxStepperPrevious {
|
|
|
3210
3188
|
host = input(null, ...(ngDevMode ? [{ debugName: "host" }] : /* istanbul ignore next */ []));
|
|
3211
3189
|
injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });
|
|
3212
3190
|
resolvedHost = computed(() => this.host() ?? this.injectedHost, ...(ngDevMode ? [{ debugName: "resolvedHost" }] : /* istanbul ignore next */ []));
|
|
3213
|
-
coPlacedAsyncClick = inject(
|
|
3191
|
+
coPlacedAsyncClick = inject(CNGX_ASYNC_RUN_STATE, {
|
|
3192
|
+
self: true,
|
|
3193
|
+
optional: true,
|
|
3194
|
+
});
|
|
3214
3195
|
elementRef = inject(ElementRef);
|
|
3215
3196
|
i18n = injectStepperI18n();
|
|
3216
3197
|
constructor() {
|
|
@@ -3290,8 +3271,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3290
3271
|
*
|
|
3291
3272
|
* `(click)` advances via `selectNext()`. A turnkey re-entrancy guard
|
|
3292
3273
|
* disables the control when there is no enabled next step
|
|
3293
|
-
* (`!canGoNext()`) OR while a commit
|
|
3294
|
-
* guard a consumer forgets is a silent
|
|
3274
|
+
* (`!canGoNext()`) OR while a commit or the finish run is in flight
|
|
3275
|
+
* (`busy()`) - an opt-in guard a consumer forgets is a silent
|
|
3276
|
+
* double-commit (Pillar 2). The
|
|
3295
3277
|
* gate reads the host's `canGoNext` bound, which derives from the same
|
|
3296
3278
|
* `select()` predicates, so the affordance can never drift from the
|
|
3297
3279
|
* navigation it triggers.
|
|
@@ -3308,11 +3290,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3308
3290
|
* <button cngxStepperNext>Continue</button>
|
|
3309
3291
|
* ```
|
|
3310
3292
|
*
|
|
3311
|
-
* @category common/stepper
|
|
3312
|
-
* @docsKind primary
|
|
3313
3293
|
* @wcag AA
|
|
3314
3294
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-next.directive.ts
|
|
3315
|
-
* @since 0.
|
|
3295
|
+
* @since 0.3.0
|
|
3316
3296
|
* @relatedTo CngxStepperPrevious, CngxStepperComplete, CngxAsyncStatus, CngxStepperHost
|
|
3317
3297
|
*/
|
|
3318
3298
|
class CngxStepperNext {
|
|
@@ -3324,7 +3304,10 @@ class CngxStepperNext {
|
|
|
3324
3304
|
host = input(null, ...(ngDevMode ? [{ debugName: "host" }] : /* istanbul ignore next */ []));
|
|
3325
3305
|
injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });
|
|
3326
3306
|
resolvedHost = computed(() => this.host() ?? this.injectedHost, ...(ngDevMode ? [{ debugName: "resolvedHost" }] : /* istanbul ignore next */ []));
|
|
3327
|
-
coPlacedAsyncClick = inject(
|
|
3307
|
+
coPlacedAsyncClick = inject(CNGX_ASYNC_RUN_STATE, {
|
|
3308
|
+
self: true,
|
|
3309
|
+
optional: true,
|
|
3310
|
+
});
|
|
3328
3311
|
elementRef = inject(ElementRef);
|
|
3329
3312
|
i18n = injectStepperI18n();
|
|
3330
3313
|
/** `true` when advancing is unavailable: no enabled next step or commit busy. */
|
|
@@ -3409,7 +3392,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3409
3392
|
* falling back to the ambient {@link CNGX_STEPPER_HOST}. {@link isActive}
|
|
3410
3393
|
* exposes whether the active step is the last one, so a consumer renders
|
|
3411
3394
|
* the finish control only on the final step. `(completed)` emits once
|
|
3412
|
-
*
|
|
3395
|
+
* per successful run of the action.
|
|
3413
3396
|
*
|
|
3414
3397
|
* ```html
|
|
3415
3398
|
* @if (s.presenter.isLastStep()) {
|
|
@@ -3417,11 +3400,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3417
3400
|
* }
|
|
3418
3401
|
* ```
|
|
3419
3402
|
*
|
|
3420
|
-
* @category common/stepper
|
|
3421
|
-
* @docsKind primary
|
|
3422
3403
|
* @wcag AA
|
|
3423
3404
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/stepper/controls/stepper-complete.directive.ts
|
|
3424
|
-
* @since 0.
|
|
3405
|
+
* @since 0.3.0
|
|
3425
3406
|
* @relatedTo CngxStepperNext, CngxStepperPrevious, CngxAsyncClick, CngxStepperHost
|
|
3426
3407
|
*/
|
|
3427
3408
|
class CngxStepperComplete {
|
|
@@ -3432,31 +3413,45 @@ class CngxStepperComplete {
|
|
|
3432
3413
|
*/
|
|
3433
3414
|
host = input(null, ...(ngDevMode ? [{ debugName: "host" }] : /* istanbul ignore next */ []));
|
|
3434
3415
|
/**
|
|
3435
|
-
* Emits once per
|
|
3436
|
-
*
|
|
3437
|
-
*
|
|
3416
|
+
* Emits once per successful run of the finish action, driven by the
|
|
3417
|
+
* runner's `(settled)` event: two runs that succeed before change
|
|
3418
|
+
* detection emit twice. Never on failure, cancel or after destroy, and
|
|
3419
|
+
* not when the `feedbackDuration` window resets the runner to idle.
|
|
3438
3420
|
*/
|
|
3439
3421
|
completed = output();
|
|
3440
3422
|
injectedHost = inject(CNGX_STEPPER_HOST, { optional: true });
|
|
3441
3423
|
resolvedHost = computed(() => this.host() ?? this.injectedHost, ...(ngDevMode ? [{ debugName: "resolvedHost" }] : /* istanbul ignore next */ []));
|
|
3442
|
-
runner = inject(
|
|
3424
|
+
runner = inject(CNGX_ASYNC_RUN_STATE, { host: true });
|
|
3425
|
+
// Busy for the run and for the held busy visual after it. The runner's own
|
|
3426
|
+
// [busy] hint and a host-reflected busy stay out: they are not this run.
|
|
3427
|
+
busy = computed(() => this.runner.pending() || this.runner.busyVisible(), ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
3428
|
+
busyKey = nextUid('cngx-stepper-complete');
|
|
3443
3429
|
/** `true` when the active step is the last one - the finish step. */
|
|
3444
3430
|
isActive = computed(() => this.resolvedHost()?.isLastStep() ?? false, ...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
3445
3431
|
constructor() {
|
|
3446
3432
|
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
3447
3433
|
warnStepperControlUnhosted('cngxStepperComplete', this.resolvedHost);
|
|
3448
3434
|
}
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3435
|
+
// The run and its dwell hold the host busy, so Back, Next and header
|
|
3436
|
+
// navigation refuse while Finish runs. register() reads and writes the
|
|
3437
|
+
// registry's own signal, so the call stays untracked; only the host is a
|
|
3438
|
+
// dependency.
|
|
3439
|
+
effect((onCleanup) => {
|
|
3440
|
+
const host = this.resolvedHost();
|
|
3441
|
+
const release = untracked(() => host?.registerBusy?.(this.busyKey, this.busy));
|
|
3442
|
+
if (release) {
|
|
3443
|
+
onCleanup(release);
|
|
3444
|
+
}
|
|
3445
|
+
});
|
|
3446
|
+
// The subscription ends with the runner, which shares this element.
|
|
3447
|
+
this.runner.settled.subscribe((settle) => {
|
|
3448
|
+
if (settle.status === 'success') {
|
|
3449
|
+
this.completed.emit();
|
|
3455
3450
|
}
|
|
3456
3451
|
});
|
|
3457
3452
|
}
|
|
3458
3453
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStepperComplete, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3459
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxStepperComplete, isStandalone: true, selector: "[cngxStepperComplete]", inputs: { host: { classPropertyName: "host", publicName: "host", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { completed: "completed" }, exportAs: ["cngxStepperComplete"], hostDirectives: [{ directive: i1.CngxAsyncClick, inputs: ["cngxAsyncClick", "cngxStepperComplete", "feedbackDuration", "feedbackDuration", "enabled", "enabled", "succeededAnnouncement", "succeededAnnouncement", "failedAnnouncement", "failedAnnouncement"] }], ngImport: i0 });
|
|
3454
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: CngxStepperComplete, isStandalone: true, selector: "[cngxStepperComplete]", inputs: { host: { classPropertyName: "host", publicName: "host", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { completed: "completed" }, exportAs: ["cngxStepperComplete"], hostDirectives: [{ directive: i1.CngxAsyncClick, inputs: ["cngxAsyncClick", "cngxStepperComplete", "feedbackDuration", "feedbackDuration", "enabled", "enabled", "succeededAnnouncement", "succeededAnnouncement", "failedAnnouncement", "failedAnnouncement", "showDelay", "showDelay", "minDwell", "minDwell"] }], ngImport: i0 });
|
|
3460
3455
|
}
|
|
3461
3456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStepperComplete, decorators: [{
|
|
3462
3457
|
type: Directive,
|
|
@@ -3473,6 +3468,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3473
3468
|
'enabled',
|
|
3474
3469
|
'succeededAnnouncement',
|
|
3475
3470
|
'failedAnnouncement',
|
|
3471
|
+
'showDelay',
|
|
3472
|
+
'minDwell',
|
|
3476
3473
|
],
|
|
3477
3474
|
},
|
|
3478
3475
|
],
|
|
@@ -3480,6 +3477,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
3480
3477
|
}], ctorParameters: () => [], propDecorators: { host: [{ type: i0.Input, args: [{ isSignal: true, alias: "host", required: false }] }], completed: [{ type: i0.Output, args: ["completed"] }] } });
|
|
3481
3478
|
|
|
3482
3479
|
const EMPTY_NODES = Object.freeze([]);
|
|
3480
|
+
const NO_RELEASE = () => undefined;
|
|
3483
3481
|
/**
|
|
3484
3482
|
* Builds a live delegating {@link CngxStepperHost} proxy over a supplier
|
|
3485
3483
|
* signal. Every signal member is a `computed()` reading
|
|
@@ -3499,8 +3497,7 @@ const EMPTY_NODES = Object.freeze([]);
|
|
|
3499
3497
|
* only). Single consumer (the footer); the surface is load-bearing, not
|
|
3500
3498
|
* speculative.
|
|
3501
3499
|
*
|
|
3502
|
-
* @
|
|
3503
|
-
* @since 0.1.0
|
|
3500
|
+
* @since 0.3.0
|
|
3504
3501
|
* @relatedTo CngxStepperFooter, CngxStepperHost
|
|
3505
3502
|
*/
|
|
3506
3503
|
function createStepperHostProxy(supplier) {
|
|
@@ -3558,6 +3555,9 @@ function createStepperHostProxy(supplier) {
|
|
|
3558
3555
|
clearLastFailed: () => supplier()?.clearLastFailed(),
|
|
3559
3556
|
register: (handle, parentId) => supplier()?.register(handle, parentId),
|
|
3560
3557
|
unregister: (id) => supplier()?.unregister(id),
|
|
3558
|
+
// Bound to the host current at the call: a later supplier swap leaves
|
|
3559
|
+
// the registration where it is (stepper-accepted-debt §20).
|
|
3560
|
+
registerBusy: (key, pending) => supplier()?.registerBusy?.(key, pending) ?? NO_RELEASE,
|
|
3561
3561
|
};
|
|
3562
3562
|
}
|
|
3563
3563
|
|
|
@@ -3607,14 +3607,11 @@ function partitionFeatures(features, caller) {
|
|
|
3607
3607
|
* provideCngxStepper(
|
|
3608
3608
|
* withStepperDefaultOrientation('vertical'),
|
|
3609
3609
|
* withStepperLinear(true),
|
|
3610
|
-
*
|
|
3611
|
-
* withStepperI18nLabels({ stepperLabel: 'Schrittfolge', previousStep: 'Vorheriger' }),
|
|
3610
|
+
* withStepperI18nLabels({ stepperLabel: 'Bestellschritte', previousStep: 'Vorheriger' }),
|
|
3612
3611
|
* ),
|
|
3613
3612
|
* ],
|
|
3614
3613
|
* });
|
|
3615
3614
|
* ```
|
|
3616
|
-
*
|
|
3617
|
-
* @category common/stepper
|
|
3618
3615
|
*/
|
|
3619
3616
|
function provideCngxStepper(...features) {
|
|
3620
3617
|
const { config, i18n } = partitionFeatures(features, 'provideCngxStepper');
|
|
@@ -3635,13 +3632,11 @@ function provideCngxStepper(...features) {
|
|
|
3635
3632
|
* viewProviders: [
|
|
3636
3633
|
* ...provideCngxStepperAt(
|
|
3637
3634
|
* withStepperDefaultOrientation('vertical'),
|
|
3638
|
-
* withStepperI18nLabels({ stepperLabel: '
|
|
3635
|
+
* withStepperI18nLabels({ stepperLabel: 'Bestellschritte' }),
|
|
3639
3636
|
* ),
|
|
3640
3637
|
* ],
|
|
3641
3638
|
* })
|
|
3642
3639
|
* ```
|
|
3643
|
-
*
|
|
3644
|
-
* @category common/stepper
|
|
3645
3640
|
*/
|
|
3646
3641
|
function provideCngxStepperAt(...features) {
|
|
3647
3642
|
const { config, i18n } = partitionFeatures(features, 'provideCngxStepperAt');
|
|
@@ -3654,7 +3649,7 @@ function provideCngxStepperAt(...features) {
|
|
|
3654
3649
|
}
|
|
3655
3650
|
|
|
3656
3651
|
/**
|
|
3657
|
-
* @module
|
|
3652
|
+
* @module `@cngx/common/stepper`
|
|
3658
3653
|
*
|
|
3659
3654
|
* Level-2 directive-only logic for stepper / wizard flows. Ships the
|
|
3660
3655
|
* presenter brain, atom directives, host tokens, router-sync, config
|
|
@@ -3667,5 +3662,5 @@ function provideCngxStepperAt(...features) {
|
|
|
3667
3662
|
* Generated bundle index. Do not edit.
|
|
3668
3663
|
*/
|
|
3669
3664
|
|
|
3670
|
-
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG,
|
|
3665
|
+
export { CNGX_STEPPER_COMMIT_HANDLER_FACTORY, CNGX_STEPPER_CONFIG, 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, withStepperCommitMode, withStepperConnectors, withStepperDefaultOrientation, withStepperDensity, withStepperEmptyTemplate, withStepperFallbackLabels, withStepperGroupCollapse, withStepperGroupCollapseSummary, withStepperHeaderNavigation, withStepperI18nLabels, withStepperLinear, withStepperMobileCollapse, withStepperMobileIndicatorPosition, withStepperMobileSwipe, withStepperRouterSync, withStepperSkin };
|
|
3671
3666
|
//# sourceMappingURL=cngx-common-stepper.mjs.map
|