@cngx/ui 0.1.0-rc.6 → 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 +112 -1
- package/a11y/README.md +87 -0
- 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/context-menu/README.md +98 -0
- package/data-grid-accordion/README.md +103 -2
- package/feedback/README.md +42 -0
- package/fesm2022/cngx-ui-a11y.mjs +452 -0
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
- package/fesm2022/cngx-ui-accordion.mjs +116 -38
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +115 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
- package/fesm2022/cngx-ui-collection.mjs +207 -66
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
- package/fesm2022/cngx-ui-context-menu.mjs +857 -0
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
- 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 +1095 -521
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +18 -9
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
- 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 +370 -203
- 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 +501 -182
- 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 +22 -21
- 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 +718 -0
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +217 -76
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +40 -19
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +548 -0
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
- package/fesm2022/cngx-ui-toc.mjs +748 -0
- package/fesm2022/cngx-ui-toc.mjs.map +1 -0
- package/fesm2022/cngx-ui.mjs +16 -21
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-accordion/README.md +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/styles/mat-tabs.css +29 -27
- package/overlay/README.md +9 -4
- package/package.json +32 -1
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/skeleton/README.md +2 -0
- package/speak/README.md +3 -2
- package/stepper/README.md +15 -3
- package/timeline/README.md +350 -0
- package/toc/README.md +186 -0
- package/types/cngx-ui-a11y.d.ts +394 -0
- package/types/cngx-ui-accordion.d.ts +100 -30
- package/types/cngx-ui-action-button.d.ts +47 -3
- package/types/cngx-ui-breadcrumb.d.ts +159 -58
- package/types/cngx-ui-chart-panel.d.ts +382 -0
- package/types/cngx-ui-collection.d.ts +159 -58
- package/types/cngx-ui-command-palette.d.ts +565 -0
- package/types/cngx-ui-context-menu.d.ts +559 -0
- package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +664 -73
- package/types/cngx-ui-layout.d.ts +8 -3
- package/types/cngx-ui-mat-accordion.d.ts +32 -4
- 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 +218 -23
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +416 -132
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +18 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +411 -0
- package/types/cngx-ui-stepper.d.ts +81 -29
- package/types/cngx-ui-tabs.d.ts +22 -6
- package/types/cngx-ui-timeline.d.ts +495 -0
- package/types/cngx-ui-toc.d.ts +581 -0
- package/types/cngx-ui.d.ts +8 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _cngx_common_interactive from '@cngx/common/interactive';
|
|
2
3
|
import { AsyncAction, CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';
|
|
3
4
|
import { CngxAsyncState } from '@cngx/core/utils';
|
|
4
5
|
|
|
@@ -57,13 +58,19 @@ type ActionButtonVariant = 'primary' | 'secondary' | 'ghost';
|
|
|
57
58
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts
|
|
58
59
|
* @since 0.1.0
|
|
59
60
|
* @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster
|
|
61
|
+
* @slot cngxPending Replaces the label while the action runs.
|
|
62
|
+
* @slot cngxSucceeded Replaces the label after the action succeeds.
|
|
63
|
+
* @slot cngxFailed Replaces the label when the action fails; gets the error.
|
|
60
64
|
* <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>
|
|
61
65
|
* <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>
|
|
62
66
|
* <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>
|
|
63
67
|
*/
|
|
64
68
|
declare class CngxActionButton {
|
|
65
69
|
private readonly toaster;
|
|
70
|
+
private readonly errorDetail;
|
|
71
|
+
private readonly feedbackI18n;
|
|
66
72
|
private readonly externalToastOn;
|
|
73
|
+
protected readonly i18n: _angular_core.Signal<_cngx_common_interactive.CngxInteractiveI18n>;
|
|
67
74
|
/** The async action to execute on click. */
|
|
68
75
|
readonly action: _angular_core.InputSignal<AsyncAction>;
|
|
69
76
|
/** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */
|
|
@@ -74,9 +81,15 @@ declare class CngxActionButton {
|
|
|
74
81
|
readonly type: _angular_core.InputSignal<"button" | "submit" | "reset">;
|
|
75
82
|
/** Visual variant - sets CSS class `cngx-action-button--{variant}`. */
|
|
76
83
|
readonly variant: _angular_core.InputSignal<ActionButtonVariant>;
|
|
77
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* SR announcement on success. Falls back to `succeededLabel`, then
|
|
86
|
+
* `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.
|
|
87
|
+
*/
|
|
78
88
|
readonly succeededAnnouncement: _angular_core.InputSignal<string | undefined>;
|
|
79
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* SR announcement on failure. Falls back to `failedLabel`, then
|
|
91
|
+
* `CNGX_INTERACTIVE_I18N.asyncClickFailed`.
|
|
92
|
+
*/
|
|
80
93
|
readonly failedAnnouncement: _angular_core.InputSignal<string | undefined>;
|
|
81
94
|
/** Fallback text while pending (when no `cngxPending` template is projected). */
|
|
82
95
|
readonly pendingLabel: _angular_core.InputSignal<string | undefined>;
|
|
@@ -89,6 +102,13 @@ declare class CngxActionButton {
|
|
|
89
102
|
* When set, the button's status display follows `externalState.status()`.
|
|
90
103
|
*/
|
|
91
104
|
readonly externalState: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
105
|
+
/**
|
|
106
|
+
* Reason the button is disabled, announced to screen readers while
|
|
107
|
+
* `[enabled]` is `false`. Rendered into a hidden region and referenced by
|
|
108
|
+
* `aria-describedby` only while disabled - an enabled button never carries
|
|
109
|
+
* the reference. No effect when `[enabled]` is `true`.
|
|
110
|
+
*/
|
|
111
|
+
readonly disabledReason: _angular_core.InputSignal<string | undefined>;
|
|
92
112
|
/**
|
|
93
113
|
* Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`
|
|
94
114
|
* or `provideToasts()`). Silently ignored when toaster is not provided.
|
|
@@ -116,6 +136,30 @@ declare class CngxActionButton {
|
|
|
116
136
|
protected readonly effectiveStatus: _angular_core.Signal<"idle" | "pending" | "success" | "error" | "loading" | "refreshing">;
|
|
117
137
|
/** @internal - effective error value from external state or inner directive. */
|
|
118
138
|
protected readonly effectiveError: _angular_core.Signal<unknown>;
|
|
139
|
+
/** @internal - busy while the effective status (inner or external) is pending. */
|
|
140
|
+
protected readonly effectiveBusy: _angular_core.Signal<boolean>;
|
|
141
|
+
/**
|
|
142
|
+
* @internal - what the inner `CngxAsyncClick` may act on: only when the
|
|
143
|
+
* consumer enabled it AND no effective operation is in flight. Feeding this
|
|
144
|
+
* as `[enabled]` routes external-pending through the atom's own click guard,
|
|
145
|
+
* so a click cannot start a second run while an external state is pending.
|
|
146
|
+
*/
|
|
147
|
+
protected readonly clickEnabled: _angular_core.Signal<boolean>;
|
|
148
|
+
/**
|
|
149
|
+
* @internal - SR announcement derived from the effective status, so an
|
|
150
|
+
* external success/error settles audibly too (the inner directive only
|
|
151
|
+
* knows its own runs). Mirrors the label fallback chain the template uses.
|
|
152
|
+
*/
|
|
153
|
+
protected readonly effectiveAnnouncement: _angular_core.Signal<string>;
|
|
154
|
+
/** @internal - stable id for the disabled-reason region. */
|
|
155
|
+
protected readonly reasonId: string;
|
|
156
|
+
/**
|
|
157
|
+
* @internal - reference the reason region only while actually disabled by
|
|
158
|
+
* intent and a reason exists. accname traverses a directly referenced hidden
|
|
159
|
+
* node, so the id must be gated on the state it describes rather than left
|
|
160
|
+
* permanently pointing at a hidden region.
|
|
161
|
+
*/
|
|
162
|
+
protected readonly describedBy: _angular_core.Signal<string | null>;
|
|
119
163
|
private readonly lastUpdatedState;
|
|
120
164
|
/**
|
|
121
165
|
* Full `CngxAsyncState` view of this button's effective lifecycle.
|
|
@@ -134,7 +178,7 @@ declare class CngxActionButton {
|
|
|
134
178
|
protected readonly failedTpl: _angular_core.Signal<CngxFailed | undefined>;
|
|
135
179
|
constructor();
|
|
136
180
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxActionButton, never>;
|
|
137
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxActionButton, "cngx-action-button", ["cngxActionButton"], { "action": { "alias": "action"; "required": true; "isSignal": true; }; "feedbackDuration": { "alias": "feedbackDuration"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "succeededAnnouncement": { "alias": "succeededAnnouncement"; "required": false; "isSignal": true; }; "failedAnnouncement": { "alias": "failedAnnouncement"; "required": false; "isSignal": true; }; "pendingLabel": { "alias": "pendingLabel"; "required": false; "isSignal": true; }; "succeededLabel": { "alias": "succeededLabel"; "required": false; "isSignal": true; }; "failedLabel": { "alias": "failedLabel"; "required": false; "isSignal": true; }; "externalState": { "alias": "externalState"; "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; }; }, {}, ["pendingTpl", "succeededTpl", "failedTpl"], ["*"], true, never>;
|
|
181
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxActionButton, "cngx-action-button", ["cngxActionButton"], { "action": { "alias": "action"; "required": true; "isSignal": true; }; "feedbackDuration": { "alias": "feedbackDuration"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "succeededAnnouncement": { "alias": "succeededAnnouncement"; "required": false; "isSignal": true; }; "failedAnnouncement": { "alias": "failedAnnouncement"; "required": false; "isSignal": true; }; "pendingLabel": { "alias": "pendingLabel"; "required": false; "isSignal": true; }; "succeededLabel": { "alias": "succeededLabel"; "required": false; "isSignal": true; }; "failedLabel": { "alias": "failedLabel"; "required": false; "isSignal": true; }; "externalState": { "alias": "externalState"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "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; }; }, {}, ["pendingTpl", "succeededTpl", "failedTpl"], ["*"], true, never>;
|
|
138
182
|
}
|
|
139
183
|
|
|
140
184
|
export { CngxActionButton };
|
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, InjectionToken,
|
|
2
|
+
import { Signal, TemplateRef, InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
3
3
|
import * as _cngx_common_interactive from '@cngx/common/interactive';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { CngxBreadcrumbItem } from '@cngx/common/interactive';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The breadcrumb section of a {@link CngxLanguagePack}: the accessible names of
|
|
8
|
+
* the breadcrumb family. They feed the `ariaLabels` of `CNGX_BREADCRUMB_CONFIG`;
|
|
9
|
+
* a key set through `withBreadcrumbAriaLabels` still wins. Route labels are app
|
|
10
|
+
* copy and stay out of the pack: route data takes a `Signal` of the label.
|
|
11
|
+
*
|
|
12
|
+
* @category ui/breadcrumb/i18n
|
|
13
|
+
* @since 0.1.0
|
|
14
|
+
* @relatedTo CNGX_BREADCRUMB_CONFIG, withBreadcrumbAriaLabels
|
|
15
|
+
*/
|
|
16
|
+
interface CngxBreadcrumbLanguageSection {
|
|
17
|
+
/** Accessible name of the `nav` landmark on `CngxBreadcrumbBar`. */
|
|
18
|
+
readonly bar: string;
|
|
19
|
+
/** Accessible name of the overflow ellipsis trigger. */
|
|
20
|
+
readonly overflowTrigger: string;
|
|
21
|
+
/** Accessible name of the collapsed-crumb menu. */
|
|
22
|
+
readonly overflowMenu: string;
|
|
23
|
+
/** Accessible name of the siblings chevron trigger. */
|
|
24
|
+
readonly siblingsTrigger: string;
|
|
25
|
+
/** Accessible name of the sibling list. */
|
|
26
|
+
readonly siblingsMenu: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The English breadcrumb section: the single source of the breadcrumb family's
|
|
30
|
+
* English copy. The `CNGX_BREADCRUMB_CONFIG` names default to it.
|
|
31
|
+
*
|
|
32
|
+
* @category ui/breadcrumb/i18n
|
|
33
|
+
* @since 0.1.0
|
|
34
|
+
* @relatedTo CNGX_BREADCRUMB_CONFIG
|
|
35
|
+
*/
|
|
36
|
+
declare const CNGX_BREADCRUMB_LANGUAGE_EN: CngxBreadcrumbLanguageSection;
|
|
37
|
+
declare module '@cngx/core/i18n' {
|
|
38
|
+
interface CngxLanguagePack {
|
|
39
|
+
readonly breadcrumb: CngxBreadcrumbLanguageSection;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
6
42
|
|
|
7
43
|
/**
|
|
8
44
|
* Selectable visual skin for `CngxBreadcrumbBar`. Every skin keeps the same
|
|
@@ -22,6 +58,16 @@ import * as i1 from '@cngx/common/layout';
|
|
|
22
58
|
* @since 0.1.0
|
|
23
59
|
*/
|
|
24
60
|
type CngxBreadcrumbSkin = 'classic' | 'plain' | 'contained' | 'pill' | 'ribbon' | 'editorial' | 'header' | 'metro' | 'toolbar' | 'chips' | 'path' | 'iconlabel' | 'icononly' | 'shell' | 'record';
|
|
61
|
+
/**
|
|
62
|
+
* Accessible names the breadcrumb family renders: the bar landmark and the
|
|
63
|
+
* overflow / siblings triggers and lists. A partial of the `breadcrumb`
|
|
64
|
+
* language section, declared once there; an unset key reads the section
|
|
65
|
+
* (English without a pack).
|
|
66
|
+
*
|
|
67
|
+
* @category ui/breadcrumb
|
|
68
|
+
* @since 0.1.0
|
|
69
|
+
*/
|
|
70
|
+
type CngxBreadcrumbAriaLabels = Partial<CngxBreadcrumbLanguageSection>;
|
|
25
71
|
/**
|
|
26
72
|
* App-wide cascade for the breadcrumb family's ARIA labels, the router
|
|
27
73
|
* `dataKey`, and the default visual `skin`.
|
|
@@ -31,7 +77,8 @@ type CngxBreadcrumbSkin = 'classic' | 'plain' | 'contained' | 'pill' | 'ribbon'
|
|
|
31
77
|
* 2. `provideBreadcrumbConfigAt(...)` in a parent component's
|
|
32
78
|
* `viewProviders` (component-scoped override).
|
|
33
79
|
* 3. `provideBreadcrumbConfig(...)` at the application root.
|
|
34
|
-
* 4. Library defaults (
|
|
80
|
+
* 4. Library defaults (`CNGX_BREADCRUMB_DEFAULTS`; the accessible names come
|
|
81
|
+
* from the `breadcrumb` section of the language pack).
|
|
35
82
|
*
|
|
36
83
|
* Every key is optional - partial overrides deep-merge with the library
|
|
37
84
|
* defaults, so consumers declare only the keys they want to override.
|
|
@@ -43,20 +90,11 @@ interface CngxBreadcrumbConfig {
|
|
|
43
90
|
/**
|
|
44
91
|
* ARIA-string fallbacks for the bar landmark and the overflow/siblings
|
|
45
92
|
* dropdown triggers and lists. Per-instance `[label]`/`[triggerLabel]`/
|
|
46
|
-
* `[menuLabel]` bindings still win over these.
|
|
93
|
+
* `[menuLabel]` bindings still win over these. Accepts a `Signal` so the
|
|
94
|
+
* labels follow a runtime language switch; read the resolved bundle through
|
|
95
|
+
* {@link injectBreadcrumbAriaLabels}.
|
|
47
96
|
*/
|
|
48
|
-
readonly ariaLabels?:
|
|
49
|
-
/** Accessible name of the `nav` landmark on `CngxBreadcrumbBar`. */
|
|
50
|
-
readonly bar?: string;
|
|
51
|
-
/** Accessible name of the overflow ellipsis trigger. */
|
|
52
|
-
readonly overflowTrigger?: string;
|
|
53
|
-
/** Accessible name of the collapsed-crumb menu. */
|
|
54
|
-
readonly overflowMenu?: string;
|
|
55
|
-
/** Accessible name of the siblings chevron trigger. */
|
|
56
|
-
readonly siblingsTrigger?: string;
|
|
57
|
-
/** Accessible name of the sibling list. */
|
|
58
|
-
readonly siblingsMenu?: string;
|
|
59
|
-
};
|
|
97
|
+
readonly ariaLabels?: CngxBreadcrumbAriaLabels | Signal<CngxBreadcrumbAriaLabels>;
|
|
60
98
|
/**
|
|
61
99
|
* Router-sync defaults shared by the trail (`CngxBreadcrumbRouterSync`)
|
|
62
100
|
* and siblings (`CngxBreadcrumbSiblingsRouterSync`) route directives.
|
|
@@ -155,36 +193,43 @@ interface CngxBreadcrumbSibling {
|
|
|
155
193
|
* <cngx-breadcrumb [items]="crumbs" [maxVisible]="4" skin="pill" />
|
|
156
194
|
* ```
|
|
157
195
|
*
|
|
196
|
+
* Left alone, the crumb cap comes from the bar's own width: 2 crumbs below
|
|
197
|
+
* `30rem`, 4 below `48rem`, 6 above. The thresholds live once, in
|
|
198
|
+
* `breadcrumb-bar.component.css`, as `--cngx-breadcrumb-max-visible` written
|
|
199
|
+
* by `@container` rules on `.cngx-breadcrumb::after`; consumer CSS re-aims
|
|
200
|
+
* them. `[maxVisible]` pins the count and overrides the derivation entirely.
|
|
201
|
+
*
|
|
158
202
|
* @category ui/breadcrumb
|
|
159
203
|
* @docsKind primary
|
|
160
204
|
* @wcag AA
|
|
161
205
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/breadcrumb/breadcrumb-bar.component.ts
|
|
162
206
|
* @since 0.1.0
|
|
163
207
|
* @relatedTo CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator, CngxBreadcrumbOverflow, CngxBreadcrumbSiblings, CngxBreadcrumbItemAccessory, CngxBreadcrumbOverflowItem, CngxBreadcrumbRouterSync
|
|
208
|
+
* @slot cngxBreadcrumbIcon Replaces a crumb's leading icon; gets the crumb.
|
|
209
|
+
* @slot cngxBreadcrumbItemAccessory Trailing control on a crumb, e.g. a siblings dropdown trigger.
|
|
210
|
+
* @slot cngxBreadcrumbOverflowItem Replaces a row inside the collapsed-crumbs menu.
|
|
164
211
|
* <example-url>http://localhost:4200/#/ui/breadcrumb/basic/explicit-items</example-url>
|
|
165
212
|
*/
|
|
166
213
|
declare class CngxBreadcrumbBar {
|
|
167
214
|
/** Uncontrolled trail. Ignored when a {@link CNGX_BREADCRUMB_ITEMS_SOURCE} is provided. */
|
|
168
215
|
readonly itemsInput: _angular_core.InputSignal<readonly CngxBreadcrumbCrumb[]>;
|
|
169
216
|
/**
|
|
170
|
-
* Maximum crumbs to show before the middle collapses.
|
|
171
|
-
*
|
|
172
|
-
*
|
|
217
|
+
* Maximum crumbs to show before the middle collapses. Pins the count: an
|
|
218
|
+
* explicit value always wins over the width-derived one
|
|
219
|
+
* (controlled/uncontrolled), resolved by {@link effectiveMaxVisible}. Unset,
|
|
220
|
+
* the bar derives the count from its own width - that is the default, there
|
|
221
|
+
* is nothing to switch on.
|
|
173
222
|
*/
|
|
174
223
|
readonly maxVisible: _angular_core.InputSignal<number | undefined>;
|
|
224
|
+
private readonly host;
|
|
225
|
+
private readonly container;
|
|
226
|
+
private readonly cfg;
|
|
227
|
+
private readonly ariaLabels;
|
|
175
228
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* `resolveBreadcrumbTier`. No hand-wired observer or `computed` needed - one
|
|
179
|
-
* attribute makes every skin responsive. Ignored when {@link maxVisible} is set.
|
|
229
|
+
* Accessible name of the `nav` landmark. Unbound (`undefined`), it falls back
|
|
230
|
+
* through the config cascade to the EN default and follows a language switch.
|
|
180
231
|
*/
|
|
181
|
-
readonly
|
|
182
|
-
/** Width tiers driving the responsive collapse. Defaults to {@link DEFAULT_BREADCRUMB_WIDTH_TIERS}. */
|
|
183
|
-
readonly responsiveTiers: _angular_core.InputSignal<readonly CngxBreadcrumbWidthTier[]>;
|
|
184
|
-
private readonly resize;
|
|
185
|
-
private readonly cfg;
|
|
186
|
-
/** Accessible name of the `nav` landmark. Falls back through the config cascade to the EN default. */
|
|
187
|
-
readonly label: _angular_core.InputSignal<string>;
|
|
232
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
188
233
|
/**
|
|
189
234
|
* Visual skin, reflected onto `[data-skin]`. Cascade `input ?? config.skin ??
|
|
190
235
|
* 'classic'`, resolved by {@link resolvedSkin}. Pure thematic concern -
|
|
@@ -215,23 +260,29 @@ declare class CngxBreadcrumbBar {
|
|
|
215
260
|
protected readonly overflowRow: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
216
261
|
/** The rendered trail: a provided source wins over the `[items]` input (controlled/uncontrolled). */
|
|
217
262
|
protected readonly items: _angular_core.Signal<readonly CngxBreadcrumbCrumb[]>;
|
|
263
|
+
/** Resolved landmark name (`input ?? config.ariaLabels.bar ?? EN default`). */
|
|
264
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
218
265
|
/** Resolved skin (`input ?? config.skin ?? 'classic'`), reflected onto `[data-skin]`. */
|
|
219
266
|
protected readonly resolvedSkin: _angular_core.Signal<CngxBreadcrumbSkin>;
|
|
267
|
+
/** Raw `--cngx-breadcrumb-max-visible`, resolved on the bar's own `::after`. */
|
|
268
|
+
private readonly capProperty;
|
|
220
269
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* a
|
|
224
|
-
* the ResizeObserver fires.
|
|
270
|
+
* Container-derived crumb cap. `undefined` until the first observation (the
|
|
271
|
+
* property reads as the empty string then), so a narrow mount never
|
|
272
|
+
* mis-collapses on a zero-width first read - the sub-frame full-trail
|
|
273
|
+
* transient settles once the `ResizeObserver` fires. The finite check means a
|
|
274
|
+
* malformed consumer override can never reach the collapse as a `NaN`.
|
|
225
275
|
*/
|
|
226
276
|
protected readonly autoMaxVisible: _angular_core.Signal<number | undefined>;
|
|
227
277
|
/**
|
|
228
|
-
* The `maxVisible` forwarded to the inner collapse: explicit
|
|
229
|
-
*
|
|
230
|
-
*
|
|
278
|
+
* The `maxVisible` forwarded to the inner collapse: an explicit
|
|
279
|
+
* `[maxVisible]` pins the count, otherwise the container-derived value
|
|
280
|
+
* applies. Before the first observation `autoMaxVisible` is `undefined`,
|
|
281
|
+
* which renders the full trail rather than guessing at a width.
|
|
231
282
|
*/
|
|
232
283
|
protected readonly effectiveMaxVisible: _angular_core.Signal<number | undefined>;
|
|
233
284
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxBreadcrumbBar, never>;
|
|
234
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxBreadcrumbBar, "cngx-breadcrumb", ["cngxBreadcrumbBar"], { "itemsInput": { "alias": "items"; "required": false; "isSignal": true; }; "maxVisible": { "alias": "maxVisible"; "required": false; "isSignal": true; }; "
|
|
285
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxBreadcrumbBar, "cngx-breadcrumb", ["cngxBreadcrumbBar"], { "itemsInput": { "alias": "items"; "required": false; "isSignal": true; }; "maxVisible": { "alias": "maxVisible"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; }, {}, ["accessory", "icon", "overflowRow"], never, true, never>;
|
|
235
286
|
}
|
|
236
287
|
|
|
237
288
|
/**
|
|
@@ -303,16 +354,19 @@ declare class CngxBreadcrumbOverflowItem {
|
|
|
303
354
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/breadcrumb/breadcrumb-overflow.component.ts
|
|
304
355
|
* @since 0.1.0
|
|
305
356
|
* @relatedTo CngxBreadcrumbBar, CngxBreadcrumbOverflowItem, CngxPopoverPanel, CngxPopoverTrigger, CngxMenu, CngxMenuTrigger
|
|
357
|
+
* @slot cngxBreadcrumbOverflowItem Replaces a row inside the collapsed-crumbs menu; gets the crumb.
|
|
306
358
|
* <example-url>http://localhost:4200/#/ui/breadcrumb/overflow/collapsed-menu</example-url>
|
|
307
359
|
*/
|
|
308
360
|
declare class CngxBreadcrumbOverflow {
|
|
309
361
|
/** Collapse-set contract, provided by the surrounding `cngxBreadcrumb`. */
|
|
310
362
|
protected readonly breadcrumb: _cngx_common_interactive.CngxBreadcrumbHost;
|
|
311
|
-
private readonly
|
|
312
|
-
/** Accessible name of the ellipsis trigger.
|
|
313
|
-
readonly triggerLabel: _angular_core.InputSignal<string>;
|
|
314
|
-
/** Accessible name of the collapsed-crumb menu.
|
|
315
|
-
readonly menuLabel: _angular_core.InputSignal<string>;
|
|
363
|
+
private readonly ariaLabels;
|
|
364
|
+
/** Accessible name of the ellipsis trigger. Unbound (`undefined`), it falls back through the config cascade to the EN default. */
|
|
365
|
+
readonly triggerLabel: _angular_core.InputSignal<string | undefined>;
|
|
366
|
+
/** Accessible name of the collapsed-crumb menu. Unbound (`undefined`), it falls back through the config cascade to the EN default. */
|
|
367
|
+
readonly menuLabel: _angular_core.InputSignal<string | undefined>;
|
|
368
|
+
protected readonly resolvedTriggerLabel: _angular_core.Signal<string>;
|
|
369
|
+
protected readonly resolvedMenuLabel: _angular_core.Signal<string>;
|
|
316
370
|
/**
|
|
317
371
|
* Per-row template forwarded by {@link CngxBreadcrumbBar}. Lets the bar pass a
|
|
318
372
|
* consumer-projected `*cngxBreadcrumbOverflowItem` into this composed overflow,
|
|
@@ -361,16 +415,19 @@ declare class CngxBreadcrumbOverflow {
|
|
|
361
415
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/breadcrumb/breadcrumb-siblings.component.ts
|
|
362
416
|
* @since 0.1.0
|
|
363
417
|
* @relatedTo CngxBreadcrumbSiblingItem, CngxBreadcrumbSiblingsRouterSync, CngxBreadcrumbSiblingsSource, CngxBreadcrumbBar, CngxPopoverPanel, CngxPopoverTrigger
|
|
418
|
+
* @slot cngxBreadcrumbSiblingItem Replaces a row in the sibling-navigation menu; gets the sibling.
|
|
364
419
|
* <example-url>http://localhost:4200/#/ui/breadcrumb/siblings/static-siblings</example-url>
|
|
365
420
|
*/
|
|
366
421
|
declare class CngxBreadcrumbSiblings {
|
|
367
422
|
/** Static sibling rows. Superseded by a provided `CNGX_BREADCRUMB_SIBLINGS_SOURCE`. */
|
|
368
423
|
readonly siblingsInput: _angular_core.InputSignal<readonly CngxBreadcrumbSibling[]>;
|
|
369
|
-
private readonly
|
|
370
|
-
/** Accessible name of the chevron trigger.
|
|
371
|
-
readonly triggerLabel: _angular_core.InputSignal<string>;
|
|
372
|
-
/** Accessible name of the sibling list (kept as `menuLabel` for overflow symmetry).
|
|
373
|
-
readonly menuLabel: _angular_core.InputSignal<string>;
|
|
424
|
+
private readonly ariaLabels;
|
|
425
|
+
/** Accessible name of the chevron trigger. Unbound (`undefined`), it falls back through the config cascade to the EN default. */
|
|
426
|
+
readonly triggerLabel: _angular_core.InputSignal<string | undefined>;
|
|
427
|
+
/** Accessible name of the sibling list (kept as `menuLabel` for overflow symmetry). Unbound (`undefined`), it falls back through the config cascade to the EN default. */
|
|
428
|
+
readonly menuLabel: _angular_core.InputSignal<string | undefined>;
|
|
429
|
+
protected readonly resolvedTriggerLabel: _angular_core.Signal<string>;
|
|
430
|
+
protected readonly resolvedMenuLabel: _angular_core.Signal<string>;
|
|
374
431
|
/** Opt-in controlled source (router-sync directive) - wins over `[siblings]`. */
|
|
375
432
|
private readonly source;
|
|
376
433
|
/** Rows the dropdown renders: controlled source wins, else the static input. */
|
|
@@ -592,8 +649,9 @@ declare const CNGX_BREADCRUMB_SIBLINGS_SOURCE: InjectionToken<CngxBreadcrumbSibl
|
|
|
592
649
|
* Opt-in router mode for {@link CngxBreadcrumbBar}. Add `routerSync` to a
|
|
593
650
|
* `<cngx-breadcrumb>` and the trail is derived from the activated route tree -
|
|
594
651
|
* every route whose `data[dataKey]` (default `data.breadcrumb`) is a non-empty
|
|
595
|
-
* string
|
|
596
|
-
*
|
|
652
|
+
* string or a `Signal` of one ({@link CngxBreadcrumbRouteLabel}, the app's own
|
|
653
|
+
* translation) contributes a crumb, terminal marking follows from
|
|
654
|
+
* position. The bar reads the trail through the {@link CNGX_BREADCRUMB_ITEMS_SOURCE} seam
|
|
597
655
|
* (provided here via `useExisting`), so the directive never writes the bar's
|
|
598
656
|
* `[items]` input and never injects the concrete bar class - decompose-clean
|
|
599
657
|
* (Pillar 1; reference_atomic_decompose rule 4).
|
|
@@ -662,6 +720,12 @@ declare class CngxBreadcrumbRouterSync implements CngxBreadcrumbItemsSource {
|
|
|
662
720
|
* navigation does not cascade. `Router` is optional - without it the directive
|
|
663
721
|
* logs a dev warning and stays an empty source.
|
|
664
722
|
*
|
|
723
|
+
* Sibling hrefs are built from the static route-config `path` patterns, so a
|
|
724
|
+
* parameterized sibling (`:id`) emits its pattern verbatim - such routes have
|
|
725
|
+
* no single static URL. Supply `[siblings]` directly (or a custom
|
|
726
|
+
* {@link CNGX_BREADCRUMB_SIBLINGS_SOURCE}) when sibling links need resolved
|
|
727
|
+
* route params.
|
|
728
|
+
*
|
|
665
729
|
* ```html
|
|
666
730
|
* <cngx-breadcrumb-siblings cngxRouterSync [depth]="1" />
|
|
667
731
|
* ```
|
|
@@ -742,7 +806,7 @@ declare const CNGX_BREADCRUMB_CONFIG: InjectionToken<CngxBreadcrumbConfig>;
|
|
|
742
806
|
*/
|
|
743
807
|
type CngxBreadcrumbConfigFeature = {
|
|
744
808
|
readonly kind: 'ariaLabels';
|
|
745
|
-
readonly payload:
|
|
809
|
+
readonly payload: CngxBreadcrumbAriaLabels | Signal<CngxBreadcrumbAriaLabels>;
|
|
746
810
|
} | {
|
|
747
811
|
readonly kind: 'router';
|
|
748
812
|
readonly payload: NonNullable<CngxBreadcrumbConfig['router']>;
|
|
@@ -813,7 +877,8 @@ declare function provideBreadcrumbConfigAt(...features: CngxBreadcrumbConfigFeat
|
|
|
813
877
|
* Override the breadcrumb family's ARIA-string fallbacks - the bar landmark
|
|
814
878
|
* name and the overflow/siblings trigger + list labels. Per-instance
|
|
815
879
|
* `[label]` / `[triggerLabel]` / `[menuLabel]` bindings still win over the
|
|
816
|
-
* cascade; this only sets the fallback.
|
|
880
|
+
* cascade; this only sets the fallback. Pass a `Signal` to switch the
|
|
881
|
+
* language at runtime.
|
|
817
882
|
*
|
|
818
883
|
* ```ts
|
|
819
884
|
* provideBreadcrumbConfig(
|
|
@@ -824,7 +889,7 @@ declare function provideBreadcrumbConfigAt(...features: CngxBreadcrumbConfigFeat
|
|
|
824
889
|
* @category ui/breadcrumb
|
|
825
890
|
* @since 0.1.0
|
|
826
891
|
*/
|
|
827
|
-
declare function withBreadcrumbAriaLabels(payload:
|
|
892
|
+
declare function withBreadcrumbAriaLabels(payload: CngxBreadcrumbAriaLabels | Signal<CngxBreadcrumbAriaLabels>): CngxBreadcrumbConfigFeature;
|
|
828
893
|
/**
|
|
829
894
|
* Override the route-data key the breadcrumb router-sync directives
|
|
830
895
|
* (`CngxBreadcrumbRouterSync`, `CngxBreadcrumbSiblingsRouterSync`) read
|
|
@@ -874,10 +939,13 @@ declare function withBreadcrumbSkin(skin: CngxBreadcrumbSkin): CngxBreadcrumbCon
|
|
|
874
939
|
* exists so consumers don't import the token directly. Mirrors
|
|
875
940
|
* `injectTagConfig` in `@cngx/common/display`.
|
|
876
941
|
*
|
|
942
|
+
* `ariaLabels` may hold a `Signal`; read the resolved bundle through
|
|
943
|
+
* {@link injectBreadcrumbAriaLabels}.
|
|
944
|
+
*
|
|
877
945
|
* ```ts
|
|
878
|
-
* export class
|
|
946
|
+
* export class MyTrail {
|
|
879
947
|
* private readonly cfg = injectBreadcrumbConfig();
|
|
880
|
-
* readonly
|
|
948
|
+
* protected readonly skin = computed(() => this.cfg.skin ?? 'classic');
|
|
881
949
|
* }
|
|
882
950
|
* ```
|
|
883
951
|
*
|
|
@@ -885,6 +953,39 @@ declare function withBreadcrumbSkin(skin: CngxBreadcrumbSkin): CngxBreadcrumbCon
|
|
|
885
953
|
* @since 0.1.0
|
|
886
954
|
*/
|
|
887
955
|
declare function injectBreadcrumbConfig(): CngxBreadcrumbConfig;
|
|
956
|
+
/**
|
|
957
|
+
* The resolved accessible names of the breadcrumb config in scope, every key
|
|
958
|
+
* the config leaves unset (also a key an override sets to `undefined`) filled
|
|
959
|
+
* from the `breadcrumb` section of the active pack, as a Signal that follows a
|
|
960
|
+
* runtime language switch. Runs in injection context; read it inside a `computed()`,
|
|
961
|
+
* a template or a handler.
|
|
962
|
+
*
|
|
963
|
+
* ```ts
|
|
964
|
+
* export class MyTrail {
|
|
965
|
+
* private readonly labels = injectBreadcrumbAriaLabels();
|
|
966
|
+
* protected readonly name = computed(() => this.labels().bar);
|
|
967
|
+
* }
|
|
968
|
+
* ```
|
|
969
|
+
*
|
|
970
|
+
* @category ui/breadcrumb
|
|
971
|
+
* @since 0.1.0
|
|
972
|
+
*/
|
|
973
|
+
declare function injectBreadcrumbAriaLabels(): Signal<Required<CngxBreadcrumbAriaLabels>>;
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* A route's breadcrumb data: a plain label, or a `Signal` of one so the crumb
|
|
977
|
+
* follows the app's own translation on a language switch. Route labels are
|
|
978
|
+
* app copy; translate them with the app's i18n, not the cngx language pack.
|
|
979
|
+
*
|
|
980
|
+
* ```ts
|
|
981
|
+
* { path: 'orders', data: { breadcrumb: computed(() => t('nav.orders')) } }
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @category ui/breadcrumb
|
|
985
|
+
* @since 0.1.0
|
|
986
|
+
* @relatedTo CngxBreadcrumbRouterSync, CngxBreadcrumbSiblingsRouterSync
|
|
987
|
+
*/
|
|
988
|
+
type CngxBreadcrumbRouteLabel = string | Signal<string>;
|
|
888
989
|
|
|
889
|
-
export { CNGX_BREADCRUMB_CONFIG, CNGX_BREADCRUMB_ITEMS_SOURCE, CNGX_BREADCRUMB_SIBLINGS_SOURCE, CngxBreadcrumbBar, CngxBreadcrumbIcon, CngxBreadcrumbItemAccessory, CngxBreadcrumbOverflow, CngxBreadcrumbOverflowItem, CngxBreadcrumbRouterSync, CngxBreadcrumbSiblingItem, CngxBreadcrumbSiblings, CngxBreadcrumbSiblingsRouterSync, injectBreadcrumbConfig, provideBreadcrumbConfig, provideBreadcrumbConfigAt, withBreadcrumbAriaLabels, withBreadcrumbDataKey, withBreadcrumbIconKey, withBreadcrumbSkin };
|
|
890
|
-
export type { CngxBreadcrumbConfig, CngxBreadcrumbConfigFeature, CngxBreadcrumbCrumb, CngxBreadcrumbIconContext, CngxBreadcrumbItemAccessoryContext, CngxBreadcrumbItemsSource, CngxBreadcrumbOverflowItemContext, CngxBreadcrumbSibling, CngxBreadcrumbSiblingItemContext, CngxBreadcrumbSiblingsSource, CngxBreadcrumbSkin };
|
|
990
|
+
export { CNGX_BREADCRUMB_CONFIG, CNGX_BREADCRUMB_ITEMS_SOURCE, CNGX_BREADCRUMB_LANGUAGE_EN, CNGX_BREADCRUMB_SIBLINGS_SOURCE, CngxBreadcrumbBar, CngxBreadcrumbIcon, CngxBreadcrumbItemAccessory, CngxBreadcrumbOverflow, CngxBreadcrumbOverflowItem, CngxBreadcrumbRouterSync, CngxBreadcrumbSiblingItem, CngxBreadcrumbSiblings, CngxBreadcrumbSiblingsRouterSync, injectBreadcrumbAriaLabels, injectBreadcrumbConfig, provideBreadcrumbConfig, provideBreadcrumbConfigAt, withBreadcrumbAriaLabels, withBreadcrumbDataKey, withBreadcrumbIconKey, withBreadcrumbSkin };
|
|
991
|
+
export type { CngxBreadcrumbAriaLabels, CngxBreadcrumbConfig, CngxBreadcrumbConfigFeature, CngxBreadcrumbCrumb, CngxBreadcrumbIconContext, CngxBreadcrumbItemAccessoryContext, CngxBreadcrumbItemsSource, CngxBreadcrumbLanguageSection, CngxBreadcrumbOverflowItemContext, CngxBreadcrumbRouteLabel, CngxBreadcrumbSibling, CngxBreadcrumbSiblingItemContext, CngxBreadcrumbSiblingsSource, CngxBreadcrumbSkin };
|