@cngx/ui 0.1.0-rc.2 → 0.1.0-rc.3
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 +15 -7
- package/fesm2022/cngx-ui-mat-paginator.mjs +215 -0
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-paginator.mjs +1868 -0
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -0
- package/fesm2022/cngx-ui-tabs.mjs +6 -4
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +2 -2
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +135 -0
- package/package.json +9 -5
- package/paginator/README.md +131 -0
- package/types/cngx-ui-mat-paginator.d.ts +108 -0
- package/types/cngx-ui-paginator.d.ts +1035 -0
- package/types/cngx-ui-tabs.d.ts +2 -0
- package/fesm2022/cngx-ui-material.mjs +0 -90
- package/fesm2022/cngx-ui-material.mjs.map +0 -1
- package/material/README.md +0 -90
- package/types/cngx-ui-material.d.ts +0 -47
|
@@ -0,0 +1,1035 @@
|
|
|
1
|
+
import * as _cngx_ui_paginator from '@cngx/ui/paginator';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { TemplateRef, InjectionToken, Signal, EnvironmentProviders, Provider } from '@angular/core';
|
|
4
|
+
import * as i1 from '@cngx/common/data';
|
|
5
|
+
import { CngxPaginate } from '@cngx/common/data';
|
|
6
|
+
|
|
7
|
+
/** Visual skin. Paint-only - structure, ARIA, and keyboard behaviour are identical across values. */
|
|
8
|
+
type CngxPaginatorSkin = 'numbered' | 'minimal' | 'pill' | 'segmented' | 'rail' | 'dots' | 'bar';
|
|
9
|
+
/** Density preset. Shifts spacing/hit-target tokens; orthogonal to skin. */
|
|
10
|
+
type CngxPaginatorDensity = 'compact' | 'default' | 'comfortable';
|
|
11
|
+
/**
|
|
12
|
+
* Declarative, skinnable pagination organism. A thin shell over the
|
|
13
|
+
* `CngxPaginate` brain (applied as a `hostDirective`), assembled by the
|
|
14
|
+
* consumer from projected segment parts in DOM order - no `show*` config
|
|
15
|
+
* inputs. `skin` / `density` are single paint attributes reflected onto
|
|
16
|
+
* `[data-skin]` / `[data-density]`.
|
|
17
|
+
*
|
|
18
|
+
* Two-way `[(pageIndex)]` / `[(pageSize)]`: the brain's controlled inputs are
|
|
19
|
+
* aliased through `hostDirectives` (`cngxPageIndex` -> `pageIndex`,
|
|
20
|
+
* `cngxPageSize` -> `pageSize`); the shell owns the matching
|
|
21
|
+
* `pageIndexChange` / `pageSizeChange` outputs and is their single emitter,
|
|
22
|
+
* guarded by the shared `lastEmitted*` fields. Two paths feed each output once:
|
|
23
|
+
* (1) a subscription forwards the brain's nav-only `pageChange` /
|
|
24
|
+
* `pageSizeChange` - the only signal that captures a controlled-mode `setPage`,
|
|
25
|
+
* because the brain's `pageIndex()` stays pinned to the input until the
|
|
26
|
+
* consumer feeds it back; (2) an `effect()` reads the effective
|
|
27
|
+
* `pageIndex()` / `pageSize()` and covers a `total`-shrink clamp the nav-only
|
|
28
|
+
* output misses. The brain output is forwarded, NOT aliased through
|
|
29
|
+
* `hostDirectives`: a raw alias would bypass the shared guard and double-emit
|
|
30
|
+
* on uncontrolled navigation. The guard makes every distinct value emit exactly
|
|
31
|
+
* once across both paths and both modes, so the clamp echoes back to controlled
|
|
32
|
+
* consumers (and, from Phase E, is announced) without a double-fire.
|
|
33
|
+
*
|
|
34
|
+
* All ARIA attributes are signal-driven. `aria-busy` has a single owner here.
|
|
35
|
+
*
|
|
36
|
+
* @category ui/paginator
|
|
37
|
+
* @docsKind primary
|
|
38
|
+
* @wcag AA
|
|
39
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator.component.ts
|
|
40
|
+
* @since 0.1.0
|
|
41
|
+
* @relatedTo CngxPaginate, CngxMatPaginator
|
|
42
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
|
|
43
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
|
|
44
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
|
|
45
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
|
|
46
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
|
|
47
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/infinite</example-url>
|
|
48
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/load-more</example-url>
|
|
49
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
|
|
50
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
|
|
51
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
52
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
|
|
53
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
|
|
54
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
55
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/dots</example-url>
|
|
56
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
|
|
57
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
58
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
59
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
60
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
|
|
61
|
+
*/
|
|
62
|
+
declare class CngxPaginator {
|
|
63
|
+
/** Accessible name for the navigation landmark. Overrides the config default. */
|
|
64
|
+
readonly ariaLabel: i0.InputSignal<string | undefined>;
|
|
65
|
+
/** Visual skin; reflected onto `[data-skin]`. */
|
|
66
|
+
readonly skin: i0.InputSignal<CngxPaginatorSkin>;
|
|
67
|
+
/** Density preset; reflected onto `[data-density]`. */
|
|
68
|
+
readonly density: i0.InputSignal<CngxPaginatorDensity>;
|
|
69
|
+
/**
|
|
70
|
+
* Opt into the responsive collapse; reflected onto `[data-responsive]`. When
|
|
71
|
+
* set, a `@container` rule swaps the projected `cngx-pgn-pages` number row for
|
|
72
|
+
* a `cngx-pgn-status` "Page n of m" readout once the paginator's own container
|
|
73
|
+
* narrows past the collapse breakpoint. Compose both segments for it to apply.
|
|
74
|
+
*/
|
|
75
|
+
readonly responsive: i0.InputSignalWithTransform<boolean, unknown>;
|
|
76
|
+
/**
|
|
77
|
+
* Reset key. When its value changes (after the initial render) the paginator
|
|
78
|
+
* jumps to the first page - bind the sort / filter / search value a result set
|
|
79
|
+
* depends on so a narrowed result never strands the user on a now-empty page.
|
|
80
|
+
* Bind a primitive or a `computed`; an inline array / object literal
|
|
81
|
+
* recomputes every change-detection pass and would reset on each. Shares the
|
|
82
|
+
* `connectPaginateResetOn` implementation with `[cngxPaginateResetOn]`.
|
|
83
|
+
*/
|
|
84
|
+
readonly resetOn: i0.InputSignal<unknown>;
|
|
85
|
+
/** Emits the effective page index on every change - navigation or `total`-shrink clamp. */
|
|
86
|
+
readonly pageIndexChange: i0.OutputEmitterRef<number>;
|
|
87
|
+
/** Emits the effective page size on every change. */
|
|
88
|
+
readonly pageSizeChange: i0.OutputEmitterRef<number>;
|
|
89
|
+
protected readonly paginate: CngxPaginate;
|
|
90
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
91
|
+
private readonly destroyRef;
|
|
92
|
+
/**
|
|
93
|
+
* Live-region message source - mounted onto the `cngxLiveRegion` span in the
|
|
94
|
+
* template. Built through the swap token so a consumer can wrap the
|
|
95
|
+
* busy / settle / page-change derivation without forking the shell.
|
|
96
|
+
*/
|
|
97
|
+
protected readonly announcer: _cngx_ui_paginator.CngxPaginatorAnnouncer;
|
|
98
|
+
protected readonly resolvedAriaLabel: i0.Signal<string>;
|
|
99
|
+
protected readonly loadingSlot: i0.Signal<TemplateRef<any> | undefined>;
|
|
100
|
+
protected readonly loadingTemplate: i0.Signal<TemplateRef<any> | null>;
|
|
101
|
+
private lastEmittedIndex;
|
|
102
|
+
private lastEmittedSize;
|
|
103
|
+
constructor();
|
|
104
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginator, never>;
|
|
105
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginator, "cngx-paginator", ["cngxPaginator"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "density": { "alias": "density"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "resetOn": { "alias": "resetOn"; "required": false; "isSignal": true; }; }, { "pageIndexChange": "pageIndexChange"; "pageSizeChange": "pageSizeChange"; }, ["loadingSlot"], ["*"], true, [{ directive: typeof i1.CngxPaginate; inputs: { "cngxPageIndex": "pageIndex"; "cngxPageSize": "pageSize"; "total": "total"; "state": "state"; }; outputs: {}; }]>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Read-mostly state-and-navigation contract every paginator segment part
|
|
110
|
+
* injects instead of the concrete `CngxPaginator` shell. \
|
|
111
|
+
* A structural subset of the `CngxPaginate` brain
|
|
112
|
+
* (`@cngx/common/data`) - the brain provides it via `useExisting`, so a
|
|
113
|
+
* decomposed skin keeps talking to the same token without depending on the
|
|
114
|
+
* organism class (Atomic Decompose, DI abstraction).
|
|
115
|
+
*
|
|
116
|
+
* The signals are the single derivation source for every segment's disabled
|
|
117
|
+
* state, label, and `aria-current`; the methods are the only write paths,
|
|
118
|
+
* each routing through the brain so the clamp-`computed()` and busy-gate
|
|
119
|
+
* invariants hold.
|
|
120
|
+
*
|
|
121
|
+
* @category ui/paginator
|
|
122
|
+
*/
|
|
123
|
+
interface CngxPaginatorHost {
|
|
124
|
+
/** Current page index (0-based), auto-clamped to `totalPages`. */
|
|
125
|
+
readonly pageIndex: Signal<number>;
|
|
126
|
+
/** Current page size. */
|
|
127
|
+
readonly pageSize: Signal<number>;
|
|
128
|
+
/** Total item count (before pagination). */
|
|
129
|
+
readonly total: Signal<number>;
|
|
130
|
+
/** Total number of pages (minimum 1). */
|
|
131
|
+
readonly totalPages: Signal<number>;
|
|
132
|
+
/** `[start, end]` slice indices for the current page - always in-bounds. */
|
|
133
|
+
readonly range: Signal<readonly [number, number]>;
|
|
134
|
+
/**
|
|
135
|
+
* `[0, end]` cumulative slice indices for append-don't-replace (load-more)
|
|
136
|
+
* consumers - every page revealed so far, sliced from the top.
|
|
137
|
+
*/
|
|
138
|
+
readonly cumulativeRange: Signal<readonly [number, number]>;
|
|
139
|
+
/** `true` when on the first page. */
|
|
140
|
+
readonly isFirst: Signal<boolean>;
|
|
141
|
+
/** `true` when on the last page. */
|
|
142
|
+
readonly isLast: Signal<boolean>;
|
|
143
|
+
/** `true` while the bound async state is busy - navigation is gated. */
|
|
144
|
+
readonly isBusy: Signal<boolean>;
|
|
145
|
+
/** Navigate to `index`, clamped to `[0, totalPages - 1]`. No-op while busy. */
|
|
146
|
+
setPage(index: number): void;
|
|
147
|
+
/** Change page size; resets to page 0 unless `resetPage` is `false`. No-op while busy. */
|
|
148
|
+
setPageSize(size: number, resetPage?: boolean): void;
|
|
149
|
+
/** Navigate to the next page (no-op on the last page). */
|
|
150
|
+
next(): void;
|
|
151
|
+
/** Navigate to the previous page (no-op on the first page). */
|
|
152
|
+
previous(): void;
|
|
153
|
+
/** Navigate to the first page. */
|
|
154
|
+
first(): void;
|
|
155
|
+
/** Navigate to the last page. */
|
|
156
|
+
last(): void;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* DI token the `CngxPaginator` shell provides via `useExisting`. Segment
|
|
160
|
+
* parts (`cngx-pgn-prev`, `cngx-pgn-pages`, ...) inject this rather than the
|
|
161
|
+
* concrete component class, keeping the organism decompose-ready.
|
|
162
|
+
*
|
|
163
|
+
* @category ui/paginator
|
|
164
|
+
* @wcag AA
|
|
165
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator-host.token.ts
|
|
166
|
+
* @since 0.1.0
|
|
167
|
+
*/
|
|
168
|
+
declare const CNGX_PAGINATOR_HOST: InjectionToken<CngxPaginatorHost>;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Overrides the paginator's built-in busy indicator. Project a structural
|
|
172
|
+
* `*cngxPaginatorLoading` template inside `<cngx-paginator>` and the shell
|
|
173
|
+
* renders it - instead of the default `<cngx-progress>` bar - while the bound
|
|
174
|
+
* async state is busy. Resolution cascades instance slot ->
|
|
175
|
+
* `CngxPaginatorConfig.templates.loading` -> built-in `CngxProgress`.
|
|
176
|
+
*
|
|
177
|
+
* ```html
|
|
178
|
+
* <cngx-paginator [state]="state">
|
|
179
|
+
* <ng-template cngxPaginatorLoading>
|
|
180
|
+
* <my-branded-spinner />
|
|
181
|
+
* </ng-template>
|
|
182
|
+
* <cngx-pgn-pages />
|
|
183
|
+
* </cngx-paginator>
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* @category ui/paginator
|
|
187
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator-loading.directive.ts
|
|
188
|
+
* @since 0.1.0
|
|
189
|
+
* @relatedTo CngxPaginator, CngxProgress
|
|
190
|
+
*/
|
|
191
|
+
declare class CngxPaginatorLoading {
|
|
192
|
+
readonly templateRef: TemplateRef<any>;
|
|
193
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorLoading, never>;
|
|
194
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxPaginatorLoading, "[cngxPaginatorLoading]", ["cngxPaginatorLoading"], {}, {}, never, never, true, never>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface NavCore {
|
|
198
|
+
readonly disabled: Signal<boolean>;
|
|
199
|
+
readonly ariaLabel: Signal<string>;
|
|
200
|
+
activate(): void;
|
|
201
|
+
}
|
|
202
|
+
/** First-page segment. Disabled on the first page; calls `host.first()`.
|
|
203
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
204
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
205
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
206
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
207
|
+
*/
|
|
208
|
+
declare class CngxPaginatorFirst {
|
|
209
|
+
protected readonly glyph: "«";
|
|
210
|
+
protected readonly core: NavCore;
|
|
211
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorFirst, never>;
|
|
212
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorFirst, "cngx-pgn-first", ["cngxPgnFirst"], {}, {}, never, never, true, never>;
|
|
213
|
+
}
|
|
214
|
+
/** Previous-page segment. Disabled on the first page; calls `host.previous()`.
|
|
215
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
|
|
216
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
|
|
217
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
|
|
218
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
|
|
219
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
|
|
220
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
|
|
221
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
|
|
222
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
223
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
|
|
224
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
|
|
225
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
226
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
|
|
227
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
228
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
229
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
230
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
|
|
231
|
+
*/
|
|
232
|
+
declare class CngxPaginatorPrev {
|
|
233
|
+
protected readonly glyph: "‹";
|
|
234
|
+
protected readonly core: NavCore;
|
|
235
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorPrev, never>;
|
|
236
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorPrev, "cngx-pgn-prev", ["cngxPgnPrev"], {}, {}, never, never, true, never>;
|
|
237
|
+
}
|
|
238
|
+
/** Next-page segment. Disabled on the last page; calls `host.next()`.
|
|
239
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
|
|
240
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
|
|
241
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
|
|
242
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
|
|
243
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
|
|
244
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
|
|
245
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
|
|
246
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
247
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
|
|
248
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
|
|
249
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
250
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
|
|
251
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
252
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
253
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
254
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
|
|
255
|
+
*/
|
|
256
|
+
declare class CngxPaginatorNext {
|
|
257
|
+
protected readonly glyph: "›";
|
|
258
|
+
protected readonly core: NavCore;
|
|
259
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorNext, never>;
|
|
260
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorNext, "cngx-pgn-next", ["cngxPgnNext"], {}, {}, never, never, true, never>;
|
|
261
|
+
}
|
|
262
|
+
/** Last-page segment. Disabled on the last page; calls `host.last()`.
|
|
263
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
264
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
265
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
266
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
267
|
+
*/
|
|
268
|
+
declare class CngxPaginatorLast {
|
|
269
|
+
protected readonly glyph: "»";
|
|
270
|
+
protected readonly core: NavCore;
|
|
271
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorLast, never>;
|
|
272
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorLast, "cngx-pgn-last", ["cngxPgnLast"], {}, {}, never, never, true, never>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** One slot in the rendered page row: a page button or a truncation gap. */
|
|
276
|
+
type PageItem = {
|
|
277
|
+
readonly kind: 'page';
|
|
278
|
+
readonly index: number;
|
|
279
|
+
} | {
|
|
280
|
+
readonly kind: 'gap';
|
|
281
|
+
readonly hidden: readonly number[];
|
|
282
|
+
};
|
|
283
|
+
/** The rendered sequence plus the gap count (a cheap structural fingerprint). */
|
|
284
|
+
interface PageWindow {
|
|
285
|
+
readonly pages: readonly PageItem[];
|
|
286
|
+
readonly gaps: number;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* The numbered page row. One tab stop via `CngxRovingTabindex` (arrows / Home /
|
|
291
|
+
* End move the active page button); the current page carries `aria-current`.
|
|
292
|
+
* A truncation run collapses into an ellipsis button that opens a `CngxListbox`
|
|
293
|
+
* grid of the hidden pages (same select-and-jump model as `cngx-pgn-page-of-pages`,
|
|
294
|
+
* so focus moves into the panel on open).
|
|
295
|
+
*
|
|
296
|
+
* @category ui/paginator
|
|
297
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
|
|
298
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
|
|
299
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
|
|
300
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
|
|
301
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
|
|
302
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
|
|
303
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
304
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
305
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
|
|
306
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
307
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
|
|
308
|
+
*/
|
|
309
|
+
declare class CngxPaginatorPages {
|
|
310
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
311
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
312
|
+
protected readonly glyphs: {
|
|
313
|
+
readonly first: "«";
|
|
314
|
+
readonly previous: "‹";
|
|
315
|
+
readonly next: "›";
|
|
316
|
+
readonly last: "»";
|
|
317
|
+
readonly more: "…";
|
|
318
|
+
readonly caret: "▾";
|
|
319
|
+
};
|
|
320
|
+
/** Pages flanking the current page on each side. Defaults to the v1 window. */
|
|
321
|
+
readonly siblingCount: i0.InputSignal<number>;
|
|
322
|
+
/** Pages pinned at each end. Defaults to the v1 window. */
|
|
323
|
+
readonly boundaryCount: i0.InputSignal<number>;
|
|
324
|
+
/** The page-window computation, swappable enterprise-wide via the DI token. */
|
|
325
|
+
private readonly pageWindowFn;
|
|
326
|
+
/**
|
|
327
|
+
* The rendered page window. Structural `equal` keeps the reference stable
|
|
328
|
+
* across recomputes that yield an identical window, so the `@for` does not
|
|
329
|
+
* churn (signal-equality rule).
|
|
330
|
+
*/
|
|
331
|
+
protected readonly model: i0.Signal<PageWindow>;
|
|
332
|
+
/** Position of the active page within the rendered window (gaps counted). */
|
|
333
|
+
private readonly activeWindowIndex;
|
|
334
|
+
/**
|
|
335
|
+
* Roving focus cursor for the page row. A `linkedSignal` so the row's single
|
|
336
|
+
* tab stop tracks the active page (Tab lands on `aria-current`) yet still
|
|
337
|
+
* moves freely under the arrow keys between selections: arrow navigation
|
|
338
|
+
* writes the cursor locally, and it re-syncs to the active page whenever the
|
|
339
|
+
* page changes by any path (click / prev / next / Enter). Focus is not
|
|
340
|
+
* selection - the user arrows to a page and Enter commits it.
|
|
341
|
+
*/
|
|
342
|
+
protected readonly rovingIndex: i0.WritableSignal<number>;
|
|
343
|
+
protected isCurrent(index: number): boolean;
|
|
344
|
+
protected goto(index: number): void;
|
|
345
|
+
/**
|
|
346
|
+
* Open the overflow popover and move focus into the listbox panel, so a
|
|
347
|
+
* keyboard user lands in the grid (the trigger is a roving page-row item, so
|
|
348
|
+
* the listbox trigger's own focus-move does not fire). `Enter`/`Space` on the
|
|
349
|
+
* button dispatch a native click, so this covers mouse and keyboard alike.
|
|
350
|
+
*/
|
|
351
|
+
protected openOverflow(popover: {
|
|
352
|
+
toggle(): void;
|
|
353
|
+
isVisible(): boolean;
|
|
354
|
+
}, panel: HTMLElement): void;
|
|
355
|
+
/**
|
|
356
|
+
* Restore focus to the ellipsis trigger when the panel closes (Escape /
|
|
357
|
+
* outside click), so a keyboard user is not dropped to the page body. If a
|
|
358
|
+
* selection re-rendered the window away, the trigger is gone and the guard
|
|
359
|
+
* skips it.
|
|
360
|
+
*/
|
|
361
|
+
protected onOverflowToggle(event: Event, trigger: HTMLElement): void;
|
|
362
|
+
protected onSelectOverflow(value: number | null | undefined): void;
|
|
363
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorPages, never>;
|
|
364
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorPages, "cngx-pgn-pages", ["cngxPgnPages"], { "siblingCount": { "alias": "siblingCount"; "required": false; "isSignal": true; }; "boundaryCount": { "alias": "boundaryCount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* The page-window computation `cngx-pgn-pages` calls per recompute: given the
|
|
369
|
+
* current 0-based page, the total page count, and the per-instance
|
|
370
|
+
* `siblingCount` / `boundaryCount`, return the rendered {@link PageWindow}. An
|
|
371
|
+
* override implements a different truncation algorithm while still honouring the
|
|
372
|
+
* consumer's sibling / boundary intent.
|
|
373
|
+
*
|
|
374
|
+
* @category ui/paginator
|
|
375
|
+
*/
|
|
376
|
+
type CngxPaginatorPageWindowFn = (current: number, total: number, siblingCount: number, boundaryCount: number) => PageWindow;
|
|
377
|
+
/** The shape an override must match to swap the page-window computation. */
|
|
378
|
+
type CngxPaginatorPageWindowFactory = () => CngxPaginatorPageWindowFn;
|
|
379
|
+
/**
|
|
380
|
+
* Default page-window factory. Resolves to the built-in {@link pageWindow} math
|
|
381
|
+
* (one sibling each side, one pinned boundary at each end at the `1 / 1`
|
|
382
|
+
* defaults). The segment builds its window via
|
|
383
|
+
* `inject(CNGX_PAGINATOR_PAGE_WINDOW_FACTORY)()` rather than calling this
|
|
384
|
+
* directly, mirroring {@link createPaginatorAnnouncer}.
|
|
385
|
+
*
|
|
386
|
+
* @category ui/paginator
|
|
387
|
+
*/
|
|
388
|
+
declare const createPaginatorPageWindow: CngxPaginatorPageWindowFactory;
|
|
389
|
+
/**
|
|
390
|
+
* Swap token for the page-row truncation algorithm. The default resolves to
|
|
391
|
+
* {@link createPaginatorPageWindow}; override it to replace the whole windowing
|
|
392
|
+
* computation enterprise-wide (via `providers`) or per-component (via
|
|
393
|
+
* `viewProviders`) without forking the segment. Per-instance tweaks to the
|
|
394
|
+
* sibling / boundary counts use the `[siblingCount]` / `[boundaryCount]` inputs
|
|
395
|
+
* on `cngx-pgn-pages` instead. Mirrors {@link CNGX_PAGINATOR_ANNOUNCER_FACTORY}.
|
|
396
|
+
*
|
|
397
|
+
* @category ui/paginator
|
|
398
|
+
*/
|
|
399
|
+
declare const CNGX_PAGINATOR_PAGE_WINDOW_FACTORY: InjectionToken<CngxPaginatorPageWindowFactory>;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Range-readout segment: renders `start-end of total` for the current page.
|
|
403
|
+
* Pure derivation from the host `range()`/`total()` signals - no local state,
|
|
404
|
+
* no writes. The text (including the `of` connector) comes from the
|
|
405
|
+
* config range formatter, so it localises with the rest of the cascade. Tabular
|
|
406
|
+
* figures keep the numerals from reflowing as the page changes.
|
|
407
|
+
*
|
|
408
|
+
* @category ui/paginator
|
|
409
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
|
|
410
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
|
|
411
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
|
|
412
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
|
|
413
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
|
|
414
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
415
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
|
|
416
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
|
|
417
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
418
|
+
*/
|
|
419
|
+
declare class CngxPaginatorRange {
|
|
420
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
421
|
+
private readonly config;
|
|
422
|
+
/** 1-based index of the first item on the current page (0 when empty). */
|
|
423
|
+
protected readonly start: i0.Signal<number>;
|
|
424
|
+
/**
|
|
425
|
+
* 1-based index of the last item on the current page. The brain's `range()`
|
|
426
|
+
* upper bound is uncapped (`start + pageSize`), so a partial final page is
|
|
427
|
+
* clamped to `total` here for an honest readout.
|
|
428
|
+
*/
|
|
429
|
+
protected readonly end: i0.Signal<number>;
|
|
430
|
+
/** Formatted readout from the config range formatter (EN default `start-end of total`). */
|
|
431
|
+
protected readonly text: i0.Signal<string>;
|
|
432
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorRange, never>;
|
|
433
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorRange, "cngx-pgn-range", ["cngxPgnRange"], {}, {}, never, never, true, never>;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Go-to-page segment: a native `<input type="number">`. Typing (or the spinner)
|
|
438
|
+
* navigates live via `input`; Enter / blur additionally clamp and re-sync the
|
|
439
|
+
* field. The brain clamps out-of-range values, so the field reflects the clamped
|
|
440
|
+
* page back. Accessible name from config (EN default, Pillar 2).
|
|
441
|
+
*
|
|
442
|
+
* @category ui/paginator
|
|
443
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
|
|
444
|
+
*/
|
|
445
|
+
declare class CngxPaginatorGoto {
|
|
446
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
447
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
448
|
+
/** Live navigation on every keystroke / spinner step - no field re-sync, so
|
|
449
|
+
* typing is never interrupted; the clamp re-sync happens on commit. */
|
|
450
|
+
protected navigate(event: Event): void;
|
|
451
|
+
protected commit(event: Event): void;
|
|
452
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorGoto, never>;
|
|
453
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorGoto, "cngx-pgn-goto", ["cngxPgnGoto"], {}, {}, never, never, true, never>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Items-per-page segment. A `CngxListbox` dropdown (never a native `<select>`,
|
|
458
|
+
* never the forms select family - keeps `@cngx/ui/paginator` free of a
|
|
459
|
+
* `@cngx/forms` dependency). `[options]` is data, not a feature toggle.
|
|
460
|
+
* Picking a size routes through `host.setPageSize`, which resets to
|
|
461
|
+
* page 0 (brain semantics). The selected size is derived from `host.pageSize()`,
|
|
462
|
+
* so the panel selection and the trigger label never drift (Pillar 1).
|
|
463
|
+
*
|
|
464
|
+
* @category ui/paginator
|
|
465
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
|
|
466
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
|
|
467
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
|
|
468
|
+
*/
|
|
469
|
+
declare class CngxPaginatorPageSize {
|
|
470
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
471
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
472
|
+
protected readonly glyphs: {
|
|
473
|
+
readonly first: "«";
|
|
474
|
+
readonly previous: "‹";
|
|
475
|
+
readonly next: "›";
|
|
476
|
+
readonly last: "»";
|
|
477
|
+
readonly more: "…";
|
|
478
|
+
readonly caret: "▾";
|
|
479
|
+
};
|
|
480
|
+
/** Selectable page sizes. Pure data - the segment is content-agnostic. */
|
|
481
|
+
readonly options: i0.InputSignal<readonly number[]>;
|
|
482
|
+
protected onSelect(value: number | undefined): void;
|
|
483
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorPageSize, never>;
|
|
484
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorPageSize, "cngx-pgn-page-size", ["cngxPgnPageSize"], { "options": { "alias": "options"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Page-of-pages segment. A `CngxListbox` dropdown of `1..totalPages`; picking
|
|
489
|
+
* page `n` routes through `host.setPage(n - 1)`. The option list is derived
|
|
490
|
+
* from `host.totalPages()` and the selected entry from `host.pageIndex()`, so
|
|
491
|
+
* both track the brain with zero local state (Pillar 1). Like the page-size
|
|
492
|
+
* segment it avoids native `<select>` and the forms family, keeping the entry
|
|
493
|
+
* `@cngx/forms`-free.
|
|
494
|
+
*
|
|
495
|
+
* @category ui/paginator
|
|
496
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
|
|
497
|
+
*/
|
|
498
|
+
declare class CngxPaginatorPageOfPages {
|
|
499
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
500
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
501
|
+
protected readonly glyphs: {
|
|
502
|
+
readonly first: "«";
|
|
503
|
+
readonly previous: "‹";
|
|
504
|
+
readonly next: "›";
|
|
505
|
+
readonly last: "»";
|
|
506
|
+
readonly more: "…";
|
|
507
|
+
readonly caret: "▾";
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* The 1-based page numbers `1..totalPages`. Length-keyed `equal` keeps the
|
|
511
|
+
* reference stable while the count is unchanged - the contents are fully
|
|
512
|
+
* determined by the length, so the `@for` never churns (signal-equality rule).
|
|
513
|
+
*/
|
|
514
|
+
protected readonly pages: i0.Signal<number[]>;
|
|
515
|
+
protected onSelect(value: number | undefined): void;
|
|
516
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorPageOfPages, never>;
|
|
517
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorPageOfPages, "cngx-pgn-page-of-pages", ["cngxPgnPageOfPages"], {}, {}, never, never, true, never>;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/** Resting size tier of a rendered dot. Edge dots shrink (iOS page-control). */
|
|
521
|
+
type DotSize = 'full' | 'medium' | 'small';
|
|
522
|
+
interface Dot {
|
|
523
|
+
readonly index: number;
|
|
524
|
+
readonly size: DotSize;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* The dots indicator: one circular `<button>` per page, windowed with an
|
|
528
|
+
* iOS-style edge-shrink for large counts. The active dot carries
|
|
529
|
+
* `aria-current="page"`; every dot exposes its page name via `aria-label`
|
|
530
|
+
* (the circle itself is decorative). Click navigates through the brain, gated
|
|
531
|
+
* while busy. Dot DOM + windowing live here, not in a shared atom (over-
|
|
532
|
+
* abstraction avoided - extract only when a second consumer appears).
|
|
533
|
+
*
|
|
534
|
+
* @category ui/paginator
|
|
535
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/dots</example-url>
|
|
536
|
+
*/
|
|
537
|
+
declare class CngxPaginatorDots {
|
|
538
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
539
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
540
|
+
/**
|
|
541
|
+
* The rendered dot window. Structural `equal` keeps the reference stable
|
|
542
|
+
* across recomputes that yield an identical window, so the `@for` does not
|
|
543
|
+
* churn (signal-equality rule).
|
|
544
|
+
*/
|
|
545
|
+
protected readonly model: i0.Signal<readonly Dot[]>;
|
|
546
|
+
protected isCurrent(index: number): boolean;
|
|
547
|
+
protected goto(index: number): void;
|
|
548
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorDots, never>;
|
|
549
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorDots, "cngx-pgn-dots", ["cngxPgnDots"], {}, {}, never, never, true, never>;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Page-status readout: renders "Page n of m" for the current page. Pure
|
|
554
|
+
* derivation from the host `pageIndex()`/`totalPages()` signals - no local
|
|
555
|
+
* state, no writes. It is the visible counterpart of the
|
|
556
|
+
* `announcements.pageChange` live-region phrasing, and the collapse target the
|
|
557
|
+
* responsive number row swaps to once the paginator's container narrows. Text
|
|
558
|
+
* comes from the config `pageStatus` formatter, so it localises with the rest of
|
|
559
|
+
* the cascade; tabular figures keep the numerals from reflowing as the page
|
|
560
|
+
* changes.
|
|
561
|
+
*
|
|
562
|
+
* @category ui/paginator
|
|
563
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/responsive-collapse</example-url>
|
|
564
|
+
*/
|
|
565
|
+
declare class CngxPaginatorStatus {
|
|
566
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
567
|
+
private readonly config;
|
|
568
|
+
/** Formatted "Page n of m" readout from the config formatter (1-based page). */
|
|
569
|
+
protected readonly text: i0.Signal<string>;
|
|
570
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorStatus, never>;
|
|
571
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorStatus, "cngx-pgn-status", ["cngxPgnStatus"], {}, {}, never, never, true, never>;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Progress-rail segment: a horizontal rail whose fill tracks the current page
|
|
576
|
+
* position, with an overlaid knob riding the fill edge. The track, fill, and
|
|
577
|
+
* `role="progressbar"` a11y are composed from the `CngxProgress` atom - not
|
|
578
|
+
* reinvented here (same precedent as the progress-bar stepper). The only new
|
|
579
|
+
* part is the position knob, a decorative (`aria-hidden`) dot positioned by an
|
|
580
|
+
* inline `inset-inline-start.%`, which `CngxProgress` cannot express. The fill
|
|
581
|
+
* percentage derives purely from the host `pageIndex()`/`totalPages()` signals -
|
|
582
|
+
* no local state, no writes.
|
|
583
|
+
*
|
|
584
|
+
* @category ui/paginator
|
|
585
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
|
|
586
|
+
*/
|
|
587
|
+
declare class CngxPaginatorRail {
|
|
588
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
589
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
590
|
+
/**
|
|
591
|
+
* Fill percentage (0-100) of the current page across the page span. A single
|
|
592
|
+
* page (or none) reads 0; the last page reads 100. Drives both the composed
|
|
593
|
+
* `cngx-progress` `[progress]` and the knob's inline position.
|
|
594
|
+
*/
|
|
595
|
+
protected readonly fillPercent: i0.Signal<number>;
|
|
596
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorRail, never>;
|
|
597
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorRail, "cngx-pgn-rail", ["cngxPgnRail"], {}, {}, never, never, true, never>;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Load-more segment: an append-don't-replace trigger over the same brain. One
|
|
602
|
+
* `host.next()` button plus a `shown / total` count readout. The cumulative
|
|
603
|
+
* slice is derived by the brain (`host.cumulativeRange()`); this segment holds
|
|
604
|
+
* no accumulation state - the consumer slices its own array from
|
|
605
|
+
* `cumulativeRange()`.
|
|
606
|
+
*
|
|
607
|
+
* Disabled (and so a no-op) on the last page or while busy. `aria-disabled`
|
|
608
|
+
* (not native `disabled`) keeps the button focusable so AT hears the bound
|
|
609
|
+
* state, matching the nav segments; the busy/position reason is already spoken
|
|
610
|
+
* by the shell live region.
|
|
611
|
+
*
|
|
612
|
+
* @category ui/paginator
|
|
613
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/load-more</example-url>
|
|
614
|
+
*/
|
|
615
|
+
declare class CngxPaginatorLoadMore {
|
|
616
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
617
|
+
private readonly config;
|
|
618
|
+
/**
|
|
619
|
+
* Accessible name from the config cascade. On the last page the actionable
|
|
620
|
+
* `Load more` name is replaced with the exhausted-state `allLoaded` label so
|
|
621
|
+
* AT does not announce an action on the disabled button.
|
|
622
|
+
*/
|
|
623
|
+
protected readonly ariaLabel: i0.Signal<string>;
|
|
624
|
+
/** Disabled on the last page or while busy - the trigger becomes a no-op. */
|
|
625
|
+
protected readonly disabled: i0.Signal<boolean>;
|
|
626
|
+
/**
|
|
627
|
+
* Items revealed so far. The brain's `cumulativeRange()` upper bound is
|
|
628
|
+
* uncapped (`(pageIndex + 1) * pageSize`), so a partial final page is clamped
|
|
629
|
+
* to `total` here for an honest readout.
|
|
630
|
+
*/
|
|
631
|
+
protected readonly shown: i0.Signal<number>;
|
|
632
|
+
/** Reveal the next page. Guarded so a disabled click is a no-op. */
|
|
633
|
+
protected handleClick(): void;
|
|
634
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorLoadMore, never>;
|
|
635
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorLoadMore, "cngx-pgn-load-more", ["cngxPgnLoadMore"], {}, {}, never, never, true, never>;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Infinite-scroll segment: a bottom-of-list sentinel that auto-advances the
|
|
640
|
+
* page as it scrolls into view, composing `CngxInfiniteScroll`. The in-template
|
|
641
|
+
* sentinel binds the directive's `[enabled]` / `[loading]` inputs and its
|
|
642
|
+
* `(loadMore)` output directly to the `CNGX_PAGINATOR_HOST` signals, so the
|
|
643
|
+
* directive's built-in debounce, busy-gate, enabled-disable, and auto-disconnect
|
|
644
|
+
* own the auto-advance double-fire guard - this segment adds no
|
|
645
|
+
* `IntersectionObserver` code of its own. The directive sits on the sentinel
|
|
646
|
+
* element (not as a `hostDirective`) precisely so its `[enabled]` / `[loading]`
|
|
647
|
+
* inputs can bind to the host-token signals; a static `hostDirectives`
|
|
648
|
+
* declaration could not express that wiring.
|
|
649
|
+
*
|
|
650
|
+
* Like `cngx-pgn-load-more`, this stays a thin trigger atom: it injects
|
|
651
|
+
* `CNGX_PAGINATOR_HOST`, holds no accumulation state, and renders no async view
|
|
652
|
+
* of its own. The consumer slices its own array from the brain's
|
|
653
|
+
* `cumulativeRange()`; the busy / error / end experience belongs to the consumer
|
|
654
|
+
* or to a composing container, keeping the segment reusable unchanged.
|
|
655
|
+
*
|
|
656
|
+
* Exhausted state: once `host.isLast()` the sentinel disables (`enabled` is
|
|
657
|
+
* `false`, so the observer disconnects). It swaps its busy affordance for the
|
|
658
|
+
* `allLoaded` end label only after the final load settles (`!host.isBusy()`),
|
|
659
|
+
* so it never claims "all loaded" while the last batch is still arriving, and
|
|
660
|
+
* the tail is never a silent or stale spinner.
|
|
661
|
+
*
|
|
662
|
+
* `[root]` / `[rootMargin]` forward straight to the composed directive so a
|
|
663
|
+
* consumer can point the sentinel at a bounded scroll container (a feed box)
|
|
664
|
+
* rather than the viewport, and tune the pre-fetch distance. They are plain
|
|
665
|
+
* passthrough config - the segment still owns no observer code and no state.
|
|
666
|
+
*
|
|
667
|
+
* @category ui/paginator
|
|
668
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/infinite</example-url>
|
|
669
|
+
*/
|
|
670
|
+
declare class CngxPaginatorInfinite {
|
|
671
|
+
protected readonly host: _cngx_ui_paginator.CngxPaginatorHost;
|
|
672
|
+
private readonly config;
|
|
673
|
+
/**
|
|
674
|
+
* CSS selector for the scroll container the sentinel is watched within.
|
|
675
|
+
* `null` (default) observes the viewport. Forwarded to `CngxInfiniteScroll`.
|
|
676
|
+
*/
|
|
677
|
+
readonly root: i0.InputSignal<string | null>;
|
|
678
|
+
/**
|
|
679
|
+
* Pre-fetch margin around the scroll container, forwarded to
|
|
680
|
+
* `CngxInfiniteScroll`. The directive default loads ~200px before the
|
|
681
|
+
* sentinel is visible.
|
|
682
|
+
*/
|
|
683
|
+
readonly rootMargin: i0.InputSignal<string>;
|
|
684
|
+
/**
|
|
685
|
+
* Exhausted: the last page is reached AND its load has settled. Gating on
|
|
686
|
+
* `!isBusy()` keeps the spinner up while the final batch is still loading, so
|
|
687
|
+
* the segment never claims "all loaded" before the last rows arrive.
|
|
688
|
+
*/
|
|
689
|
+
protected readonly isExhausted: i0.Signal<boolean>;
|
|
690
|
+
/**
|
|
691
|
+
* Exhausted-state label from the config cascade, reused from the load-more
|
|
692
|
+
* segment so both append modes speak the same "all N loaded" end state rather
|
|
693
|
+
* than leaving the tail implicit.
|
|
694
|
+
*/
|
|
695
|
+
protected readonly endLabel: i0.Signal<string>;
|
|
696
|
+
/** Status text shown beside the spinner while more pages remain. */
|
|
697
|
+
protected readonly busyLabel: i0.Signal<string>;
|
|
698
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorInfinite, never>;
|
|
699
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorInfinite, "cngx-pgn-infinite", ["cngxPgnInfinite"], { "root": { "alias": "root"; "required": false; "isSignal": true; }; "rootMargin": { "alias": "rootMargin"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* Alphabetical / category chips: a `role="group"` toggle strip over the
|
|
704
|
+
* {@link CngxBucketPaginate} range model. One `<button>` per bucket; the active
|
|
705
|
+
* bucket carries `aria-pressed`, an empty bucket is `disabled`. The model is
|
|
706
|
+
* injected through `CNGX_BUCKET_PAGINATE_HOST`, never the concrete directive
|
|
707
|
+
* class, so the strip stays decompose-ready.
|
|
708
|
+
*
|
|
709
|
+
* Every chip's pressed / disabled / name state is a `computed()` read of the
|
|
710
|
+
* host signals - nothing is synced. An empty chip is not a silent dead control:
|
|
711
|
+
* its accessible name comes from `ariaLabels.emptyBucket(label)`, which states
|
|
712
|
+
* the bucket has no items, so AT hears the reason the chip is disabled.
|
|
713
|
+
*
|
|
714
|
+
* Keyboard navigation reuses `CngxRovingTabindex` / `CngxRovingItem` (no new
|
|
715
|
+
* keyboard code, matching `cngx-pgn-pages`): arrows move the focus cursor and
|
|
716
|
+
* skip disabled chips, the single tab stop tracks the active bucket, and
|
|
717
|
+
* activation commits via `select()`.
|
|
718
|
+
*
|
|
719
|
+
* @category ui/paginator
|
|
720
|
+
* <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/alphabetical</example-url>
|
|
721
|
+
*/
|
|
722
|
+
declare class CngxPaginatorAlpha {
|
|
723
|
+
protected readonly host: i1.CngxBucketPaginateHost;
|
|
724
|
+
protected readonly config: _cngx_ui_paginator.CngxPaginatorConfig;
|
|
725
|
+
/**
|
|
726
|
+
* Roving focus cursor. A `linkedSignal` so the strip's single tab stop tracks
|
|
727
|
+
* the active bucket (Tab lands on the pressed chip) yet still moves freely
|
|
728
|
+
* under the arrow keys; when nothing is selected it falls back to the first
|
|
729
|
+
* non-empty chip so Tab never lands on a disabled control.
|
|
730
|
+
*/
|
|
731
|
+
protected readonly rovingIndex: i0.WritableSignal<number>;
|
|
732
|
+
protected isActive(label: string): boolean;
|
|
733
|
+
/**
|
|
734
|
+
* Accessible name: the available chip uses `ariaLabels.bucket`; an empty chip
|
|
735
|
+
* swaps to `ariaLabels.emptyBucket` so the disabled control states its reason.
|
|
736
|
+
*/
|
|
737
|
+
protected chipLabel(label: string): string;
|
|
738
|
+
protected select(label: string): void;
|
|
739
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CngxPaginatorAlpha, never>;
|
|
740
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CngxPaginatorAlpha, "cngx-pgn-alpha", ["cngxPgnAlpha"], {}, {}, never, never, true, never>;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Accessible-name strings for the paginator landmark and its segment parts.
|
|
745
|
+
* Library defaults are English; consumers localise via
|
|
746
|
+
* {@link withPaginatorAriaLabels}.
|
|
747
|
+
*
|
|
748
|
+
* @category ui/paginator
|
|
749
|
+
*/
|
|
750
|
+
interface CngxPaginatorAriaLabels {
|
|
751
|
+
/** Accessible name for the `role="navigation"` landmark. */
|
|
752
|
+
readonly label: string;
|
|
753
|
+
/** First-page button. */
|
|
754
|
+
readonly first: string;
|
|
755
|
+
/** Previous-page button. */
|
|
756
|
+
readonly previous: string;
|
|
757
|
+
/** Next-page button. */
|
|
758
|
+
readonly next: string;
|
|
759
|
+
/** Last-page button. */
|
|
760
|
+
readonly last: string;
|
|
761
|
+
/** A page button, given its 1-based display number. */
|
|
762
|
+
readonly page: (page: number) => string;
|
|
763
|
+
/** The ellipsis overflow trigger that reveals hidden pages. */
|
|
764
|
+
readonly morePages: string;
|
|
765
|
+
/** Page-size selector. */
|
|
766
|
+
readonly itemsPerPage: string;
|
|
767
|
+
/** Go-to-page input. */
|
|
768
|
+
readonly goToPage: string;
|
|
769
|
+
/** Page-of-pages selector (the `current / total` jump dropdown). */
|
|
770
|
+
readonly pageOfPages: string;
|
|
771
|
+
/** Load-more trigger while pages remain (the append-style "reveal next page" button). */
|
|
772
|
+
readonly loadMore: string;
|
|
773
|
+
/**
|
|
774
|
+
* Load-more trigger once every page is revealed, given the total item count.
|
|
775
|
+
* Replaces the actionable `loadMore` name on the exhausted (last-page) button
|
|
776
|
+
* so AT does not announce a "Load more" action on a disabled control.
|
|
777
|
+
*/
|
|
778
|
+
readonly allLoaded: (total: number) => string;
|
|
779
|
+
/** A category/range chip, given its bucket label (e.g. `'A-C'`). */
|
|
780
|
+
readonly bucket: (label: string) => string;
|
|
781
|
+
/**
|
|
782
|
+
* A category/range chip with no matching items, given its bucket label.
|
|
783
|
+
* Names the disabled chip AND states why it is disabled, so an empty bucket
|
|
784
|
+
* is not a silent dead control.
|
|
785
|
+
*/
|
|
786
|
+
readonly emptyBucket: (label: string) => string;
|
|
787
|
+
/** Accessible name for the category/range chip strip (`role="group"`). */
|
|
788
|
+
readonly bucketGroup: string;
|
|
789
|
+
/**
|
|
790
|
+
* Accessible name for the `rail` skin's progress rail. Becomes the composed
|
|
791
|
+
* `cngx-progress` `[label]`, so AT reads "Page position" with the progressbar
|
|
792
|
+
* value the atom exposes.
|
|
793
|
+
*/
|
|
794
|
+
readonly railPosition: string;
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Display-text formatters for the data-readout segments. Library defaults are
|
|
798
|
+
* English; consumers localise via {@link withPaginatorRangeFormat}.
|
|
799
|
+
*
|
|
800
|
+
* @category ui/paginator
|
|
801
|
+
*/
|
|
802
|
+
interface CngxPaginatorFormats {
|
|
803
|
+
/**
|
|
804
|
+
* Range-readout text, given the 1-based first item, last item, and total.
|
|
805
|
+
* The `cngx-pgn-range` segment renders the returned string as sanitised HTML,
|
|
806
|
+
* so inline emphasis (e.g. `<b>` around the current range) is honoured; the
|
|
807
|
+
* default bolds the range. Angular's sanitiser strips anything unsafe.
|
|
808
|
+
*/
|
|
809
|
+
readonly range: (start: number, end: number, total: number) => string;
|
|
810
|
+
/**
|
|
811
|
+
* Page-status text, given the 1-based current page and total page count.
|
|
812
|
+
* The `cngx-pgn-status` segment renders the returned string as sanitised HTML
|
|
813
|
+
* (the default bolds the page); it is the visible twin of the
|
|
814
|
+
* `announcements.pageChange` live-region phrasing, which stays plain text.
|
|
815
|
+
*/
|
|
816
|
+
readonly pageStatus: (page: number, totalPages: number) => string;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Live-region announcement phrasing. The paginator announces the effective page
|
|
820
|
+
* on every change (navigation or a `total`-shrink clamp, so the clamp is never
|
|
821
|
+
* silent) and the async busy / settle transitions. Library defaults are
|
|
822
|
+
* English; consumers localise via {@link withPaginatorAnnouncements}.
|
|
823
|
+
*
|
|
824
|
+
* @category ui/paginator
|
|
825
|
+
*/
|
|
826
|
+
interface CngxPaginatorAnnouncements {
|
|
827
|
+
/** Announced on every page change, given the 1-based page and total pages. */
|
|
828
|
+
readonly pageChange: (page: number, totalPages: number) => string;
|
|
829
|
+
/** Announced when the bound async state becomes busy. */
|
|
830
|
+
readonly loading: string;
|
|
831
|
+
/** Announced when the bound async state settles after being busy. */
|
|
832
|
+
readonly updated: string;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Application-wide template-slot defaults. The instance `*cngxPaginatorLoading`
|
|
836
|
+
* slot still wins over the cascade; this tier supplies a shared override when no
|
|
837
|
+
* per-instance slot is projected. Library default is unset (the built-in
|
|
838
|
+
* `CngxProgress` bar renders).
|
|
839
|
+
*
|
|
840
|
+
* @category ui/paginator
|
|
841
|
+
*/
|
|
842
|
+
interface CngxPaginatorTemplates {
|
|
843
|
+
/** Busy indicator shown while the bound async state is busy. */
|
|
844
|
+
readonly loading?: TemplateRef<unknown>;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Resolved paginator configuration. Three required sub-trees - accessible-name
|
|
848
|
+
* strings, live-region announcement phrasing, and data-readout formatters -
|
|
849
|
+
* plus an optional `templates` slot tree, each merged independently by the
|
|
850
|
+
* reducer in {@link provideCngxPaginatorConfig}.
|
|
851
|
+
*
|
|
852
|
+
* @category ui/paginator
|
|
853
|
+
*/
|
|
854
|
+
interface CngxPaginatorConfig {
|
|
855
|
+
readonly ariaLabels: CngxPaginatorAriaLabels;
|
|
856
|
+
readonly announcements: CngxPaginatorAnnouncements;
|
|
857
|
+
readonly formats: CngxPaginatorFormats;
|
|
858
|
+
readonly templates?: CngxPaginatorTemplates;
|
|
859
|
+
}
|
|
860
|
+
/** Library defaults - English. Override via {@link provideCngxPaginatorConfig}. */
|
|
861
|
+
declare const CNGX_PAGINATOR_DEFAULTS: CngxPaginatorConfig;
|
|
862
|
+
/**
|
|
863
|
+
* Configuration cascade token. Resolution priority (high to low):
|
|
864
|
+
* per-instance Input, then `provideCngxPaginatorConfig(...)` at the
|
|
865
|
+
* application root, then the library defaults.
|
|
866
|
+
*
|
|
867
|
+
* @category ui/paginator
|
|
868
|
+
*/
|
|
869
|
+
declare const CNGX_PAGINATOR_CONFIG: InjectionToken<CngxPaginatorConfig>;
|
|
870
|
+
/**
|
|
871
|
+
* A single configuration override produced by a `with*` feature factory.
|
|
872
|
+
* The reducer in {@link provideCngxPaginatorConfig} matches on `kind` and
|
|
873
|
+
* shallow-merges `payload` into the matching sub-tree.
|
|
874
|
+
*
|
|
875
|
+
* @category ui/paginator
|
|
876
|
+
*/
|
|
877
|
+
type CngxPaginatorConfigFeature = {
|
|
878
|
+
readonly kind: 'ariaLabels';
|
|
879
|
+
readonly payload: Partial<CngxPaginatorAriaLabels>;
|
|
880
|
+
} | {
|
|
881
|
+
readonly kind: 'announcements';
|
|
882
|
+
readonly payload: Partial<CngxPaginatorAnnouncements>;
|
|
883
|
+
} | {
|
|
884
|
+
readonly kind: 'formats';
|
|
885
|
+
readonly payload: Partial<CngxPaginatorFormats>;
|
|
886
|
+
} | {
|
|
887
|
+
readonly kind: 'templates';
|
|
888
|
+
readonly payload: Partial<CngxPaginatorTemplates>;
|
|
889
|
+
};
|
|
890
|
+
/**
|
|
891
|
+
* Override any subset of the paginator accessible-name strings. Per-instance
|
|
892
|
+
* `aria-label` bindings still win over the cascade for the landmark name.
|
|
893
|
+
*
|
|
894
|
+
* ```ts
|
|
895
|
+
* provideCngxPaginatorConfig(
|
|
896
|
+
* withPaginatorAriaLabels({ next: 'Nächste Seite', previous: 'Vorige Seite' }),
|
|
897
|
+
* );
|
|
898
|
+
* ```
|
|
899
|
+
*
|
|
900
|
+
* @category ui/paginator
|
|
901
|
+
*/
|
|
902
|
+
declare function withPaginatorAriaLabels(payload: Partial<CngxPaginatorAriaLabels>): CngxPaginatorConfigFeature;
|
|
903
|
+
/**
|
|
904
|
+
* Override any subset of the paginator live-region announcement phrasing.
|
|
905
|
+
*
|
|
906
|
+
* ```ts
|
|
907
|
+
* provideCngxPaginatorConfig(
|
|
908
|
+
* withPaginatorAnnouncements({
|
|
909
|
+
* pageChange: (page, total) => `Seite ${page} von ${total}`,
|
|
910
|
+
* loading: 'Wird geladen',
|
|
911
|
+
* updated: 'Aktualisiert',
|
|
912
|
+
* }),
|
|
913
|
+
* );
|
|
914
|
+
* ```
|
|
915
|
+
*
|
|
916
|
+
* @category ui/paginator
|
|
917
|
+
*/
|
|
918
|
+
declare function withPaginatorAnnouncements(payload: Partial<CngxPaginatorAnnouncements>): CngxPaginatorConfigFeature;
|
|
919
|
+
/**
|
|
920
|
+
* Override the range-readout format. The `cngx-pgn-range` segment renders the
|
|
921
|
+
* returned string verbatim, so this also localises the `of` connector.
|
|
922
|
+
*
|
|
923
|
+
* ```ts
|
|
924
|
+
* provideCngxPaginatorConfig(
|
|
925
|
+
* withPaginatorRangeFormat((start, end, total) => `${start}-${end} von ${total}`),
|
|
926
|
+
* );
|
|
927
|
+
* ```
|
|
928
|
+
*
|
|
929
|
+
* @category ui/paginator
|
|
930
|
+
*/
|
|
931
|
+
declare function withPaginatorRangeFormat(range: CngxPaginatorFormats['range']): CngxPaginatorConfigFeature;
|
|
932
|
+
/**
|
|
933
|
+
* Override the page-status format. The `cngx-pgn-status` segment renders the
|
|
934
|
+
* returned string verbatim, so this localises the "Page n of m" readout that
|
|
935
|
+
* the responsive collapse reveals.
|
|
936
|
+
*
|
|
937
|
+
* ```ts
|
|
938
|
+
* provideCngxPaginatorConfig(
|
|
939
|
+
* withPaginatorPageStatusFormat((page, totalPages) => `Seite ${page} von ${totalPages}`),
|
|
940
|
+
* );
|
|
941
|
+
* ```
|
|
942
|
+
*
|
|
943
|
+
* @category ui/paginator
|
|
944
|
+
*/
|
|
945
|
+
declare function withPaginatorPageStatusFormat(pageStatus: CngxPaginatorFormats['pageStatus']): CngxPaginatorConfigFeature;
|
|
946
|
+
/**
|
|
947
|
+
* Supply application-wide template-slot defaults for the paginator. The
|
|
948
|
+
* per-instance `*cngxPaginatorLoading` slot still wins over this tier; it only
|
|
949
|
+
* applies where no instance slot is projected.
|
|
950
|
+
*
|
|
951
|
+
* ```ts
|
|
952
|
+
* provideCngxPaginatorConfig(
|
|
953
|
+
* withPaginatorTemplates({ loading: myBrandedSpinnerTemplate }),
|
|
954
|
+
* );
|
|
955
|
+
* ```
|
|
956
|
+
*
|
|
957
|
+
* @category ui/paginator
|
|
958
|
+
*/
|
|
959
|
+
declare function withPaginatorTemplates(payload: Partial<CngxPaginatorTemplates>): CngxPaginatorConfigFeature;
|
|
960
|
+
/**
|
|
961
|
+
* Application-root configuration cascade for the paginator. Pass any
|
|
962
|
+
* combination of `with*` features in `bootstrapApplication`'s providers.
|
|
963
|
+
* Supplied features deep-merge with the library defaults, so consumers only
|
|
964
|
+
* declare the keys they want to override.
|
|
965
|
+
*
|
|
966
|
+
* @category ui/paginator
|
|
967
|
+
*/
|
|
968
|
+
declare function provideCngxPaginatorConfig(...features: CngxPaginatorConfigFeature[]): EnvironmentProviders;
|
|
969
|
+
/**
|
|
970
|
+
* Component-scoped paginator configuration override. Pass into a component's
|
|
971
|
+
* or directive's `viewProviders`; features merge on top of the parent config
|
|
972
|
+
* (an enclosing scope or the application root), so a region can re-phrase its
|
|
973
|
+
* announcements or labels without disturbing the rest of the app.
|
|
974
|
+
*
|
|
975
|
+
* @category ui/paginator
|
|
976
|
+
*/
|
|
977
|
+
declare function provideCngxPaginatorConfigAt(...features: CngxPaginatorConfigFeature[]): Provider[];
|
|
978
|
+
/**
|
|
979
|
+
* Convenience accessor for the paginator configuration. Runs in injection
|
|
980
|
+
* context; resolves through the cascade. Equivalent to
|
|
981
|
+
* `inject(CNGX_PAGINATOR_CONFIG)`.
|
|
982
|
+
*
|
|
983
|
+
* @category ui/paginator
|
|
984
|
+
*/
|
|
985
|
+
declare function injectPaginatorConfig(): CngxPaginatorConfig;
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Reactive announcement source for the paginator live region.
|
|
989
|
+
*
|
|
990
|
+
* @category ui/paginator
|
|
991
|
+
*/
|
|
992
|
+
interface CngxPaginatorAnnouncer {
|
|
993
|
+
/**
|
|
994
|
+
* The current message to render inside the `cngxLiveRegion` span. Changes
|
|
995
|
+
* (and only changes) are spoken by assistive technology.
|
|
996
|
+
*/
|
|
997
|
+
readonly message: Signal<string>;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Builds the paginator live-region message as a single derived signal - no
|
|
1001
|
+
* class logic baked into the shell, so the skin still ejects cleanly. The
|
|
1002
|
+
* message is a `linkedSignal` over `[pageIndex, totalPages, isBusy]` from
|
|
1003
|
+
* {@link CNGX_PAGINATOR_HOST}: it speaks "Page N of M" on every effective-page
|
|
1004
|
+
* change (navigation OR a `total`-shrink clamp, so the clamp is never silent),
|
|
1005
|
+
* "Loading" while busy, and "Updated" on the first settle after busy. Phrasing
|
|
1006
|
+
* comes from {@link injectPaginatorConfig}.
|
|
1007
|
+
*
|
|
1008
|
+
* The previous source value (held by `linkedSignal`) is what distinguishes a
|
|
1009
|
+
* settle from a steady state, so there is no signal write in an `effect` and no
|
|
1010
|
+
* imperative `previous` tracking. Identical consecutive messages dedupe through
|
|
1011
|
+
* the signal's value equality, so the live region never re-announces a no-op.
|
|
1012
|
+
*
|
|
1013
|
+
* Must run in an injection context (call as a field initialiser on the shell).
|
|
1014
|
+
*
|
|
1015
|
+
* @category ui/paginator
|
|
1016
|
+
*/
|
|
1017
|
+
declare function createPaginatorAnnouncer(): CngxPaginatorAnnouncer;
|
|
1018
|
+
/** The shape an override must match to swap the announcer derivation. */
|
|
1019
|
+
type CngxPaginatorAnnouncerFactory = () => CngxPaginatorAnnouncer;
|
|
1020
|
+
/**
|
|
1021
|
+
* Swap token for the live-region announcer derivation. The default resolves to
|
|
1022
|
+
* {@link createPaginatorAnnouncer}; the shell builds its announcer via
|
|
1023
|
+
* `inject(CNGX_PAGINATOR_ANNOUNCER_FACTORY)()` rather than calling the factory
|
|
1024
|
+
* directly. Override it to wrap the busy / settle / page-change derivation - a
|
|
1025
|
+
* telemetry tap, politeness escalation, or custom phrasing branch - without
|
|
1026
|
+
* forking the shell (mirrors `CNGX_COMMIT_ERROR_ANNOUNCER_FACTORY` in the
|
|
1027
|
+
* select family). The override runs in the shell's injection context, so it can
|
|
1028
|
+
* still `inject(CNGX_PAGINATOR_HOST)` / {@link injectPaginatorConfig}.
|
|
1029
|
+
*
|
|
1030
|
+
* @category ui/paginator
|
|
1031
|
+
*/
|
|
1032
|
+
declare const CNGX_PAGINATOR_ANNOUNCER_FACTORY: InjectionToken<CngxPaginatorAnnouncerFactory>;
|
|
1033
|
+
|
|
1034
|
+
export { CNGX_PAGINATOR_ANNOUNCER_FACTORY, CNGX_PAGINATOR_CONFIG, CNGX_PAGINATOR_DEFAULTS, CNGX_PAGINATOR_HOST, CNGX_PAGINATOR_PAGE_WINDOW_FACTORY, CngxPaginator, CngxPaginatorAlpha, CngxPaginatorDots, CngxPaginatorFirst, CngxPaginatorGoto, CngxPaginatorInfinite, CngxPaginatorLast, CngxPaginatorLoadMore, CngxPaginatorLoading, CngxPaginatorNext, CngxPaginatorPageOfPages, CngxPaginatorPageSize, CngxPaginatorPages, CngxPaginatorPrev, CngxPaginatorRail, CngxPaginatorRange, CngxPaginatorStatus, createPaginatorAnnouncer, createPaginatorPageWindow, injectPaginatorConfig, provideCngxPaginatorConfig, provideCngxPaginatorConfigAt, withPaginatorAnnouncements, withPaginatorAriaLabels, withPaginatorPageStatusFormat, withPaginatorRangeFormat, withPaginatorTemplates };
|
|
1035
|
+
export type { CngxPaginatorAnnouncements, CngxPaginatorAnnouncer, CngxPaginatorAnnouncerFactory, CngxPaginatorAriaLabels, CngxPaginatorConfig, CngxPaginatorConfigFeature, CngxPaginatorDensity, CngxPaginatorFormats, CngxPaginatorHost, CngxPaginatorPageWindowFactory, CngxPaginatorPageWindowFn, CngxPaginatorSkin, CngxPaginatorTemplates, PageItem, PageWindow };
|