@cngx/ui 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/README.md +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +4 -3
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +44 -66
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +213 -335
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +60 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -44
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +78 -83
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +52 -74
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +589 -467
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +3 -5
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +71 -68
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +149 -171
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +858 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +207 -90
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +71 -32
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +21 -27
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +27 -40
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +28 -14
- package/mat-tabs/styles/mat-tabs.css +233 -258
- package/nav-rail/README.md +325 -0
- package/package.json +10 -5
- package/paginator/README.md +10 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +45 -77
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +58 -94
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -53
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +67 -44
- package/types/cngx-ui-data-grid-accordion.d.ts +49 -77
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +264 -289
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +2 -3
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +43 -69
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +164 -154
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +183 -62
- package/types/cngx-ui-tabs.d.ts +101 -27
- package/types/cngx-ui-timeline.d.ts +20 -48
- package/types/cngx-ui-toc.d.ts +30 -51
- package/types/cngx-ui.d.ts +1 -1
|
@@ -8,8 +8,6 @@ import { AsyncView } from '@cngx/common/data';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Visual variant for the loading indicator.
|
|
11
|
-
*
|
|
12
|
-
* @category ui/feedback/loading
|
|
13
11
|
*/
|
|
14
12
|
type LoadingIndicatorVariant = 'spinner' | 'bar';
|
|
15
13
|
/**
|
|
@@ -35,15 +33,14 @@ type LoadingIndicatorVariant = 'spinner' | 'bar';
|
|
|
35
33
|
* <cngx-loading-indicator [loading]="isLoading()" label="Fetching data" />
|
|
36
34
|
* ```
|
|
37
35
|
*
|
|
38
|
-
* @category ui/feedback/loading
|
|
39
|
-
* @docsKind primary
|
|
40
36
|
* @wcag AA
|
|
41
37
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/loading/loading-indicator.ts
|
|
42
|
-
* @since 0.
|
|
38
|
+
* @since 0.3.0
|
|
43
39
|
* @relatedTo CngxLoadingOverlay, CngxProgress, CngxAsyncContainer
|
|
44
40
|
*
|
|
45
|
-
* <example-url
|
|
46
|
-
* <example-url
|
|
41
|
+
* <example-url>/#/ui/feedback/loading-indicator/bar-variant</example-url>
|
|
42
|
+
* <example-url>/#/ui/feedback/loading-indicator/spinner-variant</example-url>
|
|
43
|
+
* @axis level atom
|
|
47
44
|
*/
|
|
48
45
|
declare class CngxLoadingIndicator {
|
|
49
46
|
private readonly config;
|
|
@@ -61,17 +58,10 @@ declare class CngxLoadingIndicator {
|
|
|
61
58
|
readonly delay: _angular_core.InputSignal<number>;
|
|
62
59
|
/** Minimum display time in ms once visible. Defaults to `CNGX_LOADING_CONFIG.minDwell`. */
|
|
63
60
|
readonly minDwell: _angular_core.InputSignal<number>;
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Use `minDwell`. Kept one release for migration; when set, it
|
|
66
|
-
* takes precedence over `minDwell`.
|
|
67
|
-
*/
|
|
68
|
-
readonly minDuration: _angular_core.InputSignal<number | undefined>;
|
|
69
61
|
/** @internal - true when the underlying source says "loading". */
|
|
70
62
|
protected readonly isActive: _angular_core.Signal<boolean>;
|
|
71
63
|
/** @internal - custom spinner component from global config. */
|
|
72
64
|
protected readonly customSpinner: _angular_core.Signal<_angular_core.Type<unknown> | null>;
|
|
73
|
-
/** @internal - deprecated `minDuration` alias forwards to `minDwell`. */
|
|
74
|
-
protected readonly effectiveMinDwell: _angular_core.Signal<number>;
|
|
75
65
|
/** @internal - final visibility after delay + minDwell. */
|
|
76
66
|
readonly visible: _angular_core.Signal<boolean>;
|
|
77
67
|
/**
|
|
@@ -82,7 +72,7 @@ declare class CngxLoadingIndicator {
|
|
|
82
72
|
*/
|
|
83
73
|
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
84
74
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLoadingIndicator, never>;
|
|
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; };
|
|
75
|
+
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; }; }, {}, never, never, true, never>;
|
|
86
76
|
}
|
|
87
77
|
|
|
88
78
|
/**
|
|
@@ -116,14 +106,13 @@ declare class CngxLoadingIndicator {
|
|
|
116
106
|
* </cngx-loading-overlay>
|
|
117
107
|
* ```
|
|
118
108
|
*
|
|
119
|
-
* @category ui/feedback/loading
|
|
120
|
-
* @docsKind primary
|
|
121
109
|
* @wcag AA
|
|
122
110
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/loading/loading-overlay.ts
|
|
123
|
-
* @since 0.
|
|
111
|
+
* @since 0.3.0
|
|
124
112
|
* @relatedTo CngxLoadingIndicator, CngxProgress, CngxAsyncContainer
|
|
125
113
|
*
|
|
126
|
-
* <example-url
|
|
114
|
+
* <example-url>/#/ui/feedback/loading-overlay/overlay-with-form</example-url>
|
|
115
|
+
* @axis level molecule
|
|
127
116
|
*/
|
|
128
117
|
declare class CngxLoadingOverlay {
|
|
129
118
|
private readonly doc;
|
|
@@ -142,11 +131,6 @@ declare class CngxLoadingOverlay {
|
|
|
142
131
|
readonly delay: _angular_core.InputSignal<number>;
|
|
143
132
|
/** Minimum display time in ms once visible. Defaults to `CNGX_LOADING_CONFIG.minDwell`. */
|
|
144
133
|
readonly minDwell: _angular_core.InputSignal<number>;
|
|
145
|
-
/**
|
|
146
|
-
* @deprecated Use `minDwell`. Kept one release for migration; when set, it
|
|
147
|
-
* takes precedence over `minDwell`.
|
|
148
|
-
*/
|
|
149
|
-
readonly minDuration: _angular_core.InputSignal<number | undefined>;
|
|
150
134
|
/**
|
|
151
135
|
* When `true`, the overlay only activates during the first load (`isFirstLoad()`),
|
|
152
136
|
* not during refreshes. Use the async container's built-in refresh bar for
|
|
@@ -155,8 +139,6 @@ declare class CngxLoadingOverlay {
|
|
|
155
139
|
readonly firstLoadOnly: _angular_core.InputSignal<boolean>;
|
|
156
140
|
/** @internal */
|
|
157
141
|
protected readonly isActive: _angular_core.Signal<boolean>;
|
|
158
|
-
/** @internal - deprecated `minDuration` alias forwards to `minDwell`. */
|
|
159
|
-
protected readonly effectiveMinDwell: _angular_core.Signal<number>;
|
|
160
142
|
/** @internal - debounced visibility via shared gate factory. */
|
|
161
143
|
protected readonly visible: _angular_core.Signal<boolean>;
|
|
162
144
|
/**
|
|
@@ -170,13 +152,11 @@ declare class CngxLoadingOverlay {
|
|
|
170
152
|
private readonly spinnerEl;
|
|
171
153
|
constructor();
|
|
172
154
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLoadingOverlay, never>;
|
|
173
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxLoadingOverlay, "cngx-loading-overlay", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "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; }; "
|
|
155
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxLoadingOverlay, "cngx-loading-overlay", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "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; }; "firstLoadOnly": { "alias": "firstLoadOnly"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
174
156
|
}
|
|
175
157
|
|
|
176
158
|
/**
|
|
177
159
|
* Visual variant for the progress indicator.
|
|
178
|
-
*
|
|
179
|
-
* @category ui/feedback/loading
|
|
180
160
|
*/
|
|
181
161
|
type ProgressVariant = 'linear' | 'circular';
|
|
182
162
|
/**
|
|
@@ -200,16 +180,15 @@ type ProgressVariant = 'linear' | 'circular';
|
|
|
200
180
|
* <cngx-progress [progress]="percent()" label="Processing" />
|
|
201
181
|
* ```
|
|
202
182
|
*
|
|
203
|
-
* @category ui/feedback/loading
|
|
204
|
-
* @docsKind primary
|
|
205
183
|
* @wcag AA
|
|
206
184
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/loading/progress.ts
|
|
207
|
-
* @since 0.
|
|
185
|
+
* @since 0.3.0
|
|
208
186
|
* @relatedTo CngxLoadingIndicator, CngxLoadingOverlay, CngxAsyncContainer
|
|
209
187
|
*
|
|
210
|
-
* <example-url
|
|
211
|
-
* <example-url
|
|
212
|
-
* <example-url
|
|
188
|
+
* <example-url>/#/ui/feedback/progress/circular-variant</example-url>
|
|
189
|
+
* <example-url>/#/ui/feedback/progress/linear-determinate</example-url>
|
|
190
|
+
* <example-url>/#/ui/feedback/progress/linear-indeterminate</example-url>
|
|
191
|
+
* @axis level atom
|
|
213
192
|
*/
|
|
214
193
|
declare class CngxProgress {
|
|
215
194
|
private readonly i18n;
|
|
@@ -249,30 +228,25 @@ declare class CngxProgress {
|
|
|
249
228
|
|
|
250
229
|
/**
|
|
251
230
|
* Severity level for the alert - determines visual style, icon, and ARIA role.
|
|
252
|
-
*
|
|
253
|
-
* @category ui/feedback/alert
|
|
254
231
|
*/
|
|
255
232
|
type AlertSeverity = 'info' | 'success' | 'warning' | 'error';
|
|
256
233
|
/**
|
|
257
234
|
* Visibility phase for enter/exit CSS animations.
|
|
258
|
-
*
|
|
259
|
-
* @category ui/feedback/alert
|
|
260
235
|
*/
|
|
261
236
|
type AlertVisibilityPhase = 'hidden' | 'entering' | 'visible' | 'exiting';
|
|
262
237
|
/**
|
|
263
238
|
* Content slot directive for custom alert icons.
|
|
264
239
|
*
|
|
265
|
-
* @category ui/feedback/alert
|
|
266
240
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alert.ts
|
|
267
|
-
* @since 0.
|
|
241
|
+
* @since 0.3.0
|
|
268
242
|
* @relatedTo CngxAlert, CngxAlertAction
|
|
269
243
|
*
|
|
270
|
-
* <example-url
|
|
271
|
-
* <example-url
|
|
272
|
-
* <example-url
|
|
273
|
-
* <example-url
|
|
274
|
-
* <example-url
|
|
275
|
-
* <example-url
|
|
244
|
+
* <example-url>/#/ui/feedback/alert/action-buttons</example-url>
|
|
245
|
+
* <example-url>/#/ui/feedback/alert/auto-collapse</example-url>
|
|
246
|
+
* <example-url>/#/ui/feedback/alert/boolean-trigger-when</example-url>
|
|
247
|
+
* <example-url>/#/ui/feedback/alert/dismissible</example-url>
|
|
248
|
+
* <example-url>/#/ui/feedback/alert/severities</example-url>
|
|
249
|
+
* <example-url>/#/ui/feedback/alert/state-driven-visibility</example-url>
|
|
276
250
|
*/
|
|
277
251
|
declare class CngxAlertIcon {
|
|
278
252
|
readonly templateRef: TemplateRef<any> | null;
|
|
@@ -292,18 +266,17 @@ declare class CngxAlertIcon {
|
|
|
292
266
|
* </cngx-alert>
|
|
293
267
|
* ```
|
|
294
268
|
*
|
|
295
|
-
* @category ui/feedback/alert
|
|
296
269
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alert.ts
|
|
297
270
|
* @selector [cngxAlertAction]
|
|
298
|
-
* @since 0.
|
|
271
|
+
* @since 0.3.0
|
|
299
272
|
* @relatedTo CngxAlert, CngxAlertIcon
|
|
300
273
|
*
|
|
301
|
-
* <example-url
|
|
302
|
-
* <example-url
|
|
303
|
-
* <example-url
|
|
304
|
-
* <example-url
|
|
305
|
-
* <example-url
|
|
306
|
-
* <example-url
|
|
274
|
+
* <example-url>/#/ui/feedback/alert/action-buttons</example-url>
|
|
275
|
+
* <example-url>/#/ui/feedback/alert/auto-collapse</example-url>
|
|
276
|
+
* <example-url>/#/ui/feedback/alert/boolean-trigger-when</example-url>
|
|
277
|
+
* <example-url>/#/ui/feedback/alert/dismissible</example-url>
|
|
278
|
+
* <example-url>/#/ui/feedback/alert/severities</example-url>
|
|
279
|
+
* <example-url>/#/ui/feedback/alert/state-driven-visibility</example-url>
|
|
307
280
|
*/
|
|
308
281
|
declare class CngxAlertAction {
|
|
309
282
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAlertAction, never>;
|
|
@@ -320,19 +293,18 @@ declare class CngxAlertAction {
|
|
|
320
293
|
*
|
|
321
294
|
* `[state]` takes precedence over `[when]`.
|
|
322
295
|
*
|
|
323
|
-
* @category ui/feedback/alert
|
|
324
|
-
* @docsKind primary
|
|
325
296
|
* @wcag AA
|
|
326
297
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alert.ts
|
|
327
|
-
* @since 0.
|
|
298
|
+
* @since 0.3.0
|
|
328
299
|
* @relatedTo CngxAlertStack, CngxAlerter, CngxAlertOn, CngxAlertIcon, CngxAlertAction
|
|
329
300
|
*
|
|
330
|
-
* <example-url
|
|
331
|
-
* <example-url
|
|
332
|
-
* <example-url
|
|
333
|
-
* <example-url
|
|
334
|
-
* <example-url
|
|
335
|
-
* <example-url
|
|
301
|
+
* <example-url>/#/ui/feedback/alert/action-buttons</example-url>
|
|
302
|
+
* <example-url>/#/ui/feedback/alert/auto-collapse</example-url>
|
|
303
|
+
* <example-url>/#/ui/feedback/alert/boolean-trigger-when</example-url>
|
|
304
|
+
* <example-url>/#/ui/feedback/alert/dismissible</example-url>
|
|
305
|
+
* <example-url>/#/ui/feedback/alert/severities</example-url>
|
|
306
|
+
* <example-url>/#/ui/feedback/alert/state-driven-visibility</example-url>
|
|
307
|
+
* @axis level molecule
|
|
336
308
|
*/
|
|
337
309
|
declare class CngxAlert {
|
|
338
310
|
private readonly config;
|
|
@@ -344,13 +316,8 @@ declare class CngxAlert {
|
|
|
344
316
|
readonly severity: _angular_core.InputSignal<AlertSeverity>;
|
|
345
317
|
/** Optional title displayed above the content. */
|
|
346
318
|
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
347
|
-
/**
|
|
348
|
-
* Shows a dismiss button.
|
|
349
|
-
* @deprecated Use `closable` instead.
|
|
350
|
-
*/
|
|
319
|
+
/** Shows a dismiss button. */
|
|
351
320
|
readonly dismissible: _angular_core.InputSignal<boolean>;
|
|
352
|
-
/** Shows a dismiss button. Preferred over deprecated `dismissible`. */
|
|
353
|
-
readonly closable: _angular_core.InputSignal<boolean>;
|
|
354
321
|
/** Bind an async state - auto-shows on error/success/loading, auto-hides on idle. */
|
|
355
322
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
356
323
|
/**
|
|
@@ -387,15 +354,13 @@ declare class CngxAlert {
|
|
|
387
354
|
*/
|
|
388
355
|
private readonly motionWindow;
|
|
389
356
|
private readonly canQueryMotion;
|
|
390
|
-
private readonly
|
|
357
|
+
private readonly motion;
|
|
391
358
|
/** Active pause holds - pointer hover and focus-within count independently. */
|
|
392
359
|
private interactionHolds;
|
|
393
360
|
/** Set when interaction expanded an already-collapsed alert; release re-arms. */
|
|
394
361
|
private reCollapseOnRelease;
|
|
395
362
|
/** @internal - global icon component for the current severity (from provideFeedback config). */
|
|
396
363
|
protected readonly globalIcon: _angular_core.Signal<_angular_core.Type<unknown> | null>;
|
|
397
|
-
/** @internal - merged closable from new and deprecated input. */
|
|
398
|
-
protected readonly effectiveClosable: _angular_core.Signal<boolean>;
|
|
399
364
|
/** @internal - ARIA role: 'alert' for error/warning, 'status' for info/success. */
|
|
400
365
|
protected readonly ariaRole: _angular_core.Signal<"alert" | "status">;
|
|
401
366
|
/** @internal - false when actions are projected to prevent full re-announcement. */
|
|
@@ -446,38 +411,24 @@ declare class CngxAlert {
|
|
|
446
411
|
private handleInteractionStart;
|
|
447
412
|
private handleInteractionEnd;
|
|
448
413
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAlert, never>;
|
|
449
|
-
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; }; "
|
|
414
|
+
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; }; "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>;
|
|
450
415
|
}
|
|
451
416
|
|
|
452
417
|
/**
|
|
453
418
|
* Global configuration for all feedback components.
|
|
454
419
|
* Provided via `provideFeedback()` with `with*` features.
|
|
455
|
-
*
|
|
456
|
-
* @category ui/feedback
|
|
457
420
|
*/
|
|
458
421
|
interface FeedbackConfig {
|
|
459
422
|
/** Custom spinner component to replace the built-in SVG spinner. */
|
|
460
423
|
spinnerComponent?: Type<unknown>;
|
|
461
424
|
/** Custom icon components per alert severity. Replaces built-in SVG icons. */
|
|
462
425
|
alertIcons?: Partial<Record<AlertSeverity, Type<unknown>>>;
|
|
463
|
-
/**
|
|
464
|
-
* Default delay in ms before showing loading indicators.
|
|
465
|
-
*
|
|
466
|
-
* @deprecated Use `provideLoadingConfig(withShowDelay(...))` from `@cngx/core/utils`.
|
|
467
|
-
* Kept one release as a forwarder; `withLoadingDefaults` still writes it.
|
|
468
|
-
*/
|
|
469
|
-
loadingDelay?: number;
|
|
470
|
-
/**
|
|
471
|
-
* Default minimum display time in ms for loading indicators.
|
|
472
|
-
*
|
|
473
|
-
* @deprecated Use `provideLoadingConfig(withMinDwell(...))` from `@cngx/core/utils`.
|
|
474
|
-
* Kept one release as a forwarder; `withLoadingDefaults` still writes it.
|
|
475
|
-
*/
|
|
476
|
-
loadingMinDuration?: number;
|
|
477
426
|
/** Custom close/dismiss icon component - replaces default X SVG globally. */
|
|
478
427
|
closeIconComponent?: Type<unknown>;
|
|
479
428
|
/** Default auto-dismiss duration for toasts in ms. */
|
|
480
429
|
toastDefaultDuration?: number;
|
|
430
|
+
/** Default auto-dismiss duration for toasts that carry an action, in ms. */
|
|
431
|
+
toastActionDuration?: number;
|
|
481
432
|
/** Dedup window for identical toasts in ms. */
|
|
482
433
|
toastDedupWindow?: number;
|
|
483
434
|
/** Default auto-dismiss duration for scoped alerts in ms. `undefined` = persistent. */
|
|
@@ -494,18 +445,15 @@ interface FeedbackConfig {
|
|
|
494
445
|
}
|
|
495
446
|
/**
|
|
496
447
|
* Maps a failure to user-facing detail text, or `undefined` for none.
|
|
497
|
-
*
|
|
498
|
-
* @category ui/feedback
|
|
499
448
|
*/
|
|
500
449
|
type CngxErrorDetailFn = (error: unknown) => string | undefined;
|
|
501
450
|
/**
|
|
502
451
|
* Injection token for the global feedback configuration.
|
|
503
452
|
* Components read this with `inject(CNGX_FEEDBACK_CONFIG, { optional: true })`.
|
|
504
453
|
*
|
|
505
|
-
* @category ui/feedback
|
|
506
454
|
* @wcag AA
|
|
507
455
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/config/feedback-config.ts
|
|
508
|
-
* @since 0.
|
|
456
|
+
* @since 0.3.0
|
|
509
457
|
*/
|
|
510
458
|
declare const CNGX_FEEDBACK_CONFIG: InjectionToken<FeedbackConfig>;
|
|
511
459
|
/**
|
|
@@ -514,8 +462,6 @@ declare const CNGX_FEEDBACK_CONFIG: InjectionToken<FeedbackConfig>;
|
|
|
514
462
|
* Merge rule (all features): an explicitly passed option wins; an omitted
|
|
515
463
|
* option preserves the value an earlier feature wrote. No feature clears
|
|
516
464
|
* fields it was not given.
|
|
517
|
-
*
|
|
518
|
-
* @category ui/feedback
|
|
519
465
|
*/
|
|
520
466
|
interface FeedbackFeature {
|
|
521
467
|
/** @internal */
|
|
@@ -532,13 +478,10 @@ interface FeedbackFeature {
|
|
|
532
478
|
* provideFeedback(
|
|
533
479
|
* withSpinnerTemplate(MyLucideSpinner),
|
|
534
480
|
* withAlertIcons({ error: MyErrorIcon, warning: MyWarningIcon }),
|
|
535
|
-
* withLoadingDefaults({ delay: 300, minDuration: 600 }),
|
|
536
481
|
* ),
|
|
537
482
|
* ],
|
|
538
483
|
* });
|
|
539
484
|
* ```
|
|
540
|
-
*
|
|
541
|
-
* @category ui/feedback
|
|
542
485
|
*/
|
|
543
486
|
declare function provideFeedback(...features: FeedbackFeature[]): EnvironmentProviders;
|
|
544
487
|
/**
|
|
@@ -550,8 +493,6 @@ declare function provideFeedback(...features: FeedbackFeature[]): EnvironmentPro
|
|
|
550
493
|
* ```ts
|
|
551
494
|
* provideFeedback(withSpinnerTemplate(MatProgressSpinner))
|
|
552
495
|
* ```
|
|
553
|
-
*
|
|
554
|
-
* @category ui/feedback/loading
|
|
555
496
|
*/
|
|
556
497
|
declare function withSpinnerTemplate(component: Type<unknown>): FeedbackFeature;
|
|
557
498
|
/**
|
|
@@ -568,47 +509,19 @@ declare function withSpinnerTemplate(component: Type<unknown>): FeedbackFeature;
|
|
|
568
509
|
* info: MyInfoIcon,
|
|
569
510
|
* }))
|
|
570
511
|
* ```
|
|
571
|
-
*
|
|
572
|
-
* @category ui/feedback
|
|
573
512
|
*/
|
|
574
513
|
declare function withAlertIcons(icons: Partial<Record<AlertSeverity, Type<unknown>>>): FeedbackFeature;
|
|
575
|
-
/**
|
|
576
|
-
* Set default timing for all loading indicators and overlays.
|
|
577
|
-
*
|
|
578
|
-
* Forwards into the Level-1 `CNGX_LOADING_CONFIG` cascade so the gated
|
|
579
|
-
* surfaces (indicator, overlay, async-container, skeleton) all read the same
|
|
580
|
-
* defaults. Prefer `provideLoadingConfig(withShowDelay(...), withMinDwell(...))`
|
|
581
|
-
* from `@cngx/core/utils` directly; this feature is kept for back-compat.
|
|
582
|
-
*
|
|
583
|
-
* Note: this forwarder provides a full `CNGX_LOADING_CONFIG` value, so under
|
|
584
|
-
* DI last-wins it replaces the whole config - including `spinnerVsSkeletonCutoff`,
|
|
585
|
-
* which resets to its default. Set the cutoff through
|
|
586
|
-
* `provideLoadingConfig(withSpinnerVsSkeletonCutoff(...))` rather than combining
|
|
587
|
-
* it with this back-compat forwarder.
|
|
588
|
-
*
|
|
589
|
-
* Individual components can still override via their `[delay]` and `[minDwell]` inputs.
|
|
590
|
-
*
|
|
591
|
-
* ```ts
|
|
592
|
-
* provideFeedback(withLoadingDefaults({ delay: 300, minDuration: 600 }))
|
|
593
|
-
* ```
|
|
594
|
-
*
|
|
595
|
-
* @category ui/feedback
|
|
596
|
-
*/
|
|
597
|
-
declare function withLoadingDefaults(opts: {
|
|
598
|
-
delay?: number;
|
|
599
|
-
minDuration?: number;
|
|
600
|
-
}): FeedbackFeature;
|
|
601
514
|
/**
|
|
602
515
|
* Replace the built-in X SVG in all close/dismiss buttons globally.
|
|
603
516
|
*
|
|
604
517
|
* The component receives no inputs - it should render a single icon.
|
|
605
518
|
* Per-instance override via content projection on `CngxCloseButton` takes precedence.
|
|
519
|
+
* Forwards to `provideButtonCloseIcon` from `@cngx/common/button`, so a close
|
|
520
|
+
* button outside the feedback surfaces gets the same glyph.
|
|
606
521
|
*
|
|
607
522
|
* ```ts
|
|
608
523
|
* provideFeedback(withCloseIcon(MyLucideXIcon))
|
|
609
524
|
* ```
|
|
610
|
-
*
|
|
611
|
-
* @category ui/feedback
|
|
612
525
|
*/
|
|
613
526
|
declare function withCloseIcon(component: Type<unknown>): FeedbackFeature;
|
|
614
527
|
/**
|
|
@@ -626,12 +539,16 @@ declare function withCloseIcon(component: Type<unknown>): FeedbackFeature;
|
|
|
626
539
|
* withAlertIcons({ error: MyErrorIcon }),
|
|
627
540
|
* )
|
|
628
541
|
* ```
|
|
629
|
-
*
|
|
630
|
-
* @category ui/feedback
|
|
631
542
|
*/
|
|
632
543
|
declare function withToasts(opts?: {
|
|
633
544
|
/** Default auto-dismiss duration in ms. */
|
|
634
545
|
defaultDuration?: number;
|
|
546
|
+
/**
|
|
547
|
+
* Default auto-dismiss duration in ms for toasts that carry an `action`
|
|
548
|
+
* (default 10000). Longer than `defaultDuration` so keyboard and screen
|
|
549
|
+
* reader users can reach the action button (WCAG 2.2.1).
|
|
550
|
+
*/
|
|
551
|
+
actionDuration?: number;
|
|
635
552
|
/** Dedup window in ms. */
|
|
636
553
|
dedupWindow?: number;
|
|
637
554
|
}): FeedbackFeature;
|
|
@@ -653,8 +570,6 @@ declare function withToasts(opts?: {
|
|
|
653
570
|
* withAlerts(),
|
|
654
571
|
* )
|
|
655
572
|
* ```
|
|
656
|
-
*
|
|
657
|
-
* @category ui/feedback
|
|
658
573
|
*/
|
|
659
574
|
declare function withAlerts(opts?: {
|
|
660
575
|
/** Default auto-dismiss duration in ms. `undefined` = persistent. */
|
|
@@ -680,8 +595,6 @@ declare function withAlerts(opts?: {
|
|
|
680
595
|
* withBanners(),
|
|
681
596
|
* )
|
|
682
597
|
* ```
|
|
683
|
-
*
|
|
684
|
-
* @category ui/feedback
|
|
685
598
|
*/
|
|
686
599
|
declare function withBanners(): FeedbackFeature;
|
|
687
600
|
/**
|
|
@@ -704,8 +617,7 @@ declare function withBanners(): FeedbackFeature;
|
|
|
704
617
|
* )
|
|
705
618
|
* ```
|
|
706
619
|
*
|
|
707
|
-
* @
|
|
708
|
-
* @since 0.1.0
|
|
620
|
+
* @since 0.3.0
|
|
709
621
|
*/
|
|
710
622
|
declare function withErrorDetail(map: CngxErrorDetailFn): FeedbackFeature;
|
|
711
623
|
/**
|
|
@@ -714,8 +626,7 @@ declare function withErrorDetail(map: CngxErrorDetailFn): FeedbackFeature;
|
|
|
714
626
|
* time it shows, and nothing in production. Call it in an injection context,
|
|
715
627
|
* then call the returned function with the error.
|
|
716
628
|
*
|
|
717
|
-
* @
|
|
718
|
-
* @since 0.1.0
|
|
629
|
+
* @since 0.3.0
|
|
719
630
|
*/
|
|
720
631
|
declare function injectErrorDetail(): CngxErrorDetailFn;
|
|
721
632
|
|
|
@@ -724,8 +635,6 @@ declare function injectErrorDetail(): CngxErrorDetailFn;
|
|
|
724
635
|
* from the region names: these describe a transition rather than naming a
|
|
725
636
|
* landmark, so they change on a different cadence and a consumer usually
|
|
726
637
|
* translates them as one block.
|
|
727
|
-
*
|
|
728
|
-
* @category ui/feedback/i18n
|
|
729
638
|
*/
|
|
730
639
|
interface CngxFeedbackAnnouncements {
|
|
731
640
|
/** Announced when a user dismisses an alert. */
|
|
@@ -767,8 +676,6 @@ interface CngxFeedbackAnnouncements {
|
|
|
767
676
|
* Two region names and one announcement sub-bundle. The banner outlet carries
|
|
768
677
|
* no region `aria-label`, so it gets no key - a key with no Wirkungsort is
|
|
769
678
|
* configuration for its own sake.
|
|
770
|
-
*
|
|
771
|
-
* @category ui/feedback/i18n
|
|
772
679
|
*/
|
|
773
680
|
interface CngxFeedbackI18n {
|
|
774
681
|
/** Accessible name of the `role="region"` host on `CngxAlertStack`. */
|
|
@@ -807,8 +714,6 @@ interface CngxFeedbackI18n {
|
|
|
807
714
|
/**
|
|
808
715
|
* Override shape: every top-level key optional, and `announcements` overridable
|
|
809
716
|
* key by key rather than all-or-nothing.
|
|
810
|
-
*
|
|
811
|
-
* @category ui/feedback/i18n
|
|
812
717
|
*/
|
|
813
718
|
type CngxFeedbackI18nOverrides = Partial<Omit<CngxFeedbackI18n, 'announcements'>> & {
|
|
814
719
|
readonly announcements?: Partial<CngxFeedbackAnnouncements>;
|
|
@@ -820,10 +725,9 @@ type CngxFeedbackI18nOverrides = Partial<Omit<CngxFeedbackI18n, 'announcements'>
|
|
|
820
725
|
* defaults, formatted for the app locale, so a consumer who provides nothing
|
|
821
726
|
* still gets named regions.
|
|
822
727
|
*
|
|
823
|
-
* @category ui/feedback/i18n
|
|
824
728
|
* @wcag AA
|
|
825
729
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/config/feedback-i18n.ts
|
|
826
|
-
* @since 0.
|
|
730
|
+
* @since 0.3.0
|
|
827
731
|
* @relatedTo CngxAlertStack, CngxToastOutlet
|
|
828
732
|
*/
|
|
829
733
|
declare const CNGX_FEEDBACK_I18N: InjectionToken<Signal<CngxFeedbackI18n>>;
|
|
@@ -844,8 +748,6 @@ declare const CNGX_FEEDBACK_I18N: InjectionToken<Signal<CngxFeedbackI18n>>;
|
|
|
844
748
|
* Contributes the token through the feature's `_providers`, so - like
|
|
845
749
|
* {@link withCloseIcon} - a second call in the same `provideFeedback()` wins
|
|
846
750
|
* over the first rather than merging with it. Pass every key in one call.
|
|
847
|
-
*
|
|
848
|
-
* @category ui/feedback/i18n
|
|
849
751
|
*/
|
|
850
752
|
declare function withFeedbackI18nLabels(overrides: CngxFeedbackI18nOverrides | Signal<CngxFeedbackI18nOverrides>): FeedbackFeature;
|
|
851
753
|
/**
|
|
@@ -877,8 +779,7 @@ declare function withFeedbackI18nLabels(overrides: CngxFeedbackI18nOverrides | S
|
|
|
877
779
|
* bootstrapApplication(App, { providers: [...DE] });
|
|
878
780
|
* ```
|
|
879
781
|
*
|
|
880
|
-
* @
|
|
881
|
-
* @since 0.1.0
|
|
782
|
+
* @since 0.3.0
|
|
882
783
|
*/
|
|
883
784
|
declare function provideFeedbackI18n(overrides: CngxFeedbackI18nOverrides | Signal<CngxFeedbackI18nOverrides>): Provider;
|
|
884
785
|
/**
|
|
@@ -888,8 +789,6 @@ declare function provideFeedbackI18n(overrides: CngxFeedbackI18nOverrides | Sign
|
|
|
888
789
|
* a `computed()`, template or handler so a language switch reaches the label.
|
|
889
790
|
* One Signal per injector, bundle and locale, so row-level readers (alerts,
|
|
890
791
|
* toasts, banners) share it.
|
|
891
|
-
*
|
|
892
|
-
* @category ui/feedback/i18n
|
|
893
792
|
*/
|
|
894
793
|
declare function injectFeedbackI18n(): Signal<CngxFeedbackI18n>;
|
|
895
794
|
|
|
@@ -897,8 +796,7 @@ declare function injectFeedbackI18n(): Signal<CngxFeedbackI18n>;
|
|
|
897
796
|
* The live-region words of the feedback section: transitions the feedback
|
|
898
797
|
* family announces on its own behalf.
|
|
899
798
|
*
|
|
900
|
-
* @
|
|
901
|
-
* @since 0.1.0
|
|
799
|
+
* @since 0.3.0
|
|
902
800
|
*/
|
|
903
801
|
interface CngxFeedbackAnnouncementsLanguage {
|
|
904
802
|
/** Announced when a user dismisses an alert. */
|
|
@@ -930,8 +828,7 @@ interface CngxFeedbackAnnouncementsLanguage {
|
|
|
930
828
|
* container and the state bridges). It feeds `CNGX_FEEDBACK_I18N`. Messages
|
|
931
829
|
* use `{name}` placeholders; a plural message picks its form from `{count}`.
|
|
932
830
|
*
|
|
933
|
-
* @
|
|
934
|
-
* @since 0.1.0
|
|
831
|
+
* @since 0.3.0
|
|
935
832
|
* @relatedTo CNGX_FEEDBACK_I18N
|
|
936
833
|
*/
|
|
937
834
|
interface CngxFeedbackLanguageSection {
|
|
@@ -965,8 +862,7 @@ interface CngxFeedbackLanguageSection {
|
|
|
965
862
|
* The English feedback section: the single source of the feedback family's
|
|
966
863
|
* English copy. `CNGX_FEEDBACK_I18N` defaults to it.
|
|
967
864
|
*
|
|
968
|
-
* @
|
|
969
|
-
* @since 0.1.0
|
|
865
|
+
* @since 0.3.0
|
|
970
866
|
* @relatedTo CNGX_FEEDBACK_I18N
|
|
971
867
|
*/
|
|
972
868
|
declare const CNGX_FEEDBACK_LANGUAGE_EN: CngxFeedbackLanguageSection;
|
|
@@ -977,9 +873,33 @@ declare module '@cngx/core/i18n' {
|
|
|
977
873
|
}
|
|
978
874
|
|
|
979
875
|
/**
|
|
980
|
-
*
|
|
876
|
+
* A source that holds a registry timer. Pointer hover and focus-within fire
|
|
877
|
+
* separate event pairs on the same element; `queue` is the outlet's hold on a
|
|
878
|
+
* toast that `maxVisible` keeps out of view.
|
|
981
879
|
*
|
|
982
|
-
* @
|
|
880
|
+
* @internal
|
|
881
|
+
*/
|
|
882
|
+
type TimerHoldSource = 'pointer' | 'focus' | 'queue';
|
|
883
|
+
/**
|
|
884
|
+
* One countdown segment of a registry timer, snapshotted at the transition
|
|
885
|
+
* that opened it (a start, the first hold or the last release).
|
|
886
|
+
*
|
|
887
|
+
* `serial` is registry-wide and monotonic, so a renderer keyed by it starts a
|
|
888
|
+
* fresh animation at every transition. `total` is the duration of the current
|
|
889
|
+
* start, `remaining` the milliseconds left at the snapshot, `running` whether
|
|
890
|
+
* the clock was moving at that moment.
|
|
891
|
+
*
|
|
892
|
+
* @internal
|
|
893
|
+
*/
|
|
894
|
+
interface TimerSegment {
|
|
895
|
+
readonly serial: number;
|
|
896
|
+
readonly total: number;
|
|
897
|
+
readonly remaining: number;
|
|
898
|
+
readonly running: boolean;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/**
|
|
902
|
+
* Configuration for a programmatic alert.
|
|
983
903
|
*/
|
|
984
904
|
interface AlertConfig {
|
|
985
905
|
/** Alert message text (required). */
|
|
@@ -1009,8 +929,6 @@ interface AlertConfig {
|
|
|
1009
929
|
}
|
|
1010
930
|
/**
|
|
1011
931
|
* Handle to a displayed alert - allows programmatic dismiss.
|
|
1012
|
-
*
|
|
1013
|
-
* @category ui/feedback/alert
|
|
1014
932
|
*/
|
|
1015
933
|
interface AlertRef {
|
|
1016
934
|
/** Programmatically dismiss this alert. */
|
|
@@ -1021,8 +939,6 @@ interface AlertRef {
|
|
|
1021
939
|
/**
|
|
1022
940
|
* Tracked state for a single alert - the element type of the public
|
|
1023
941
|
* `CngxAlerter.alerts` signal. Immutable per slot; treat as read-only.
|
|
1024
|
-
*
|
|
1025
|
-
* @category ui/feedback/alert
|
|
1026
942
|
*/
|
|
1027
943
|
interface AlertState {
|
|
1028
944
|
readonly id: number;
|
|
@@ -1042,16 +958,14 @@ interface AlertState {
|
|
|
1042
958
|
*
|
|
1043
959
|
* For root-level injection, use `provideFeedback(withAlerts())`.
|
|
1044
960
|
*
|
|
1045
|
-
* @category ui/feedback/alert
|
|
1046
|
-
* @docsKind primary
|
|
1047
961
|
* @wcag AA
|
|
1048
962
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alerter.service.ts
|
|
1049
|
-
* @since 0.
|
|
963
|
+
* @since 0.3.0
|
|
1050
964
|
* @relatedTo CngxAlertStack, CngxAlertOn, CngxToaster, CngxBanner
|
|
1051
965
|
*
|
|
1052
|
-
* <example-url
|
|
1053
|
-
* <example-url
|
|
1054
|
-
* <example-url
|
|
966
|
+
* <example-url>/#/ui/feedback/alert-stack/basic-stack</example-url>
|
|
967
|
+
* <example-url>/#/ui/feedback/alert-stack/dialog-use-case</example-url>
|
|
968
|
+
* <example-url>/#/ui/feedback/alert-stack/overflow-collapse</example-url>
|
|
1055
969
|
*/
|
|
1056
970
|
declare class CngxAlerter {
|
|
1057
971
|
private readonly destroyRef;
|
|
@@ -1068,12 +982,19 @@ declare class CngxAlerter {
|
|
|
1068
982
|
show(config: AlertConfig): AlertRef;
|
|
1069
983
|
/**
|
|
1070
984
|
* @internal - called by `CngxAlertStack` on hover/focus (WCAG 2.2.1).
|
|
1071
|
-
*
|
|
1072
|
-
* resumes only when the last
|
|
985
|
+
* Holds are sourced: hover and focus-within pause independently, and the
|
|
986
|
+
* timer resumes only when the last source releases.
|
|
1073
987
|
*/
|
|
1074
|
-
pauseTimer(id: number): void;
|
|
988
|
+
pauseTimer(id: number, source: TimerHoldSource): void;
|
|
1075
989
|
/** @internal - called by `CngxAlertStack` on pointer-leave/focus-out. */
|
|
1076
|
-
resumeTimer(id: number): void;
|
|
990
|
+
resumeTimer(id: number, source: TimerHoldSource): void;
|
|
991
|
+
/**
|
|
992
|
+
* @internal - drops several hold sources of an alert in one transition.
|
|
993
|
+
* `CngxAlertStack` calls it for an alert that leaves the rendered set or
|
|
994
|
+
* when the stack unmounts: the removed element never fires `pointerleave`
|
|
995
|
+
* or a reliable `focusout`.
|
|
996
|
+
*/
|
|
997
|
+
dropHolds(id: number, sources: readonly TimerHoldSource[]): void;
|
|
1077
998
|
/** Dismiss a single alert by id. */
|
|
1078
999
|
dismiss(id: number): void;
|
|
1079
1000
|
/** Dismiss all alerts (optionally filtered by scope). */
|
|
@@ -1131,16 +1052,15 @@ interface StackEntry {
|
|
|
1131
1052
|
* }
|
|
1132
1053
|
* ```
|
|
1133
1054
|
*
|
|
1134
|
-
* @category ui/feedback/alert
|
|
1135
|
-
* @docsKind primary
|
|
1136
1055
|
* @wcag AA
|
|
1137
1056
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alert-stack.ts
|
|
1138
|
-
* @since 0.
|
|
1057
|
+
* @since 0.3.0
|
|
1139
1058
|
* @relatedTo CngxAlerter, CngxAlert, CngxAlertOn
|
|
1140
1059
|
*
|
|
1141
|
-
* <example-url
|
|
1142
|
-
* <example-url
|
|
1143
|
-
* <example-url
|
|
1060
|
+
* <example-url>/#/ui/feedback/alert-stack/basic-stack</example-url>
|
|
1061
|
+
* <example-url>/#/ui/feedback/alert-stack/dialog-use-case</example-url>
|
|
1062
|
+
* <example-url>/#/ui/feedback/alert-stack/overflow-collapse</example-url>
|
|
1063
|
+
* @axis level organism
|
|
1144
1064
|
*/
|
|
1145
1065
|
declare class CngxAlertStack {
|
|
1146
1066
|
/** The scoped alerter instance - use to add/dismiss alerts programmatically. */
|
|
@@ -1232,11 +1152,9 @@ declare class CngxAlertStack {
|
|
|
1232
1152
|
* </button>
|
|
1233
1153
|
* ```
|
|
1234
1154
|
*
|
|
1235
|
-
* @category ui/feedback/alert
|
|
1236
|
-
* @docsKind primary
|
|
1237
1155
|
* @wcag AA
|
|
1238
1156
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/alert/alert-on.directive.ts
|
|
1239
|
-
* @since 0.
|
|
1157
|
+
* @since 0.3.0
|
|
1240
1158
|
* @relatedTo CngxAlertStack, CngxAlerter, CngxToastOn, CngxBannerOn
|
|
1241
1159
|
*/
|
|
1242
1160
|
declare class CngxAlertOn {
|
|
@@ -1271,8 +1189,6 @@ declare class CngxAlertOn {
|
|
|
1271
1189
|
|
|
1272
1190
|
/**
|
|
1273
1191
|
* Configuration for a system-level banner.
|
|
1274
|
-
*
|
|
1275
|
-
* @category ui/feedback/banner
|
|
1276
1192
|
*/
|
|
1277
1193
|
interface BannerConfig {
|
|
1278
1194
|
/** Banner message text (required). */
|
|
@@ -1294,8 +1210,6 @@ interface BannerConfig {
|
|
|
1294
1210
|
}
|
|
1295
1211
|
/**
|
|
1296
1212
|
* Handle to a displayed banner.
|
|
1297
|
-
*
|
|
1298
|
-
* @category ui/feedback/banner
|
|
1299
1213
|
*/
|
|
1300
1214
|
interface BannerRef {
|
|
1301
1215
|
/** Programmatically dismiss this banner. */
|
|
@@ -1305,8 +1219,6 @@ interface BannerRef {
|
|
|
1305
1219
|
}
|
|
1306
1220
|
/**
|
|
1307
1221
|
* @internal - tracked state for a single banner.
|
|
1308
|
-
*
|
|
1309
|
-
* @category ui/feedback/banner
|
|
1310
1222
|
*/
|
|
1311
1223
|
interface BannerState {
|
|
1312
1224
|
readonly id: string;
|
|
@@ -1339,16 +1251,14 @@ interface BannerState {
|
|
|
1339
1251
|
* });
|
|
1340
1252
|
* ```
|
|
1341
1253
|
*
|
|
1342
|
-
* @category ui/feedback/banner
|
|
1343
|
-
* @docsKind primary
|
|
1344
1254
|
* @wcag AA
|
|
1345
1255
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/banner/banner.service.ts
|
|
1346
|
-
* @since 0.
|
|
1256
|
+
* @since 0.3.0
|
|
1347
1257
|
* @relatedTo CngxBannerOutlet, CngxBannerTrigger, CngxBannerOn, CngxAlerter, CngxToaster
|
|
1348
1258
|
*
|
|
1349
|
-
* <example-url
|
|
1350
|
-
* <example-url
|
|
1351
|
-
* <example-url
|
|
1259
|
+
* <example-url>/#/ui/feedback/banner/async-action</example-url>
|
|
1260
|
+
* <example-url>/#/ui/feedback/banner/dedup-update</example-url>
|
|
1261
|
+
* <example-url>/#/ui/feedback/banner/system-banners</example-url>
|
|
1352
1262
|
*/
|
|
1353
1263
|
declare class CngxBanner {
|
|
1354
1264
|
private readonly destroyRef;
|
|
@@ -1387,16 +1297,14 @@ declare class CngxBanner {
|
|
|
1387
1297
|
* <router-outlet />
|
|
1388
1298
|
* ```
|
|
1389
1299
|
*
|
|
1390
|
-
* @category ui/feedback/banner
|
|
1391
|
-
* @docsKind primary
|
|
1392
1300
|
* @wcag AA
|
|
1393
1301
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/banner/banner-outlet.ts
|
|
1394
|
-
* @since 0.
|
|
1302
|
+
* @since 0.3.0
|
|
1395
1303
|
* @relatedTo CngxBanner, CngxBannerTrigger, CngxBannerOn
|
|
1396
1304
|
*
|
|
1397
|
-
* <example-url
|
|
1398
|
-
* <example-url
|
|
1399
|
-
* <example-url
|
|
1305
|
+
* <example-url>/#/ui/feedback/banner/async-action</example-url>
|
|
1306
|
+
* <example-url>/#/ui/feedback/banner/dedup-update</example-url>
|
|
1307
|
+
* <example-url>/#/ui/feedback/banner/system-banners</example-url>
|
|
1400
1308
|
*/
|
|
1401
1309
|
declare class CngxBannerOutlet {
|
|
1402
1310
|
protected readonly service: CngxBanner;
|
|
@@ -1439,14 +1347,10 @@ declare class CngxBannerOutlet {
|
|
|
1439
1347
|
* </div>
|
|
1440
1348
|
* ```
|
|
1441
1349
|
*
|
|
1442
|
-
* @category ui/feedback/banner
|
|
1443
|
-
* @docsKind primary
|
|
1444
1350
|
* @wcag AA
|
|
1445
1351
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/banner/banner-on.directive.ts
|
|
1446
|
-
* @since 0.
|
|
1352
|
+
* @since 0.3.0
|
|
1447
1353
|
* @relatedTo CngxBanner, CngxBannerOutlet, CngxBannerTrigger, CngxAlertOn, CngxToastOn
|
|
1448
|
-
*
|
|
1449
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
1450
1354
|
*/
|
|
1451
1355
|
declare class CngxBannerOn {
|
|
1452
1356
|
private readonly bannerService;
|
|
@@ -1504,11 +1408,9 @@ declare class CngxBannerOn {
|
|
|
1504
1408
|
* [actionHandler]="extendSession" />
|
|
1505
1409
|
* ```
|
|
1506
1410
|
*
|
|
1507
|
-
* @category ui/feedback/banner
|
|
1508
|
-
* @docsKind primary
|
|
1509
1411
|
* @wcag AA
|
|
1510
1412
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/banner/banner-trigger.ts
|
|
1511
|
-
* @since 0.
|
|
1413
|
+
* @since 0.3.0
|
|
1512
1414
|
* @relatedTo CngxBanner, CngxBannerOutlet, CngxBannerOn
|
|
1513
1415
|
*/
|
|
1514
1416
|
declare class CngxBannerTrigger {
|
|
@@ -1542,8 +1444,6 @@ declare class CngxBannerTrigger {
|
|
|
1542
1444
|
|
|
1543
1445
|
/**
|
|
1544
1446
|
* Configuration for a single toast.
|
|
1545
|
-
*
|
|
1546
|
-
* @category ui/feedback/toast
|
|
1547
1447
|
*/
|
|
1548
1448
|
interface ToastConfig {
|
|
1549
1449
|
/** Toast message text. Used as sole text when `title` is not set. */
|
|
@@ -1562,9 +1462,21 @@ interface ToastConfig {
|
|
|
1562
1462
|
description?: string;
|
|
1563
1463
|
/** Visual severity - determines icon, color, and ARIA role. */
|
|
1564
1464
|
severity?: AlertSeverity;
|
|
1565
|
-
/**
|
|
1465
|
+
/**
|
|
1466
|
+
* Auto-dismiss duration in ms, or `'persistent'` for manual dismiss only.
|
|
1467
|
+
* Defaults: `'persistent'` for errors, the action duration (10000 ms) for
|
|
1468
|
+
* toasts with an `action`, the default duration (5000 ms) otherwise.
|
|
1469
|
+
*/
|
|
1566
1470
|
duration?: number | 'persistent';
|
|
1567
|
-
/**
|
|
1471
|
+
/**
|
|
1472
|
+
* Optional action button inside the toast. A toast with an action is never
|
|
1473
|
+
* merged by dedup: each `show()` gets its own toast, so every handler stays
|
|
1474
|
+
* reachable. Without an explicit `duration` it stays up for the action
|
|
1475
|
+
* duration (10000 ms, `withToasts({ actionDuration })`) instead of the
|
|
1476
|
+
* default, so users can reach the button. Name the affected object in the
|
|
1477
|
+
* message ("Item 3 deleted", not "Item deleted") so the user knows what
|
|
1478
|
+
* the action reverts.
|
|
1479
|
+
*/
|
|
1568
1480
|
action?: {
|
|
1569
1481
|
label: string;
|
|
1570
1482
|
handler: () => void;
|
|
@@ -1592,8 +1504,6 @@ interface ToastConfig {
|
|
|
1592
1504
|
}
|
|
1593
1505
|
/**
|
|
1594
1506
|
* Handle to a displayed toast - allows programmatic dismiss.
|
|
1595
|
-
*
|
|
1596
|
-
* @category ui/feedback/toast
|
|
1597
1507
|
*/
|
|
1598
1508
|
interface ToastRef {
|
|
1599
1509
|
/** Programmatically dismiss this toast. */
|
|
@@ -1604,8 +1514,6 @@ interface ToastRef {
|
|
|
1604
1514
|
/**
|
|
1605
1515
|
* Tracked state for a single toast - the element type of the public
|
|
1606
1516
|
* `CngxToaster.toasts` signal. Immutable per slot; treat as read-only.
|
|
1607
|
-
*
|
|
1608
|
-
* @category ui/feedback/toast
|
|
1609
1517
|
*/
|
|
1610
1518
|
interface ToastState {
|
|
1611
1519
|
readonly id: number;
|
|
@@ -1629,18 +1537,16 @@ interface ToastState {
|
|
|
1629
1537
|
*
|
|
1630
1538
|
* Manages the toast stack as a signal array. `CngxToastOutlet` reads it reactively.
|
|
1631
1539
|
*
|
|
1632
|
-
* @category ui/feedback/toast
|
|
1633
|
-
* @docsKind primary
|
|
1634
1540
|
* @wcag AA
|
|
1635
1541
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/toast/toast.service.ts
|
|
1636
|
-
* @since 0.
|
|
1542
|
+
* @since 0.3.0
|
|
1637
1543
|
* @relatedTo CngxToastOutlet, CngxToastOn, CngxToast, CngxAlerter
|
|
1638
1544
|
*
|
|
1639
|
-
* <example-url
|
|
1640
|
-
* <example-url
|
|
1641
|
-
* <example-url
|
|
1642
|
-
* <example-url
|
|
1643
|
-
* <example-url
|
|
1545
|
+
* <example-url>/#/ui/feedback/toast/custom-component-body</example-url>
|
|
1546
|
+
* <example-url>/#/ui/feedback/toast/declarative-cngx-toast</example-url>
|
|
1547
|
+
* <example-url>/#/ui/feedback/toast/programmatic-cngxtoaster</example-url>
|
|
1548
|
+
* <example-url>/#/ui/feedback/toast/state-bridge-cngxtoaston</example-url>
|
|
1549
|
+
* <example-url>/#/ui/feedback/toast/title-description</example-url>
|
|
1644
1550
|
*/
|
|
1645
1551
|
declare class CngxToaster {
|
|
1646
1552
|
private readonly destroyRef;
|
|
@@ -1650,6 +1556,14 @@ declare class CngxToaster {
|
|
|
1650
1556
|
readonly toasts: _angular_core.WritableSignal<readonly ToastState[]>;
|
|
1651
1557
|
/** Default duration for non-error toasts - configure via `withToasts({ defaultDuration })`. */
|
|
1652
1558
|
private readonly defaultDuration;
|
|
1559
|
+
/**
|
|
1560
|
+
* Default duration for non-error toasts that carry an `action` - configure
|
|
1561
|
+
* via `withToasts({ actionDuration })`. Longer than `defaultDuration`
|
|
1562
|
+
* because keyboard and screen reader users need time to reach the action
|
|
1563
|
+
* button before the toast leaves (WCAG 2.2.1); hover and focus pause the
|
|
1564
|
+
* timer on top of that.
|
|
1565
|
+
*/
|
|
1566
|
+
private readonly actionDuration;
|
|
1653
1567
|
/** Dedup window in ms - configure via `withToasts({ dedupWindow })`. */
|
|
1654
1568
|
private readonly dedupWindow;
|
|
1655
1569
|
/** Auto-dismiss timers keyed by toast id - not part of the public state shape. */
|
|
@@ -1658,17 +1572,32 @@ declare class CngxToaster {
|
|
|
1658
1572
|
/** Show a toast. Returns a ref for programmatic control. */
|
|
1659
1573
|
show(config: ToastConfig): ToastRef;
|
|
1660
1574
|
/**
|
|
1661
|
-
* @internal - called by toast-outlet on hover/focus (WCAG 2.2.1)
|
|
1662
|
-
*
|
|
1663
|
-
*
|
|
1575
|
+
* @internal - called by toast-outlet on hover/focus (WCAG 2.2.1) and for
|
|
1576
|
+
* toasts kept out of view by `maxVisible`. Holds are sourced: hover,
|
|
1577
|
+
* focus-within and the queue pause independently, and the timer resumes
|
|
1578
|
+
* only when the last source releases.
|
|
1579
|
+
*/
|
|
1580
|
+
pauseTimer(id: number, source: TimerHoldSource): void;
|
|
1581
|
+
/**
|
|
1582
|
+
* @internal - current countdown segment per timed toast id. `CngxToastOutlet`
|
|
1583
|
+
* is the only reader: it derives the `data-timer` state, the timer custom
|
|
1584
|
+
* properties and the serial-keyed timer element from it. Written in a
|
|
1585
|
+
* microtask flush, never inside a timer call.
|
|
1664
1586
|
*/
|
|
1665
|
-
|
|
1666
|
-
/** @internal - called by toast-outlet on mouse-leave/focus-out. */
|
|
1667
|
-
resumeTimer(id: number): void;
|
|
1587
|
+
readonly timerSegments: _angular_core.Signal<ReadonlyMap<number, _cngx_ui_feedback.TimerSegment>>;
|
|
1588
|
+
/** @internal - called by toast-outlet on mouse-leave/focus-out and on reveal. */
|
|
1589
|
+
resumeTimer(id: number, source: TimerHoldSource): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* @internal - drops several hold sources of a toast in one transition. The
|
|
1592
|
+
* outlet calls it for a toast that leaves the visible set, whose removed
|
|
1593
|
+
* element never fires `pointerleave` or a reliable `focusout`.
|
|
1594
|
+
*/
|
|
1595
|
+
dropHolds(id: number, sources: readonly TimerHoldSource[]): void;
|
|
1668
1596
|
/** Dismiss a toast by id. */
|
|
1669
1597
|
dismiss(id: number): void;
|
|
1670
1598
|
/** Dismiss all toasts. */
|
|
1671
1599
|
dismissAll(): void;
|
|
1600
|
+
private resolveDefaultDuration;
|
|
1672
1601
|
private startTimer;
|
|
1673
1602
|
private clearTimer;
|
|
1674
1603
|
private createRef;
|
|
@@ -1683,16 +1612,11 @@ declare class CngxToaster {
|
|
|
1683
1612
|
* providers: [provideToasts()],
|
|
1684
1613
|
* });
|
|
1685
1614
|
* ```
|
|
1686
|
-
*
|
|
1687
|
-
* @category ui/feedback/toast
|
|
1688
|
-
*
|
|
1689
1615
|
*/
|
|
1690
1616
|
declare function provideToasts(): EnvironmentProviders;
|
|
1691
1617
|
|
|
1692
1618
|
/**
|
|
1693
1619
|
* Position for the toast stack.
|
|
1694
|
-
*
|
|
1695
|
-
* @category ui/feedback/toast
|
|
1696
1620
|
*/
|
|
1697
1621
|
type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | 'bottom-center' | 'bottom-end';
|
|
1698
1622
|
/**
|
|
@@ -1711,18 +1635,16 @@ type ToastPosition = 'top-start' | 'top-center' | 'top-end' | 'bottom-start' | '
|
|
|
1711
1635
|
*
|
|
1712
1636
|
* @playground Async state bridges ./examples/bridges/bridges-example.component.ts
|
|
1713
1637
|
*
|
|
1714
|
-
* @category ui/feedback/toast
|
|
1715
|
-
* @docsKind primary
|
|
1716
1638
|
* @wcag AA
|
|
1717
1639
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/toast/toast-outlet.ts
|
|
1718
|
-
* @since 0.
|
|
1640
|
+
* @since 0.3.0
|
|
1719
1641
|
* @relatedTo CngxToaster, CngxToast, CngxToastOn
|
|
1720
1642
|
*
|
|
1721
|
-
* <example-url
|
|
1722
|
-
* <example-url
|
|
1723
|
-
* <example-url
|
|
1724
|
-
* <example-url
|
|
1725
|
-
* <example-url
|
|
1643
|
+
* <example-url>/#/ui/feedback/toast/custom-component-body</example-url>
|
|
1644
|
+
* <example-url>/#/ui/feedback/toast/declarative-cngx-toast</example-url>
|
|
1645
|
+
* <example-url>/#/ui/feedback/toast/programmatic-cngxtoaster</example-url>
|
|
1646
|
+
* <example-url>/#/ui/feedback/toast/state-bridge-cngxtoaston</example-url>
|
|
1647
|
+
* <example-url>/#/ui/feedback/toast/title-description</example-url>
|
|
1726
1648
|
*/
|
|
1727
1649
|
declare class CngxToastOutlet {
|
|
1728
1650
|
protected readonly service: CngxToaster;
|
|
@@ -1743,7 +1665,11 @@ declare class CngxToastOutlet {
|
|
|
1743
1665
|
protected readonly regionLabel: _angular_core.Signal<string>;
|
|
1744
1666
|
/** Stack position. */
|
|
1745
1667
|
readonly position: _angular_core.InputSignal<ToastPosition>;
|
|
1746
|
-
/**
|
|
1668
|
+
/**
|
|
1669
|
+
* Maximum visible toasts. Toasts beyond it wait, with their timer held,
|
|
1670
|
+
* until a visible one leaves; when every visible toast is persistent,
|
|
1671
|
+
* queued toasts keep their timer running.
|
|
1672
|
+
*/
|
|
1747
1673
|
readonly maxVisible: _angular_core.InputSignal<number>;
|
|
1748
1674
|
/** Insert new toasts at start or end of the stack. */
|
|
1749
1675
|
readonly insertPosition: _angular_core.InputSignal<"end" | "start">;
|
|
@@ -1751,6 +1677,26 @@ declare class CngxToastOutlet {
|
|
|
1751
1677
|
protected readonly positionClass: _angular_core.Signal<string>;
|
|
1752
1678
|
/** @internal - slice to maxVisible, respecting insert position. ToastState is immutable per slot. */
|
|
1753
1679
|
protected readonly visibleToasts: _angular_core.Signal<readonly ToastState[]>;
|
|
1680
|
+
/**
|
|
1681
|
+
* @internal - the toaster's countdown segments, the only timer source of the
|
|
1682
|
+
* view. A toast is timed exactly when it has a segment: a dedup restart that
|
|
1683
|
+
* switches between timed and persistent never leaves a stale config behind.
|
|
1684
|
+
*/
|
|
1685
|
+
protected readonly segments: _angular_core.Signal<ReadonlyMap<number, TimerSegment>>;
|
|
1686
|
+
/**
|
|
1687
|
+
* @internal - ids kept out of view by `maxVisible`, and whether their timers
|
|
1688
|
+
* are held. Not held while no visible toast is timed: a held queue would
|
|
1689
|
+
* never move. `running` reads the hold back from the registry segments, so a
|
|
1690
|
+
* hidden toast whose timer (re)starts without the queue hold - a dedup repeat
|
|
1691
|
+
* turning a persistent toast timed, or a restart after `clear()` - is held
|
|
1692
|
+
* again instead of expiring unseen.
|
|
1693
|
+
*/
|
|
1694
|
+
private readonly queue;
|
|
1695
|
+
constructor();
|
|
1696
|
+
/** @internal - `data-timer` value: absent without a segment. */
|
|
1697
|
+
protected timerState(segment: TimerSegment | null): 'running' | 'paused' | null;
|
|
1698
|
+
/** @internal - negative elapsed time of the segment, the animation start offset. */
|
|
1699
|
+
protected timerOffset(segment: TimerSegment | null): number | null;
|
|
1754
1700
|
/** @internal - resolve icon component from global config or null. */
|
|
1755
1701
|
protected iconFor(toast: ToastState): _angular_core.Type<unknown> | null;
|
|
1756
1702
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxToastOutlet, never>;
|
|
@@ -1784,19 +1730,17 @@ declare class CngxToastOutlet {
|
|
|
1784
1730
|
* </form>
|
|
1785
1731
|
* ```
|
|
1786
1732
|
*
|
|
1787
|
-
* @category ui/feedback/toast
|
|
1788
|
-
* @docsKind primary
|
|
1789
1733
|
* @wcag AA
|
|
1790
1734
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/toast/toast-on.directive.ts
|
|
1791
|
-
* @since 0.
|
|
1735
|
+
* @since 0.3.0
|
|
1792
1736
|
* @relatedTo CngxToaster, CngxToastOutlet, CngxAlertOn, CngxBannerOn
|
|
1793
1737
|
*
|
|
1794
|
-
* <example-url
|
|
1795
|
-
* <example-url
|
|
1796
|
-
* <example-url
|
|
1797
|
-
* <example-url
|
|
1798
|
-
* <example-url
|
|
1799
|
-
*
|
|
1738
|
+
* <example-url>/#/ui/feedback/toast/custom-component-body</example-url>
|
|
1739
|
+
* <example-url>/#/ui/feedback/toast/declarative-cngx-toast</example-url>
|
|
1740
|
+
* <example-url>/#/ui/feedback/toast/programmatic-cngxtoaster</example-url>
|
|
1741
|
+
* <example-url>/#/ui/feedback/toast/state-bridge-cngxtoaston</example-url>
|
|
1742
|
+
* <example-url>/#/ui/feedback/toast/title-description</example-url>
|
|
1743
|
+
* @axis level organism
|
|
1800
1744
|
*/
|
|
1801
1745
|
declare class CngxToastOn {
|
|
1802
1746
|
private readonly toast;
|
|
@@ -1823,15 +1767,47 @@ declare class CngxToastOn {
|
|
|
1823
1767
|
* nothing in production).
|
|
1824
1768
|
*/
|
|
1825
1769
|
readonly toastErrorDetail: _angular_core.InputSignal<boolean>;
|
|
1826
|
-
/**
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1770
|
+
/**
|
|
1771
|
+
* Duration for success toasts in ms. Unbound, `CngxToaster` resolves it:
|
|
1772
|
+
* `withToasts({ defaultDuration })`, else 5000 ms.
|
|
1773
|
+
*/
|
|
1774
|
+
readonly toastSuccessDuration: _angular_core.InputSignal<number | undefined>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Duration for error toasts; `'persistent'` means manual dismiss only.
|
|
1777
|
+
* Unbound, `CngxToaster` resolves it (an error toast stays until dismissed).
|
|
1778
|
+
*/
|
|
1779
|
+
readonly toastErrorDuration: _angular_core.InputSignal<number | "persistent" | undefined>;
|
|
1830
1780
|
constructor();
|
|
1831
1781
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxToastOn, never>;
|
|
1832
1782
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxToastOn, "[cngxToastOn]", never, { "state": { "alias": "cngxToastOn"; "required": false; "isSignal": true; }; "toastSuccess": { "alias": "toastSuccess"; "required": false; "isSignal": true; }; "toastError": { "alias": "toastError"; "required": false; "isSignal": true; }; "toastErrorDetail": { "alias": "toastErrorDetail"; "required": false; "isSignal": true; }; "toastSuccessDuration": { "alias": "toastSuccessDuration"; "required": false; "isSignal": true; }; "toastErrorDuration": { "alias": "toastErrorDuration"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1833
1783
|
}
|
|
1834
1784
|
|
|
1785
|
+
/**
|
|
1786
|
+
* The toast inputs `CngxToastOn` and `CngxActionToast` share, read as
|
|
1787
|
+
* signals by `resolveOutcomeToast`.
|
|
1788
|
+
*
|
|
1789
|
+
* @internal
|
|
1790
|
+
*/
|
|
1791
|
+
interface CngxOutcomeToastInputs {
|
|
1792
|
+
readonly toastSuccess: () => string | undefined;
|
|
1793
|
+
readonly toastError: () => string | undefined;
|
|
1794
|
+
readonly toastErrorDetail: () => boolean;
|
|
1795
|
+
readonly toastSuccessDuration: () => number | undefined;
|
|
1796
|
+
readonly toastErrorDuration: () => number | 'persistent' | undefined;
|
|
1797
|
+
}
|
|
1798
|
+
/**
|
|
1799
|
+
* The toast one `success` / `error` outcome shows, or `undefined` when the
|
|
1800
|
+
* outcome has no message. The error toast appends the mapped error detail
|
|
1801
|
+
* through `errorWithDetail` when `toastErrorDetail` is set. An unbound
|
|
1802
|
+
* duration stays `undefined` so `CngxToaster` resolves it.
|
|
1803
|
+
*
|
|
1804
|
+
* Only the show path is shared: `CngxToastOn` fires on a state transition,
|
|
1805
|
+
* `CngxActionToast` once per action outcome, and each keeps its trigger.
|
|
1806
|
+
*
|
|
1807
|
+
* @internal
|
|
1808
|
+
*/
|
|
1809
|
+
declare function resolveOutcomeToast(inputs: CngxOutcomeToastInputs, status: 'success' | 'error', error: unknown, detailOf: CngxErrorDetailFn, i18n: Pick<CngxFeedbackI18n, 'errorWithDetail'>): ToastConfig | undefined;
|
|
1810
|
+
|
|
1835
1811
|
/**
|
|
1836
1812
|
* Declarative toast - renders nothing at its position, pushes into the global `CngxToastOutlet`.
|
|
1837
1813
|
*
|
|
@@ -1863,18 +1839,17 @@ declare class CngxToastOn {
|
|
|
1863
1839
|
* <cngx-toast severity="error" message="Save failed" [when]="saveState.status() === 'error'" />
|
|
1864
1840
|
* ```
|
|
1865
1841
|
*
|
|
1866
|
-
* @category ui/feedback/toast
|
|
1867
|
-
* @docsKind primary
|
|
1868
1842
|
* @wcag AA
|
|
1869
1843
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/toast/toast.component.ts
|
|
1870
|
-
* @since 0.
|
|
1844
|
+
* @since 0.3.0
|
|
1871
1845
|
* @relatedTo CngxToaster, CngxToastOutlet, CngxToastOn
|
|
1872
1846
|
*
|
|
1873
|
-
* <example-url
|
|
1874
|
-
* <example-url
|
|
1875
|
-
* <example-url
|
|
1876
|
-
* <example-url
|
|
1877
|
-
* <example-url
|
|
1847
|
+
* <example-url>/#/ui/feedback/toast/custom-component-body</example-url>
|
|
1848
|
+
* <example-url>/#/ui/feedback/toast/declarative-cngx-toast</example-url>
|
|
1849
|
+
* <example-url>/#/ui/feedback/toast/programmatic-cngxtoaster</example-url>
|
|
1850
|
+
* <example-url>/#/ui/feedback/toast/state-bridge-cngxtoaston</example-url>
|
|
1851
|
+
* <example-url>/#/ui/feedback/toast/title-description</example-url>
|
|
1852
|
+
* @axis level organism
|
|
1878
1853
|
*/
|
|
1879
1854
|
declare class CngxToast {
|
|
1880
1855
|
private readonly toaster;
|
|
@@ -1891,6 +1866,12 @@ declare class CngxToast {
|
|
|
1891
1866
|
readonly dismissible: _angular_core.InputSignal<boolean>;
|
|
1892
1867
|
/** Action button config. */
|
|
1893
1868
|
readonly actionLabel: _angular_core.InputSignal<string | undefined>;
|
|
1869
|
+
/**
|
|
1870
|
+
* Callback run, without arguments, when the toast's action button is clicked. The button
|
|
1871
|
+
* renders only when `actionLabel` is set as well, and the click does not dismiss the toast.
|
|
1872
|
+
* The label and handler are read when the toast is shown, so later changes do not update a
|
|
1873
|
+
* toast that is already visible.
|
|
1874
|
+
*/
|
|
1894
1875
|
readonly actionHandler: _angular_core.InputSignal<(() => void) | undefined>;
|
|
1895
1876
|
/** Emitted when the shown toast is dismissed (auto, manual, or falling edge). */
|
|
1896
1877
|
readonly dismissed: _angular_core.OutputEmitterRef<void>;
|
|
@@ -1920,9 +1901,8 @@ declare class CngxToast {
|
|
|
1920
1901
|
/**
|
|
1921
1902
|
* Marks the skeleton template inside `cngx-async-container`.
|
|
1922
1903
|
*
|
|
1923
|
-
* @category ui/feedback/async
|
|
1924
1904
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/async-container/async-container.ts
|
|
1925
|
-
* @since 0.
|
|
1905
|
+
* @since 0.3.0
|
|
1926
1906
|
*/
|
|
1927
1907
|
declare class CngxAsyncSkeletonTpl {
|
|
1928
1908
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -1933,9 +1913,8 @@ declare class CngxAsyncSkeletonTpl {
|
|
|
1933
1913
|
* Marks the content template inside `cngx-async-container`.
|
|
1934
1914
|
* Context: `{ $implicit: T }` - use `let-data` to access.
|
|
1935
1915
|
*
|
|
1936
|
-
* @category ui/feedback/async
|
|
1937
1916
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/async-container/async-container.ts
|
|
1938
|
-
* @since 0.
|
|
1917
|
+
* @since 0.3.0
|
|
1939
1918
|
*/
|
|
1940
1919
|
declare class CngxAsyncContentTpl<T> {
|
|
1941
1920
|
readonly templateRef: TemplateRef<{
|
|
@@ -1950,9 +1929,8 @@ declare class CngxAsyncContentTpl<T> {
|
|
|
1950
1929
|
/**
|
|
1951
1930
|
* Marks the empty-state template inside `cngx-async-container`.
|
|
1952
1931
|
*
|
|
1953
|
-
* @category ui/feedback/async
|
|
1954
1932
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/async-container/async-container.ts
|
|
1955
|
-
* @since 0.
|
|
1933
|
+
* @since 0.3.0
|
|
1956
1934
|
*/
|
|
1957
1935
|
declare class CngxAsyncEmptyTpl {
|
|
1958
1936
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -1963,9 +1941,8 @@ declare class CngxAsyncEmptyTpl {
|
|
|
1963
1941
|
* Marks the error template inside `cngx-async-container`.
|
|
1964
1942
|
* Context: `{ $implicit: unknown }` - use `let-err` to access.
|
|
1965
1943
|
*
|
|
1966
|
-
* @category ui/feedback/async
|
|
1967
1944
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/async-container/async-container.ts
|
|
1968
|
-
* @since 0.
|
|
1945
|
+
* @since 0.3.0
|
|
1969
1946
|
*/
|
|
1970
1947
|
declare class CngxAsyncErrorTpl {
|
|
1971
1948
|
readonly templateRef: TemplateRef<{
|
|
@@ -2003,24 +1980,22 @@ declare class CngxAsyncErrorTpl {
|
|
|
2003
1980
|
*
|
|
2004
1981
|
* @playground Data flow ./examples/data-flow/data-flow-example.component.ts
|
|
2005
1982
|
*
|
|
2006
|
-
* @category ui/feedback/async
|
|
2007
|
-
* @docsKind primary
|
|
2008
1983
|
* @wcag AA
|
|
2009
1984
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/feedback/async-container/async-container.ts
|
|
2010
|
-
* @since 0.
|
|
1985
|
+
* @since 0.3.0
|
|
2011
1986
|
* @relatedTo CngxLoadingIndicator, CngxLoadingOverlay, CngxAlert, CngxToaster
|
|
2012
1987
|
* @slot cngxAsyncContent Rendered on success; gets the resolved value.
|
|
2013
1988
|
* @slot cngxAsyncSkeleton Rendered during the first load.
|
|
2014
1989
|
* @slot cngxAsyncEmpty Rendered when the value resolves to nothing.
|
|
2015
1990
|
* @slot cngxAsyncError Rendered on failure; gets the error as `$implicit` (use `let-err`).
|
|
2016
1991
|
*
|
|
2017
|
-
* <example-url
|
|
2018
|
-
* <example-url
|
|
2019
|
-
* <example-url
|
|
2020
|
-
* <example-url
|
|
2021
|
-
* <example-url
|
|
2022
|
-
* <example-url
|
|
2023
|
-
*
|
|
1992
|
+
* <example-url>/#/ui/feedback/async-container/cngx-async-container-full-control-toast</example-url>
|
|
1993
|
+
* <example-url>/#/ui/feedback/async-container/cngxasync-one-line</example-url>
|
|
1994
|
+
* <example-url>/#/ui/feedback/async-container/cngxasync-with-custom-templates</example-url>
|
|
1995
|
+
* <example-url>/#/ui/feedback/async-container/composition-overlay-container-toast</example-url>
|
|
1996
|
+
* <example-url>/#/ui/feedback/async-container/createasyncstate-mutation</example-url>
|
|
1997
|
+
* <example-url>/#/ui/feedback/async-container/injectasyncstate-reactive-query</example-url>
|
|
1998
|
+
* @axis level molecule
|
|
2024
1999
|
*/
|
|
2025
2000
|
declare class CngxAsyncContainer<T> {
|
|
2026
2001
|
private readonly toaster;
|
|
@@ -2085,5 +2060,5 @@ declare class CngxAsyncContainer<T> {
|
|
|
2085
2060
|
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>;
|
|
2086
2061
|
}
|
|
2087
2062
|
|
|
2088
|
-
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,
|
|
2089
|
-
export type { AlertConfig, AlertRef, AlertSeverity, AlertState, AlertVisibilityPhase, BannerConfig, BannerRef, BannerState, CngxErrorDetailFn, CngxFeedbackAnnouncements, CngxFeedbackAnnouncementsLanguage, CngxFeedbackI18n, CngxFeedbackI18nOverrides, CngxFeedbackLanguageSection, FeedbackConfig, FeedbackFeature, LoadingIndicatorVariant, ProgressVariant, ToastConfig, ToastPosition, ToastRef, ToastState };
|
|
2063
|
+
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, resolveOutcomeToast, withAlertIcons, withAlerts, withBanners, withCloseIcon, withErrorDetail, withFeedbackI18nLabels, withSpinnerTemplate, withToasts };
|
|
2064
|
+
export type { AlertConfig, AlertRef, AlertSeverity, AlertState, AlertVisibilityPhase, BannerConfig, BannerRef, BannerState, CngxErrorDetailFn, CngxFeedbackAnnouncements, CngxFeedbackAnnouncementsLanguage, CngxFeedbackI18n, CngxFeedbackI18nOverrides, CngxFeedbackLanguageSection, CngxOutcomeToastInputs, FeedbackConfig, FeedbackFeature, LoadingIndicatorVariant, ProgressVariant, TimerHoldSource, TimerSegment, ToastConfig, ToastPosition, ToastRef, ToastState };
|