@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,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
|
|
@@ -137,10 +140,20 @@ type CngxIncrementalListSkin = 'plain' | 'divided' | 'card';
|
|
|
137
140
|
* @slot cngxIncrementalEmpty Rendered when the list resolves to nothing.
|
|
138
141
|
* @slot cngxIncrementalError Rendered when a page fetch fails; gets the error and a retry callback.
|
|
139
142
|
* @slot cngxIncrementalEnd Rendered once after the last page, e.g. an end-of-results marker.
|
|
143
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/load-more-trigger</example-url>
|
|
144
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/infinite-trigger</example-url>
|
|
145
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/virtualized</example-url>
|
|
146
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/custom-loading-slot</example-url>
|
|
147
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/empty</example-url>
|
|
148
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/end-reached</example-url>
|
|
149
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/error-retry</example-url>
|
|
150
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/plain</example-url>
|
|
151
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/divided</example-url>
|
|
152
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/card</example-url>
|
|
140
153
|
*/
|
|
141
154
|
declare class CngxIncrementalList<T = unknown> {
|
|
142
155
|
/** Visual skin; reflected onto `[data-skin]`. Paint-only. */
|
|
143
|
-
readonly skin:
|
|
156
|
+
readonly skin: i0.InputSignal<CngxIncrementalListSkin>;
|
|
144
157
|
/**
|
|
145
158
|
* Opt into DOM recycling. When set, the accumulated content branch renders
|
|
146
159
|
* only the visible window of rows through an internal virtualized body inside
|
|
@@ -148,75 +161,98 @@ declare class CngxIncrementalList<T = unknown> {
|
|
|
148
161
|
* (default) keeps the render-all path - the recycler never constructs, so a
|
|
149
162
|
* small list pays nothing. Reflected onto `[data-virtualize]`.
|
|
150
163
|
*/
|
|
151
|
-
readonly virtualize:
|
|
164
|
+
readonly virtualize: i0.InputSignalWithTransform<boolean, unknown>;
|
|
152
165
|
/**
|
|
153
166
|
* Initial per-row height estimate (px) for the virtualized window - the first
|
|
154
167
|
* guess before a row is measured. Ignored unless `[virtualize]` is set.
|
|
155
168
|
*/
|
|
156
|
-
readonly estimateSize:
|
|
157
|
-
/**
|
|
158
|
-
|
|
169
|
+
readonly estimateSize: i0.InputSignal<number>;
|
|
170
|
+
/**
|
|
171
|
+
* Emits the effective page index on every change - navigation or
|
|
172
|
+
* `total`-shrink clamp. Clamp emits are held back while the brain is busy or
|
|
173
|
+
* `total` is 0, so a transient total drop during a refetch never writes a
|
|
174
|
+
* page-0 clamp into the consumer's two-way state.
|
|
175
|
+
*/
|
|
176
|
+
readonly pageIndexChange: i0.OutputEmitterRef<number>;
|
|
159
177
|
/** Emits the effective page size on every change. */
|
|
160
|
-
readonly pageSizeChange:
|
|
178
|
+
readonly pageSizeChange: i0.OutputEmitterRef<number>;
|
|
161
179
|
/**
|
|
162
180
|
* Emits when the error view's retry affordance is activated (the built-in
|
|
163
181
|
* button or a projected error slot's `retry()` context). The consumer re-runs
|
|
164
182
|
* its data source; the organism owns no fetch of its own.
|
|
165
183
|
*/
|
|
166
|
-
readonly retry:
|
|
184
|
+
readonly retry: i0.OutputEmitterRef<void>;
|
|
167
185
|
/**
|
|
168
186
|
* Item identity for the accumulated `@for`. Defaults to the row index
|
|
169
187
|
* (append-safe: appended rows keep their position). Supply a key fn when the
|
|
170
188
|
* bound `[state]` data can be replaced or reordered, so a projected item
|
|
171
189
|
* template keeps its per-row state instead of being reused by position.
|
|
172
190
|
*/
|
|
173
|
-
readonly trackBy:
|
|
191
|
+
readonly trackBy: i0.InputSignal<(index: number, item: T) => unknown>;
|
|
174
192
|
protected readonly paginate: CngxPaginate;
|
|
175
193
|
private readonly host;
|
|
176
194
|
private readonly config;
|
|
195
|
+
private readonly ariaLabels;
|
|
196
|
+
private readonly locale;
|
|
197
|
+
private readonly formatters;
|
|
177
198
|
private readonly itemSlot;
|
|
178
199
|
private readonly emptySlot;
|
|
179
200
|
private readonly errorSlot;
|
|
180
201
|
private readonly endSlot;
|
|
181
202
|
private readonly loadingSlot;
|
|
182
|
-
protected readonly itemTemplate:
|
|
183
|
-
protected readonly emptyTemplate:
|
|
184
|
-
protected readonly errorTemplate:
|
|
185
|
-
protected readonly endTemplate:
|
|
186
|
-
protected readonly loadingTemplate:
|
|
203
|
+
protected readonly itemTemplate: Signal<TemplateRef<any> | null>;
|
|
204
|
+
protected readonly emptyTemplate: Signal<TemplateRef<any> | null>;
|
|
205
|
+
protected readonly errorTemplate: Signal<TemplateRef<any> | null>;
|
|
206
|
+
protected readonly endTemplate: Signal<TemplateRef<any> | null>;
|
|
207
|
+
protected readonly loadingTemplate: Signal<TemplateRef<any> | null>;
|
|
187
208
|
/**
|
|
188
209
|
* Which region renders, resolved from the single `[state]` source through the
|
|
189
210
|
* shared `resolveAsyncView` switch - no local state machine. With no bound
|
|
190
211
|
* state the organism is a plain content list.
|
|
191
212
|
*/
|
|
192
|
-
protected readonly view:
|
|
193
|
-
/**
|
|
194
|
-
|
|
213
|
+
protected readonly view: Signal<AsyncView>;
|
|
214
|
+
/**
|
|
215
|
+
* `true` on the last page of a KNOWN total - every accumulated item has been
|
|
216
|
+
* revealed. With `total` unset or not yet arrived (0), the end state never
|
|
217
|
+
* renders ("All 0 loaded" would be a lie); the load-more trigger stays until
|
|
218
|
+
* the consumer supplies the count.
|
|
219
|
+
*/
|
|
220
|
+
protected readonly exhausted: Signal<boolean>;
|
|
195
221
|
/**
|
|
196
222
|
* The accumulated slice: every page revealed so far, sliced from the top of
|
|
197
223
|
* the bound data. Pure derivation of the brain `cumulativeRange()` and the
|
|
198
224
|
* state's `data()`; the explicit `equal` stops a fresh-array identity from
|
|
199
225
|
* cascading downstream.
|
|
200
226
|
*/
|
|
201
|
-
protected readonly items:
|
|
202
|
-
protected readonly loadingLabel:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
227
|
+
protected readonly items: Signal<readonly T[]>;
|
|
228
|
+
protected readonly loadingLabel: Signal<string>;
|
|
229
|
+
/**
|
|
230
|
+
* The empty view renders `cngx-empty-state`, itself a polite status region, so
|
|
231
|
+
* its title is read untracked and keyed on the view: a language switch does
|
|
232
|
+
* not re-announce it, the next settle speaks the new language.
|
|
233
|
+
*/
|
|
234
|
+
protected readonly emptyLabel: Signal<string>;
|
|
235
|
+
protected readonly errorLabel: Signal<string>;
|
|
236
|
+
protected readonly pageErrorLabel: Signal<string>;
|
|
237
|
+
protected readonly retryLabel: Signal<string>;
|
|
238
|
+
protected readonly endLabel: Signal<string>;
|
|
208
239
|
/**
|
|
209
240
|
* Error text for the active error view - the distinct `pageError` phrasing
|
|
210
241
|
* when a subsequent page failed with the list still visible (`content+error`),
|
|
211
242
|
* the first-load `error` phrasing otherwise. Drives both the built-in visible
|
|
212
243
|
* text and the live-region announcement so the two never diverge.
|
|
213
244
|
*/
|
|
214
|
-
protected readonly errorViewLabel:
|
|
245
|
+
protected readonly errorViewLabel: Signal<string>;
|
|
215
246
|
/**
|
|
216
247
|
* Polite live-region message - communicated on every settle through the same
|
|
217
248
|
* labels the visible views use, so a config or slot override stays in sync.
|
|
249
|
+
* The view state is tracked, the labels are read untracked: a language switch
|
|
250
|
+
* does not re-speak the current message, the next settle speaks the new
|
|
251
|
+
* language.
|
|
218
252
|
*/
|
|
219
|
-
protected readonly statusMessage:
|
|
253
|
+
protected readonly statusMessage: Signal<string>;
|
|
254
|
+
/** Which message the live region speaks for the current view, if any. */
|
|
255
|
+
private readonly statusKey;
|
|
220
256
|
/** Stable retry callback - emits the `retry` output; shared by the built-in button and the error slot context. */
|
|
221
257
|
protected readonly retryFn: () => void;
|
|
222
258
|
/**
|
|
@@ -227,19 +263,22 @@ declare class CngxIncrementalList<T = unknown> {
|
|
|
227
263
|
*/
|
|
228
264
|
protected handleFocusEscaped(): void;
|
|
229
265
|
/** Context handed to a projected error slot: the retry callback and the raw error. */
|
|
230
|
-
protected readonly errorContext:
|
|
266
|
+
protected readonly errorContext: Signal<CngxIncrementalErrorContext>;
|
|
231
267
|
/** `@for` track expression - delegates to the `trackBy` input (index by default). */
|
|
232
268
|
protected readonly trackItem: (index: number, item: T) => unknown;
|
|
269
|
+
/** Built-in row text without an item slot: numbers and dates in the locale. */
|
|
270
|
+
protected itemText(item: T): unknown;
|
|
233
271
|
constructor();
|
|
234
|
-
static ɵfac:
|
|
235
|
-
static ɵcmp:
|
|
272
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxIncrementalList<any>, never>;
|
|
273
|
+
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
274
|
}
|
|
237
275
|
|
|
238
276
|
/**
|
|
239
277
|
* Accessible-name / visible-label strings for the incremental-list view states.
|
|
240
278
|
* Each doubles as the live-region announcement and the built-in view text, so
|
|
241
|
-
* an override stays in sync across both surfaces.
|
|
242
|
-
*
|
|
279
|
+
* an override stays in sync across both surfaces. The defaults come from the
|
|
280
|
+
* `collection` section of the language pack (English without one); override
|
|
281
|
+
* single keys via {@link withIncrementalListAriaLabels}.
|
|
243
282
|
*
|
|
244
283
|
* @category ui/collection
|
|
245
284
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
@@ -294,20 +333,25 @@ interface CngxIncrementalListTemplates {
|
|
|
294
333
|
readonly loading?: TemplateRef<unknown>;
|
|
295
334
|
}
|
|
296
335
|
/**
|
|
297
|
-
* Resolved incremental-list configuration - the accessible-name
|
|
298
|
-
* optional `templates` slot tree, each merged independently by the reducer
|
|
299
|
-
* {@link provideIncrementalListConfig}.
|
|
336
|
+
* Resolved incremental-list configuration - the accessible-name overrides plus
|
|
337
|
+
* an optional `templates` slot tree, each merged independently by the reducer
|
|
338
|
+
* in {@link provideIncrementalListConfig}.
|
|
339
|
+
*
|
|
340
|
+
* `ariaLabels` holds overrides only: unset by default, a value or a `Signal`
|
|
341
|
+
* once {@link withIncrementalListAriaLabels} ran. Every key it leaves out reads
|
|
342
|
+
* the `collection` section of the language pack, so the list follows a
|
|
343
|
+
* runtime language switch. Read the labels through
|
|
344
|
+
* {@link injectIncrementalListAriaLabels}, inside a `computed()`, a template or
|
|
345
|
+
* a handler.
|
|
300
346
|
*
|
|
301
347
|
* @category ui/collection
|
|
302
348
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
303
349
|
* @since 0.1.0
|
|
304
350
|
*/
|
|
305
351
|
interface CngxIncrementalListConfig {
|
|
306
|
-
readonly ariaLabels
|
|
352
|
+
readonly ariaLabels?: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>;
|
|
307
353
|
readonly templates?: CngxIncrementalListTemplates;
|
|
308
354
|
}
|
|
309
|
-
/** Library defaults - English. Override via {@link provideIncrementalListConfig}. */
|
|
310
|
-
declare const CNGX_INCREMENTAL_LIST_DEFAULTS: CngxIncrementalListConfig;
|
|
311
355
|
/**
|
|
312
356
|
* Configuration cascade token. Resolution priority (high to low):
|
|
313
357
|
* per-instance projected slot, then `provideIncrementalListConfigAt(...)` at
|
|
@@ -330,14 +374,16 @@ declare const CNGX_INCREMENTAL_LIST_CONFIG: InjectionToken<CngxIncrementalListCo
|
|
|
330
374
|
*/
|
|
331
375
|
type CngxIncrementalListConfigFeature = {
|
|
332
376
|
readonly kind: 'ariaLabels';
|
|
333
|
-
readonly payload: Partial<CngxIncrementalListAriaLabels
|
|
377
|
+
readonly payload: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>;
|
|
334
378
|
} | {
|
|
335
379
|
readonly kind: 'templates';
|
|
336
380
|
readonly payload: Partial<CngxIncrementalListTemplates>;
|
|
337
381
|
};
|
|
338
382
|
/**
|
|
339
383
|
* Override any subset of the incremental-list labels. The override applies to
|
|
340
|
-
* both the visible built-in views and the live-region announcements.
|
|
384
|
+
* both the visible built-in views and the live-region announcements. Pass a
|
|
385
|
+
* `Signal` to switch the language at runtime; the live region speaks the new
|
|
386
|
+
* phrasing with its next change.
|
|
341
387
|
*
|
|
342
388
|
* ```ts
|
|
343
389
|
* provideIncrementalListConfig(
|
|
@@ -352,7 +398,7 @@ type CngxIncrementalListConfigFeature = {
|
|
|
352
398
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
353
399
|
* @since 0.1.0
|
|
354
400
|
*/
|
|
355
|
-
declare function withIncrementalListAriaLabels(payload: Partial<CngxIncrementalListAriaLabels>): CngxIncrementalListConfigFeature;
|
|
401
|
+
declare function withIncrementalListAriaLabels(payload: Partial<CngxIncrementalListAriaLabels> | Signal<Partial<CngxIncrementalListAriaLabels>>): CngxIncrementalListConfigFeature;
|
|
356
402
|
/**
|
|
357
403
|
* Supply application-wide template-slot defaults. A per-instance projected slot
|
|
358
404
|
* still wins over this tier; it only applies where no instance slot is present.
|
|
@@ -400,6 +446,62 @@ declare function provideIncrementalListConfigAt(...features: CngxIncrementalList
|
|
|
400
446
|
* @since 0.1.0
|
|
401
447
|
*/
|
|
402
448
|
declare function injectIncrementalListConfig(): CngxIncrementalListConfig;
|
|
449
|
+
/**
|
|
450
|
+
* The resolved labels of the incremental-list config in scope, as a Signal that
|
|
451
|
+
* follows a runtime language switch: the config overrides over the
|
|
452
|
+
* `collection` section of the active pack, formatted for the reading site's
|
|
453
|
+
* locale. A key the config leaves unset, `null` or `undefined` reads the
|
|
454
|
+
* section. Read it untracked where it builds
|
|
455
|
+
* live-region text, so a language switch does not re-speak the current
|
|
456
|
+
* message. Runs in injection context.
|
|
457
|
+
*
|
|
458
|
+
* @category ui/collection
|
|
459
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
460
|
+
* @since 0.1.0
|
|
461
|
+
*/
|
|
462
|
+
declare function injectIncrementalListAriaLabels(): Signal<CngxIncrementalListAriaLabels>;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* The collection section of a {@link CngxLanguagePack}: the copy of
|
|
466
|
+
* `CngxIncrementalList`, its built-in views and its live region. It feeds the
|
|
467
|
+
* `ariaLabels` of `CNGX_INCREMENTAL_LIST_CONFIG`; a key set through
|
|
468
|
+
* `withIncrementalListAriaLabels` still wins. Messages use `{name}`
|
|
469
|
+
* placeholders, numbers are formatted for the locale.
|
|
470
|
+
*
|
|
471
|
+
* @category ui/collection/i18n
|
|
472
|
+
* @since 0.1.0
|
|
473
|
+
* @relatedTo CNGX_INCREMENTAL_LIST_CONFIG, withIncrementalListAriaLabels
|
|
474
|
+
*/
|
|
475
|
+
interface CngxCollectionLanguageSection {
|
|
476
|
+
/** Busy indicator label while the first load runs. */
|
|
477
|
+
readonly loading: string;
|
|
478
|
+
/** Empty-view text when the list settles with no data. */
|
|
479
|
+
readonly empty: string;
|
|
480
|
+
/** Error-view text when the first load fails. */
|
|
481
|
+
readonly error: string;
|
|
482
|
+
/** Error text when a later page fails and the loaded rows stay visible. */
|
|
483
|
+
readonly pageError: string;
|
|
484
|
+
/** Label of the retry button on the built-in error view. */
|
|
485
|
+
readonly retry: string;
|
|
486
|
+
/** `{count}`: the number of items once every page is loaded. */
|
|
487
|
+
readonly endReached: CngxMessage;
|
|
488
|
+
/** `{count}`: rows newly loaded, `{total}`: rows loaded so far. Announced under `[virtualize]`. */
|
|
489
|
+
readonly loadedMore: CngxMessage;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* The English collection section: the single source of the incremental
|
|
493
|
+
* list's English copy. The `CNGX_INCREMENTAL_LIST_CONFIG` labels default to it.
|
|
494
|
+
*
|
|
495
|
+
* @category ui/collection/i18n
|
|
496
|
+
* @since 0.1.0
|
|
497
|
+
* @relatedTo CNGX_INCREMENTAL_LIST_CONFIG
|
|
498
|
+
*/
|
|
499
|
+
declare const CNGX_COLLECTION_LANGUAGE_EN: CngxCollectionLanguageSection;
|
|
500
|
+
declare module '@cngx/core/i18n' {
|
|
501
|
+
interface CngxLanguagePack {
|
|
502
|
+
readonly collection: CngxCollectionLanguageSection;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
403
505
|
|
|
404
|
-
export {
|
|
405
|
-
export type { CngxIncrementalErrorContext, CngxIncrementalItemContext, CngxIncrementalListAriaLabels, CngxIncrementalListConfig, CngxIncrementalListConfigFeature, CngxIncrementalListSkin, CngxIncrementalListTemplates };
|
|
506
|
+
export { CNGX_COLLECTION_LANGUAGE_EN, CNGX_INCREMENTAL_LIST_CONFIG, CngxIncrementalEmpty, CngxIncrementalEnd, CngxIncrementalError, CngxIncrementalItem, CngxIncrementalList, CngxIncrementalLoading, injectIncrementalListAriaLabels, injectIncrementalListConfig, provideIncrementalListConfig, provideIncrementalListConfigAt, withIncrementalListAriaLabels, withIncrementalListTemplates };
|
|
507
|
+
export type { CngxCollectionLanguageSection, CngxIncrementalErrorContext, CngxIncrementalItemContext, CngxIncrementalListAriaLabels, CngxIncrementalListConfig, CngxIncrementalListConfigFeature, CngxIncrementalListSkin, CngxIncrementalListTemplates };
|