@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +224 -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 +102 -35
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +112 -50
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +176 -96
- 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 +194 -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 +149 -34
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +415 -98
- 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 +1022 -439
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +75 -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 +314 -141
- 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 +487 -178
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +327 -106
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +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 +191 -68
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +10 -6
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +74 -21
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +70 -26
- 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/styles/mat-tabs.css +9 -10
- package/overlay/README.md +9 -4
- package/package.json +4 -4
- package/paginator/README.md +8 -4
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +13 -1
- 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 +91 -26
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +154 -58
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +147 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +98 -6
- package/types/cngx-ui-data-grid-accordion.d.ts +274 -38
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +594 -56
- package/types/cngx-ui-mat-accordion.d.ts +29 -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 +207 -14
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +403 -129
- 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 +66 -27
- package/types/cngx-ui-tabs.d.ts +2 -2
- package/types/cngx-ui-timeline.d.ts +23 -7
- package/types/cngx-ui-toc.d.ts +80 -13
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { TemplateRef, InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef, Signal, InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
|
|
3
3
|
import * as i1 from '@cngx/common/data';
|
|
4
4
|
import { CngxPaginate, AsyncView } from '@cngx/common/data';
|
|
5
5
|
export { CNGX_PAGINATOR_HOST, CngxPaginatorHost, CngxPaginatorInfinite, CngxPaginatorLoadMore } from '@cngx/ui/paginator';
|
|
6
|
+
import { CngxMessage } from '@cngx/core/i18n';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Context exposed to a projected item template - the accumulated item and its
|
|
@@ -26,8 +27,8 @@ interface CngxIncrementalItemContext<T> {
|
|
|
26
27
|
declare class CngxIncrementalItem<T = unknown> {
|
|
27
28
|
readonly templateRef: TemplateRef<CngxIncrementalItemContext<T>>;
|
|
28
29
|
static ngTemplateContextGuard<T>(_dir: CngxIncrementalItem<T>, ctx: unknown): ctx is CngxIncrementalItemContext<T>;
|
|
29
|
-
static ɵfac:
|
|
30
|
-
static ɵdir:
|
|
30
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalItem<any>, never>;
|
|
31
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxIncrementalItem<any>, "ng-template[cngxIncrementalItem]", ["cngxIncrementalItem"], {}, {}, never, never, true, never>;
|
|
31
32
|
}
|
|
32
33
|
/**
|
|
33
34
|
* Empty slot. Project `<ng-template cngxIncrementalEmpty>` to replace the
|
|
@@ -38,8 +39,8 @@ declare class CngxIncrementalItem<T = unknown> {
|
|
|
38
39
|
*/
|
|
39
40
|
declare class CngxIncrementalEmpty {
|
|
40
41
|
readonly templateRef: TemplateRef<any>;
|
|
41
|
-
static ɵfac:
|
|
42
|
-
static ɵdir:
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalEmpty, never>;
|
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxIncrementalEmpty, "ng-template[cngxIncrementalEmpty]", ["cngxIncrementalEmpty"], {}, {}, never, never, true, never>;
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Context exposed to a projected error template - a `retry` callback that
|
|
@@ -63,8 +64,8 @@ interface CngxIncrementalErrorContext {
|
|
|
63
64
|
declare class CngxIncrementalError {
|
|
64
65
|
readonly templateRef: TemplateRef<CngxIncrementalErrorContext>;
|
|
65
66
|
static ngTemplateContextGuard(_dir: CngxIncrementalError, ctx: unknown): ctx is CngxIncrementalErrorContext;
|
|
66
|
-
static ɵfac:
|
|
67
|
-
static ɵdir:
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalError, never>;
|
|
68
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxIncrementalError, "ng-template[cngxIncrementalError]", ["cngxIncrementalError"], {}, {}, never, never, true, never>;
|
|
68
69
|
}
|
|
69
70
|
/**
|
|
70
71
|
* End-reached slot. Project `<ng-template cngxIncrementalEnd>` to replace the
|
|
@@ -75,8 +76,8 @@ declare class CngxIncrementalError {
|
|
|
75
76
|
*/
|
|
76
77
|
declare class CngxIncrementalEnd {
|
|
77
78
|
readonly templateRef: TemplateRef<any>;
|
|
78
|
-
static ɵfac:
|
|
79
|
-
static ɵdir:
|
|
79
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalEnd, never>;
|
|
80
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxIncrementalEnd, "ng-template[cngxIncrementalEnd]", ["cngxIncrementalEnd"], {}, {}, never, never, true, never>;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
83
|
* Loading slot. Project `<ng-template cngxIncrementalLoading>` to replace the
|
|
@@ -88,8 +89,8 @@ declare class CngxIncrementalEnd {
|
|
|
88
89
|
*/
|
|
89
90
|
declare class CngxIncrementalLoading {
|
|
90
91
|
readonly templateRef: TemplateRef<any>;
|
|
91
|
-
static ɵfac:
|
|
92
|
-
static ɵdir:
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalLoading, never>;
|
|
93
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxIncrementalLoading, "ng-template[cngxIncrementalLoading]", ["cngxIncrementalLoading"], {}, {}, never, never, true, never>;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
/**
|
|
@@ -123,8 +124,10 @@ type CngxIncrementalListSkin = 'plain' | 'divided' | 'card';
|
|
|
123
124
|
* the two halves resolve to different directive instances - same limitation,
|
|
124
125
|
* same reason, as `CngxPaginator`.
|
|
125
126
|
*
|
|
126
|
-
* All ARIA is signal-driven: `aria-busy` reflects the brain busy signal
|
|
127
|
-
*
|
|
127
|
+
* All ARIA is signal-driven: `aria-busy` reflects the brain busy signal on the
|
|
128
|
+
* items container (scoped there so the polite live region never sits inside a
|
|
129
|
+
* busy container) and the live region communicates every settle
|
|
130
|
+
* (empty / error / end-reached).
|
|
128
131
|
*
|
|
129
132
|
* @category ui/collection
|
|
130
133
|
* @docsKind primary
|
|
@@ -140,7 +143,7 @@ type CngxIncrementalListSkin = 'plain' | 'divided' | 'card';
|
|
|
140
143
|
*/
|
|
141
144
|
declare class CngxIncrementalList<T = unknown> {
|
|
142
145
|
/** Visual skin; reflected onto `[data-skin]`. Paint-only. */
|
|
143
|
-
readonly skin:
|
|
146
|
+
readonly skin: i0.InputSignal<CngxIncrementalListSkin>;
|
|
144
147
|
/**
|
|
145
148
|
* Opt into DOM recycling. When set, the accumulated content branch renders
|
|
146
149
|
* only the visible window of rows through an internal virtualized body inside
|
|
@@ -148,75 +151,98 @@ declare class CngxIncrementalList<T = unknown> {
|
|
|
148
151
|
* (default) keeps the render-all path - the recycler never constructs, so a
|
|
149
152
|
* small list pays nothing. Reflected onto `[data-virtualize]`.
|
|
150
153
|
*/
|
|
151
|
-
readonly virtualize:
|
|
154
|
+
readonly virtualize: i0.InputSignalWithTransform<boolean, unknown>;
|
|
152
155
|
/**
|
|
153
156
|
* Initial per-row height estimate (px) for the virtualized window - the first
|
|
154
157
|
* guess before a row is measured. Ignored unless `[virtualize]` is set.
|
|
155
158
|
*/
|
|
156
|
-
readonly estimateSize:
|
|
157
|
-
/**
|
|
158
|
-
|
|
159
|
+
readonly estimateSize: i0.InputSignal<number>;
|
|
160
|
+
/**
|
|
161
|
+
* Emits the effective page index on every change - navigation or
|
|
162
|
+
* `total`-shrink clamp. Clamp emits are held back while the brain is busy or
|
|
163
|
+
* `total` is 0, so a transient total drop during a refetch never writes a
|
|
164
|
+
* page-0 clamp into the consumer's two-way state.
|
|
165
|
+
*/
|
|
166
|
+
readonly pageIndexChange: i0.OutputEmitterRef<number>;
|
|
159
167
|
/** Emits the effective page size on every change. */
|
|
160
|
-
readonly pageSizeChange:
|
|
168
|
+
readonly pageSizeChange: i0.OutputEmitterRef<number>;
|
|
161
169
|
/**
|
|
162
170
|
* Emits when the error view's retry affordance is activated (the built-in
|
|
163
171
|
* button or a projected error slot's `retry()` context). The consumer re-runs
|
|
164
172
|
* its data source; the organism owns no fetch of its own.
|
|
165
173
|
*/
|
|
166
|
-
readonly retry:
|
|
174
|
+
readonly retry: i0.OutputEmitterRef<void>;
|
|
167
175
|
/**
|
|
168
176
|
* Item identity for the accumulated `@for`. Defaults to the row index
|
|
169
177
|
* (append-safe: appended rows keep their position). Supply a key fn when the
|
|
170
178
|
* bound `[state]` data can be replaced or reordered, so a projected item
|
|
171
179
|
* template keeps its per-row state instead of being reused by position.
|
|
172
180
|
*/
|
|
173
|
-
readonly trackBy:
|
|
181
|
+
readonly trackBy: i0.InputSignal<(index: number, item: T) => unknown>;
|
|
174
182
|
protected readonly paginate: CngxPaginate;
|
|
175
183
|
private readonly host;
|
|
176
184
|
private readonly config;
|
|
185
|
+
private readonly ariaLabels;
|
|
186
|
+
private readonly locale;
|
|
187
|
+
private readonly formatters;
|
|
177
188
|
private readonly itemSlot;
|
|
178
189
|
private readonly emptySlot;
|
|
179
190
|
private readonly errorSlot;
|
|
180
191
|
private readonly endSlot;
|
|
181
192
|
private readonly loadingSlot;
|
|
182
|
-
protected readonly itemTemplate:
|
|
183
|
-
protected readonly emptyTemplate:
|
|
184
|
-
protected readonly errorTemplate:
|
|
185
|
-
protected readonly endTemplate:
|
|
186
|
-
protected readonly loadingTemplate:
|
|
193
|
+
protected readonly itemTemplate: Signal<TemplateRef<any> | null>;
|
|
194
|
+
protected readonly emptyTemplate: Signal<TemplateRef<any> | null>;
|
|
195
|
+
protected readonly errorTemplate: Signal<TemplateRef<any> | null>;
|
|
196
|
+
protected readonly endTemplate: Signal<TemplateRef<any> | null>;
|
|
197
|
+
protected readonly loadingTemplate: Signal<TemplateRef<any> | null>;
|
|
187
198
|
/**
|
|
188
199
|
* Which region renders, resolved from the single `[state]` source through the
|
|
189
200
|
* shared `resolveAsyncView` switch - no local state machine. With no bound
|
|
190
201
|
* state the organism is a plain content list.
|
|
191
202
|
*/
|
|
192
|
-
protected readonly view:
|
|
193
|
-
/**
|
|
194
|
-
|
|
203
|
+
protected readonly view: Signal<AsyncView>;
|
|
204
|
+
/**
|
|
205
|
+
* `true` on the last page of a KNOWN total - every accumulated item has been
|
|
206
|
+
* revealed. With `total` unset or not yet arrived (0), the end state never
|
|
207
|
+
* renders ("All 0 loaded" would be a lie); the load-more trigger stays until
|
|
208
|
+
* the consumer supplies the count.
|
|
209
|
+
*/
|
|
210
|
+
protected readonly exhausted: Signal<boolean>;
|
|
195
211
|
/**
|
|
196
212
|
* The accumulated slice: every page revealed so far, sliced from the top of
|
|
197
213
|
* the bound data. Pure derivation of the brain `cumulativeRange()` and the
|
|
198
214
|
* state's `data()`; the explicit `equal` stops a fresh-array identity from
|
|
199
215
|
* cascading downstream.
|
|
200
216
|
*/
|
|
201
|
-
protected readonly items:
|
|
202
|
-
protected readonly loadingLabel:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
217
|
+
protected readonly items: Signal<readonly T[]>;
|
|
218
|
+
protected readonly loadingLabel: Signal<string>;
|
|
219
|
+
/**
|
|
220
|
+
* The empty view renders `cngx-empty-state`, itself a polite status region, so
|
|
221
|
+
* its title is read untracked and keyed on the view: a language switch does
|
|
222
|
+
* not re-announce it, the next settle speaks the new language.
|
|
223
|
+
*/
|
|
224
|
+
protected readonly emptyLabel: Signal<string>;
|
|
225
|
+
protected readonly errorLabel: Signal<string>;
|
|
226
|
+
protected readonly pageErrorLabel: Signal<string>;
|
|
227
|
+
protected readonly retryLabel: Signal<string>;
|
|
228
|
+
protected readonly endLabel: Signal<string>;
|
|
208
229
|
/**
|
|
209
230
|
* Error text for the active error view - the distinct `pageError` phrasing
|
|
210
231
|
* when a subsequent page failed with the list still visible (`content+error`),
|
|
211
232
|
* the first-load `error` phrasing otherwise. Drives both the built-in visible
|
|
212
233
|
* text and the live-region announcement so the two never diverge.
|
|
213
234
|
*/
|
|
214
|
-
protected readonly errorViewLabel:
|
|
235
|
+
protected readonly errorViewLabel: Signal<string>;
|
|
215
236
|
/**
|
|
216
237
|
* Polite live-region message - communicated on every settle through the same
|
|
217
238
|
* labels the visible views use, so a config or slot override stays in sync.
|
|
239
|
+
* The view state is tracked, the labels are read untracked: a language switch
|
|
240
|
+
* does not re-speak the current message, the next settle speaks the new
|
|
241
|
+
* language.
|
|
218
242
|
*/
|
|
219
|
-
protected readonly statusMessage:
|
|
243
|
+
protected readonly statusMessage: Signal<string>;
|
|
244
|
+
/** Which message the live region speaks for the current view, if any. */
|
|
245
|
+
private readonly statusKey;
|
|
220
246
|
/** Stable retry callback - emits the `retry` output; shared by the built-in button and the error slot context. */
|
|
221
247
|
protected readonly retryFn: () => void;
|
|
222
248
|
/**
|
|
@@ -227,19 +253,22 @@ declare class CngxIncrementalList<T = unknown> {
|
|
|
227
253
|
*/
|
|
228
254
|
protected handleFocusEscaped(): void;
|
|
229
255
|
/** Context handed to a projected error slot: the retry callback and the raw error. */
|
|
230
|
-
protected readonly errorContext:
|
|
256
|
+
protected readonly errorContext: Signal<CngxIncrementalErrorContext>;
|
|
231
257
|
/** `@for` track expression - delegates to the `trackBy` input (index by default). */
|
|
232
258
|
protected readonly trackItem: (index: number, item: T) => unknown;
|
|
259
|
+
/** Built-in row text without an item slot: numbers and dates in the locale. */
|
|
260
|
+
protected itemText(item: T): unknown;
|
|
233
261
|
constructor();
|
|
234
|
-
static ɵfac:
|
|
235
|
-
static ɵcmp:
|
|
262
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalList<any>, never>;
|
|
263
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxIncrementalList<any>, "cngx-incremental-list", ["cngxIncrementalList"], { "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "virtualize": { "alias": "virtualize"; "required": false; "isSignal": true; }; "estimateSize": { "alias": "estimateSize"; "required": false; "isSignal": true; }; "trackBy": { "alias": "trackBy"; "required": false; "isSignal": true; }; }, { "pageIndexChange": "pageIndexChange"; "pageSizeChange": "pageSizeChange"; "retry": "retry"; }, ["itemSlot", "emptySlot", "errorSlot", "endSlot", "loadingSlot"], ["[cngxIncrementalTrigger]"], true, [{ directive: typeof i1.CngxPaginate; inputs: { "cngxPageIndex": "pageIndex"; "cngxPageSize": "pageSize"; "total": "total"; "state": "state"; }; outputs: {}; }]>;
|
|
236
264
|
}
|
|
237
265
|
|
|
238
266
|
/**
|
|
239
267
|
* Accessible-name / visible-label strings for the incremental-list view states.
|
|
240
268
|
* Each doubles as the live-region announcement and the built-in view text, so
|
|
241
|
-
* an override stays in sync across both surfaces.
|
|
242
|
-
*
|
|
269
|
+
* an override stays in sync across both surfaces. The defaults come from the
|
|
270
|
+
* `collection` section of the language pack (English without one); override
|
|
271
|
+
* single keys via {@link withIncrementalListAriaLabels}.
|
|
243
272
|
*
|
|
244
273
|
* @category ui/collection
|
|
245
274
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
@@ -294,20 +323,25 @@ interface CngxIncrementalListTemplates {
|
|
|
294
323
|
readonly loading?: TemplateRef<unknown>;
|
|
295
324
|
}
|
|
296
325
|
/**
|
|
297
|
-
* Resolved incremental-list configuration - the accessible-name
|
|
298
|
-
* optional `templates` slot tree, each merged independently by the reducer
|
|
299
|
-
* {@link provideIncrementalListConfig}.
|
|
326
|
+
* Resolved incremental-list configuration - the accessible-name overrides plus
|
|
327
|
+
* an optional `templates` slot tree, each merged independently by the reducer
|
|
328
|
+
* in {@link provideIncrementalListConfig}.
|
|
329
|
+
*
|
|
330
|
+
* `ariaLabels` holds overrides only: unset by default, a value or a `Signal`
|
|
331
|
+
* once {@link withIncrementalListAriaLabels} ran. Every key it leaves out reads
|
|
332
|
+
* the `collection` section of the language pack, so the list follows a
|
|
333
|
+
* runtime language switch. Read the labels through
|
|
334
|
+
* {@link injectIncrementalListAriaLabels}, inside a `computed()`, a template or
|
|
335
|
+
* a handler.
|
|
300
336
|
*
|
|
301
337
|
* @category ui/collection
|
|
302
338
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
303
339
|
* @since 0.1.0
|
|
304
340
|
*/
|
|
305
341
|
interface CngxIncrementalListConfig {
|
|
306
|
-
readonly ariaLabels
|
|
342
|
+
readonly ariaLabels?: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>;
|
|
307
343
|
readonly templates?: CngxIncrementalListTemplates;
|
|
308
344
|
}
|
|
309
|
-
/** Library defaults - English. Override via {@link provideIncrementalListConfig}. */
|
|
310
|
-
declare const CNGX_INCREMENTAL_LIST_DEFAULTS: CngxIncrementalListConfig;
|
|
311
345
|
/**
|
|
312
346
|
* Configuration cascade token. Resolution priority (high to low):
|
|
313
347
|
* per-instance projected slot, then `provideIncrementalListConfigAt(...)` at
|
|
@@ -330,14 +364,16 @@ declare const CNGX_INCREMENTAL_LIST_CONFIG: InjectionToken<CngxIncrementalListCo
|
|
|
330
364
|
*/
|
|
331
365
|
type CngxIncrementalListConfigFeature = {
|
|
332
366
|
readonly kind: 'ariaLabels';
|
|
333
|
-
readonly payload: Partial<CngxIncrementalListAriaLabels
|
|
367
|
+
readonly payload: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>;
|
|
334
368
|
} | {
|
|
335
369
|
readonly kind: 'templates';
|
|
336
370
|
readonly payload: Partial<CngxIncrementalListTemplates>;
|
|
337
371
|
};
|
|
338
372
|
/**
|
|
339
373
|
* Override any subset of the incremental-list labels. The override applies to
|
|
340
|
-
* both the visible built-in views and the live-region announcements.
|
|
374
|
+
* both the visible built-in views and the live-region announcements. Pass a
|
|
375
|
+
* `Signal` to switch the language at runtime; the live region speaks the new
|
|
376
|
+
* phrasing with its next change.
|
|
341
377
|
*
|
|
342
378
|
* ```ts
|
|
343
379
|
* provideIncrementalListConfig(
|
|
@@ -352,7 +388,7 @@ type CngxIncrementalListConfigFeature = {
|
|
|
352
388
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
353
389
|
* @since 0.1.0
|
|
354
390
|
*/
|
|
355
|
-
declare function withIncrementalListAriaLabels(payload: Partial<CngxIncrementalListAriaLabels>): CngxIncrementalListConfigFeature;
|
|
391
|
+
declare function withIncrementalListAriaLabels(payload: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>): CngxIncrementalListConfigFeature;
|
|
356
392
|
/**
|
|
357
393
|
* Supply application-wide template-slot defaults. A per-instance projected slot
|
|
358
394
|
* still wins over this tier; it only applies where no instance slot is present.
|
|
@@ -400,6 +436,62 @@ declare function provideIncrementalListConfigAt(...features: CngxIncrementalList
|
|
|
400
436
|
* @since 0.1.0
|
|
401
437
|
*/
|
|
402
438
|
declare function injectIncrementalListConfig(): CngxIncrementalListConfig;
|
|
439
|
+
/**
|
|
440
|
+
* The resolved labels of the incremental-list config in scope, as a Signal that
|
|
441
|
+
* follows a runtime language switch: the config overrides over the
|
|
442
|
+
* `collection` section of the active pack, formatted for the reading site's
|
|
443
|
+
* locale. A key the config leaves unset, `null` or `undefined` reads the
|
|
444
|
+
* section. Read it untracked where it builds
|
|
445
|
+
* live-region text, so a language switch does not re-speak the current
|
|
446
|
+
* message. Runs in injection context.
|
|
447
|
+
*
|
|
448
|
+
* @category ui/collection
|
|
449
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
450
|
+
* @since 0.1.0
|
|
451
|
+
*/
|
|
452
|
+
declare function injectIncrementalListAriaLabels(): Signal<CngxIncrementalListAriaLabels>;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* The collection section of a {@link CngxLanguagePack}: the copy of
|
|
456
|
+
* `CngxIncrementalList`, its built-in views and its live region. It feeds the
|
|
457
|
+
* `ariaLabels` of `CNGX_INCREMENTAL_LIST_CONFIG`; a key set through
|
|
458
|
+
* `withIncrementalListAriaLabels` still wins. Messages use `{name}`
|
|
459
|
+
* placeholders, numbers are formatted for the locale.
|
|
460
|
+
*
|
|
461
|
+
* @category ui/collection/i18n
|
|
462
|
+
* @since 0.1.0
|
|
463
|
+
* @relatedTo CNGX_INCREMENTAL_LIST_CONFIG, withIncrementalListAriaLabels
|
|
464
|
+
*/
|
|
465
|
+
interface CngxCollectionLanguageSection {
|
|
466
|
+
/** Busy indicator label while the first load runs. */
|
|
467
|
+
readonly loading: string;
|
|
468
|
+
/** Empty-view text when the list settles with no data. */
|
|
469
|
+
readonly empty: string;
|
|
470
|
+
/** Error-view text when the first load fails. */
|
|
471
|
+
readonly error: string;
|
|
472
|
+
/** Error text when a later page fails and the loaded rows stay visible. */
|
|
473
|
+
readonly pageError: string;
|
|
474
|
+
/** Label of the retry button on the built-in error view. */
|
|
475
|
+
readonly retry: string;
|
|
476
|
+
/** `{count}`: the number of items once every page is loaded. */
|
|
477
|
+
readonly endReached: CngxMessage;
|
|
478
|
+
/** `{count}`: rows newly loaded, `{total}`: rows loaded so far. Announced under `[virtualize]`. */
|
|
479
|
+
readonly loadedMore: CngxMessage;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* The English collection section: the single source of the incremental
|
|
483
|
+
* list's English copy. The `CNGX_INCREMENTAL_LIST_CONFIG` labels default to it.
|
|
484
|
+
*
|
|
485
|
+
* @category ui/collection/i18n
|
|
486
|
+
* @since 0.1.0
|
|
487
|
+
* @relatedTo CNGX_INCREMENTAL_LIST_CONFIG
|
|
488
|
+
*/
|
|
489
|
+
declare const CNGX_COLLECTION_LANGUAGE_EN: CngxCollectionLanguageSection;
|
|
490
|
+
declare module '@cngx/core/i18n' {
|
|
491
|
+
interface CngxLanguagePack {
|
|
492
|
+
readonly collection: CngxCollectionLanguageSection;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
403
495
|
|
|
404
|
-
export {
|
|
405
|
-
export type { CngxIncrementalErrorContext, CngxIncrementalItemContext, CngxIncrementalListAriaLabels, CngxIncrementalListConfig, CngxIncrementalListConfigFeature, CngxIncrementalListSkin, CngxIncrementalListTemplates };
|
|
496
|
+
export { CNGX_COLLECTION_LANGUAGE_EN, CNGX_INCREMENTAL_LIST_CONFIG, CngxIncrementalEmpty, CngxIncrementalEnd, CngxIncrementalError, CngxIncrementalItem, CngxIncrementalList, CngxIncrementalLoading, injectIncrementalListAriaLabels, injectIncrementalListConfig, provideIncrementalListConfig, provideIncrementalListConfigAt, withIncrementalListAriaLabels, withIncrementalListTemplates };
|
|
497
|
+
export type { CngxCollectionLanguageSection, CngxIncrementalErrorContext, CngxIncrementalItemContext, CngxIncrementalListAriaLabels, CngxIncrementalListConfig, CngxIncrementalListConfigFeature, CngxIncrementalListSkin, CngxIncrementalListTemplates };
|