@cngx/ui 0.1.0-rc.5 → 0.1.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/a11y/README.md +81 -0
- package/context-menu/README.md +98 -0
- package/data-grid-accordion/README.md +27 -0
- package/feedback/README.md +2 -0
- package/fesm2022/cngx-ui-a11y.mjs +320 -0
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
- package/fesm2022/cngx-ui-accordion.mjs +19 -8
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +5 -2
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +11 -6
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +429 -0
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
- package/fesm2022/cngx-ui-collection.mjs +15 -6
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +1005 -0
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
- package/fesm2022/cngx-ui-context-menu.mjs +742 -0
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +90 -20
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +97 -106
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +18 -9
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +9 -9
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +64 -70
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +18 -8
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +2 -2
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +20 -7
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +2 -2
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +618 -0
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
- package/fesm2022/cngx-ui-stepper.mjs +38 -19
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +36 -19
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +495 -0
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
- package/fesm2022/cngx-ui-toc.mjs +704 -0
- package/fesm2022/cngx-ui-toc.mjs.map +1 -0
- package/fesm2022/cngx-ui.mjs +2 -2
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-accordion/README.md +1 -1
- package/mat-tabs/styles/mat-tabs.css +20 -17
- package/package.json +32 -1
- package/skeleton/README.md +2 -0
- package/stepper/README.md +2 -2
- package/timeline/README.md +350 -0
- package/toc/README.md +183 -0
- package/types/cngx-ui-a11y.d.ts +303 -0
- package/types/cngx-ui-accordion.d.ts +9 -4
- package/types/cngx-ui-action-button.d.ts +3 -0
- package/types/cngx-ui-breadcrumb.d.ts +5 -0
- package/types/cngx-ui-chart-panel.d.ts +278 -0
- package/types/cngx-ui-collection.d.ts +12 -3
- package/types/cngx-ui-command-palette.d.ts +451 -0
- package/types/cngx-ui-context-menu.d.ts +467 -0
- package/types/cngx-ui-data-grid-accordion.d.ts +72 -15
- package/types/cngx-ui-feedback.d.ts +71 -18
- package/types/cngx-ui-layout.d.ts +8 -3
- package/types/cngx-ui-mat-accordion.d.ts +3 -3
- package/types/cngx-ui-mat-tabs.d.ts +11 -9
- package/types/cngx-ui-paginator.d.ts +13 -3
- package/types/cngx-ui-skeleton.d.ts +13 -1
- package/types/cngx-ui-stat-card.d.ts +327 -0
- package/types/cngx-ui-stepper.d.ts +18 -4
- package/types/cngx-ui-tabs.d.ts +20 -4
- package/types/cngx-ui-timeline.d.ts +479 -0
- package/types/cngx-ui-toc.d.ts +514 -0
- package/types/cngx-ui.d.ts +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import * as _cngx_common_data from '@cngx/common/data';
|
|
2
|
+
import { CngxStatCoordinator, CngxStatSlotKind } from '@cngx/common/data';
|
|
3
|
+
export { CNGX_STAT, CngxStatCaption, CngxStatDelta, CngxStatLabel, CngxStatRegistry, CngxStatValue } from '@cngx/common/data';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
6
|
+
import { CngxAsyncState, CngxLoadingTreatment } from '@cngx/core/utils';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Card-framed KPI tile: one `<cngx-stat-card>` renders a complete dashboard
|
|
10
|
+
* metric - card surface, coordinated stat slots, an inline visualisation, a
|
|
11
|
+
* footer, and the async view switch - from a single `[state]`.
|
|
12
|
+
*
|
|
13
|
+
* The stat slots are the existing `cngxStatLabel` / `cngxStatValue` /
|
|
14
|
+
* `cngxStatDelta` / `cngxStatCaption` atoms from `@cngx/common/data`, not
|
|
15
|
+
* copies. They resolve `CNGX_STAT` against their declaration site, so the card
|
|
16
|
+
* hosts the same {@link CngxStatCoordinator} brain `CngxStat` hosts and
|
|
17
|
+
* re-points the token at it - the shape `CngxIncrementalList` uses for
|
|
18
|
+
* `CNGX_PAGINATOR_HOST`. A screen reader therefore reads the tile as one
|
|
19
|
+
* phrase, not four fragments (Pillar 2).
|
|
20
|
+
*
|
|
21
|
+
* The view switch is a pure `computed()` off `[state]` via `resolveAsyncView`
|
|
22
|
+
* (Pillar 1) - there is no second state machine and no boolean fallback inputs.
|
|
23
|
+
*
|
|
24
|
+
* Like `cngx-chart`, the card does **not** provide `CNGX_STATEFUL`: the
|
|
25
|
+
* consumer already holds the state object it bound, so transition bridges take
|
|
26
|
+
* it directly, e.g. `<cngx-toast-on [state]="revenue" />`.
|
|
27
|
+
*
|
|
28
|
+
* ```html
|
|
29
|
+
* <cngx-stat-card [state]="revenue">
|
|
30
|
+
* <span cngxStatLabel>Revenue</span>
|
|
31
|
+
* <cngx-metric cngxStatValue [value]="1.2" unit="M EUR" />
|
|
32
|
+
* <cngx-delta cngxStatDelta [value]="5.3" />
|
|
33
|
+
* <span cngxStatCaption>vs. last quarter</span>
|
|
34
|
+
* <cngx-sparkline cngxStatCardViz [data]="trend()" />
|
|
35
|
+
* </cngx-stat-card>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @category ui/stat-card
|
|
39
|
+
* @docsKind primary
|
|
40
|
+
* @wcag AA
|
|
41
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card.component.ts
|
|
42
|
+
* @since 0.1.0
|
|
43
|
+
* @relatedTo CngxStat, CngxStatCoordinator, CngxStatCardViz, CngxStatCardFooter, CngxCard
|
|
44
|
+
*
|
|
45
|
+
* <example-url>http://localhost:4200/#/ui/stat-card/basic/composed-kpi-tile</example-url>
|
|
46
|
+
* <example-url>http://localhost:4200/#/ui/stat-card/async/latency-aware-loading</example-url>
|
|
47
|
+
* <example-url>http://localhost:4200/#/ui/stat-card/async/error-and-refresh</example-url>
|
|
48
|
+
*/
|
|
49
|
+
declare class CngxStatCard {
|
|
50
|
+
/** @internal The shared slot-id brain, applied as a host directive. */
|
|
51
|
+
protected readonly coordinator: CngxStatCoordinator;
|
|
52
|
+
private readonly config;
|
|
53
|
+
/**
|
|
54
|
+
* The tile's async envelope. Every view decision derives from it; there are
|
|
55
|
+
* no discrete `loading` / `error` boolean fallbacks. Optional per the
|
|
56
|
+
* bridge-input rule, so `[state]` may be bound conditionally.
|
|
57
|
+
*/
|
|
58
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* What the card shows while it loads. `'auto'` (default) picks from the
|
|
61
|
+
* latency the tile itself observed: a tile whose last load was quick shows a
|
|
62
|
+
* spinner blip, one whose last load dragged shows a skeleton. `'spinner'` and
|
|
63
|
+
* `'skeleton'` pin the choice.
|
|
64
|
+
*/
|
|
65
|
+
readonly loadingTreatment: _angular_core.InputSignal<CngxLoadingTreatment>;
|
|
66
|
+
/** Accessible label announced while the card is loading. */
|
|
67
|
+
readonly busyLabel: _angular_core.InputSignal<string>;
|
|
68
|
+
/** Headline of the error state shown instead of the stat when the first load failed. */
|
|
69
|
+
readonly errorText: _angular_core.InputSignal<string>;
|
|
70
|
+
/** Supporting detail under {@link errorText}. Omitted when unset. */
|
|
71
|
+
readonly errorDescription: _angular_core.InputSignal<string | undefined>;
|
|
72
|
+
/** Note appended below the stat when a refresh failed but stale data is still shown. */
|
|
73
|
+
readonly staleText: _angular_core.InputSignal<string>;
|
|
74
|
+
/**
|
|
75
|
+
* Politeness of the tile's live region. `off` (default) for a static KPI;
|
|
76
|
+
* `polite` for a tile that refreshes on a timer, so the new figure is
|
|
77
|
+
* announced instead of changing silently. Mirrors `CngxStat.live`.
|
|
78
|
+
*/
|
|
79
|
+
readonly live: _angular_core.InputSignal<"off" | "polite" | "assertive">;
|
|
80
|
+
/** @internal Whether any operation is running. Drives `aria-busy` (Pillar 2). */
|
|
81
|
+
protected readonly busy: _angular_core.Signal<boolean>;
|
|
82
|
+
/**
|
|
83
|
+
* @internal A refresh over content the user can still read. The skeleton and
|
|
84
|
+
* spinner branches already carry their own busy signal, so the bar would be
|
|
85
|
+
* redundant there.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* @internal Which bars the placeholder draws. Mirrors the slots the consumer
|
|
89
|
+
* actually projected, so a tile without a delta gets no delta bar. Falls back
|
|
90
|
+
* to the common label / value / caption shape when nothing has registered -
|
|
91
|
+
* a card with no stat slots at all still needs a plausible placeholder.
|
|
92
|
+
*/
|
|
93
|
+
protected readonly skeletonSlots: _angular_core.Signal<readonly CngxStatSlotKind[]>;
|
|
94
|
+
protected readonly showRefreshIndicator: _angular_core.Signal<boolean>;
|
|
95
|
+
private readonly loadingConfig;
|
|
96
|
+
/**
|
|
97
|
+
* Measures how long this tile's own busy windows last. The measurement is a
|
|
98
|
+
* wall-clock sample the probe writes from an effect; the selection below stays
|
|
99
|
+
* a pure `computed()`, so nothing in the reactive graph writes state.
|
|
100
|
+
*/
|
|
101
|
+
private readonly probe;
|
|
102
|
+
/**
|
|
103
|
+
* Spinner or skeleton for the current load, from the observed latency and the
|
|
104
|
+
* cascaded cutoff. Never a hardcoded millisecond threshold - the cutoff always
|
|
105
|
+
* comes from `CNGX_LOADING_CONFIG`, so one `provideLoadingConfig(...)` retunes
|
|
106
|
+
* every tile in the app.
|
|
107
|
+
*/
|
|
108
|
+
protected readonly resolvedTreatment: _angular_core.Signal<"spinner" | "skeleton">;
|
|
109
|
+
/**
|
|
110
|
+
* Which body the card renders. Delegates to the shared `resolveAsyncView`
|
|
111
|
+
* lookup table so the tile cannot drift from every other async surface.
|
|
112
|
+
* Without a bound `[state]` the card always shows its content.
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* @internal The card element carries the accessible name, so the tile is one
|
|
116
|
+
* named region instead of an unnamed `article` wrapped around a named group.
|
|
117
|
+
* Null while the stat is not rendered: the slot ids live inside the content
|
|
118
|
+
* branch, and pointing at ids that are out of the DOM reads as unnamed anyway.
|
|
119
|
+
*/
|
|
120
|
+
protected readonly cardLabelledBy: _angular_core.Signal<string | null>;
|
|
121
|
+
protected readonly activeView: _angular_core.Signal<_cngx_common_data.AsyncView>;
|
|
122
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCard, never>;
|
|
123
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxStatCard, "cngx-stat-card", never, { "state": { "alias": "state"; "required": false; "isSignal": true; }; "loadingTreatment": { "alias": "loadingTreatment"; "required": false; "isSignal": true; }; "busyLabel": { "alias": "busyLabel"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "errorDescription": { "alias": "errorDescription"; "required": false; "isSignal": true; }; "staleText": { "alias": "staleText"; "required": false; "isSignal": true; }; "live": { "alias": "live"; "required": false; "isSignal": true; }; }, {}, never, ["[cngxStatLabel]", "[cngxStatValue]", "[cngxStatDelta]", "[cngxStatCaption]", "[cngxStatCardViz]", "[cngxStatCardFooter]"], true, [{ directive: typeof _cngx_common_data.CngxStatCoordinator; inputs: {}; outputs: {}; }]>;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Marks the inline visualisation of a {@link CngxStatCard} - a `cngx-sparkline`,
|
|
128
|
+
* `cngx-mini-area`, `cngx-deviation-bar`, or any other compact chart preset.
|
|
129
|
+
*
|
|
130
|
+
* Rendered beside the stat block and outside its `aria-labelledby` chain: the
|
|
131
|
+
* accessible name stays the numbers a screen reader can actually read, while
|
|
132
|
+
* the viz stays decorative unless the projected preset carries its own
|
|
133
|
+
* accessible name.
|
|
134
|
+
*
|
|
135
|
+
* @category ui/stat-card
|
|
136
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts
|
|
137
|
+
* @since 0.1.0
|
|
138
|
+
* @relatedTo CngxStatCard, CngxStatCardFooter
|
|
139
|
+
*/
|
|
140
|
+
declare class CngxStatCardViz {
|
|
141
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCardViz, never>;
|
|
142
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCardViz, "[cngxStatCardViz]", never, {}, {}, never, never, true, never>;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Marks the footer row of a {@link CngxStatCard} - a timestamp, a drill-down
|
|
146
|
+
* link, a `cngx-tag` row. Rendered below the stat block and the viz slot.
|
|
147
|
+
*
|
|
148
|
+
* @category ui/stat-card
|
|
149
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/stat-card-slots.ts
|
|
150
|
+
* @since 0.1.0
|
|
151
|
+
* @relatedTo CngxStatCard, CngxStatCardViz
|
|
152
|
+
*/
|
|
153
|
+
declare class CngxStatCardFooter {
|
|
154
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStatCardFooter, never>;
|
|
155
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxStatCardFooter, "[cngxStatCardFooter]", never, {}, {}, never, never, true, never>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* App-wide cascade for the stat-card's ARIA/message strings and its default
|
|
160
|
+
* loading treatment.
|
|
161
|
+
*
|
|
162
|
+
* Resolution priority (high -> low):
|
|
163
|
+
* 1. Per-instance Input binding (e.g. `[errorText]`, `[loadingTreatment]`).
|
|
164
|
+
* 2. `provideStatCardConfigAt(...)` in a parent component's `viewProviders`.
|
|
165
|
+
* 3. `provideStatCardConfig(...)` at the application root.
|
|
166
|
+
* 4. Library defaults (English; merged in via `CNGX_STAT_CARD_DEFAULTS`).
|
|
167
|
+
*
|
|
168
|
+
* Every key is optional - partial overrides deep-merge with the library
|
|
169
|
+
* defaults, so consumers declare only the keys they want to override.
|
|
170
|
+
*
|
|
171
|
+
* @category ui/stat-card
|
|
172
|
+
* @since 0.1.0
|
|
173
|
+
*/
|
|
174
|
+
interface CngxStatCardConfig {
|
|
175
|
+
/**
|
|
176
|
+
* String fallbacks for the tile's non-content states. Per-instance
|
|
177
|
+
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.
|
|
178
|
+
*/
|
|
179
|
+
readonly ariaLabels?: {
|
|
180
|
+
/** Accessible name announced while the tile is loading. */
|
|
181
|
+
readonly busy?: string;
|
|
182
|
+
/** Headline of the error state shown instead of the stat when the first load failed. */
|
|
183
|
+
readonly errorFallback?: string;
|
|
184
|
+
/** Supporting detail under the error headline. Omitted when unset. */
|
|
185
|
+
readonly errorDescription?: string;
|
|
186
|
+
/** Note shown below stale numbers when a refresh failed. */
|
|
187
|
+
readonly staleFallback?: string;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* App-wide default loading treatment. Per-instance `[loadingTreatment]`
|
|
191
|
+
* still wins; this only moves the cascade default. A flat top-level scalar,
|
|
192
|
+
* not a nested sub-tree.
|
|
193
|
+
*/
|
|
194
|
+
readonly loadingTreatment?: CngxLoadingTreatment;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* App-wide configuration cascade for the stat-card. Resolves in priority
|
|
199
|
+
* order:
|
|
200
|
+
*
|
|
201
|
+
* 1. Per-instance Input binding.
|
|
202
|
+
* 2. `provideStatCardConfigAt(...)` in a parent component's `viewProviders`.
|
|
203
|
+
* 3. `provideStatCardConfig(...)` at the application root.
|
|
204
|
+
* 4. Library defaults (this token's `factory`).
|
|
205
|
+
*
|
|
206
|
+
* `providedIn: 'root'` with a default factory means consumers never need to
|
|
207
|
+
* provide the token explicitly - `inject(CNGX_STAT_CARD_CONFIG)` always
|
|
208
|
+
* resolves.
|
|
209
|
+
*
|
|
210
|
+
* @category ui/stat-card
|
|
211
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stat-card/config/stat-card.config.defaults.ts
|
|
212
|
+
* @since 0.1.0
|
|
213
|
+
* @relatedTo provideStatCardConfig, provideStatCardConfigAt, injectStatCardConfig
|
|
214
|
+
*/
|
|
215
|
+
declare const CNGX_STAT_CARD_CONFIG: InjectionToken<CngxStatCardConfig>;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Discriminated-union shape returned by the stat-card config features -
|
|
219
|
+
* `withStatCardAriaLabels` and `withStatCardLoadingTreatment`. The reducer in
|
|
220
|
+
* `provideStatCardConfig` / `provideStatCardConfigAt` matches on `kind` and
|
|
221
|
+
* merges `payload` into the corresponding config sub-tree. Mirrors
|
|
222
|
+
* `CngxBreadcrumbConfigFeature` so the consumer's mental model is one across
|
|
223
|
+
* feature areas.
|
|
224
|
+
*
|
|
225
|
+
* @category ui/stat-card
|
|
226
|
+
* @since 0.1.0
|
|
227
|
+
*/
|
|
228
|
+
type CngxStatCardConfigFeature = {
|
|
229
|
+
readonly kind: 'ariaLabels';
|
|
230
|
+
readonly payload: NonNullable<CngxStatCardConfig['ariaLabels']>;
|
|
231
|
+
} | {
|
|
232
|
+
readonly kind: 'loadingTreatment';
|
|
233
|
+
readonly payload: {
|
|
234
|
+
readonly loadingTreatment: NonNullable<CngxStatCardConfig['loadingTreatment']>;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Application-root configuration cascade for the stat-card. Pass any
|
|
239
|
+
* combination of `withStatCardAriaLabels` and `withStatCardLoadingTreatment`
|
|
240
|
+
* in `bootstrapApplication`'s providers array.
|
|
241
|
+
*
|
|
242
|
+
* ```ts
|
|
243
|
+
* bootstrapApplication(AppComponent, {
|
|
244
|
+
* providers: [
|
|
245
|
+
* provideStatCardConfig(
|
|
246
|
+
* withStatCardAriaLabels({ errorFallback: 'Kennzahl nicht verfügbar' }),
|
|
247
|
+
* withStatCardLoadingTreatment('skeleton'),
|
|
248
|
+
* ),
|
|
249
|
+
* ],
|
|
250
|
+
* });
|
|
251
|
+
* ```
|
|
252
|
+
*
|
|
253
|
+
* @category ui/stat-card
|
|
254
|
+
* @since 0.1.0
|
|
255
|
+
*/
|
|
256
|
+
declare function provideStatCardConfig(...features: CngxStatCardConfigFeature[]): EnvironmentProviders;
|
|
257
|
+
/**
|
|
258
|
+
* Component-scoped configuration cascade for the stat-card. Pass any
|
|
259
|
+
* combination of feature factories in a parent component's `viewProviders`.
|
|
260
|
+
*
|
|
261
|
+
* Unlike `provideStatCardConfig` (root-only), this injects the parent
|
|
262
|
+
* injector's `CNGX_STAT_CARD_CONFIG` value and deep-merges the supplied
|
|
263
|
+
* features on top. Descendant tiles see the merged config; sibling sub-trees
|
|
264
|
+
* keep the inherited value untouched.
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
* @Component({
|
|
268
|
+
* viewProviders: [provideStatCardConfigAt(withStatCardLoadingTreatment('spinner'))],
|
|
269
|
+
* template: '<cngx-stat-card [state]="s" />',
|
|
270
|
+
* })
|
|
271
|
+
* class LiveTiles {}
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @category ui/stat-card
|
|
275
|
+
* @since 0.1.0
|
|
276
|
+
*/
|
|
277
|
+
declare function provideStatCardConfigAt(...features: CngxStatCardConfigFeature[]): Provider[];
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Override the stat-card's string fallbacks - the busy announcement, the
|
|
281
|
+
* first-load error message, and the stale-data note. Per-instance
|
|
282
|
+
* `[busyLabel]` / `[errorText]` / `[staleText]` bindings still win.
|
|
283
|
+
*
|
|
284
|
+
* Library defaults are English; this is the hook a localised app uses.
|
|
285
|
+
*
|
|
286
|
+
* ```ts
|
|
287
|
+
* provideStatCardConfig(
|
|
288
|
+
* withStatCardAriaLabels({ busy: 'Lädt', errorFallback: 'Nicht verfügbar' }),
|
|
289
|
+
* );
|
|
290
|
+
* ```
|
|
291
|
+
*
|
|
292
|
+
* @category ui/stat-card
|
|
293
|
+
* @since 0.1.0
|
|
294
|
+
*/
|
|
295
|
+
declare function withStatCardAriaLabels(labels: NonNullable<CngxStatCardConfig['ariaLabels']>): CngxStatCardConfigFeature;
|
|
296
|
+
/**
|
|
297
|
+
* Move the cascade default for what a tile renders while it loads. `'auto'`
|
|
298
|
+
* (the library default) picks spinner vs skeleton from the latency the tile
|
|
299
|
+
* observed; `'spinner'` and `'skeleton'` pin it app-wide. Per-instance
|
|
300
|
+
* `[loadingTreatment]` still wins.
|
|
301
|
+
*
|
|
302
|
+
* @category ui/stat-card
|
|
303
|
+
* @since 0.1.0
|
|
304
|
+
*/
|
|
305
|
+
declare function withStatCardLoadingTreatment(treatment: CngxLoadingTreatment): CngxStatCardConfigFeature;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Convenience accessor for the stat-card configuration cascade. Runs in
|
|
309
|
+
* injection context; resolves through the priority chain (per-instance Input
|
|
310
|
+
* -> `provideStatCardConfigAt` -> `provideStatCardConfig` -> library
|
|
311
|
+
* defaults). Equivalent to `inject(CNGX_STAT_CARD_CONFIG)` - the helper exists
|
|
312
|
+
* so consumers don't import the token directly.
|
|
313
|
+
*
|
|
314
|
+
* ```ts
|
|
315
|
+
* export class CngxStatCard {
|
|
316
|
+
* private readonly cfg = injectStatCardConfig();
|
|
317
|
+
* readonly errorText = input<string>(this.cfg.ariaLabels?.errorFallback ?? 'Could not load');
|
|
318
|
+
* }
|
|
319
|
+
* ```
|
|
320
|
+
*
|
|
321
|
+
* @category ui/stat-card
|
|
322
|
+
* @since 0.1.0
|
|
323
|
+
*/
|
|
324
|
+
declare function injectStatCardConfig(): CngxStatCardConfig;
|
|
325
|
+
|
|
326
|
+
export { CNGX_STAT_CARD_CONFIG, CngxStatCard, CngxStatCardFooter, CngxStatCardViz, injectStatCardConfig, provideStatCardConfig, provideStatCardConfigAt, withStatCardAriaLabels, withStatCardLoadingTreatment };
|
|
327
|
+
export type { CngxStatCardConfig, CngxStatCardConfigFeature };
|
|
@@ -17,6 +17,13 @@ import * as i2 from '@cngx/common/a11y';
|
|
|
17
17
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/stepper.component.ts
|
|
18
18
|
* @since 0.1.0
|
|
19
19
|
* @relatedTo CngxStepperPresenter, CngxStep, CngxRovingTabindex, CngxFocusRestore, CngxLiveRegion
|
|
20
|
+
* @slot cngxStepIndicator Replaces the per-step number or check glyph in the header.
|
|
21
|
+
* @slot cngxStepBadge Extra marker beside a step label, e.g. an optional or count badge.
|
|
22
|
+
* @slot cngxStepBusySpinner Replaces the busy affordance shown while a step commits.
|
|
23
|
+
* @slot cngxStepError Renders the failure surface on a step whose commit was rejected.
|
|
24
|
+
* @slot cngxStepRejection Renders the reason a rolled-back step was refused.
|
|
25
|
+
* @slot cngxStepGroupHeader Replaces the header a step group renders above its steps.
|
|
26
|
+
* @slot cngxStepperEmpty Renders when no step is projected at all.
|
|
20
27
|
* @playground Material theme coverage across all skins ./examples/material-theme-coverage/skins-coverage.component.ts
|
|
21
28
|
* <example-url>http://localhost:4200/#/ui/stepper/stepper-horizontal/three-step-wizard</example-url>
|
|
22
29
|
* <example-url>http://localhost:4200/#/ui/stepper/stepper-vertical/vertical-sidebar-layout</example-url>
|
|
@@ -90,8 +97,9 @@ declare class CngxStepper implements CngxStepPanelHost {
|
|
|
90
97
|
/**
|
|
91
98
|
* Space-driven density rung for the classic strip, measured off the
|
|
92
99
|
* host element's own width via {@link createStripDensity}. `'full'`
|
|
93
|
-
* under the `'comfortable'` default. Drives `[data-density]` (the
|
|
94
|
-
*
|
|
100
|
+
* under the `'comfortable'` default. Drives `[data-strip-density]` (the
|
|
101
|
+
* strip-overflow rung, distinct from the global `[data-density]` spacing
|
|
102
|
+
* swap so strip degradation never re-scales component spacing).
|
|
95
103
|
*/
|
|
96
104
|
protected readonly stripDensity: Signal<_cngx_common_stepper.CngxStripDensity>;
|
|
97
105
|
/**
|
|
@@ -213,8 +221,11 @@ declare class CngxStepper implements CngxStepPanelHost {
|
|
|
213
221
|
protected readonly isCommitting: Signal<boolean>;
|
|
214
222
|
protected stepHeaderId(node: CngxStepNode): string;
|
|
215
223
|
protected stepPanelId(node: CngxStepNode): string;
|
|
216
|
-
|
|
217
|
-
|
|
224
|
+
/**
|
|
225
|
+
* Live-region + per-step + group SR phrase builders (Level-2 factory);
|
|
226
|
+
* also owns the descriptor-span id scheme and the gated
|
|
227
|
+
* `aria-describedby` reference the template binds directly.
|
|
228
|
+
*/
|
|
218
229
|
protected readonly announcement: _cngx_common_stepper.CngxStepperAnnouncementBuilders;
|
|
219
230
|
protected handleHeaderClick(node: CngxStepNode): void;
|
|
220
231
|
/**
|
|
@@ -334,6 +345,7 @@ declare class CngxProgressBarStepper {
|
|
|
334
345
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/stepper/dot-stepper.component.ts
|
|
335
346
|
* @since 0.1.0
|
|
336
347
|
* @relatedTo CngxStepperPresenter, CngxProgressBarStepper, CngxTextStepper
|
|
348
|
+
* @slot cngxDotStepperDot Replaces one dot; gets its index and active state.
|
|
337
349
|
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>
|
|
338
350
|
*/
|
|
339
351
|
declare class CngxDotStepper {
|
|
@@ -344,6 +356,8 @@ declare class CngxDotStepper {
|
|
|
344
356
|
protected readonly config: _cngx_common_stepper.CngxStepperConfig;
|
|
345
357
|
/** Mobile-swipe routing surface composed via hostDirectives. */
|
|
346
358
|
protected readonly swipeNav: CngxStepperSwipeNav;
|
|
359
|
+
/** Document writing direction - flips the inline next/previous arrows under `rtl` (APG). */
|
|
360
|
+
private readonly direction;
|
|
347
361
|
protected readonly stepNodes: Signal<readonly CngxStepNode[]>;
|
|
348
362
|
protected readonly activeIndex: Signal<number>;
|
|
349
363
|
/** Shared per-step/aggregate state derivations - the single error source. */
|
package/types/cngx-ui-tabs.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
36
36
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-group.component.ts
|
|
37
37
|
* @since 0.1.0
|
|
38
38
|
* @relatedTo CngxTabOverflow, CngxTabGroupPresenter, CngxTab, CngxFocusRestore
|
|
39
|
+
* @slot cngxTabIcon Replaces a tab's leading icon; gets the tab.
|
|
40
|
+
* @slot cngxTabAddIcon Replaces the glyph on the add-tab control.
|
|
41
|
+
* @slot cngxTabCloseIcon Replaces the glyph on a tab's close control.
|
|
42
|
+
* @slot cngxTabErrorBadge Marks a tab whose panel holds validation errors.
|
|
43
|
+
* @slot cngxTabBusySpinner Rendered on a tab while its switch commits.
|
|
44
|
+
* @slot cngxTabRejectionIcon Marks a tab whose switch was refused.
|
|
39
45
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
40
46
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
41
47
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/all-skins-side-by-side</example-url>
|
|
@@ -196,6 +202,14 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
196
202
|
*/
|
|
197
203
|
protected shouldRenderContent(tab: CngxTabHandle): boolean;
|
|
198
204
|
protected tabDescriptorId(tab: CngxTabHandle): string;
|
|
205
|
+
/**
|
|
206
|
+
* `aria-describedby` for a tab header: the descriptor id while the
|
|
207
|
+
* status phrase (error state) is non-empty, else `null`. The sr-only
|
|
208
|
+
* descriptor span stays in the DOM; only the reference is gated -
|
|
209
|
+
* accname 1.2 §2A traverses a directly-referenced node even when it
|
|
210
|
+
* is empty or hidden.
|
|
211
|
+
*/
|
|
212
|
+
protected tabDescribedBy(tab: CngxTabHandle): string | null;
|
|
199
213
|
/**
|
|
200
214
|
* `true` when the tab is in error - the folded `hasError` (direct
|
|
201
215
|
* `[error]` flag OR the aggregator's reveal-gated `shouldShow()`), so
|
|
@@ -320,10 +334,10 @@ declare class CngxTabNav {
|
|
|
320
334
|
private readonly config;
|
|
321
335
|
protected readonly resolvedSkin: Signal<CngxTabsSkin>;
|
|
322
336
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
337
|
+
* Polite live-region content. The brain stays linked from
|
|
338
|
+
* `@cngx/common/tabs`, so a decomposed skin keeps receiving fixes to
|
|
339
|
+
* the mount-window gate and the change detection instead of carrying a
|
|
340
|
+
* frozen copy.
|
|
327
341
|
*/
|
|
328
342
|
protected readonly liveAnnouncement: Signal<string>;
|
|
329
343
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabNav, never>;
|
|
@@ -351,6 +365,8 @@ declare class CngxTabNav {
|
|
|
351
365
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-overflow.component.ts
|
|
352
366
|
* @since 0.1.0
|
|
353
367
|
* @relatedTo CngxTabGroup, CngxPopover, CngxActiveDescendant
|
|
368
|
+
* @slot cngxTabOverflowTrigger Replaces the control that opens the overflow menu.
|
|
369
|
+
* @slot cngxTabOverflowItem Replaces a row in the overflow menu; gets the tab.
|
|
354
370
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>
|
|
355
371
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-horizontal</example-url>
|
|
356
372
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-vertical</example-url>
|