@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +224 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +194 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +314 -141
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, InjectionToken, Type, Provider, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { TemplateRef, InjectionToken, Type, Provider, EnvironmentProviders, Signal } from '@angular/core';
|
|
3
3
|
import { CngxAsyncState } from '@cngx/core/utils';
|
|
4
|
+
import { CngxMessage } from '@cngx/core/i18n';
|
|
4
5
|
import { Observable, Subject } from 'rxjs';
|
|
6
|
+
import * as _cngx_ui_feedback from '@cngx/ui/feedback';
|
|
5
7
|
import { AsyncView } from '@cngx/common/data';
|
|
6
8
|
|
|
7
9
|
/**
|
|
@@ -46,14 +48,15 @@ type LoadingIndicatorVariant = 'spinner' | 'bar';
|
|
|
46
48
|
declare class CngxLoadingIndicator {
|
|
47
49
|
private readonly config;
|
|
48
50
|
private readonly loadingConfig;
|
|
51
|
+
private readonly i18n;
|
|
49
52
|
/** Bind an async state - shows indicator when `isBusy()`. */
|
|
50
53
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
51
54
|
/** Direct boolean control - alternative to `[state]`. */
|
|
52
55
|
readonly loading: _angular_core.InputSignal<boolean>;
|
|
53
56
|
/** Visual variant. */
|
|
54
57
|
readonly variant: _angular_core.InputSignal<LoadingIndicatorVariant>;
|
|
55
|
-
/** Screen reader label. */
|
|
56
|
-
readonly label: _angular_core.InputSignal<string>;
|
|
58
|
+
/** Screen reader label. Unbound, `CNGX_FEEDBACK_I18N.loadingLabel` applies. */
|
|
59
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
57
60
|
/** Delay in ms before showing the indicator. Defaults to `CNGX_LOADING_CONFIG.showDelay`. */
|
|
58
61
|
readonly delay: _angular_core.InputSignal<number>;
|
|
59
62
|
/** Minimum display time in ms once visible. Defaults to `CNGX_LOADING_CONFIG.minDwell`. */
|
|
@@ -71,6 +74,13 @@ declare class CngxLoadingIndicator {
|
|
|
71
74
|
protected readonly effectiveMinDwell: _angular_core.Signal<number>;
|
|
72
75
|
/** @internal - final visibility after delay + minDwell. */
|
|
73
76
|
readonly visible: _angular_core.Signal<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* @internal - accessible name of the status host. A bound `label` applies at
|
|
79
|
+
* once; the i18n default is read untracked and keyed on visibility, so a
|
|
80
|
+
* language switch never renames a showing indicator and its next appearance
|
|
81
|
+
* speaks the new language.
|
|
82
|
+
*/
|
|
83
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
74
84
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLoadingIndicator, never>;
|
|
75
85
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxLoadingIndicator, "cngx-loading-indicator", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "delay": { "alias": "delay"; "required": false; "isSignal": true; }; "minDwell": { "alias": "minDwell"; "required": false; "isSignal": true; }; "minDuration": { "alias": "minDuration"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
76
86
|
}
|
|
@@ -118,12 +128,16 @@ declare class CngxLoadingIndicator {
|
|
|
118
128
|
declare class CngxLoadingOverlay {
|
|
119
129
|
private readonly doc;
|
|
120
130
|
private readonly loadingConfig;
|
|
131
|
+
private readonly i18n;
|
|
121
132
|
/** Bind an async state - shows overlay when `isBusy()`. */
|
|
122
133
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
123
134
|
/** Direct boolean control - alternative to `[state]`. */
|
|
124
135
|
readonly loading: _angular_core.InputSignal<boolean>;
|
|
125
|
-
/**
|
|
126
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Screen reader label for the spinner. Unbound,
|
|
138
|
+
* `CNGX_FEEDBACK_I18N.loadingLabel` applies.
|
|
139
|
+
*/
|
|
140
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
127
141
|
/** Delay in ms before showing the overlay. Defaults to `CNGX_LOADING_CONFIG.showDelay`. */
|
|
128
142
|
readonly delay: _angular_core.InputSignal<number>;
|
|
129
143
|
/** Minimum display time in ms once visible. Defaults to `CNGX_LOADING_CONFIG.minDwell`. */
|
|
@@ -145,7 +159,13 @@ declare class CngxLoadingOverlay {
|
|
|
145
159
|
protected readonly effectiveMinDwell: _angular_core.Signal<number>;
|
|
146
160
|
/** @internal - debounced visibility via shared gate factory. */
|
|
147
161
|
protected readonly visible: _angular_core.Signal<boolean>;
|
|
148
|
-
|
|
162
|
+
/**
|
|
163
|
+
* @internal - accessible name of the spinner status region. A bound `label`
|
|
164
|
+
* applies at once; the i18n default is read untracked and keyed on
|
|
165
|
+
* visibility, so a language switch never renames a showing spinner.
|
|
166
|
+
*/
|
|
167
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
168
|
+
private savedFocus;
|
|
149
169
|
private readonly contentWrapper;
|
|
150
170
|
private readonly spinnerEl;
|
|
151
171
|
constructor();
|
|
@@ -192,6 +212,8 @@ type ProgressVariant = 'linear' | 'circular';
|
|
|
192
212
|
* <example-url>http://localhost:4200/#/ui/feedback/progress/linear-indeterminate</example-url>
|
|
193
213
|
*/
|
|
194
214
|
declare class CngxProgress {
|
|
215
|
+
private readonly i18n;
|
|
216
|
+
private readonly locale;
|
|
195
217
|
/** Bind an async state - reads `progress()` for determinate mode. */
|
|
196
218
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
197
219
|
/** Direct progress value (0–100). `undefined` = indeterminate. */
|
|
@@ -200,14 +222,21 @@ declare class CngxProgress {
|
|
|
200
222
|
readonly variant: _angular_core.InputSignal<ProgressVariant>;
|
|
201
223
|
/** Show percentage label next to the bar. */
|
|
202
224
|
readonly showLabel: _angular_core.InputSignal<boolean>;
|
|
203
|
-
/**
|
|
204
|
-
|
|
225
|
+
/**
|
|
226
|
+
* Screen reader label describing *what* is progressing. Unbound,
|
|
227
|
+
* `CNGX_FEEDBACK_I18N.progressLabel` applies.
|
|
228
|
+
*/
|
|
229
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
230
|
+
/** @internal */
|
|
231
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
205
232
|
/** @internal */
|
|
206
233
|
protected readonly effectiveProgress: _angular_core.Signal<number | undefined>;
|
|
207
234
|
/** @internal */
|
|
208
235
|
protected readonly isDeterminate: _angular_core.Signal<boolean>;
|
|
209
236
|
/** @internal - `null` removes the attribute from the DOM for indeterminate mode. */
|
|
210
237
|
protected readonly ariaValueNow: _angular_core.Signal<number | null>;
|
|
238
|
+
/** @internal - the rounded percent formatted in the app locale (`42%`, `42 %`). */
|
|
239
|
+
protected readonly formattedPercent: _angular_core.Signal<string | null>;
|
|
211
240
|
/** @internal */
|
|
212
241
|
protected readonly ariaValueText: _angular_core.Signal<string | null>;
|
|
213
242
|
/** @internal */
|
|
@@ -307,6 +336,7 @@ declare class CngxAlertAction {
|
|
|
307
336
|
*/
|
|
308
337
|
declare class CngxAlert {
|
|
309
338
|
private readonly config;
|
|
339
|
+
private readonly i18n;
|
|
310
340
|
private readonly destroyRef;
|
|
311
341
|
/** Alert severity - determines visual style, default icon, and ARIA role. */
|
|
312
342
|
readonly severity: _angular_core.InputSignal<AlertSeverity>;
|
|
@@ -350,6 +380,17 @@ declare class CngxAlert {
|
|
|
350
380
|
private readonly autoDismissTimer;
|
|
351
381
|
private readonly collapseTimer;
|
|
352
382
|
private animationFallbackId;
|
|
383
|
+
/**
|
|
384
|
+
* Reduced-motion via the shared kernel; environments without matchMedia
|
|
385
|
+
* (SSR, bare jsdom) count as reduced so the fallback settles immediately.
|
|
386
|
+
*/
|
|
387
|
+
private readonly motionWindow;
|
|
388
|
+
private readonly canQueryMotion;
|
|
389
|
+
private readonly prefersReducedMotion;
|
|
390
|
+
/** Active pause holds - pointer hover and focus-within count independently. */
|
|
391
|
+
private interactionHolds;
|
|
392
|
+
/** Set when interaction expanded an already-collapsed alert; release re-arms. */
|
|
393
|
+
private reCollapseOnRelease;
|
|
353
394
|
/** @internal - global icon component for the current severity (from provideFeedback config). */
|
|
354
395
|
protected readonly globalIcon: _angular_core.Signal<_angular_core.Type<unknown> | null>;
|
|
355
396
|
/** @internal - merged closable from new and deprecated input. */
|
|
@@ -369,6 +410,13 @@ declare class CngxAlert {
|
|
|
369
410
|
protected readonly isVisible: _angular_core.Signal<boolean>;
|
|
370
411
|
/** @internal - collapsed state (read-only public view). */
|
|
371
412
|
protected readonly collapsed: _angular_core.Signal<boolean>;
|
|
413
|
+
/**
|
|
414
|
+
* @internal - dismiss-button name inside the alert/status host. Visibility is
|
|
415
|
+
* the only tracked source; the copy is read untracked, so a language switch
|
|
416
|
+
* never rewrites a shown alert and its next appearance speaks the new
|
|
417
|
+
* language.
|
|
418
|
+
*/
|
|
419
|
+
protected readonly dismissLabel: _angular_core.Signal<string>;
|
|
372
420
|
/** @internal - SR announcement text for state transitions. */
|
|
373
421
|
protected readonly announcement: _angular_core.Signal<string>;
|
|
374
422
|
private readonly effectiveCollapseDelay;
|
|
@@ -391,6 +439,13 @@ declare class CngxAlert {
|
|
|
391
439
|
protected handleFocusIn(): void;
|
|
392
440
|
/** @internal - resume timers on focus out. */
|
|
393
441
|
protected handleFocusOut(): void;
|
|
442
|
+
/**
|
|
443
|
+
* Hold-counted pause: hover and focus-within are independent holds on the
|
|
444
|
+
* same timers - leaving with the mouse must not resume auto-dismiss while
|
|
445
|
+
* keyboard focus is still inside, and vice versa.
|
|
446
|
+
*/
|
|
447
|
+
private handleInteractionStart;
|
|
448
|
+
private handleInteractionEnd;
|
|
394
449
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAlert, never>;
|
|
395
450
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxAlert, "cngx-alert", never, { "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "when": { "alias": "when"; "required": false; "isSignal": true; }; "autoDismissDelay": { "alias": "autoDismissDelay"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "collapseDelay": { "alias": "collapseDelay"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, ["customIcon", "hasActions"], ["[cngxAlertIcon]", "*", "[cngxAlertAction]"], true, never>;
|
|
396
451
|
}
|
|
@@ -432,7 +487,18 @@ interface FeedbackConfig {
|
|
|
432
487
|
alertDedupWindow?: number;
|
|
433
488
|
/** Default max visible alerts per stack. */
|
|
434
489
|
alertMaxVisible?: number;
|
|
490
|
+
/**
|
|
491
|
+
* Maps a failure to the detail the state bridges and `CngxActionButton`
|
|
492
|
+
* append to their error message. Set through {@link withErrorDetail}.
|
|
493
|
+
*/
|
|
494
|
+
errorDetail?: CngxErrorDetailFn;
|
|
435
495
|
}
|
|
496
|
+
/**
|
|
497
|
+
* Maps a failure to user-facing detail text, or `undefined` for none.
|
|
498
|
+
*
|
|
499
|
+
* @category ui/feedback
|
|
500
|
+
*/
|
|
501
|
+
type CngxErrorDetailFn = (error: unknown) => string | undefined;
|
|
436
502
|
/**
|
|
437
503
|
* Injection token for the global feedback configuration.
|
|
438
504
|
* Components read this with `inject(CNGX_FEEDBACK_CONFIG, { optional: true })`.
|
|
@@ -446,6 +512,10 @@ declare const CNGX_FEEDBACK_CONFIG: InjectionToken<FeedbackConfig>;
|
|
|
446
512
|
/**
|
|
447
513
|
* A feature configuration function returned by `withXxx()` helpers.
|
|
448
514
|
*
|
|
515
|
+
* Merge rule (all features): an explicitly passed option wins; an omitted
|
|
516
|
+
* option preserves the value an earlier feature wrote. No feature clears
|
|
517
|
+
* fields it was not given.
|
|
518
|
+
*
|
|
449
519
|
* @category ui/feedback
|
|
450
520
|
*/
|
|
451
521
|
interface FeedbackFeature {
|
|
@@ -615,6 +685,297 @@ declare function withAlerts(opts?: {
|
|
|
615
685
|
* @category ui/feedback
|
|
616
686
|
*/
|
|
617
687
|
declare function withBanners(): FeedbackFeature;
|
|
688
|
+
/**
|
|
689
|
+
* Map a failure to the detail text `CngxAlertOn`, `CngxToastOn`,
|
|
690
|
+
* `CngxBannerOn` (with their `*ErrorDetail` input set) and
|
|
691
|
+
* `CngxActionButton` append to the error message, through the
|
|
692
|
+
* `errorWithDetail` message of `CNGX_FEEDBACK_I18N`. Return `undefined` to
|
|
693
|
+
* show the message alone.
|
|
694
|
+
*
|
|
695
|
+
* Without this feature, development builds show the raw `Error.message` (or
|
|
696
|
+
* a thrown string) and warn once that production builds show no detail, so
|
|
697
|
+
* no untranslated server text reaches a user.
|
|
698
|
+
*
|
|
699
|
+
* ```ts
|
|
700
|
+
* provideFeedback(
|
|
701
|
+
* withToasts(),
|
|
702
|
+
* withErrorDetail((error) =>
|
|
703
|
+
* error instanceof HttpErrorResponse ? translate(`http.${error.status}`) : undefined,
|
|
704
|
+
* ),
|
|
705
|
+
* )
|
|
706
|
+
* ```
|
|
707
|
+
*
|
|
708
|
+
* @category ui/feedback
|
|
709
|
+
* @since 0.1.0
|
|
710
|
+
*/
|
|
711
|
+
declare function withErrorDetail(map: CngxErrorDetailFn): FeedbackFeature;
|
|
712
|
+
/**
|
|
713
|
+
* Inject the error-detail mapping set by {@link withErrorDetail}, or the
|
|
714
|
+
* default: the raw text in development, with one warning per app the first
|
|
715
|
+
* time it shows, and nothing in production. Call it in an injection context,
|
|
716
|
+
* then call the returned function with the error.
|
|
717
|
+
*
|
|
718
|
+
* @category ui/feedback
|
|
719
|
+
* @since 0.1.0
|
|
720
|
+
*/
|
|
721
|
+
declare function injectErrorDetail(): CngxErrorDetailFn;
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Live-region copy the feedback family announces on its own behalf. Separate
|
|
725
|
+
* from the region names: these describe a transition rather than naming a
|
|
726
|
+
* landmark, so they change on a different cadence and a consumer usually
|
|
727
|
+
* translates them as one block.
|
|
728
|
+
*
|
|
729
|
+
* @category ui/feedback/i18n
|
|
730
|
+
*/
|
|
731
|
+
interface CngxFeedbackAnnouncements {
|
|
732
|
+
/** Announced when a user dismisses an alert. */
|
|
733
|
+
readonly alertDismissed: string;
|
|
734
|
+
/**
|
|
735
|
+
* Accessible name of the alert-stack overflow trigger. Receives the hidden
|
|
736
|
+
* count. Must contain the visible label from
|
|
737
|
+
* {@link CngxFeedbackAnnouncements.alertOverflowVisible} for the same count
|
|
738
|
+
* (WCAG 2.5.3 Label in Name, compared case-insensitively): a speech-input
|
|
739
|
+
* user says what they see. A dev-mode warning fires when a translated pair
|
|
740
|
+
* breaks containment.
|
|
741
|
+
*/
|
|
742
|
+
readonly alertOverflow: (count: number) => string;
|
|
743
|
+
/**
|
|
744
|
+
* Visible text of the alert-stack overflow trigger. Receives the hidden
|
|
745
|
+
* count; its output must be contained in
|
|
746
|
+
* {@link CngxFeedbackAnnouncements.alertOverflow} for the same count.
|
|
747
|
+
*/
|
|
748
|
+
readonly alertOverflowVisible: (count: number) => string;
|
|
749
|
+
/** `idle -> loading` on `CngxAsyncContainer`. */
|
|
750
|
+
readonly asyncLoading: string;
|
|
751
|
+
/** `loading -> success`. */
|
|
752
|
+
readonly asyncLoaded: string;
|
|
753
|
+
/** `loading -> error`. */
|
|
754
|
+
readonly asyncError: string;
|
|
755
|
+
/** Entering `refreshing`. */
|
|
756
|
+
readonly asyncRefreshing: string;
|
|
757
|
+
/** `refreshing -> success`. */
|
|
758
|
+
readonly asyncRefreshed: string;
|
|
759
|
+
/** `refreshing -> error`. */
|
|
760
|
+
readonly asyncRefreshFailed: string;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Feedback i18n surface. The defaults come from the `feedback` section of the
|
|
764
|
+
* language pack (English without one); {@link withFeedbackI18nLabels} inside
|
|
765
|
+
* `provideFeedback()` or {@link provideFeedbackI18n} override single keys on top.
|
|
766
|
+
* Sibling to `CNGX_STEPPER_I18N`, `CNGX_TABS_I18N` and `CNGX_CHART_I18N`.
|
|
767
|
+
*
|
|
768
|
+
* Two region names and one announcement sub-bundle. The banner outlet carries
|
|
769
|
+
* no region `aria-label`, so it gets no key - a key with no Wirkungsort is
|
|
770
|
+
* configuration for its own sake.
|
|
771
|
+
*
|
|
772
|
+
* @category ui/feedback/i18n
|
|
773
|
+
*/
|
|
774
|
+
interface CngxFeedbackI18n {
|
|
775
|
+
/** Accessible name of the `role="region"` host on `CngxAlertStack`. */
|
|
776
|
+
readonly alertsRegionLabel: string;
|
|
777
|
+
/** Accessible name of the `role="region"` host on `CngxToastOutlet`. */
|
|
778
|
+
readonly notificationsRegionLabel: string;
|
|
779
|
+
/** Live-region copy - see {@link CngxFeedbackAnnouncements}. */
|
|
780
|
+
readonly announcements: CngxFeedbackAnnouncements;
|
|
781
|
+
/** Accessible name of the dismiss button on alerts, stacked alerts, toasts and banners. */
|
|
782
|
+
readonly dismissLabel: string;
|
|
783
|
+
/** Shown in the banner's `role="alert"` slot when its action rejects. */
|
|
784
|
+
readonly bannerActionFailed: string;
|
|
785
|
+
/** Visible repeat marker on a toast raised more than once. Receives the repeat count. */
|
|
786
|
+
readonly toastRepeatCount: (count: number) => string;
|
|
787
|
+
/**
|
|
788
|
+
* Default accessible name of `CngxLoadingIndicator` and `CngxLoadingOverlay`
|
|
789
|
+
* while their `label` input is unbound.
|
|
790
|
+
*/
|
|
791
|
+
readonly loadingLabel: string;
|
|
792
|
+
/** Default accessible name of `CngxProgress` while its `label` input is unbound. */
|
|
793
|
+
readonly progressLabel: string;
|
|
794
|
+
/**
|
|
795
|
+
* `aria-valuetext` of a determinate `CngxProgress`. Receives the rounded
|
|
796
|
+
* percent (0-100) and that value already formatted as a percent in the app
|
|
797
|
+
* locale; the default returns the formatted string.
|
|
798
|
+
*/
|
|
799
|
+
readonly progressValueText: (percent: number, formatted: string) => string;
|
|
800
|
+
/**
|
|
801
|
+
* The message a state bridge (`CngxAlertOn`, `CngxToastOn`, `CngxBannerOn`)
|
|
802
|
+
* and `CngxActionButton` show for a failure with a detail: the bound error
|
|
803
|
+
* message followed by the detail `withErrorDetail` mapped from the error.
|
|
804
|
+
* One message, so a locale owns the joiner and the order.
|
|
805
|
+
*/
|
|
806
|
+
readonly errorWithDetail: (message: string, detail: string) => string;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Override shape: every top-level key optional, and `announcements` overridable
|
|
810
|
+
* key by key rather than all-or-nothing.
|
|
811
|
+
*
|
|
812
|
+
* @category ui/feedback/i18n
|
|
813
|
+
*/
|
|
814
|
+
type CngxFeedbackI18nOverrides = Partial<Omit<CngxFeedbackI18n, 'announcements'>> & {
|
|
815
|
+
readonly announcements?: Partial<CngxFeedbackAnnouncements>;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* DI token for the feedback i18n bundle, a `Signal` so region names, labels
|
|
819
|
+
* and announcements follow a runtime language switch. `providedIn: 'root'`:
|
|
820
|
+
* the feedback section of the active language pack over the English
|
|
821
|
+
* defaults, formatted for the app locale, so a consumer who provides nothing
|
|
822
|
+
* still gets named regions.
|
|
823
|
+
*
|
|
824
|
+
* @category ui/feedback/i18n
|
|
825
|
+
* @wcag AA
|
|
826
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/config/feedback-i18n.ts
|
|
827
|
+
* @since 0.1.0
|
|
828
|
+
* @relatedTo CngxAlertStack, CngxToastOutlet
|
|
829
|
+
*/
|
|
830
|
+
declare const CNGX_FEEDBACK_I18N: InjectionToken<Signal<CngxFeedbackI18n>>;
|
|
831
|
+
/**
|
|
832
|
+
* Override the feedback region names from inside `provideFeedback()`. Unset
|
|
833
|
+
* keys keep the language pack's copy, or the English default, and
|
|
834
|
+
* `announcements` merges key by key. Pass
|
|
835
|
+
* a `Signal` to switch the language at runtime.
|
|
836
|
+
*
|
|
837
|
+
* ```ts
|
|
838
|
+
* provideFeedback(
|
|
839
|
+
* withToasts(),
|
|
840
|
+
* withAlerts(),
|
|
841
|
+
* withFeedbackI18nLabels({ alertsRegionLabel: 'Hinweise' }),
|
|
842
|
+
* )
|
|
843
|
+
* ```
|
|
844
|
+
*
|
|
845
|
+
* Contributes the token through the feature's `_providers`, so - like
|
|
846
|
+
* {@link withCloseIcon} - a second call in the same `provideFeedback()` wins
|
|
847
|
+
* over the first rather than merging with it. Pass every key in one call.
|
|
848
|
+
*
|
|
849
|
+
* @category ui/feedback/i18n
|
|
850
|
+
*/
|
|
851
|
+
declare function withFeedbackI18nLabels(overrides: CngxFeedbackI18nOverrides | Signal<CngxFeedbackI18nOverrides>): FeedbackFeature;
|
|
852
|
+
/**
|
|
853
|
+
* Provider for the feedback i18n bundle on its own, without the rest of
|
|
854
|
+
* `provideFeedback()`. This is the entry point a consumer-composed language
|
|
855
|
+
* file uses - `provideFeedback()` replaces the whole `CNGX_FEEDBACK_CONFIG`
|
|
856
|
+
* value, so routing a translation through it would reset unrelated feedback
|
|
857
|
+
* defaults the app set elsewhere. Unset keys keep the language pack's copy,
|
|
858
|
+
* or the English default, `announcements` merges key by key, and a `Signal`
|
|
859
|
+
* switches the language at runtime. For a whole language prefer the
|
|
860
|
+
* `feedback` section of a language pack (`provideCngxI18n` from
|
|
861
|
+
* `@cngx/core/i18n`); this provider overrides single keys on top of it.
|
|
862
|
+
*
|
|
863
|
+
* @example
|
|
864
|
+
* ```ts
|
|
865
|
+
* // src/i18n/de.ts - the app's language file: every per-lib provider it uses,
|
|
866
|
+
* // composed in one const. See the "Localisation" core-concepts page for the
|
|
867
|
+
* // full recipe and the per-area entry points.
|
|
868
|
+
* export const DE: Provider[] = [
|
|
869
|
+
* provideFeedbackI18n({
|
|
870
|
+
* alertsRegionLabel: 'Hinweise',
|
|
871
|
+
* notificationsRegionLabel: 'Meldungen',
|
|
872
|
+
* announcements: { alertDismissed: 'Hinweis verworfen' },
|
|
873
|
+
* }),
|
|
874
|
+
* provideTabsI18n(withTabsI18nLabels({ tabsLabel: 'Reiter' })),
|
|
875
|
+
* provideCardI18n(withCardI18nLabels({ selected: 'Ausgewählt' })),
|
|
876
|
+
* ];
|
|
877
|
+
*
|
|
878
|
+
* bootstrapApplication(App, { providers: [...DE] });
|
|
879
|
+
* ```
|
|
880
|
+
*
|
|
881
|
+
* @category ui/feedback/i18n
|
|
882
|
+
* @since 0.1.0
|
|
883
|
+
*/
|
|
884
|
+
declare function provideFeedbackI18n(overrides: CngxFeedbackI18nOverrides | Signal<CngxFeedbackI18nOverrides>): Provider;
|
|
885
|
+
/**
|
|
886
|
+
* Inject the resolved feedback i18n bundle in an injection context: every key
|
|
887
|
+
* left at its default follows the locale of the reading site (a
|
|
888
|
+
* `provideLocaleAt` subtree), every key an override set stays. Read it inside
|
|
889
|
+
* a `computed()`, template or handler so a language switch reaches the label.
|
|
890
|
+
* One Signal per injector, bundle and locale, so row-level readers (alerts,
|
|
891
|
+
* toasts, banners) share it.
|
|
892
|
+
*
|
|
893
|
+
* @category ui/feedback/i18n
|
|
894
|
+
*/
|
|
895
|
+
declare function injectFeedbackI18n(): Signal<CngxFeedbackI18n>;
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* The live-region words of the feedback section: transitions the feedback
|
|
899
|
+
* family announces on its own behalf.
|
|
900
|
+
*
|
|
901
|
+
* @category ui/feedback/i18n
|
|
902
|
+
* @since 0.1.0
|
|
903
|
+
*/
|
|
904
|
+
interface CngxFeedbackAnnouncementsLanguage {
|
|
905
|
+
/** Announced when a user dismisses an alert. */
|
|
906
|
+
readonly alertDismissed: string;
|
|
907
|
+
/**
|
|
908
|
+
* Plural on `{count}`: accessible name of the alert-stack overflow trigger.
|
|
909
|
+
* Must contain {@link CngxFeedbackAnnouncementsLanguage.alertOverflowVisible}
|
|
910
|
+
* for the same count (WCAG 2.5.3 Label in Name).
|
|
911
|
+
*/
|
|
912
|
+
readonly alertOverflow: CngxMessage;
|
|
913
|
+
/** `{count}`: visible text of the alert-stack overflow trigger. */
|
|
914
|
+
readonly alertOverflowVisible: CngxMessage;
|
|
915
|
+
/** `idle -> loading` on `CngxAsyncContainer`. */
|
|
916
|
+
readonly asyncLoading: string;
|
|
917
|
+
/** `loading -> success`. */
|
|
918
|
+
readonly asyncLoaded: string;
|
|
919
|
+
/** `loading -> error`. */
|
|
920
|
+
readonly asyncError: string;
|
|
921
|
+
/** Entering `refreshing`. */
|
|
922
|
+
readonly asyncRefreshing: string;
|
|
923
|
+
/** `refreshing -> success`. */
|
|
924
|
+
readonly asyncRefreshed: string;
|
|
925
|
+
/** `refreshing -> error`. */
|
|
926
|
+
readonly asyncRefreshFailed: string;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* The feedback section of a {@link CngxLanguagePack}: the copy of
|
|
930
|
+
* `@cngx/ui/feedback` (alerts, toasts, banners, loading surfaces, the async
|
|
931
|
+
* container and the state bridges). It feeds `CNGX_FEEDBACK_I18N`. Messages
|
|
932
|
+
* use `{name}` placeholders; a plural message picks its form from `{count}`.
|
|
933
|
+
*
|
|
934
|
+
* @category ui/feedback/i18n
|
|
935
|
+
* @since 0.1.0
|
|
936
|
+
* @relatedTo CNGX_FEEDBACK_I18N
|
|
937
|
+
*/
|
|
938
|
+
interface CngxFeedbackLanguageSection {
|
|
939
|
+
/** Accessible name of the alert-stack region. */
|
|
940
|
+
readonly alertsRegionLabel: string;
|
|
941
|
+
/** Accessible name of the toast-outlet region. */
|
|
942
|
+
readonly notificationsRegionLabel: string;
|
|
943
|
+
/** Accessible name of every dismiss button. */
|
|
944
|
+
readonly dismissLabel: string;
|
|
945
|
+
/** Shown in the banner's alert slot when its action rejects. */
|
|
946
|
+
readonly bannerActionFailed: string;
|
|
947
|
+
/** `{count}`: visible repeat marker on a toast raised more than once. */
|
|
948
|
+
readonly toastRepeatCount: CngxMessage;
|
|
949
|
+
/** Default accessible name of the loading indicator and overlay. */
|
|
950
|
+
readonly loadingLabel: string;
|
|
951
|
+
/** Default accessible name of `CngxProgress`. */
|
|
952
|
+
readonly progressLabel: string;
|
|
953
|
+
/**
|
|
954
|
+
* `{value}` (the percent formatted in the locale, `42%`), `{percent}` (the
|
|
955
|
+
* rounded number): `aria-valuetext` of a determinate `CngxProgress`.
|
|
956
|
+
*/
|
|
957
|
+
readonly progressValueText: CngxMessage;
|
|
958
|
+
/**
|
|
959
|
+
* `{message}`, `{detail}`: an error message of a state bridge followed by
|
|
960
|
+
* the mapped error detail.
|
|
961
|
+
*/
|
|
962
|
+
readonly errorWithDetail: CngxMessage;
|
|
963
|
+
readonly announcements: CngxFeedbackAnnouncementsLanguage;
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* The English feedback section: the single source of the feedback family's
|
|
967
|
+
* English copy. `CNGX_FEEDBACK_I18N` defaults to it.
|
|
968
|
+
*
|
|
969
|
+
* @category ui/feedback/i18n
|
|
970
|
+
* @since 0.1.0
|
|
971
|
+
* @relatedTo CNGX_FEEDBACK_I18N
|
|
972
|
+
*/
|
|
973
|
+
declare const CNGX_FEEDBACK_LANGUAGE_EN: CngxFeedbackLanguageSection;
|
|
974
|
+
declare module '@cngx/core/i18n' {
|
|
975
|
+
interface CngxLanguagePack {
|
|
976
|
+
readonly feedback: CngxFeedbackLanguageSection;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
618
979
|
|
|
619
980
|
/**
|
|
620
981
|
* Configuration for a programmatic alert.
|
|
@@ -628,9 +989,19 @@ interface AlertConfig {
|
|
|
628
989
|
severity?: AlertSeverity;
|
|
629
990
|
/** Optional bold title above the message. */
|
|
630
991
|
title?: string;
|
|
631
|
-
/**
|
|
992
|
+
/**
|
|
993
|
+
* Whether the alert persists until explicitly dismissed.
|
|
994
|
+
* Defaults to `true` unless a `duration` is passed or
|
|
995
|
+
* `withAlerts({ defaultDuration })` is configured. `error` alerts always
|
|
996
|
+
* default to persistent (matching the toaster) - opt out with an explicit
|
|
997
|
+
* `duration` or `persistent: false`.
|
|
998
|
+
*/
|
|
632
999
|
persistent?: boolean;
|
|
633
|
-
/**
|
|
1000
|
+
/**
|
|
1001
|
+
* Auto-dismiss duration in ms. Setting it implies `persistent: false`.
|
|
1002
|
+
* Non-persistent alerts without a duration fall back to
|
|
1003
|
+
* `withAlerts({ defaultDuration })`, then 5000ms.
|
|
1004
|
+
*/
|
|
634
1005
|
duration?: number;
|
|
635
1006
|
/** Show a dismiss button. Default `true`. */
|
|
636
1007
|
dismissible?: boolean;
|
|
@@ -649,7 +1020,8 @@ interface AlertRef {
|
|
|
649
1020
|
afterDismissed(): Observable<void>;
|
|
650
1021
|
}
|
|
651
1022
|
/**
|
|
652
|
-
*
|
|
1023
|
+
* Tracked state for a single alert - the element type of the public
|
|
1024
|
+
* `CngxAlerter.alerts` signal. Immutable per slot; treat as read-only.
|
|
653
1025
|
*
|
|
654
1026
|
* @category ui/feedback/alert
|
|
655
1027
|
*/
|
|
@@ -657,6 +1029,10 @@ interface AlertState {
|
|
|
657
1029
|
readonly id: number;
|
|
658
1030
|
readonly config: Required<Pick<AlertConfig, 'message' | 'severity' | 'dismissible' | 'persistent'>> & Pick<AlertConfig, 'title' | 'duration' | 'scope'>;
|
|
659
1031
|
readonly createdAt: number;
|
|
1032
|
+
/**
|
|
1033
|
+
* @internal - library-owned dismissal lifecycle. Never call `next()` or
|
|
1034
|
+
* `complete()` from consumer code; observe via `AlertRef.afterDismissed()`.
|
|
1035
|
+
*/
|
|
660
1036
|
readonly dismissed$: Subject<void>;
|
|
661
1037
|
}
|
|
662
1038
|
/**
|
|
@@ -686,26 +1062,54 @@ declare class CngxAlerter {
|
|
|
686
1062
|
readonly alerts: _angular_core.WritableSignal<readonly AlertState[]>;
|
|
687
1063
|
private readonly dedupWindow;
|
|
688
1064
|
private readonly defaultDuration;
|
|
1065
|
+
/** Auto-dismiss timers keyed by alert id - not part of the public state shape. */
|
|
1066
|
+
private readonly timers;
|
|
689
1067
|
constructor();
|
|
690
1068
|
/** Show an alert. Returns a ref for programmatic dismiss. */
|
|
691
1069
|
show(config: AlertConfig): AlertRef;
|
|
1070
|
+
/**
|
|
1071
|
+
* @internal - called by `CngxAlertStack` on hover/focus (WCAG 2.2.1).
|
|
1072
|
+
* Hold-counted: hover and focus-within pause independently; the timer
|
|
1073
|
+
* resumes only when the last hold releases.
|
|
1074
|
+
*/
|
|
1075
|
+
pauseTimer(id: number): void;
|
|
1076
|
+
/** @internal - called by `CngxAlertStack` on pointer-leave/focus-out. */
|
|
1077
|
+
resumeTimer(id: number): void;
|
|
692
1078
|
/** Dismiss a single alert by id. */
|
|
693
1079
|
dismiss(id: number): void;
|
|
694
1080
|
/** Dismiss all alerts (optionally filtered by scope). */
|
|
695
1081
|
dismissAll(scope?: string): void;
|
|
1082
|
+
private startTimer;
|
|
1083
|
+
private clearTimer;
|
|
696
1084
|
private createRef;
|
|
697
1085
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAlerter, never>;
|
|
698
1086
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxAlerter>;
|
|
699
1087
|
}
|
|
700
1088
|
|
|
1089
|
+
/** @internal - one rendered alert plus the service instance that owns it. */
|
|
1090
|
+
interface StackEntry {
|
|
1091
|
+
/** Render-stable key - service-local ids collide across instances. */
|
|
1092
|
+
readonly key: string;
|
|
1093
|
+
readonly state: AlertState;
|
|
1094
|
+
readonly owner: CngxAlerter;
|
|
1095
|
+
}
|
|
701
1096
|
/**
|
|
702
|
-
* Scoped alert stack - renders alerts from its own `CngxAlerter` instance
|
|
1097
|
+
* Scoped alert stack - renders alerts from its own `CngxAlerter` instance
|
|
1098
|
+
* merged with the nearest ancestor/environment instance.
|
|
1099
|
+
*
|
|
1100
|
+
* Provides `CngxAlerter` via `viewProviders` - the stack's own instance is
|
|
1101
|
+
* private to its view. Alerts shown through an ancestor-provided alerter or
|
|
1102
|
+
* the environment alerter from `provideFeedback(withAlerts())` (the instance
|
|
1103
|
+
* `CngxAlertOn` and sibling components resolve) render here too, filtered by
|
|
1104
|
+
* `[scope]`. Nesting is supported - each stack stays independent.
|
|
703
1105
|
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
1106
|
+
* Scope your stacks when more than one is mounted: two unscoped stacks
|
|
1107
|
+
* under the same environment alerter both render (and announce) every
|
|
1108
|
+
* shared alert.
|
|
707
1109
|
*
|
|
708
1110
|
* ### In a dialog
|
|
1111
|
+
* The dialog component and the stack resolve the same environment alerter,
|
|
1112
|
+
* so programmatic alerts land in the stack below:
|
|
709
1113
|
* ```html
|
|
710
1114
|
* <dialog cngxDialog [submitAction]="save">
|
|
711
1115
|
* <header cngxDialogTitle>Edit user</header>
|
|
@@ -715,12 +1119,16 @@ declare class CngxAlerter {
|
|
|
715
1119
|
* ```
|
|
716
1120
|
*
|
|
717
1121
|
* ### Programmatic usage
|
|
1122
|
+
* Requires `provideFeedback(withAlerts())` (or an ancestor component that
|
|
1123
|
+
* provides `CngxAlerter`):
|
|
718
1124
|
* ```typescript
|
|
719
1125
|
* private readonly alerter = inject(CngxAlerter);
|
|
720
1126
|
*
|
|
721
1127
|
* handleErrors(errors: string[]) {
|
|
722
|
-
* this.alerter.dismissAll();
|
|
723
|
-
* errors.forEach(e =>
|
|
1128
|
+
* this.alerter.dismissAll('user-form');
|
|
1129
|
+
* errors.forEach(e =>
|
|
1130
|
+
* this.alerter.show({ message: e, severity: 'error', scope: 'user-form' }),
|
|
1131
|
+
* );
|
|
724
1132
|
* }
|
|
725
1133
|
* ```
|
|
726
1134
|
*
|
|
@@ -738,30 +1146,64 @@ declare class CngxAlerter {
|
|
|
738
1146
|
declare class CngxAlertStack {
|
|
739
1147
|
/** The scoped alerter instance - use to add/dismiss alerts programmatically. */
|
|
740
1148
|
readonly alerter: CngxAlerter;
|
|
1149
|
+
/**
|
|
1150
|
+
* Nearest ancestor/environment alerter - the instance `CngxAlertOn` and
|
|
1151
|
+
* sibling components resolve. Merged into the rendered stack so the
|
|
1152
|
+
* documented `withAlerts()` routing actually lands somewhere.
|
|
1153
|
+
*/
|
|
1154
|
+
private readonly parentAlerter;
|
|
741
1155
|
private readonly config;
|
|
1156
|
+
private readonly i18n;
|
|
1157
|
+
/** @internal - region name of the plain `role="region"` host; follows a switch at once. */
|
|
1158
|
+
protected readonly regionLabel: _angular_core.Signal<string>;
|
|
1159
|
+
private readonly host;
|
|
1160
|
+
private readonly injector;
|
|
742
1161
|
/** Scope filter - only shows alerts matching this scope. */
|
|
743
1162
|
readonly scope: _angular_core.InputSignal<string | undefined>;
|
|
744
|
-
/** Maximum visible alerts before collapse overflow. */
|
|
745
|
-
readonly maxVisible: _angular_core.InputSignal<number>;
|
|
1163
|
+
/** Maximum visible alerts before collapse overflow. Defaults to `withAlerts({ maxVisible })`, then 5. */
|
|
1164
|
+
readonly maxVisible: _angular_core.InputSignal<number | undefined>;
|
|
746
1165
|
/** Where new alerts appear. */
|
|
747
1166
|
readonly position: _angular_core.InputSignal<"top" | "bottom">;
|
|
748
1167
|
/** Reserve min-height for one alert to prevent layout shift. */
|
|
749
1168
|
readonly reserveSpace: _angular_core.InputSignal<boolean>;
|
|
750
1169
|
/** Auto-scroll stack into view when new alert appears. */
|
|
751
1170
|
readonly autoScroll: _angular_core.InputSignal<boolean>;
|
|
1171
|
+
/** @internal - maxVisible input, then withAlerts({ maxVisible }), then 5. */
|
|
1172
|
+
private readonly effectiveMaxVisible;
|
|
752
1173
|
/** @internal - expanded state. Resets when alert count drops to maxVisible or below. */
|
|
753
1174
|
private readonly expanded;
|
|
754
|
-
/** @internal - alerts filtered
|
|
755
|
-
private readonly
|
|
756
|
-
/** @internal -
|
|
757
|
-
protected readonly
|
|
1175
|
+
/** @internal - own + ancestor alerts, scope-filtered, newest first. */
|
|
1176
|
+
private readonly entries;
|
|
1177
|
+
/** @internal - entries within maxVisible, ordered per [position]. */
|
|
1178
|
+
protected readonly visibleEntries: _angular_core.Signal<readonly StackEntry[]>;
|
|
1179
|
+
/**
|
|
1180
|
+
* @internal - dismiss-button name inside the alert/status items. The visible
|
|
1181
|
+
* entries are the only tracked source; the copy is read untracked, so a
|
|
1182
|
+
* language switch never rewrites a shown item and the next stack change
|
|
1183
|
+
* picks it up.
|
|
1184
|
+
*/
|
|
1185
|
+
protected readonly dismissLabel: _angular_core.Signal<string>;
|
|
758
1186
|
/** @internal - number of hidden overflow alerts. */
|
|
759
1187
|
protected readonly overflowCount: _angular_core.Signal<number>;
|
|
760
|
-
/** @internal -
|
|
761
|
-
protected readonly
|
|
1188
|
+
/** @internal - accessible name of the overflow trigger. */
|
|
1189
|
+
protected readonly overflowLabel: _angular_core.Signal<string>;
|
|
1190
|
+
/** @internal - visible text of the overflow trigger, contained in its accessible name. */
|
|
1191
|
+
protected readonly overflowVisibleLabel: _angular_core.Signal<string>;
|
|
1192
|
+
/**
|
|
1193
|
+
* @internal - arrival detection derived via linkedSignal (not managed in
|
|
1194
|
+
* the effect). `arrived` is true only when a key shows up that was not
|
|
1195
|
+
* rendered before - a dismissal exposing an older neighbour is not an
|
|
1196
|
+
* arrival. The initial computation (mount with pre-existing alerts) never
|
|
1197
|
+
* counts as one.
|
|
1198
|
+
*/
|
|
1199
|
+
private readonly arrivalTransition;
|
|
1200
|
+
constructor();
|
|
762
1201
|
/** @internal - resolve icon component from global config. */
|
|
763
1202
|
protected iconFor(alert: AlertState): _angular_core.Type<unknown> | null;
|
|
764
|
-
/**
|
|
1203
|
+
/**
|
|
1204
|
+
* @internal - the overflow button removes itself on expansion, so focus is
|
|
1205
|
+
* handed to the first newly revealed alert item instead of falling to body.
|
|
1206
|
+
*/
|
|
765
1207
|
protected handleExpandOverflow(): void;
|
|
766
1208
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAlertStack, never>;
|
|
767
1209
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxAlertStack, "cngx-alert-stack", never, { "scope": { "alias": "scope"; "required": false; "isSignal": true; }; "maxVisible": { "alias": "maxVisible"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "reserveSpace": { "alias": "reserveSpace"; "required": false; "isSignal": true; }; "autoScroll": { "alias": "autoScroll"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -770,9 +1212,14 @@ declare class CngxAlertStack {
|
|
|
770
1212
|
/**
|
|
771
1213
|
* Declarative state-to-alert bridge for scoped alert stacks.
|
|
772
1214
|
*
|
|
773
|
-
*
|
|
774
|
-
*
|
|
775
|
-
*
|
|
1215
|
+
* Fires an alert when the bound `CngxAsyncState` transitions to `error`
|
|
1216
|
+
* (or optionally `success`). Only fires on actual transitions, not on
|
|
1217
|
+
* initial `idle` state.
|
|
1218
|
+
*
|
|
1219
|
+
* Alerts route through the injected `CngxAlerter` - the environment
|
|
1220
|
+
* instance from `provideFeedback(withAlerts())` or one provided by an
|
|
1221
|
+
* ancestor component. Every `CngxAlertStack` that resolves the same
|
|
1222
|
+
* instance renders them, filtered by scope:
|
|
776
1223
|
*
|
|
777
1224
|
* ```html
|
|
778
1225
|
* <cngx-alert-stack scope="form" />
|
|
@@ -780,6 +1227,7 @@ declare class CngxAlertStack {
|
|
|
780
1227
|
* <button [cngxAsyncClick]="save"
|
|
781
1228
|
* [cngxAlertOn]="saveState"
|
|
782
1229
|
* alertError="Save failed"
|
|
1230
|
+
* alertScope="form"
|
|
783
1231
|
* [alertErrorDetail]="true">
|
|
784
1232
|
* Save
|
|
785
1233
|
* </button>
|
|
@@ -795,6 +1243,8 @@ declare class CngxAlertStack {
|
|
|
795
1243
|
declare class CngxAlertOn {
|
|
796
1244
|
private readonly alerter;
|
|
797
1245
|
private readonly statefulFallback;
|
|
1246
|
+
private readonly errorDetail;
|
|
1247
|
+
private readonly i18n;
|
|
798
1248
|
/**
|
|
799
1249
|
* The async state to watch. Optional - when omitted, falls back to
|
|
800
1250
|
* `CNGX_STATEFUL` from an ancestor/self component. A bare `cngxAlertOn`
|
|
@@ -807,7 +1257,11 @@ declare class CngxAlertOn {
|
|
|
807
1257
|
readonly alertSuccess: _angular_core.InputSignal<string | undefined>;
|
|
808
1258
|
/** Alert message on error. If not set, no error alert fires. */
|
|
809
1259
|
readonly alertError: _angular_core.InputSignal<string | undefined>;
|
|
810
|
-
/**
|
|
1260
|
+
/**
|
|
1261
|
+
* Append the error detail to the alert message, as mapped by
|
|
1262
|
+
* `withErrorDetail` (default: the raw error text in development builds,
|
|
1263
|
+
* nothing in production).
|
|
1264
|
+
*/
|
|
811
1265
|
readonly alertErrorDetail: _angular_core.InputSignal<boolean>;
|
|
812
1266
|
/** Scope for the alert - matches against `CngxAlertStack`'s `[scope]` input. */
|
|
813
1267
|
readonly alertScope: _angular_core.InputSignal<string | undefined>;
|
|
@@ -948,6 +1402,18 @@ declare class CngxBanner {
|
|
|
948
1402
|
declare class CngxBannerOutlet {
|
|
949
1403
|
protected readonly service: CngxBanner;
|
|
950
1404
|
private readonly config;
|
|
1405
|
+
private readonly i18n;
|
|
1406
|
+
/**
|
|
1407
|
+
* @internal - action-error copy for the `role="alert"` slot. The banner list is the
|
|
1408
|
+
* only tracked source; the copy is read untracked, so a copy flip never rewrites a
|
|
1409
|
+
* shown alert and the next banner transition picks the new language up.
|
|
1410
|
+
*/
|
|
1411
|
+
protected readonly actionFailedCopy: _angular_core.Signal<string>;
|
|
1412
|
+
/**
|
|
1413
|
+
* @internal - dismiss-button name inside the banner live regions, keyed on the
|
|
1414
|
+
* banner list like {@link actionFailedCopy}.
|
|
1415
|
+
*/
|
|
1416
|
+
protected readonly dismissLabel: _angular_core.Signal<string>;
|
|
951
1417
|
/**
|
|
952
1418
|
* @internal - skip enter animation for banners present at first render.
|
|
953
1419
|
* Prevents layout jump when banners are known before first paint (e.g., offline state).
|
|
@@ -986,6 +1452,8 @@ declare class CngxBannerOutlet {
|
|
|
986
1452
|
declare class CngxBannerOn {
|
|
987
1453
|
private readonly bannerService;
|
|
988
1454
|
private readonly statefulFallback;
|
|
1455
|
+
private readonly errorDetail;
|
|
1456
|
+
private readonly i18n;
|
|
989
1457
|
/**
|
|
990
1458
|
* The async state to watch. Optional - when omitted, falls back to
|
|
991
1459
|
* `CNGX_STATEFUL` from an ancestor/self component. A bare `cngxBannerOn`
|
|
@@ -1000,7 +1468,11 @@ declare class CngxBannerOn {
|
|
|
1000
1468
|
readonly bannerError: _angular_core.InputSignal<string | undefined>;
|
|
1001
1469
|
/** Banner severity on error. Default `'error'`. */
|
|
1002
1470
|
readonly bannerSeverity: _angular_core.InputSignal<"warning" | "error">;
|
|
1003
|
-
/**
|
|
1471
|
+
/**
|
|
1472
|
+
* Append the error detail to the banner message, as mapped by
|
|
1473
|
+
* `withErrorDetail` (default: the raw error text in development builds,
|
|
1474
|
+
* nothing in production).
|
|
1475
|
+
*/
|
|
1004
1476
|
readonly bannerErrorDetail: _angular_core.InputSignal<boolean>;
|
|
1005
1477
|
constructor();
|
|
1006
1478
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxBannerOn, never>;
|
|
@@ -1047,7 +1519,12 @@ declare class CngxBannerTrigger {
|
|
|
1047
1519
|
readonly when: _angular_core.InputSignal<boolean>;
|
|
1048
1520
|
/** Banner message text. */
|
|
1049
1521
|
readonly message: _angular_core.InputSignal<string>;
|
|
1050
|
-
/**
|
|
1522
|
+
/**
|
|
1523
|
+
* Required unique id - dedup key, shared by design. Any code (or another
|
|
1524
|
+
* trigger) using the same id updates and dismisses the same banner; there
|
|
1525
|
+
* is no per-instance guard. Namespace ids (`net:offline`, `auth:session`)
|
|
1526
|
+
* to avoid unintended collisions.
|
|
1527
|
+
*/
|
|
1051
1528
|
readonly id: _angular_core.InputSignal<string>;
|
|
1052
1529
|
/** Visual severity. */
|
|
1053
1530
|
readonly severity: _angular_core.InputSignal<AlertSeverity>;
|
|
@@ -1057,6 +1534,8 @@ declare class CngxBannerTrigger {
|
|
|
1057
1534
|
readonly actionLabel: _angular_core.InputSignal<string | undefined>;
|
|
1058
1535
|
/** Action button handler. */
|
|
1059
1536
|
readonly actionHandler: _angular_core.InputSignal<(() => void | Promise<void>) | undefined>;
|
|
1537
|
+
/** @internal - id transition derived via linkedSignal, not managed in the effect. */
|
|
1538
|
+
private readonly idTransition;
|
|
1060
1539
|
constructor();
|
|
1061
1540
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxBannerTrigger, never>;
|
|
1062
1541
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxBannerTrigger, "cngx-banner-trigger", never, { "when": { "alias": "when"; "required": true; "isSignal": true; }; "message": { "alias": "message"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": true; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "actionLabel": { "alias": "actionLabel"; "required": false; "isSignal": true; }; "actionHandler": { "alias": "actionHandler"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -1094,7 +1573,7 @@ interface ToastConfig {
|
|
|
1094
1573
|
/** Show dismiss button. */
|
|
1095
1574
|
dismissible?: boolean;
|
|
1096
1575
|
/**
|
|
1097
|
-
* Custom component rendered as the toast body
|
|
1576
|
+
* Custom component rendered as the toast body.
|
|
1098
1577
|
* Replaces the default `message`/`description` text.
|
|
1099
1578
|
* `title` is still rendered above the component if set.
|
|
1100
1579
|
*
|
|
@@ -1104,6 +1583,13 @@ interface ToastConfig {
|
|
|
1104
1583
|
content?: Type<unknown>;
|
|
1105
1584
|
/** Inputs passed to the `content` component via `NgComponentOutlet`. */
|
|
1106
1585
|
contentInputs?: Record<string, unknown>;
|
|
1586
|
+
/**
|
|
1587
|
+
* Template rendered as the toast body - takes precedence over `content`
|
|
1588
|
+
* and `message`. `CngxToast` passes its projected content through here.
|
|
1589
|
+
*
|
|
1590
|
+
* A11y: same rule as `content` - avoid focusable elements inside.
|
|
1591
|
+
*/
|
|
1592
|
+
contentTemplate?: TemplateRef<unknown>;
|
|
1107
1593
|
}
|
|
1108
1594
|
/**
|
|
1109
1595
|
* Handle to a displayed toast - allows programmatic dismiss.
|
|
@@ -1117,25 +1603,23 @@ interface ToastRef {
|
|
|
1117
1603
|
afterDismissed(): Observable<void>;
|
|
1118
1604
|
}
|
|
1119
1605
|
/**
|
|
1120
|
-
*
|
|
1606
|
+
* Tracked state for a single toast - the element type of the public
|
|
1607
|
+
* `CngxToaster.toasts` signal. Immutable per slot; treat as read-only.
|
|
1121
1608
|
*
|
|
1122
1609
|
* @category ui/feedback/toast
|
|
1123
1610
|
*/
|
|
1124
1611
|
interface ToastState {
|
|
1125
1612
|
readonly id: number;
|
|
1126
|
-
readonly config: Required<Pick<ToastConfig, 'message' | 'severity' | 'dismissible'>> & Pick<ToastConfig, 'action' | 'title' | 'description' | 'content' | 'contentInputs'> & {
|
|
1613
|
+
readonly config: Required<Pick<ToastConfig, 'message' | 'severity' | 'dismissible'>> & Pick<ToastConfig, 'action' | 'title' | 'description' | 'content' | 'contentInputs' | 'contentTemplate'> & {
|
|
1127
1614
|
duration: number | 'persistent';
|
|
1128
1615
|
};
|
|
1129
1616
|
readonly createdAt: number;
|
|
1130
|
-
/** Timestamp when the current timer started (created or last resumed). */
|
|
1131
|
-
readonly timerStartedAt: number;
|
|
1132
1617
|
/** Dedup counter - incremented when identical toast fires again. */
|
|
1133
1618
|
readonly count: number;
|
|
1134
|
-
/**
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
/** Subject that emits on dismiss. */
|
|
1619
|
+
/**
|
|
1620
|
+
* @internal - library-owned dismissal lifecycle. Never call `next()` or
|
|
1621
|
+
* `complete()` from consumer code; observe via `ToastRef.afterDismissed()`.
|
|
1622
|
+
*/
|
|
1139
1623
|
readonly dismissed$: Subject<void>;
|
|
1140
1624
|
}
|
|
1141
1625
|
/**
|
|
@@ -1165,14 +1649,20 @@ declare class CngxToaster {
|
|
|
1165
1649
|
private nextId;
|
|
1166
1650
|
/** Reactive toast stack - read by `CngxToastOutlet`. */
|
|
1167
1651
|
readonly toasts: _angular_core.WritableSignal<readonly ToastState[]>;
|
|
1168
|
-
/** Default duration for non-error toasts
|
|
1169
|
-
readonly defaultDuration
|
|
1170
|
-
/** Dedup window in ms -
|
|
1171
|
-
readonly dedupWindow
|
|
1652
|
+
/** Default duration for non-error toasts - configure via `withToasts({ defaultDuration })`. */
|
|
1653
|
+
private readonly defaultDuration;
|
|
1654
|
+
/** Dedup window in ms - configure via `withToasts({ dedupWindow })`. */
|
|
1655
|
+
private readonly dedupWindow;
|
|
1656
|
+
/** Auto-dismiss timers keyed by toast id - not part of the public state shape. */
|
|
1657
|
+
private readonly timers;
|
|
1172
1658
|
constructor();
|
|
1173
1659
|
/** Show a toast. Returns a ref for programmatic control. */
|
|
1174
1660
|
show(config: ToastConfig): ToastRef;
|
|
1175
|
-
/**
|
|
1661
|
+
/**
|
|
1662
|
+
* @internal - called by toast-outlet on hover/focus (WCAG 2.2.1).
|
|
1663
|
+
* Hold-counted: hover and focus-within pause independently; the timer
|
|
1664
|
+
* resumes only when the last hold releases.
|
|
1665
|
+
*/
|
|
1176
1666
|
pauseTimer(id: number): void;
|
|
1177
1667
|
/** @internal - called by toast-outlet on mouse-leave/focus-out. */
|
|
1178
1668
|
resumeTimer(id: number): void;
|
|
@@ -1181,6 +1671,7 @@ declare class CngxToaster {
|
|
|
1181
1671
|
/** Dismiss all toasts. */
|
|
1182
1672
|
dismissAll(): void;
|
|
1183
1673
|
private startTimer;
|
|
1674
|
+
private clearTimer;
|
|
1184
1675
|
private createRef;
|
|
1185
1676
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxToaster, never>;
|
|
1186
1677
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxToaster>;
|
|
@@ -1211,6 +1702,10 @@ type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | '
|
|
|
1211
1702
|
* Place once in the app shell. Reads from `CngxToaster` reactively.
|
|
1212
1703
|
* Requires `provideToasts()` or `provideFeedback(withToasts())`.
|
|
1213
1704
|
*
|
|
1705
|
+
* One outlet per toaster instance: projected toast bodies (`CngxToast`
|
|
1706
|
+
* content) are captured as templates whose DOM nodes exist exactly once -
|
|
1707
|
+
* a second outlet on the same toaster renders those bodies empty.
|
|
1708
|
+
*
|
|
1214
1709
|
* ```html
|
|
1215
1710
|
* <cngx-toast-outlet position="bottom-end" [maxVisible]="5" />
|
|
1216
1711
|
* ```
|
|
@@ -1233,15 +1728,29 @@ type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | '
|
|
|
1233
1728
|
declare class CngxToastOutlet {
|
|
1234
1729
|
protected readonly service: CngxToaster;
|
|
1235
1730
|
private readonly config;
|
|
1731
|
+
private readonly i18n;
|
|
1732
|
+
/**
|
|
1733
|
+
* @internal - repeat-marker formatter for toasts, which are live regions. The toast
|
|
1734
|
+
* list is the only tracked source; the formatter is read untracked, so a copy flip
|
|
1735
|
+
* never rewrites a shown toast and the next toast transition picks it up.
|
|
1736
|
+
*/
|
|
1737
|
+
protected readonly repeatCount: _angular_core.Signal<(count: number) => string>;
|
|
1738
|
+
/**
|
|
1739
|
+
* @internal - dismiss-button name inside the toast live regions, keyed on the
|
|
1740
|
+
* toast list like {@link repeatCount}.
|
|
1741
|
+
*/
|
|
1742
|
+
protected readonly dismissLabel: _angular_core.Signal<string>;
|
|
1743
|
+
/** @internal - region name of the plain `role="region"` host; follows a switch at once. */
|
|
1744
|
+
protected readonly regionLabel: _angular_core.Signal<string>;
|
|
1236
1745
|
/** Stack position. */
|
|
1237
1746
|
readonly position: _angular_core.InputSignal<ToastPosition>;
|
|
1238
1747
|
/** Maximum visible toasts - oldest are evicted. */
|
|
1239
1748
|
readonly maxVisible: _angular_core.InputSignal<number>;
|
|
1240
1749
|
/** Insert new toasts at start or end of the stack. */
|
|
1241
|
-
readonly insertPosition: _angular_core.InputSignal<"
|
|
1750
|
+
readonly insertPosition: _angular_core.InputSignal<"end" | "start">;
|
|
1242
1751
|
/** @internal */
|
|
1243
1752
|
protected readonly positionClass: _angular_core.Signal<string>;
|
|
1244
|
-
/** @internal - slice to maxVisible, respecting insert position. */
|
|
1753
|
+
/** @internal - slice to maxVisible, respecting insert position. ToastState is immutable per slot. */
|
|
1245
1754
|
protected readonly visibleToasts: _angular_core.Signal<readonly ToastState[]>;
|
|
1246
1755
|
/** @internal - resolve icon component from global config or null. */
|
|
1247
1756
|
protected iconFor(toast: ToastState): _angular_core.Type<unknown> | null;
|
|
@@ -1293,6 +1802,8 @@ declare class CngxToastOutlet {
|
|
|
1293
1802
|
declare class CngxToastOn {
|
|
1294
1803
|
private readonly toast;
|
|
1295
1804
|
private readonly statefulFallback;
|
|
1805
|
+
private readonly errorDetail;
|
|
1806
|
+
private readonly i18n;
|
|
1296
1807
|
private readonly toastService;
|
|
1297
1808
|
/**
|
|
1298
1809
|
* The async state to watch. Optional - when omitted, the bridge falls back
|
|
@@ -1307,7 +1818,11 @@ declare class CngxToastOn {
|
|
|
1307
1818
|
readonly toastSuccess: _angular_core.InputSignal<string | undefined>;
|
|
1308
1819
|
/** Toast message on error. If not set, no error toast fires. */
|
|
1309
1820
|
readonly toastError: _angular_core.InputSignal<string | undefined>;
|
|
1310
|
-
/**
|
|
1821
|
+
/**
|
|
1822
|
+
* Append the error detail to the toast message, as mapped by
|
|
1823
|
+
* `withErrorDetail` (default: the raw error text in development builds,
|
|
1824
|
+
* nothing in production).
|
|
1825
|
+
*/
|
|
1311
1826
|
readonly toastErrorDetail: _angular_core.InputSignal<boolean>;
|
|
1312
1827
|
/** Duration for success toasts in ms. */
|
|
1313
1828
|
readonly toastSuccessDuration: _angular_core.InputSignal<number>;
|
|
@@ -1332,9 +1847,14 @@ declare class CngxToastOn {
|
|
|
1332
1847
|
* ```
|
|
1333
1848
|
*
|
|
1334
1849
|
* ### With custom content
|
|
1850
|
+
* Projected content replaces `message` as the toast body. Keep it
|
|
1851
|
+
* non-interactive - the toast renders inside a live region, where focusable
|
|
1852
|
+
* elements are unreachable for screen reader users. For a button, use
|
|
1853
|
+
* `actionLabel`/`actionHandler` instead.
|
|
1335
1854
|
* ```html
|
|
1336
|
-
* <cngx-toast severity="error" [when]="hasError()"
|
|
1337
|
-
*
|
|
1855
|
+
* <cngx-toast severity="error" [when]="hasError()"
|
|
1856
|
+
* actionLabel="Retry" [actionHandler]="retry">
|
|
1857
|
+
* Something went <strong>wrong</strong>.
|
|
1338
1858
|
* </cngx-toast>
|
|
1339
1859
|
* ```
|
|
1340
1860
|
*
|
|
@@ -1373,12 +1893,29 @@ declare class CngxToast {
|
|
|
1373
1893
|
/** Action button config. */
|
|
1374
1894
|
readonly actionLabel: _angular_core.InputSignal<string | undefined>;
|
|
1375
1895
|
readonly actionHandler: _angular_core.InputSignal<(() => void) | undefined>;
|
|
1896
|
+
/** Emitted when the shown toast is dismissed (auto, manual, or falling edge). */
|
|
1897
|
+
readonly dismissed: _angular_core.OutputEmitterRef<void>;
|
|
1376
1898
|
/** @internal */
|
|
1377
1899
|
private readonly action;
|
|
1900
|
+
private readonly projectedContent;
|
|
1378
1901
|
private activeRef;
|
|
1902
|
+
/**
|
|
1903
|
+
* @internal - edge detection derived via linkedSignal, not managed in the
|
|
1904
|
+
* effect. The pre-bind baseline is `false`, so an initial `[when]="true"`
|
|
1905
|
+
* counts as a rising edge.
|
|
1906
|
+
*/
|
|
1907
|
+
private readonly whenEdge;
|
|
1379
1908
|
constructor();
|
|
1909
|
+
/**
|
|
1910
|
+
* Returns the content template when something was actually projected,
|
|
1911
|
+
* `undefined` otherwise (then `message` renders). Presence is probed per
|
|
1912
|
+
* show via a throwaway embedded view - conditional content may appear
|
|
1913
|
+
* between edges, so the result is never cached. Deferred projection
|
|
1914
|
+
* re-attaches the nodes wherever the template instantiates next.
|
|
1915
|
+
*/
|
|
1916
|
+
private captureProjectedContent;
|
|
1380
1917
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxToast, never>;
|
|
1381
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxToast, "cngx-toast", never, { "when": { "alias": "when"; "required": true; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "actionLabel": { "alias": "actionLabel"; "required": false; "isSignal": true; }; "actionHandler": { "alias": "actionHandler"; "required": false; "isSignal": true; }; }, {}, never,
|
|
1918
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxToast, "cngx-toast", never, { "when": { "alias": "when"; "required": true; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "severity": { "alias": "severity"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "actionLabel": { "alias": "actionLabel"; "required": false; "isSignal": true; }; "actionHandler": { "alias": "actionHandler"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, never, ["*"], true, never>;
|
|
1382
1919
|
}
|
|
1383
1920
|
|
|
1384
1921
|
/**
|
|
@@ -1476,7 +2013,7 @@ declare class CngxAsyncErrorTpl {
|
|
|
1476
2013
|
* @slot cngxAsyncContent Rendered on success; gets the resolved value.
|
|
1477
2014
|
* @slot cngxAsyncSkeleton Rendered during the first load.
|
|
1478
2015
|
* @slot cngxAsyncEmpty Rendered when the value resolves to nothing.
|
|
1479
|
-
* @slot cngxAsyncError Rendered on failure; gets the error
|
|
2016
|
+
* @slot cngxAsyncError Rendered on failure; gets the error as `$implicit` (use `let-err`).
|
|
1480
2017
|
*
|
|
1481
2018
|
* <example-url>http://localhost:4200/#/forms/filter-builder/filter-builder-async-state/loading-error-content-branches-via-cngx-async-container</example-url>
|
|
1482
2019
|
* <example-url>http://localhost:4200/#/ui/feedback/async-container/cngx-async-container-full-control-toast</example-url>
|
|
@@ -1488,6 +2025,7 @@ declare class CngxAsyncErrorTpl {
|
|
|
1488
2025
|
*/
|
|
1489
2026
|
declare class CngxAsyncContainer<T> {
|
|
1490
2027
|
private readonly toaster;
|
|
2028
|
+
protected readonly i18n: _angular_core.Signal<_cngx_ui_feedback.CngxFeedbackI18n>;
|
|
1491
2029
|
private readonly loadingConfig;
|
|
1492
2030
|
/** The async state to render. */
|
|
1493
2031
|
readonly state: _angular_core.InputSignal<CngxAsyncState<T>>;
|
|
@@ -1539,5 +2077,5 @@ declare class CngxAsyncContainer<T> {
|
|
|
1539
2077
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxAsyncContainer<any>, "cngx-async-container", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "minDwell": { "alias": "minDwell"; "required": false; "isSignal": true; }; "refreshIndicator": { "alias": "refreshIndicator"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "toastSuccess": { "alias": "toastSuccess"; "required": false; "isSignal": true; }; "toastError": { "alias": "toastError"; "required": false; "isSignal": true; }; }, {}, ["skeletonTpl", "contentTpl", "emptyTpl", "errorTpl"], never, true, never>;
|
|
1540
2078
|
}
|
|
1541
2079
|
|
|
1542
|
-
export { CNGX_FEEDBACK_CONFIG, CngxAlert, CngxAlertAction, CngxAlertIcon, CngxAlertOn, CngxAlertStack, CngxAlerter, CngxAsyncContainer, CngxAsyncContentTpl, CngxAsyncEmptyTpl, CngxAsyncErrorTpl, CngxAsyncSkeletonTpl, CngxBanner, CngxBannerOn, CngxBannerOutlet, CngxBannerTrigger, CngxLoadingIndicator, CngxLoadingOverlay, CngxProgress, CngxToast, CngxToastOn, CngxToastOutlet, CngxToaster, provideFeedback, provideToasts, withAlertIcons, withAlerts, withBanners, withCloseIcon, withLoadingDefaults, withSpinnerTemplate, withToasts };
|
|
1543
|
-
export type { AlertConfig, AlertRef, AlertSeverity, AlertState, AlertVisibilityPhase, BannerConfig, BannerRef, BannerState, FeedbackConfig, FeedbackFeature, LoadingIndicatorVariant, ProgressVariant, ToastConfig, ToastPosition, ToastRef };
|
|
2080
|
+
export { CNGX_FEEDBACK_CONFIG, CNGX_FEEDBACK_I18N, CNGX_FEEDBACK_LANGUAGE_EN, CngxAlert, CngxAlertAction, CngxAlertIcon, CngxAlertOn, CngxAlertStack, CngxAlerter, CngxAsyncContainer, CngxAsyncContentTpl, CngxAsyncEmptyTpl, CngxAsyncErrorTpl, CngxAsyncSkeletonTpl, CngxBanner, CngxBannerOn, CngxBannerOutlet, CngxBannerTrigger, CngxLoadingIndicator, CngxLoadingOverlay, CngxProgress, CngxToast, CngxToastOn, CngxToastOutlet, CngxToaster, injectErrorDetail, injectFeedbackI18n, provideFeedback, provideFeedbackI18n, provideToasts, withAlertIcons, withAlerts, withBanners, withCloseIcon, withErrorDetail, withFeedbackI18nLabels, withLoadingDefaults, withSpinnerTemplate, withToasts };
|
|
2081
|
+
export type { AlertConfig, AlertRef, AlertSeverity, AlertState, AlertVisibilityPhase, BannerConfig, BannerRef, BannerState, CngxErrorDetailFn, CngxFeedbackAnnouncements, CngxFeedbackAnnouncementsLanguage, CngxFeedbackI18n, CngxFeedbackI18nOverrides, CngxFeedbackLanguageSection, FeedbackConfig, FeedbackFeature, LoadingIndicatorVariant, ProgressVariant, ToastConfig, ToastPosition, ToastRef, ToastState };
|