@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
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, makeEnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, input, computed, untracked, ViewEncapsulation, ChangeDetectionStrategy, Component, Directive, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { CngxCard } from '@cngx/common/card';
|
|
4
4
|
import * as i1 from '@cngx/common/data';
|
|
5
5
|
import { CngxStatCoordinator, resolveAsyncView, CNGX_STAT } from '@cngx/common/data';
|
|
6
6
|
export { CNGX_STAT, CngxStatCaption, CngxStatDelta, CngxStatLabel, CngxStatValue } from '@cngx/common/data';
|
|
7
7
|
import { CngxSkeleton } from '@cngx/common/layout';
|
|
8
|
-
import { injectLoadingConfig, createLatencyProbe, resolveLoadingTreatment } from '@cngx/core/utils';
|
|
8
|
+
import { createFilledOverrideMerge, injectLoadingConfig, createLatencyProbe, resolveLoadingTreatment, createOverrideMerge } from '@cngx/core/utils';
|
|
9
9
|
import { CngxEmptyState } from '@cngx/ui/empty-state';
|
|
10
10
|
import { CngxLoadingIndicator } from '@cngx/ui/feedback';
|
|
11
|
+
import { createLanguageSection } from '@cngx/core/i18n';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* The English stat-card section: the single source of the stat card's English
|
|
15
|
+
* copy. The `CNGX_STAT_CARD_CONFIG` labels default to it.
|
|
16
|
+
*
|
|
17
|
+
* @category ui/stat-card/i18n
|
|
18
|
+
* @since 0.1.0
|
|
19
|
+
* @relatedTo CNGX_STAT_CARD_CONFIG
|
|
20
|
+
*/
|
|
21
|
+
const CNGX_STAT_CARD_LANGUAGE_EN = {
|
|
22
|
+
busy: 'Loading',
|
|
23
|
+
errorFallback: 'Could not load',
|
|
24
|
+
staleFallback: 'Showing last known value',
|
|
25
|
+
emptyFallback: 'No data',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @internal The stat-card section of the active pack over the English section,
|
|
30
|
+
* shared app-wide. Consumers override copy through `withStatCardAriaLabels`.
|
|
31
|
+
*/
|
|
32
|
+
const injectStatCardSiteCopy = createLanguageSection('statCard', CNGX_STAT_CARD_LANGUAGE_EN);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Library defaults for the stat-card configuration cascade. Carries no copy:
|
|
36
|
+
* the `ariaLabels` defaults are the `statCard` section of the language pack;
|
|
37
|
+
* single keys ride the `withStatCardAriaLabels` feature.
|
|
17
38
|
*
|
|
18
39
|
* Exported for intra-lib consumers (`provideStatCardConfig` deep-merges with
|
|
19
40
|
* this base) but **NOT** re-exported from `public-api.ts` - downstream
|
|
@@ -24,11 +45,6 @@ import { CngxLoadingIndicator } from '@cngx/ui/feedback';
|
|
|
24
45
|
* @internal
|
|
25
46
|
*/
|
|
26
47
|
const CNGX_STAT_CARD_DEFAULTS = {
|
|
27
|
-
ariaLabels: {
|
|
28
|
-
busy: 'Loading',
|
|
29
|
-
errorFallback: 'Could not load',
|
|
30
|
-
staleFallback: 'Showing last known value',
|
|
31
|
-
},
|
|
32
48
|
loadingTreatment: 'auto',
|
|
33
49
|
};
|
|
34
50
|
/**
|
|
@@ -74,6 +90,20 @@ const CNGX_STAT_CARD_CONFIG = new InjectionToken('CNGX_STAT_CARD_CONFIG', {
|
|
|
74
90
|
function injectStatCardConfig() {
|
|
75
91
|
return inject(CNGX_STAT_CARD_CONFIG);
|
|
76
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* The resolved strings of the stat-card config in scope, every key the config
|
|
95
|
+
* leaves unset (also a key an override sets to `undefined`) filled from the
|
|
96
|
+
* `statCard` section of the active pack, as a Signal that follows a runtime
|
|
97
|
+
* language switch. Runs
|
|
98
|
+
* in injection context; read it inside a `computed()`, a template or a
|
|
99
|
+
* handler, and untracked where it builds live-region text.
|
|
100
|
+
*
|
|
101
|
+
* @category ui/stat-card
|
|
102
|
+
* @since 0.1.0
|
|
103
|
+
*/
|
|
104
|
+
function injectStatCardAriaLabels() {
|
|
105
|
+
return createFilledOverrideMerge(injectStatCardSiteCopy(), injectStatCardConfig().ariaLabels);
|
|
106
|
+
}
|
|
77
107
|
|
|
78
108
|
/** Placeholder shape for a card whose consumer projected no stat slots at all. */
|
|
79
109
|
const DEFAULT_SKELETON_SLOTS = ['label', 'value', 'caption'];
|
|
@@ -122,6 +152,7 @@ class CngxStatCard {
|
|
|
122
152
|
/** @internal The shared slot-id brain, applied as a host directive. */
|
|
123
153
|
coordinator = inject(CngxStatCoordinator, { host: true });
|
|
124
154
|
config = injectStatCardConfig();
|
|
155
|
+
ariaLabels = injectStatCardAriaLabels();
|
|
125
156
|
/**
|
|
126
157
|
* The tile's async envelope. Every view decision derives from it; there are
|
|
127
158
|
* no discrete `loading` / `error` boolean fallbacks. Optional per the
|
|
@@ -135,14 +166,20 @@ class CngxStatCard {
|
|
|
135
166
|
* `'skeleton'` pin the choice.
|
|
136
167
|
*/
|
|
137
168
|
loadingTreatment = input(this.config.loadingTreatment ?? 'auto', ...(ngDevMode ? [{ debugName: "loadingTreatment" }] : /* istanbul ignore next */ []));
|
|
138
|
-
/**
|
|
139
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Accessible label announced while the card is loading. Unbound
|
|
171
|
+
* (`undefined`), each copy input falls back to the config cascade and the
|
|
172
|
+
* `statCard` section of the language pack.
|
|
173
|
+
*/
|
|
174
|
+
busyLabel = input(undefined, ...(ngDevMode ? [{ debugName: "busyLabel" }] : /* istanbul ignore next */ []));
|
|
140
175
|
/** Headline of the error state shown instead of the stat when the first load failed. */
|
|
141
|
-
errorText = input(
|
|
176
|
+
errorText = input(undefined, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
142
177
|
/** Supporting detail under {@link errorText}. Omitted when unset. */
|
|
143
|
-
errorDescription = input(
|
|
178
|
+
errorDescription = input(undefined, ...(ngDevMode ? [{ debugName: "errorDescription" }] : /* istanbul ignore next */ []));
|
|
144
179
|
/** Note appended below the stat when a refresh failed but stale data is still shown. */
|
|
145
|
-
staleText = input(
|
|
180
|
+
staleText = input(undefined, ...(ngDevMode ? [{ debugName: "staleText" }] : /* istanbul ignore next */ []));
|
|
181
|
+
/** Headline of the empty state shown when a load settled with no data. */
|
|
182
|
+
emptyText = input(undefined, ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
146
183
|
/**
|
|
147
184
|
* Politeness of the tile's live region. `off` (default) for a static KPI;
|
|
148
185
|
* `polite` for a tile that refreshes on a timer, so the new figure is
|
|
@@ -151,11 +188,6 @@ class CngxStatCard {
|
|
|
151
188
|
live = input('off', ...(ngDevMode ? [{ debugName: "live" }] : /* istanbul ignore next */ []));
|
|
152
189
|
/** @internal Whether any operation is running. Drives `aria-busy` (Pillar 2). */
|
|
153
190
|
busy = computed(() => this.state()?.isBusy() ?? false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
154
|
-
/**
|
|
155
|
-
* @internal A refresh over content the user can still read. The skeleton and
|
|
156
|
-
* spinner branches already carry their own busy signal, so the bar would be
|
|
157
|
-
* redundant there.
|
|
158
|
-
*/
|
|
159
191
|
/**
|
|
160
192
|
* @internal Which bars the placeholder draws. Mirrors the slots the consumer
|
|
161
193
|
* actually projected, so a tile without a delta gets no delta bar. Falls back
|
|
@@ -166,6 +198,11 @@ class CngxStatCard {
|
|
|
166
198
|
const present = this.coordinator.presentKinds();
|
|
167
199
|
return present.length > 0 ? present : DEFAULT_SKELETON_SLOTS;
|
|
168
200
|
}, ...(ngDevMode ? [{ debugName: "skeletonSlots" }] : /* istanbul ignore next */ []));
|
|
201
|
+
/**
|
|
202
|
+
* @internal A refresh over content the user can still read. The skeleton and
|
|
203
|
+
* spinner branches already carry their own busy signal, so the bar would be
|
|
204
|
+
* redundant there.
|
|
205
|
+
*/
|
|
169
206
|
showRefreshIndicator = computed(() => this.busy() && this.activeView() !== 'skeleton', ...(ngDevMode ? [{ debugName: "showRefreshIndicator" }] : /* istanbul ignore next */ []));
|
|
170
207
|
loadingConfig = injectLoadingConfig();
|
|
171
208
|
/**
|
|
@@ -181,11 +218,6 @@ class CngxStatCard {
|
|
|
181
218
|
* every tile in the app.
|
|
182
219
|
*/
|
|
183
220
|
resolvedTreatment = computed(() => resolveLoadingTreatment(this.loadingTreatment(), this.probe.lastDuration(), this.loadingConfig.spinnerVsSkeletonCutoff), ...(ngDevMode ? [{ debugName: "resolvedTreatment" }] : /* istanbul ignore next */ []));
|
|
184
|
-
/**
|
|
185
|
-
* Which body the card renders. Delegates to the shared `resolveAsyncView`
|
|
186
|
-
* lookup table so the tile cannot drift from every other async surface.
|
|
187
|
-
* Without a bound `[state]` the card always shows its content.
|
|
188
|
-
*/
|
|
189
221
|
/**
|
|
190
222
|
* @internal The card element carries the accessible name, so the tile is one
|
|
191
223
|
* named region instead of an unnamed `article` wrapped around a named group.
|
|
@@ -194,17 +226,61 @@ class CngxStatCard {
|
|
|
194
226
|
*/
|
|
195
227
|
cardLabelledBy = computed(() => {
|
|
196
228
|
const view = this.activeView();
|
|
197
|
-
|
|
229
|
+
const showsStat = view === 'content' || view === 'content+error';
|
|
230
|
+
return showsStat ? this.coordinator.labelledBy() : null;
|
|
198
231
|
}, ...(ngDevMode ? [{ debugName: "cardLabelledBy" }] : /* istanbul ignore next */ []));
|
|
232
|
+
/**
|
|
233
|
+
* @internal Which body the card renders. Delegates to the shared
|
|
234
|
+
* `resolveAsyncView` lookup table so the tile cannot drift from every other
|
|
235
|
+
* async surface. Without a bound `[state]` the card always shows its content.
|
|
236
|
+
*/
|
|
199
237
|
activeView = computed(() => {
|
|
200
238
|
const s = this.state();
|
|
201
239
|
if (!s) {
|
|
202
240
|
return 'content';
|
|
203
241
|
}
|
|
204
|
-
|
|
242
|
+
const view = resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());
|
|
243
|
+
// A non-first-load busy phase over an empty tile resolves to content in
|
|
244
|
+
// the lookup table - blank metric slots posing as a figure. A load with
|
|
245
|
+
// nothing on screen is a load (same correction the timeline applies).
|
|
246
|
+
if (view === 'content' && s.isEmpty() && s.isBusy()) {
|
|
247
|
+
return 'skeleton';
|
|
248
|
+
}
|
|
249
|
+
return view;
|
|
205
250
|
}, ...(ngDevMode ? [{ debugName: "activeView" }] : /* istanbul ignore next */ []));
|
|
251
|
+
resolvedBusyLabel = computed(() => {
|
|
252
|
+
this.trackPhase();
|
|
253
|
+
return this.busyLabel() ?? untracked(() => this.ariaLabels().busy);
|
|
254
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedBusyLabel" }] : /* istanbul ignore next */ []));
|
|
255
|
+
resolvedErrorText = computed(() => {
|
|
256
|
+
this.trackPhase();
|
|
257
|
+
return this.errorText() ?? untracked(() => this.ariaLabels().errorFallback);
|
|
258
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedErrorText" }] : /* istanbul ignore next */ []));
|
|
259
|
+
resolvedErrorDescription = computed(() => {
|
|
260
|
+
this.trackPhase();
|
|
261
|
+
return this.errorDescription() ?? untracked(() => this.ariaLabels().errorDescription);
|
|
262
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedErrorDescription" }] : /* istanbul ignore next */ []));
|
|
263
|
+
resolvedStaleText = computed(() => {
|
|
264
|
+
this.trackPhase();
|
|
265
|
+
return this.staleText() ?? untracked(() => this.ariaLabels().staleFallback);
|
|
266
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedStaleText" }] : /* istanbul ignore next */ []));
|
|
267
|
+
resolvedEmptyText = computed(() => {
|
|
268
|
+
this.trackPhase();
|
|
269
|
+
return this.emptyText() ?? untracked(() => this.ariaLabels().emptyFallback);
|
|
270
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedEmptyText" }] : /* istanbul ignore next */ []));
|
|
271
|
+
/**
|
|
272
|
+
* Keys the untracked cascade reads above on the view and busy phase, read
|
|
273
|
+
* straight from the signals the template polls (so a phase that returns to an
|
|
274
|
+
* earlier value still re-reads). The whole card can be a live region, so a
|
|
275
|
+
* language switch must not re-render its text; the next view or busy change
|
|
276
|
+
* speaks the new language. A bound input stays tracked.
|
|
277
|
+
*/
|
|
278
|
+
trackPhase() {
|
|
279
|
+
this.activeView();
|
|
280
|
+
this.busy();
|
|
281
|
+
}
|
|
206
282
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
207
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxStatCard, isStandalone: true, selector: "cngx-stat-card", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, loadingTreatment: { classPropertyName: "loadingTreatment", publicName: "loadingTreatment", isSignal: true, isRequired: false, transformFunction: null }, busyLabel: { classPropertyName: "busyLabel", publicName: "busyLabel", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, errorDescription: { classPropertyName: "errorDescription", publicName: "errorDescription", isSignal: true, isRequired: false, transformFunction: null }, staleText: { classPropertyName: "staleText", publicName: "staleText", isSignal: true, isRequired: false, transformFunction: null }, live: { classPropertyName: "live", publicName: "live", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "busy() || null", "class.cngx-stat-card--busy": "busy()" }, classAttribute: "cngx-stat-card" }, providers: [{ provide: CNGX_STAT, useExisting: CngxStatCoordinator }], hostDirectives: [{ directive: i1.CngxStatCoordinator }], ngImport: i0, template: `
|
|
283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxStatCard, isStandalone: true, selector: "cngx-stat-card", inputs: { state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, loadingTreatment: { classPropertyName: "loadingTreatment", publicName: "loadingTreatment", isSignal: true, isRequired: false, transformFunction: null }, busyLabel: { classPropertyName: "busyLabel", publicName: "busyLabel", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, errorDescription: { classPropertyName: "errorDescription", publicName: "errorDescription", isSignal: true, isRequired: false, transformFunction: null }, staleText: { classPropertyName: "staleText", publicName: "staleText", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, live: { classPropertyName: "live", publicName: "live", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "busy() || null", "class.cngx-stat-card--busy": "busy()" }, classAttribute: "cngx-stat-card" }, providers: [{ provide: CNGX_STAT, useExisting: CngxStatCoordinator }], hostDirectives: [{ directive: i1.CngxStatCoordinator }], ngImport: i0, template: `
|
|
208
284
|
<cngx-card
|
|
209
285
|
[attr.aria-labelledby]="cardLabelledBy()"
|
|
210
286
|
[attr.aria-live]="live() === 'off' ? null : live()"
|
|
@@ -220,7 +296,7 @@ class CngxStatCard {
|
|
|
220
296
|
class="cngx-stat-card__refresh"
|
|
221
297
|
[loading]="true"
|
|
222
298
|
variant="spinner"
|
|
223
|
-
[label]="
|
|
299
|
+
[label]="resolvedBusyLabel()"
|
|
224
300
|
/>
|
|
225
301
|
}
|
|
226
302
|
|
|
@@ -256,15 +332,15 @@ class CngxStatCard {
|
|
|
256
332
|
</div>
|
|
257
333
|
} @else {
|
|
258
334
|
<div class="cngx-stat-card__spinner">
|
|
259
|
-
<cngx-loading-indicator [loading]="true" variant="spinner" [label]="
|
|
335
|
+
<cngx-loading-indicator [loading]="true" variant="spinner" [label]="resolvedBusyLabel()" />
|
|
260
336
|
</div>
|
|
261
337
|
}
|
|
262
338
|
}
|
|
263
339
|
@case ('error') {
|
|
264
340
|
<cngx-empty-state
|
|
265
341
|
class="cngx-stat-card__error"
|
|
266
|
-
[title]="
|
|
267
|
-
[description]="
|
|
342
|
+
[title]="resolvedErrorText()"
|
|
343
|
+
[description]="resolvedErrorDescription()"
|
|
268
344
|
>
|
|
269
345
|
<!-- The stock empty-state glyph is an archive box, which reads
|
|
270
346
|
"nothing here" rather than "this failed". Projecting into the
|
|
@@ -286,6 +362,16 @@ class CngxStatCard {
|
|
|
286
362
|
</svg>
|
|
287
363
|
</cngx-empty-state>
|
|
288
364
|
}
|
|
365
|
+
@case ('empty') {
|
|
366
|
+
<!-- A settle with no data is its own message, not blank metric
|
|
367
|
+
slots pretending to be a figure. -->
|
|
368
|
+
<cngx-empty-state class="cngx-stat-card__empty" [title]="resolvedEmptyText()" />
|
|
369
|
+
}
|
|
370
|
+
@case ('none') {
|
|
371
|
+
<!-- Idle first load: nothing was asked for yet, so the tile shows
|
|
372
|
+
nothing - projected slots over absent data would read as a
|
|
373
|
+
real (blank) figure. -->
|
|
374
|
+
}
|
|
289
375
|
@default {
|
|
290
376
|
<div class="cngx-stat-card__stat">
|
|
291
377
|
<ng-content select="[cngxStatLabel]" />
|
|
@@ -299,14 +385,14 @@ class CngxStatCard {
|
|
|
299
385
|
<ng-content select="[cngxStatCardViz]" />
|
|
300
386
|
|
|
301
387
|
@if (activeView() === 'content+error') {
|
|
302
|
-
<p class="cngx-stat-card__stale">{{
|
|
388
|
+
<p class="cngx-stat-card__stale">{{ resolvedStaleText() }}</p>
|
|
303
389
|
}
|
|
304
390
|
}
|
|
305
391
|
}
|
|
306
392
|
|
|
307
393
|
<ng-content select="[cngxStatCardFooter]" />
|
|
308
394
|
</cngx-card>
|
|
309
|
-
`, isInline: true, styles: ["@layer cngx.tokens{.cngx-stat-card{display:block;position:relative;--cngx-stat-card-gap: var(--cngx-space-sm, .5rem);--cngx-stat-card-row-gap: var(--cngx-space-xs, .25rem);--cngx-stat-card-viz-margin: var(--cngx-space-sm, .5rem);--cngx-stat-card-footer-padding: var(--cngx-space-xs, .25rem);--cngx-stat-card-refresh-inset: var(--cngx-space-sm, .5rem);--cngx-stat-card-body-min-height: 6rem}}@layer cngx.components{@scope(.cngx-stat-card){.cngx-stat-card__stat,.cngx-stat-card__spinner,.cngx-stat-card__error{min-block-size:var(--cngx-stat-card-body-min-height)}.cngx-stat-card__stat{display:flex;flex-direction:column;justify-content:center;gap:var(--cngx-stat-card-gap)}.cngx-stat-card__row{display:flex;align-items:baseline;gap:var(--cngx-stat-card-row-gap);flex-wrap:wrap}.cngx-stat-card__viz{display:block;margin-block-start:var(--cngx-stat-card-viz-margin)}.cngx-stat-card__footer{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);padding-block-start:var(--cngx-stat-card-footer-padding);font-size:var(--cngx-stat-card-footer-size, .8125rem);color:var(--cngx-stat-card-footer-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-stat-card__footer .cngx-card-timestamp{font-size:inherit;color:inherit}.cngx-stat-card__error.cngx-empty-state{--cngx-empty-padding: 0px;--cngx-empty-gap: var(--cngx-space-xs, .25rem);--cngx-empty-title-size: var(--cngx-stat-card-error-title-size, .9375rem);display:flex;flex-direction:column;justify-content:center;text-align:center
|
|
395
|
+
`, isInline: true, styles: ["@layer cngx.tokens{.cngx-stat-card{display:block;position:relative;--cngx-stat-card-gap: var(--cngx-space-sm, .5rem);--cngx-stat-card-row-gap: var(--cngx-space-xs, .25rem);--cngx-stat-card-viz-margin: var(--cngx-space-sm, .5rem);--cngx-stat-card-footer-padding: var(--cngx-space-xs, .25rem);--cngx-stat-card-refresh-inset: var(--cngx-space-sm, .5rem);--cngx-stat-card-body-min-height: 6rem}}@layer cngx.components{@scope(.cngx-stat-card){.cngx-stat-card__stat,.cngx-stat-card__spinner,.cngx-stat-card__error,.cngx-stat-card__empty{min-block-size:var(--cngx-stat-card-body-min-height)}.cngx-stat-card__stat{display:flex;flex-direction:column;justify-content:center;gap:var(--cngx-stat-card-gap)}.cngx-stat-card__row{display:flex;align-items:baseline;gap:var(--cngx-stat-card-row-gap);flex-wrap:wrap}.cngx-stat-card__viz{display:block;margin-block-start:var(--cngx-stat-card-viz-margin)}.cngx-stat-card__footer{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);padding-block-start:var(--cngx-stat-card-footer-padding);font-size:var(--cngx-stat-card-footer-size, .8125rem);color:var(--cngx-stat-card-footer-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-stat-card__footer .cngx-card-timestamp{font-size:inherit;color:inherit}.cngx-stat-card__error.cngx-empty-state,.cngx-stat-card__empty.cngx-empty-state{--cngx-empty-padding: 0px;--cngx-empty-gap: var(--cngx-space-xs, .25rem);--cngx-empty-title-size: var(--cngx-stat-card-error-title-size, .9375rem);display:flex;flex-direction:column;justify-content:center;text-align:center}.cngx-stat-card__error.cngx-empty-state{color:var(--cngx-stat-card-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__error .cngx-empty-state__title{color:inherit}.cngx-stat-card__error-icon{inline-size:var(--cngx-stat-card-error-icon-size, 22px);block-size:var(--cngx-stat-card-error-icon-size, 22px)}.cngx-stat-card__refresh{position:absolute;inset-block-start:var(--cngx-stat-card-refresh-inset);inset-inline-end:var(--cngx-stat-card-refresh-inset);pointer-events:none}.cngx-stat-card__refresh .cngx-loading-indicator__spinner{--cngx-loading-indicator-size: var(--cngx-stat-card-refresh-size, 14px)}.cngx-stat-card__stale{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);margin:0;margin-block-start:var(--cngx-stat-card-row-gap);font-size:var(--cngx-stat-card-stale-size, .8125rem);color:var(--cngx-stat-card-stale-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__stale:before{content:\"!\" / \"\";flex:none;display:grid;place-items:center;inline-size:var(--cngx-stat-card-stale-glyph-size, 1rem);block-size:var(--cngx-stat-card-stale-glyph-size, 1rem);border-radius:50%;font-size:var(--cngx-stat-card-stale-glyph-font-size, .75rem);font-weight:700;line-height:1;color:var(--cngx-stat-card-stale-glyph-color, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-stat-card-stale-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__spinner{display:flex;align-items:center;justify-content:center}.cngx-stat-card__skeleton-line{--cngx-stat-card-skeleton-base: var( --cngx-stat-card-skeleton-color, var(--cngx-skeleton-bg, var(--cngx-color-border, oklch(.88 .005 250))) );display:block;border-radius:var(--cngx-stat-card-skeleton-radius, var(--cngx-radius-sm, 6px));background:var(--cngx-stat-card-skeleton-base)}.cngx-stat-card__stat--skeleton.cngx-skeleton--shimmer .cngx-stat-card__skeleton-line{background-image:linear-gradient(90deg,var(--cngx-stat-card-skeleton-base) 0%,var( --cngx-skeleton-shimmer-color, color-mix(in oklch, var(--cngx-stat-card-skeleton-base), white 18%) ) 50%,var(--cngx-stat-card-skeleton-base) 100%);background-size:200% 100%;animation:cngx-stat-card-shimmer var(--cngx-skeleton-shimmer-duration, 1.5s) ease-in-out infinite}.cngx-stat-card__skeleton-line--label{inline-size:var(--cngx-stat-card-skeleton-label-width, 45%);block-size:1lh}.cngx-stat-card__skeleton-line--value{inline-size:var(--cngx-stat-card-skeleton-value-width, 55%);font-size:var(--cngx-metric-value-size, 1.75rem);line-height:1.2;block-size:1lh}.cngx-stat-card__skeleton-line--delta{inline-size:var(--cngx-stat-card-skeleton-delta-width, 3rem);block-size:1lh}.cngx-stat-card__skeleton-line--caption{inline-size:var(--cngx-stat-card-skeleton-caption-width, 65%);block-size:1lh}}}@keyframes cngx-stat-card-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"], dependencies: [{ kind: "component", type: CngxCard, selector: "cngx-card", inputs: ["as", "href", "role", "ariaLabel", "selected", "selectable", "loading", "disabled", "disabledReason"], outputs: ["selectedChange", "clicked"] }, { kind: "directive", type: CngxSkeleton, selector: "[cngxSkeleton]", inputs: ["cngxSkeleton", "shimmer", "count"], exportAs: ["cngxSkeleton"] }, { kind: "component", type: CngxLoadingIndicator, selector: "cngx-loading-indicator", inputs: ["state", "loading", "variant", "label", "delay", "minDwell", "minDuration"] }, { kind: "component", type: CngxEmptyState, selector: "cngx-empty-state", inputs: ["title", "description", "state"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
310
396
|
}
|
|
311
397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatCard, decorators: [{
|
|
312
398
|
type: Component,
|
|
@@ -330,7 +416,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
330
416
|
class="cngx-stat-card__refresh"
|
|
331
417
|
[loading]="true"
|
|
332
418
|
variant="spinner"
|
|
333
|
-
[label]="
|
|
419
|
+
[label]="resolvedBusyLabel()"
|
|
334
420
|
/>
|
|
335
421
|
}
|
|
336
422
|
|
|
@@ -366,15 +452,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
366
452
|
</div>
|
|
367
453
|
} @else {
|
|
368
454
|
<div class="cngx-stat-card__spinner">
|
|
369
|
-
<cngx-loading-indicator [loading]="true" variant="spinner" [label]="
|
|
455
|
+
<cngx-loading-indicator [loading]="true" variant="spinner" [label]="resolvedBusyLabel()" />
|
|
370
456
|
</div>
|
|
371
457
|
}
|
|
372
458
|
}
|
|
373
459
|
@case ('error') {
|
|
374
460
|
<cngx-empty-state
|
|
375
461
|
class="cngx-stat-card__error"
|
|
376
|
-
[title]="
|
|
377
|
-
[description]="
|
|
462
|
+
[title]="resolvedErrorText()"
|
|
463
|
+
[description]="resolvedErrorDescription()"
|
|
378
464
|
>
|
|
379
465
|
<!-- The stock empty-state glyph is an archive box, which reads
|
|
380
466
|
"nothing here" rather than "this failed". Projecting into the
|
|
@@ -396,6 +482,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
396
482
|
</svg>
|
|
397
483
|
</cngx-empty-state>
|
|
398
484
|
}
|
|
485
|
+
@case ('empty') {
|
|
486
|
+
<!-- A settle with no data is its own message, not blank metric
|
|
487
|
+
slots pretending to be a figure. -->
|
|
488
|
+
<cngx-empty-state class="cngx-stat-card__empty" [title]="resolvedEmptyText()" />
|
|
489
|
+
}
|
|
490
|
+
@case ('none') {
|
|
491
|
+
<!-- Idle first load: nothing was asked for yet, so the tile shows
|
|
492
|
+
nothing - projected slots over absent data would read as a
|
|
493
|
+
real (blank) figure. -->
|
|
494
|
+
}
|
|
399
495
|
@default {
|
|
400
496
|
<div class="cngx-stat-card__stat">
|
|
401
497
|
<ng-content select="[cngxStatLabel]" />
|
|
@@ -409,15 +505,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
409
505
|
<ng-content select="[cngxStatCardViz]" />
|
|
410
506
|
|
|
411
507
|
@if (activeView() === 'content+error') {
|
|
412
|
-
<p class="cngx-stat-card__stale">{{
|
|
508
|
+
<p class="cngx-stat-card__stale">{{ resolvedStaleText() }}</p>
|
|
413
509
|
}
|
|
414
510
|
}
|
|
415
511
|
}
|
|
416
512
|
|
|
417
513
|
<ng-content select="[cngxStatCardFooter]" />
|
|
418
514
|
</cngx-card>
|
|
419
|
-
`, styles: ["@layer cngx.tokens{.cngx-stat-card{display:block;position:relative;--cngx-stat-card-gap: var(--cngx-space-sm, .5rem);--cngx-stat-card-row-gap: var(--cngx-space-xs, .25rem);--cngx-stat-card-viz-margin: var(--cngx-space-sm, .5rem);--cngx-stat-card-footer-padding: var(--cngx-space-xs, .25rem);--cngx-stat-card-refresh-inset: var(--cngx-space-sm, .5rem);--cngx-stat-card-body-min-height: 6rem}}@layer cngx.components{@scope(.cngx-stat-card){.cngx-stat-card__stat,.cngx-stat-card__spinner,.cngx-stat-card__error{min-block-size:var(--cngx-stat-card-body-min-height)}.cngx-stat-card__stat{display:flex;flex-direction:column;justify-content:center;gap:var(--cngx-stat-card-gap)}.cngx-stat-card__row{display:flex;align-items:baseline;gap:var(--cngx-stat-card-row-gap);flex-wrap:wrap}.cngx-stat-card__viz{display:block;margin-block-start:var(--cngx-stat-card-viz-margin)}.cngx-stat-card__footer{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);padding-block-start:var(--cngx-stat-card-footer-padding);font-size:var(--cngx-stat-card-footer-size, .8125rem);color:var(--cngx-stat-card-footer-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-stat-card__footer .cngx-card-timestamp{font-size:inherit;color:inherit}.cngx-stat-card__error.cngx-empty-state{--cngx-empty-padding: 0px;--cngx-empty-gap: var(--cngx-space-xs, .25rem);--cngx-empty-title-size: var(--cngx-stat-card-error-title-size, .9375rem);display:flex;flex-direction:column;justify-content:center;text-align:center
|
|
420
|
-
}], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], loadingTreatment: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTreatment", required: false }] }], busyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "busyLabel", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], errorDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDescription", required: false }] }], staleText: [{ type: i0.Input, args: [{ isSignal: true, alias: "staleText", required: false }] }], live: [{ type: i0.Input, args: [{ isSignal: true, alias: "live", required: false }] }] } });
|
|
515
|
+
`, styles: ["@layer cngx.tokens{.cngx-stat-card{display:block;position:relative;--cngx-stat-card-gap: var(--cngx-space-sm, .5rem);--cngx-stat-card-row-gap: var(--cngx-space-xs, .25rem);--cngx-stat-card-viz-margin: var(--cngx-space-sm, .5rem);--cngx-stat-card-footer-padding: var(--cngx-space-xs, .25rem);--cngx-stat-card-refresh-inset: var(--cngx-space-sm, .5rem);--cngx-stat-card-body-min-height: 6rem}}@layer cngx.components{@scope(.cngx-stat-card){.cngx-stat-card__stat,.cngx-stat-card__spinner,.cngx-stat-card__error,.cngx-stat-card__empty{min-block-size:var(--cngx-stat-card-body-min-height)}.cngx-stat-card__stat{display:flex;flex-direction:column;justify-content:center;gap:var(--cngx-stat-card-gap)}.cngx-stat-card__row{display:flex;align-items:baseline;gap:var(--cngx-stat-card-row-gap);flex-wrap:wrap}.cngx-stat-card__viz{display:block;margin-block-start:var(--cngx-stat-card-viz-margin)}.cngx-stat-card__footer{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);padding-block-start:var(--cngx-stat-card-footer-padding);font-size:var(--cngx-stat-card-footer-size, .8125rem);color:var(--cngx-stat-card-footer-color, var(--cngx-color-text-muted, oklch(.5 .01 250)))}.cngx-stat-card__footer .cngx-card-timestamp{font-size:inherit;color:inherit}.cngx-stat-card__error.cngx-empty-state,.cngx-stat-card__empty.cngx-empty-state{--cngx-empty-padding: 0px;--cngx-empty-gap: var(--cngx-space-xs, .25rem);--cngx-empty-title-size: var(--cngx-stat-card-error-title-size, .9375rem);display:flex;flex-direction:column;justify-content:center;text-align:center}.cngx-stat-card__error.cngx-empty-state{color:var(--cngx-stat-card-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__error .cngx-empty-state__title{color:inherit}.cngx-stat-card__error-icon{inline-size:var(--cngx-stat-card-error-icon-size, 22px);block-size:var(--cngx-stat-card-error-icon-size, 22px)}.cngx-stat-card__refresh{position:absolute;inset-block-start:var(--cngx-stat-card-refresh-inset);inset-inline-end:var(--cngx-stat-card-refresh-inset);pointer-events:none}.cngx-stat-card__refresh .cngx-loading-indicator__spinner{--cngx-loading-indicator-size: var(--cngx-stat-card-refresh-size, 14px)}.cngx-stat-card__stale{display:flex;align-items:center;gap:var(--cngx-stat-card-row-gap);margin:0;margin-block-start:var(--cngx-stat-card-row-gap);font-size:var(--cngx-stat-card-stale-size, .8125rem);color:var(--cngx-stat-card-stale-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__stale:before{content:\"!\" / \"\";flex:none;display:grid;place-items:center;inline-size:var(--cngx-stat-card-stale-glyph-size, 1rem);block-size:var(--cngx-stat-card-stale-glyph-size, 1rem);border-radius:50%;font-size:var(--cngx-stat-card-stale-glyph-font-size, .75rem);font-weight:700;line-height:1;color:var(--cngx-stat-card-stale-glyph-color, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-stat-card-stale-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-stat-card__spinner{display:flex;align-items:center;justify-content:center}.cngx-stat-card__skeleton-line{--cngx-stat-card-skeleton-base: var( --cngx-stat-card-skeleton-color, var(--cngx-skeleton-bg, var(--cngx-color-border, oklch(.88 .005 250))) );display:block;border-radius:var(--cngx-stat-card-skeleton-radius, var(--cngx-radius-sm, 6px));background:var(--cngx-stat-card-skeleton-base)}.cngx-stat-card__stat--skeleton.cngx-skeleton--shimmer .cngx-stat-card__skeleton-line{background-image:linear-gradient(90deg,var(--cngx-stat-card-skeleton-base) 0%,var( --cngx-skeleton-shimmer-color, color-mix(in oklch, var(--cngx-stat-card-skeleton-base), white 18%) ) 50%,var(--cngx-stat-card-skeleton-base) 100%);background-size:200% 100%;animation:cngx-stat-card-shimmer var(--cngx-skeleton-shimmer-duration, 1.5s) ease-in-out infinite}.cngx-stat-card__skeleton-line--label{inline-size:var(--cngx-stat-card-skeleton-label-width, 45%);block-size:1lh}.cngx-stat-card__skeleton-line--value{inline-size:var(--cngx-stat-card-skeleton-value-width, 55%);font-size:var(--cngx-metric-value-size, 1.75rem);line-height:1.2;block-size:1lh}.cngx-stat-card__skeleton-line--delta{inline-size:var(--cngx-stat-card-skeleton-delta-width, 3rem);block-size:1lh}.cngx-stat-card__skeleton-line--caption{inline-size:var(--cngx-stat-card-skeleton-caption-width, 65%);block-size:1lh}}}@keyframes cngx-stat-card-shimmer{0%{background-position:-200% 0}to{background-position:200% 0}}\n"] }]
|
|
516
|
+
}], propDecorators: { state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], loadingTreatment: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingTreatment", required: false }] }], busyLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "busyLabel", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], errorDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorDescription", required: false }] }], staleText: [{ type: i0.Input, args: [{ isSignal: true, alias: "staleText", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], live: [{ type: i0.Input, args: [{ isSignal: true, alias: "live", required: false }] }] } });
|
|
421
517
|
|
|
422
518
|
/**
|
|
423
519
|
* Marks the inline visualisation of a {@link CngxStatCard} - a `cngx-sparkline`,
|
|
@@ -467,6 +563,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
467
563
|
}]
|
|
468
564
|
}] });
|
|
469
565
|
|
|
566
|
+
const NO_ARIA_LABELS = {};
|
|
470
567
|
/**
|
|
471
568
|
* Reduces a list of feature objects into a partial config - last write wins
|
|
472
569
|
* per sub-tree. Inner objects are spread-merged so partial overrides compose
|
|
@@ -479,7 +576,7 @@ function reduceFeatures(features) {
|
|
|
479
576
|
for (const f of features) {
|
|
480
577
|
switch (f.kind) {
|
|
481
578
|
case 'ariaLabels':
|
|
482
|
-
out.ariaLabels =
|
|
579
|
+
out.ariaLabels = createOverrideMerge(out.ariaLabels ?? NO_ARIA_LABELS, f.payload);
|
|
483
580
|
break;
|
|
484
581
|
case 'loadingTreatment':
|
|
485
582
|
out.loadingTreatment = f.payload.loadingTreatment;
|
|
@@ -497,7 +594,7 @@ function reduceFeatures(features) {
|
|
|
497
594
|
*/
|
|
498
595
|
function mergeConfig(base, partial) {
|
|
499
596
|
return {
|
|
500
|
-
ariaLabels:
|
|
597
|
+
ariaLabels: createOverrideMerge(base.ariaLabels ?? NO_ARIA_LABELS, partial.ariaLabels),
|
|
501
598
|
loadingTreatment: partial.loadingTreatment ?? base.loadingTreatment,
|
|
502
599
|
};
|
|
503
600
|
}
|
|
@@ -579,7 +676,10 @@ function provideStatCardConfigAt(...features) {
|
|
|
579
676
|
* first-load error message, and the stale-data note. Per-instance
|
|
580
677
|
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.
|
|
581
678
|
*
|
|
582
|
-
*
|
|
679
|
+
* The defaults come from the `statCard` section of the language pack (English
|
|
680
|
+
* without one); this overrides single keys on top of it. Pass a
|
|
681
|
+
* `Signal` to switch the language at runtime; a tile with a live region speaks
|
|
682
|
+
* the new language with its next state change.
|
|
583
683
|
*
|
|
584
684
|
* ```ts
|
|
585
685
|
* provideStatCardConfig(
|
|
@@ -614,5 +714,5 @@ function withStatCardLoadingTreatment(treatment) {
|
|
|
614
714
|
* Generated bundle index. Do not edit.
|
|
615
715
|
*/
|
|
616
716
|
|
|
617
|
-
export { CNGX_STAT_CARD_CONFIG, CngxStatCard, CngxStatCardFooter, CngxStatCardViz, injectStatCardConfig, provideStatCardConfig, provideStatCardConfigAt, withStatCardAriaLabels, withStatCardLoadingTreatment };
|
|
717
|
+
export { CNGX_STAT_CARD_CONFIG, CNGX_STAT_CARD_LANGUAGE_EN, CngxStatCard, CngxStatCardFooter, CngxStatCardViz, injectStatCardAriaLabels, injectStatCardConfig, provideStatCardConfig, provideStatCardConfigAt, withStatCardAriaLabels, withStatCardLoadingTreatment };
|
|
618
718
|
//# sourceMappingURL=cngx-ui-stat-card.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-ui-stat-card.mjs","sources":["../../../projects/ui/stat-card/config/stat-card.config.defaults.ts","../../../projects/ui/stat-card/config/inject-stat-card-config.ts","../../../projects/ui/stat-card/stat-card.component.ts","../../../projects/ui/stat-card/stat-card-slots.ts","../../../projects/ui/stat-card/config/provide-stat-card-config.ts","../../../projects/ui/stat-card/config/features.ts","../../../projects/ui/stat-card/public-api.ts","../../../projects/ui/stat-card/cngx-ui-stat-card.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport type { CngxStatCardConfig } from './stat-card.config';\n\n/**\n * Library defaults for the stat-card configuration cascade. English by\n * default; locale overrides ride the `withStatCardAriaLabels` feature. The\n * values are byte-identical to the per-instance input defaults the component\n * shipped before the cascade, so an un-configured consumer sees no change.\n *\n * Exported for intra-lib consumers (`provideStatCardConfig` deep-merges with\n * this base) but **NOT** re-exported from `public-api.ts` - downstream\n * consumers reach the defaults via `inject(CNGX_STAT_CARD_CONFIG)` so\n * `provideStatCardConfig` / `provideStatCardConfigAt` overrides take\n * precedence.\n *\n * @internal\n */\nexport const CNGX_STAT_CARD_DEFAULTS: CngxStatCardConfig = {\n ariaLabels: {\n busy: 'Loading',\n errorFallback: 'Could not load',\n staleFallback: 'Showing last known value',\n },\n loadingTreatment: 'auto',\n};\n\n/**\n * App-wide configuration cascade for the stat-card. Resolves in priority\n * order:\n *\n * 1. Per-instance Input binding.\n * 2. `provideStatCardConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideStatCardConfig(...)` at the application root.\n * 4. Library defaults (this token's `factory`).\n *\n * `providedIn: 'root'` with a default factory means consumers never need to\n * provide the token explicitly - `inject(CNGX_STAT_CARD_CONFIG)` always\n * resolves.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/config/stat-card.config.defaults.ts\n * @since 0.1.0\n * @relatedTo provideStatCardConfig, provideStatCardConfigAt, injectStatCardConfig\n */\nexport const CNGX_STAT_CARD_CONFIG = new InjectionToken<CngxStatCardConfig>(\n 'CNGX_STAT_CARD_CONFIG',\n {\n providedIn: 'root',\n factory: () => CNGX_STAT_CARD_DEFAULTS,\n },\n);\n","import { inject } from '@angular/core';\n\nimport type { CngxStatCardConfig } from './stat-card.config';\nimport { CNGX_STAT_CARD_CONFIG } from './stat-card.config.defaults';\n\n/**\n * Convenience accessor for the stat-card configuration cascade. Runs in\n * injection context; resolves through the priority chain (per-instance Input\n * -> `provideStatCardConfigAt` -> `provideStatCardConfig` -> library\n * defaults). Equivalent to `inject(CNGX_STAT_CARD_CONFIG)` - the helper exists\n * so consumers don't import the token directly.\n *\n * ```ts\n * export class CngxStatCard {\n * private readonly cfg = injectStatCardConfig();\n * readonly errorText = input<string>(this.cfg.ariaLabels?.errorFallback ?? 'Could not load');\n * }\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function injectStatCardConfig(): CngxStatCardConfig {\n return inject(CNGX_STAT_CARD_CONFIG);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { CngxCard } from '@cngx/common/card';\nimport {\n CNGX_STAT,\n CngxStatCoordinator,\n resolveAsyncView,\n type CngxStatSlotKind,\n} from '@cngx/common/data';\nimport { CngxSkeleton } from '@cngx/common/layout';\nimport {\n createLatencyProbe,\n injectLoadingConfig,\n resolveLoadingTreatment,\n type CngxAsyncState,\n type CngxLoadingTreatment,\n} from '@cngx/core/utils';\nimport { CngxEmptyState } from '@cngx/ui/empty-state';\nimport { CngxLoadingIndicator } from '@cngx/ui/feedback';\n\nimport { injectStatCardConfig } from './config/inject-stat-card-config';\n\n/** Placeholder shape for a card whose consumer projected no stat slots at all. */\nconst DEFAULT_SKELETON_SLOTS: readonly CngxStatSlotKind[] = ['label', 'value', 'caption'];\n\n/**\n * Card-framed KPI tile: one `<cngx-stat-card>` renders a complete dashboard\n * metric - card surface, coordinated stat slots, an inline visualisation, a\n * footer, and the async view switch - from a single `[state]`.\n *\n * The stat slots are the existing `cngxStatLabel` / `cngxStatValue` /\n * `cngxStatDelta` / `cngxStatCaption` atoms from `@cngx/common/data`, not\n * copies. They resolve `CNGX_STAT` against their declaration site, so the card\n * hosts the same {@link CngxStatCoordinator} brain `CngxStat` hosts and\n * re-points the token at it - the shape `CngxIncrementalList` uses for\n * `CNGX_PAGINATOR_HOST`. A screen reader therefore reads the tile as one\n * phrase, not four fragments (Pillar 2).\n *\n * The view switch is a pure `computed()` off `[state]` via `resolveAsyncView`\n * (Pillar 1) - there is no second state machine and no boolean fallback inputs.\n *\n * Like `cngx-chart`, the card does **not** provide `CNGX_STATEFUL`: the\n * consumer already holds the state object it bound, so transition bridges take\n * it directly, e.g. `<cngx-toast-on [state]=\"revenue\" />`.\n *\n * ```html\n * <cngx-stat-card [state]=\"revenue\">\n * <span cngxStatLabel>Revenue</span>\n * <cngx-metric cngxStatValue [value]=\"1.2\" unit=\"M EUR\" />\n * <cngx-delta cngxStatDelta [value]=\"5.3\" />\n * <span cngxStatCaption>vs. last quarter</span>\n * <cngx-sparkline cngxStatCardViz [data]=\"trend()\" />\n * </cngx-stat-card>\n * ```\n *\n * @category ui/stat-card\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card.component.ts\n * @since 0.1.0\n * @relatedTo CngxStat, CngxStatCoordinator, CngxStatCardViz, CngxStatCardFooter, CngxCard\n *\n * <example-url>http://localhost:4200/#/ui/stat-card/basic/composed-kpi-tile</example-url>\n * <example-url>http://localhost:4200/#/ui/stat-card/async/latency-aware-loading</example-url>\n * <example-url>http://localhost:4200/#/ui/stat-card/async/error-and-refresh</example-url>\n */\n@Component({\n selector: 'cngx-stat-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxCard, CngxSkeleton, CngxLoadingIndicator, CngxEmptyState],\n hostDirectives: [CngxStatCoordinator],\n providers: [{ provide: CNGX_STAT, useExisting: CngxStatCoordinator }],\n host: {\n class: 'cngx-stat-card',\n '[attr.aria-busy]': 'busy() || null',\n '[class.cngx-stat-card--busy]': 'busy()',\n },\n template: `\n <cngx-card\n [attr.aria-labelledby]=\"cardLabelledBy()\"\n [attr.aria-live]=\"live() === 'off' ? null : live()\"\n >\n <!-- A refresh over existing content would otherwise be invisible: the view\n stays 'content' and only aria-busy flips, which says nothing to a\n sighted user. The indicator is absolutely placed and the figure only\n dims, so the tile never reflows while refreshing - a dashboard grid\n would otherwise twitch on every poll. It carries the loading config's\n show-delay and min-dwell, so a fast refresh never flashes. -->\n @if (showRefreshIndicator()) {\n <cngx-loading-indicator\n class=\"cngx-stat-card__refresh\"\n [loading]=\"true\"\n variant=\"spinner\"\n [label]=\"busyLabel()\"\n />\n }\n\n @switch (activeView()) {\n @case ('skeleton') {\n @if (resolvedTreatment() === 'skeleton') {\n <!-- Same container and same row structure as the content branch, so\n each bar sits exactly where its text will, and the swap to\n content does not resize the tile. -->\n <div\n class=\"cngx-stat-card__stat cngx-stat-card__stat--skeleton\"\n [cngxSkeleton]=\"true\"\n aria-hidden=\"true\"\n >\n @if (skeletonSlots().includes('label')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--label\">\n </span>\n }\n <div class=\"cngx-stat-card__row\">\n @if (skeletonSlots().includes('value')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--value\">\n </span>\n }\n @if (skeletonSlots().includes('delta')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--delta\">\n </span>\n }\n </div>\n @if (skeletonSlots().includes('caption')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--caption\">\n </span>\n }\n </div>\n } @else {\n <div class=\"cngx-stat-card__spinner\">\n <cngx-loading-indicator [loading]=\"true\" variant=\"spinner\" [label]=\"busyLabel()\" />\n </div>\n }\n }\n @case ('error') {\n <cngx-empty-state\n class=\"cngx-stat-card__error\"\n [title]=\"errorText()\"\n [description]=\"errorDescription()\"\n >\n <!-- The stock empty-state glyph is an archive box, which reads\n \"nothing here\" rather than \"this failed\". Projecting into the\n icon slot hides it. Decorative: the title carries the message. -->\n <svg\n cngxEmptyStateIcon\n class=\"cngx-stat-card__error-icon\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </cngx-empty-state>\n }\n @default {\n <div class=\"cngx-stat-card__stat\">\n <ng-content select=\"[cngxStatLabel]\" />\n <div class=\"cngx-stat-card__row\">\n <ng-content select=\"[cngxStatValue]\" />\n <ng-content select=\"[cngxStatDelta]\" />\n </div>\n <ng-content select=\"[cngxStatCaption]\" />\n </div>\n\n <ng-content select=\"[cngxStatCardViz]\" />\n\n @if (activeView() === 'content+error') {\n <p class=\"cngx-stat-card__stale\">{{ staleText() }}</p>\n }\n }\n }\n\n <ng-content select=\"[cngxStatCardFooter]\" />\n </cngx-card>\n `,\n styleUrls: ['./stat-card.component.css'],\n})\nexport class CngxStatCard {\n /** @internal The shared slot-id brain, applied as a host directive. */\n protected readonly coordinator = inject(CngxStatCoordinator, { host: true });\n\n private readonly config = injectStatCardConfig();\n\n /**\n * The tile's async envelope. Every view decision derives from it; there are\n * no discrete `loading` / `error` boolean fallbacks. Optional per the\n * bridge-input rule, so `[state]` may be bound conditionally.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined, CngxAsyncState<unknown> | '' | undefined>(\n undefined,\n { transform: (v) => (typeof v === 'string' ? undefined : v) },\n );\n\n /**\n * What the card shows while it loads. `'auto'` (default) picks from the\n * latency the tile itself observed: a tile whose last load was quick shows a\n * spinner blip, one whose last load dragged shows a skeleton. `'spinner'` and\n * `'skeleton'` pin the choice.\n */\n readonly loadingTreatment = input<CngxLoadingTreatment>(this.config.loadingTreatment ?? 'auto');\n\n /** Accessible label announced while the card is loading. */\n readonly busyLabel = input<string>(this.config.ariaLabels?.busy ?? 'Loading');\n\n /** Headline of the error state shown instead of the stat when the first load failed. */\n readonly errorText = input<string>(this.config.ariaLabels?.errorFallback ?? 'Could not load');\n\n /** Supporting detail under {@link errorText}. Omitted when unset. */\n readonly errorDescription = input<string | undefined>(\n this.config.ariaLabels?.errorDescription,\n );\n\n /** Note appended below the stat when a refresh failed but stale data is still shown. */\n readonly staleText = input<string>(\n this.config.ariaLabels?.staleFallback ?? 'Showing last known value',\n );\n\n /**\n * Politeness of the tile's live region. `off` (default) for a static KPI;\n * `polite` for a tile that refreshes on a timer, so the new figure is\n * announced instead of changing silently. Mirrors `CngxStat.live`.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** @internal Whether any operation is running. Drives `aria-busy` (Pillar 2). */\n protected readonly busy = computed(() => this.state()?.isBusy() ?? false);\n\n /**\n * @internal A refresh over content the user can still read. The skeleton and\n * spinner branches already carry their own busy signal, so the bar would be\n * redundant there.\n */\n /**\n * @internal Which bars the placeholder draws. Mirrors the slots the consumer\n * actually projected, so a tile without a delta gets no delta bar. Falls back\n * to the common label / value / caption shape when nothing has registered -\n * a card with no stat slots at all still needs a plausible placeholder.\n */\n protected readonly skeletonSlots = computed<readonly CngxStatSlotKind[]>(() => {\n const present = this.coordinator.presentKinds();\n return present.length > 0 ? present : DEFAULT_SKELETON_SLOTS;\n });\n\n protected readonly showRefreshIndicator = computed(\n () => this.busy() && this.activeView() !== 'skeleton',\n );\n\n private readonly loadingConfig = injectLoadingConfig();\n\n /**\n * Measures how long this tile's own busy windows last. The measurement is a\n * wall-clock sample the probe writes from an effect; the selection below stays\n * a pure `computed()`, so nothing in the reactive graph writes state.\n */\n private readonly probe = createLatencyProbe(() => this.busy());\n\n /**\n * Spinner or skeleton for the current load, from the observed latency and the\n * cascaded cutoff. Never a hardcoded millisecond threshold - the cutoff always\n * comes from `CNGX_LOADING_CONFIG`, so one `provideLoadingConfig(...)` retunes\n * every tile in the app.\n */\n protected readonly resolvedTreatment = computed(() =>\n resolveLoadingTreatment(\n this.loadingTreatment(),\n this.probe.lastDuration(),\n this.loadingConfig.spinnerVsSkeletonCutoff,\n ),\n );\n\n /**\n * Which body the card renders. Delegates to the shared `resolveAsyncView`\n * lookup table so the tile cannot drift from every other async surface.\n * Without a bound `[state]` the card always shows its content.\n */\n /**\n * @internal The card element carries the accessible name, so the tile is one\n * named region instead of an unnamed `article` wrapped around a named group.\n * Null while the stat is not rendered: the slot ids live inside the content\n * branch, and pointing at ids that are out of the DOM reads as unnamed anyway.\n */\n protected readonly cardLabelledBy = computed(() => {\n const view = this.activeView();\n return view === 'skeleton' || view === 'error' ? null : this.coordinator.labelledBy();\n });\n\n protected readonly activeView = computed(() => {\n const s = this.state();\n if (!s) {\n return 'content' as const;\n }\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Marks the inline visualisation of a {@link CngxStatCard} - a `cngx-sparkline`,\n * `cngx-mini-area`, `cngx-deviation-bar`, or any other compact chart preset.\n *\n * Rendered beside the stat block and outside its `aria-labelledby` chain: the\n * accessible name stays the numbers a screen reader can actually read, while\n * the viz stays decorative unless the projected preset carries its own\n * accessible name.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts\n * @since 0.1.0\n * @relatedTo CngxStatCard, CngxStatCardFooter\n */\n@Directive({\n selector: '[cngxStatCardViz]',\n standalone: true,\n host: { class: 'cngx-stat-card__viz' },\n})\nexport class CngxStatCardViz {}\n\n/**\n * Marks the footer row of a {@link CngxStatCard} - a timestamp, a drill-down\n * link, a `cngx-tag` row. Rendered below the stat block and the viz slot.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts\n * @since 0.1.0\n * @relatedTo CngxStatCard, CngxStatCardViz\n */\n@Directive({\n selector: '[cngxStatCardFooter]',\n standalone: true,\n host: { class: 'cngx-stat-card__footer' },\n})\nexport class CngxStatCardFooter {}\n","import {\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport type { CngxStatCardConfig } from './stat-card.config';\nimport { CNGX_STAT_CARD_CONFIG, CNGX_STAT_CARD_DEFAULTS } from './stat-card.config.defaults';\n\n/**\n * Discriminated-union shape returned by the stat-card config features -\n * `withStatCardAriaLabels` and `withStatCardLoadingTreatment`. The reducer in\n * `provideStatCardConfig` / `provideStatCardConfigAt` matches on `kind` and\n * merges `payload` into the corresponding config sub-tree. Mirrors\n * `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across\n * feature areas.\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport type CngxStatCardConfigFeature =\n | {\n readonly kind: 'ariaLabels';\n readonly payload: NonNullable<CngxStatCardConfig['ariaLabels']>;\n }\n | {\n readonly kind: 'loadingTreatment';\n readonly payload: { readonly loadingTreatment: NonNullable<CngxStatCardConfig['loadingTreatment']> };\n };\n\n/**\n * Reduces a list of feature objects into a partial config - last write wins\n * per sub-tree. Inner objects are spread-merged so partial overrides compose\n * cleanly with prior writes.\n *\n * @internal\n */\nfunction reduceFeatures(\n features: readonly CngxStatCardConfigFeature[],\n): Partial<CngxStatCardConfig> {\n const out: {\n ariaLabels?: NonNullable<CngxStatCardConfig['ariaLabels']>;\n loadingTreatment?: NonNullable<CngxStatCardConfig['loadingTreatment']>;\n } = {};\n for (const f of features) {\n switch (f.kind) {\n case 'ariaLabels':\n out.ariaLabels = { ...out.ariaLabels, ...f.payload };\n break;\n case 'loadingTreatment':\n out.loadingTreatment = f.payload.loadingTreatment;\n break;\n }\n }\n return out;\n}\n\n/**\n * Two-level deep merge: the nested `ariaLabels` sub-tree is spread-merged so a\n * partial fills in missing keys without nuking the rest; the flat top-level\n * scalar `loadingTreatment` takes the partial when present, else the base.\n *\n * @internal\n */\nfunction mergeConfig(\n base: CngxStatCardConfig,\n partial: Partial<CngxStatCardConfig>,\n): CngxStatCardConfig {\n return {\n ariaLabels: { ...base.ariaLabels, ...partial.ariaLabels },\n loadingTreatment: partial.loadingTreatment ?? base.loadingTreatment,\n };\n}\n\n/**\n * Application-root configuration cascade for the stat-card. Pass any\n * combination of `withStatCardAriaLabels` and `withStatCardLoadingTreatment`\n * in `bootstrapApplication`'s providers array.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStatCardConfig(\n * withStatCardAriaLabels({ errorFallback: 'Kennzahl nicht verfügbar' }),\n * withStatCardLoadingTreatment('skeleton'),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function provideStatCardConfig(\n ...features: CngxStatCardConfigFeature[]\n): EnvironmentProviders {\n // Empty-features: skip the override so the root factory's\n // CNGX_STAT_CARD_DEFAULTS reference flows through untouched. A fresh\n // mergeConfig(...) would allocate identical content under a new reference\n // and bust downstream identity comparisons.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n const partial = reduceFeatures(features);\n return makeEnvironmentProviders([\n {\n provide: CNGX_STAT_CARD_CONFIG,\n useValue: mergeConfig(CNGX_STAT_CARD_DEFAULTS, partial),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration cascade for the stat-card. Pass any\n * combination of feature factories in a parent component's `viewProviders`.\n *\n * Unlike `provideStatCardConfig` (root-only), this injects the parent\n * injector's `CNGX_STAT_CARD_CONFIG` value and deep-merges the supplied\n * features on top. Descendant tiles see the merged config; sibling sub-trees\n * keep the inherited value untouched.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideStatCardConfigAt(withStatCardLoadingTreatment('spinner'))],\n * template: '<cngx-stat-card [state]=\"s\" />',\n * })\n * class LiveTiles {}\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function provideStatCardConfigAt(...features: CngxStatCardConfigFeature[]): Provider[] {\n // Empty-features call: parent value flows through untouched. Skipping the\n // factory preserves reference identity through the sub-tree.\n if (features.length === 0) {\n return [];\n }\n const partial = reduceFeatures(features);\n return [\n {\n provide: CNGX_STAT_CARD_CONFIG,\n useFactory: () => {\n const parent = inject(CNGX_STAT_CARD_CONFIG, { skipSelf: true });\n return mergeConfig(parent, partial);\n },\n },\n ];\n}\n","import type { CngxLoadingTreatment } from '@cngx/core/utils';\n\nimport type { CngxStatCardConfig } from './stat-card.config';\nimport type { CngxStatCardConfigFeature } from './provide-stat-card-config';\n\n/**\n * Override the stat-card's string fallbacks - the busy announcement, the\n * first-load error message, and the stale-data note. Per-instance\n * `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.\n *\n * Library defaults are English; this is the hook a localised app uses.\n *\n * ```ts\n * provideStatCardConfig(\n * withStatCardAriaLabels({ busy: 'Lädt', errorFallback: 'Nicht verfügbar' }),\n * );\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function withStatCardAriaLabels(\n labels: NonNullable<CngxStatCardConfig['ariaLabels']>,\n): CngxStatCardConfigFeature {\n return { kind: 'ariaLabels', payload: labels };\n}\n\n/**\n * Move the cascade default for what a tile renders while it loads. `'auto'`\n * (the library default) picks spinner vs skeleton from the latency the tile\n * observed; `'spinner'` and `'skeleton'` pin it app-wide. Per-instance\n * `[loadingTreatment]` still wins.\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function withStatCardLoadingTreatment(\n treatment: CngxLoadingTreatment,\n): CngxStatCardConfigFeature {\n return { kind: 'loadingTreatment', payload: { loadingTreatment: treatment } };\n}\n","/**\n * @module @cngx/ui/stat-card\n */\n\nexport { CngxStatCard } from './stat-card.component';\nexport { CngxStatCardViz, CngxStatCardFooter } from './stat-card-slots';\nexport { type CngxStatCardConfig } from './config/stat-card.config';\nexport { CNGX_STAT_CARD_CONFIG } from './config/stat-card.config.defaults';\nexport {\n provideStatCardConfig,\n provideStatCardConfigAt,\n type CngxStatCardConfigFeature,\n} from './config/provide-stat-card-config';\nexport { withStatCardAriaLabels, withStatCardLoadingTreatment } from './config/features';\nexport { injectStatCardConfig } from './config/inject-stat-card-config';\n\n// The four coordinated stat slots are the existing atoms from @cngx/common/data,\n// re-exported for a local import surface. A slot projected into the card injects\n// the same CNGX_STAT the card provides - one token, one shape, no new contract.\nexport {\n CngxStatLabel,\n CngxStatValue,\n CngxStatDelta,\n CngxStatCaption,\n CNGX_STAT,\n type CngxStatRegistry,\n} from '@cngx/common/data';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;AAaG;AACI,MAAM,uBAAuB,GAAuB;AACzD,IAAA,UAAU,EAAE;AACV,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,aAAa,EAAE,gBAAgB;AAC/B,QAAA,aAAa,EA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;AACA,IAAA,MAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC;IACxC,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;YAC9B,UAAU,EAAE,MAAK;AACf,gBAAA,MAAM,MAAM,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAChE,gBAAA,OAAO,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;YACrC,CAAC;AACF,SAAA;KACF;AACH;;AChJA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,sBAAsB,CACpC,MAAqD,EAAA;IAErD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE;AAChD;AAEA;;;;;;;;AAQG;AACG,SAAU,4BAA4B,CAC1C,SAA+B,EAAA;AAE/B,IAAA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE,EAAE;AAC/E;;ACxCA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-ui-stat-card.mjs","sources":["../../../projects/ui/stat-card/i18n/stat-card-language-section.ts","../../../projects/ui/stat-card/i18n/stat-card-i18n.ts","../../../projects/ui/stat-card/config/stat-card.config.defaults.ts","../../../projects/ui/stat-card/config/inject-stat-card-config.ts","../../../projects/ui/stat-card/stat-card.component.ts","../../../projects/ui/stat-card/stat-card-slots.ts","../../../projects/ui/stat-card/config/provide-stat-card-config.ts","../../../projects/ui/stat-card/config/features.ts","../../../projects/ui/stat-card/public-api.ts","../../../projects/ui/stat-card/cngx-ui-stat-card.ts"],"sourcesContent":["/**\n * The stat-card section of a {@link CngxLanguagePack}: the state copy of\n * `CngxStatCard`. It feeds the `ariaLabels` of `CNGX_STAT_CARD_CONFIG`; a key\n * set through `withStatCardAriaLabels` or a bound copy input still wins.\n *\n * @category ui/stat-card/i18n\n * @since 0.1.0\n * @relatedTo CNGX_STAT_CARD_CONFIG, withStatCardAriaLabels\n */\nexport interface CngxStatCardLanguageSection {\n /** Accessible name announced while the tile is loading. */\n readonly busy: string;\n /** Headline of the error state shown when the first load failed. */\n readonly errorFallback: string;\n /** Note shown below stale numbers when a refresh failed. */\n readonly staleFallback: string;\n /** Headline of the empty state shown when a load settled with no data. */\n readonly emptyFallback: string;\n}\n\n/**\n * The English stat-card section: the single source of the stat card's English\n * copy. The `CNGX_STAT_CARD_CONFIG` labels default to it.\n *\n * @category ui/stat-card/i18n\n * @since 0.1.0\n * @relatedTo CNGX_STAT_CARD_CONFIG\n */\nexport const CNGX_STAT_CARD_LANGUAGE_EN: CngxStatCardLanguageSection = {\n busy: 'Loading',\n errorFallback: 'Could not load',\n staleFallback: 'Showing last known value',\n emptyFallback: 'No data',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly statCard: CngxStatCardLanguageSection;\n }\n}\n","import { createLanguageSection } from '@cngx/core/i18n';\n\nimport { CNGX_STAT_CARD_LANGUAGE_EN } from './stat-card-language-section';\n\n/**\n * @internal The stat-card section of the active pack over the English section,\n * shared app-wide. Consumers override copy through `withStatCardAriaLabels`.\n */\nexport const injectStatCardSiteCopy = createLanguageSection('statCard', CNGX_STAT_CARD_LANGUAGE_EN);\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxStatCardConfig } from './stat-card.config';\n\n/**\n * Library defaults for the stat-card configuration cascade. Carries no copy:\n * the `ariaLabels` defaults are the `statCard` section of the language pack;\n * single keys ride the `withStatCardAriaLabels` feature.\n *\n * Exported for intra-lib consumers (`provideStatCardConfig` deep-merges with\n * this base) but **NOT** re-exported from `public-api.ts` - downstream\n * consumers reach the defaults via `inject(CNGX_STAT_CARD_CONFIG)` so\n * `provideStatCardConfig` / `provideStatCardConfigAt` overrides take\n * precedence.\n *\n * @internal\n */\nexport const CNGX_STAT_CARD_DEFAULTS: CngxStatCardConfig = {\n loadingTreatment: 'auto',\n};\n\n/**\n * App-wide configuration cascade for the stat-card. Resolves in priority\n * order:\n *\n * 1. Per-instance Input binding.\n * 2. `provideStatCardConfigAt(...)` in a parent component's `viewProviders`.\n * 3. `provideStatCardConfig(...)` at the application root.\n * 4. Library defaults (this token's `factory`).\n *\n * `providedIn: 'root'` with a default factory means consumers never need to\n * provide the token explicitly - `inject(CNGX_STAT_CARD_CONFIG)` always\n * resolves.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/config/stat-card.config.defaults.ts\n * @since 0.1.0\n * @relatedTo provideStatCardConfig, provideStatCardConfigAt, injectStatCardConfig\n */\nexport const CNGX_STAT_CARD_CONFIG = new InjectionToken<CngxStatCardConfig>(\n 'CNGX_STAT_CARD_CONFIG',\n {\n providedIn: 'root',\n factory: () => CNGX_STAT_CARD_DEFAULTS,\n },\n);\n","import { inject, type Signal } from '@angular/core';\nimport { createFilledOverrideMerge } from '@cngx/core/utils';\n\nimport { injectStatCardSiteCopy } from '../i18n/stat-card-i18n';\nimport type { CngxStatCardConfig, CngxStatCardResolvedAriaLabels } from './stat-card.config';\nimport { CNGX_STAT_CARD_CONFIG } from './stat-card.config.defaults';\n\n/**\n * Convenience accessor for the stat-card configuration cascade. Runs in\n * injection context; resolves through the priority chain (per-instance Input\n * -> `provideStatCardConfigAt` -> `provideStatCardConfig` -> library\n * defaults). Equivalent to `inject(CNGX_STAT_CARD_CONFIG)` - the helper exists\n * so consumers don't import the token directly.\n *\n * ```ts\n * export class CngxStatCard {\n * private readonly cfg = injectStatCardConfig();\n * readonly errorText = input<string>(this.cfg.ariaLabels?.errorFallback ?? 'Could not load');\n * }\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function injectStatCardConfig(): CngxStatCardConfig {\n return inject(CNGX_STAT_CARD_CONFIG);\n}\n\n/**\n * The resolved strings of the stat-card config in scope, every key the config\n * leaves unset (also a key an override sets to `undefined`) filled from the\n * `statCard` section of the active pack, as a Signal that follows a runtime\n * language switch. Runs\n * in injection context; read it inside a `computed()`, a template or a\n * handler, and untracked where it builds live-region text.\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function injectStatCardAriaLabels(): Signal<CngxStatCardResolvedAriaLabels> {\n return createFilledOverrideMerge(injectStatCardSiteCopy(), injectStatCardConfig().ariaLabels);\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { CngxCard } from '@cngx/common/card';\nimport {\n CNGX_STAT,\n CngxStatCoordinator,\n resolveAsyncView,\n type CngxStatSlotKind,\n} from '@cngx/common/data';\nimport { CngxSkeleton } from '@cngx/common/layout';\nimport {\n createLatencyProbe,\n injectLoadingConfig,\n resolveLoadingTreatment,\n type CngxAsyncState,\n type CngxLoadingTreatment,\n} from '@cngx/core/utils';\nimport { CngxEmptyState } from '@cngx/ui/empty-state';\nimport { CngxLoadingIndicator } from '@cngx/ui/feedback';\n\nimport { injectStatCardAriaLabels, injectStatCardConfig } from './config/inject-stat-card-config';\n\n/** Placeholder shape for a card whose consumer projected no stat slots at all. */\nconst DEFAULT_SKELETON_SLOTS: readonly CngxStatSlotKind[] = ['label', 'value', 'caption'];\n\n/**\n * Card-framed KPI tile: one `<cngx-stat-card>` renders a complete dashboard\n * metric - card surface, coordinated stat slots, an inline visualisation, a\n * footer, and the async view switch - from a single `[state]`.\n *\n * The stat slots are the existing `cngxStatLabel` / `cngxStatValue` /\n * `cngxStatDelta` / `cngxStatCaption` atoms from `@cngx/common/data`, not\n * copies. They resolve `CNGX_STAT` against their declaration site, so the card\n * hosts the same {@link CngxStatCoordinator} brain `CngxStat` hosts and\n * re-points the token at it - the shape `CngxIncrementalList` uses for\n * `CNGX_PAGINATOR_HOST`. A screen reader therefore reads the tile as one\n * phrase, not four fragments (Pillar 2).\n *\n * The view switch is a pure `computed()` off `[state]` via `resolveAsyncView`\n * (Pillar 1) - there is no second state machine and no boolean fallback inputs.\n *\n * Like `cngx-chart`, the card does **not** provide `CNGX_STATEFUL`: the\n * consumer already holds the state object it bound, so transition bridges take\n * it directly, e.g. `<cngx-toast-on [state]=\"revenue\" />`.\n *\n * ```html\n * <cngx-stat-card [state]=\"revenue\">\n * <span cngxStatLabel>Revenue</span>\n * <cngx-metric cngxStatValue [value]=\"1.2\" unit=\"M EUR\" />\n * <cngx-delta cngxStatDelta [value]=\"5.3\" />\n * <span cngxStatCaption>vs. last quarter</span>\n * <cngx-sparkline cngxStatCardViz [data]=\"trend()\" />\n * </cngx-stat-card>\n * ```\n *\n * @category ui/stat-card\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card.component.ts\n * @since 0.1.0\n * @relatedTo CngxStat, CngxStatCoordinator, CngxStatCardViz, CngxStatCardFooter, CngxCard\n *\n * <example-url>http://localhost:4200/#/ui/stat-card/basic/composed-kpi-tile</example-url>\n * <example-url>http://localhost:4200/#/ui/stat-card/async/latency-aware-loading</example-url>\n * <example-url>http://localhost:4200/#/ui/stat-card/async/error-and-refresh</example-url>\n */\n@Component({\n selector: 'cngx-stat-card',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxCard, CngxSkeleton, CngxLoadingIndicator, CngxEmptyState],\n hostDirectives: [CngxStatCoordinator],\n providers: [{ provide: CNGX_STAT, useExisting: CngxStatCoordinator }],\n host: {\n class: 'cngx-stat-card',\n '[attr.aria-busy]': 'busy() || null',\n '[class.cngx-stat-card--busy]': 'busy()',\n },\n template: `\n <cngx-card\n [attr.aria-labelledby]=\"cardLabelledBy()\"\n [attr.aria-live]=\"live() === 'off' ? null : live()\"\n >\n <!-- A refresh over existing content would otherwise be invisible: the view\n stays 'content' and only aria-busy flips, which says nothing to a\n sighted user. The indicator is absolutely placed and the figure only\n dims, so the tile never reflows while refreshing - a dashboard grid\n would otherwise twitch on every poll. It carries the loading config's\n show-delay and min-dwell, so a fast refresh never flashes. -->\n @if (showRefreshIndicator()) {\n <cngx-loading-indicator\n class=\"cngx-stat-card__refresh\"\n [loading]=\"true\"\n variant=\"spinner\"\n [label]=\"resolvedBusyLabel()\"\n />\n }\n\n @switch (activeView()) {\n @case ('skeleton') {\n @if (resolvedTreatment() === 'skeleton') {\n <!-- Same container and same row structure as the content branch, so\n each bar sits exactly where its text will, and the swap to\n content does not resize the tile. -->\n <div\n class=\"cngx-stat-card__stat cngx-stat-card__stat--skeleton\"\n [cngxSkeleton]=\"true\"\n aria-hidden=\"true\"\n >\n @if (skeletonSlots().includes('label')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--label\">\n </span>\n }\n <div class=\"cngx-stat-card__row\">\n @if (skeletonSlots().includes('value')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--value\">\n </span>\n }\n @if (skeletonSlots().includes('delta')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--delta\">\n </span>\n }\n </div>\n @if (skeletonSlots().includes('caption')) {\n <span class=\"cngx-stat-card__skeleton-line cngx-stat-card__skeleton-line--caption\">\n </span>\n }\n </div>\n } @else {\n <div class=\"cngx-stat-card__spinner\">\n <cngx-loading-indicator [loading]=\"true\" variant=\"spinner\" [label]=\"resolvedBusyLabel()\" />\n </div>\n }\n }\n @case ('error') {\n <cngx-empty-state\n class=\"cngx-stat-card__error\"\n [title]=\"resolvedErrorText()\"\n [description]=\"resolvedErrorDescription()\"\n >\n <!-- The stock empty-state glyph is an archive box, which reads\n \"nothing here\" rather than \"this failed\". Projecting into the\n icon slot hides it. Decorative: the title carries the message. -->\n <svg\n cngxEmptyStateIcon\n class=\"cngx-stat-card__error-icon\"\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n </cngx-empty-state>\n }\n @case ('empty') {\n <!-- A settle with no data is its own message, not blank metric\n slots pretending to be a figure. -->\n <cngx-empty-state class=\"cngx-stat-card__empty\" [title]=\"resolvedEmptyText()\" />\n }\n @case ('none') {\n <!-- Idle first load: nothing was asked for yet, so the tile shows\n nothing - projected slots over absent data would read as a\n real (blank) figure. -->\n }\n @default {\n <div class=\"cngx-stat-card__stat\">\n <ng-content select=\"[cngxStatLabel]\" />\n <div class=\"cngx-stat-card__row\">\n <ng-content select=\"[cngxStatValue]\" />\n <ng-content select=\"[cngxStatDelta]\" />\n </div>\n <ng-content select=\"[cngxStatCaption]\" />\n </div>\n\n <ng-content select=\"[cngxStatCardViz]\" />\n\n @if (activeView() === 'content+error') {\n <p class=\"cngx-stat-card__stale\">{{ resolvedStaleText() }}</p>\n }\n }\n }\n\n <ng-content select=\"[cngxStatCardFooter]\" />\n </cngx-card>\n `,\n styleUrls: ['./stat-card.component.css'],\n})\nexport class CngxStatCard {\n /** @internal The shared slot-id brain, applied as a host directive. */\n protected readonly coordinator = inject(CngxStatCoordinator, { host: true });\n\n private readonly config = injectStatCardConfig();\n private readonly ariaLabels = injectStatCardAriaLabels();\n\n /**\n * The tile's async envelope. Every view decision derives from it; there are\n * no discrete `loading` / `error` boolean fallbacks. Optional per the\n * bridge-input rule, so `[state]` may be bound conditionally.\n */\n readonly state = input<CngxAsyncState<unknown> | undefined, CngxAsyncState<unknown> | '' | undefined>(\n undefined,\n { transform: (v) => (typeof v === 'string' ? undefined : v) },\n );\n\n /**\n * What the card shows while it loads. `'auto'` (default) picks from the\n * latency the tile itself observed: a tile whose last load was quick shows a\n * spinner blip, one whose last load dragged shows a skeleton. `'spinner'` and\n * `'skeleton'` pin the choice.\n */\n readonly loadingTreatment = input<CngxLoadingTreatment>(this.config.loadingTreatment ?? 'auto');\n\n /**\n * Accessible label announced while the card is loading. Unbound\n * (`undefined`), each copy input falls back to the config cascade and the\n * `statCard` section of the language pack.\n */\n readonly busyLabel = input<string | undefined>(undefined);\n\n /** Headline of the error state shown instead of the stat when the first load failed. */\n readonly errorText = input<string | undefined>(undefined);\n\n /** Supporting detail under {@link errorText}. Omitted when unset. */\n readonly errorDescription = input<string | undefined>(undefined);\n\n /** Note appended below the stat when a refresh failed but stale data is still shown. */\n readonly staleText = input<string | undefined>(undefined);\n\n /** Headline of the empty state shown when a load settled with no data. */\n readonly emptyText = input<string | undefined>(undefined);\n\n /**\n * Politeness of the tile's live region. `off` (default) for a static KPI;\n * `polite` for a tile that refreshes on a timer, so the new figure is\n * announced instead of changing silently. Mirrors `CngxStat.live`.\n */\n readonly live = input<'off' | 'polite' | 'assertive'>('off');\n\n /** @internal Whether any operation is running. Drives `aria-busy` (Pillar 2). */\n protected readonly busy = computed(() => this.state()?.isBusy() ?? false);\n\n /**\n * @internal Which bars the placeholder draws. Mirrors the slots the consumer\n * actually projected, so a tile without a delta gets no delta bar. Falls back\n * to the common label / value / caption shape when nothing has registered -\n * a card with no stat slots at all still needs a plausible placeholder.\n */\n protected readonly skeletonSlots = computed<readonly CngxStatSlotKind[]>(() => {\n const present = this.coordinator.presentKinds();\n return present.length > 0 ? present : DEFAULT_SKELETON_SLOTS;\n });\n\n /**\n * @internal A refresh over content the user can still read. The skeleton and\n * spinner branches already carry their own busy signal, so the bar would be\n * redundant there.\n */\n protected readonly showRefreshIndicator = computed(\n () => this.busy() && this.activeView() !== 'skeleton',\n );\n\n private readonly loadingConfig = injectLoadingConfig();\n\n /**\n * Measures how long this tile's own busy windows last. The measurement is a\n * wall-clock sample the probe writes from an effect; the selection below stays\n * a pure `computed()`, so nothing in the reactive graph writes state.\n */\n private readonly probe = createLatencyProbe(() => this.busy());\n\n /**\n * Spinner or skeleton for the current load, from the observed latency and the\n * cascaded cutoff. Never a hardcoded millisecond threshold - the cutoff always\n * comes from `CNGX_LOADING_CONFIG`, so one `provideLoadingConfig(...)` retunes\n * every tile in the app.\n */\n protected readonly resolvedTreatment = computed(() =>\n resolveLoadingTreatment(\n this.loadingTreatment(),\n this.probe.lastDuration(),\n this.loadingConfig.spinnerVsSkeletonCutoff,\n ),\n );\n\n /**\n * @internal The card element carries the accessible name, so the tile is one\n * named region instead of an unnamed `article` wrapped around a named group.\n * Null while the stat is not rendered: the slot ids live inside the content\n * branch, and pointing at ids that are out of the DOM reads as unnamed anyway.\n */\n protected readonly cardLabelledBy = computed(() => {\n const view = this.activeView();\n const showsStat = view === 'content' || view === 'content+error';\n return showsStat ? this.coordinator.labelledBy() : null;\n });\n\n /**\n * @internal Which body the card renders. Delegates to the shared\n * `resolveAsyncView` lookup table so the tile cannot drift from every other\n * async surface. Without a bound `[state]` the card always shows its content.\n */\n protected readonly activeView = computed(() => {\n const s = this.state();\n if (!s) {\n return 'content' as const;\n }\n const view = resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n // A non-first-load busy phase over an empty tile resolves to content in\n // the lookup table - blank metric slots posing as a figure. A load with\n // nothing on screen is a load (same correction the timeline applies).\n if (view === 'content' && s.isEmpty() && s.isBusy()) {\n return 'skeleton' as const;\n }\n return view;\n });\n\n protected readonly resolvedBusyLabel = computed(() => {\n this.trackPhase();\n return this.busyLabel() ?? untracked(() => this.ariaLabels().busy);\n });\n protected readonly resolvedErrorText = computed(() => {\n this.trackPhase();\n return this.errorText() ?? untracked(() => this.ariaLabels().errorFallback);\n });\n protected readonly resolvedErrorDescription = computed(() => {\n this.trackPhase();\n return this.errorDescription() ?? untracked(() => this.ariaLabels().errorDescription);\n });\n protected readonly resolvedStaleText = computed(() => {\n this.trackPhase();\n return this.staleText() ?? untracked(() => this.ariaLabels().staleFallback);\n });\n protected readonly resolvedEmptyText = computed(() => {\n this.trackPhase();\n return this.emptyText() ?? untracked(() => this.ariaLabels().emptyFallback);\n });\n\n /**\n * Keys the untracked cascade reads above on the view and busy phase, read\n * straight from the signals the template polls (so a phase that returns to an\n * earlier value still re-reads). The whole card can be a live region, so a\n * language switch must not re-render its text; the next view or busy change\n * speaks the new language. A bound input stays tracked.\n */\n private trackPhase(): void {\n this.activeView();\n this.busy();\n }\n}\n","import { Directive } from '@angular/core';\n\n/**\n * Marks the inline visualisation of a {@link CngxStatCard} - a `cngx-sparkline`,\n * `cngx-mini-area`, `cngx-deviation-bar`, or any other compact chart preset.\n *\n * Rendered beside the stat block and outside its `aria-labelledby` chain: the\n * accessible name stays the numbers a screen reader can actually read, while\n * the viz stays decorative unless the projected preset carries its own\n * accessible name.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts\n * @since 0.1.0\n * @relatedTo CngxStatCard, CngxStatCardFooter\n */\n@Directive({\n selector: '[cngxStatCardViz]',\n standalone: true,\n host: { class: 'cngx-stat-card__viz' },\n})\nexport class CngxStatCardViz {}\n\n/**\n * Marks the footer row of a {@link CngxStatCard} - a timestamp, a drill-down\n * link, a `cngx-tag` row. Rendered below the stat block and the viz slot.\n *\n * @category ui/stat-card\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts\n * @since 0.1.0\n * @relatedTo CngxStatCard, CngxStatCardViz\n */\n@Directive({\n selector: '[cngxStatCardFooter]',\n standalone: true,\n host: { class: 'cngx-stat-card__footer' },\n})\nexport class CngxStatCardFooter {}\n","import {\n inject,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n type Provider,\n type Signal,\n} from '@angular/core';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport type { CngxStatCardAriaLabels, CngxStatCardConfig } from './stat-card.config';\nimport { CNGX_STAT_CARD_CONFIG, CNGX_STAT_CARD_DEFAULTS } from './stat-card.config.defaults';\n\nconst NO_ARIA_LABELS: CngxStatCardAriaLabels = {};\n\n/**\n * Discriminated-union shape returned by the stat-card config features -\n * `withStatCardAriaLabels` and `withStatCardLoadingTreatment`. The reducer in\n * `provideStatCardConfig` / `provideStatCardConfigAt` matches on `kind` and\n * merges `payload` into the corresponding config sub-tree. Mirrors\n * `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across\n * feature areas.\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport type CngxStatCardConfigFeature =\n | {\n readonly kind: 'ariaLabels';\n readonly payload: CngxStatCardAriaLabels | Signal<CngxStatCardAriaLabels>;\n }\n | {\n readonly kind: 'loadingTreatment';\n readonly payload: { readonly loadingTreatment: NonNullable<CngxStatCardConfig['loadingTreatment']> };\n };\n\n/**\n * Reduces a list of feature objects into a partial config - last write wins\n * per sub-tree. Inner objects are spread-merged so partial overrides compose\n * cleanly with prior writes.\n *\n * @internal\n */\nfunction reduceFeatures(\n features: readonly CngxStatCardConfigFeature[],\n): Partial<CngxStatCardConfig> {\n const out: {\n ariaLabels?: NonNullable<CngxStatCardConfig['ariaLabels']>;\n loadingTreatment?: NonNullable<CngxStatCardConfig['loadingTreatment']>;\n } = {};\n for (const f of features) {\n switch (f.kind) {\n case 'ariaLabels':\n out.ariaLabels = createOverrideMerge(out.ariaLabels ?? NO_ARIA_LABELS, f.payload);\n break;\n case 'loadingTreatment':\n out.loadingTreatment = f.payload.loadingTreatment;\n break;\n }\n }\n return out;\n}\n\n/**\n * Two-level deep merge: the nested `ariaLabels` sub-tree is spread-merged so a\n * partial fills in missing keys without nuking the rest; the flat top-level\n * scalar `loadingTreatment` takes the partial when present, else the base.\n *\n * @internal\n */\nfunction mergeConfig(\n base: CngxStatCardConfig,\n partial: Partial<CngxStatCardConfig>,\n): CngxStatCardConfig {\n return {\n ariaLabels: createOverrideMerge(base.ariaLabels ?? NO_ARIA_LABELS, partial.ariaLabels),\n loadingTreatment: partial.loadingTreatment ?? base.loadingTreatment,\n };\n}\n\n/**\n * Application-root configuration cascade for the stat-card. Pass any\n * combination of `withStatCardAriaLabels` and `withStatCardLoadingTreatment`\n * in `bootstrapApplication`'s providers array.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideStatCardConfig(\n * withStatCardAriaLabels({ errorFallback: 'Kennzahl nicht verfügbar' }),\n * withStatCardLoadingTreatment('skeleton'),\n * ),\n * ],\n * });\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function provideStatCardConfig(\n ...features: CngxStatCardConfigFeature[]\n): EnvironmentProviders {\n // Empty-features: skip the override so the root factory's\n // CNGX_STAT_CARD_DEFAULTS reference flows through untouched. A fresh\n // mergeConfig(...) would allocate identical content under a new reference\n // and bust downstream identity comparisons.\n if (features.length === 0) {\n return makeEnvironmentProviders([]);\n }\n const partial = reduceFeatures(features);\n return makeEnvironmentProviders([\n {\n provide: CNGX_STAT_CARD_CONFIG,\n useValue: mergeConfig(CNGX_STAT_CARD_DEFAULTS, partial),\n },\n ]);\n}\n\n/**\n * Component-scoped configuration cascade for the stat-card. Pass any\n * combination of feature factories in a parent component's `viewProviders`.\n *\n * Unlike `provideStatCardConfig` (root-only), this injects the parent\n * injector's `CNGX_STAT_CARD_CONFIG` value and deep-merges the supplied\n * features on top. Descendant tiles see the merged config; sibling sub-trees\n * keep the inherited value untouched.\n *\n * ```ts\n * @Component({\n * viewProviders: [provideStatCardConfigAt(withStatCardLoadingTreatment('spinner'))],\n * template: '<cngx-stat-card [state]=\"s\" />',\n * })\n * class LiveTiles {}\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function provideStatCardConfigAt(...features: CngxStatCardConfigFeature[]): Provider[] {\n // Empty-features call: parent value flows through untouched. Skipping the\n // factory preserves reference identity through the sub-tree.\n if (features.length === 0) {\n return [];\n }\n const partial = reduceFeatures(features);\n return [\n {\n provide: CNGX_STAT_CARD_CONFIG,\n useFactory: () => {\n const parent = inject(CNGX_STAT_CARD_CONFIG, { skipSelf: true });\n return mergeConfig(parent, partial);\n },\n },\n ];\n}\n","import type { Signal } from '@angular/core';\nimport type { CngxLoadingTreatment } from '@cngx/core/utils';\n\nimport type { CngxStatCardAriaLabels } from './stat-card.config';\nimport type { CngxStatCardConfigFeature } from './provide-stat-card-config';\n\n/**\n * Override the stat-card's string fallbacks - the busy announcement, the\n * first-load error message, and the stale-data note. Per-instance\n * `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.\n *\n * The defaults come from the `statCard` section of the language pack (English\n * without one); this overrides single keys on top of it. Pass a\n * `Signal` to switch the language at runtime; a tile with a live region speaks\n * the new language with its next state change.\n *\n * ```ts\n * provideStatCardConfig(\n * withStatCardAriaLabels({ busy: 'Lädt', errorFallback: 'Nicht verfügbar' }),\n * );\n * ```\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function withStatCardAriaLabels(\n labels: CngxStatCardAriaLabels | Signal<CngxStatCardAriaLabels>,\n): CngxStatCardConfigFeature {\n return { kind: 'ariaLabels', payload: labels };\n}\n\n/**\n * Move the cascade default for what a tile renders while it loads. `'auto'`\n * (the library default) picks spinner vs skeleton from the latency the tile\n * observed; `'spinner'` and `'skeleton'` pin it app-wide. Per-instance\n * `[loadingTreatment]` still wins.\n *\n * @category ui/stat-card\n * @since 0.1.0\n */\nexport function withStatCardLoadingTreatment(\n treatment: CngxLoadingTreatment,\n): CngxStatCardConfigFeature {\n return { kind: 'loadingTreatment', payload: { loadingTreatment: treatment } };\n}\n","/**\n * @module @cngx/ui/stat-card\n */\n\nexport { CngxStatCard } from './stat-card.component';\nexport { CngxStatCardViz, CngxStatCardFooter } from './stat-card-slots';\nexport {\n type CngxStatCardAriaLabels,\n type CngxStatCardConfig,\n type CngxStatCardResolvedAriaLabels,\n} from './config/stat-card.config';\nexport { CNGX_STAT_CARD_CONFIG } from './config/stat-card.config.defaults';\nexport {\n provideStatCardConfig,\n provideStatCardConfigAt,\n type CngxStatCardConfigFeature,\n} from './config/provide-stat-card-config';\nexport { withStatCardAriaLabels, withStatCardLoadingTreatment } from './config/features';\nexport { injectStatCardAriaLabels, injectStatCardConfig } from './config/inject-stat-card-config';\nexport {\n CNGX_STAT_CARD_LANGUAGE_EN,\n type CngxStatCardLanguageSection,\n} from './i18n/stat-card-language-section';\n\n// The four coordinated stat slots are the existing atoms from @cngx/common/data,\n// re-exported for a local import surface. A slot projected into the card injects\n// the same CNGX_STAT the card provides - one token, one shape, no new contract.\nexport {\n CngxStatLabel,\n CngxStatValue,\n CngxStatDelta,\n CngxStatCaption,\n CNGX_STAT,\n type CngxStatRegistry,\n} from '@cngx/common/data';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAoBA;;;;;;;AAOG;AACI,MAAM,0BAA0B,GAAgC;AACrE,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,aAAa,EAAE,gBAAgB;AAC/B,IAAA,aAAa,EAAE,0BAA0B;AACzC,IAAA,aAAa,EAAE,SAAS;;;AC5B1B;;;AAGG;AACI,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,UAAU,EAAE,0BAA0B,CAAC;;ACJnG;;;;;;;;;;;;AAYG;AACI,MAAM,uBAAuB,GAAuB;AACzD,IAAA,gBAAgB,EAAE,MAAM;CACzB;AAED;;;;;;;;;;;;;;;;;AAiBG;MACU,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,uBAAuB;AACvC,CAAA;;ACrCH;;;;;;;;;;;;;;;;AAgBG;SACa,oBAAoB,GAAA;AAClC,IAAA,OAAO,MAAM,CAAC,qBAAqB,CAAC;AACtC;AAEA;;;;;;;;;;AAUG;SACa,wBAAwB,GAAA;IACtC,OAAO,yBAAyB,CAAC,sBAAsB,EAAE,EAAE,oBAAoB,EAAE,CAAC,UAAU,CAAC;AAC/F;;ACZA;AACA,MAAM,sBAAsB,GAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCG;MAiIU,YAAY,CAAA;;IAEJ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