@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +227 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +120 -36
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +121 -56
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +204 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +209 -40
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
- 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 +1074 -460
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
- 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 +553 -198
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +344 -109
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +234 -99
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +88 -25
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +98 -23
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +101 -33
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/README.md +30 -6
- package/mat-tabs/styles/mat-tabs.css +188 -42
- package/overlay/README.md +9 -4
- package/package.json +31 -7
- package/paginator/README.md +8 -4
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +14 -2
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +100 -28
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +167 -60
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +157 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +140 -10
- package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +605 -59
- package/types/cngx-ui-mat-accordion.d.ts +30 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +250 -34
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +425 -136
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +88 -49
- package/types/cngx-ui-tabs.d.ts +6 -4
- package/types/cngx-ui-timeline.d.ts +35 -11
- package/types/cngx-ui-toc.d.ts +93 -16
- package/types/cngx-ui.d.ts +7 -4
package/types/cngx-ui-speak.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Signal, Provider } from '@angular/core';
|
|
2
3
|
import { CngxSpeak } from '@cngx/common';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -30,10 +31,122 @@ import { CngxSpeak } from '@cngx/common';
|
|
|
30
31
|
* <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>
|
|
31
32
|
*/
|
|
32
33
|
declare class CngxSpeakButton {
|
|
34
|
+
private readonly i18n;
|
|
33
35
|
/** The `CngxSpeak` directive instance to connect to. */
|
|
34
|
-
readonly speakRef:
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
readonly speakRef: _angular_core.InputSignal<CngxSpeak>;
|
|
37
|
+
/**
|
|
38
|
+
* Accessible label while idle - the action the button offers. Unbound,
|
|
39
|
+
* `CNGX_SPEAK_I18N.readAloud` applies.
|
|
40
|
+
*/
|
|
41
|
+
readonly readAloudLabel: _angular_core.InputSignal<string | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* Accessible label while speaking - the action the button offers to
|
|
44
|
+
* interrupt playback. Unbound, `CNGX_SPEAK_I18N.stopSpeaking` applies.
|
|
45
|
+
*/
|
|
46
|
+
readonly stopLabel: _angular_core.InputSignal<string | undefined>;
|
|
47
|
+
/** @internal - the label for the current playback state. */
|
|
48
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
49
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSpeakButton, never>;
|
|
50
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSpeakButton, "cngx-speak-button", never, { "speakRef": { "alias": "speakRef"; "required": true; "isSignal": true; }; "readAloudLabel": { "alias": "readAloudLabel"; "required": false; "isSignal": true; }; "stopLabel": { "alias": "stopLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
51
|
}
|
|
38
52
|
|
|
39
|
-
|
|
53
|
+
/**
|
|
54
|
+
* The speak section of a {@link CngxLanguagePack}: the accessible names of
|
|
55
|
+
* `CngxSpeakButton`. It feeds `CNGX_SPEAK_I18N`; a key set through
|
|
56
|
+
* `withSpeakI18nLabels` still wins.
|
|
57
|
+
*
|
|
58
|
+
* @category ui/speak/i18n
|
|
59
|
+
* @since 0.1.0
|
|
60
|
+
* @relatedTo CNGX_SPEAK_I18N, withSpeakI18nLabels
|
|
61
|
+
*/
|
|
62
|
+
interface CngxSpeakLanguageSection {
|
|
63
|
+
/** Accessible name of the speak button while idle. */
|
|
64
|
+
readonly readAloud: string;
|
|
65
|
+
/** Accessible name of the speak button while speaking. */
|
|
66
|
+
readonly stopSpeaking: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The English speak section: the single source of the speak button's English
|
|
70
|
+
* copy. `CNGX_SPEAK_I18N` defaults to it.
|
|
71
|
+
*
|
|
72
|
+
* @category ui/speak/i18n
|
|
73
|
+
* @since 0.1.0
|
|
74
|
+
* @relatedTo CNGX_SPEAK_I18N
|
|
75
|
+
*/
|
|
76
|
+
declare const CNGX_SPEAK_LANGUAGE_EN: CngxSpeakLanguageSection;
|
|
77
|
+
declare module '@cngx/core/i18n' {
|
|
78
|
+
interface CngxLanguagePack {
|
|
79
|
+
readonly speak: CngxSpeakLanguageSection;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Speak i18n surface: the `speak` section of the language pack (English
|
|
85
|
+
* without one); override single keys via {@link provideSpeakI18n}. Reactive
|
|
86
|
+
* from birth: the token carries a `Signal`, and {@link withSpeakI18nLabels}
|
|
87
|
+
* accepts a `Signal` of a partial bundle.
|
|
88
|
+
*
|
|
89
|
+
* `CngxSpeakButton` reads both keys inside a `computed()` while its
|
|
90
|
+
* `readAloudLabel` / `stopLabel` inputs are unbound, so the label follows a
|
|
91
|
+
* language switch.
|
|
92
|
+
*
|
|
93
|
+
* @category ui/speak/i18n
|
|
94
|
+
*/
|
|
95
|
+
type CngxSpeakI18n = CngxSpeakLanguageSection;
|
|
96
|
+
/**
|
|
97
|
+
* DI token for the speak i18n bundle. `providedIn: 'root'`: the `speak`
|
|
98
|
+
* section of the active language pack over the English defaults. The value is
|
|
99
|
+
* a `Signal`, shared by every reader under one injector.
|
|
100
|
+
*
|
|
101
|
+
* @category ui/speak/i18n
|
|
102
|
+
* @wcag AA
|
|
103
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/speak/speak-i18n.ts
|
|
104
|
+
* @since 0.1.0
|
|
105
|
+
* @relatedTo CngxSpeakButton
|
|
106
|
+
*/
|
|
107
|
+
declare const CNGX_SPEAK_I18N: InjectionToken<Signal<CngxSpeakLanguageSection>>;
|
|
108
|
+
/**
|
|
109
|
+
* Branded feature-fn for {@link provideSpeakI18n}.
|
|
110
|
+
*
|
|
111
|
+
* @category ui/speak/i18n
|
|
112
|
+
* @since 0.1.0
|
|
113
|
+
*/
|
|
114
|
+
type CngxSpeakI18nFeature = ((bundle: Signal<CngxSpeakI18n>) => Signal<CngxSpeakI18n>) & {
|
|
115
|
+
readonly _target: 'i18n';
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Override i18n labels via a partial bundle - unset keys, and keys set to
|
|
119
|
+
* `null` or `undefined`, keep the language pack's copy, or the English
|
|
120
|
+
* default, so the button never loses its accessible name. Pass a `Signal` of a
|
|
121
|
+
* partial bundle to switch languages at runtime.
|
|
122
|
+
*
|
|
123
|
+
* @category ui/speak/i18n
|
|
124
|
+
* @since 0.1.0
|
|
125
|
+
*/
|
|
126
|
+
declare function withSpeakI18nLabels(overrides: Partial<CngxSpeakI18n> | Signal<Partial<CngxSpeakI18n>>): CngxSpeakI18nFeature;
|
|
127
|
+
/**
|
|
128
|
+
* Provider for the speak i18n bundle. Returns a plain `Provider`, so it also
|
|
129
|
+
* scopes a subtree through `viewProviders`.
|
|
130
|
+
*
|
|
131
|
+
* ```ts
|
|
132
|
+
* bootstrapApplication(AppComponent, {
|
|
133
|
+
* providers: [
|
|
134
|
+
* provideSpeakI18n(withSpeakI18nLabels({ readAloud: 'Vorlesen', stopSpeaking: 'Vorlesen beenden' })),
|
|
135
|
+
* ],
|
|
136
|
+
* });
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* @category ui/speak/i18n
|
|
140
|
+
* @since 0.1.0
|
|
141
|
+
*/
|
|
142
|
+
declare function provideSpeakI18n(...features: readonly CngxSpeakI18nFeature[]): Provider;
|
|
143
|
+
/**
|
|
144
|
+
* Inject the resolved speak i18n bundle signal.
|
|
145
|
+
*
|
|
146
|
+
* @category ui/speak/i18n
|
|
147
|
+
* @since 0.1.0
|
|
148
|
+
*/
|
|
149
|
+
declare function injectSpeakI18n(): Signal<CngxSpeakI18n>;
|
|
150
|
+
|
|
151
|
+
export { CNGX_SPEAK_I18N, CNGX_SPEAK_LANGUAGE_EN, CngxSpeakButton, injectSpeakI18n, provideSpeakI18n, withSpeakI18nLabels };
|
|
152
|
+
export type { CngxSpeakI18n, CngxSpeakI18nFeature, CngxSpeakLanguageSection };
|
|
@@ -2,7 +2,7 @@ import * as _cngx_common_data from '@cngx/common/data';
|
|
|
2
2
|
import { CngxStatCoordinator, CngxStatSlotKind } from '@cngx/common/data';
|
|
3
3
|
export { CNGX_STAT, CngxStatCaption, CngxStatDelta, CngxStatLabel, CngxStatRegistry, CngxStatValue } from '@cngx/common/data';
|
|
4
4
|
import * as _angular_core from '@angular/core';
|
|
5
|
-
import { InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
5
|
+
import { Signal, InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
6
6
|
import { CngxAsyncState, CngxLoadingTreatment } from '@cngx/core/utils';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -50,6 +50,7 @@ declare class CngxStatCard {
|
|
|
50
50
|
/** @internal The shared slot-id brain, applied as a host directive. */
|
|
51
51
|
protected readonly coordinator: CngxStatCoordinator;
|
|
52
52
|
private readonly config;
|
|
53
|
+
private readonly ariaLabels;
|
|
53
54
|
/**
|
|
54
55
|
* The tile's async envelope. Every view decision derives from it; there are
|
|
55
56
|
* no discrete `loading` / `error` boolean fallbacks. Optional per the
|
|
@@ -63,14 +64,20 @@ declare class CngxStatCard {
|
|
|
63
64
|
* `'skeleton'` pin the choice.
|
|
64
65
|
*/
|
|
65
66
|
readonly loadingTreatment: _angular_core.InputSignal<CngxLoadingTreatment>;
|
|
66
|
-
/**
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Accessible label announced while the card is loading. Unbound
|
|
69
|
+
* (`undefined`), each copy input falls back to the config cascade and the
|
|
70
|
+
* `statCard` section of the language pack.
|
|
71
|
+
*/
|
|
72
|
+
readonly busyLabel: _angular_core.InputSignal<string | undefined>;
|
|
68
73
|
/** Headline of the error state shown instead of the stat when the first load failed. */
|
|
69
|
-
readonly errorText: _angular_core.InputSignal<string>;
|
|
74
|
+
readonly errorText: _angular_core.InputSignal<string | undefined>;
|
|
70
75
|
/** Supporting detail under {@link errorText}. Omitted when unset. */
|
|
71
76
|
readonly errorDescription: _angular_core.InputSignal<string | undefined>;
|
|
72
77
|
/** Note appended below the stat when a refresh failed but stale data is still shown. */
|
|
73
|
-
readonly staleText: _angular_core.InputSignal<string>;
|
|
78
|
+
readonly staleText: _angular_core.InputSignal<string | undefined>;
|
|
79
|
+
/** Headline of the empty state shown when a load settled with no data. */
|
|
80
|
+
readonly emptyText: _angular_core.InputSignal<string | undefined>;
|
|
74
81
|
/**
|
|
75
82
|
* Politeness of the tile's live region. `off` (default) for a static KPI;
|
|
76
83
|
* `polite` for a tile that refreshes on a timer, so the new figure is
|
|
@@ -79,11 +86,6 @@ declare class CngxStatCard {
|
|
|
79
86
|
readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
|
|
80
87
|
/** @internal Whether any operation is running. Drives `aria-busy` (Pillar 2). */
|
|
81
88
|
protected readonly busy: _angular_core.Signal<boolean>;
|
|
82
|
-
/**
|
|
83
|
-
* @internal A refresh over content the user can still read. The skeleton and
|
|
84
|
-
* spinner branches already carry their own busy signal, so the bar would be
|
|
85
|
-
* redundant there.
|
|
86
|
-
*/
|
|
87
89
|
/**
|
|
88
90
|
* @internal Which bars the placeholder draws. Mirrors the slots the consumer
|
|
89
91
|
* actually projected, so a tile without a delta gets no delta bar. Falls back
|
|
@@ -91,6 +93,11 @@ declare class CngxStatCard {
|
|
|
91
93
|
* a card with no stat slots at all still needs a plausible placeholder.
|
|
92
94
|
*/
|
|
93
95
|
protected readonly skeletonSlots: _angular_core.Signal<readonly CngxStatSlotKind[]>;
|
|
96
|
+
/**
|
|
97
|
+
* @internal A refresh over content the user can still read. The skeleton and
|
|
98
|
+
* spinner branches already carry their own busy signal, so the bar would be
|
|
99
|
+
* redundant there.
|
|
100
|
+
*/
|
|
94
101
|
protected readonly showRefreshIndicator: _angular_core.Signal<boolean>;
|
|
95
102
|
private readonly loadingConfig;
|
|
96
103
|
/**
|
|
@@ -106,11 +113,6 @@ declare class CngxStatCard {
|
|
|
106
113
|
* every tile in the app.
|
|
107
114
|
*/
|
|
108
115
|
protected readonly resolvedTreatment: _angular_core.Signal<"spinner" | "skeleton">;
|
|
109
|
-
/**
|
|
110
|
-
* Which body the card renders. Delegates to the shared `resolveAsyncView`
|
|
111
|
-
* lookup table so the tile cannot drift from every other async surface.
|
|
112
|
-
* Without a bound `[state]` the card always shows its content.
|
|
113
|
-
*/
|
|
114
116
|
/**
|
|
115
117
|
* @internal The card element carries the accessible name, so the tile is one
|
|
116
118
|
* named region instead of an unnamed `article` wrapped around a named group.
|
|
@@ -118,9 +120,27 @@ declare class CngxStatCard {
|
|
|
118
120
|
* branch, and pointing at ids that are out of the DOM reads as unnamed anyway.
|
|
119
121
|
*/
|
|
120
122
|
protected readonly cardLabelledBy: _angular_core.Signal<string | null>;
|
|
123
|
+
/**
|
|
124
|
+
* @internal Which body the card renders. Delegates to the shared
|
|
125
|
+
* `resolveAsyncView` lookup table so the tile cannot drift from every other
|
|
126
|
+
* async surface. Without a bound `[state]` the card always shows its content.
|
|
127
|
+
*/
|
|
121
128
|
protected readonly activeView: _angular_core.Signal<_cngx_common_data.AsyncView>;
|
|
129
|
+
protected readonly resolvedBusyLabel: _angular_core.Signal<string>;
|
|
130
|
+
protected readonly resolvedErrorText: _angular_core.Signal<string>;
|
|
131
|
+
protected readonly resolvedErrorDescription: _angular_core.Signal<string | undefined>;
|
|
132
|
+
protected readonly resolvedStaleText: _angular_core.Signal<string>;
|
|
133
|
+
protected readonly resolvedEmptyText: _angular_core.Signal<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Keys the untracked cascade reads above on the view and busy phase, read
|
|
136
|
+
* straight from the signals the template polls (so a phase that returns to an
|
|
137
|
+
* earlier value still re-reads). The whole card can be a live region, so a
|
|
138
|
+
* language switch must not re-render its text; the next view or busy change
|
|
139
|
+
* speaks the new language. A bound input stays tracked.
|
|
140
|
+
*/
|
|
141
|
+
private trackPhase;
|
|
122
142
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCard, never>;
|
|
123
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStatCard, "cngx-stat-card", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loadingTreatment": { "alias": "loadingTreatment"; "required": false; "isSignal": true; }; "busyLabel": { "alias": "busyLabel"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "errorDescription": { "alias": "errorDescription"; "required": false; "isSignal": true; }; "staleText": { "alias": "staleText"; "required": false; "isSignal": true; }; "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]", "[cngxStatCardViz]", "[cngxStatCardFooter]"], true, [{ directive: typeof _cngx_common_data.CngxStatCoordinator; inputs: {}; outputs: {}; }]>;
|
|
143
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStatCard, "cngx-stat-card", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loadingTreatment": { "alias": "loadingTreatment"; "required": false; "isSignal": true; }; "busyLabel": { "alias": "busyLabel"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "errorDescription": { "alias": "errorDescription"; "required": false; "isSignal": true; }; "staleText": { "alias": "staleText"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]", "[cngxStatCardViz]", "[cngxStatCardFooter]"], true, [{ directive: typeof _cngx_common_data.CngxStatCoordinator; inputs: {}; outputs: {}; }]>;
|
|
124
144
|
}
|
|
125
145
|
|
|
126
146
|
/**
|
|
@@ -155,6 +175,61 @@ declare class CngxStatCardFooter {
|
|
|
155
175
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCardFooter, "[cngxStatCardFooter]", never, {}, {}, never, never, true, never>;
|
|
156
176
|
}
|
|
157
177
|
|
|
178
|
+
/**
|
|
179
|
+
* The stat-card section of a {@link CngxLanguagePack}: the state copy of
|
|
180
|
+
* `CngxStatCard`. It feeds the `ariaLabels` of `CNGX_STAT_CARD_CONFIG`; a key
|
|
181
|
+
* set through `withStatCardAriaLabels` or a bound copy input still wins.
|
|
182
|
+
*
|
|
183
|
+
* @category ui/stat-card/i18n
|
|
184
|
+
* @since 0.1.0
|
|
185
|
+
* @relatedTo CNGX_STAT_CARD_CONFIG, withStatCardAriaLabels
|
|
186
|
+
*/
|
|
187
|
+
interface CngxStatCardLanguageSection {
|
|
188
|
+
/** Accessible name announced while the tile is loading. */
|
|
189
|
+
readonly busy: string;
|
|
190
|
+
/** Headline of the error state shown when the first load failed. */
|
|
191
|
+
readonly errorFallback: string;
|
|
192
|
+
/** Note shown below stale numbers when a refresh failed. */
|
|
193
|
+
readonly staleFallback: string;
|
|
194
|
+
/** Headline of the empty state shown when a load settled with no data. */
|
|
195
|
+
readonly emptyFallback: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The English stat-card section: the single source of the stat card's English
|
|
199
|
+
* copy. The `CNGX_STAT_CARD_CONFIG` labels default to it.
|
|
200
|
+
*
|
|
201
|
+
* @category ui/stat-card/i18n
|
|
202
|
+
* @since 0.1.0
|
|
203
|
+
* @relatedTo CNGX_STAT_CARD_CONFIG
|
|
204
|
+
*/
|
|
205
|
+
declare const CNGX_STAT_CARD_LANGUAGE_EN: CngxStatCardLanguageSection;
|
|
206
|
+
declare module '@cngx/core/i18n' {
|
|
207
|
+
interface CngxLanguagePack {
|
|
208
|
+
readonly statCard: CngxStatCardLanguageSection;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* String fallbacks for the stat-card's non-content states: a partial of the
|
|
214
|
+
* `statCard` language section (declared once there; an unset key reads the
|
|
215
|
+
* section, English without a pack) plus `errorDescription`, the supporting
|
|
216
|
+
* detail under the error headline, which has no default and is omitted when
|
|
217
|
+
* unset.
|
|
218
|
+
*
|
|
219
|
+
* @category ui/stat-card
|
|
220
|
+
* @since 0.1.0
|
|
221
|
+
*/
|
|
222
|
+
interface CngxStatCardAriaLabels extends Partial<CngxStatCardLanguageSection> {
|
|
223
|
+
/** Supporting detail under the error headline. Omitted when unset. */
|
|
224
|
+
readonly errorDescription?: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The resolved stat-card strings: every key of the `statCard` section is set.
|
|
228
|
+
*
|
|
229
|
+
* @category ui/stat-card
|
|
230
|
+
* @since 0.1.0
|
|
231
|
+
*/
|
|
232
|
+
type CngxStatCardResolvedAriaLabels = CngxStatCardAriaLabels & CngxStatCardLanguageSection;
|
|
158
233
|
/**
|
|
159
234
|
* App-wide cascade for the stat-card's ARIA/message strings and its default
|
|
160
235
|
* loading treatment.
|
|
@@ -163,7 +238,8 @@ declare class CngxStatCardFooter {
|
|
|
163
238
|
* 1. Per-instance Input binding (e.g. `[errorText]`, `[loadingTreatment]`).
|
|
164
239
|
* 2. `provideStatCardConfigAt(...)` in a parent component's `viewProviders`.
|
|
165
240
|
* 3. `provideStatCardConfig(...)` at the application root.
|
|
166
|
-
* 4. Library defaults (
|
|
241
|
+
* 4. Library defaults (`CNGX_STAT_CARD_DEFAULTS`; the strings come from the
|
|
242
|
+
* `statCard` section of the language pack).
|
|
167
243
|
*
|
|
168
244
|
* Every key is optional - partial overrides deep-merge with the library
|
|
169
245
|
* defaults, so consumers declare only the keys they want to override.
|
|
@@ -174,18 +250,11 @@ declare class CngxStatCardFooter {
|
|
|
174
250
|
interface CngxStatCardConfig {
|
|
175
251
|
/**
|
|
176
252
|
* String fallbacks for the tile's non-content states. Per-instance
|
|
177
|
-
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.
|
|
253
|
+
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win. Accepts
|
|
254
|
+
* a `Signal` so the strings follow a runtime language switch; read the
|
|
255
|
+
* resolved bundle through {@link injectStatCardAriaLabels}.
|
|
178
256
|
*/
|
|
179
|
-
readonly ariaLabels?:
|
|
180
|
-
/** Accessible name announced while the tile is loading. */
|
|
181
|
-
readonly busy?: string;
|
|
182
|
-
/** Headline of the error state shown instead of the stat when the first load failed. */
|
|
183
|
-
readonly errorFallback?: string;
|
|
184
|
-
/** Supporting detail under the error headline. Omitted when unset. */
|
|
185
|
-
readonly errorDescription?: string;
|
|
186
|
-
/** Note shown below stale numbers when a refresh failed. */
|
|
187
|
-
readonly staleFallback?: string;
|
|
188
|
-
};
|
|
257
|
+
readonly ariaLabels?: CngxStatCardAriaLabels | Signal<CngxStatCardAriaLabels>;
|
|
189
258
|
/**
|
|
190
259
|
* App-wide default loading treatment. Per-instance `[loadingTreatment]`
|
|
191
260
|
* still wins; this only moves the cascade default. A flat top-level scalar,
|
|
@@ -227,7 +296,7 @@ declare const CNGX_STAT_CARD_CONFIG: InjectionToken<CngxStatCardConfig>;
|
|
|
227
296
|
*/
|
|
228
297
|
type CngxStatCardConfigFeature = {
|
|
229
298
|
readonly kind: 'ariaLabels';
|
|
230
|
-
readonly payload:
|
|
299
|
+
readonly payload: CngxStatCardAriaLabels | Signal<CngxStatCardAriaLabels>;
|
|
231
300
|
} | {
|
|
232
301
|
readonly kind: 'loadingTreatment';
|
|
233
302
|
readonly payload: {
|
|
@@ -281,7 +350,10 @@ declare function provideStatCardConfigAt(...features: CngxStatCardConfigFeature[
|
|
|
281
350
|
* first-load error message, and the stale-data note. Per-instance
|
|
282
351
|
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.
|
|
283
352
|
*
|
|
284
|
-
*
|
|
353
|
+
* The defaults come from the `statCard` section of the language pack (English
|
|
354
|
+
* without one); this overrides single keys on top of it. Pass a
|
|
355
|
+
* `Signal` to switch the language at runtime; a tile with a live region speaks
|
|
356
|
+
* the new language with its next state change.
|
|
285
357
|
*
|
|
286
358
|
* ```ts
|
|
287
359
|
* provideStatCardConfig(
|
|
@@ -292,7 +364,7 @@ declare function provideStatCardConfigAt(...features: CngxStatCardConfigFeature[
|
|
|
292
364
|
* @category ui/stat-card
|
|
293
365
|
* @since 0.1.0
|
|
294
366
|
*/
|
|
295
|
-
declare function withStatCardAriaLabels(labels:
|
|
367
|
+
declare function withStatCardAriaLabels(labels: CngxStatCardAriaLabels | Signal<CngxStatCardAriaLabels>): CngxStatCardConfigFeature;
|
|
296
368
|
/**
|
|
297
369
|
* Move the cascade default for what a tile renders while it loads. `'auto'`
|
|
298
370
|
* (the library default) picks spinner vs skeleton from the latency the tile
|
|
@@ -322,6 +394,18 @@ declare function withStatCardLoadingTreatment(treatment: CngxLoadingTreatment):
|
|
|
322
394
|
* @since 0.1.0
|
|
323
395
|
*/
|
|
324
396
|
declare function injectStatCardConfig(): CngxStatCardConfig;
|
|
397
|
+
/**
|
|
398
|
+
* The resolved strings of the stat-card config in scope, every key the config
|
|
399
|
+
* leaves unset (also a key an override sets to `undefined`) filled from the
|
|
400
|
+
* `statCard` section of the active pack, as a Signal that follows a runtime
|
|
401
|
+
* language switch. Runs
|
|
402
|
+
* in injection context; read it inside a `computed()`, a template or a
|
|
403
|
+
* handler, and untracked where it builds live-region text.
|
|
404
|
+
*
|
|
405
|
+
* @category ui/stat-card
|
|
406
|
+
* @since 0.1.0
|
|
407
|
+
*/
|
|
408
|
+
declare function injectStatCardAriaLabels(): Signal<CngxStatCardResolvedAriaLabels>;
|
|
325
409
|
|
|
326
|
-
export { CNGX_STAT_CARD_CONFIG, CngxStatCard, CngxStatCardFooter, CngxStatCardViz, injectStatCardConfig, provideStatCardConfig, provideStatCardConfigAt, withStatCardAriaLabels, withStatCardLoadingTreatment };
|
|
327
|
-
export type { CngxStatCardConfig, CngxStatCardConfigFeature };
|
|
410
|
+
export { CNGX_STAT_CARD_CONFIG, CNGX_STAT_CARD_LANGUAGE_EN, CngxStatCard, CngxStatCardFooter, CngxStatCardViz, injectStatCardAriaLabels, injectStatCardConfig, provideStatCardConfig, provideStatCardConfigAt, withStatCardAriaLabels, withStatCardLoadingTreatment };
|
|
411
|
+
export type { CngxStatCardAriaLabels, CngxStatCardConfig, CngxStatCardConfigFeature, CngxStatCardLanguageSection, CngxStatCardResolvedAriaLabels };
|